]> git.sur5r.net Git - openldap/blob - configure
Experiment with busy loop protection...
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.372 2001/10/19 06:09:03 ando Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-rewrite        enable rewrite [no]"
48 ac_help="$ac_help
49   --enable-x-compile      enable cross compiling [no]"
50 ac_help="$ac_help
51   --with-cyrus-sasl       with Cyrus SASL support [auto]"
52 ac_help="$ac_help
53   --with-fetch            with fetch URL support [auto]"
54 ac_help="$ac_help
55   --with-kerberos         with Kerberos support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65 SLAPD (Standalone LDAP Daemon) Options:"
66 ac_help="$ac_help
67   --enable-slapd          enable building slapd [yes]"
68 ac_help="$ac_help
69     --enable-aci          enable per-object ACIs (experimental) [no]"
70 ac_help="$ac_help
71     --enable-cleartext    enable cleartext passwords [yes]"
72 ac_help="$ac_help
73     --enable-crypt        enable crypt(3) passwords [no]"
74 ac_help="$ac_help
75     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
76 ac_help="$ac_help
77     --enable-kpasswd      enable Kerberos password verification [no]"
78 ac_help="$ac_help
79     --enable-lmpasswd     enable LAN Manager passwords [no]"
80 ac_help="$ac_help
81     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
82 ac_help="$ac_help
83     --enable-modules      enable dynamic module support [no]"
84 ac_help="$ac_help
85     --enable-phonetic     enable phonetic/soundex [no]"
86 ac_help="$ac_help
87     --enable-rlookups     enable reverse lookups [no]"
88 ac_help="$ac_help
89     --enable-slp          enable SLPv2 support [no]"
90 ac_help="$ac_help
91     --enable-wrappers     enable tcp wrapper support [no]"
92 ac_help="$ac_help
93     --enable-bdb          enable Berkeley DB backend [no]"
94 ac_help="$ac_help
95     --with-bdb-module     module type [static]"
96 ac_help="$ac_help
97     --enable-dnssrv       enable dnssrv backend [no]"
98 ac_help="$ac_help
99     --with-dnssrv-module  module type [static]"
100 ac_help="$ac_help
101     --enable-ldap         enable ldap backend [no]"
102 ac_help="$ac_help
103     --with-ldap-module    module type [static]"
104 ac_help="$ac_help
105     --enable-ldbm         enable ldbm backend [yes]"
106 ac_help="$ac_help
107     --with-ldbm-api       with LDBM API [auto]"
108 ac_help="$ac_help
109     --with-ldbm-module    module type [static]"
110 ac_help="$ac_help
111     --with-ldbm-type      use LDBM type [auto]"
112 ac_help="$ac_help
113     --enable-meta         enable metadirectory backend [no]"
114 ac_help="$ac_help
115     --with-meta-module    module type [static]"
116 ac_help="$ac_help
117     --enable-monitor      enable monitor backend [no]"
118 ac_help="$ac_help
119     --with-monitor-module         module type [static]"
120 ac_help="$ac_help
121     --enable-passwd       enable passwd backend [no]"
122 ac_help="$ac_help
123     --with-passwd-module  module type [static]"
124 ac_help="$ac_help
125     --enable-perl         enable perl backend [no]"
126 ac_help="$ac_help
127     --with-perl-module    module type [static]"
128 ac_help="$ac_help
129     --enable-shell        enable shell backend [no]"
130 ac_help="$ac_help
131     --with-shell-module   module type [static]"
132 ac_help="$ac_help
133     --enable-sql          enable sql backend [no]"
134 ac_help="$ac_help
135     --with-sql-module     module type [static]"
136 ac_help="$ac_help
137     --enable-tcl          enable tcl backend [no]"
138 ac_help="$ac_help
139     --with-tcl-module     module type [static]"
140 ac_help="$ac_help
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145 Library Generation & Linking Options"
146 ac_help="$ac_help
147   --enable-static[=PKGS]  build static libraries [default=yes]"
148 ac_help="$ac_help
149   --enable-shared[=PKGS]  build shared libraries [default=yes]"
150 ac_help="$ac_help
151   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
152 ac_help="$ac_help
153   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
154 ac_help="$ac_help
155   --disable-libtool-lock  avoid locking (might break parallel builds)"
156
157 # Initialize some variables set by options.
158 # The variables have the same names as the options, with
159 # dashes changed to underlines.
160 build=NONE
161 cache_file=./config.cache
162 exec_prefix=NONE
163 host=NONE
164 no_create=
165 nonopt=NONE
166 no_recursion=
167 prefix=NONE
168 program_prefix=NONE
169 program_suffix=NONE
170 program_transform_name=s,x,x,
171 silent=
172 site=
173 srcdir=
174 target=NONE
175 verbose=
176 x_includes=NONE
177 x_libraries=NONE
178 bindir='${exec_prefix}/bin'
179 sbindir='${exec_prefix}/sbin'
180 libexecdir='${exec_prefix}/libexec'
181 datadir='${prefix}/share'
182 sysconfdir='${prefix}/etc'
183 sharedstatedir='${prefix}/com'
184 localstatedir='${prefix}/var'
185 libdir='${exec_prefix}/lib'
186 includedir='${prefix}/include'
187 oldincludedir='/usr/include'
188 infodir='${prefix}/info'
189 mandir='${prefix}/man'
190
191 # Initialize some other variables.
192 subdirs=
193 MFLAGS= MAKEFLAGS=
194 SHELL=${CONFIG_SHELL-/bin/sh}
195 # Maximum number of lines to put in a shell here document.
196 ac_max_here_lines=12
197
198 ac_prev=
199 for ac_option
200 do
201
202   # If the previous option needs an argument, assign it.
203   if test -n "$ac_prev"; then
204     eval "$ac_prev=\$ac_option"
205     ac_prev=
206     continue
207   fi
208
209   case "$ac_option" in
210   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
211   *) ac_optarg= ;;
212   esac
213
214   # Accept the important Cygnus configure options, so we can diagnose typos.
215
216   case "$ac_option" in
217
218   -bindir | --bindir | --bindi | --bind | --bin | --bi)
219     ac_prev=bindir ;;
220   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
221     bindir="$ac_optarg" ;;
222
223   -build | --build | --buil | --bui | --bu)
224     ac_prev=build ;;
225   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
226     build="$ac_optarg" ;;
227
228   -cache-file | --cache-file | --cache-fil | --cache-fi \
229   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
230     ac_prev=cache_file ;;
231   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
232   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
233     cache_file="$ac_optarg" ;;
234
235   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
236     ac_prev=datadir ;;
237   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
238   | --da=*)
239     datadir="$ac_optarg" ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
243     # Reject names that are not valid shell variable names.
244     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
245       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
246     fi
247     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
248     eval "enable_${ac_feature}=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
252     # Reject names that are not valid shell variable names.
253     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
254       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
255     fi
256     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
257     case "$ac_option" in
258       *=*) ;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_${ac_feature}='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix="$ac_optarg" ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he)
277     # Omit some internal or obsolete options to make the list less imposing.
278     # This message is too long to be a string in the A/UX 3.1 sh.
279     cat << EOF
280 Usage: configure [options] [host]
281 Options: [defaults in brackets after descriptions]
282 Configuration:
283   --cache-file=FILE       cache test results in FILE
284   --help                  print this message
285   --no-create             do not create output files
286   --quiet, --silent       do not print \`checking...' messages
287   --version               print the version of autoconf that created configure
288 Directory and file names:
289   --prefix=PREFIX         install architecture-independent files in PREFIX
290                           [$ac_default_prefix]
291   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
292                           [same as prefix]
293   --bindir=DIR            user executables in DIR [EPREFIX/bin]
294   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
295   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
296   --datadir=DIR           read-only architecture-independent data in DIR
297                           [PREFIX/share]
298   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
299   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
300                           [PREFIX/com]
301   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
302   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
303   --includedir=DIR        C header files in DIR [PREFIX/include]
304   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
305   --infodir=DIR           info documentation in DIR [PREFIX/info]
306   --mandir=DIR            man documentation in DIR [PREFIX/man]
307   --srcdir=DIR            find the sources in DIR [configure dir or ..]
308   --program-prefix=PREFIX prepend PREFIX to installed program names
309   --program-suffix=SUFFIX append SUFFIX to installed program names
310   --program-transform-name=PROGRAM
311                           run sed PROGRAM on installed program names
312 EOF
313     cat << EOF
314 Host type:
315   --build=BUILD           configure for building on BUILD [BUILD=HOST]
316   --host=HOST             configure for HOST [guessed]
317   --target=TARGET         configure for TARGET [TARGET=HOST]
318 Features and packages:
319   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
320   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
321   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
322   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
323   --x-includes=DIR        X include files are in DIR
324   --x-libraries=DIR       X library files are in DIR
325 EOF
326     if test -n "$ac_help"; then
327       echo "--enable and --with options recognized:$ac_help"
328     fi
329     exit 0 ;;
330
331   -host | --host | --hos | --ho)
332     ac_prev=host ;;
333   -host=* | --host=* | --hos=* | --ho=*)
334     host="$ac_optarg" ;;
335
336   -includedir | --includedir | --includedi | --included | --include \
337   | --includ | --inclu | --incl | --inc)
338     ac_prev=includedir ;;
339   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
340   | --includ=* | --inclu=* | --incl=* | --inc=*)
341     includedir="$ac_optarg" ;;
342
343   -infodir | --infodir | --infodi | --infod | --info | --inf)
344     ac_prev=infodir ;;
345   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
346     infodir="$ac_optarg" ;;
347
348   -libdir | --libdir | --libdi | --libd)
349     ac_prev=libdir ;;
350   -libdir=* | --libdir=* | --libdi=* | --libd=*)
351     libdir="$ac_optarg" ;;
352
353   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
354   | --libexe | --libex | --libe)
355     ac_prev=libexecdir ;;
356   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
357   | --libexe=* | --libex=* | --libe=*)
358     libexecdir="$ac_optarg" ;;
359
360   -localstatedir | --localstatedir | --localstatedi | --localstated \
361   | --localstate | --localstat | --localsta | --localst \
362   | --locals | --local | --loca | --loc | --lo)
363     ac_prev=localstatedir ;;
364   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
365   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
366   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
367     localstatedir="$ac_optarg" ;;
368
369   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
370     ac_prev=mandir ;;
371   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
372     mandir="$ac_optarg" ;;
373
374   -nfp | --nfp | --nf)
375     # Obsolete; use --without-fp.
376     with_fp=no ;;
377
378   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
379   | --no-cr | --no-c)
380     no_create=yes ;;
381
382   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
383   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
384     no_recursion=yes ;;
385
386   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
387   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
388   | --oldin | --oldi | --old | --ol | --o)
389     ac_prev=oldincludedir ;;
390   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
391   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
392   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
393     oldincludedir="$ac_optarg" ;;
394
395   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
396     ac_prev=prefix ;;
397   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
398     prefix="$ac_optarg" ;;
399
400   -program-prefix | --program-prefix | --program-prefi | --program-pref \
401   | --program-pre | --program-pr | --program-p)
402     ac_prev=program_prefix ;;
403   -program-prefix=* | --program-prefix=* | --program-prefi=* \
404   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
405     program_prefix="$ac_optarg" ;;
406
407   -program-suffix | --program-suffix | --program-suffi | --program-suff \
408   | --program-suf | --program-su | --program-s)
409     ac_prev=program_suffix ;;
410   -program-suffix=* | --program-suffix=* | --program-suffi=* \
411   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
412     program_suffix="$ac_optarg" ;;
413
414   -program-transform-name | --program-transform-name \
415   | --program-transform-nam | --program-transform-na \
416   | --program-transform-n | --program-transform- \
417   | --program-transform | --program-transfor \
418   | --program-transfo | --program-transf \
419   | --program-trans | --program-tran \
420   | --progr-tra | --program-tr | --program-t)
421     ac_prev=program_transform_name ;;
422   -program-transform-name=* | --program-transform-name=* \
423   | --program-transform-nam=* | --program-transform-na=* \
424   | --program-transform-n=* | --program-transform-=* \
425   | --program-transform=* | --program-transfor=* \
426   | --program-transfo=* | --program-transf=* \
427   | --program-trans=* | --program-tran=* \
428   | --progr-tra=* | --program-tr=* | --program-t=*)
429     program_transform_name="$ac_optarg" ;;
430
431   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
432   | -silent | --silent | --silen | --sile | --sil)
433     silent=yes ;;
434
435   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
436     ac_prev=sbindir ;;
437   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
438   | --sbi=* | --sb=*)
439     sbindir="$ac_optarg" ;;
440
441   -sharedstatedir | --sharedstatedir | --sharedstatedi \
442   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
443   | --sharedst | --shareds | --shared | --share | --shar \
444   | --sha | --sh)
445     ac_prev=sharedstatedir ;;
446   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
447   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
448   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
449   | --sha=* | --sh=*)
450     sharedstatedir="$ac_optarg" ;;
451
452   -site | --site | --sit)
453     ac_prev=site ;;
454   -site=* | --site=* | --sit=*)
455     site="$ac_optarg" ;;
456
457   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
458     ac_prev=srcdir ;;
459   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
460     srcdir="$ac_optarg" ;;
461
462   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
463   | --syscon | --sysco | --sysc | --sys | --sy)
464     ac_prev=sysconfdir ;;
465   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
466   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
467     sysconfdir="$ac_optarg" ;;
468
469   -target | --target | --targe | --targ | --tar | --ta | --t)
470     ac_prev=target ;;
471   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
472     target="$ac_optarg" ;;
473
474   -v | -verbose | --verbose | --verbos | --verbo | --verb)
475     verbose=yes ;;
476
477   -version | --version | --versio | --versi | --vers)
478     echo "configure generated by autoconf version 2.13.1"
479     exit 0 ;;
480
481   -with-* | --with-*)
482     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
483     # Reject names that are not valid shell variable names.
484     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
485       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
486     fi
487     ac_package=`echo $ac_package| sed 's/-/_/g'`
488     case "$ac_option" in
489       *=*) ;;
490       *) ac_optarg=yes ;;
491     esac
492     eval "with_${ac_package}='$ac_optarg'" ;;
493
494   -without-* | --without-*)
495     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
496     # Reject names that are not valid shell variable names.
497     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
498       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
499     fi
500     ac_package=`echo $ac_package| sed 's/-/_/g'`
501     eval "with_${ac_package}=no" ;;
502
503   --x)
504     # Obsolete; use --with-x.
505     with_x=yes ;;
506
507   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
508   | --x-incl | --x-inc | --x-in | --x-i)
509     ac_prev=x_includes ;;
510   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
511   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
512     x_includes="$ac_optarg" ;;
513
514   -x-libraries | --x-libraries | --x-librarie | --x-librari \
515   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
516     ac_prev=x_libraries ;;
517   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
518   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
519     x_libraries="$ac_optarg" ;;
520
521   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
522     ;;
523
524   *)
525     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
526       echo "configure: warning: $ac_option: invalid host type" 1>&2
527     fi
528     if test "x$nonopt" != xNONE; then
529       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
530     fi
531     nonopt="$ac_option"
532     ;;
533
534   esac
535 done
536
537 if test -n "$ac_prev"; then
538   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
539 fi
540
541 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
542
543 # File descriptor usage:
544 # 0 standard input
545 # 1 file creation
546 # 2 errors and warnings
547 # 3 some systems may open it to /dev/tty
548 # 4 used on the Kubota Titan
549 # 6 checking for... messages and results
550 # 5 compiler messages saved in config.log
551 if test "$silent" = yes; then
552   exec 6>/dev/null
553 else
554   exec 6>&1
555 fi
556 exec 5>./config.log
557
558 echo "\
559 This file contains any messages produced by compilers while
560 running configure, to aid debugging if configure makes a mistake.
561 " 1>&5
562
563 # Strip out --no-create and --no-recursion so they do not pile up.
564 # Also quote any args containing shell metacharacters.
565 ac_configure_args=
566 for ac_arg
567 do
568   case "$ac_arg" in
569   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
570   | --no-cr | --no-c) ;;
571   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
572   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
573   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
574   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
575   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
576   esac
577 done
578
579 # NLS nuisances.
580 # Only set these to C if already set.  These must not be set unconditionally
581 # because not all systems understand e.g. LANG=C (notably SCO).
582 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
583 # Non-C LC_CTYPE values break the ctype check.
584 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
585 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
586 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
587 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
588
589 # confdefs.h avoids OS command line length limits that DEFS can exceed.
590 rm -rf conftest* confdefs.h
591 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
592 echo > confdefs.h
593
594 # A filename unique to this package, relative to the directory that
595 # configure is in, which we can look for to find out if srcdir is correct.
596 ac_unique_file=build/version.sh
597
598 # Find the source files, if location was not specified.
599 if test -z "$srcdir"; then
600   ac_srcdir_defaulted=yes
601   # Try the directory containing this script, then its parent.
602   ac_prog=$0
603   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
604   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
605   srcdir=$ac_confdir
606   if test ! -r $srcdir/$ac_unique_file; then
607     srcdir=..
608   fi
609 else
610   ac_srcdir_defaulted=no
611 fi
612 if test ! -r $srcdir/$ac_unique_file; then
613   if test "$ac_srcdir_defaulted" = yes; then
614     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
615   else
616     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
617   fi
618 fi
619 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
620
621 # Prefer explicitly selected file to automatically selected ones.
622 if test -z "$CONFIG_SITE"; then
623   if test "x$prefix" != xNONE; then
624     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
625   else
626     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
627   fi
628 fi
629 for ac_site_file in $CONFIG_SITE; do
630   if test -r "$ac_site_file"; then
631     echo "loading site script $ac_site_file"
632     . "$ac_site_file"
633   fi
634 done
635
636
637 ac_ext=c
638 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
639 ac_cpp='$CPP $CPPFLAGS'
640 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
641 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
642 cross_compiling=$ac_cv_prog_cc_cross
643
644 ac_exeext=
645 ac_objext=o
646 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
647   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
648   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
649     ac_n= ac_c='
650 ' ac_t='        '
651   else
652     ac_n=-n ac_c= ac_t=
653   fi
654 else
655   ac_n= ac_c='\c' ac_t=
656 fi
657
658
659 # set unset (borrowed from autoconf 2.49c)
660 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
661   ol_unset=unset
662 else
663   ol_unset=false
664 fi
665 # unset CDPATH
666 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
667
668 ac_aux_dir=
669 for ac_dir in build $srcdir/build; do
670   if test -f $ac_dir/install-sh; then
671     ac_aux_dir=$ac_dir
672     ac_install_sh="$ac_aux_dir/install-sh -c"
673     break
674   elif test -f $ac_dir/install.sh; then
675     ac_aux_dir=$ac_dir
676     ac_install_sh="$ac_aux_dir/install.sh -c"
677     break
678   elif test -f $ac_dir/shtool; then
679     ac_aux_dir=$ac_dir
680     ac_install_sh="$ac_aux_dir/shtool install -c"
681     break
682   fi
683 done
684 if test -z "$ac_aux_dir"; then
685   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
686 fi
687 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
688 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
689 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
690
691 eval `$ac_aux_dir/version.sh`
692 if test -z "$OL_STRING"; then
693         { echo "configure: error: could not determine version" 1>&2; exit 1; }
694 fi
695
696 echo "Configuring $OL_STRING ..."
697
698
699 echo $ac_n "checking host system type""... $ac_c" 1>&6
700 echo "configure:701: checking host system type" >&5
701 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
702
703 # Make sure we can run config.sub.
704   if $ac_config_sub sun4 >/dev/null 2>&1; then :
705     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
706   fi
707
708   ac_cv_host_alias=$host
709   case "$ac_cv_host_alias" in
710   NONE)
711     case $nonopt in
712     NONE)
713       if ac_cv_host_alias=`$ac_config_guess`; then :
714       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
715       fi ;;
716     *) ac_cv_host_alias=$nonopt ;;
717     esac ;;
718   esac
719
720   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
721   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
722   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
723   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
724 else
725   echo $ac_n "(cached) $ac_c" 1>&6
726 fi
727
728 echo "$ac_t""$ac_cv_host" 1>&6
729
730 host=$ac_cv_host
731 host_alias=$ac_cv_host_alias
732 host_cpu=$ac_cv_host_cpu
733 host_vendor=$ac_cv_host_vendor
734 host_os=$ac_cv_host_os
735
736
737
738
739
740 echo $ac_n "checking target system type""... $ac_c" 1>&6
741 echo "configure:742: checking target system type" >&5
742 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
743
744 # Make sure we can run config.sub.
745   if $ac_config_sub sun4 >/dev/null 2>&1; then :
746     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
747   fi
748
749   ac_cv_target_alias=$target
750   case "$ac_cv_target_alias" in
751   NONE)
752     case $nonopt in
753     NONE)
754       ac_cv_target_alias=$host_alias ;;
755
756     *) ac_cv_target_alias=$nonopt ;;
757     esac ;;
758   esac
759
760   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
761   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
762   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
763   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
764 else
765   echo $ac_n "(cached) $ac_c" 1>&6
766 fi
767
768 echo "$ac_t""$ac_cv_target" 1>&6
769
770 target=$ac_cv_target
771 target_alias=$ac_cv_target_alias
772 target_cpu=$ac_cv_target_cpu
773 target_vendor=$ac_cv_target_vendor
774 target_os=$ac_cv_target_os
775
776
777
778
779
780 echo $ac_n "checking build system type""... $ac_c" 1>&6
781 echo "configure:782: checking build system type" >&5
782 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
783
784 # Make sure we can run config.sub.
785   if $ac_config_sub sun4 >/dev/null 2>&1; then :
786     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
787   fi
788
789   ac_cv_build_alias=$build
790   case "$ac_cv_build_alias" in
791   NONE)
792     case $nonopt in
793     NONE)
794       ac_cv_build_alias=$host_alias ;;
795
796     *) ac_cv_build_alias=$nonopt ;;
797     esac ;;
798   esac
799
800   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
801   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
802   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
803   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
804 else
805   echo $ac_n "(cached) $ac_c" 1>&6
806 fi
807
808 echo "$ac_t""$ac_cv_build" 1>&6
809
810 build=$ac_cv_build
811 build_alias=$ac_cv_build_alias
812 build_cpu=$ac_cv_build_cpu
813 build_vendor=$ac_cv_build_vendor
814 build_os=$ac_cv_build_os
815
816
817
818
819
820 # Do some error checking and defaulting for the host and target type.
821 # The inputs are:
822 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
823 #
824 # The rules are:
825 # 1. You are not allowed to specify --host, --target, and nonopt at the
826 #    same time.
827 # 2. Host defaults to nonopt.
828 # 3. If nonopt is not specified, then host defaults to the current host,
829 #    as determined by config.guess.
830 # 4. Target and build default to nonopt.
831 # 5. If nonopt is not specified, then target and build default to host.
832
833 # The aliases save the names the user supplied, while $host etc.
834 # will get canonicalized.
835 case $host---$target---$nonopt in
836 NONE---*---* | *---NONE---* | *---*---NONE) ;;
837 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
838 esac
839
840 test "$host_alias" != "$target_alias" &&
841   test "$program_prefix$program_suffix$program_transform_name" = \
842     NONENONEs,x,x, &&
843   program_prefix=${target_alias}-
844
845
846 # Find a good install program.  We prefer a C program (faster),
847 # so one script is as good as another.  But avoid the broken or
848 # incompatible versions:
849 # SysV /etc/install, /usr/sbin/install
850 # SunOS /usr/etc/install
851 # IRIX /sbin/install
852 # AIX /bin/install
853 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
854 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
855 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
856 # ./install, which can be erroneously created by make from ./install.sh.
857 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
858 echo "configure:859: checking for a BSD compatible install" >&5
859 if test -z "$INSTALL"; then
860 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
861   echo $ac_n "(cached) $ac_c" 1>&6
862 else
863     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
864   for ac_dir in $PATH; do
865     # Account for people who put trailing slashes in PATH elements.
866     case "$ac_dir/" in
867     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
868     *)
869       # OSF1 and SCO ODT 3.0 have their own names for install.
870       # Don't use installbsd from OSF since it installs stuff as root
871       # by default.
872       for ac_prog in ginstall scoinst install; do
873         if test -f $ac_dir/$ac_prog; then
874           if test $ac_prog = install &&
875             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
876             # AIX install.  It has an incompatible calling convention.
877             :
878           elif test $ac_prog = install &&
879             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
880             # program-specific install script used by HP pwplus--don't use.
881             :
882           else
883             ac_cv_path_install="$ac_dir/$ac_prog -c"
884             break 2
885           fi
886         fi
887       done
888       ;;
889     esac
890   done
891   IFS="$ac_save_IFS"
892
893 fi
894   if test "${ac_cv_path_install+set}" = set; then
895     INSTALL="$ac_cv_path_install"
896   else
897     # As a last resort, use the slow shell script.  We don't cache a
898     # path for INSTALL within a source directory, because that will
899     # break other packages using the cache if that directory is
900     # removed, or if the path is relative.
901     INSTALL="$ac_install_sh"
902   fi
903 fi
904 echo "$ac_t""$INSTALL" 1>&6
905
906 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
907 # It thinks the first close brace ends the variable substitution.
908 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
909
910 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
911
912 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
913
914 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
915 echo "configure:916: checking whether build environment is sane" >&5
916 # Just in case
917 sleep 1
918 echo timestamp > conftestfile
919 # Do `set' in a subshell so we don't clobber the current shell's
920 # arguments.  Must try -L first in case configure is actually a
921 # symlink; some systems play weird games with the mod time of symlinks
922 # (eg FreeBSD returns the mod time of the symlink's containing
923 # directory).
924 if (
925    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
926    if test "$*" = "X"; then
927       # -L didn't work.
928       set X `ls -t $srcdir/configure conftestfile`
929    fi
930    if test "$*" != "X $srcdir/configure conftestfile" \
931       && test "$*" != "X conftestfile $srcdir/configure"; then
932
933       # If neither matched, then we have a broken ls.  This can happen
934       # if, for instance, CONFIG_SHELL is bash and it inherits a
935       # broken ls alias from the environment.  This has actually
936       # happened.  Such a system could not be considered "sane".
937       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
938 alias in your environment" 1>&2; exit 1; }
939    fi
940
941    test "$2" = conftestfile
942    )
943 then
944    # Ok.
945    :
946 else
947    { echo "configure: error: newly created file is older than distributed files!
948 Check your system clock" 1>&2; exit 1; }
949 fi
950 rm -f conftest*
951 echo "$ac_t""yes" 1>&6
952 if test "$program_transform_name" = s,x,x,; then
953   program_transform_name=
954 else
955   # Double any \ or $.  echo might interpret backslashes.
956   cat <<\EOF_SED > conftestsed
957 s,\\,\\\\,g; s,\$,$$,g
958 EOF_SED
959   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
960   rm -f conftestsed
961 fi
962 test "$program_prefix" != NONE &&
963   program_transform_name="s,^,${program_prefix},;$program_transform_name"
964 # Use a double $ so make ignores it.
965 test "$program_suffix" != NONE &&
966   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
967
968 # sed with no file args requires a program.
969 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
970
971 for ac_prog in mawk gawk nawk awk
972 do
973 # Extract the first word of "$ac_prog", so it can be a program name with args.
974 set dummy $ac_prog; ac_word=$2
975 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
976 echo "configure:977: checking for $ac_word" >&5
977 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   if test -n "$AWK"; then
981   ac_cv_prog_AWK="$AWK" # Let the user override the test.
982 else
983   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
984   ac_dummy="$PATH"
985   for ac_dir in $ac_dummy; do
986     test -z "$ac_dir" && ac_dir=.
987     if test -f $ac_dir/$ac_word; then
988       ac_cv_prog_AWK="$ac_prog"
989       break
990     fi
991   done
992   IFS="$ac_save_ifs"
993 fi
994 fi
995 AWK="$ac_cv_prog_AWK"
996 if test -n "$AWK"; then
997   echo "$ac_t""$AWK" 1>&6
998 else
999   echo "$ac_t""no" 1>&6
1000 fi
1001
1002 test -n "$AWK" && break
1003 done
1004
1005 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether ${MAKE-make} sets \${MAKE}" >&5
1007 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1008 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1009   echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011   cat > conftestmake <<\EOF
1012 all:
1013         @echo 'ac_maketemp="${MAKE}"'
1014 EOF
1015 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1016 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1017 if test -n "$ac_maketemp"; then
1018   eval ac_cv_prog_make_${ac_make}_set=yes
1019 else
1020   eval ac_cv_prog_make_${ac_make}_set=no
1021 fi
1022 rm -f conftestmake
1023 fi
1024 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1025   echo "$ac_t""yes" 1>&6
1026   SET_MAKE=
1027 else
1028   echo "$ac_t""no" 1>&6
1029   SET_MAKE="MAKE=${MAKE-make}"
1030 fi
1031
1032
1033
1034 PACKAGE=$OL_PACKAGE
1035
1036 VERSION=$OL_VERSION
1037
1038 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1039   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1040 fi
1041
1042
1043
1044 missing_dir=`cd $ac_aux_dir && pwd`
1045 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working aclocal" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1051    ACLOCAL=aclocal
1052    echo "$ac_t""found" 1>&6
1053 else
1054    ACLOCAL="$missing_dir/missing aclocal"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoconf" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOCONF=autoconf
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOCONF="$missing_dir/missing autoconf"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working automake" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (automake --version) < /dev/null > /dev/null 2>&1; then
1077    AUTOMAKE=automake
1078    echo "$ac_t""found" 1>&6
1079 else
1080    AUTOMAKE="$missing_dir/missing automake"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1085 echo "configure:1086: checking for working autoheader" >&5
1086 # Run test in a subshell; some versions of sh will print an error if
1087 # an executable is not found, even if stderr is redirected.
1088 # Redirect stdin to placate older versions of autoconf.  Sigh.
1089 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1090    AUTOHEADER=autoheader
1091    echo "$ac_t""found" 1>&6
1092 else
1093    AUTOHEADER="$missing_dir/missing autoheader"
1094    echo "$ac_t""missing" 1>&6
1095 fi
1096
1097 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1098 echo "configure:1099: checking for working makeinfo" >&5
1099 # Run test in a subshell; some versions of sh will print an error if
1100 # an executable is not found, even if stderr is redirected.
1101 # Redirect stdin to placate older versions of autoconf.  Sigh.
1102 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1103    MAKEINFO=makeinfo
1104    echo "$ac_t""found" 1>&6
1105 else
1106    MAKEINFO="$missing_dir/missing makeinfo"
1107    echo "$ac_t""missing" 1>&6
1108 fi
1109
1110 install_sh="$missing_dir/install-sh"
1111 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1112
1113 for ac_prog in gnutar gtar tar
1114 do
1115 # Extract the first word of "$ac_prog", so it can be a program name with args.
1116 set dummy $ac_prog; ac_word=$2
1117 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1118 echo "configure:1119: checking for $ac_word" >&5
1119 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1120   echo $ac_n "(cached) $ac_c" 1>&6
1121 else
1122   if test -n "$AMTAR"; then
1123   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1124 else
1125   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1126   ac_dummy="$PATH"
1127   for ac_dir in $ac_dummy; do
1128     test -z "$ac_dir" && ac_dir=.
1129     if test -f $ac_dir/$ac_word; then
1130       ac_cv_prog_AMTAR="$ac_prog"
1131       break
1132     fi
1133   done
1134   IFS="$ac_save_ifs"
1135 fi
1136 fi
1137 AMTAR="$ac_cv_prog_AMTAR"
1138 if test -n "$AMTAR"; then
1139   echo "$ac_t""$AMTAR" 1>&6
1140 else
1141   echo "$ac_t""no" 1>&6
1142 fi
1143
1144 test -n "$AMTAR" && break
1145 done
1146
1147
1148 AMTARFLAGS=
1149 if test -n "$AMTAR"; then
1150   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1151         AMTARFLAGS=o
1152   fi
1153 fi
1154
1155 cat >> confdefs.h <<EOF
1156 #define OPENLDAP_PACKAGE "$PACKAGE"
1157 EOF
1158
1159 cat >> confdefs.h <<EOF
1160 #define OPENLDAP_VERSION "$VERSION"
1161 EOF
1162
1163
1164 cat >> confdefs.h <<EOF
1165 #define LDAP_VENDOR_VERSION $OL_API_INC
1166 EOF
1167
1168 cat >> confdefs.h <<EOF
1169 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1170 EOF
1171
1172 cat >> confdefs.h <<EOF
1173 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1174 EOF
1175
1176 cat >> confdefs.h <<EOF
1177 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1178 EOF
1179
1180
1181 OPENLDAP_LIBVERSION=$OL_API_LIB
1182
1183
1184
1185 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1186 echo "configure:1187: checking configure arguments" >&5
1187
1188
1189 top_builddir=`pwd`
1190
1191 ldap_subdir="/openldap"
1192
1193 # Check whether --with-subdir or --without-subdir was given.
1194 if test "${with_subdir+set}" = set; then
1195   withval="$with_subdir"
1196   case "$withval" in
1197         no) ldap_subdir=""
1198                 ;;
1199         yes)
1200                 ;;
1201         /*|\\*)
1202                 ldap_subdir="$withval"
1203                 ;;
1204         *)
1205                 ldap_subdir="/$withval"
1206                 ;;
1207 esac
1208
1209 fi
1210
1211
1212 # OpenLDAP --enable-debug
1213         # Check whether --enable-debug or --disable-debug was given.
1214 if test "${enable_debug+set}" = set; then
1215   enableval="$enable_debug"
1216   
1217         ol_arg=invalid
1218         for ol_val in auto yes no ; do
1219                 if test "$enableval" = "$ol_val" ; then
1220                         ol_arg="$ol_val"
1221                 fi
1222         done
1223         if test "$ol_arg" = "invalid" ; then
1224                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1225         fi
1226         ol_enable_debug="$ol_arg"
1227
1228 else
1229         ol_enable_debug="yes"
1230 fi
1231 # end --enable-debug
1232 # OpenLDAP --enable-syslog
1233         # Check whether --enable-syslog or --disable-syslog was given.
1234 if test "${enable_syslog+set}" = set; then
1235   enableval="$enable_syslog"
1236   
1237         ol_arg=invalid
1238         for ol_val in auto yes no ; do
1239                 if test "$enableval" = "$ol_val" ; then
1240                         ol_arg="$ol_val"
1241                 fi
1242         done
1243         if test "$ol_arg" = "invalid" ; then
1244                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1245         fi
1246         ol_enable_syslog="$ol_arg"
1247
1248 else
1249         ol_enable_syslog="auto"
1250 fi
1251 # end --enable-syslog
1252 # OpenLDAP --enable-proctitle
1253         # Check whether --enable-proctitle or --disable-proctitle was given.
1254 if test "${enable_proctitle+set}" = set; then
1255   enableval="$enable_proctitle"
1256   
1257         ol_arg=invalid
1258         for ol_val in auto yes no ; do
1259                 if test "$enableval" = "$ol_val" ; then
1260                         ol_arg="$ol_val"
1261                 fi
1262         done
1263         if test "$ol_arg" = "invalid" ; then
1264                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1265         fi
1266         ol_enable_proctitle="$ol_arg"
1267
1268 else
1269         ol_enable_proctitle="yes"
1270 fi
1271 # end --enable-proctitle
1272 # OpenLDAP --enable-cache
1273         # Check whether --enable-cache or --disable-cache was given.
1274 if test "${enable_cache+set}" = set; then
1275   enableval="$enable_cache"
1276   
1277         ol_arg=invalid
1278         for ol_val in auto yes no ; do
1279                 if test "$enableval" = "$ol_val" ; then
1280                         ol_arg="$ol_val"
1281                 fi
1282         done
1283         if test "$ol_arg" = "invalid" ; then
1284                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1285         fi
1286         ol_enable_cache="$ol_arg"
1287
1288 else
1289         ol_enable_cache="no"
1290 fi
1291 # end --enable-cache
1292 # OpenLDAP --enable-referrals
1293         # Check whether --enable-referrals or --disable-referrals was given.
1294 if test "${enable_referrals+set}" = set; then
1295   enableval="$enable_referrals"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1305         fi
1306         ol_enable_referrals="$ol_arg"
1307
1308 else
1309         ol_enable_referrals="no"
1310 fi
1311 # end --enable-referrals
1312 # OpenLDAP --enable-kbind
1313         # Check whether --enable-kbind or --disable-kbind was given.
1314 if test "${enable_kbind+set}" = set; then
1315   enableval="$enable_kbind"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1325         fi
1326         ol_enable_kbind="$ol_arg"
1327
1328 else
1329         ol_enable_kbind="no"
1330 fi
1331 # end --enable-kbind
1332 # OpenLDAP --enable-ipv6
1333         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1334 if test "${enable_ipv6+set}" = set; then
1335   enableval="$enable_ipv6"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto yes no ; do
1339                 if test "$enableval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1345         fi
1346         ol_enable_ipv6="$ol_arg"
1347
1348 else
1349         ol_enable_ipv6="auto"
1350 fi
1351 # end --enable-ipv6
1352 # OpenLDAP --enable-local
1353         # Check whether --enable-local or --disable-local was given.
1354 if test "${enable_local+set}" = set; then
1355   enableval="$enable_local"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no ; do
1359                 if test "$enableval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1365         fi
1366         ol_enable_local="$ol_arg"
1367
1368 else
1369         ol_enable_local="auto"
1370 fi
1371 # end --enable-local
1372 # OpenLDAP --enable-rewrite
1373         # Check whether --enable-rewrite or --disable-rewrite was given.
1374 if test "${enable_rewrite+set}" = set; then
1375   enableval="$enable_rewrite"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto yes no ; do
1379                 if test "$enableval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1385         fi
1386         ol_enable_rewrite="$ol_arg"
1387
1388 else
1389         ol_enable_rewrite="no"
1390 fi
1391 # end --enable-rewrite
1392 # OpenLDAP --enable-x_compile
1393         # Check whether --enable-x_compile or --disable-x_compile was given.
1394 if test "${enable_x_compile+set}" = set; then
1395   enableval="$enable_x_compile"
1396   
1397         ol_arg=invalid
1398         for ol_val in yes no ; do
1399                 if test "$enableval" = "$ol_val" ; then
1400                         ol_arg="$ol_val"
1401                 fi
1402         done
1403         if test "$ol_arg" = "invalid" ; then
1404                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1405         fi
1406         ol_enable_x_compile="$ol_arg"
1407
1408 else
1409         ol_enable_x_compile="no"
1410 fi
1411 # end --enable-x_compile
1412
1413
1414 # OpenLDAP --with-cyrus_sasl
1415         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1416 if test "${with_cyrus_sasl+set}" = set; then
1417   withval="$with_cyrus_sasl"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no  ; do
1421                 if test "$withval" = "$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 $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1427         fi
1428         ol_with_cyrus_sasl="$ol_arg"
1429
1430 else
1431         ol_with_cyrus_sasl="auto"
1432 fi
1433 # end --with-cyrus_sasl
1434
1435 # OpenLDAP --with-fetch
1436         # Check whether --with-fetch or --without-fetch was given.
1437 if test "${with_fetch+set}" = set; then
1438   withval="$with_fetch"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1448         fi
1449         ol_with_fetch="$ol_arg"
1450
1451 else
1452         ol_with_fetch="auto"
1453 fi
1454 # end --with-fetch
1455
1456 # OpenLDAP --with-kerberos
1457         # Check whether --with-kerberos or --without-kerberos was given.
1458 if test "${with_kerberos+set}" = set; then
1459   withval="$with_kerberos"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1469         fi
1470         ol_with_kerberos="$ol_arg"
1471
1472 else
1473         ol_with_kerberos="auto"
1474 fi
1475 # end --with-kerberos
1476
1477 # OpenLDAP --with-readline
1478         # Check whether --with-readline or --without-readline was given.
1479 if test "${with_readline+set}" = set; then
1480   withval="$with_readline"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no  ; do
1484                 if test "$withval" = "$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 $withval for --with-readline" 1>&2; exit 1; }
1490         fi
1491         ol_with_readline="$ol_arg"
1492
1493 else
1494         ol_with_readline="auto"
1495 fi
1496 # end --with-readline
1497
1498 # OpenLDAP --with-threads
1499         # Check whether --with-threads or --without-threads was given.
1500 if test "${with_threads+set}" = set; then
1501   withval="$with_threads"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1505                 if test "$withval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1511         fi
1512         ol_with_threads="$ol_arg"
1513
1514 else
1515         ol_with_threads="auto"
1516 fi
1517 # end --with-threads
1518
1519 # OpenLDAP --with-tls
1520         # Check whether --with-tls or --without-tls was given.
1521 if test "${with_tls+set}" = set; then
1522   withval="$with_tls"
1523   
1524         ol_arg=invalid
1525         for ol_val in auto ssleay openssl yes no  ; do
1526                 if test "$withval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1532         fi
1533         ol_with_tls="$ol_arg"
1534
1535 else
1536         ol_with_tls="auto"
1537 fi
1538 # end --with-tls
1539
1540 # OpenLDAP --with-yielding_select
1541         # Check whether --with-yielding_select or --without-yielding_select was given.
1542 if test "${with_yielding_select+set}" = set; then
1543   withval="$with_yielding_select"
1544   
1545         ol_arg=invalid
1546         for ol_val in auto yes no manual  ; do
1547                 if test "$withval" = "$ol_val" ; then
1548                         ol_arg="$ol_val"
1549                 fi
1550         done
1551         if test "$ol_arg" = "invalid" ; then
1552                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1553         fi
1554         ol_with_yielding_select="$ol_arg"
1555
1556 else
1557         ol_with_yielding_select="auto"
1558 fi
1559 # end --with-yielding_select
1560
1561
1562
1563 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1564 if test "${with_xxslapdoptions+set}" = set; then
1565   withval="$with_xxslapdoptions"
1566   :
1567 fi
1568
1569 # OpenLDAP --enable-slapd
1570         # Check whether --enable-slapd or --disable-slapd was given.
1571 if test "${enable_slapd+set}" = set; then
1572   enableval="$enable_slapd"
1573   
1574         ol_arg=invalid
1575         for ol_val in auto yes no ; do
1576                 if test "$enableval" = "$ol_val" ; then
1577                         ol_arg="$ol_val"
1578                 fi
1579         done
1580         if test "$ol_arg" = "invalid" ; then
1581                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1582         fi
1583         ol_enable_slapd="$ol_arg"
1584
1585 else
1586         ol_enable_slapd="yes"
1587 fi
1588 # end --enable-slapd
1589 # OpenLDAP --enable-aci
1590         # Check whether --enable-aci or --disable-aci was given.
1591 if test "${enable_aci+set}" = set; then
1592   enableval="$enable_aci"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no ; do
1596                 if test "$enableval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1602         fi
1603         ol_enable_aci="$ol_arg"
1604
1605 else
1606         ol_enable_aci="no"
1607 fi
1608 # end --enable-aci
1609 # OpenLDAP --enable-cleartext
1610         # Check whether --enable-cleartext or --disable-cleartext was given.
1611 if test "${enable_cleartext+set}" = set; then
1612   enableval="$enable_cleartext"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto yes no ; do
1616                 if test "$enableval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1622         fi
1623         ol_enable_cleartext="$ol_arg"
1624
1625 else
1626         ol_enable_cleartext="yes"
1627 fi
1628 # end --enable-cleartext
1629 # OpenLDAP --enable-crypt
1630         # Check whether --enable-crypt or --disable-crypt was given.
1631 if test "${enable_crypt+set}" = set; then
1632   enableval="$enable_crypt"
1633   
1634         ol_arg=invalid
1635         for ol_val in auto yes no ; do
1636                 if test "$enableval" = "$ol_val" ; then
1637                         ol_arg="$ol_val"
1638                 fi
1639         done
1640         if test "$ol_arg" = "invalid" ; then
1641                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1642         fi
1643         ol_enable_crypt="$ol_arg"
1644
1645 else
1646         ol_enable_crypt="no"
1647 fi
1648 # end --enable-crypt
1649 # OpenLDAP --enable-dynamic
1650         # Check whether --enable-dynamic or --disable-dynamic was given.
1651 if test "${enable_dynamic+set}" = set; then
1652   enableval="$enable_dynamic"
1653   
1654         ol_arg=invalid
1655         for ol_val in auto yes no ; do
1656                 if test "$enableval" = "$ol_val" ; then
1657                         ol_arg="$ol_val"
1658                 fi
1659         done
1660         if test "$ol_arg" = "invalid" ; then
1661                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1662         fi
1663         ol_enable_dynamic="$ol_arg"
1664
1665 else
1666         ol_enable_dynamic="no"
1667 fi
1668 # end --enable-dynamic
1669 # OpenLDAP --enable-kpasswd
1670         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1671 if test "${enable_kpasswd+set}" = set; then
1672   enableval="$enable_kpasswd"
1673   
1674         ol_arg=invalid
1675         for ol_val in auto yes no ; do
1676                 if test "$enableval" = "$ol_val" ; then
1677                         ol_arg="$ol_val"
1678                 fi
1679         done
1680         if test "$ol_arg" = "invalid" ; then
1681                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1682         fi
1683         ol_enable_kpasswd="$ol_arg"
1684
1685 else
1686         ol_enable_kpasswd="no"
1687 fi
1688 # end --enable-kpasswd
1689 # OpenLDAP --enable-lmpasswd
1690         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1691 if test "${enable_lmpasswd+set}" = set; then
1692   enableval="$enable_lmpasswd"
1693   
1694         ol_arg=invalid
1695         for ol_val in auto yes no ; do
1696                 if test "$enableval" = "$ol_val" ; then
1697                         ol_arg="$ol_val"
1698                 fi
1699         done
1700         if test "$ol_arg" = "invalid" ; then
1701                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1702         fi
1703         ol_enable_lmpasswd="$ol_arg"
1704
1705 else
1706         ol_enable_lmpasswd="no"
1707 fi
1708 # end --enable-lmpasswd
1709 # OpenLDAP --enable-spasswd
1710         # Check whether --enable-spasswd or --disable-spasswd was given.
1711 if test "${enable_spasswd+set}" = set; then
1712   enableval="$enable_spasswd"
1713   
1714         ol_arg=invalid
1715         for ol_val in auto yes no ; do
1716                 if test "$enableval" = "$ol_val" ; then
1717                         ol_arg="$ol_val"
1718                 fi
1719         done
1720         if test "$ol_arg" = "invalid" ; then
1721                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1722         fi
1723         ol_enable_spasswd="$ol_arg"
1724
1725 else
1726         ol_enable_spasswd="no"
1727 fi
1728 # end --enable-spasswd
1729 # OpenLDAP --enable-modules
1730         # Check whether --enable-modules or --disable-modules was given.
1731 if test "${enable_modules+set}" = set; then
1732   enableval="$enable_modules"
1733   
1734         ol_arg=invalid
1735         for ol_val in auto yes no ; do
1736                 if test "$enableval" = "$ol_val" ; then
1737                         ol_arg="$ol_val"
1738                 fi
1739         done
1740         if test "$ol_arg" = "invalid" ; then
1741                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1742         fi
1743         ol_enable_modules="$ol_arg"
1744
1745 else
1746         ol_enable_modules="no"
1747 fi
1748 # end --enable-modules
1749 # OpenLDAP --enable-phonetic
1750         # Check whether --enable-phonetic or --disable-phonetic was given.
1751 if test "${enable_phonetic+set}" = set; then
1752   enableval="$enable_phonetic"
1753   
1754         ol_arg=invalid
1755         for ol_val in auto yes no ; do
1756                 if test "$enableval" = "$ol_val" ; then
1757                         ol_arg="$ol_val"
1758                 fi
1759         done
1760         if test "$ol_arg" = "invalid" ; then
1761                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1762         fi
1763         ol_enable_phonetic="$ol_arg"
1764
1765 else
1766         ol_enable_phonetic="no"
1767 fi
1768 # end --enable-phonetic
1769 # OpenLDAP --enable-rlookups
1770         # Check whether --enable-rlookups or --disable-rlookups was given.
1771 if test "${enable_rlookups+set}" = set; then
1772   enableval="$enable_rlookups"
1773   
1774         ol_arg=invalid
1775         for ol_val in auto yes no ; do
1776                 if test "$enableval" = "$ol_val" ; then
1777                         ol_arg="$ol_val"
1778                 fi
1779         done
1780         if test "$ol_arg" = "invalid" ; then
1781                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1782         fi
1783         ol_enable_rlookups="$ol_arg"
1784
1785 else
1786         ol_enable_rlookups="no"
1787 fi
1788 # end --enable-rlookups
1789 # OpenLDAP --enable-slp
1790         # Check whether --enable-slp or --disable-slp was given.
1791 if test "${enable_slp+set}" = set; then
1792   enableval="$enable_slp"
1793   
1794         ol_arg=invalid
1795         for ol_val in auto yes no ; do
1796                 if test "$enableval" = "$ol_val" ; then
1797                         ol_arg="$ol_val"
1798                 fi
1799         done
1800         if test "$ol_arg" = "invalid" ; then
1801                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1802         fi
1803         ol_enable_slp="$ol_arg"
1804
1805 else
1806         ol_enable_slp="no"
1807 fi
1808 # end --enable-slp
1809 # OpenLDAP --enable-wrappers
1810         # Check whether --enable-wrappers or --disable-wrappers was given.
1811 if test "${enable_wrappers+set}" = set; then
1812   enableval="$enable_wrappers"
1813   
1814         ol_arg=invalid
1815         for ol_val in auto yes no ; do
1816                 if test "$enableval" = "$ol_val" ; then
1817                         ol_arg="$ol_val"
1818                 fi
1819         done
1820         if test "$ol_arg" = "invalid" ; then
1821                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1822         fi
1823         ol_enable_wrappers="$ol_arg"
1824
1825 else
1826         ol_enable_wrappers="no"
1827 fi
1828 # end --enable-wrappers
1829
1830 # OpenLDAP --enable-bdb
1831         # Check whether --enable-bdb or --disable-bdb was given.
1832 if test "${enable_bdb+set}" = set; then
1833   enableval="$enable_bdb"
1834   
1835         ol_arg=invalid
1836         for ol_val in auto yes no ; do
1837                 if test "$enableval" = "$ol_val" ; then
1838                         ol_arg="$ol_val"
1839                 fi
1840         done
1841         if test "$ol_arg" = "invalid" ; then
1842                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1843         fi
1844         ol_enable_bdb="$ol_arg"
1845
1846 else
1847         ol_enable_bdb="no"
1848 fi
1849 # end --enable-bdb
1850 # OpenLDAP --with-bdb_module
1851         # Check whether --with-bdb_module or --without-bdb_module was given.
1852 if test "${with_bdb_module+set}" = set; then
1853   withval="$with_bdb_module"
1854   
1855         ol_arg=invalid
1856         for ol_val in static dynamic ; do
1857                 if test "$withval" = "$ol_val" ; then
1858                         ol_arg="$ol_val"
1859                 fi
1860         done
1861         if test "$ol_arg" = "invalid" ; then
1862                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1863         fi
1864         ol_with_bdb_module="$ol_arg"
1865
1866 else
1867         ol_with_bdb_module="static"
1868 fi
1869 # end --with-bdb_module
1870
1871 # OpenLDAP --enable-dnssrv
1872         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1873 if test "${enable_dnssrv+set}" = set; then
1874   enableval="$enable_dnssrv"
1875   
1876         ol_arg=invalid
1877         for ol_val in auto yes no ; do
1878                 if test "$enableval" = "$ol_val" ; then
1879                         ol_arg="$ol_val"
1880                 fi
1881         done
1882         if test "$ol_arg" = "invalid" ; then
1883                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1884         fi
1885         ol_enable_dnssrv="$ol_arg"
1886
1887 else
1888         ol_enable_dnssrv="no"
1889 fi
1890 # end --enable-dnssrv
1891 # OpenLDAP --with-dnssrv_module
1892         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1893 if test "${with_dnssrv_module+set}" = set; then
1894   withval="$with_dnssrv_module"
1895   
1896         ol_arg=invalid
1897         for ol_val in static dynamic ; do
1898                 if test "$withval" = "$ol_val" ; then
1899                         ol_arg="$ol_val"
1900                 fi
1901         done
1902         if test "$ol_arg" = "invalid" ; then
1903                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1904         fi
1905         ol_with_dnssrv_module="$ol_arg"
1906
1907 else
1908         ol_with_dnssrv_module="static"
1909 fi
1910 # end --with-dnssrv_module
1911
1912 # OpenLDAP --enable-ldap
1913         # Check whether --enable-ldap or --disable-ldap was given.
1914 if test "${enable_ldap+set}" = set; then
1915   enableval="$enable_ldap"
1916   
1917         ol_arg=invalid
1918         for ol_val in auto yes no ; do
1919                 if test "$enableval" = "$ol_val" ; then
1920                         ol_arg="$ol_val"
1921                 fi
1922         done
1923         if test "$ol_arg" = "invalid" ; then
1924                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1925         fi
1926         ol_enable_ldap="$ol_arg"
1927
1928 else
1929         ol_enable_ldap="no"
1930 fi
1931 # end --enable-ldap
1932 # OpenLDAP --with-ldap_module
1933         # Check whether --with-ldap_module or --without-ldap_module was given.
1934 if test "${with_ldap_module+set}" = set; then
1935   withval="$with_ldap_module"
1936   
1937         ol_arg=invalid
1938         for ol_val in static dynamic ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1945         fi
1946         ol_with_ldap_module="$ol_arg"
1947
1948 else
1949         ol_with_ldap_module="static"
1950 fi
1951 # end --with-ldap_module
1952
1953 # OpenLDAP --enable-ldbm
1954         # Check whether --enable-ldbm or --disable-ldbm was given.
1955 if test "${enable_ldbm+set}" = set; then
1956   enableval="$enable_ldbm"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1966         fi
1967         ol_enable_ldbm="$ol_arg"
1968
1969 else
1970         ol_enable_ldbm="yes"
1971 fi
1972 # end --enable-ldbm
1973 # OpenLDAP --with-ldbm_api
1974         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1975 if test "${with_ldbm_api+set}" = set; then
1976   withval="$with_ldbm_api"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1986         fi
1987         ol_with_ldbm_api="$ol_arg"
1988
1989 else
1990         ol_with_ldbm_api="auto"
1991 fi
1992 # end --with-ldbm_api
1993
1994 # OpenLDAP --with-ldbm_module
1995         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1996 if test "${with_ldbm_module+set}" = set; then
1997   withval="$with_ldbm_module"
1998   
1999         ol_arg=invalid
2000         for ol_val in static dynamic ; do
2001                 if test "$withval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2007         fi
2008         ol_with_ldbm_module="$ol_arg"
2009
2010 else
2011         ol_with_ldbm_module="static"
2012 fi
2013 # end --with-ldbm_module
2014
2015 # OpenLDAP --with-ldbm_type
2016         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2017 if test "${with_ldbm_type+set}" = set; then
2018   withval="$with_ldbm_type"
2019   
2020         ol_arg=invalid
2021         for ol_val in auto btree hash ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2028         fi
2029         ol_with_ldbm_type="$ol_arg"
2030
2031 else
2032         ol_with_ldbm_type="auto"
2033 fi
2034 # end --with-ldbm_type
2035
2036 # OpenLDAP --enable-meta
2037         # Check whether --enable-meta or --disable-meta was given.
2038 if test "${enable_meta+set}" = set; then
2039   enableval="$enable_meta"
2040   
2041         ol_arg=invalid
2042         for ol_val in auto yes no ; do
2043                 if test "$enableval" = "$ol_val" ; then
2044                         ol_arg="$ol_val"
2045                 fi
2046         done
2047         if test "$ol_arg" = "invalid" ; then
2048                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2049         fi
2050         ol_enable_meta="$ol_arg"
2051
2052 else
2053         ol_enable_meta="no"
2054 fi
2055 # end --enable-meta
2056 # OpenLDAP --with-meta_module
2057         # Check whether --with-meta_module or --without-meta_module was given.
2058 if test "${with_meta_module+set}" = set; then
2059   withval="$with_meta_module"
2060   
2061         ol_arg=invalid
2062         for ol_val in static dynamic ; do
2063                 if test "$withval" = "$ol_val" ; then
2064                         ol_arg="$ol_val"
2065                 fi
2066         done
2067         if test "$ol_arg" = "invalid" ; then
2068                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2069         fi
2070         ol_with_meta_module="$ol_arg"
2071
2072 else
2073         ol_with_meta_module="static"
2074 fi
2075 # end --with-meta_module
2076
2077 # OpenLDAP --enable-monitor
2078         # Check whether --enable-monitor or --disable-monitor was given.
2079 if test "${enable_monitor+set}" = set; then
2080   enableval="$enable_monitor"
2081   
2082         ol_arg=invalid
2083         for ol_val in auto yes no ; do
2084                 if test "$enableval" = "$ol_val" ; then
2085                         ol_arg="$ol_val"
2086                 fi
2087         done
2088         if test "$ol_arg" = "invalid" ; then
2089                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2090         fi
2091         ol_enable_monitor="$ol_arg"
2092
2093 else
2094         ol_enable_monitor="no"
2095 fi
2096 # end --enable-monitor
2097 # OpenLDAP --with-monitor_module
2098         # Check whether --with-monitor_module or --without-monitor_module was given.
2099 if test "${with_monitor_module+set}" = set; then
2100   withval="$with_monitor_module"
2101   
2102         ol_arg=invalid
2103         for ol_val in static dynamic ; do
2104                 if test "$withval" = "$ol_val" ; then
2105                         ol_arg="$ol_val"
2106                 fi
2107         done
2108         if test "$ol_arg" = "invalid" ; then
2109                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2110         fi
2111         ol_with_monitor_module="$ol_arg"
2112
2113 else
2114         ol_with_monitor_module="static"
2115 fi
2116 # end --with-monitor_module
2117
2118 # OpenLDAP --enable-passwd
2119         # Check whether --enable-passwd or --disable-passwd was given.
2120 if test "${enable_passwd+set}" = set; then
2121   enableval="$enable_passwd"
2122   
2123         ol_arg=invalid
2124         for ol_val in auto yes no ; do
2125                 if test "$enableval" = "$ol_val" ; then
2126                         ol_arg="$ol_val"
2127                 fi
2128         done
2129         if test "$ol_arg" = "invalid" ; then
2130                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2131         fi
2132         ol_enable_passwd="$ol_arg"
2133
2134 else
2135         ol_enable_passwd="no"
2136 fi
2137 # end --enable-passwd
2138 # OpenLDAP --with-passwd_module
2139         # Check whether --with-passwd_module or --without-passwd_module was given.
2140 if test "${with_passwd_module+set}" = set; then
2141   withval="$with_passwd_module"
2142   
2143         ol_arg=invalid
2144         for ol_val in static dynamic ; do
2145                 if test "$withval" = "$ol_val" ; then
2146                         ol_arg="$ol_val"
2147                 fi
2148         done
2149         if test "$ol_arg" = "invalid" ; then
2150                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2151         fi
2152         ol_with_passwd_module="$ol_arg"
2153
2154 else
2155         ol_with_passwd_module="static"
2156 fi
2157 # end --with-passwd_module
2158
2159 # OpenLDAP --enable-perl
2160         # Check whether --enable-perl or --disable-perl was given.
2161 if test "${enable_perl+set}" = set; then
2162   enableval="$enable_perl"
2163   
2164         ol_arg=invalid
2165         for ol_val in auto yes no ; do
2166                 if test "$enableval" = "$ol_val" ; then
2167                         ol_arg="$ol_val"
2168                 fi
2169         done
2170         if test "$ol_arg" = "invalid" ; then
2171                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2172         fi
2173         ol_enable_perl="$ol_arg"
2174
2175 else
2176         ol_enable_perl="no"
2177 fi
2178 # end --enable-perl
2179 # OpenLDAP --with-perl_module
2180         # Check whether --with-perl_module or --without-perl_module was given.
2181 if test "${with_perl_module+set}" = set; then
2182   withval="$with_perl_module"
2183   
2184         ol_arg=invalid
2185         for ol_val in static dynamic ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2192         fi
2193         ol_with_perl_module="$ol_arg"
2194
2195 else
2196         ol_with_perl_module="static"
2197 fi
2198 # end --with-perl_module
2199
2200 # OpenLDAP --enable-shell
2201         # Check whether --enable-shell or --disable-shell was given.
2202 if test "${enable_shell+set}" = set; then
2203   enableval="$enable_shell"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2213         fi
2214         ol_enable_shell="$ol_arg"
2215
2216 else
2217         ol_enable_shell="no"
2218 fi
2219 # end --enable-shell
2220 # OpenLDAP --with-shell_module
2221         # Check whether --with-shell_module or --without-shell_module was given.
2222 if test "${with_shell_module+set}" = set; then
2223   withval="$with_shell_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_shell_module="$ol_arg"
2235
2236 else
2237         ol_with_shell_module="static"
2238 fi
2239 # end --with-shell_module
2240
2241 # OpenLDAP --enable-sql
2242         # Check whether --enable-sql or --disable-sql was given.
2243 if test "${enable_sql+set}" = set; then
2244   enableval="$enable_sql"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2254         fi
2255         ol_enable_sql="$ol_arg"
2256
2257 else
2258         ol_enable_sql="no"
2259 fi
2260 # end --enable-sql
2261 # OpenLDAP --with-sql_module
2262         # Check whether --with-sql_module or --without-sql_module was given.
2263 if test "${with_sql_module+set}" = set; then
2264   withval="$with_sql_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_sql_module="$ol_arg"
2276
2277 else
2278         ol_with_sql_module="static"
2279 fi
2280 # end --with-sql_module
2281
2282 # OpenLDAP --enable-tcl
2283         # Check whether --enable-tcl or --disable-tcl was given.
2284 if test "${enable_tcl+set}" = set; then
2285   enableval="$enable_tcl"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2295         fi
2296         ol_enable_tcl="$ol_arg"
2297
2298 else
2299         ol_enable_tcl="no"
2300 fi
2301 # end --enable-tcl
2302 # OpenLDAP --with-tcl_module
2303         # Check whether --with-tcl_module or --without-tcl_module was given.
2304 if test "${with_tcl_module+set}" = set; then
2305   withval="$with_tcl_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_tcl_module="$ol_arg"
2317
2318 else
2319         ol_with_tcl_module="static"
2320 fi
2321 # end --with-tcl_module
2322
2323
2324 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2325 if test "${with_xxslurpdoptions+set}" = set; then
2326   withval="$with_xxslurpdoptions"
2327   :
2328 fi
2329
2330 # OpenLDAP --enable-slurpd
2331         # Check whether --enable-slurpd or --disable-slurpd was given.
2332 if test "${enable_slurpd+set}" = set; then
2333   enableval="$enable_slurpd"
2334   
2335         ol_arg=invalid
2336         for ol_val in auto yes no ; do
2337                 if test "$enableval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2343         fi
2344         ol_enable_slurpd="$ol_arg"
2345
2346 else
2347         ol_enable_slurpd="auto"
2348 fi
2349 # end --enable-slurpd
2350
2351 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2352 if test "${with_xxliboptions+set}" = set; then
2353   withval="$with_xxliboptions"
2354   :
2355 fi
2356
2357 # Check whether --enable-static or --disable-static was given.
2358 if test "${enable_static+set}" = set; then
2359   enableval="$enable_static"
2360   p=${PACKAGE-default}
2361 case "$enableval" in
2362 yes) enable_static=yes ;;
2363 no) enable_static=no ;;
2364 *)
2365   enable_static=no
2366   # Look at the argument we got.  We use all the common list separators.
2367   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2368   for pkg in $enableval; do
2369     if test "X$pkg" = "X$p"; then
2370       enable_static=yes
2371     fi
2372   done
2373   IFS="$ac_save_ifs"
2374   ;;
2375 esac
2376 else
2377   enable_static=yes
2378 fi
2379
2380 # Check whether --enable-shared or --disable-shared was given.
2381 if test "${enable_shared+set}" = set; then
2382   enableval="$enable_shared"
2383   p=${PACKAGE-default}
2384 case "$enableval" in
2385 yes) enable_shared=yes ;;
2386 no) enable_shared=no ;;
2387 *)
2388   enable_shared=no
2389   # Look at the argument we got.  We use all the common list separators.
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2391   for pkg in $enableval; do
2392     if test "X$pkg" = "X$p"; then
2393       enable_shared=yes
2394     fi
2395   done
2396   IFS="$ac_save_ifs"
2397   ;;
2398 esac
2399 else
2400   enable_shared=yes
2401 fi
2402
2403
2404
2405 # validate options
2406 if test $ol_enable_slapd = no ; then
2407                 if test $ol_enable_bdb = yes ; then
2408                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2409         fi
2410         if test $ol_enable_dnssrv = yes ; then
2411                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2412         fi
2413         if test $ol_enable_ldap = yes ; then
2414                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2415         fi
2416         if test $ol_enable_ldbm = yes ; then
2417                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2418         fi
2419         if test $ol_enable_meta = yes ; then
2420                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2421         fi
2422         if test $ol_enable_monitor = yes ; then
2423                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2424         fi
2425         if test $ol_enable_passwd = yes ; then
2426                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2427         fi
2428         if test $ol_enable_perl = yes ; then
2429                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2430         fi
2431         if test $ol_enable_shell = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2433         fi
2434         if test $ol_enable_tcl = yes ; then
2435                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2436         fi
2437         if test $ol_enable_sql = yes ; then
2438                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2439         fi
2440         if test $ol_enable_modules = yes ; then
2441                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2442         fi
2443         if test $ol_enable_wrappers = yes ; then
2444                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2445         fi
2446         if test $ol_enable_phonetic = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2448         fi
2449         if test $ol_enable_rlookups = yes ; then
2450                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2451         fi
2452         if test $ol_enable_aci = yes ; then
2453                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2454         fi
2455         if test $ol_with_ldbm_api != auto ; then
2456                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2457         fi
2458         if test $ol_with_ldbm_type != auto ; then
2459                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2460         fi
2461         if test $ol_with_bdb_module != static ; then
2462                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2463         fi
2464         if test $ol_with_dnssrv_module != static ; then
2465                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2466         fi
2467         if test $ol_with_ldap_module != static ; then
2468                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2469         fi
2470         if test $ol_with_ldbm_module != static ; then
2471                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2472         fi
2473         if test $ol_with_meta_module != static ; then
2474                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2475         fi
2476         if test $ol_with_monitor_module != static ; then
2477                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2478         fi
2479         if test $ol_with_passwd_module != static ; then
2480                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2481         fi
2482         if test $ol_with_perl_module != static ; then
2483                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2484         fi
2485         if test $ol_with_shell_module != static ; then
2486                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2487         fi
2488         if test $ol_with_tcl_module != static ; then
2489                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2490         fi
2491         if test $ol_with_sql_module != static ; then
2492                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2493         fi
2494         if test $ol_enable_slurpd = yes ; then
2495                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2496         fi
2497         if test $ol_enable_rewrite = yes ; then
2498                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2499         fi
2500
2501         # force settings to no
2502         ol_enable_bdb=no
2503         ol_enable_dnssrv=no
2504         ol_enable_ldap=no
2505         ol_enable_ldbm=no
2506         ol_enable_meta=no
2507         ol_enable_monitor=no
2508         ol_enable_passwd=no
2509         ol_enable_perl=no
2510         ol_enable_shell=no
2511         ol_enable_tcl=no
2512         ol_enable_sql=no
2513
2514         ol_enable_modules=no
2515         ol_enable_phonetic=no
2516         ol_enable_rlookups=no
2517         ol_enable_aci=no
2518         ol_enable_wrappers=no
2519         ol_enable_dynamic=no
2520
2521         ol_with_ldbm_api=no
2522         ol_with_ldbm_type=no
2523
2524         ol_with_bdb_module=static
2525         ol_with_dnssrv_module=static
2526         ol_with_ldap_module=static
2527         ol_with_ldbm_module=static
2528         ol_with_meta_module=static
2529         ol_with_monitor_module=static
2530         ol_with_passwd_module=static
2531         ol_with_perl_module=static
2532         ol_with_shell_module=static
2533         ol_with_tcl_module=static
2534         ol_with_sql_module=static
2535
2536         ol_enable_slurpd=no
2537
2538         ol_enable_rewrite=no
2539
2540 elif test $ol_enable_ldbm = no ; then
2541         
2542         if test $ol_with_ldbm_api != auto ; then
2543                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2544         fi
2545
2546         if test $ol_with_ldbm_type != auto ; then
2547                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2548         fi
2549
2550         if test $ol_with_ldbm_module != static ; then
2551                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2552         fi
2553
2554         if test $ol_enable_modules != yes -a \
2555                 $ol_enable_bdb = no -a \
2556                 $ol_enable_dnssrv = no -a \
2557                 $ol_enable_ldap = no -a \
2558                 $ol_enable_meta = no -a \
2559                 $ol_enable_monitor = no -a \
2560                 $ol_enable_passwd = no -a \
2561                 $ol_enable_perl = no -a \
2562                 $ol_enable_shell = no -a \
2563                 $ol_enable_sql = no -a \
2564                 $ol_enable_tcl = no ; then
2565
2566                 if test $ol_enable_slapd = yes ; then
2567                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2568                 else
2569                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2570                         ol_enable_slapd=no
2571                 fi
2572         fi
2573
2574         ol_with_ldbm_api=no
2575         ol_with_ldbm_type=no
2576         ol_with_ldbm_module=static
2577
2578         if test $ol_enable_bdb != no ; then
2579                 ol_with_ldbm_api=berkeley
2580         fi
2581
2582 else
2583                 if test $ol_with_ldbm_api = gdbm -a \
2584                 $ol_with_ldbm_type = btree ; then
2585                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2586         fi
2587         if test $ol_with_ldbm_api = mdbm -a \
2588                 $ol_with_ldbm_type = btree ; then
2589                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2590         fi
2591         if test $ol_with_ldbm_api = ndbm -a \
2592                 $ol_with_ldbm_type = btree ; then
2593                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2594         fi
2595
2596         if test $ol_enable_bdb = yes ; then
2597                 if test $ol_with_ldbm_api = auto ; then
2598                         ol_with_ldbm_api=berkeley
2599                 elif test $ol_with_ldbm_api != berkeley ; then
2600                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2601                 fi
2602
2603         elif test $ol_enable_bdb = auto ; then
2604                 if test $ol_with_ldbm_api != berkeley \
2605                         -o $ol_with_ldbm_api != auto ; then
2606                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2607                         ol_enable_bdb=no
2608                 fi
2609         fi
2610 fi
2611
2612 if test $ol_enable_slurpd = yes ; then
2613                 if test $ol_with_threads = no ; then
2614                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2615         fi
2616 fi
2617
2618 if test $ol_enable_lmpasswd = yes ; then
2619         if test $ol_with_tls = no ; then
2620                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2621         fi
2622 fi
2623
2624 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2625         if test $ol_with_kerberos = no ; then
2626                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2627         elif $ol_with_kerberos = auto ; then
2628                 ol_with_kerberos=yes
2629         fi
2630
2631 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2632         if test $ol_with_kerberos = auto ; then
2633                 ol_with_kerberos=no
2634         elif test $ol_with_kerberos != no ; then
2635                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2636                 ol_with_kerberos=no
2637         fi
2638 fi
2639
2640 if test $ol_enable_spasswd = yes ; then
2641         if test $ol_with_cyrus_sasl = no ; then
2642                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2643         fi
2644         ol_with_cyrus_sasl=yes
2645 fi
2646
2647 echo "$ac_t""done" 1>&6
2648
2649 LDAP_LIBS=
2650 LDIF_LIBS=
2651 LDBM_LIB=
2652 LDBM_LIBS=
2653 LTHREAD_LIBS=
2654 LUTIL_LIBS=
2655
2656 SLAPD_LIBS=
2657 SLURPD_LIBS=
2658
2659 BUILD_SLAPD=no
2660 BUILD_SLURPD=no
2661
2662 BUILD_THREAD=no
2663
2664 BUILD_BDB=no
2665 BUILD_DNSSRV=no
2666 BUILD_LDAP=no
2667 BUILD_LDBM=no
2668 BUILD_META=no
2669 BUILD_MONITOR=no
2670 BUILD_PASSWD=no
2671 BUILD_PERL=no
2672 BUILD_SHELL=no
2673 BUILD_SQL=no
2674 BUILD_TCL=no
2675
2676 BUILD_BDB_DYNAMIC=static
2677 BUILD_DNSSRV_DYNAMIC=static
2678 BUILD_LDAP_DYNAMIC=static
2679 BUILD_LDBM_DYNAMIC=static
2680 BUILD_META_DYNAMIC=static
2681 BUILD_MONITOR_DYNAMIC=static
2682 BUILD_PASSWD_DYNAMIC=static
2683 BUILD_PERL_DYNAMIC=static
2684 BUILD_SHELL_DYNAMIC=static
2685 BUILD_TCL_DYNAMIC=static
2686 BUILD_SQL_DYNAMIC=static
2687
2688 SLAPD_MODULES_LDFLAGS=
2689 SLAPD_MODULES_CPPFLAGS=
2690 SLAPD_MODULES_LIST=
2691
2692 SLAPD_PERL_LDFLAGS=
2693 MOD_PERL_LDFLAGS=
2694 PERL_CPPFLAGS=
2695
2696 SLAPD_SQL_LDFLAGS=
2697 SLAPD_SQL_LIBS=
2698 SLAPD_SQL_INCLUDES=
2699
2700 MOD_TCL_LIB=
2701 KRB4_LIBS=
2702 KRB5_LIBS=
2703 READLINE_LIBS=
2704 SASL_LIBS=
2705 TERMCAP_LIBS=
2706 TLS_LIBS=
2707 MODULES_LIBS=
2708 AUTH_LIBS=
2709
2710 SLAPD_SLP_LIBS=
2711
2712
2713
2714 cat >> confdefs.h <<\EOF
2715 #define HAVE_MKVERSION 1
2716 EOF
2717
2718
2719
2720
2721 ol_aix_threads=no
2722 case "$target" in
2723 *-*-aix*)       if test -z "$CC" ; then
2724                 case "$ol_with_threads" in
2725                 auto | yes |  posix) ol_aix_threads=yes ;;
2726                 esac
2727         fi
2728 ;;
2729 esac
2730
2731 if test $ol_aix_threads = yes ; then
2732         if test -z "${CC}" ; then
2733                 for ac_prog in cc_r xlc_r cc
2734 do
2735 # Extract the first word of "$ac_prog", so it can be a program name with args.
2736 set dummy $ac_prog; ac_word=$2
2737 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2738 echo "configure:2739: checking for $ac_word" >&5
2739 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2740   echo $ac_n "(cached) $ac_c" 1>&6
2741 else
2742   if test -n "$CC"; then
2743   ac_cv_prog_CC="$CC" # Let the user override the test.
2744 else
2745   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2746   ac_dummy="$PATH"
2747   for ac_dir in $ac_dummy; do
2748     test -z "$ac_dir" && ac_dir=.
2749     if test -f $ac_dir/$ac_word; then
2750       ac_cv_prog_CC="$ac_prog"
2751       break
2752     fi
2753   done
2754   IFS="$ac_save_ifs"
2755 fi
2756 fi
2757 CC="$ac_cv_prog_CC"
2758 if test -n "$CC"; then
2759   echo "$ac_t""$CC" 1>&6
2760 else
2761   echo "$ac_t""no" 1>&6
2762 fi
2763
2764 test -n "$CC" && break
2765 done
2766
2767
2768                 if test "$CC" = cc ; then
2769                                                 if test $ol_with_threads != auto ; then
2770                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2771                         else
2772                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2773                         fi
2774                         ol_with_threads=no
2775                 fi
2776         fi
2777
2778         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2779                 ol_with_threads=posix
2780                 ol_cv_pthread_create=yes
2781         fi
2782 fi
2783
2784 if test -z "${CC}"; then
2785         for ac_prog in cc
2786 do
2787 # Extract the first word of "$ac_prog", so it can be a program name with args.
2788 set dummy $ac_prog; ac_word=$2
2789 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2790 echo "configure:2791: checking for $ac_word" >&5
2791 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2792   echo $ac_n "(cached) $ac_c" 1>&6
2793 else
2794   if test -n "$CC"; then
2795   ac_cv_prog_CC="$CC" # Let the user override the test.
2796 else
2797   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2798   ac_dummy="$PATH"
2799   for ac_dir in $ac_dummy; do
2800     test -z "$ac_dir" && ac_dir=.
2801     if test -f $ac_dir/$ac_word; then
2802       ac_cv_prog_CC="$ac_prog"
2803       break
2804     fi
2805   done
2806   IFS="$ac_save_ifs"
2807 fi
2808 fi
2809 CC="$ac_cv_prog_CC"
2810 if test -n "$CC"; then
2811   echo "$ac_t""$CC" 1>&6
2812 else
2813   echo "$ac_t""no" 1>&6
2814 fi
2815
2816 test -n "$CC" && break
2817 done
2818
2819 fi
2820
2821
2822
2823
2824 # Check whether --enable-fast-install or --disable-fast-install was given.
2825 if test "${enable_fast_install+set}" = set; then
2826   enableval="$enable_fast_install"
2827   p=${PACKAGE-default}
2828 case "$enableval" in
2829 yes) enable_fast_install=yes ;;
2830 no) enable_fast_install=no ;;
2831 *)
2832   enable_fast_install=no
2833   # Look at the argument we got.  We use all the common list separators.
2834   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2835   for pkg in $enableval; do
2836     if test "X$pkg" = "X$p"; then
2837       enable_fast_install=yes
2838     fi
2839   done
2840   IFS="$ac_save_ifs"
2841   ;;
2842 esac
2843 else
2844   enable_fast_install=yes
2845 fi
2846
2847 # Extract the first word of "ranlib", so it can be a program name with args.
2848 set dummy ranlib; ac_word=$2
2849 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2850 echo "configure:2851: checking for $ac_word" >&5
2851 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2852   echo $ac_n "(cached) $ac_c" 1>&6
2853 else
2854   if test -n "$RANLIB"; then
2855   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2856 else
2857   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2858   ac_dummy="$PATH"
2859   for ac_dir in $ac_dummy; do
2860     test -z "$ac_dir" && ac_dir=.
2861     if test -f $ac_dir/$ac_word; then
2862       ac_cv_prog_RANLIB="ranlib"
2863       break
2864     fi
2865   done
2866   IFS="$ac_save_ifs"
2867   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2868 fi
2869 fi
2870 RANLIB="$ac_cv_prog_RANLIB"
2871 if test -n "$RANLIB"; then
2872   echo "$ac_t""$RANLIB" 1>&6
2873 else
2874   echo "$ac_t""no" 1>&6
2875 fi
2876
2877 # Extract the first word of "gcc", so it can be a program name with args.
2878 set dummy gcc; ac_word=$2
2879 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2880 echo "configure:2881: checking for $ac_word" >&5
2881 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2882   echo $ac_n "(cached) $ac_c" 1>&6
2883 else
2884   if test -n "$CC"; then
2885   ac_cv_prog_CC="$CC" # Let the user override the test.
2886 else
2887   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2888   ac_dummy="$PATH"
2889   for ac_dir in $ac_dummy; do
2890     test -z "$ac_dir" && ac_dir=.
2891     if test -f $ac_dir/$ac_word; then
2892       ac_cv_prog_CC="gcc"
2893       break
2894     fi
2895   done
2896   IFS="$ac_save_ifs"
2897 fi
2898 fi
2899 CC="$ac_cv_prog_CC"
2900 if test -n "$CC"; then
2901   echo "$ac_t""$CC" 1>&6
2902 else
2903   echo "$ac_t""no" 1>&6
2904 fi
2905
2906 if test -z "$CC"; then
2907   # Extract the first word of "cc", so it can be a program name with args.
2908 set dummy cc; ac_word=$2
2909 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2910 echo "configure:2911: checking for $ac_word" >&5
2911 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2912   echo $ac_n "(cached) $ac_c" 1>&6
2913 else
2914   if test -n "$CC"; then
2915   ac_cv_prog_CC="$CC" # Let the user override the test.
2916 else
2917   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2918   ac_prog_rejected=no
2919   ac_dummy="$PATH"
2920   for ac_dir in $ac_dummy; do
2921     test -z "$ac_dir" && ac_dir=.
2922     if test -f $ac_dir/$ac_word; then
2923       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2924         ac_prog_rejected=yes
2925         continue
2926       fi
2927       ac_cv_prog_CC="cc"
2928       break
2929     fi
2930   done
2931   IFS="$ac_save_ifs"
2932 if test $ac_prog_rejected = yes; then
2933   # We found a bogon in the path, so make sure we never use it.
2934   set dummy $ac_cv_prog_CC
2935   shift
2936   if test $# -gt 0; then
2937     # We chose a different compiler from the bogus one.
2938     # However, it has the same basename, so the bogon will be chosen
2939     # first if we set CC to just the basename; use the full file name.
2940     shift
2941     set dummy "$ac_dir/$ac_word" "$@"
2942     shift
2943     ac_cv_prog_CC="$@"
2944   fi
2945 fi
2946 fi
2947 fi
2948 CC="$ac_cv_prog_CC"
2949 if test -n "$CC"; then
2950   echo "$ac_t""$CC" 1>&6
2951 else
2952   echo "$ac_t""no" 1>&6
2953 fi
2954
2955   if test -z "$CC"; then
2956     case "`uname -s`" in
2957     *win32* | *WIN32* | *CYGWIN*)
2958       # Extract the first word of "cl", so it can be a program name with args.
2959 set dummy cl; ac_word=$2
2960 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2961 echo "configure:2962: checking for $ac_word" >&5
2962 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2963   echo $ac_n "(cached) $ac_c" 1>&6
2964 else
2965   if test -n "$CC"; then
2966   ac_cv_prog_CC="$CC" # Let the user override the test.
2967 else
2968   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2969   ac_dummy="$PATH"
2970   for ac_dir in $ac_dummy; do
2971     test -z "$ac_dir" && ac_dir=.
2972     if test -f $ac_dir/$ac_word; then
2973       ac_cv_prog_CC="cl"
2974       break
2975     fi
2976   done
2977   IFS="$ac_save_ifs"
2978 fi
2979 fi
2980 CC="$ac_cv_prog_CC"
2981 if test -n "$CC"; then
2982   echo "$ac_t""$CC" 1>&6
2983 else
2984   echo "$ac_t""no" 1>&6
2985 fi
2986  ;;
2987     esac
2988   fi
2989   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2990 fi
2991
2992 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2993 echo "configure:2994: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2994
2995 ac_ext=c
2996 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2997 ac_cpp='$CPP $CPPFLAGS'
2998 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2999 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3000 cross_compiling=$ac_cv_prog_cc_cross
3001
3002 cat > conftest.$ac_ext << EOF
3003
3004 #line 3005 "configure"
3005 #include "confdefs.h"
3006
3007 main(){return(0);}
3008 EOF
3009 if { (eval echo configure:3010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3010   ac_cv_prog_cc_works=yes
3011   # If we can't run a trivial program, we are probably using a cross compiler.
3012   if (./conftest; exit) 2>/dev/null; then
3013     ac_cv_prog_cc_cross=no
3014   else
3015     ac_cv_prog_cc_cross=yes
3016   fi
3017 else
3018   echo "configure: failed program was:" >&5
3019   cat conftest.$ac_ext >&5
3020   ac_cv_prog_cc_works=no
3021 fi
3022 rm -fr conftest*
3023 ac_ext=c
3024 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3025 ac_cpp='$CPP $CPPFLAGS'
3026 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3027 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3028 cross_compiling=$ac_cv_prog_cc_cross
3029
3030 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3031 if test $ac_cv_prog_cc_works = no; then
3032   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3033 fi
3034 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3035 echo "configure:3036: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3036 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3037 cross_compiling=$ac_cv_prog_cc_cross
3038
3039 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3040 echo "configure:3041: checking whether we are using GNU C" >&5
3041 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3042   echo $ac_n "(cached) $ac_c" 1>&6
3043 else
3044   cat > conftest.c <<EOF
3045 #ifdef __GNUC__
3046   yes;
3047 #endif
3048 EOF
3049 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3050   ac_cv_prog_gcc=yes
3051 else
3052   ac_cv_prog_gcc=no
3053 fi
3054 fi
3055
3056 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3057
3058 if test $ac_cv_prog_gcc = yes; then
3059   GCC=yes
3060 else
3061   GCC=
3062 fi
3063
3064 ac_test_CFLAGS="${CFLAGS+set}"
3065 ac_save_CFLAGS="$CFLAGS"
3066 CFLAGS=
3067 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3068 echo "configure:3069: checking whether ${CC-cc} accepts -g" >&5
3069 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3070   echo $ac_n "(cached) $ac_c" 1>&6
3071 else
3072   echo 'void f(){}' > conftest.c
3073 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3074   ac_cv_prog_cc_g=yes
3075 else
3076   ac_cv_prog_cc_g=no
3077 fi
3078 rm -f conftest*
3079
3080 fi
3081
3082 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3083 if test "$ac_test_CFLAGS" = set; then
3084   CFLAGS="$ac_save_CFLAGS"
3085 elif test $ac_cv_prog_cc_g = yes; then
3086   if test "$GCC" = yes; then
3087     CFLAGS="-g -O2"
3088   else
3089     CFLAGS="-g"
3090   fi
3091 else
3092   if test "$GCC" = yes; then
3093     CFLAGS="-O2"
3094   else
3095     CFLAGS=
3096   fi
3097 fi
3098
3099 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3100 if test "${with_gnu_ld+set}" = set; then
3101   withval="$with_gnu_ld"
3102   test "$withval" = no || with_gnu_ld=yes
3103 else
3104   with_gnu_ld=no
3105 fi
3106
3107 ac_prog=ld
3108 if test "$ac_cv_prog_gcc" = yes; then
3109   # Check if gcc -print-prog-name=ld gives a path.
3110   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3111 echo "configure:3112: checking for ld used by GCC" >&5
3112   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3113   case "$ac_prog" in
3114     # Accept absolute paths.
3115     [\\/]* | [A-Za-z]:[\\/]*)
3116       re_direlt='/[^/][^/]*/\.\./'
3117       # Canonicalize the path of ld
3118       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3119       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3120         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3121       done
3122       test -z "$LD" && LD="$ac_prog"
3123       ;;
3124   "")
3125     # If it fails, then pretend we aren't using GCC.
3126     ac_prog=ld
3127     ;;
3128   *)
3129     # If it is relative, then search for the first ld in PATH.
3130     with_gnu_ld=unknown
3131     ;;
3132   esac
3133 elif test "$with_gnu_ld" = yes; then
3134   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3135 echo "configure:3136: checking for GNU ld" >&5
3136 else
3137   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3138 echo "configure:3139: checking for non-GNU ld" >&5
3139 fi
3140 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3141   echo $ac_n "(cached) $ac_c" 1>&6
3142 else
3143   if test -z "$LD"; then
3144   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3145   for ac_dir in $PATH; do
3146     test -z "$ac_dir" && ac_dir=.
3147     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3148       ac_cv_path_LD="$ac_dir/$ac_prog"
3149       # Check to see if the program is GNU ld.  I'd rather use --version,
3150       # but apparently some GNU ld's only accept -v.
3151       # Break only if it was the GNU/non-GNU ld that we prefer.
3152       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3153         test "$with_gnu_ld" != no && break
3154       else
3155         test "$with_gnu_ld" != yes && break
3156       fi
3157     fi
3158   done
3159   IFS="$ac_save_ifs"
3160 else
3161   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3162 fi
3163 fi
3164
3165 LD="$ac_cv_path_LD"
3166 if test -n "$LD"; then
3167   echo "$ac_t""$LD" 1>&6
3168 else
3169   echo "$ac_t""no" 1>&6
3170 fi
3171 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3172 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3173 echo "configure:3174: checking if the linker ($LD) is GNU ld" >&5
3174 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3175   echo $ac_n "(cached) $ac_c" 1>&6
3176 else
3177   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3178 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3179   ac_cv_prog_gnu_ld=yes
3180 else
3181   ac_cv_prog_gnu_ld=no
3182 fi
3183 fi
3184
3185 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3186
3187
3188 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3189 echo "configure:3190: checking for BSD-compatible nm" >&5
3190 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3191   echo $ac_n "(cached) $ac_c" 1>&6
3192 else
3193   if test -n "$NM"; then
3194   # Let the user override the test.
3195   ac_cv_path_NM="$NM"
3196 else
3197   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3198   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3199     test -z "$ac_dir" && ac_dir=.
3200     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3201       # Check to see if the nm accepts a BSD-compat flag.
3202       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3203       #   nm: unknown option "B" ignored
3204       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3205         ac_cv_path_NM="$ac_dir/nm -B"
3206         break
3207       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3208         ac_cv_path_NM="$ac_dir/nm -p"
3209         break
3210       else
3211         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3212         continue # so that we can try to find one that supports BSD flags
3213       fi
3214     fi
3215   done
3216   IFS="$ac_save_ifs"
3217   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3218 fi
3219 fi
3220
3221 NM="$ac_cv_path_NM"
3222 echo "$ac_t""$NM" 1>&6
3223
3224 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3225 echo "configure:3226: checking whether ln -s works" >&5
3226 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3227   echo $ac_n "(cached) $ac_c" 1>&6
3228 else
3229   rm -f conftestdata
3230 if ln -s X conftestdata 2>/dev/null
3231 then
3232   rm -f conftestdata
3233   ac_cv_prog_LN_S="ln -s"
3234 else
3235   ac_cv_prog_LN_S=ln
3236 fi
3237 fi
3238 LN_S="$ac_cv_prog_LN_S"
3239 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3240   echo "$ac_t""yes" 1>&6
3241 else
3242   echo "$ac_t""no" 1>&6
3243 fi
3244
3245 if test $host != $build; then
3246   ac_tool_prefix=${host_alias}-
3247 else
3248   ac_tool_prefix=
3249 fi
3250
3251
3252 case "$target" in
3253 NONE) lt_target="$host" ;;
3254 *) lt_target="$target" ;;
3255 esac
3256
3257 # Check for any special flags to pass to ltconfig.
3258 libtool_flags="--cache-file=$cache_file"
3259 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3260 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3261 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3262 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3263 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3264 libtool_flags="$libtool_flags --enable-dlopen"
3265 libtool_flags="$libtool_flags --enable-win32-dll"
3266 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3267 if test "${enable_libtool_lock+set}" = set; then
3268   enableval="$enable_libtool_lock"
3269   :
3270 fi
3271
3272 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3273 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3274
3275 # Some flags need to be propagated to the compiler or linker for good
3276 # libtool support.
3277 case "$lt_target" in
3278 *-*-irix6*)
3279   # Find out which ABI we are using.
3280   echo '#line 3281 "configure"' > conftest.$ac_ext
3281   if { (eval echo configure:3282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3282     case "`/usr/bin/file conftest.o`" in
3283     *32-bit*)
3284       LD="${LD-ld} -32"
3285       ;;
3286     *N32*)
3287       LD="${LD-ld} -n32"
3288       ;;
3289     *64-bit*)
3290       LD="${LD-ld} -64"
3291       ;;
3292     esac
3293   fi
3294   rm -rf conftest*
3295   ;;
3296
3297 *-*-sco3.2v5*)
3298   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3299   SAVE_CFLAGS="$CFLAGS"
3300   CFLAGS="$CFLAGS -belf"
3301   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3302 echo "configure:3303: checking whether the C compiler needs -belf" >&5
3303 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3304   echo $ac_n "(cached) $ac_c" 1>&6
3305 else
3306   cat > conftest.$ac_ext <<EOF
3307 #line 3308 "configure"
3308 #include "confdefs.h"
3309
3310 int main() {
3311
3312 ; return 0; }
3313 EOF
3314 if { (eval echo configure:3315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3315   rm -rf conftest*
3316   lt_cv_cc_needs_belf=yes
3317 else
3318   echo "configure: failed program was:" >&5
3319   cat conftest.$ac_ext >&5
3320   rm -rf conftest*
3321   lt_cv_cc_needs_belf=no
3322 fi
3323 rm -f conftest*
3324 fi
3325
3326 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3327   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3328     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3329     CFLAGS="$SAVE_CFLAGS"
3330   fi
3331   ;;
3332
3333 *-*-cygwin* | *-*-mingw*)
3334   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3335 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3336 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3337 echo "configure:3338: checking for $ac_word" >&5
3338 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3339   echo $ac_n "(cached) $ac_c" 1>&6
3340 else
3341   if test -n "$DLLTOOL"; then
3342   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3343 else
3344   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3345   ac_dummy="$PATH"
3346   for ac_dir in $ac_dummy; do
3347     test -z "$ac_dir" && ac_dir=.
3348     if test -f $ac_dir/$ac_word; then
3349       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3350       break
3351     fi
3352   done
3353   IFS="$ac_save_ifs"
3354 fi
3355 fi
3356 DLLTOOL="$ac_cv_prog_DLLTOOL"
3357 if test -n "$DLLTOOL"; then
3358   echo "$ac_t""$DLLTOOL" 1>&6
3359 else
3360   echo "$ac_t""no" 1>&6
3361 fi
3362
3363
3364 if test -z "$ac_cv_prog_DLLTOOL"; then
3365 if test -n "$ac_tool_prefix"; then
3366   # Extract the first word of "dlltool", so it can be a program name with args.
3367 set dummy dlltool; ac_word=$2
3368 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3369 echo "configure:3370: checking for $ac_word" >&5
3370 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3371   echo $ac_n "(cached) $ac_c" 1>&6
3372 else
3373   if test -n "$DLLTOOL"; then
3374   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3375 else
3376   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3377   ac_dummy="$PATH"
3378   for ac_dir in $ac_dummy; do
3379     test -z "$ac_dir" && ac_dir=.
3380     if test -f $ac_dir/$ac_word; then
3381       ac_cv_prog_DLLTOOL="dlltool"
3382       break
3383     fi
3384   done
3385   IFS="$ac_save_ifs"
3386   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3387 fi
3388 fi
3389 DLLTOOL="$ac_cv_prog_DLLTOOL"
3390 if test -n "$DLLTOOL"; then
3391   echo "$ac_t""$DLLTOOL" 1>&6
3392 else
3393   echo "$ac_t""no" 1>&6
3394 fi
3395
3396 else
3397   DLLTOOL="false"
3398 fi
3399 fi
3400
3401   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3402 set dummy ${ac_tool_prefix}as; ac_word=$2
3403 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3404 echo "configure:3405: checking for $ac_word" >&5
3405 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3406   echo $ac_n "(cached) $ac_c" 1>&6
3407 else
3408   if test -n "$AS"; then
3409   ac_cv_prog_AS="$AS" # Let the user override the test.
3410 else
3411   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3412   ac_dummy="$PATH"
3413   for ac_dir in $ac_dummy; do
3414     test -z "$ac_dir" && ac_dir=.
3415     if test -f $ac_dir/$ac_word; then
3416       ac_cv_prog_AS="${ac_tool_prefix}as"
3417       break
3418     fi
3419   done
3420   IFS="$ac_save_ifs"
3421 fi
3422 fi
3423 AS="$ac_cv_prog_AS"
3424 if test -n "$AS"; then
3425   echo "$ac_t""$AS" 1>&6
3426 else
3427   echo "$ac_t""no" 1>&6
3428 fi
3429
3430
3431 if test -z "$ac_cv_prog_AS"; then
3432 if test -n "$ac_tool_prefix"; then
3433   # Extract the first word of "as", so it can be a program name with args.
3434 set dummy as; ac_word=$2
3435 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3436 echo "configure:3437: checking for $ac_word" >&5
3437 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3438   echo $ac_n "(cached) $ac_c" 1>&6
3439 else
3440   if test -n "$AS"; then
3441   ac_cv_prog_AS="$AS" # Let the user override the test.
3442 else
3443   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3444   ac_dummy="$PATH"
3445   for ac_dir in $ac_dummy; do
3446     test -z "$ac_dir" && ac_dir=.
3447     if test -f $ac_dir/$ac_word; then
3448       ac_cv_prog_AS="as"
3449       break
3450     fi
3451   done
3452   IFS="$ac_save_ifs"
3453   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3454 fi
3455 fi
3456 AS="$ac_cv_prog_AS"
3457 if test -n "$AS"; then
3458   echo "$ac_t""$AS" 1>&6
3459 else
3460   echo "$ac_t""no" 1>&6
3461 fi
3462
3463 else
3464   AS="false"
3465 fi
3466 fi
3467
3468   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3469 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3470 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3471 echo "configure:3472: checking for $ac_word" >&5
3472 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3473   echo $ac_n "(cached) $ac_c" 1>&6
3474 else
3475   if test -n "$OBJDUMP"; then
3476   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3477 else
3478   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3479   ac_dummy="$PATH"
3480   for ac_dir in $ac_dummy; do
3481     test -z "$ac_dir" && ac_dir=.
3482     if test -f $ac_dir/$ac_word; then
3483       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3484       break
3485     fi
3486   done
3487   IFS="$ac_save_ifs"
3488 fi
3489 fi
3490 OBJDUMP="$ac_cv_prog_OBJDUMP"
3491 if test -n "$OBJDUMP"; then
3492   echo "$ac_t""$OBJDUMP" 1>&6
3493 else
3494   echo "$ac_t""no" 1>&6
3495 fi
3496
3497
3498 if test -z "$ac_cv_prog_OBJDUMP"; then
3499 if test -n "$ac_tool_prefix"; then
3500   # Extract the first word of "objdump", so it can be a program name with args.
3501 set dummy objdump; ac_word=$2
3502 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3503 echo "configure:3504: checking for $ac_word" >&5
3504 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3505   echo $ac_n "(cached) $ac_c" 1>&6
3506 else
3507   if test -n "$OBJDUMP"; then
3508   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3509 else
3510   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3511   ac_dummy="$PATH"
3512   for ac_dir in $ac_dummy; do
3513     test -z "$ac_dir" && ac_dir=.
3514     if test -f $ac_dir/$ac_word; then
3515       ac_cv_prog_OBJDUMP="objdump"
3516       break
3517     fi
3518   done
3519   IFS="$ac_save_ifs"
3520   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3521 fi
3522 fi
3523 OBJDUMP="$ac_cv_prog_OBJDUMP"
3524 if test -n "$OBJDUMP"; then
3525   echo "$ac_t""$OBJDUMP" 1>&6
3526 else
3527   echo "$ac_t""no" 1>&6
3528 fi
3529
3530 else
3531   OBJDUMP="false"
3532 fi
3533 fi
3534
3535   ;;
3536
3537 esac
3538
3539
3540 # Save cache, so that ltconfig can load it
3541
3542
3543 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3544 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3545 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3546 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3547 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3548 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3549 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3550 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3551
3552 # Reload cache, that may have been modified by ltconfig
3553
3554
3555 # This can be used to rebuild libtool when needed
3556 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3557
3558 # Always use our own libtool.
3559 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3560
3561 # Redirect the config.log output again, so that the ltconfig log is not
3562 # clobbered by the next message.
3563 exec 5>>./config.log
3564
3565
3566 for ac_prog in mawk gawk nawk awk
3567 do
3568 # Extract the first word of "$ac_prog", so it can be a program name with args.
3569 set dummy $ac_prog; ac_word=$2
3570 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3571 echo "configure:3572: checking for $ac_word" >&5
3572 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3573   echo $ac_n "(cached) $ac_c" 1>&6
3574 else
3575   if test -n "$AWK"; then
3576   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3577 else
3578   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3579   ac_dummy="$PATH"
3580   for ac_dir in $ac_dummy; do
3581     test -z "$ac_dir" && ac_dir=.
3582     if test -f $ac_dir/$ac_word; then
3583       ac_cv_prog_AWK="$ac_prog"
3584       break
3585     fi
3586   done
3587   IFS="$ac_save_ifs"
3588 fi
3589 fi
3590 AWK="$ac_cv_prog_AWK"
3591 if test -n "$AWK"; then
3592   echo "$ac_t""$AWK" 1>&6
3593 else
3594   echo "$ac_t""no" 1>&6
3595 fi
3596
3597 test -n "$AWK" && break
3598 done
3599
3600 # test for ln hardlink support
3601 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3602 echo "configure:3603: checking whether ln works" >&5
3603 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3604   echo $ac_n "(cached) $ac_c" 1>&6
3605 else
3606   rm -f conftest.src conftest.dst
3607 echo "conftest" > conftest.src
3608 if ln conftest.src conftest.dst 2>/dev/null
3609 then
3610   ol_cv_prog_LN_H="ln"
3611 else
3612   ol_cv_prog_LN_H="cp"
3613 fi
3614 rm -f conftest.src conftest.dst
3615
3616 fi
3617 LN_H="$ol_cv_prog_LN_H"
3618 if test "$ol_cv_prog_LN_H" = "ln"; then
3619         echo "$ac_t""yes" 1>&6
3620 else
3621         echo "$ac_t""no" 1>&6
3622 fi
3623
3624 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3625 echo "configure:3626: checking whether ln -s works" >&5
3626 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3627   echo $ac_n "(cached) $ac_c" 1>&6
3628 else
3629   rm -f conftestdata
3630 if ln -s X conftestdata 2>/dev/null
3631 then
3632   rm -f conftestdata
3633   ac_cv_prog_LN_S="ln -s"
3634 else
3635   ac_cv_prog_LN_S=ln
3636 fi
3637 fi
3638 LN_S="$ac_cv_prog_LN_S"
3639 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3640   echo "$ac_t""yes" 1>&6
3641 else
3642   echo "$ac_t""no" 1>&6
3643 fi
3644
3645
3646 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3647         LN_S="$LN_H"
3648 fi
3649
3650 # Extract the first word of "sendmail", so it can be a program name with args.
3651 set dummy sendmail; ac_word=$2
3652 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3653 echo "configure:3654: checking for $ac_word" >&5
3654 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3655   echo $ac_n "(cached) $ac_c" 1>&6
3656 else
3657   case "$SENDMAIL" in
3658   /*)
3659   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3660   ;;
3661   ?:/*)
3662   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3663   ;;
3664   *)
3665   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3666   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3667   for ac_dir in $ac_dummy; do 
3668     test -z "$ac_dir" && ac_dir=.
3669     if test -f $ac_dir/$ac_word; then
3670       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3671       break
3672     fi
3673   done
3674   IFS="$ac_save_ifs"
3675   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3676   ;;
3677 esac
3678 fi
3679 SENDMAIL="$ac_cv_path_SENDMAIL"
3680 if test -n "$SENDMAIL"; then
3681   echo "$ac_t""$SENDMAIL" 1>&6
3682 else
3683   echo "$ac_t""no" 1>&6
3684 fi
3685
3686 # Extract the first word of "vi", so it can be a program name with args.
3687 set dummy vi; ac_word=$2
3688 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3689 echo "configure:3690: checking for $ac_word" >&5
3690 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3691   echo $ac_n "(cached) $ac_c" 1>&6
3692 else
3693   case "$EDITOR" in
3694   /*)
3695   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3696   ;;
3697   ?:/*)
3698   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3699   ;;
3700   *)
3701   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3702   ac_dummy="$PATH:/usr/ucb"
3703   for ac_dir in $ac_dummy; do 
3704     test -z "$ac_dir" && ac_dir=.
3705     if test -f $ac_dir/$ac_word; then
3706       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3707       break
3708     fi
3709   done
3710   IFS="$ac_save_ifs"
3711   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3712   ;;
3713 esac
3714 fi
3715 EDITOR="$ac_cv_path_EDITOR"
3716 if test -n "$EDITOR"; then
3717   echo "$ac_t""$EDITOR" 1>&6
3718 else
3719   echo "$ac_t""no" 1>&6
3720 fi
3721
3722 # Extract the first word of "finger", so it can be a program name with args.
3723 set dummy finger; ac_word=$2
3724 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3725 echo "configure:3726: checking for $ac_word" >&5
3726 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3727   echo $ac_n "(cached) $ac_c" 1>&6
3728 else
3729   case "$FINGER" in
3730   /*)
3731   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3732   ;;
3733   ?:/*)
3734   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3735   ;;
3736   *)
3737   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3738   ac_dummy="$PATH:/usr/ucb"
3739   for ac_dir in $ac_dummy; do 
3740     test -z "$ac_dir" && ac_dir=.
3741     if test -f $ac_dir/$ac_word; then
3742       ac_cv_path_FINGER="$ac_dir/$ac_word"
3743       break
3744     fi
3745   done
3746   IFS="$ac_save_ifs"
3747   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3748   ;;
3749 esac
3750 fi
3751 FINGER="$ac_cv_path_FINGER"
3752 if test -n "$FINGER"; then
3753   echo "$ac_t""$FINGER" 1>&6
3754 else
3755   echo "$ac_t""no" 1>&6
3756 fi
3757
3758
3759 ol_link_perl=no
3760 if test $ol_enable_perl != no ; then
3761         # Extract the first word of "perl", so it can be a program name with args.
3762 set dummy perl; ac_word=$2
3763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3764 echo "configure:3765: checking for $ac_word" >&5
3765 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3766   echo $ac_n "(cached) $ac_c" 1>&6
3767 else
3768   case "$PERLBIN" in
3769   /*)
3770   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3771   ;;
3772   ?:/*)
3773   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3774   ;;
3775   *)
3776   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3777   ac_dummy="$PATH"
3778   for ac_dir in $ac_dummy; do 
3779     test -z "$ac_dir" && ac_dir=.
3780     if test -f $ac_dir/$ac_word; then
3781       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3782       break
3783     fi
3784   done
3785   IFS="$ac_save_ifs"
3786   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3787   ;;
3788 esac
3789 fi
3790 PERLBIN="$ac_cv_path_PERLBIN"
3791 if test -n "$PERLBIN"; then
3792   echo "$ac_t""$PERLBIN" 1>&6
3793 else
3794   echo "$ac_t""no" 1>&6
3795 fi
3796
3797
3798         if test "no$PERLBIN" = "no" ; then
3799                 if test $ol_enable_perl = yes ; then
3800                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3801                 fi
3802
3803         else
3804                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3805                 if test x"$ol_with_perl_module" = "xstatic" ; then
3806                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3807                 else
3808                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3809                 fi
3810                                 ol_link_perl=yes
3811         fi
3812 fi
3813
3814 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3815 echo "configure:3816: checking how to run the C preprocessor" >&5
3816 # On Suns, sometimes $CPP names a directory.
3817 if test -n "$CPP" && test -d "$CPP"; then
3818   CPP=
3819 fi
3820 if test -z "$CPP"; then
3821 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3822   echo $ac_n "(cached) $ac_c" 1>&6
3823 else
3824     # This must be in double quotes, not single quotes, because CPP may get
3825   # substituted into the Makefile and "${CC-cc}" will confuse make.
3826   CPP="${CC-cc} -E"
3827   # On the NeXT, cc -E runs the code through the compiler's parser,
3828   # not just through cpp.
3829   cat > conftest.$ac_ext <<EOF
3830 #line 3831 "configure"
3831 #include "confdefs.h"
3832 #include <assert.h>
3833 Syntax Error
3834 EOF
3835 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3836 { (eval echo configure:3837: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3837 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3838 if test -z "$ac_err"; then
3839   :
3840 else
3841   echo "$ac_err" >&5
3842   echo "configure: failed program was:" >&5
3843   cat conftest.$ac_ext >&5
3844   rm -rf conftest*
3845   CPP="${CC-cc} -E -traditional-cpp"
3846   cat > conftest.$ac_ext <<EOF
3847 #line 3848 "configure"
3848 #include "confdefs.h"
3849 #include <assert.h>
3850 Syntax Error
3851 EOF
3852 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3853 { (eval echo configure:3854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3854 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3855 if test -z "$ac_err"; then
3856   :
3857 else
3858   echo "$ac_err" >&5
3859   echo "configure: failed program was:" >&5
3860   cat conftest.$ac_ext >&5
3861   rm -rf conftest*
3862   CPP="${CC-cc} -nologo -E"
3863   cat > conftest.$ac_ext <<EOF
3864 #line 3865 "configure"
3865 #include "confdefs.h"
3866 #include <assert.h>
3867 Syntax Error
3868 EOF
3869 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3870 { (eval echo configure:3871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3871 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3872 if test -z "$ac_err"; then
3873   :
3874 else
3875   echo "$ac_err" >&5
3876   echo "configure: failed program was:" >&5
3877   cat conftest.$ac_ext >&5
3878   rm -rf conftest*
3879   CPP=/lib/cpp
3880 fi
3881 rm -f conftest*
3882 fi
3883 rm -f conftest*
3884 fi
3885 rm -f conftest*
3886   ac_cv_prog_CPP="$CPP"
3887 fi
3888   CPP="$ac_cv_prog_CPP"
3889 else
3890   ac_cv_prog_CPP="$CPP"
3891 fi
3892 echo "$ac_t""$CPP" 1>&6
3893
3894
3895 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3896         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3897
3898 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3899         echo "configure: warning: programs compiled here do run here..." 1>&2
3900         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3901
3902 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3903         echo "configure: warning: programs compiled here do not run here..." 1>&2
3904         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3905 fi
3906
3907 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3908 echo "configure:3909: checking for AIX" >&5
3909 cat > conftest.$ac_ext <<EOF
3910 #line 3911 "configure"
3911 #include "confdefs.h"
3912 #ifdef _AIX
3913   yes
3914 #endif
3915
3916 EOF
3917 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3918   egrep "yes" >/dev/null 2>&1; then
3919   rm -rf conftest*
3920   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3921 #define _ALL_SOURCE 1
3922 EOF
3923
3924 else
3925   rm -rf conftest*
3926   echo "$ac_t""no" 1>&6
3927 fi
3928 rm -f conftest*
3929
3930
3931 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3932 echo "configure:3933: checking for POSIXized ISC" >&5
3933 if test -d /etc/conf/kconfig.d &&
3934   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3935 then
3936   echo "$ac_t""yes" 1>&6
3937   ISC=yes # If later tests want to check for ISC.
3938   cat >> confdefs.h <<\EOF
3939 #define _POSIX_SOURCE 1
3940 EOF
3941
3942   if test "$GCC" = yes; then
3943     CC="$CC -posix"
3944   else
3945     CC="$CC -Xp"
3946   fi
3947 else
3948   echo "$ac_t""no" 1>&6
3949   ISC=
3950 fi
3951
3952 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3953 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3954 echo "configure:3955: checking for minix/config.h" >&5
3955 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3956   echo $ac_n "(cached) $ac_c" 1>&6
3957 else
3958   cat > conftest.$ac_ext <<EOF
3959 #line 3960 "configure"
3960 #include "confdefs.h"
3961 #include <minix/config.h>
3962 EOF
3963 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3964 { (eval echo configure:3965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3965 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3966 if test -z "$ac_err"; then
3967   rm -rf conftest*
3968   eval "ac_cv_header_$ac_safe=yes"
3969 else
3970   echo "$ac_err" >&5
3971   echo "configure: failed program was:" >&5
3972   cat conftest.$ac_ext >&5
3973   rm -rf conftest*
3974   eval "ac_cv_header_$ac_safe=no"
3975 fi
3976 rm -f conftest*
3977 fi
3978 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3979   echo "$ac_t""yes" 1>&6
3980   MINIX=yes
3981 else
3982   echo "$ac_t""no" 1>&6
3983 MINIX=
3984 fi
3985
3986 if test "$MINIX" = yes; then
3987   cat >> confdefs.h <<\EOF
3988 #define _POSIX_SOURCE 1
3989 EOF
3990
3991   cat >> confdefs.h <<\EOF
3992 #define _POSIX_1_SOURCE 2
3993 EOF
3994
3995   cat >> confdefs.h <<\EOF
3996 #define _MINIX 1
3997 EOF
3998
3999 fi
4000
4001
4002 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4003 echo "configure:4004: checking for Cygwin environment" >&5
4004 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4005   echo $ac_n "(cached) $ac_c" 1>&6
4006 else
4007   cat > conftest.$ac_ext <<EOF
4008 #line 4009 "configure"
4009 #include "confdefs.h"
4010
4011 int main() {
4012
4013 #ifndef __CYGWIN__
4014 #define __CYGWIN__ __CYGWIN32__
4015 #endif
4016 return __CYGWIN__;
4017 ; return 0; }
4018 EOF
4019 if { (eval echo configure:4020: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4020   rm -rf conftest*
4021   ac_cv_cygwin=yes
4022 else
4023   echo "configure: failed program was:" >&5
4024   cat conftest.$ac_ext >&5
4025   rm -rf conftest*
4026   ac_cv_cygwin=no
4027 fi
4028 rm -f conftest*
4029 fi
4030
4031 echo "$ac_t""$ac_cv_cygwin" 1>&6
4032 CYGWIN=
4033 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4034 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4035 echo "configure:4036: checking for mingw32 environment" >&5
4036 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4037   echo $ac_n "(cached) $ac_c" 1>&6
4038 else
4039   cat > conftest.$ac_ext <<EOF
4040 #line 4041 "configure"
4041 #include "confdefs.h"
4042
4043 int main() {
4044 return __MINGW32__;
4045 ; return 0; }
4046 EOF
4047 if { (eval echo configure:4048: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4048   rm -rf conftest*
4049   ac_cv_mingw32=yes
4050 else
4051   echo "configure: failed program was:" >&5
4052   cat conftest.$ac_ext >&5
4053   rm -rf conftest*
4054   ac_cv_mingw32=no
4055 fi
4056 rm -f conftest*
4057 fi
4058
4059 echo "$ac_t""$ac_cv_mingw32" 1>&6
4060 MINGW32=
4061 test "$ac_cv_mingw32" = yes && MINGW32=yes
4062 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4063 echo "configure:4064: checking for EMX OS/2 environment" >&5
4064 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4065   echo $ac_n "(cached) $ac_c" 1>&6
4066 else
4067   cat > conftest.$ac_ext <<EOF
4068 #line 4069 "configure"
4069 #include "confdefs.h"
4070
4071 int main() {
4072 return __EMX__;
4073 ; return 0; }
4074 EOF
4075 if { (eval echo configure:4076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4076   rm -rf conftest*
4077   ac_cv_emxos2=yes
4078 else
4079   echo "configure: failed program was:" >&5
4080   cat conftest.$ac_ext >&5
4081   rm -rf conftest*
4082   ac_cv_emxos2=no
4083 fi
4084 rm -f conftest*
4085 fi
4086
4087 echo "$ac_t""$ac_cv_emxos2" 1>&6
4088 EMXOS2=
4089 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4090
4091
4092
4093 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4094 echo "configure:4095: checking for executable suffix" >&5
4095 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4096   echo $ac_n "(cached) $ac_c" 1>&6
4097 else
4098   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4099   ac_cv_exeext=.exe
4100 else
4101   rm -f conftest*
4102   echo 'int main () { return 0; }' > conftest.$ac_ext
4103   ac_cv_exeext=
4104   if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4105     for file in conftest.*; do
4106       case $file in
4107       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4108       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4109       esac
4110     done
4111   else
4112     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4113   fi
4114   rm -f conftest*
4115   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4116 fi
4117 fi
4118
4119 EXEEXT=""
4120 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4121 echo "$ac_t""${ac_cv_exeext}" 1>&6
4122 ac_exeext=$EXEEXT
4123
4124 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4125 echo "configure:4126: checking for object suffix" >&5
4126 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4127   echo $ac_n "(cached) $ac_c" 1>&6
4128 else
4129   rm -f conftest*
4130 echo 'int i = 1;' > conftest.$ac_ext
4131 if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4132   for ac_file in conftest.*; do
4133     case $ac_file in
4134     *.c) ;;
4135     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4136     esac
4137   done
4138 else
4139   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4140 fi
4141 rm -f conftest*
4142 fi
4143
4144 echo "$ac_t""$ac_cv_objext" 1>&6
4145 OBJEXT=$ac_cv_objext
4146 ac_objext=$ac_cv_objext
4147
4148
4149 cat >> confdefs.h <<EOF
4150 #define EXEEXT "${EXEEXT}"
4151 EOF
4152
4153
4154 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4155 echo "configure:4156: checking for be_app in -lbe" >&5
4156 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4157 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4158   echo $ac_n "(cached) $ac_c" 1>&6
4159 else
4160   ac_save_LIBS="$LIBS"
4161 LIBS="-lbe -lroot -lnet $LIBS"
4162 cat > conftest.$ac_ext <<EOF
4163 #line 4164 "configure"
4164 #include "confdefs.h"
4165 /* Override any gcc2 internal prototype to avoid an error.  */
4166 /* We use char because int might match the return type of a gcc2
4167     builtin and then its argument prototype would still apply.  */
4168 char be_app();
4169
4170 int main() {
4171 be_app()
4172 ; return 0; }
4173 EOF
4174 if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4175   rm -rf conftest*
4176   eval "ac_cv_lib_$ac_lib_var=yes"
4177 else
4178   echo "configure: failed program was:" >&5
4179   cat conftest.$ac_ext >&5
4180   rm -rf conftest*
4181   eval "ac_cv_lib_$ac_lib_var=no"
4182 fi
4183 rm -f conftest*
4184 LIBS="$ac_save_LIBS"
4185
4186 fi
4187 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4188   echo "$ac_t""yes" 1>&6
4189   LIBS="$LIBS -lbe -lroot -lnet"
4190 else
4191   echo "$ac_t""no" 1>&6
4192 :
4193 fi
4194
4195
4196
4197
4198
4199 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4200 echo "configure:4201: checking for ${CC-cc} option to accept ANSI C" >&5
4201 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4202   echo $ac_n "(cached) $ac_c" 1>&6
4203 else
4204   am_cv_prog_cc_stdc=no
4205 ac_save_CC="$CC"
4206 # Don't try gcc -ansi; that turns off useful extensions and
4207 # breaks some systems' header files.
4208 # AIX                   -qlanglvl=ansi
4209 # Ultrix and OSF/1      -std1
4210 # HP-UX 10.20 and later -Ae
4211 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4212 # SVR4                  -Xc -D__EXTENSIONS__
4213 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4214 do
4215   CC="$ac_save_CC $ac_arg"
4216   cat > conftest.$ac_ext <<EOF
4217 #line 4218 "configure"
4218 #include "confdefs.h"
4219 #include <stdarg.h>
4220 #include <stdio.h>
4221 #include <sys/types.h>
4222 #include <sys/stat.h>
4223 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4224 struct buf { int x; };
4225 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4226 static char *e (p, i)
4227      char **p;
4228      int i;
4229 {
4230   return p[i];
4231 }
4232 static char *f (char * (*g) (char **, int), char **p, ...)
4233 {
4234   char *s;
4235   va_list v;
4236   va_start (v,p);
4237   s = g (p, va_arg (v,int));
4238   va_end (v);
4239   return s;
4240 }
4241 int test (int i, double x);
4242 struct s1 {int (*f) (int a);};
4243 struct s2 {int (*f) (double a);};
4244 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4245 int argc;
4246 char **argv;
4247
4248 int main() {
4249
4250 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4251
4252 ; return 0; }
4253 EOF
4254 if { (eval echo configure:4255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4255   rm -rf conftest*
4256   am_cv_prog_cc_stdc="$ac_arg"; break
4257 else
4258   echo "configure: failed program was:" >&5
4259   cat conftest.$ac_ext >&5
4260 fi
4261 rm -f conftest*
4262 done
4263 CC="$ac_save_CC"
4264
4265 fi
4266
4267 if test -z "$am_cv_prog_cc_stdc"; then
4268   echo "$ac_t""none needed" 1>&6
4269 else
4270   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4271 fi
4272 case "x$am_cv_prog_cc_stdc" in
4273   x|xno) ;;
4274   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4275 esac
4276
4277 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4278         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4279 fi
4280
4281 # test for make depend flag
4282 OL_MKDEP=
4283 OL_MKDEP_FLAGS=
4284 if test -z "${MKDEP}"; then
4285         OL_MKDEP="${CC-cc}"
4286         if test -z "${MKDEP_FLAGS}"; then
4287                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4288 echo "configure:4289: checking for ${OL_MKDEP} depend flag" >&5
4289 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4290   echo $ac_n "(cached) $ac_c" 1>&6
4291 else
4292   
4293                         ol_cv_mkdep=no
4294                         for flag in "-M" "-xM"; do
4295                                 cat > conftest.c <<EOF
4296  noCode;
4297 EOF
4298                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4299                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4300                                 then
4301                                         if test ! -f conftest."${ac_object}" ; then
4302                                                 ol_cv_mkdep=$flag
4303                                                 OL_MKDEP_FLAGS="$flag"
4304                                                 break
4305                                         fi
4306                                 fi
4307                         done
4308                         rm -f conftest*
4309                 
4310 fi
4311
4312 echo "$ac_t""$ol_cv_mkdep" 1>&6
4313         else
4314                 cc_cv_mkdep=yes
4315                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4316         fi
4317 else
4318         cc_cv_mkdep=yes
4319         OL_MKDEP="${MKDEP}"
4320         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4321 fi
4322
4323
4324
4325 if test "${ol_cv_mkdep}" = no ; then
4326         # this will soon become an error
4327         echo "configure: warning: do not know how to generate dependencies" 1>&2
4328 fi
4329
4330 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4331 echo "configure:4332: checking for afopen in -ls" >&5
4332 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4333 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4334   echo $ac_n "(cached) $ac_c" 1>&6
4335 else
4336   ac_save_LIBS="$LIBS"
4337 LIBS="-ls  $LIBS"
4338 cat > conftest.$ac_ext <<EOF
4339 #line 4340 "configure"
4340 #include "confdefs.h"
4341 /* Override any gcc2 internal prototype to avoid an error.  */
4342 /* We use char because int might match the return type of a gcc2
4343     builtin and then its argument prototype would still apply.  */
4344 char afopen();
4345
4346 int main() {
4347 afopen()
4348 ; return 0; }
4349 EOF
4350 if { (eval echo configure:4351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4351   rm -rf conftest*
4352   eval "ac_cv_lib_$ac_lib_var=yes"
4353 else
4354   echo "configure: failed program was:" >&5
4355   cat conftest.$ac_ext >&5
4356   rm -rf conftest*
4357   eval "ac_cv_lib_$ac_lib_var=no"
4358 fi
4359 rm -f conftest*
4360 LIBS="$ac_save_LIBS"
4361
4362 fi
4363 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4364   echo "$ac_t""yes" 1>&6
4365   
4366         AUTH_LIBS=-ls
4367         cat >> confdefs.h <<\EOF
4368 #define HAVE_AIX_SECURITY 1
4369 EOF
4370
4371
4372 else
4373   echo "$ac_t""no" 1>&6
4374 fi
4375
4376
4377
4378 ol_link_modules=no
4379 if test $ol_enable_modules != no ; then
4380         for ac_hdr in ltdl.h
4381 do
4382 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4383 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4384 echo "configure:4385: checking for $ac_hdr" >&5
4385 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4386   echo $ac_n "(cached) $ac_c" 1>&6
4387 else
4388   cat > conftest.$ac_ext <<EOF
4389 #line 4390 "configure"
4390 #include "confdefs.h"
4391 #include <$ac_hdr>
4392 EOF
4393 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4394 { (eval echo configure:4395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4395 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4396 if test -z "$ac_err"; then
4397   rm -rf conftest*
4398   eval "ac_cv_header_$ac_safe=yes"
4399 else
4400   echo "$ac_err" >&5
4401   echo "configure: failed program was:" >&5
4402   cat conftest.$ac_ext >&5
4403   rm -rf conftest*
4404   eval "ac_cv_header_$ac_safe=no"
4405 fi
4406 rm -f conftest*
4407 fi
4408 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4409   echo "$ac_t""yes" 1>&6
4410     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4411   cat >> confdefs.h <<EOF
4412 #define $ac_tr_hdr 1
4413 EOF
4414  
4415 else
4416   echo "$ac_t""no" 1>&6
4417 fi
4418 done
4419
4420
4421         if test $ac_cv_header_ltdl_h = no ; then
4422                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4423         fi
4424
4425         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4426 echo "configure:4427: checking for lt_dlinit in -lltdl" >&5
4427 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4428 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4429   echo $ac_n "(cached) $ac_c" 1>&6
4430 else
4431   ac_save_LIBS="$LIBS"
4432 LIBS="-lltdl  $LIBS"
4433 cat > conftest.$ac_ext <<EOF
4434 #line 4435 "configure"
4435 #include "confdefs.h"
4436 /* Override any gcc2 internal prototype to avoid an error.  */
4437 /* We use char because int might match the return type of a gcc2
4438     builtin and then its argument prototype would still apply.  */
4439 char lt_dlinit();
4440
4441 int main() {
4442 lt_dlinit()
4443 ; return 0; }
4444 EOF
4445 if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4446   rm -rf conftest*
4447   eval "ac_cv_lib_$ac_lib_var=yes"
4448 else
4449   echo "configure: failed program was:" >&5
4450   cat conftest.$ac_ext >&5
4451   rm -rf conftest*
4452   eval "ac_cv_lib_$ac_lib_var=no"
4453 fi
4454 rm -f conftest*
4455 LIBS="$ac_save_LIBS"
4456
4457 fi
4458 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4459   echo "$ac_t""yes" 1>&6
4460   
4461             MODULES_LIBS=-lltdl
4462             cat >> confdefs.h <<\EOF
4463 #define HAVE_LIBLTDL 1
4464 EOF
4465
4466         
4467 else
4468   echo "$ac_t""no" 1>&6
4469 fi
4470
4471
4472         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4473                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4474         fi
4475         ol_link_modules=yes
4476 else
4477         ol_with_bdb_module=static
4478         ol_with_dnssrv_module=static
4479         ol_with_ldap_module=static
4480         ol_with_ldbm_module=static
4481         ol_with_meta_module=static
4482         ol_with_monitor_module=static
4483         ol_with_passwd_module=static
4484         ol_with_perl_module=static
4485         ol_with_shell_module=static
4486         ol_with_tcl_module=static
4487         ol_with_sql_module=static
4488 fi
4489
4490 # test for EBCDIC
4491 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4492 echo "configure:4493: checking for EBCDIC" >&5
4493 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4494   echo $ac_n "(cached) $ac_c" 1>&6
4495 else
4496   
4497         cat > conftest.$ac_ext <<EOF
4498 #line 4499 "configure"
4499 #include "confdefs.h"
4500
4501 #if !('M' == 0xd4)
4502 #include <__ASCII__/generate_error.h>
4503 #endif
4504
4505 EOF
4506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4507 { (eval echo configure:4508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4509 if test -z "$ac_err"; then
4510   rm -rf conftest*
4511   ol_cv_cpp_ebcdic=yes
4512 else
4513   echo "$ac_err" >&5
4514   echo "configure: failed program was:" >&5
4515   cat conftest.$ac_ext >&5
4516   rm -rf conftest*
4517   ol_cv_cpp_ebcdic=no
4518 fi
4519 rm -f conftest*
4520 fi
4521
4522 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4523 if test $ol_cv_cpp_ebcdic = yes ; then
4524         cat >> confdefs.h <<\EOF
4525 #define HAVE_EBCDIC 1
4526 EOF
4527
4528 fi
4529
4530 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4531 echo "configure:4532: checking for ANSI C header files" >&5
4532 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4533   echo $ac_n "(cached) $ac_c" 1>&6
4534 else
4535   cat > conftest.$ac_ext <<EOF
4536 #line 4537 "configure"
4537 #include "confdefs.h"
4538 #include <stdlib.h>
4539 #include <stdarg.h>
4540 #include <string.h>
4541 #include <float.h>
4542 EOF
4543 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4544 { (eval echo configure:4545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4545 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4546 if test -z "$ac_err"; then
4547   rm -rf conftest*
4548   ol_cv_header_stdc=yes
4549 else
4550   echo "$ac_err" >&5
4551   echo "configure: failed program was:" >&5
4552   cat conftest.$ac_ext >&5
4553   rm -rf conftest*
4554   ol_cv_header_stdc=no
4555 fi
4556 rm -f conftest*
4557
4558 if test $ol_cv_header_stdc = yes; then
4559   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4560 cat > conftest.$ac_ext <<EOF
4561 #line 4562 "configure"
4562 #include "confdefs.h"
4563 #include <string.h>
4564 EOF
4565 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4566   egrep "memchr" >/dev/null 2>&1; then
4567   :
4568 else
4569   rm -rf conftest*
4570   ol_cv_header_stdc=no
4571 fi
4572 rm -f conftest*
4573
4574 fi
4575
4576 if test $ol_cv_header_stdc = yes; then
4577   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4578 cat > conftest.$ac_ext <<EOF
4579 #line 4580 "configure"
4580 #include "confdefs.h"
4581 #include <stdlib.h>
4582 EOF
4583 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4584   egrep "free" >/dev/null 2>&1; then
4585   :
4586 else
4587   rm -rf conftest*
4588   ol_cv_header_stdc=no
4589 fi
4590 rm -f conftest*
4591
4592 fi
4593
4594 if test $ol_cv_header_stdc = yes; then
4595   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4596 if test "$cross_compiling" = yes; then
4597   :
4598 else
4599   cat > conftest.$ac_ext <<EOF
4600 #line 4601 "configure"
4601 #include "confdefs.h"
4602 #include <ctype.h>
4603 #ifndef HAVE_EBCDIC
4604 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4605 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4606 #else
4607 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4608                 || ('j' <= (c) && (c) <= 'r') \
4609                 || ('s' <= (c) && (c) <= 'z'))
4610 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4611 #endif
4612 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4613 int main () { int i; for (i = 0; i < 256; i++)
4614 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4615 exit (0); }
4616
4617 EOF
4618 if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4619 then
4620   :
4621 else
4622   echo "configure: failed program was:" >&5
4623   cat conftest.$ac_ext >&5
4624   rm -fr conftest*
4625   ol_cv_header_stdc=no
4626 fi
4627 rm -fr conftest*
4628 fi
4629
4630 fi
4631 fi
4632
4633 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4634 if test $ol_cv_header_stdc = yes; then
4635   cat >> confdefs.h <<\EOF
4636 #define STDC_HEADERS 1
4637 EOF
4638
4639 fi
4640 ac_cv_header_stdc=disable
4641
4642
4643 if test $ol_cv_header_stdc != yes; then
4644         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4645 fi
4646
4647 ac_header_dirent=no
4648 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4649 do
4650 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4651 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4652 echo "configure:4653: checking for $ac_hdr that defines DIR" >&5
4653 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4654   echo $ac_n "(cached) $ac_c" 1>&6
4655 else
4656   cat > conftest.$ac_ext <<EOF
4657 #line 4658 "configure"
4658 #include "confdefs.h"
4659 #include <sys/types.h>
4660 #include <$ac_hdr>
4661 int main() {
4662 DIR *dirp = 0;
4663 ; return 0; }
4664 EOF
4665 if { (eval echo configure:4666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4666   rm -rf conftest*
4667   eval "ac_cv_header_dirent_$ac_safe=yes"
4668 else
4669   echo "configure: failed program was:" >&5
4670   cat conftest.$ac_ext >&5
4671   rm -rf conftest*
4672   eval "ac_cv_header_dirent_$ac_safe=no"
4673 fi
4674 rm -f conftest*
4675 fi
4676 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4677   echo "$ac_t""yes" 1>&6
4678     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4679   cat >> confdefs.h <<EOF
4680 #define $ac_tr_hdr 1
4681 EOF
4682  ac_header_dirent=$ac_hdr; break
4683 else
4684   echo "$ac_t""no" 1>&6
4685 fi
4686 done
4687 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4688 if test $ac_header_dirent = dirent.h; then
4689 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4690 echo "configure:4691: checking for opendir in -ldir" >&5
4691 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4692 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4693   echo $ac_n "(cached) $ac_c" 1>&6
4694 else
4695   ac_save_LIBS="$LIBS"
4696 LIBS="-ldir  $LIBS"
4697 cat > conftest.$ac_ext <<EOF
4698 #line 4699 "configure"
4699 #include "confdefs.h"
4700 /* Override any gcc2 internal prototype to avoid an error.  */
4701 /* We use char because int might match the return type of a gcc2
4702     builtin and then its argument prototype would still apply.  */
4703 char opendir();
4704
4705 int main() {
4706 opendir()
4707 ; return 0; }
4708 EOF
4709 if { (eval echo configure:4710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4710   rm -rf conftest*
4711   eval "ac_cv_lib_$ac_lib_var=yes"
4712 else
4713   echo "configure: failed program was:" >&5
4714   cat conftest.$ac_ext >&5
4715   rm -rf conftest*
4716   eval "ac_cv_lib_$ac_lib_var=no"
4717 fi
4718 rm -f conftest*
4719 LIBS="$ac_save_LIBS"
4720
4721 fi
4722 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4723   echo "$ac_t""yes" 1>&6
4724   LIBS="$LIBS -ldir"
4725 else
4726   echo "$ac_t""no" 1>&6
4727 fi
4728
4729 else
4730 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4731 echo "configure:4732: checking for opendir in -lx" >&5
4732 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4733 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4734   echo $ac_n "(cached) $ac_c" 1>&6
4735 else
4736   ac_save_LIBS="$LIBS"
4737 LIBS="-lx  $LIBS"
4738 cat > conftest.$ac_ext <<EOF
4739 #line 4740 "configure"
4740 #include "confdefs.h"
4741 /* Override any gcc2 internal prototype to avoid an error.  */
4742 /* We use char because int might match the return type of a gcc2
4743     builtin and then its argument prototype would still apply.  */
4744 char opendir();
4745
4746 int main() {
4747 opendir()
4748 ; return 0; }
4749 EOF
4750 if { (eval echo configure:4751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4751   rm -rf conftest*
4752   eval "ac_cv_lib_$ac_lib_var=yes"
4753 else
4754   echo "configure: failed program was:" >&5
4755   cat conftest.$ac_ext >&5
4756   rm -rf conftest*
4757   eval "ac_cv_lib_$ac_lib_var=no"
4758 fi
4759 rm -f conftest*
4760 LIBS="$ac_save_LIBS"
4761
4762 fi
4763 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4764   echo "$ac_t""yes" 1>&6
4765   LIBS="$LIBS -lx"
4766 else
4767   echo "$ac_t""no" 1>&6
4768 fi
4769
4770 fi
4771
4772 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4773 echo "configure:4774: checking for sys/wait.h that is POSIX.1 compatible" >&5
4774 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4775   echo $ac_n "(cached) $ac_c" 1>&6
4776 else
4777   cat > conftest.$ac_ext <<EOF
4778 #line 4779 "configure"
4779 #include "confdefs.h"
4780 #include <sys/types.h>
4781 #include <sys/wait.h>
4782 #ifndef WEXITSTATUS
4783 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4784 #endif
4785 #ifndef WIFEXITED
4786 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4787 #endif
4788 int main() {
4789 int s;
4790 wait (&s);
4791 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4792 ; return 0; }
4793 EOF
4794 if { (eval echo configure:4795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4795   rm -rf conftest*
4796   ac_cv_header_sys_wait_h=yes
4797 else
4798   echo "configure: failed program was:" >&5
4799   cat conftest.$ac_ext >&5
4800   rm -rf conftest*
4801   ac_cv_header_sys_wait_h=no
4802 fi
4803 rm -f conftest*
4804 fi
4805
4806 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4807 if test $ac_cv_header_sys_wait_h = yes; then
4808   cat >> confdefs.h <<\EOF
4809 #define HAVE_SYS_WAIT_H 1
4810 EOF
4811
4812 fi
4813
4814 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4815 echo "configure:4816: checking POSIX termios" >&5
4816 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4817   echo $ac_n "(cached) $ac_c" 1>&6
4818 else
4819   cat > conftest.$ac_ext <<EOF
4820 #line 4821 "configure"
4821 #include "confdefs.h"
4822 #include <sys/types.h>
4823 #include <unistd.h>
4824 #include <termios.h>
4825 int main() {
4826 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4827    tcgetattr(0, 0);
4828 ; return 0; }
4829 EOF
4830 if { (eval echo configure:4831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4831   rm -rf conftest*
4832   am_cv_sys_posix_termios=yes
4833 else
4834   echo "configure: failed program was:" >&5
4835   cat conftest.$ac_ext >&5
4836   rm -rf conftest*
4837   am_cv_sys_posix_termios=no
4838 fi
4839 rm -f conftest*
4840 fi
4841
4842 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4843
4844
4845  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4846 echo "configure:4847: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4847 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4848   echo $ac_n "(cached) $ac_c" 1>&6
4849 else
4850   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4851
4852   gwinsz_in_termios_h=no
4853   if test $am_cv_sys_posix_termios = yes; then
4854     cat > conftest.$ac_ext <<EOF
4855 #line 4856 "configure"
4856 #include "confdefs.h"
4857 #include <sys/types.h>
4858 #     include <termios.h>
4859 #     ifdef TIOCGWINSZ
4860         yes
4861 #     endif
4862     
4863 EOF
4864 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4865   egrep "yes" >/dev/null 2>&1; then
4866   rm -rf conftest*
4867   gwinsz_in_termios_h=yes
4868 fi
4869 rm -f conftest*
4870
4871   fi
4872
4873   if test $gwinsz_in_termios_h = no; then
4874     cat > conftest.$ac_ext <<EOF
4875 #line 4876 "configure"
4876 #include "confdefs.h"
4877 #include <sys/types.h>
4878 #     include <sys/ioctl.h>
4879 #     ifdef TIOCGWINSZ
4880         yes
4881 #     endif
4882     
4883 EOF
4884 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4885   egrep "yes" >/dev/null 2>&1; then
4886   rm -rf conftest*
4887   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4888 fi
4889 rm -f conftest*
4890
4891   fi
4892   
4893 fi
4894
4895 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4896   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4897     cat >> confdefs.h <<\EOF
4898 #define GWINSZ_IN_SYS_IOCTL 1
4899 EOF
4900
4901   fi
4902
4903 if test $am_cv_sys_posix_termios = yes ; then
4904         cat >> confdefs.h <<\EOF
4905 #define HAVE_POSIX_TERMIOS 1
4906 EOF
4907
4908 fi
4909
4910 for ac_hdr in \
4911         arpa/inet.h             \
4912         arpa/nameser.h  \
4913         assert.h                \
4914         conio.h                 \
4915         crypt.h                 \
4916         direct.h                \
4917         errno.h                 \
4918         fcntl.h                 \
4919         filio.h                 \
4920         getopt.h                \
4921         grp.h                   \
4922         io.h                    \
4923         libutil.h               \
4924         limits.h                \
4925         locale.h                \
4926         netinet/tcp.h   \
4927         malloc.h                \
4928         memory.h                \
4929         psap.h                  \
4930         pwd.h                   \
4931         process.h               \
4932         resolv.h                \
4933         sgtty.h                 \
4934         shadow.h                \
4935         stddef.h                \
4936         string.h                \
4937         strings.h               \
4938         sysexits.h              \
4939         sys/file.h              \
4940         sys/filio.h             \
4941         sys/errno.h             \
4942         sys/ioctl.h             \
4943         sys/param.h             \
4944         sys/resource.h  \
4945         sys/select.h    \
4946         sys/socket.h    \
4947         sys/syslog.h    \
4948         sys/time.h              \
4949         sys/types.h             \
4950         syslog.h                \
4951         termios.h               \
4952         unistd.h                \
4953         winsock.h               \
4954
4955 do
4956 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4957 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4958 echo "configure:4959: checking for $ac_hdr" >&5
4959 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4960   echo $ac_n "(cached) $ac_c" 1>&6
4961 else
4962   cat > conftest.$ac_ext <<EOF
4963 #line 4964 "configure"
4964 #include "confdefs.h"
4965 #include <$ac_hdr>
4966 EOF
4967 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4968 { (eval echo configure:4969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4969 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4970 if test -z "$ac_err"; then
4971   rm -rf conftest*
4972   eval "ac_cv_header_$ac_safe=yes"
4973 else
4974   echo "$ac_err" >&5
4975   echo "configure: failed program was:" >&5
4976   cat conftest.$ac_ext >&5
4977   rm -rf conftest*
4978   eval "ac_cv_header_$ac_safe=no"
4979 fi
4980 rm -f conftest*
4981 fi
4982 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4983   echo "$ac_t""yes" 1>&6
4984     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4985   cat >> confdefs.h <<EOF
4986 #define $ac_tr_hdr 1
4987 EOF
4988  
4989 else
4990   echo "$ac_t""no" 1>&6
4991 fi
4992 done
4993
4994
4995
4996
4997 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4998 echo "configure:4999: checking for dlopen" >&5
4999 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5000   echo $ac_n "(cached) $ac_c" 1>&6
5001 else
5002   cat > conftest.$ac_ext <<EOF
5003 #line 5004 "configure"
5004 #include "confdefs.h"
5005 /* System header to define __stub macros and hopefully few prototypes,
5006     which can conflict with char dlopen(); below.  */
5007 #include <assert.h>
5008 /* Override any gcc2 internal prototype to avoid an error.  */
5009 /* We use char because int might match the return type of a gcc2
5010     builtin and then its argument prototype would still apply.  */
5011 char dlopen();
5012 char (*f)();
5013
5014 int main() {
5015
5016 /* The GNU C library defines this for functions which it implements
5017     to always fail with ENOSYS.  Some functions are actually named
5018     something starting with __ and the normal name is an alias.  */
5019 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5020 choke me
5021 #else
5022 f = dlopen;
5023 #endif
5024
5025 ; return 0; }
5026 EOF
5027 if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5028   rm -rf conftest*
5029   eval "ac_cv_func_dlopen=yes"
5030 else
5031   echo "configure: failed program was:" >&5
5032   cat conftest.$ac_ext >&5
5033   rm -rf conftest*
5034   eval "ac_cv_func_dlopen=no"
5035 fi
5036 rm -f conftest*
5037 fi
5038
5039 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5040   echo "$ac_t""yes" 1>&6
5041   :
5042 else
5043   echo "$ac_t""no" 1>&6
5044 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5045 echo "configure:5046: checking for dlopen in -ldl" >&5
5046 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5047 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5048   echo $ac_n "(cached) $ac_c" 1>&6
5049 else
5050   ac_save_LIBS="$LIBS"
5051 LIBS="-ldl  $LIBS"
5052 cat > conftest.$ac_ext <<EOF
5053 #line 5054 "configure"
5054 #include "confdefs.h"
5055 /* Override any gcc2 internal prototype to avoid an error.  */
5056 /* We use char because int might match the return type of a gcc2
5057     builtin and then its argument prototype would still apply.  */
5058 char dlopen();
5059
5060 int main() {
5061 dlopen()
5062 ; return 0; }
5063 EOF
5064 if { (eval echo configure:5065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5065   rm -rf conftest*
5066   eval "ac_cv_lib_$ac_lib_var=yes"
5067 else
5068   echo "configure: failed program was:" >&5
5069   cat conftest.$ac_ext >&5
5070   rm -rf conftest*
5071   eval "ac_cv_lib_$ac_lib_var=no"
5072 fi
5073 rm -f conftest*
5074 LIBS="$ac_save_LIBS"
5075
5076 fi
5077 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5078   echo "$ac_t""yes" 1>&6
5079     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5080     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5081   cat >> confdefs.h <<EOF
5082 #define $ac_tr_lib 1
5083 EOF
5084
5085   LIBS="-ldl $LIBS"
5086
5087 else
5088   echo "$ac_t""no" 1>&6
5089 fi
5090
5091 fi
5092
5093
5094 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5095 echo "configure:5096: checking for sigset in -lV3" >&5
5096 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5097 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5098   echo $ac_n "(cached) $ac_c" 1>&6
5099 else
5100   ac_save_LIBS="$LIBS"
5101 LIBS="-lV3  $LIBS"
5102 cat > conftest.$ac_ext <<EOF
5103 #line 5104 "configure"
5104 #include "confdefs.h"
5105 /* Override any gcc2 internal prototype to avoid an error.  */
5106 /* We use char because int might match the return type of a gcc2
5107     builtin and then its argument prototype would still apply.  */
5108 char sigset();
5109
5110 int main() {
5111 sigset()
5112 ; return 0; }
5113 EOF
5114 if { (eval echo configure:5115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5115   rm -rf conftest*
5116   eval "ac_cv_lib_$ac_lib_var=yes"
5117 else
5118   echo "configure: failed program was:" >&5
5119   cat conftest.$ac_ext >&5
5120   rm -rf conftest*
5121   eval "ac_cv_lib_$ac_lib_var=no"
5122 fi
5123 rm -f conftest*
5124 LIBS="$ac_save_LIBS"
5125
5126 fi
5127 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5128   echo "$ac_t""yes" 1>&6
5129     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5130     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5131   cat >> confdefs.h <<EOF
5132 #define $ac_tr_lib 1
5133 EOF
5134
5135   LIBS="-lV3 $LIBS"
5136
5137 else
5138   echo "$ac_t""no" 1>&6
5139 fi
5140
5141
5142 if test $ac_cv_header_winsock_h = yes; then
5143         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5144 echo "configure:5145: checking for winsock" >&5
5145 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
5146   echo $ac_n "(cached) $ac_c" 1>&6
5147 else
5148   cat > conftest.$ac_ext <<EOF
5149 #line 5150 "configure"
5150 #include "confdefs.h"
5151 #include <winsock.h>
5152 int main() {
5153
5154                         socket(0,0,0);
5155                         select(0,NULL,NULL,NULL,NULL);
5156                         closesocket(0);
5157                         gethostname(NULL,0);
5158         
5159 ; return 0; }
5160 EOF
5161 if { (eval echo configure:5162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5162   rm -rf conftest*
5163   ol_cv_winsock=yes
5164 else
5165   echo "configure: failed program was:" >&5
5166   cat conftest.$ac_ext >&5
5167   rm -rf conftest*
5168   ol_cv_winsock=no
5169 fi
5170 rm -f conftest*
5171 fi
5172
5173 echo "$ac_t""$ol_cv_winsock" 1>&6
5174
5175         if test $ol_cv_winsock = yes ; then
5176                 cat >> confdefs.h <<\EOF
5177 #define HAVE_WINSOCK 1
5178 EOF
5179
5180                 ac_cv_func_socket=yes
5181                 ac_cv_func_select=yes
5182                 ac_cv_func_closesocket=yes
5183                 ac_cv_func_gethostname=yes
5184         fi
5185 fi
5186
5187
5188 echo $ac_n "checking for socket""... $ac_c" 1>&6
5189 echo "configure:5190: checking for socket" >&5
5190 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5191   echo $ac_n "(cached) $ac_c" 1>&6
5192 else
5193   cat > conftest.$ac_ext <<EOF
5194 #line 5195 "configure"
5195 #include "confdefs.h"
5196 /* System header to define __stub macros and hopefully few prototypes,
5197     which can conflict with char socket(); below.  */
5198 #include <assert.h>
5199 /* Override any gcc2 internal prototype to avoid an error.  */
5200 /* We use char because int might match the return type of a gcc2
5201     builtin and then its argument prototype would still apply.  */
5202 char socket();
5203 char (*f)();
5204
5205 int main() {
5206
5207 /* The GNU C library defines this for functions which it implements
5208     to always fail with ENOSYS.  Some functions are actually named
5209     something starting with __ and the normal name is an alias.  */
5210 #if defined (__stub_socket) || defined (__stub___socket)
5211 choke me
5212 #else
5213 f = socket;
5214 #endif
5215
5216 ; return 0; }
5217 EOF
5218 if { (eval echo configure:5219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5219   rm -rf conftest*
5220   eval "ac_cv_func_socket=yes"
5221 else
5222   echo "configure: failed program was:" >&5
5223   cat conftest.$ac_ext >&5
5224   rm -rf conftest*
5225   eval "ac_cv_func_socket=no"
5226 fi
5227 rm -f conftest*
5228 fi
5229
5230 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5231   echo "$ac_t""yes" 1>&6
5232   :
5233 else
5234   echo "$ac_t""no" 1>&6
5235         
5236         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5237 echo "configure:5238: checking for main in -lsocket" >&5
5238 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5239 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5240   echo $ac_n "(cached) $ac_c" 1>&6
5241 else
5242   ac_save_LIBS="$LIBS"
5243 LIBS="-lsocket  $LIBS"
5244 cat > conftest.$ac_ext <<EOF
5245 #line 5246 "configure"
5246 #include "confdefs.h"
5247
5248 int main() {
5249 main()
5250 ; return 0; }
5251 EOF
5252 if { (eval echo configure:5253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5253   rm -rf conftest*
5254   eval "ac_cv_lib_$ac_lib_var=yes"
5255 else
5256   echo "configure: failed program was:" >&5
5257   cat conftest.$ac_ext >&5
5258   rm -rf conftest*
5259   eval "ac_cv_lib_$ac_lib_var=no"
5260 fi
5261 rm -f conftest*
5262 LIBS="$ac_save_LIBS"
5263
5264 fi
5265 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5266   echo "$ac_t""yes" 1>&6
5267     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5268     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5269   cat >> confdefs.h <<EOF
5270 #define $ac_tr_lib 1
5271 EOF
5272
5273   LIBS="-lsocket $LIBS"
5274
5275 else
5276   echo "$ac_t""no" 1>&6
5277 fi
5278
5279         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5280 echo "configure:5281: checking for main in -lnet" >&5
5281 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5282 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5283   echo $ac_n "(cached) $ac_c" 1>&6
5284 else
5285   ac_save_LIBS="$LIBS"
5286 LIBS="-lnet  $LIBS"
5287 cat > conftest.$ac_ext <<EOF
5288 #line 5289 "configure"
5289 #include "confdefs.h"
5290
5291 int main() {
5292 main()
5293 ; return 0; }
5294 EOF
5295 if { (eval echo configure:5296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5296   rm -rf conftest*
5297   eval "ac_cv_lib_$ac_lib_var=yes"
5298 else
5299   echo "configure: failed program was:" >&5
5300   cat conftest.$ac_ext >&5
5301   rm -rf conftest*
5302   eval "ac_cv_lib_$ac_lib_var=no"
5303 fi
5304 rm -f conftest*
5305 LIBS="$ac_save_LIBS"
5306
5307 fi
5308 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5309   echo "$ac_t""yes" 1>&6
5310     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5311     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5312   cat >> confdefs.h <<EOF
5313 #define $ac_tr_lib 1
5314 EOF
5315
5316   LIBS="-lnet $LIBS"
5317
5318 else
5319   echo "$ac_t""no" 1>&6
5320 fi
5321
5322         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5323 echo "configure:5324: checking for main in -lnsl_s" >&5
5324 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5325 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5326   echo $ac_n "(cached) $ac_c" 1>&6
5327 else
5328   ac_save_LIBS="$LIBS"
5329 LIBS="-lnsl_s  $LIBS"
5330 cat > conftest.$ac_ext <<EOF
5331 #line 5332 "configure"
5332 #include "confdefs.h"
5333
5334 int main() {
5335 main()
5336 ; return 0; }
5337 EOF
5338 if { (eval echo configure:5339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5339   rm -rf conftest*
5340   eval "ac_cv_lib_$ac_lib_var=yes"
5341 else
5342   echo "configure: failed program was:" >&5
5343   cat conftest.$ac_ext >&5
5344   rm -rf conftest*
5345   eval "ac_cv_lib_$ac_lib_var=no"
5346 fi
5347 rm -f conftest*
5348 LIBS="$ac_save_LIBS"
5349
5350 fi
5351 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5352   echo "$ac_t""yes" 1>&6
5353     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5354     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5355   cat >> confdefs.h <<EOF
5356 #define $ac_tr_lib 1
5357 EOF
5358
5359   LIBS="-lnsl_s $LIBS"
5360
5361 else
5362   echo "$ac_t""no" 1>&6
5363 fi
5364
5365         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5366 echo "configure:5367: checking for main in -lnsl" >&5
5367 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5368 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5369   echo $ac_n "(cached) $ac_c" 1>&6
5370 else
5371   ac_save_LIBS="$LIBS"
5372 LIBS="-lnsl  $LIBS"
5373 cat > conftest.$ac_ext <<EOF
5374 #line 5375 "configure"
5375 #include "confdefs.h"
5376
5377 int main() {
5378 main()
5379 ; return 0; }
5380 EOF
5381 if { (eval echo configure:5382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5382   rm -rf conftest*
5383   eval "ac_cv_lib_$ac_lib_var=yes"
5384 else
5385   echo "configure: failed program was:" >&5
5386   cat conftest.$ac_ext >&5
5387   rm -rf conftest*
5388   eval "ac_cv_lib_$ac_lib_var=no"
5389 fi
5390 rm -f conftest*
5391 LIBS="$ac_save_LIBS"
5392
5393 fi
5394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5395   echo "$ac_t""yes" 1>&6
5396     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5397     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5398   cat >> confdefs.h <<EOF
5399 #define $ac_tr_lib 1
5400 EOF
5401
5402   LIBS="-lnsl $LIBS"
5403
5404 else
5405   echo "$ac_t""no" 1>&6
5406 fi
5407
5408         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5409 echo "configure:5410: checking for socket in -linet" >&5
5410 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5411 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5412   echo $ac_n "(cached) $ac_c" 1>&6
5413 else
5414   ac_save_LIBS="$LIBS"
5415 LIBS="-linet  $LIBS"
5416 cat > conftest.$ac_ext <<EOF
5417 #line 5418 "configure"
5418 #include "confdefs.h"
5419 /* Override any gcc2 internal prototype to avoid an error.  */
5420 /* We use char because int might match the return type of a gcc2
5421     builtin and then its argument prototype would still apply.  */
5422 char socket();
5423
5424 int main() {
5425 socket()
5426 ; return 0; }
5427 EOF
5428 if { (eval echo configure:5429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5429   rm -rf conftest*
5430   eval "ac_cv_lib_$ac_lib_var=yes"
5431 else
5432   echo "configure: failed program was:" >&5
5433   cat conftest.$ac_ext >&5
5434   rm -rf conftest*
5435   eval "ac_cv_lib_$ac_lib_var=no"
5436 fi
5437 rm -f conftest*
5438 LIBS="$ac_save_LIBS"
5439
5440 fi
5441 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5442   echo "$ac_t""yes" 1>&6
5443     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5444     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5445   cat >> confdefs.h <<EOF
5446 #define $ac_tr_lib 1
5447 EOF
5448
5449   LIBS="-linet $LIBS"
5450
5451 else
5452   echo "$ac_t""no" 1>&6
5453 fi
5454
5455         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5456 echo "configure:5457: checking for main in -lgen" >&5
5457 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5458 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5459   echo $ac_n "(cached) $ac_c" 1>&6
5460 else
5461   ac_save_LIBS="$LIBS"
5462 LIBS="-lgen  $LIBS"
5463 cat > conftest.$ac_ext <<EOF
5464 #line 5465 "configure"
5465 #include "confdefs.h"
5466
5467 int main() {
5468 main()
5469 ; return 0; }
5470 EOF
5471 if { (eval echo configure:5472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5472   rm -rf conftest*
5473   eval "ac_cv_lib_$ac_lib_var=yes"
5474 else
5475   echo "configure: failed program was:" >&5
5476   cat conftest.$ac_ext >&5
5477   rm -rf conftest*
5478   eval "ac_cv_lib_$ac_lib_var=no"
5479 fi
5480 rm -f conftest*
5481 LIBS="$ac_save_LIBS"
5482
5483 fi
5484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5485   echo "$ac_t""yes" 1>&6
5486     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5487     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5488   cat >> confdefs.h <<EOF
5489 #define $ac_tr_lib 1
5490 EOF
5491
5492   LIBS="-lgen $LIBS"
5493
5494 else
5495   echo "$ac_t""no" 1>&6
5496 fi
5497
5498
5499 fi
5500
5501
5502 echo $ac_n "checking for select""... $ac_c" 1>&6
5503 echo "configure:5504: checking for select" >&5
5504 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5505   echo $ac_n "(cached) $ac_c" 1>&6
5506 else
5507   cat > conftest.$ac_ext <<EOF
5508 #line 5509 "configure"
5509 #include "confdefs.h"
5510 /* System header to define __stub macros and hopefully few prototypes,
5511     which can conflict with char select(); below.  */
5512 #include <assert.h>
5513 /* Override any gcc2 internal prototype to avoid an error.  */
5514 /* We use char because int might match the return type of a gcc2
5515     builtin and then its argument prototype would still apply.  */
5516 char select();
5517 char (*f)();
5518
5519 int main() {
5520
5521 /* The GNU C library defines this for functions which it implements
5522     to always fail with ENOSYS.  Some functions are actually named
5523     something starting with __ and the normal name is an alias.  */
5524 #if defined (__stub_select) || defined (__stub___select)
5525 choke me
5526 #else
5527 f = select;
5528 #endif
5529
5530 ; return 0; }
5531 EOF
5532 if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5533   rm -rf conftest*
5534   eval "ac_cv_func_select=yes"
5535 else
5536   echo "configure: failed program was:" >&5
5537   cat conftest.$ac_ext >&5
5538   rm -rf conftest*
5539   eval "ac_cv_func_select=no"
5540 fi
5541 rm -f conftest*
5542 fi
5543
5544 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5545   echo "$ac_t""yes" 1>&6
5546   :
5547 else
5548   echo "$ac_t""no" 1>&6
5549 { echo "configure: error: select() required." 1>&2; exit 1; }
5550 fi
5551
5552
5553 if test "${ac_cv_header_winsock_h}" != yes; then
5554                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5555 echo "configure:5556: checking types of arguments for select()" >&5
5556  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5557   echo $ac_n "(cached) $ac_c" 1>&6
5558 else
5559    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5560   echo $ac_n "(cached) $ac_c" 1>&6
5561 else
5562     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5563   echo $ac_n "(cached) $ac_c" 1>&6
5564 else
5565      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5566      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5567       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5568        cat > conftest.$ac_ext <<EOF
5569 #line 5570 "configure"
5570 #include "confdefs.h"
5571 #ifdef HAVE_SYS_TYPES_H
5572 #include <sys/types.h>
5573 #endif
5574 #ifdef HAVE_SYS_TIME_H
5575 #include <sys/time.h>
5576 #endif
5577 #ifdef HAVE_SYS_SELECT_H
5578 #include <sys/select.h>
5579 #endif
5580 #ifdef HAVE_SYS_SOCKET_H
5581 #include <sys/socket.h>
5582 #endif
5583 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);
5584 int main() {
5585
5586 ; return 0; }
5587 EOF
5588 if { (eval echo configure:5589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5589   rm -rf conftest*
5590           ac_not_found=no ; break 3
5591 else
5592   echo "configure: failed program was:" >&5
5593   cat conftest.$ac_ext >&5
5594   rm -rf conftest*
5595   ac_not_found=yes
5596 fi
5597 rm -f conftest*
5598       done
5599      done
5600     done
5601    
5602 fi
5603   
5604 fi
5605  
5606 fi
5607  if test "$ac_not_found" = yes; then
5608   ac_cv_func_select_arg1=int 
5609   ac_cv_func_select_arg234='int *' 
5610   ac_cv_func_select_arg5='struct timeval *'
5611  fi
5612  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5613  cat >> confdefs.h <<EOF
5614 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5615 EOF
5616
5617  cat >> confdefs.h <<EOF
5618 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5619 EOF
5620
5621  cat >> confdefs.h <<EOF
5622 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5623 EOF
5624
5625
5626 fi
5627
5628
5629 for ac_hdr in regex.h 
5630 do
5631 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5632 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5633 echo "configure:5634: checking for $ac_hdr" >&5
5634 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5635   echo $ac_n "(cached) $ac_c" 1>&6
5636 else
5637   cat > conftest.$ac_ext <<EOF
5638 #line 5639 "configure"
5639 #include "confdefs.h"
5640 #include <$ac_hdr>
5641 EOF
5642 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5643 { (eval echo configure:5644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5644 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5645 if test -z "$ac_err"; then
5646   rm -rf conftest*
5647   eval "ac_cv_header_$ac_safe=yes"
5648 else
5649   echo "$ac_err" >&5
5650   echo "configure: failed program was:" >&5
5651   cat conftest.$ac_ext >&5
5652   rm -rf conftest*
5653   eval "ac_cv_header_$ac_safe=no"
5654 fi
5655 rm -f conftest*
5656 fi
5657 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5658   echo "$ac_t""yes" 1>&6
5659     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5660   cat >> confdefs.h <<EOF
5661 #define $ac_tr_hdr 1
5662 EOF
5663  
5664 else
5665   echo "$ac_t""no" 1>&6
5666 fi
5667 done
5668
5669 if test "$ac_cv_header_regex_h" != yes ; then
5670         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5671 fi
5672 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5673 echo "configure:5674: checking for regfree" >&5
5674 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5675   echo $ac_n "(cached) $ac_c" 1>&6
5676 else
5677   cat > conftest.$ac_ext <<EOF
5678 #line 5679 "configure"
5679 #include "confdefs.h"
5680 /* System header to define __stub macros and hopefully few prototypes,
5681     which can conflict with char regfree(); below.  */
5682 #include <assert.h>
5683 /* Override any gcc2 internal prototype to avoid an error.  */
5684 /* We use char because int might match the return type of a gcc2
5685     builtin and then its argument prototype would still apply.  */
5686 char regfree();
5687 char (*f)();
5688
5689 int main() {
5690
5691 /* The GNU C library defines this for functions which it implements
5692     to always fail with ENOSYS.  Some functions are actually named
5693     something starting with __ and the normal name is an alias.  */
5694 #if defined (__stub_regfree) || defined (__stub___regfree)
5695 choke me
5696 #else
5697 f = regfree;
5698 #endif
5699
5700 ; return 0; }
5701 EOF
5702 if { (eval echo configure:5703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5703   rm -rf conftest*
5704   eval "ac_cv_func_regfree=yes"
5705 else
5706   echo "configure: failed program was:" >&5
5707   cat conftest.$ac_ext >&5
5708   rm -rf conftest*
5709   eval "ac_cv_func_regfree=no"
5710 fi
5711 rm -f conftest*
5712 fi
5713
5714 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5715   echo "$ac_t""yes" 1>&6
5716   :
5717 else
5718   echo "$ac_t""no" 1>&6
5719 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5720 fi
5721
5722
5723
5724 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5725 echo "configure:5726: checking for compatible POSIX regex" >&5
5726 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5727   echo $ac_n "(cached) $ac_c" 1>&6
5728 else
5729   
5730         if test "$cross_compiling" = yes; then
5731   ol_cv_c_posix_regex=cross
5732 else
5733   cat > conftest.$ac_ext <<EOF
5734 #line 5735 "configure"
5735 #include "confdefs.h"
5736
5737 #include <sys/types.h>
5738 #include <regex.h>
5739 static char *pattern, *string;
5740 main()
5741 {
5742         int rc;
5743         regex_t re;
5744
5745         pattern = "^A";
5746
5747         if(regcomp(&re, pattern, 0)) {
5748                 return -1;
5749         }
5750         
5751         string = "ALL MATCH";
5752         
5753         rc = regexec(&re, string, 0, (void*)0, 0);
5754
5755         regfree(&re);
5756
5757         return rc;
5758 }
5759 EOF
5760 if { (eval echo configure:5761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5761 then
5762   ol_cv_c_posix_regex=yes
5763 else
5764   echo "configure: failed program was:" >&5
5765   cat conftest.$ac_ext >&5
5766   rm -fr conftest*
5767   ol_cv_c_posix_regex=no
5768 fi
5769 rm -fr conftest*
5770 fi
5771
5772 fi
5773
5774 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5775
5776 if test "$ol_cv_c_posix_regex" = no ; then
5777         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5778 fi
5779
5780 ol_link_dnssrv=no
5781 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5782 echo "configure:5783: checking for res_query" >&5
5783 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5784   echo $ac_n "(cached) $ac_c" 1>&6
5785 else
5786   cat > conftest.$ac_ext <<EOF
5787 #line 5788 "configure"
5788 #include "confdefs.h"
5789 /* System header to define __stub macros and hopefully few prototypes,
5790     which can conflict with char res_query(); below.  */
5791 #include <assert.h>
5792 /* Override any gcc2 internal prototype to avoid an error.  */
5793 /* We use char because int might match the return type of a gcc2
5794     builtin and then its argument prototype would still apply.  */
5795 char res_query();
5796 char (*f)();
5797
5798 int main() {
5799
5800 /* The GNU C library defines this for functions which it implements
5801     to always fail with ENOSYS.  Some functions are actually named
5802     something starting with __ and the normal name is an alias.  */
5803 #if defined (__stub_res_query) || defined (__stub___res_query)
5804 choke me
5805 #else
5806 f = res_query;
5807 #endif
5808
5809 ; return 0; }
5810 EOF
5811 if { (eval echo configure:5812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5812   rm -rf conftest*
5813   eval "ac_cv_func_res_query=yes"
5814 else
5815   echo "configure: failed program was:" >&5
5816   cat conftest.$ac_ext >&5
5817   rm -rf conftest*
5818   eval "ac_cv_func_res_query=no"
5819 fi
5820 rm -f conftest*
5821 fi
5822
5823 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5824   echo "$ac_t""yes" 1>&6
5825   :
5826 else
5827   echo "$ac_t""no" 1>&6
5828 fi
5829
5830 if test $ac_cv_func_res_query = no ; then 
5831         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5832 echo "configure:5833: checking for __res_query" >&5
5833 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5834   echo $ac_n "(cached) $ac_c" 1>&6
5835 else
5836   cat > conftest.$ac_ext <<EOF
5837 #line 5838 "configure"
5838 #include "confdefs.h"
5839 /* System header to define __stub macros and hopefully few prototypes,
5840     which can conflict with char __res_query(); below.  */
5841 #include <assert.h>
5842 /* Override any gcc2 internal prototype to avoid an error.  */
5843 /* We use char because int might match the return type of a gcc2
5844     builtin and then its argument prototype would still apply.  */
5845 char __res_query();
5846 char (*f)();
5847
5848 int main() {
5849
5850 /* The GNU C library defines this for functions which it implements
5851     to always fail with ENOSYS.  Some functions are actually named
5852     something starting with __ and the normal name is an alias.  */
5853 #if defined (__stub___res_query) || defined (__stub_____res_query)
5854 choke me
5855 #else
5856 f = __res_query;
5857 #endif
5858
5859 ; return 0; }
5860 EOF
5861 if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5862   rm -rf conftest*
5863   eval "ac_cv_func___res_query=yes"
5864 else
5865   echo "configure: failed program was:" >&5
5866   cat conftest.$ac_ext >&5
5867   rm -rf conftest*
5868   eval "ac_cv_func___res_query=no"
5869 fi
5870 rm -f conftest*
5871 fi
5872
5873 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5874   echo "$ac_t""yes" 1>&6
5875   :
5876 else
5877   echo "$ac_t""no" 1>&6
5878 fi
5879
5880         ac_cv_func_res_query=$ac_cv_func___res_query
5881 fi
5882
5883 if test $ac_cv_func_res_query = no ; then 
5884         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5885 echo "configure:5886: checking for res_query in -lbind" >&5
5886 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5887 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5888   echo $ac_n "(cached) $ac_c" 1>&6
5889 else
5890   ac_save_LIBS="$LIBS"
5891 LIBS="-lbind  $LIBS"
5892 cat > conftest.$ac_ext <<EOF
5893 #line 5894 "configure"
5894 #include "confdefs.h"
5895 /* Override any gcc2 internal prototype to avoid an error.  */
5896 /* We use char because int might match the return type of a gcc2
5897     builtin and then its argument prototype would still apply.  */
5898 char res_query();
5899
5900 int main() {
5901 res_query()
5902 ; return 0; }
5903 EOF
5904 if { (eval echo configure:5905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5905   rm -rf conftest*
5906   eval "ac_cv_lib_$ac_lib_var=yes"
5907 else
5908   echo "configure: failed program was:" >&5
5909   cat conftest.$ac_ext >&5
5910   rm -rf conftest*
5911   eval "ac_cv_lib_$ac_lib_var=no"
5912 fi
5913 rm -f conftest*
5914 LIBS="$ac_save_LIBS"
5915
5916 fi
5917 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5918   echo "$ac_t""yes" 1>&6
5919     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5920     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5921   cat >> confdefs.h <<EOF
5922 #define $ac_tr_lib 1
5923 EOF
5924
5925   LIBS="-lbind $LIBS"
5926
5927 else
5928   echo "$ac_t""no" 1>&6
5929 fi
5930
5931         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5932 fi
5933
5934 if test $ac_cv_func_res_query = no ; then 
5935         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5936 echo "configure:5937: checking for __res_query in -lbind" >&5
5937 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5938 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5939   echo $ac_n "(cached) $ac_c" 1>&6
5940 else
5941   ac_save_LIBS="$LIBS"
5942 LIBS="-lbind  $LIBS"
5943 cat > conftest.$ac_ext <<EOF
5944 #line 5945 "configure"
5945 #include "confdefs.h"
5946 /* Override any gcc2 internal prototype to avoid an error.  */
5947 /* We use char because int might match the return type of a gcc2
5948     builtin and then its argument prototype would still apply.  */
5949 char __res_query();
5950
5951 int main() {
5952 __res_query()
5953 ; return 0; }
5954 EOF
5955 if { (eval echo configure:5956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5956   rm -rf conftest*
5957   eval "ac_cv_lib_$ac_lib_var=yes"
5958 else
5959   echo "configure: failed program was:" >&5
5960   cat conftest.$ac_ext >&5
5961   rm -rf conftest*
5962   eval "ac_cv_lib_$ac_lib_var=no"
5963 fi
5964 rm -f conftest*
5965 LIBS="$ac_save_LIBS"
5966
5967 fi
5968 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5969   echo "$ac_t""yes" 1>&6
5970     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5971     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5972   cat >> confdefs.h <<EOF
5973 #define $ac_tr_lib 1
5974 EOF
5975
5976   LIBS="-lbind $LIBS"
5977
5978 else
5979   echo "$ac_t""no" 1>&6
5980 fi
5981
5982         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5983 fi
5984
5985 if test $ac_cv_func_res_query = no ; then 
5986         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5987 echo "configure:5988: checking for res_query in -lresolv" >&5
5988 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5989 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5990   echo $ac_n "(cached) $ac_c" 1>&6
5991 else
5992   ac_save_LIBS="$LIBS"
5993 LIBS="-lresolv  $LIBS"
5994 cat > conftest.$ac_ext <<EOF
5995 #line 5996 "configure"
5996 #include "confdefs.h"
5997 /* Override any gcc2 internal prototype to avoid an error.  */
5998 /* We use char because int might match the return type of a gcc2
5999     builtin and then its argument prototype would still apply.  */
6000 char res_query();
6001
6002 int main() {
6003 res_query()
6004 ; return 0; }
6005 EOF
6006 if { (eval echo configure:6007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6007   rm -rf conftest*
6008   eval "ac_cv_lib_$ac_lib_var=yes"
6009 else
6010   echo "configure: failed program was:" >&5
6011   cat conftest.$ac_ext >&5
6012   rm -rf conftest*
6013   eval "ac_cv_lib_$ac_lib_var=no"
6014 fi
6015 rm -f conftest*
6016 LIBS="$ac_save_LIBS"
6017
6018 fi
6019 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6020   echo "$ac_t""yes" 1>&6
6021     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6022     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6023   cat >> confdefs.h <<EOF
6024 #define $ac_tr_lib 1
6025 EOF
6026
6027   LIBS="-lresolv $LIBS"
6028
6029 else
6030   echo "$ac_t""no" 1>&6
6031 fi
6032
6033         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6034 fi
6035
6036 if test "$ac_cv_func_res_query" = yes ; then
6037         cat >> confdefs.h <<\EOF
6038 #define HAVE_RES_QUERY 1
6039 EOF
6040
6041
6042         if test $ol_enable_dnssrv != no ; then
6043                 ol_link_dnssrv=yes
6044         fi
6045 fi
6046
6047 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6048         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6049 fi
6050
6051 for ac_func in getaddrinfo inet_ntop 
6052 do
6053 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6054 echo "configure:6055: checking for $ac_func" >&5
6055 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6056   echo $ac_n "(cached) $ac_c" 1>&6
6057 else
6058   cat > conftest.$ac_ext <<EOF
6059 #line 6060 "configure"
6060 #include "confdefs.h"
6061 /* System header to define __stub macros and hopefully few prototypes,
6062     which can conflict with char $ac_func(); below.  */
6063 #include <assert.h>
6064 /* Override any gcc2 internal prototype to avoid an error.  */
6065 /* We use char because int might match the return type of a gcc2
6066     builtin and then its argument prototype would still apply.  */
6067 char $ac_func();
6068 char (*f)();
6069
6070 int main() {
6071
6072 /* The GNU C library defines this for functions which it implements
6073     to always fail with ENOSYS.  Some functions are actually named
6074     something starting with __ and the normal name is an alias.  */
6075 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6076 choke me
6077 #else
6078 f = $ac_func;
6079 #endif
6080
6081 ; return 0; }
6082 EOF
6083 if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6084   rm -rf conftest*
6085   eval "ac_cv_func_$ac_func=yes"
6086 else
6087   echo "configure: failed program was:" >&5
6088   cat conftest.$ac_ext >&5
6089   rm -rf conftest*
6090   eval "ac_cv_func_$ac_func=no"
6091 fi
6092 rm -f conftest*
6093 fi
6094
6095 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6096   echo "$ac_t""yes" 1>&6
6097     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6098   cat >> confdefs.h <<EOF
6099 #define $ac_tr_func 1
6100 EOF
6101  
6102 else
6103   echo "$ac_t""no" 1>&6
6104 fi
6105 done
6106
6107
6108 ol_link_ipv6=no
6109 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6110         if test $ol_enable_ipv6 = yes ; then
6111                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6112         fi
6113 else
6114         for ac_func in gai_strerror 
6115 do
6116 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6117 echo "configure:6118: checking for $ac_func" >&5
6118 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6119   echo $ac_n "(cached) $ac_c" 1>&6
6120 else
6121   cat > conftest.$ac_ext <<EOF
6122 #line 6123 "configure"
6123 #include "confdefs.h"
6124 /* System header to define __stub macros and hopefully few prototypes,
6125     which can conflict with char $ac_func(); below.  */
6126 #include <assert.h>
6127 /* Override any gcc2 internal prototype to avoid an error.  */
6128 /* We use char because int might match the return type of a gcc2
6129     builtin and then its argument prototype would still apply.  */
6130 char $ac_func();
6131 char (*f)();
6132
6133 int main() {
6134
6135 /* The GNU C library defines this for functions which it implements
6136     to always fail with ENOSYS.  Some functions are actually named
6137     something starting with __ and the normal name is an alias.  */
6138 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6139 choke me
6140 #else
6141 f = $ac_func;
6142 #endif
6143
6144 ; return 0; }
6145 EOF
6146 if { (eval echo configure:6147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6147   rm -rf conftest*
6148   eval "ac_cv_func_$ac_func=yes"
6149 else
6150   echo "configure: failed program was:" >&5
6151   cat conftest.$ac_ext >&5
6152   rm -rf conftest*
6153   eval "ac_cv_func_$ac_func=no"
6154 fi
6155 rm -f conftest*
6156 fi
6157
6158 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6159   echo "$ac_t""yes" 1>&6
6160     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6161   cat >> confdefs.h <<EOF
6162 #define $ac_tr_func 1
6163 EOF
6164  
6165 else
6166   echo "$ac_t""no" 1>&6
6167 fi
6168 done
6169
6170
6171         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6172 echo "configure:6173: checking INET6_ADDRSTRLEN" >&5
6173 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6174   echo $ac_n "(cached) $ac_c" 1>&6
6175 else
6176   
6177                 cat > conftest.$ac_ext <<EOF
6178 #line 6179 "configure"
6179 #include "confdefs.h"
6180
6181 #                       include <netinet/in.h>
6182 #                       ifdef INET6_ADDRSTRLEN
6183                                 __has_inet6_addrstrlen__;
6184 #                       endif
6185                 
6186 EOF
6187 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6188   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6189   rm -rf conftest*
6190   ol_cv_inet6_addrstrlen=yes
6191 else
6192   rm -rf conftest*
6193   ol_cv_inet6_addrstrlen=no
6194 fi
6195 rm -f conftest*
6196
6197 fi
6198
6199 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6200
6201         if test $ol_cv_inet6_addrstrlen = yes ; then
6202                 ol_link_ipv6=yes
6203         elif test $ol_enable_ipv6 = yes ; then
6204                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6205         fi
6206 fi
6207
6208 if test $ol_enable_local != no ; then
6209         for ac_hdr in sys/un.h 
6210 do
6211 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6212 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6213 echo "configure:6214: checking for $ac_hdr" >&5
6214 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6215   echo $ac_n "(cached) $ac_c" 1>&6
6216 else
6217   cat > conftest.$ac_ext <<EOF
6218 #line 6219 "configure"
6219 #include "confdefs.h"
6220 #include <$ac_hdr>
6221 EOF
6222 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6223 { (eval echo configure:6224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6224 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6225 if test -z "$ac_err"; then
6226   rm -rf conftest*
6227   eval "ac_cv_header_$ac_safe=yes"
6228 else
6229   echo "$ac_err" >&5
6230   echo "configure: failed program was:" >&5
6231   cat conftest.$ac_ext >&5
6232   rm -rf conftest*
6233   eval "ac_cv_header_$ac_safe=no"
6234 fi
6235 rm -f conftest*
6236 fi
6237 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6238   echo "$ac_t""yes" 1>&6
6239     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6240   cat >> confdefs.h <<EOF
6241 #define $ac_tr_hdr 1
6242 EOF
6243  
6244 else
6245   echo "$ac_t""no" 1>&6
6246 fi
6247 done
6248
6249
6250         if test $ol_enable_local = auto ; then
6251                 ol_enable_local=$ac_cv_header_sys_un_h
6252         elif test $ac_cv_header_sys_un_h = no ; then
6253                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6254         fi
6255 fi
6256
6257 ol_link_kbind=no
6258 ol_link_kpasswd=no
6259 ol_link_krb5=no
6260 ol_link_krb4=no
6261
6262 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6263         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6264         -o $ol_with_kerberos = k425 ; then
6265
6266         for ac_hdr in krb5.h
6267 do
6268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6269 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6270 echo "configure:6271: checking for $ac_hdr" >&5
6271 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6272   echo $ac_n "(cached) $ac_c" 1>&6
6273 else
6274   cat > conftest.$ac_ext <<EOF
6275 #line 6276 "configure"
6276 #include "confdefs.h"
6277 #include <$ac_hdr>
6278 EOF
6279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6280 { (eval echo configure:6281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6282 if test -z "$ac_err"; then
6283   rm -rf conftest*
6284   eval "ac_cv_header_$ac_safe=yes"
6285 else
6286   echo "$ac_err" >&5
6287   echo "configure: failed program was:" >&5
6288   cat conftest.$ac_ext >&5
6289   rm -rf conftest*
6290   eval "ac_cv_header_$ac_safe=no"
6291 fi
6292 rm -f conftest*
6293 fi
6294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6295   echo "$ac_t""yes" 1>&6
6296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6297   cat >> confdefs.h <<EOF
6298 #define $ac_tr_hdr 1
6299 EOF
6300  
6301 else
6302   echo "$ac_t""no" 1>&6
6303 fi
6304 done
6305
6306
6307         if test $ac_cv_header_krb5_h = yes ; then
6308                                 for ac_hdr in heim_err.h
6309 do
6310 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6311 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6312 echo "configure:6313: checking for $ac_hdr" >&5
6313 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6314   echo $ac_n "(cached) $ac_c" 1>&6
6315 else
6316   cat > conftest.$ac_ext <<EOF
6317 #line 6318 "configure"
6318 #include "confdefs.h"
6319 #include <$ac_hdr>
6320 EOF
6321 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6322 { (eval echo configure:6323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6323 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6324 if test -z "$ac_err"; then
6325   rm -rf conftest*
6326   eval "ac_cv_header_$ac_safe=yes"
6327 else
6328   echo "$ac_err" >&5
6329   echo "configure: failed program was:" >&5
6330   cat conftest.$ac_ext >&5
6331   rm -rf conftest*
6332   eval "ac_cv_header_$ac_safe=no"
6333 fi
6334 rm -f conftest*
6335 fi
6336 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6337   echo "$ac_t""yes" 1>&6
6338     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6339   cat >> confdefs.h <<EOF
6340 #define $ac_tr_hdr 1
6341 EOF
6342  
6343 else
6344   echo "$ac_t""no" 1>&6
6345 fi
6346 done
6347
6348                 if test $ac_cv_header_heim_err_h = yes ; then
6349                         krb5_impl=heimdal
6350                 else
6351                         krb5_impl=mit
6352                 fi
6353
6354                 if test $krb5_impl = mit; then
6355                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6356 echo "configure:6357: checking for main in -lk5crypto" >&5
6357 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6358 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6359   echo $ac_n "(cached) $ac_c" 1>&6
6360 else
6361   ac_save_LIBS="$LIBS"
6362 LIBS="-lk5crypto  $LIBS"
6363 cat > conftest.$ac_ext <<EOF
6364 #line 6365 "configure"
6365 #include "confdefs.h"
6366
6367 int main() {
6368 main()
6369 ; return 0; }
6370 EOF
6371 if { (eval echo configure:6372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6372   rm -rf conftest*
6373   eval "ac_cv_lib_$ac_lib_var=yes"
6374 else
6375   echo "configure: failed program was:" >&5
6376   cat conftest.$ac_ext >&5
6377   rm -rf conftest*
6378   eval "ac_cv_lib_$ac_lib_var=no"
6379 fi
6380 rm -f conftest*
6381 LIBS="$ac_save_LIBS"
6382
6383 fi
6384 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6385   echo "$ac_t""yes" 1>&6
6386   krb5crypto=k5crypto
6387 else
6388   echo "$ac_t""no" 1>&6
6389 krb5crypto=crypto
6390 fi
6391
6392
6393                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6394 echo "configure:6395: checking for main in -lkrb5" >&5
6395 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6396 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6397   echo $ac_n "(cached) $ac_c" 1>&6
6398 else
6399   ac_save_LIBS="$LIBS"
6400 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6401 cat > conftest.$ac_ext <<EOF
6402 #line 6403 "configure"
6403 #include "confdefs.h"
6404
6405 int main() {
6406 main()
6407 ; return 0; }
6408 EOF
6409 if { (eval echo configure:6410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6410   rm -rf conftest*
6411   eval "ac_cv_lib_$ac_lib_var=yes"
6412 else
6413   echo "configure: failed program was:" >&5
6414   cat conftest.$ac_ext >&5
6415   rm -rf conftest*
6416   eval "ac_cv_lib_$ac_lib_var=no"
6417 fi
6418 rm -f conftest*
6419 LIBS="$ac_save_LIBS"
6420
6421 fi
6422 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6423   echo "$ac_t""yes" 1>&6
6424   have_krb5=yes
6425                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6426 else
6427   echo "$ac_t""no" 1>&6
6428 have_krb5=no
6429 fi
6430
6431
6432                 elif test $krb5_impl = heimdal; then
6433                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6434 echo "configure:6435: checking for main in -lkrb5" >&5
6435 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6436 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6437   echo $ac_n "(cached) $ac_c" 1>&6
6438 else
6439   ac_save_LIBS="$LIBS"
6440 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6441 cat > conftest.$ac_ext <<EOF
6442 #line 6443 "configure"
6443 #include "confdefs.h"
6444
6445 int main() {
6446 main()
6447 ; return 0; }
6448 EOF
6449 if { (eval echo configure:6450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6450   rm -rf conftest*
6451   eval "ac_cv_lib_$ac_lib_var=yes"
6452 else
6453   echo "configure: failed program was:" >&5
6454   cat conftest.$ac_ext >&5
6455   rm -rf conftest*
6456   eval "ac_cv_lib_$ac_lib_var=no"
6457 fi
6458 rm -f conftest*
6459 LIBS="$ac_save_LIBS"
6460
6461 fi
6462 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6463   echo "$ac_t""yes" 1>&6
6464   have_krb5=yes
6465                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6466 else
6467   echo "$ac_t""no" 1>&6
6468 have_krb5=no
6469 fi
6470
6471
6472                         cat >> confdefs.h <<\EOF
6473 #define HAVE_HEIMDAL_KERBEROS 1
6474 EOF
6475
6476
6477                 else
6478                         have_krb5=no
6479                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6480                 fi
6481
6482                 if test $have_krb5 = yes ; then
6483                         ol_link_krb5=yes
6484
6485                         cat >> confdefs.h <<\EOF
6486 #define HAVE_KRB5 1
6487 EOF
6488
6489
6490                         if test $ol_enable_kpasswd != no ; then
6491                                 ol_link_kpasswd=yes;
6492                         fi
6493
6494                         if test $ol_with_kerberos = k5only ; then
6495                                 ol_with_kerberos=found
6496                         fi
6497
6498                 elif test $ol_with_kerberos != auto ; then
6499                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6500                 fi
6501
6502         fi
6503 fi
6504
6505 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6506         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6507
6508         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6509 do
6510 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6511 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6512 echo "configure:6513: checking for $ac_hdr" >&5
6513 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6514   echo $ac_n "(cached) $ac_c" 1>&6
6515 else
6516   cat > conftest.$ac_ext <<EOF
6517 #line 6518 "configure"
6518 #include "confdefs.h"
6519 #include <$ac_hdr>
6520 EOF
6521 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6522 { (eval echo configure:6523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6523 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6524 if test -z "$ac_err"; then
6525   rm -rf conftest*
6526   eval "ac_cv_header_$ac_safe=yes"
6527 else
6528   echo "$ac_err" >&5
6529   echo "configure: failed program was:" >&5
6530   cat conftest.$ac_ext >&5
6531   rm -rf conftest*
6532   eval "ac_cv_header_$ac_safe=no"
6533 fi
6534 rm -f conftest*
6535 fi
6536 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6537   echo "$ac_t""yes" 1>&6
6538     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6539   cat >> confdefs.h <<EOF
6540 #define $ac_tr_hdr 1
6541 EOF
6542  
6543 else
6544   echo "$ac_t""no" 1>&6
6545 fi
6546 done
6547
6548
6549         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6550                 if test $krb5_impl = mit; then
6551                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6552 echo "configure:6553: checking for main in -lkrb4" >&5
6553 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6554 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6555   echo $ac_n "(cached) $ac_c" 1>&6
6556 else
6557   ac_save_LIBS="$LIBS"
6558 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6559 cat > conftest.$ac_ext <<EOF
6560 #line 6561 "configure"
6561 #include "confdefs.h"
6562
6563 int main() {
6564 main()
6565 ; return 0; }
6566 EOF
6567 if { (eval echo configure:6568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6568   rm -rf conftest*
6569   eval "ac_cv_lib_$ac_lib_var=yes"
6570 else
6571   echo "configure: failed program was:" >&5
6572   cat conftest.$ac_ext >&5
6573   rm -rf conftest*
6574   eval "ac_cv_lib_$ac_lib_var=no"
6575 fi
6576 rm -f conftest*
6577 LIBS="$ac_save_LIBS"
6578
6579 fi
6580 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6581   echo "$ac_t""yes" 1>&6
6582   have_k425=yes
6583                                 KRB4_LIBS="-lkrb4 -ldes425"
6584 else
6585   echo "$ac_t""no" 1>&6
6586 have_k425=no
6587 fi
6588
6589
6590                 elif test $krb5_impl = heimdal; then
6591                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6592 echo "configure:6593: checking for main in -lkrb4" >&5
6593 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6594 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6595   echo $ac_n "(cached) $ac_c" 1>&6
6596 else
6597   ac_save_LIBS="$LIBS"
6598 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6599 cat > conftest.$ac_ext <<EOF
6600 #line 6601 "configure"
6601 #include "confdefs.h"
6602
6603 int main() {
6604 main()
6605 ; return 0; }
6606 EOF
6607 if { (eval echo configure:6608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6608   rm -rf conftest*
6609   eval "ac_cv_lib_$ac_lib_var=yes"
6610 else
6611   echo "configure: failed program was:" >&5
6612   cat conftest.$ac_ext >&5
6613   rm -rf conftest*
6614   eval "ac_cv_lib_$ac_lib_var=no"
6615 fi
6616 rm -f conftest*
6617 LIBS="$ac_save_LIBS"
6618
6619 fi
6620 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6621   echo "$ac_t""yes" 1>&6
6622   have_k425=yes
6623                                 KRB4_LIBS="-lkrb4"
6624 else
6625   echo "$ac_t""no" 1>&6
6626 have_k425=no
6627 fi
6628
6629
6630                 else
6631                         have_425=no
6632                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6633                 fi
6634
6635                 if test $have_k425 = yes ; then
6636                         ol_with_kerberos=found
6637                         ol_link_krb4=yes
6638
6639                         cat >> confdefs.h <<\EOF
6640 #define HAVE_KRB425 1
6641 EOF
6642
6643                         cat >> confdefs.h <<\EOF
6644 #define HAVE_KRB4 1
6645 EOF
6646
6647
6648                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6649 echo "configure:6650: checking for des_debug in Kerberos libraries" >&5
6650 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6651   echo $ac_n "(cached) $ac_c" 1>&6
6652 else
6653   
6654                                                                 save_LIBS="$LIBS"
6655                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6656                                 cat > conftest.$ac_ext <<EOF
6657 #line 6658 "configure"
6658 #include "confdefs.h"
6659
6660 #include <kerberosIV/krb.h>
6661 #include <kerberosIV/des.h>
6662 extern int des_debug;
6663
6664 int main() {
6665
6666 des_debug = 1;
6667
6668 ; return 0; }
6669 EOF
6670 if { (eval echo configure:6671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6671   rm -rf conftest*
6672   ol_cv_var_des_debug=yes
6673 else
6674   echo "configure: failed program was:" >&5
6675   cat conftest.$ac_ext >&5
6676   rm -rf conftest*
6677   ol_cv_var_des_debug=no
6678 fi
6679 rm -f conftest*
6680                                                                 LIBS="$save_LIBS"
6681                         
6682 fi
6683
6684 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6685
6686                         if test $ol_cv_var_des_debug = yes ; then
6687                                 cat >> confdefs.h <<\EOF
6688 #define HAVE_DES_DEBUG 1
6689 EOF
6690
6691                         fi
6692
6693                         LIBS="$save_LIBS"
6694                 fi
6695         fi
6696 fi
6697
6698 if test $ol_link_krb5 = yes ; then
6699         ol_with_kerberos=found
6700 fi
6701
6702 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6703         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6704
6705         for ac_hdr in krb.h des.h krb-archaeology.h 
6706 do
6707 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6708 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6709 echo "configure:6710: checking for $ac_hdr" >&5
6710 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6711   echo $ac_n "(cached) $ac_c" 1>&6
6712 else
6713   cat > conftest.$ac_ext <<EOF
6714 #line 6715 "configure"
6715 #include "confdefs.h"
6716 #include <$ac_hdr>
6717 EOF
6718 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6719 { (eval echo configure:6720: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6720 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6721 if test -z "$ac_err"; then
6722   rm -rf conftest*
6723   eval "ac_cv_header_$ac_safe=yes"
6724 else
6725   echo "$ac_err" >&5
6726   echo "configure: failed program was:" >&5
6727   cat conftest.$ac_ext >&5
6728   rm -rf conftest*
6729   eval "ac_cv_header_$ac_safe=no"
6730 fi
6731 rm -f conftest*
6732 fi
6733 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6734   echo "$ac_t""yes" 1>&6
6735     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6736   cat >> confdefs.h <<EOF
6737 #define $ac_tr_hdr 1
6738 EOF
6739  
6740 else
6741   echo "$ac_t""no" 1>&6
6742 fi
6743 done
6744
6745
6746         if test $ac_cv_header_krb_h = yes ; then
6747                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6748 echo "configure:6749: checking for main in -lkrb" >&5
6749 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6750 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6751   echo $ac_n "(cached) $ac_c" 1>&6
6752 else
6753   ac_save_LIBS="$LIBS"
6754 LIBS="-lkrb -ldes $LIBS"
6755 cat > conftest.$ac_ext <<EOF
6756 #line 6757 "configure"
6757 #include "confdefs.h"
6758
6759 int main() {
6760 main()
6761 ; return 0; }
6762 EOF
6763 if { (eval echo configure:6764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6764   rm -rf conftest*
6765   eval "ac_cv_lib_$ac_lib_var=yes"
6766 else
6767   echo "configure: failed program was:" >&5
6768   cat conftest.$ac_ext >&5
6769   rm -rf conftest*
6770   eval "ac_cv_lib_$ac_lib_var=no"
6771 fi
6772 rm -f conftest*
6773 LIBS="$ac_save_LIBS"
6774
6775 fi
6776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6777   echo "$ac_t""yes" 1>&6
6778   have_k4=yes
6779 else
6780   echo "$ac_t""no" 1>&6
6781 have_k4=no
6782 fi
6783
6784
6785                 if test $have_k4 = yes ; then
6786                         ol_with_kerberos=found
6787                         ol_link_krb4=yes
6788
6789                         cat >> confdefs.h <<\EOF
6790 #define HAVE_KRB4 1
6791 EOF
6792
6793
6794                         KRB4_LIBS="-lkrb -ldes"
6795
6796                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6797                                 cat >> confdefs.h <<\EOF
6798 #define HAVE_KTH_KERBEROS 1
6799 EOF
6800
6801                         fi
6802                 fi
6803         fi
6804 fi
6805
6806 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6807         ol_link_kpasswd=yes
6808 fi
6809
6810 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6811         ol_link_kbind=yes
6812
6813 elif test $ol_enable_kbind = yes ; then
6814         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6815 fi
6816
6817 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6818         cat >> confdefs.h <<\EOF
6819 #define HAVE_KERBEROS 1
6820 EOF
6821
6822
6823 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6824         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6825 fi
6826
6827 ol_link_tls=no
6828 if test $ol_with_tls != no ; then
6829         for ac_hdr in openssl/ssl.h ssl.h
6830 do
6831 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6832 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6833 echo "configure:6834: checking for $ac_hdr" >&5
6834 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6835   echo $ac_n "(cached) $ac_c" 1>&6
6836 else
6837   cat > conftest.$ac_ext <<EOF
6838 #line 6839 "configure"
6839 #include "confdefs.h"
6840 #include <$ac_hdr>
6841 EOF
6842 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6843 { (eval echo configure:6844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6844 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6845 if test -z "$ac_err"; then
6846   rm -rf conftest*
6847   eval "ac_cv_header_$ac_safe=yes"
6848 else
6849   echo "$ac_err" >&5
6850   echo "configure: failed program was:" >&5
6851   cat conftest.$ac_ext >&5
6852   rm -rf conftest*
6853   eval "ac_cv_header_$ac_safe=no"
6854 fi
6855 rm -f conftest*
6856 fi
6857 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6858   echo "$ac_t""yes" 1>&6
6859     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6860   cat >> confdefs.h <<EOF
6861 #define $ac_tr_hdr 1
6862 EOF
6863  
6864 else
6865   echo "$ac_t""no" 1>&6
6866 fi
6867 done
6868
6869         
6870         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6871                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6872 echo "configure:6873: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6873 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6875   echo $ac_n "(cached) $ac_c" 1>&6
6876 else
6877   ac_save_LIBS="$LIBS"
6878 LIBS="-lssl -lcrypto $LIBS"
6879 cat > conftest.$ac_ext <<EOF
6880 #line 6881 "configure"
6881 #include "confdefs.h"
6882 /* Override any gcc2 internal prototype to avoid an error.  */
6883 /* We use char because int might match the return type of a gcc2
6884     builtin and then its argument prototype would still apply.  */
6885 char SSLeay_add_ssl_algorithms();
6886
6887 int main() {
6888 SSLeay_add_ssl_algorithms()
6889 ; return 0; }
6890 EOF
6891 if { (eval echo configure:6892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6892   rm -rf conftest*
6893   eval "ac_cv_lib_$ac_lib_var=yes"
6894 else
6895   echo "configure: failed program was:" >&5
6896   cat conftest.$ac_ext >&5
6897   rm -rf conftest*
6898   eval "ac_cv_lib_$ac_lib_var=no"
6899 fi
6900 rm -f conftest*
6901 LIBS="$ac_save_LIBS"
6902
6903 fi
6904 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6905   echo "$ac_t""yes" 1>&6
6906   have_ssleay=yes
6907                         need_rsaref=no
6908 else
6909   echo "$ac_t""no" 1>&6
6910 have_ssleay=no
6911 fi
6912
6913                         
6914                 if test $have_ssleay = no ; then
6915                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6916 echo "configure:6917: checking for SSL_library_init in -lssl" >&5
6917 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6918 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6919   echo $ac_n "(cached) $ac_c" 1>&6
6920 else
6921   ac_save_LIBS="$LIBS"
6922 LIBS="-lssl -lcrypto $LIBS"
6923 cat > conftest.$ac_ext <<EOF
6924 #line 6925 "configure"
6925 #include "confdefs.h"
6926 /* Override any gcc2 internal prototype to avoid an error.  */
6927 /* We use char because int might match the return type of a gcc2
6928     builtin and then its argument prototype would still apply.  */
6929 char SSL_library_init();
6930
6931 int main() {
6932 SSL_library_init()
6933 ; return 0; }
6934 EOF
6935 if { (eval echo configure:6936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6936   rm -rf conftest*
6937   eval "ac_cv_lib_$ac_lib_var=yes"
6938 else
6939   echo "configure: failed program was:" >&5
6940   cat conftest.$ac_ext >&5
6941   rm -rf conftest*
6942   eval "ac_cv_lib_$ac_lib_var=no"
6943 fi
6944 rm -f conftest*
6945 LIBS="$ac_save_LIBS"
6946
6947 fi
6948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6949   echo "$ac_t""yes" 1>&6
6950   have_ssleay=yes
6951                                 need_rsaref=no
6952 else
6953   echo "$ac_t""no" 1>&6
6954 have_ssleay=no
6955 fi
6956
6957                 fi
6958
6959                 if test $have_ssleay = no ; then
6960                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6961 echo "configure:6962: checking for ssl3_accept in -lssl" >&5
6962 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6963 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6964   echo $ac_n "(cached) $ac_c" 1>&6
6965 else
6966   ac_save_LIBS="$LIBS"
6967 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6968 cat > conftest.$ac_ext <<EOF
6969 #line 6970 "configure"
6970 #include "confdefs.h"
6971 /* Override any gcc2 internal prototype to avoid an error.  */
6972 /* We use char because int might match the return type of a gcc2
6973     builtin and then its argument prototype would still apply.  */
6974 char ssl3_accept();
6975
6976 int main() {
6977 ssl3_accept()
6978 ; return 0; }
6979 EOF
6980 if { (eval echo configure:6981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6981   rm -rf conftest*
6982   eval "ac_cv_lib_$ac_lib_var=yes"
6983 else
6984   echo "configure: failed program was:" >&5
6985   cat conftest.$ac_ext >&5
6986   rm -rf conftest*
6987   eval "ac_cv_lib_$ac_lib_var=no"
6988 fi
6989 rm -f conftest*
6990 LIBS="$ac_save_LIBS"
6991
6992 fi
6993 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6994   echo "$ac_t""yes" 1>&6
6995   have_ssleay=yes
6996                                 need_rsaref=yes
6997 else
6998   echo "$ac_t""no" 1>&6
6999 have_ssleay=no
7000 fi
7001
7002                 fi
7003
7004                 if test $have_ssleay = yes ; then
7005                         ol_with_tls=found
7006                         ol_link_tls=yes
7007
7008                         cat >> confdefs.h <<\EOF
7009 #define HAVE_SSLEAY 1
7010 EOF
7011
7012
7013                         if test $need_rsaref = yes; then
7014                                 cat >> confdefs.h <<\EOF
7015 #define HAVE_RSAREF 1
7016 EOF
7017
7018
7019                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7020                         else
7021                                 TLS_LIBS="-lssl -lcrypto"
7022                         fi
7023                 fi
7024         fi
7025
7026 else
7027         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7028 fi
7029
7030 if test $ol_link_tls = yes ; then
7031         cat >> confdefs.h <<\EOF
7032 #define HAVE_TLS 1
7033 EOF
7034
7035
7036 elif test $ol_with_tls = auto ; then
7037         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7038         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7039
7040 elif test $ol_with_tls != no ; then
7041         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7042 fi
7043
7044 if test $ol_enable_lmpasswd != no; then
7045         if test $ol_link_tls != yes ; then
7046                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7047         fi
7048
7049         cat >> confdefs.h <<\EOF
7050 #define SLAPD_LMHASH 1
7051 EOF
7052
7053 fi
7054
7055 for ac_func in \
7056         ctime_r                 \
7057         gethostbyname_r gethostbyaddr_r \
7058
7059 do
7060 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7061 echo "configure:7062: checking for $ac_func" >&5
7062 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7063   echo $ac_n "(cached) $ac_c" 1>&6
7064 else
7065   cat > conftest.$ac_ext <<EOF
7066 #line 7067 "configure"
7067 #include "confdefs.h"
7068 /* System header to define __stub macros and hopefully few prototypes,
7069     which can conflict with char $ac_func(); below.  */
7070 #include <assert.h>
7071 /* Override any gcc2 internal prototype to avoid an error.  */
7072 /* We use char because int might match the return type of a gcc2
7073     builtin and then its argument prototype would still apply.  */
7074 char $ac_func();
7075 char (*f)();
7076
7077 int main() {
7078
7079 /* The GNU C library defines this for functions which it implements
7080     to always fail with ENOSYS.  Some functions are actually named
7081     something starting with __ and the normal name is an alias.  */
7082 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7083 choke me
7084 #else
7085 f = $ac_func;
7086 #endif
7087
7088 ; return 0; }
7089 EOF
7090 if { (eval echo configure:7091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7091   rm -rf conftest*
7092   eval "ac_cv_func_$ac_func=yes"
7093 else
7094   echo "configure: failed program was:" >&5
7095   cat conftest.$ac_ext >&5
7096   rm -rf conftest*
7097   eval "ac_cv_func_$ac_func=no"
7098 fi
7099 rm -f conftest*
7100 fi
7101
7102 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7103   echo "$ac_t""yes" 1>&6
7104     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7105   cat >> confdefs.h <<EOF
7106 #define $ac_tr_func 1
7107 EOF
7108  
7109 else
7110   echo "$ac_t""no" 1>&6
7111 fi
7112 done
7113
7114
7115 if test "$ac_cv_func_ctime_r" = no ; then
7116         ol_cv_func_ctime_r_nargs=0
7117 else
7118         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7119 echo "configure:7120: checking number of arguments of ctime_r" >&5
7120 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7121   echo $ac_n "(cached) $ac_c" 1>&6
7122 else
7123   cat > conftest.$ac_ext <<EOF
7124 #line 7125 "configure"
7125 #include "confdefs.h"
7126 #include <time.h>
7127 int main() {
7128 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7129 ; return 0; }
7130 EOF
7131 if { (eval echo configure:7132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7132   rm -rf conftest*
7133   ol_cv_func_ctime_r_nargs3=yes
7134 else
7135   echo "configure: failed program was:" >&5
7136   cat conftest.$ac_ext >&5
7137   rm -rf conftest*
7138   ol_cv_func_ctime_r_nargs3=no
7139 fi
7140 rm -f conftest*
7141
7142         cat > conftest.$ac_ext <<EOF
7143 #line 7144 "configure"
7144 #include "confdefs.h"
7145 #include <time.h>
7146 int main() {
7147 time_t ti; char *buffer; ctime_r(&ti,buffer);
7148 ; return 0; }
7149 EOF
7150 if { (eval echo configure:7151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7151   rm -rf conftest*
7152   ol_cv_func_ctime_r_nargs2=yes
7153 else
7154   echo "configure: failed program was:" >&5
7155   cat conftest.$ac_ext >&5
7156   rm -rf conftest*
7157   ol_cv_func_ctime_r_nargs2=no
7158 fi
7159 rm -f conftest*
7160
7161         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7162                 $ol_cv_func_ctime_r_nargs2 = no ; then
7163
7164                 ol_cv_func_ctime_r_nargs=3
7165
7166         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7167                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7168
7169                 ol_cv_func_ctime_r_nargs=2
7170
7171         else
7172                 ol_cv_func_ctime_r_nargs=0
7173         fi
7174   
7175 fi
7176
7177 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7178
7179   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7180         cat >> confdefs.h <<EOF
7181 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7182 EOF
7183
7184   fi
7185
7186 fi
7187
7188 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7189         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7190 echo "configure:7191: checking number of arguments of gethostbyname_r" >&5
7191 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7192   echo $ac_n "(cached) $ac_c" 1>&6
7193 else
7194   cat > conftest.$ac_ext <<EOF
7195 #line 7196 "configure"
7196 #include "confdefs.h"
7197 #include <sys/types.h>
7198 #include <sys/socket.h>
7199 #include <netinet/in.h>
7200 #include <netdb.h>
7201 #define BUFSIZE (sizeof(struct hostent)+10)
7202 int main() {
7203 struct hostent hent; char buffer[BUFSIZE];
7204                 int bufsize=BUFSIZE;int h_errno;
7205                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7206                         buffer, bufsize, &h_errno);
7207 ; return 0; }
7208 EOF
7209 if { (eval echo configure:7210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7210   rm -rf conftest*
7211   ol_cv_func_gethostbyname_r_nargs5=yes
7212 else
7213   echo "configure: failed program was:" >&5
7214   cat conftest.$ac_ext >&5
7215   rm -rf conftest*
7216   ol_cv_func_gethostbyname_r_nargs5=no
7217 fi
7218 rm -f conftest*
7219
7220         cat > conftest.$ac_ext <<EOF
7221 #line 7222 "configure"
7222 #include "confdefs.h"
7223 #include <sys/types.h>
7224 #include <sys/socket.h>
7225 #include <netinet/in.h>
7226 #include <netdb.h>
7227 #define BUFSIZE (sizeof(struct hostent)+10)
7228 int main() {
7229 struct hostent hent;struct hostent *rhent;
7230                 char buffer[BUFSIZE];
7231                 int bufsize=BUFSIZE;int h_errno;
7232                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7233                         &rhent, &h_errno);
7234 ; return 0; }
7235 EOF
7236 if { (eval echo configure:7237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7237   rm -rf conftest*
7238   ol_cv_func_gethostbyname_r_nargs6=yes
7239 else
7240   echo "configure: failed program was:" >&5
7241   cat conftest.$ac_ext >&5
7242   rm -rf conftest*
7243   ol_cv_func_gethostbyname_r_nargs6=no
7244 fi
7245 rm -f conftest*
7246
7247         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7248                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7249
7250                 ol_cv_func_gethostbyname_r_nargs=5
7251
7252         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7253                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7254
7255                 ol_cv_func_gethostbyname_r_nargs=6
7256
7257         else
7258                 ol_cv_func_gethostbyname_r_nargs=0
7259         fi
7260   
7261 fi
7262
7263 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7264   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7265         cat >> confdefs.h <<EOF
7266 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7267 EOF
7268
7269   fi
7270
7271 else
7272         ol_cv_func_gethostbyname_r_nargs=0
7273 fi
7274  
7275 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7276         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7277 echo "configure:7278: checking number of arguments of gethostbyaddr_r" >&5
7278 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7279   echo $ac_n "(cached) $ac_c" 1>&6
7280 else
7281   cat > conftest.$ac_ext <<EOF
7282 #line 7283 "configure"
7283 #include "confdefs.h"
7284 #include <sys/types.h>
7285 #include <sys/socket.h>
7286 #include <netinet/in.h>
7287 #include <netdb.h>
7288 #define BUFSIZE (sizeof(struct hostent)+10)
7289 int main() {
7290 struct hostent hent; char buffer[BUFSIZE]; 
7291             struct in_addr add;
7292             size_t alen=sizeof(struct in_addr);
7293             int bufsize=BUFSIZE;int h_errno;
7294                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7295                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7296 ; return 0; }
7297 EOF
7298 if { (eval echo configure:7299: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7299   rm -rf conftest*
7300   ol_cv_func_gethostbyaddr_r_nargs7=yes
7301 else
7302   echo "configure: failed program was:" >&5
7303   cat conftest.$ac_ext >&5
7304   rm -rf conftest*
7305   ol_cv_func_gethostbyaddr_r_nargs7=no
7306 fi
7307 rm -f conftest*
7308
7309         cat > conftest.$ac_ext <<EOF
7310 #line 7311 "configure"
7311 #include "confdefs.h"
7312 #include <sys/types.h>
7313 #include <sys/socket.h>
7314 #include <netinet/in.h>
7315 #include <netdb.h>
7316 #define BUFSIZE (sizeof(struct hostent)+10)
7317 int main() {
7318 struct hostent hent;
7319                 struct hostent *rhent; char buffer[BUFSIZE]; 
7320                 struct in_addr add;
7321                 size_t alen=sizeof(struct in_addr);
7322                 int bufsize=BUFSIZE;int h_errno;
7323                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7324                         alen, AF_INET, &hent, buffer, bufsize, 
7325                         &rhent, &h_errno);
7326 ; return 0; }
7327 EOF
7328 if { (eval echo configure:7329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7329   rm -rf conftest*
7330   ol_cv_func_gethostbyaddr_r_nargs8=yes
7331 else
7332   echo "configure: failed program was:" >&5
7333   cat conftest.$ac_ext >&5
7334   rm -rf conftest*
7335   ol_cv_func_gethostbyaddr_r_nargs8=no
7336 fi
7337 rm -f conftest*
7338
7339         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7340                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7341
7342                 ol_cv_func_gethostbyaddr_r_nargs=7
7343
7344         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7345                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7346
7347                 ol_cv_func_gethostbyaddr_r_nargs=8
7348
7349         else
7350                 ol_cv_func_gethostbyaddr_r_nargs=0
7351         fi
7352   
7353 fi
7354
7355 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7356   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7357     cat >> confdefs.h <<EOF
7358 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7359 EOF
7360
7361   fi
7362
7363 else
7364         ol_cv_func_gethostbyaddr_r_nargs=0
7365 fi
7366
7367 if test "$ac_cv_func_ctime_r" = yes \
7368         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7369         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7370         -a "$ac_cv_func_gethostbyname_r" = yes \
7371         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7372         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7373         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7374         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7375         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7376         ; then
7377  
7378         cat >> confdefs.h <<\EOF
7379 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7380 EOF
7381
7382 fi
7383
7384 ol_link_threads=no
7385
7386 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7387         -o $ol_with_threads = nt ; then
7388
7389         
7390         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7391 echo "configure:7392: checking for _beginthread" >&5
7392 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7393   echo $ac_n "(cached) $ac_c" 1>&6
7394 else
7395   cat > conftest.$ac_ext <<EOF
7396 #line 7397 "configure"
7397 #include "confdefs.h"
7398 /* System header to define __stub macros and hopefully few prototypes,
7399     which can conflict with char _beginthread(); below.  */
7400 #include <assert.h>
7401 /* Override any gcc2 internal prototype to avoid an error.  */
7402 /* We use char because int might match the return type of a gcc2
7403     builtin and then its argument prototype would still apply.  */
7404 char _beginthread();
7405 char (*f)();
7406
7407 int main() {
7408
7409 /* The GNU C library defines this for functions which it implements
7410     to always fail with ENOSYS.  Some functions are actually named
7411     something starting with __ and the normal name is an alias.  */
7412 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7413 choke me
7414 #else
7415 f = _beginthread;
7416 #endif
7417
7418 ; return 0; }
7419 EOF
7420 if { (eval echo configure:7421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7421   rm -rf conftest*
7422   eval "ac_cv_func__beginthread=yes"
7423 else
7424   echo "configure: failed program was:" >&5
7425   cat conftest.$ac_ext >&5
7426   rm -rf conftest*
7427   eval "ac_cv_func__beginthread=no"
7428 fi
7429 rm -f conftest*
7430 fi
7431
7432 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7433   echo "$ac_t""yes" 1>&6
7434   :
7435 else
7436   echo "$ac_t""no" 1>&6
7437 fi
7438
7439
7440         if test $ac_cv_func__beginthread = yes ; then
7441                 cat >> confdefs.h <<\EOF
7442 #define HAVE_NT_THREADS 1
7443 EOF
7444
7445         fi
7446
7447
7448         if test "$ol_cv_nt_threads" = yes ; then
7449         ol_link_threads=nt
7450         ol_with_threads=found
7451         ol_with_yielding_select=yes
7452
7453                 cat >> confdefs.h <<\EOF
7454 #define HAVE_NT_SERVICE_MANAGER 1
7455 EOF
7456
7457                 cat >> confdefs.h <<\EOF
7458 #define HAVE_NT_EVENT_LOG 1
7459 EOF
7460
7461         fi
7462
7463         if test $ol_with_threads = nt ; then
7464                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7465         fi
7466 fi
7467
7468 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7469         -o $ol_with_threads = posix ; then
7470
7471         for ac_hdr in pthread.h
7472 do
7473 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7474 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7475 echo "configure:7476: checking for $ac_hdr" >&5
7476 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7477   echo $ac_n "(cached) $ac_c" 1>&6
7478 else
7479   cat > conftest.$ac_ext <<EOF
7480 #line 7481 "configure"
7481 #include "confdefs.h"
7482 #include <$ac_hdr>
7483 EOF
7484 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7485 { (eval echo configure:7486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7486 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7487 if test -z "$ac_err"; then
7488   rm -rf conftest*
7489   eval "ac_cv_header_$ac_safe=yes"
7490 else
7491   echo "$ac_err" >&5
7492   echo "configure: failed program was:" >&5
7493   cat conftest.$ac_ext >&5
7494   rm -rf conftest*
7495   eval "ac_cv_header_$ac_safe=no"
7496 fi
7497 rm -f conftest*
7498 fi
7499 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7500   echo "$ac_t""yes" 1>&6
7501     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7502   cat >> confdefs.h <<EOF
7503 #define $ac_tr_hdr 1
7504 EOF
7505  
7506 else
7507   echo "$ac_t""no" 1>&6
7508 fi
7509 done
7510
7511
7512         if test $ac_cv_header_pthread_h = yes ; then
7513                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7514 echo "configure:7515: checking POSIX thread version" >&5
7515 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7516   echo $ac_n "(cached) $ac_c" 1>&6
7517 else
7518   
7519         cat > conftest.$ac_ext <<EOF
7520 #line 7521 "configure"
7521 #include "confdefs.h"
7522
7523 #               include <pthread.h>
7524                 /* this check could be improved */
7525 #               ifdef PTHREAD_ONCE_INIT
7526                         pthread_version_final;
7527 #               endif
7528         
7529 EOF
7530 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7531   egrep "pthread_version_final" >/dev/null 2>&1; then
7532   rm -rf conftest*
7533   ol_pthread_final=yes
7534 else
7535   rm -rf conftest*
7536   ol_pthread_final=no
7537 fi
7538 rm -f conftest*
7539
7540
7541         cat > conftest.$ac_ext <<EOF
7542 #line 7543 "configure"
7543 #include "confdefs.h"
7544
7545 #               include <pthread.h>
7546                 /* this check could be improved */
7547 #               ifdef pthread_once_init
7548                         pthread_version_draft4;
7549 #               endif
7550         
7551 EOF
7552 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7553   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7554   rm -rf conftest*
7555   ol_pthread_draft4=yes
7556 else
7557   rm -rf conftest*
7558   ol_pthread_draft4=no
7559 fi
7560 rm -f conftest*
7561
7562
7563         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7564                 ol_cv_pthread_version=final
7565         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7566                 ol_cv_pthread_version=draft4
7567         else
7568                 ol_cv_pthread_version=unknown
7569         fi
7570
7571 fi
7572
7573 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7574
7575
7576                 if test $ol_cv_pthread_version = final ; then
7577                         cat >> confdefs.h <<\EOF
7578 #define HAVE_PTHREADS_FINAL 1
7579 EOF
7580
7581                 elif test $ol_cv_pthread_version = draft4 ; then
7582                         cat >> confdefs.h <<\EOF
7583 #define HAVE_PTHREADS_D4 1
7584 EOF
7585
7586                 else
7587                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7588                 fi
7589
7590                 # consider threads found
7591                 ol_with_threads=found
7592
7593                 
7594         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7595 echo "configure:7596: checking for LinuxThreads pthread.h" >&5
7596 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7597   echo $ac_n "(cached) $ac_c" 1>&6
7598 else
7599   cat > conftest.$ac_ext <<EOF
7600 #line 7601 "configure"
7601 #include "confdefs.h"
7602 #include <pthread.h>
7603 EOF
7604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7605   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7606   rm -rf conftest*
7607   ol_cv_header_linux_threads=yes
7608 else
7609   rm -rf conftest*
7610   ol_cv_header_linux_threads=no
7611 fi
7612 rm -f conftest*
7613
7614                 
7615 fi
7616
7617 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7618         if test $ol_cv_header_linux_threads = yes; then
7619                 cat >> confdefs.h <<\EOF
7620 #define HAVE_LINUX_THREADS 1
7621 EOF
7622
7623         fi
7624
7625                 
7626         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7627 echo "configure:7628: checking for GNU Pth pthread.h" >&5
7628 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7629   echo $ac_n "(cached) $ac_c" 1>&6
7630 else
7631   cat > conftest.$ac_ext <<EOF
7632 #line 7633 "configure"
7633 #include "confdefs.h"
7634 #include <pthread.h>
7635 #ifdef _POSIX_THREAD_IS_GNU_PTH
7636         __gnu_pth__;
7637 #endif
7638
7639 EOF
7640 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7641   egrep "__gnu_pth__" >/dev/null 2>&1; then
7642   rm -rf conftest*
7643   ol_cv_header_gnu_pth_pthread_h=yes
7644 else
7645   rm -rf conftest*
7646   ol_cv_header_gnu_pth_pthread_h=no
7647 fi
7648 rm -f conftest*
7649
7650                 
7651 fi
7652
7653 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7654
7655
7656                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7657                         for ac_hdr in sched.h
7658 do
7659 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7660 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7661 echo "configure:7662: checking for $ac_hdr" >&5
7662 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7663   echo $ac_n "(cached) $ac_c" 1>&6
7664 else
7665   cat > conftest.$ac_ext <<EOF
7666 #line 7667 "configure"
7667 #include "confdefs.h"
7668 #include <$ac_hdr>
7669 EOF
7670 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7671 { (eval echo configure:7672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7672 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7673 if test -z "$ac_err"; then
7674   rm -rf conftest*
7675   eval "ac_cv_header_$ac_safe=yes"
7676 else
7677   echo "$ac_err" >&5
7678   echo "configure: failed program was:" >&5
7679   cat conftest.$ac_ext >&5
7680   rm -rf conftest*
7681   eval "ac_cv_header_$ac_safe=no"
7682 fi
7683 rm -f conftest*
7684 fi
7685 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7686   echo "$ac_t""yes" 1>&6
7687     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7688   cat >> confdefs.h <<EOF
7689 #define $ac_tr_hdr 1
7690 EOF
7691  
7692 else
7693   echo "$ac_t""no" 1>&6
7694 fi
7695 done
7696
7697                 fi
7698
7699                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7700                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7701 echo "configure:7702: checking for pthread_create in default libraries" >&5
7702 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7703   echo $ac_n "(cached) $ac_c" 1>&6
7704 else
7705   
7706                 if test "$cross_compiling" = yes; then
7707   cat > conftest.$ac_ext <<EOF
7708 #line 7709 "configure"
7709 #include "confdefs.h"
7710 /* pthread test headers */
7711 #include <pthread.h>
7712 #ifndef NULL
7713 #define NULL (void*)0
7714 #endif
7715
7716 static void *task(p)
7717         void *p;
7718 {
7719         return (void *) (p == NULL);
7720 }
7721
7722 int main() {
7723
7724         /* pthread test function */
7725         pthread_t t;
7726         int status;
7727         int detach = 1;
7728
7729 #ifdef HAVE_PTHREADS_FINAL
7730         /* Final pthreads */
7731         pthread_attr_t attr;
7732
7733         status = pthread_attr_init(&attr);
7734         if( status ) return status;
7735
7736 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7737         if( !detach ) {
7738 #if defined( PTHREAD_CREATE_JOINABLE )
7739                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7740 #else
7741                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7742 #endif
7743
7744 #ifdef PTHREAD_CREATE_DETACHED
7745         } else {
7746                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7747 #endif
7748         }
7749         if( status ) return status;
7750 #endif
7751
7752         status = pthread_create( &t, &attr, task, NULL );
7753         if( status ) return status;
7754
7755 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7756         if( detach ) {
7757                 /* give thread a chance to complete */
7758                 /* it should remain joinable and hence detachable */
7759                 sleep( 1 );
7760
7761                 status = pthread_detach( t );
7762                 if( status ) return status;
7763         }
7764 #endif
7765
7766 #else
7767         /* Draft 4 pthreads */
7768         status = pthread_create( &t, pthread_attr_default, task, NULL );
7769         if( status ) return status;
7770
7771         if( detach ) {
7772                 /* give thread a chance to complete */
7773                 /* it should remain joinable and hence detachable */
7774                 sleep( 1 );
7775
7776                 status = pthread_detach( &t );
7777                 if( status ) return status;
7778         }
7779 #endif
7780
7781 #ifdef HAVE_LINUX_THREADS
7782         pthread_kill_other_threads_np();
7783 #endif
7784
7785         return 0;
7786
7787 ; return 0; }
7788 EOF
7789 if { (eval echo configure:7790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7790   rm -rf conftest*
7791   ol_cv_pthread_create=yes
7792 else
7793   echo "configure: failed program was:" >&5
7794   cat conftest.$ac_ext >&5
7795   rm -rf conftest*
7796   ol_cv_pthread_create=no
7797 fi
7798 rm -f conftest*
7799 else
7800   cat > conftest.$ac_ext <<EOF
7801 #line 7802 "configure"
7802 #include "confdefs.h"
7803 /* pthread test headers */
7804 #include <pthread.h>
7805 #ifndef NULL
7806 #define NULL (void*)0
7807 #endif
7808
7809 static void *task(p)
7810         void *p;
7811 {
7812         return (void *) (p == NULL);
7813 }
7814
7815
7816 int main(argc, argv)
7817         int argc;
7818         char **argv;
7819 {
7820
7821         /* pthread test function */
7822         pthread_t t;
7823         int status;
7824         int detach = 1;
7825
7826 #ifdef HAVE_PTHREADS_FINAL
7827         /* Final pthreads */
7828         pthread_attr_t attr;
7829
7830         status = pthread_attr_init(&attr);
7831         if( status ) return status;
7832
7833 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7834         if( !detach ) {
7835 #if defined( PTHREAD_CREATE_JOINABLE )
7836                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7837 #else
7838                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7839 #endif
7840
7841 #ifdef PTHREAD_CREATE_DETACHED
7842         } else {
7843                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7844 #endif
7845         }
7846         if( status ) return status;
7847 #endif
7848
7849         status = pthread_create( &t, &attr, task, NULL );
7850         if( status ) return status;
7851
7852 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7853         if( detach ) {
7854                 /* give thread a chance to complete */
7855                 /* it should remain joinable and hence detachable */
7856                 sleep( 1 );
7857
7858                 status = pthread_detach( t );
7859                 if( status ) return status;
7860         }
7861 #endif
7862
7863 #else
7864         /* Draft 4 pthreads */
7865         status = pthread_create( &t, pthread_attr_default, task, NULL );
7866         if( status ) return status;
7867
7868         if( detach ) {
7869                 /* give thread a chance to complete */
7870                 /* it should remain joinable and hence detachable */
7871                 sleep( 1 );
7872
7873                 status = pthread_detach( &t );
7874                 if( status ) return status;
7875         }
7876 #endif
7877
7878 #ifdef HAVE_LINUX_THREADS
7879         pthread_kill_other_threads_np();
7880 #endif
7881
7882         return 0;
7883
7884 }
7885
7886 EOF
7887 if { (eval echo configure:7888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7888 then
7889   ol_cv_pthread_create=yes
7890 else
7891   echo "configure: failed program was:" >&5
7892   cat conftest.$ac_ext >&5
7893   rm -fr conftest*
7894   ol_cv_pthread_create=no
7895 fi
7896 rm -fr conftest*
7897 fi
7898
7899 fi
7900
7901 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7902
7903                 if test $ol_cv_pthread_create != no ; then
7904                         ol_link_threads=posix
7905                         ol_link_pthreads=""
7906                 fi
7907                 
7908                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7909 if test "$ol_link_threads" = no ; then
7910         # try -kthread
7911         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7912 echo "configure:7913: checking for pthread link with -kthread" >&5
7913 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7914   echo $ac_n "(cached) $ac_c" 1>&6
7915 else
7916   
7917                 # save the flags
7918                 ol_LIBS="$LIBS"
7919                 LIBS="-kthread $LIBS"
7920
7921                 if test "$cross_compiling" = yes; then
7922   cat > conftest.$ac_ext <<EOF
7923 #line 7924 "configure"
7924 #include "confdefs.h"
7925 /* pthread test headers */
7926 #include <pthread.h>
7927 #ifndef NULL
7928 #define NULL (void*)0
7929 #endif
7930
7931 static void *task(p)
7932         void *p;
7933 {
7934         return (void *) (p == NULL);
7935 }
7936
7937 int main() {
7938
7939         /* pthread test function */
7940         pthread_t t;
7941         int status;
7942         int detach = 1;
7943
7944 #ifdef HAVE_PTHREADS_FINAL
7945         /* Final pthreads */
7946         pthread_attr_t attr;
7947
7948         status = pthread_attr_init(&attr);
7949         if( status ) return status;
7950
7951 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7952         if( !detach ) {
7953 #if defined( PTHREAD_CREATE_JOINABLE )
7954                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7955 #else
7956                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7957 #endif
7958
7959 #ifdef PTHREAD_CREATE_DETACHED
7960         } else {
7961                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7962 #endif
7963         }
7964         if( status ) return status;
7965 #endif
7966
7967         status = pthread_create( &t, &attr, task, NULL );
7968         if( status ) return status;
7969
7970 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7971         if( detach ) {
7972                 /* give thread a chance to complete */
7973                 /* it should remain joinable and hence detachable */
7974                 sleep( 1 );
7975
7976                 status = pthread_detach( t );
7977                 if( status ) return status;
7978         }
7979 #endif
7980
7981 #else
7982         /* Draft 4 pthreads */
7983         status = pthread_create( &t, pthread_attr_default, task, NULL );
7984         if( status ) return status;
7985
7986         if( detach ) {
7987                 /* give thread a chance to complete */
7988                 /* it should remain joinable and hence detachable */
7989                 sleep( 1 );
7990
7991                 status = pthread_detach( &t );
7992                 if( status ) return status;
7993         }
7994 #endif
7995
7996 #ifdef HAVE_LINUX_THREADS
7997         pthread_kill_other_threads_np();
7998 #endif
7999
8000         return 0;
8001
8002 ; return 0; }
8003 EOF
8004 if { (eval echo configure:8005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8005   rm -rf conftest*
8006   ol_cv_pthread_kthread=yes
8007 else
8008   echo "configure: failed program was:" >&5
8009   cat conftest.$ac_ext >&5
8010   rm -rf conftest*
8011   ol_cv_pthread_kthread=no
8012 fi
8013 rm -f conftest*
8014 else
8015   cat > conftest.$ac_ext <<EOF
8016 #line 8017 "configure"
8017 #include "confdefs.h"
8018 /* pthread test headers */
8019 #include <pthread.h>
8020 #ifndef NULL
8021 #define NULL (void*)0
8022 #endif
8023
8024 static void *task(p)
8025         void *p;
8026 {
8027         return (void *) (p == NULL);
8028 }
8029
8030
8031 int main(argc, argv)
8032         int argc;
8033         char **argv;
8034 {
8035
8036         /* pthread test function */
8037         pthread_t t;
8038         int status;
8039         int detach = 1;
8040
8041 #ifdef HAVE_PTHREADS_FINAL
8042         /* Final pthreads */
8043         pthread_attr_t attr;
8044
8045         status = pthread_attr_init(&attr);
8046         if( status ) return status;
8047
8048 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8049         if( !detach ) {
8050 #if defined( PTHREAD_CREATE_JOINABLE )
8051                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8052 #else
8053                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8054 #endif
8055
8056 #ifdef PTHREAD_CREATE_DETACHED
8057         } else {
8058                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8059 #endif
8060         }
8061         if( status ) return status;
8062 #endif
8063
8064         status = pthread_create( &t, &attr, task, NULL );
8065         if( status ) return status;
8066
8067 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8068         if( detach ) {
8069                 /* give thread a chance to complete */
8070                 /* it should remain joinable and hence detachable */
8071                 sleep( 1 );
8072
8073                 status = pthread_detach( t );
8074                 if( status ) return status;
8075         }
8076 #endif
8077
8078 #else
8079         /* Draft 4 pthreads */
8080         status = pthread_create( &t, pthread_attr_default, task, NULL );
8081         if( status ) return status;
8082
8083         if( detach ) {
8084                 /* give thread a chance to complete */
8085                 /* it should remain joinable and hence detachable */
8086                 sleep( 1 );
8087
8088                 status = pthread_detach( &t );
8089                 if( status ) return status;
8090         }
8091 #endif
8092
8093 #ifdef HAVE_LINUX_THREADS
8094         pthread_kill_other_threads_np();
8095 #endif
8096
8097         return 0;
8098
8099 }
8100
8101 EOF
8102 if { (eval echo configure:8103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8103 then
8104   ol_cv_pthread_kthread=yes
8105 else
8106   echo "configure: failed program was:" >&5
8107   cat conftest.$ac_ext >&5
8108   rm -fr conftest*
8109   ol_cv_pthread_kthread=no
8110 fi
8111 rm -fr conftest*
8112 fi
8113
8114
8115                 # restore the LIBS
8116                 LIBS="$ol_LIBS"
8117         
8118 fi
8119
8120 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8121
8122         if test $ol_cv_pthread_kthread = yes ; then
8123                 ol_link_pthreads="-kthread"
8124                 ol_link_threads=posix
8125         fi
8126 fi
8127
8128                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8129 if test "$ol_link_threads" = no ; then
8130         # try -pthread
8131         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8132 echo "configure:8133: checking for pthread link with -pthread" >&5
8133 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8134   echo $ac_n "(cached) $ac_c" 1>&6
8135 else
8136   
8137                 # save the flags
8138                 ol_LIBS="$LIBS"
8139                 LIBS="-pthread $LIBS"
8140
8141                 if test "$cross_compiling" = yes; then
8142   cat > conftest.$ac_ext <<EOF
8143 #line 8144 "configure"
8144 #include "confdefs.h"
8145 /* pthread test headers */
8146 #include <pthread.h>
8147 #ifndef NULL
8148 #define NULL (void*)0
8149 #endif
8150
8151 static void *task(p)
8152         void *p;
8153 {
8154         return (void *) (p == NULL);
8155 }
8156
8157 int main() {
8158
8159         /* pthread test function */
8160         pthread_t t;
8161         int status;
8162         int detach = 1;
8163
8164 #ifdef HAVE_PTHREADS_FINAL
8165         /* Final pthreads */
8166         pthread_attr_t attr;
8167
8168         status = pthread_attr_init(&attr);
8169         if( status ) return status;
8170
8171 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8172         if( !detach ) {
8173 #if defined( PTHREAD_CREATE_JOINABLE )
8174                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8175 #else
8176                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8177 #endif
8178
8179 #ifdef PTHREAD_CREATE_DETACHED
8180         } else {
8181                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8182 #endif
8183         }
8184         if( status ) return status;
8185 #endif
8186
8187         status = pthread_create( &t, &attr, task, NULL );
8188         if( status ) return status;
8189
8190 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8191         if( detach ) {
8192                 /* give thread a chance to complete */
8193                 /* it should remain joinable and hence detachable */
8194                 sleep( 1 );
8195
8196                 status = pthread_detach( t );
8197                 if( status ) return status;
8198         }
8199 #endif
8200
8201 #else
8202         /* Draft 4 pthreads */
8203         status = pthread_create( &t, pthread_attr_default, task, NULL );
8204         if( status ) return status;
8205
8206         if( detach ) {
8207                 /* give thread a chance to complete */
8208                 /* it should remain joinable and hence detachable */
8209                 sleep( 1 );
8210
8211                 status = pthread_detach( &t );
8212                 if( status ) return status;
8213         }
8214 #endif
8215
8216 #ifdef HAVE_LINUX_THREADS
8217         pthread_kill_other_threads_np();
8218 #endif
8219
8220         return 0;
8221
8222 ; return 0; }
8223 EOF
8224 if { (eval echo configure:8225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8225   rm -rf conftest*
8226   ol_cv_pthread_pthread=yes
8227 else
8228   echo "configure: failed program was:" >&5
8229   cat conftest.$ac_ext >&5
8230   rm -rf conftest*
8231   ol_cv_pthread_pthread=no
8232 fi
8233 rm -f conftest*
8234 else
8235   cat > conftest.$ac_ext <<EOF
8236 #line 8237 "configure"
8237 #include "confdefs.h"
8238 /* pthread test headers */
8239 #include <pthread.h>
8240 #ifndef NULL
8241 #define NULL (void*)0
8242 #endif
8243
8244 static void *task(p)
8245         void *p;
8246 {
8247         return (void *) (p == NULL);
8248 }
8249
8250
8251 int main(argc, argv)
8252         int argc;
8253         char **argv;
8254 {
8255
8256         /* pthread test function */
8257         pthread_t t;
8258         int status;
8259         int detach = 1;
8260
8261 #ifdef HAVE_PTHREADS_FINAL
8262         /* Final pthreads */
8263         pthread_attr_t attr;
8264
8265         status = pthread_attr_init(&attr);
8266         if( status ) return status;
8267
8268 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8269         if( !detach ) {
8270 #if defined( PTHREAD_CREATE_JOINABLE )
8271                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8272 #else
8273                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8274 #endif
8275
8276 #ifdef PTHREAD_CREATE_DETACHED
8277         } else {
8278                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8279 #endif
8280         }
8281         if( status ) return status;
8282 #endif
8283
8284         status = pthread_create( &t, &attr, task, NULL );
8285         if( status ) return status;
8286
8287 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8288         if( detach ) {
8289                 /* give thread a chance to complete */
8290                 /* it should remain joinable and hence detachable */
8291                 sleep( 1 );
8292
8293                 status = pthread_detach( t );
8294                 if( status ) return status;
8295         }
8296 #endif
8297
8298 #else
8299         /* Draft 4 pthreads */
8300         status = pthread_create( &t, pthread_attr_default, task, NULL );
8301         if( status ) return status;
8302
8303         if( detach ) {
8304                 /* give thread a chance to complete */
8305                 /* it should remain joinable and hence detachable */
8306                 sleep( 1 );
8307
8308                 status = pthread_detach( &t );
8309                 if( status ) return status;
8310         }
8311 #endif
8312
8313 #ifdef HAVE_LINUX_THREADS
8314         pthread_kill_other_threads_np();
8315 #endif
8316
8317         return 0;
8318
8319 }
8320
8321 EOF
8322 if { (eval echo configure:8323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8323 then
8324   ol_cv_pthread_pthread=yes
8325 else
8326   echo "configure: failed program was:" >&5
8327   cat conftest.$ac_ext >&5
8328   rm -fr conftest*
8329   ol_cv_pthread_pthread=no
8330 fi
8331 rm -fr conftest*
8332 fi
8333
8334
8335                 # restore the LIBS
8336                 LIBS="$ol_LIBS"
8337         
8338 fi
8339
8340 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8341
8342         if test $ol_cv_pthread_pthread = yes ; then
8343                 ol_link_pthreads="-pthread"
8344                 ol_link_threads=posix
8345         fi
8346 fi
8347
8348                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8349 if test "$ol_link_threads" = no ; then
8350         # try -pthreads
8351         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8352 echo "configure:8353: checking for pthread link with -pthreads" >&5
8353 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8354   echo $ac_n "(cached) $ac_c" 1>&6
8355 else
8356   
8357                 # save the flags
8358                 ol_LIBS="$LIBS"
8359                 LIBS="-pthreads $LIBS"
8360
8361                 if test "$cross_compiling" = yes; then
8362   cat > conftest.$ac_ext <<EOF
8363 #line 8364 "configure"
8364 #include "confdefs.h"
8365 /* pthread test headers */
8366 #include <pthread.h>
8367 #ifndef NULL
8368 #define NULL (void*)0
8369 #endif
8370
8371 static void *task(p)
8372         void *p;
8373 {
8374         return (void *) (p == NULL);
8375 }
8376
8377 int main() {
8378
8379         /* pthread test function */
8380         pthread_t t;
8381         int status;
8382         int detach = 1;
8383
8384 #ifdef HAVE_PTHREADS_FINAL
8385         /* Final pthreads */
8386         pthread_attr_t attr;
8387
8388         status = pthread_attr_init(&attr);
8389         if( status ) return status;
8390
8391 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8392         if( !detach ) {
8393 #if defined( PTHREAD_CREATE_JOINABLE )
8394                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8395 #else
8396                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8397 #endif
8398
8399 #ifdef PTHREAD_CREATE_DETACHED
8400         } else {
8401                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8402 #endif
8403         }
8404         if( status ) return status;
8405 #endif
8406
8407         status = pthread_create( &t, &attr, task, NULL );
8408         if( status ) return status;
8409
8410 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8411         if( detach ) {
8412                 /* give thread a chance to complete */
8413                 /* it should remain joinable and hence detachable */
8414                 sleep( 1 );
8415
8416                 status = pthread_detach( t );
8417                 if( status ) return status;
8418         }
8419 #endif
8420
8421 #else
8422         /* Draft 4 pthreads */
8423         status = pthread_create( &t, pthread_attr_default, task, NULL );
8424         if( status ) return status;
8425
8426         if( detach ) {
8427                 /* give thread a chance to complete */
8428                 /* it should remain joinable and hence detachable */
8429                 sleep( 1 );
8430
8431                 status = pthread_detach( &t );
8432                 if( status ) return status;
8433         }
8434 #endif
8435
8436 #ifdef HAVE_LINUX_THREADS
8437         pthread_kill_other_threads_np();
8438 #endif
8439
8440         return 0;
8441
8442 ; return 0; }
8443 EOF
8444 if { (eval echo configure:8445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8445   rm -rf conftest*
8446   ol_cv_pthread_pthreads=yes
8447 else
8448   echo "configure: failed program was:" >&5
8449   cat conftest.$ac_ext >&5
8450   rm -rf conftest*
8451   ol_cv_pthread_pthreads=no
8452 fi
8453 rm -f conftest*
8454 else
8455   cat > conftest.$ac_ext <<EOF
8456 #line 8457 "configure"
8457 #include "confdefs.h"
8458 /* pthread test headers */
8459 #include <pthread.h>
8460 #ifndef NULL
8461 #define NULL (void*)0
8462 #endif
8463
8464 static void *task(p)
8465         void *p;
8466 {
8467         return (void *) (p == NULL);
8468 }
8469
8470
8471 int main(argc, argv)
8472         int argc;
8473         char **argv;
8474 {
8475
8476         /* pthread test function */
8477         pthread_t t;
8478         int status;
8479         int detach = 1;
8480
8481 #ifdef HAVE_PTHREADS_FINAL
8482         /* Final pthreads */
8483         pthread_attr_t attr;
8484
8485         status = pthread_attr_init(&attr);
8486         if( status ) return status;
8487
8488 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8489         if( !detach ) {
8490 #if defined( PTHREAD_CREATE_JOINABLE )
8491                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8492 #else
8493                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8494 #endif
8495
8496 #ifdef PTHREAD_CREATE_DETACHED
8497         } else {
8498                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8499 #endif
8500         }
8501         if( status ) return status;
8502 #endif
8503
8504         status = pthread_create( &t, &attr, task, NULL );
8505         if( status ) return status;
8506
8507 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8508         if( detach ) {
8509                 /* give thread a chance to complete */
8510                 /* it should remain joinable and hence detachable */
8511                 sleep( 1 );
8512
8513                 status = pthread_detach( t );
8514                 if( status ) return status;
8515         }
8516 #endif
8517
8518 #else
8519         /* Draft 4 pthreads */
8520         status = pthread_create( &t, pthread_attr_default, task, NULL );
8521         if( status ) return status;
8522
8523         if( detach ) {
8524                 /* give thread a chance to complete */
8525                 /* it should remain joinable and hence detachable */
8526                 sleep( 1 );
8527
8528                 status = pthread_detach( &t );
8529                 if( status ) return status;
8530         }
8531 #endif
8532
8533 #ifdef HAVE_LINUX_THREADS
8534         pthread_kill_other_threads_np();
8535 #endif
8536
8537         return 0;
8538
8539 }
8540
8541 EOF
8542 if { (eval echo configure:8543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8543 then
8544   ol_cv_pthread_pthreads=yes
8545 else
8546   echo "configure: failed program was:" >&5
8547   cat conftest.$ac_ext >&5
8548   rm -fr conftest*
8549   ol_cv_pthread_pthreads=no
8550 fi
8551 rm -fr conftest*
8552 fi
8553
8554
8555                 # restore the LIBS
8556                 LIBS="$ol_LIBS"
8557         
8558 fi
8559
8560 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8561
8562         if test $ol_cv_pthread_pthreads = yes ; then
8563                 ol_link_pthreads="-pthreads"
8564                 ol_link_threads=posix
8565         fi
8566 fi
8567
8568                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8569 if test "$ol_link_threads" = no ; then
8570         # try -mthreads
8571         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8572 echo "configure:8573: checking for pthread link with -mthreads" >&5
8573 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8574   echo $ac_n "(cached) $ac_c" 1>&6
8575 else
8576   
8577                 # save the flags
8578                 ol_LIBS="$LIBS"
8579                 LIBS="-mthreads $LIBS"
8580
8581                 if test "$cross_compiling" = yes; then
8582   cat > conftest.$ac_ext <<EOF
8583 #line 8584 "configure"
8584 #include "confdefs.h"
8585 /* pthread test headers */
8586 #include <pthread.h>
8587 #ifndef NULL
8588 #define NULL (void*)0
8589 #endif
8590
8591 static void *task(p)
8592         void *p;
8593 {
8594         return (void *) (p == NULL);
8595 }
8596
8597 int main() {
8598
8599         /* pthread test function */
8600         pthread_t t;
8601         int status;
8602         int detach = 1;
8603
8604 #ifdef HAVE_PTHREADS_FINAL
8605         /* Final pthreads */
8606         pthread_attr_t attr;
8607
8608         status = pthread_attr_init(&attr);
8609         if( status ) return status;
8610
8611 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8612         if( !detach ) {
8613 #if defined( PTHREAD_CREATE_JOINABLE )
8614                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8615 #else
8616                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8617 #endif
8618
8619 #ifdef PTHREAD_CREATE_DETACHED
8620         } else {
8621                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8622 #endif
8623         }
8624         if( status ) return status;
8625 #endif
8626
8627         status = pthread_create( &t, &attr, task, NULL );
8628         if( status ) return status;
8629
8630 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8631         if( detach ) {
8632                 /* give thread a chance to complete */
8633                 /* it should remain joinable and hence detachable */
8634                 sleep( 1 );
8635
8636                 status = pthread_detach( t );
8637                 if( status ) return status;
8638         }
8639 #endif
8640
8641 #else
8642         /* Draft 4 pthreads */
8643         status = pthread_create( &t, pthread_attr_default, task, NULL );
8644         if( status ) return status;
8645
8646         if( detach ) {
8647                 /* give thread a chance to complete */
8648                 /* it should remain joinable and hence detachable */
8649                 sleep( 1 );
8650
8651                 status = pthread_detach( &t );
8652                 if( status ) return status;
8653         }
8654 #endif
8655
8656 #ifdef HAVE_LINUX_THREADS
8657         pthread_kill_other_threads_np();
8658 #endif
8659
8660         return 0;
8661
8662 ; return 0; }
8663 EOF
8664 if { (eval echo configure:8665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8665   rm -rf conftest*
8666   ol_cv_pthread_mthreads=yes
8667 else
8668   echo "configure: failed program was:" >&5
8669   cat conftest.$ac_ext >&5
8670   rm -rf conftest*
8671   ol_cv_pthread_mthreads=no
8672 fi
8673 rm -f conftest*
8674 else
8675   cat > conftest.$ac_ext <<EOF
8676 #line 8677 "configure"
8677 #include "confdefs.h"
8678 /* pthread test headers */
8679 #include <pthread.h>
8680 #ifndef NULL
8681 #define NULL (void*)0
8682 #endif
8683
8684 static void *task(p)
8685         void *p;
8686 {
8687         return (void *) (p == NULL);
8688 }
8689
8690
8691 int main(argc, argv)
8692         int argc;
8693         char **argv;
8694 {
8695
8696         /* pthread test function */
8697         pthread_t t;
8698         int status;
8699         int detach = 1;
8700
8701 #ifdef HAVE_PTHREADS_FINAL
8702         /* Final pthreads */
8703         pthread_attr_t attr;
8704
8705         status = pthread_attr_init(&attr);
8706         if( status ) return status;
8707
8708 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8709         if( !detach ) {
8710 #if defined( PTHREAD_CREATE_JOINABLE )
8711                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8712 #else
8713                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8714 #endif
8715
8716 #ifdef PTHREAD_CREATE_DETACHED
8717         } else {
8718                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8719 #endif
8720         }
8721         if( status ) return status;
8722 #endif
8723
8724         status = pthread_create( &t, &attr, task, NULL );
8725         if( status ) return status;
8726
8727 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8728         if( detach ) {
8729                 /* give thread a chance to complete */
8730                 /* it should remain joinable and hence detachable */
8731                 sleep( 1 );
8732
8733                 status = pthread_detach( t );
8734                 if( status ) return status;
8735         }
8736 #endif
8737
8738 #else
8739         /* Draft 4 pthreads */
8740         status = pthread_create( &t, pthread_attr_default, task, NULL );
8741         if( status ) return status;
8742
8743         if( detach ) {
8744                 /* give thread a chance to complete */
8745                 /* it should remain joinable and hence detachable */
8746                 sleep( 1 );
8747
8748                 status = pthread_detach( &t );
8749                 if( status ) return status;
8750         }
8751 #endif
8752
8753 #ifdef HAVE_LINUX_THREADS
8754         pthread_kill_other_threads_np();
8755 #endif
8756
8757         return 0;
8758
8759 }
8760
8761 EOF
8762 if { (eval echo configure:8763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8763 then
8764   ol_cv_pthread_mthreads=yes
8765 else
8766   echo "configure: failed program was:" >&5
8767   cat conftest.$ac_ext >&5
8768   rm -fr conftest*
8769   ol_cv_pthread_mthreads=no
8770 fi
8771 rm -fr conftest*
8772 fi
8773
8774
8775                 # restore the LIBS
8776                 LIBS="$ol_LIBS"
8777         
8778 fi
8779
8780 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8781
8782         if test $ol_cv_pthread_mthreads = yes ; then
8783                 ol_link_pthreads="-mthreads"
8784                 ol_link_threads=posix
8785         fi
8786 fi
8787
8788                 # Pthread try link: -thread (ol_cv_pthread_thread)
8789 if test "$ol_link_threads" = no ; then
8790         # try -thread
8791         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8792 echo "configure:8793: checking for pthread link with -thread" >&5
8793 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8794   echo $ac_n "(cached) $ac_c" 1>&6
8795 else
8796   
8797                 # save the flags
8798                 ol_LIBS="$LIBS"
8799                 LIBS="-thread $LIBS"
8800
8801                 if test "$cross_compiling" = yes; then
8802   cat > conftest.$ac_ext <<EOF
8803 #line 8804 "configure"
8804 #include "confdefs.h"
8805 /* pthread test headers */
8806 #include <pthread.h>
8807 #ifndef NULL
8808 #define NULL (void*)0
8809 #endif
8810
8811 static void *task(p)
8812         void *p;
8813 {
8814         return (void *) (p == NULL);
8815 }
8816
8817 int main() {
8818
8819         /* pthread test function */
8820         pthread_t t;
8821         int status;
8822         int detach = 1;
8823
8824 #ifdef HAVE_PTHREADS_FINAL
8825         /* Final pthreads */
8826         pthread_attr_t attr;
8827
8828         status = pthread_attr_init(&attr);
8829         if( status ) return status;
8830
8831 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8832         if( !detach ) {
8833 #if defined( PTHREAD_CREATE_JOINABLE )
8834                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8835 #else
8836                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8837 #endif
8838
8839 #ifdef PTHREAD_CREATE_DETACHED
8840         } else {
8841                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8842 #endif
8843         }
8844         if( status ) return status;
8845 #endif
8846
8847         status = pthread_create( &t, &attr, task, NULL );
8848         if( status ) return status;
8849
8850 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8851         if( detach ) {
8852                 /* give thread a chance to complete */
8853                 /* it should remain joinable and hence detachable */
8854                 sleep( 1 );
8855
8856                 status = pthread_detach( t );
8857                 if( status ) return status;
8858         }
8859 #endif
8860
8861 #else
8862         /* Draft 4 pthreads */
8863         status = pthread_create( &t, pthread_attr_default, task, NULL );
8864         if( status ) return status;
8865
8866         if( detach ) {
8867                 /* give thread a chance to complete */
8868                 /* it should remain joinable and hence detachable */
8869                 sleep( 1 );
8870
8871                 status = pthread_detach( &t );
8872                 if( status ) return status;
8873         }
8874 #endif
8875
8876 #ifdef HAVE_LINUX_THREADS
8877         pthread_kill_other_threads_np();
8878 #endif
8879
8880         return 0;
8881
8882 ; return 0; }
8883 EOF
8884 if { (eval echo configure:8885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8885   rm -rf conftest*
8886   ol_cv_pthread_thread=yes
8887 else
8888   echo "configure: failed program was:" >&5
8889   cat conftest.$ac_ext >&5
8890   rm -rf conftest*
8891   ol_cv_pthread_thread=no
8892 fi
8893 rm -f conftest*
8894 else
8895   cat > conftest.$ac_ext <<EOF
8896 #line 8897 "configure"
8897 #include "confdefs.h"
8898 /* pthread test headers */
8899 #include <pthread.h>
8900 #ifndef NULL
8901 #define NULL (void*)0
8902 #endif
8903
8904 static void *task(p)
8905         void *p;
8906 {
8907         return (void *) (p == NULL);
8908 }
8909
8910
8911 int main(argc, argv)
8912         int argc;
8913         char **argv;
8914 {
8915
8916         /* pthread test function */
8917         pthread_t t;
8918         int status;
8919         int detach = 1;
8920
8921 #ifdef HAVE_PTHREADS_FINAL
8922         /* Final pthreads */
8923         pthread_attr_t attr;
8924
8925         status = pthread_attr_init(&attr);
8926         if( status ) return status;
8927
8928 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8929         if( !detach ) {
8930 #if defined( PTHREAD_CREATE_JOINABLE )
8931                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8932 #else
8933                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8934 #endif
8935
8936 #ifdef PTHREAD_CREATE_DETACHED
8937         } else {
8938                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8939 #endif
8940         }
8941         if( status ) return status;
8942 #endif
8943
8944         status = pthread_create( &t, &attr, task, NULL );
8945         if( status ) return status;
8946
8947 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8948         if( detach ) {
8949                 /* give thread a chance to complete */
8950                 /* it should remain joinable and hence detachable */
8951                 sleep( 1 );
8952
8953                 status = pthread_detach( t );
8954                 if( status ) return status;
8955         }
8956 #endif
8957
8958 #else
8959         /* Draft 4 pthreads */
8960         status = pthread_create( &t, pthread_attr_default, task, NULL );
8961         if( status ) return status;
8962
8963         if( detach ) {
8964                 /* give thread a chance to complete */
8965                 /* it should remain joinable and hence detachable */
8966                 sleep( 1 );
8967
8968                 status = pthread_detach( &t );
8969                 if( status ) return status;
8970         }
8971 #endif
8972
8973 #ifdef HAVE_LINUX_THREADS
8974         pthread_kill_other_threads_np();
8975 #endif
8976
8977         return 0;
8978
8979 }
8980
8981 EOF
8982 if { (eval echo configure:8983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8983 then
8984   ol_cv_pthread_thread=yes
8985 else
8986   echo "configure: failed program was:" >&5
8987   cat conftest.$ac_ext >&5
8988   rm -fr conftest*
8989   ol_cv_pthread_thread=no
8990 fi
8991 rm -fr conftest*
8992 fi
8993
8994
8995                 # restore the LIBS
8996                 LIBS="$ol_LIBS"
8997         
8998 fi
8999
9000 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9001
9002         if test $ol_cv_pthread_thread = yes ; then
9003                 ol_link_pthreads="-thread"
9004                 ol_link_threads=posix
9005         fi
9006 fi
9007
9008
9009                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9010 if test "$ol_link_threads" = no ; then
9011         # try -lpthread -lmach -lexc -lc_r
9012         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9013 echo "configure:9014: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9014 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9015   echo $ac_n "(cached) $ac_c" 1>&6
9016 else
9017   
9018                 # save the flags
9019                 ol_LIBS="$LIBS"
9020                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9021
9022                 if test "$cross_compiling" = yes; then
9023   cat > conftest.$ac_ext <<EOF
9024 #line 9025 "configure"
9025 #include "confdefs.h"
9026 /* pthread test headers */
9027 #include <pthread.h>
9028 #ifndef NULL
9029 #define NULL (void*)0
9030 #endif
9031
9032 static void *task(p)
9033         void *p;
9034 {
9035         return (void *) (p == NULL);
9036 }
9037
9038 int main() {
9039
9040         /* pthread test function */
9041         pthread_t t;
9042         int status;
9043         int detach = 1;
9044
9045 #ifdef HAVE_PTHREADS_FINAL
9046         /* Final pthreads */
9047         pthread_attr_t attr;
9048
9049         status = pthread_attr_init(&attr);
9050         if( status ) return status;
9051
9052 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9053         if( !detach ) {
9054 #if defined( PTHREAD_CREATE_JOINABLE )
9055                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9056 #else
9057                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9058 #endif
9059
9060 #ifdef PTHREAD_CREATE_DETACHED
9061         } else {
9062                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9063 #endif
9064         }
9065         if( status ) return status;
9066 #endif
9067
9068         status = pthread_create( &t, &attr, task, NULL );
9069         if( status ) return status;
9070
9071 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9072         if( detach ) {
9073                 /* give thread a chance to complete */
9074                 /* it should remain joinable and hence detachable */
9075                 sleep( 1 );
9076
9077                 status = pthread_detach( t );
9078                 if( status ) return status;
9079         }
9080 #endif
9081
9082 #else
9083         /* Draft 4 pthreads */
9084         status = pthread_create( &t, pthread_attr_default, task, NULL );
9085         if( status ) return status;
9086
9087         if( detach ) {
9088                 /* give thread a chance to complete */
9089                 /* it should remain joinable and hence detachable */
9090                 sleep( 1 );
9091
9092                 status = pthread_detach( &t );
9093                 if( status ) return status;
9094         }
9095 #endif
9096
9097 #ifdef HAVE_LINUX_THREADS
9098         pthread_kill_other_threads_np();
9099 #endif
9100
9101         return 0;
9102
9103 ; return 0; }
9104 EOF
9105 if { (eval echo configure:9106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9106   rm -rf conftest*
9107   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9108 else
9109   echo "configure: failed program was:" >&5
9110   cat conftest.$ac_ext >&5
9111   rm -rf conftest*
9112   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9113 fi
9114 rm -f conftest*
9115 else
9116   cat > conftest.$ac_ext <<EOF
9117 #line 9118 "configure"
9118 #include "confdefs.h"
9119 /* pthread test headers */
9120 #include <pthread.h>
9121 #ifndef NULL
9122 #define NULL (void*)0
9123 #endif
9124
9125 static void *task(p)
9126         void *p;
9127 {
9128         return (void *) (p == NULL);
9129 }
9130
9131
9132 int main(argc, argv)
9133         int argc;
9134         char **argv;
9135 {
9136
9137         /* pthread test function */
9138         pthread_t t;
9139         int status;
9140         int detach = 1;
9141
9142 #ifdef HAVE_PTHREADS_FINAL
9143         /* Final pthreads */
9144         pthread_attr_t attr;
9145
9146         status = pthread_attr_init(&attr);
9147         if( status ) return status;
9148
9149 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9150         if( !detach ) {
9151 #if defined( PTHREAD_CREATE_JOINABLE )
9152                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9153 #else
9154                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9155 #endif
9156
9157 #ifdef PTHREAD_CREATE_DETACHED
9158         } else {
9159                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9160 #endif
9161         }
9162         if( status ) return status;
9163 #endif
9164
9165         status = pthread_create( &t, &attr, task, NULL );
9166         if( status ) return status;
9167
9168 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9169         if( detach ) {
9170                 /* give thread a chance to complete */
9171                 /* it should remain joinable and hence detachable */
9172                 sleep( 1 );
9173
9174                 status = pthread_detach( t );
9175                 if( status ) return status;
9176         }
9177 #endif
9178
9179 #else
9180         /* Draft 4 pthreads */
9181         status = pthread_create( &t, pthread_attr_default, task, NULL );
9182         if( status ) return status;
9183
9184         if( detach ) {
9185                 /* give thread a chance to complete */
9186                 /* it should remain joinable and hence detachable */
9187                 sleep( 1 );
9188
9189                 status = pthread_detach( &t );
9190                 if( status ) return status;
9191         }
9192 #endif
9193
9194 #ifdef HAVE_LINUX_THREADS
9195         pthread_kill_other_threads_np();
9196 #endif
9197
9198         return 0;
9199
9200 }
9201
9202 EOF
9203 if { (eval echo configure:9204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9204 then
9205   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9206 else
9207   echo "configure: failed program was:" >&5
9208   cat conftest.$ac_ext >&5
9209   rm -fr conftest*
9210   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9211 fi
9212 rm -fr conftest*
9213 fi
9214
9215
9216                 # restore the LIBS
9217                 LIBS="$ol_LIBS"
9218         
9219 fi
9220
9221 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9222
9223         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9224                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9225                 ol_link_threads=posix
9226         fi
9227 fi
9228
9229                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9230 if test "$ol_link_threads" = no ; then
9231         # try -lpthread -lmach -lexc
9232         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9233 echo "configure:9234: checking for pthread link with -lpthread -lmach -lexc" >&5
9234 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9235   echo $ac_n "(cached) $ac_c" 1>&6
9236 else
9237   
9238                 # save the flags
9239                 ol_LIBS="$LIBS"
9240                 LIBS="-lpthread -lmach -lexc $LIBS"
9241
9242                 if test "$cross_compiling" = yes; then
9243   cat > conftest.$ac_ext <<EOF
9244 #line 9245 "configure"
9245 #include "confdefs.h"
9246 /* pthread test headers */
9247 #include <pthread.h>
9248 #ifndef NULL
9249 #define NULL (void*)0
9250 #endif
9251
9252 static void *task(p)
9253         void *p;
9254 {
9255         return (void *) (p == NULL);
9256 }
9257
9258 int main() {
9259
9260         /* pthread test function */
9261         pthread_t t;
9262         int status;
9263         int detach = 1;
9264
9265 #ifdef HAVE_PTHREADS_FINAL
9266         /* Final pthreads */
9267         pthread_attr_t attr;
9268
9269         status = pthread_attr_init(&attr);
9270         if( status ) return status;
9271
9272 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9273         if( !detach ) {
9274 #if defined( PTHREAD_CREATE_JOINABLE )
9275                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9276 #else
9277                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9278 #endif
9279
9280 #ifdef PTHREAD_CREATE_DETACHED
9281         } else {
9282                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9283 #endif
9284         }
9285         if( status ) return status;
9286 #endif
9287
9288         status = pthread_create( &t, &attr, task, NULL );
9289         if( status ) return status;
9290
9291 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9292         if( detach ) {
9293                 /* give thread a chance to complete */
9294                 /* it should remain joinable and hence detachable */
9295                 sleep( 1 );
9296
9297                 status = pthread_detach( t );
9298                 if( status ) return status;
9299         }
9300 #endif
9301
9302 #else
9303         /* Draft 4 pthreads */
9304         status = pthread_create( &t, pthread_attr_default, task, NULL );
9305         if( status ) return status;
9306
9307         if( detach ) {
9308                 /* give thread a chance to complete */
9309                 /* it should remain joinable and hence detachable */
9310                 sleep( 1 );
9311
9312                 status = pthread_detach( &t );
9313                 if( status ) return status;
9314         }
9315 #endif
9316
9317 #ifdef HAVE_LINUX_THREADS
9318         pthread_kill_other_threads_np();
9319 #endif
9320
9321         return 0;
9322
9323 ; return 0; }
9324 EOF
9325 if { (eval echo configure:9326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9326   rm -rf conftest*
9327   ol_cv_pthread_lpthread_lmach_lexc=yes
9328 else
9329   echo "configure: failed program was:" >&5
9330   cat conftest.$ac_ext >&5
9331   rm -rf conftest*
9332   ol_cv_pthread_lpthread_lmach_lexc=no
9333 fi
9334 rm -f conftest*
9335 else
9336   cat > conftest.$ac_ext <<EOF
9337 #line 9338 "configure"
9338 #include "confdefs.h"
9339 /* pthread test headers */
9340 #include <pthread.h>
9341 #ifndef NULL
9342 #define NULL (void*)0
9343 #endif
9344
9345 static void *task(p)
9346         void *p;
9347 {
9348         return (void *) (p == NULL);
9349 }
9350
9351
9352 int main(argc, argv)
9353         int argc;
9354         char **argv;
9355 {
9356
9357         /* pthread test function */
9358         pthread_t t;
9359         int status;
9360         int detach = 1;
9361
9362 #ifdef HAVE_PTHREADS_FINAL
9363         /* Final pthreads */
9364         pthread_attr_t attr;
9365
9366         status = pthread_attr_init(&attr);
9367         if( status ) return status;
9368
9369 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9370         if( !detach ) {
9371 #if defined( PTHREAD_CREATE_JOINABLE )
9372                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9373 #else
9374                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9375 #endif
9376
9377 #ifdef PTHREAD_CREATE_DETACHED
9378         } else {
9379                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9380 #endif
9381         }
9382         if( status ) return status;
9383 #endif
9384
9385         status = pthread_create( &t, &attr, task, NULL );
9386         if( status ) return status;
9387
9388 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9389         if( detach ) {
9390                 /* give thread a chance to complete */
9391                 /* it should remain joinable and hence detachable */
9392                 sleep( 1 );
9393
9394                 status = pthread_detach( t );
9395                 if( status ) return status;
9396         }
9397 #endif
9398
9399 #else
9400         /* Draft 4 pthreads */
9401         status = pthread_create( &t, pthread_attr_default, task, NULL );
9402         if( status ) return status;
9403
9404         if( detach ) {
9405                 /* give thread a chance to complete */
9406                 /* it should remain joinable and hence detachable */
9407                 sleep( 1 );
9408
9409                 status = pthread_detach( &t );
9410                 if( status ) return status;
9411         }
9412 #endif
9413
9414 #ifdef HAVE_LINUX_THREADS
9415         pthread_kill_other_threads_np();
9416 #endif
9417
9418         return 0;
9419
9420 }
9421
9422 EOF
9423 if { (eval echo configure:9424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9424 then
9425   ol_cv_pthread_lpthread_lmach_lexc=yes
9426 else
9427   echo "configure: failed program was:" >&5
9428   cat conftest.$ac_ext >&5
9429   rm -fr conftest*
9430   ol_cv_pthread_lpthread_lmach_lexc=no
9431 fi
9432 rm -fr conftest*
9433 fi
9434
9435
9436                 # restore the LIBS
9437                 LIBS="$ol_LIBS"
9438         
9439 fi
9440
9441 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9442
9443         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9444                 ol_link_pthreads="-lpthread -lmach -lexc"
9445                 ol_link_threads=posix
9446         fi
9447 fi
9448
9449
9450                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9451 if test "$ol_link_threads" = no ; then
9452         # try -lpthread -Wl,-woff,85
9453         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9454 echo "configure:9455: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9455 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9456   echo $ac_n "(cached) $ac_c" 1>&6
9457 else
9458   
9459                 # save the flags
9460                 ol_LIBS="$LIBS"
9461                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9462
9463                 if test "$cross_compiling" = yes; then
9464   cat > conftest.$ac_ext <<EOF
9465 #line 9466 "configure"
9466 #include "confdefs.h"
9467 /* pthread test headers */
9468 #include <pthread.h>
9469 #ifndef NULL
9470 #define NULL (void*)0
9471 #endif
9472
9473 static void *task(p)
9474         void *p;
9475 {
9476         return (void *) (p == NULL);
9477 }
9478
9479 int main() {
9480
9481         /* pthread test function */
9482         pthread_t t;
9483         int status;
9484         int detach = 1;
9485
9486 #ifdef HAVE_PTHREADS_FINAL
9487         /* Final pthreads */
9488         pthread_attr_t attr;
9489
9490         status = pthread_attr_init(&attr);
9491         if( status ) return status;
9492
9493 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9494         if( !detach ) {
9495 #if defined( PTHREAD_CREATE_JOINABLE )
9496                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9497 #else
9498                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9499 #endif
9500
9501 #ifdef PTHREAD_CREATE_DETACHED
9502         } else {
9503                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9504 #endif
9505         }
9506         if( status ) return status;
9507 #endif
9508
9509         status = pthread_create( &t, &attr, task, NULL );
9510         if( status ) return status;
9511
9512 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9513         if( detach ) {
9514                 /* give thread a chance to complete */
9515                 /* it should remain joinable and hence detachable */
9516                 sleep( 1 );
9517
9518                 status = pthread_detach( t );
9519                 if( status ) return status;
9520         }
9521 #endif
9522
9523 #else
9524         /* Draft 4 pthreads */
9525         status = pthread_create( &t, pthread_attr_default, task, NULL );
9526         if( status ) return status;
9527
9528         if( detach ) {
9529                 /* give thread a chance to complete */
9530                 /* it should remain joinable and hence detachable */
9531                 sleep( 1 );
9532
9533                 status = pthread_detach( &t );
9534                 if( status ) return status;
9535         }
9536 #endif
9537
9538 #ifdef HAVE_LINUX_THREADS
9539         pthread_kill_other_threads_np();
9540 #endif
9541
9542         return 0;
9543
9544 ; return 0; }
9545 EOF
9546 if { (eval echo configure:9547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9547   rm -rf conftest*
9548   ol_cv_pthread_lib_lpthread_woff=yes
9549 else
9550   echo "configure: failed program was:" >&5
9551   cat conftest.$ac_ext >&5
9552   rm -rf conftest*
9553   ol_cv_pthread_lib_lpthread_woff=no
9554 fi
9555 rm -f conftest*
9556 else
9557   cat > conftest.$ac_ext <<EOF
9558 #line 9559 "configure"
9559 #include "confdefs.h"
9560 /* pthread test headers */
9561 #include <pthread.h>
9562 #ifndef NULL
9563 #define NULL (void*)0
9564 #endif
9565
9566 static void *task(p)
9567         void *p;
9568 {
9569         return (void *) (p == NULL);
9570 }
9571
9572
9573 int main(argc, argv)
9574         int argc;
9575         char **argv;
9576 {
9577
9578         /* pthread test function */
9579         pthread_t t;
9580         int status;
9581         int detach = 1;
9582
9583 #ifdef HAVE_PTHREADS_FINAL
9584         /* Final pthreads */
9585         pthread_attr_t attr;
9586
9587         status = pthread_attr_init(&attr);
9588         if( status ) return status;
9589
9590 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9591         if( !detach ) {
9592 #if defined( PTHREAD_CREATE_JOINABLE )
9593                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9594 #else
9595                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9596 #endif
9597
9598 #ifdef PTHREAD_CREATE_DETACHED
9599         } else {
9600                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9601 #endif
9602         }
9603         if( status ) return status;
9604 #endif
9605
9606         status = pthread_create( &t, &attr, task, NULL );
9607         if( status ) return status;
9608
9609 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9610         if( detach ) {
9611                 /* give thread a chance to complete */
9612                 /* it should remain joinable and hence detachable */
9613                 sleep( 1 );
9614
9615                 status = pthread_detach( t );
9616                 if( status ) return status;
9617         }
9618 #endif
9619
9620 #else
9621         /* Draft 4 pthreads */
9622         status = pthread_create( &t, pthread_attr_default, task, NULL );
9623         if( status ) return status;
9624
9625         if( detach ) {
9626                 /* give thread a chance to complete */
9627                 /* it should remain joinable and hence detachable */
9628                 sleep( 1 );
9629
9630                 status = pthread_detach( &t );
9631                 if( status ) return status;
9632         }
9633 #endif
9634
9635 #ifdef HAVE_LINUX_THREADS
9636         pthread_kill_other_threads_np();
9637 #endif
9638
9639         return 0;
9640
9641 }
9642
9643 EOF
9644 if { (eval echo configure:9645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9645 then
9646   ol_cv_pthread_lib_lpthread_woff=yes
9647 else
9648   echo "configure: failed program was:" >&5
9649   cat conftest.$ac_ext >&5
9650   rm -fr conftest*
9651   ol_cv_pthread_lib_lpthread_woff=no
9652 fi
9653 rm -fr conftest*
9654 fi
9655
9656
9657                 # restore the LIBS
9658                 LIBS="$ol_LIBS"
9659         
9660 fi
9661
9662 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9663
9664         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9665                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9666                 ol_link_threads=posix
9667         fi
9668 fi
9669
9670
9671                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9672 if test "$ol_link_threads" = no ; then
9673         # try -lpthread
9674         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9675 echo "configure:9676: checking for pthread link with -lpthread" >&5
9676 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9677   echo $ac_n "(cached) $ac_c" 1>&6
9678 else
9679   
9680                 # save the flags
9681                 ol_LIBS="$LIBS"
9682                 LIBS="-lpthread $LIBS"
9683
9684                 if test "$cross_compiling" = yes; then
9685   cat > conftest.$ac_ext <<EOF
9686 #line 9687 "configure"
9687 #include "confdefs.h"
9688 /* pthread test headers */
9689 #include <pthread.h>
9690 #ifndef NULL
9691 #define NULL (void*)0
9692 #endif
9693
9694 static void *task(p)
9695         void *p;
9696 {
9697         return (void *) (p == NULL);
9698 }
9699
9700 int main() {
9701
9702         /* pthread test function */
9703         pthread_t t;
9704         int status;
9705         int detach = 1;
9706
9707 #ifdef HAVE_PTHREADS_FINAL
9708         /* Final pthreads */
9709         pthread_attr_t attr;
9710
9711         status = pthread_attr_init(&attr);
9712         if( status ) return status;
9713
9714 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9715         if( !detach ) {
9716 #if defined( PTHREAD_CREATE_JOINABLE )
9717                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9718 #else
9719                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9720 #endif
9721
9722 #ifdef PTHREAD_CREATE_DETACHED
9723         } else {
9724                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9725 #endif
9726         }
9727         if( status ) return status;
9728 #endif
9729
9730         status = pthread_create( &t, &attr, task, NULL );
9731         if( status ) return status;
9732
9733 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9734         if( detach ) {
9735                 /* give thread a chance to complete */
9736                 /* it should remain joinable and hence detachable */
9737                 sleep( 1 );
9738
9739                 status = pthread_detach( t );
9740                 if( status ) return status;
9741         }
9742 #endif
9743
9744 #else
9745         /* Draft 4 pthreads */
9746         status = pthread_create( &t, pthread_attr_default, task, NULL );
9747         if( status ) return status;
9748
9749         if( detach ) {
9750                 /* give thread a chance to complete */
9751                 /* it should remain joinable and hence detachable */
9752                 sleep( 1 );
9753
9754                 status = pthread_detach( &t );
9755                 if( status ) return status;
9756         }
9757 #endif
9758
9759 #ifdef HAVE_LINUX_THREADS
9760         pthread_kill_other_threads_np();
9761 #endif
9762
9763         return 0;
9764
9765 ; return 0; }
9766 EOF
9767 if { (eval echo configure:9768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9768   rm -rf conftest*
9769   ol_cv_pthread_lpthread=yes
9770 else
9771   echo "configure: failed program was:" >&5
9772   cat conftest.$ac_ext >&5
9773   rm -rf conftest*
9774   ol_cv_pthread_lpthread=no
9775 fi
9776 rm -f conftest*
9777 else
9778   cat > conftest.$ac_ext <<EOF
9779 #line 9780 "configure"
9780 #include "confdefs.h"
9781 /* pthread test headers */
9782 #include <pthread.h>
9783 #ifndef NULL
9784 #define NULL (void*)0
9785 #endif
9786
9787 static void *task(p)
9788         void *p;
9789 {
9790         return (void *) (p == NULL);
9791 }
9792
9793
9794 int main(argc, argv)
9795         int argc;
9796         char **argv;
9797 {
9798
9799         /* pthread test function */
9800         pthread_t t;
9801         int status;
9802         int detach = 1;
9803
9804 #ifdef HAVE_PTHREADS_FINAL
9805         /* Final pthreads */
9806         pthread_attr_t attr;
9807
9808         status = pthread_attr_init(&attr);
9809         if( status ) return status;
9810
9811 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9812         if( !detach ) {
9813 #if defined( PTHREAD_CREATE_JOINABLE )
9814                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9815 #else
9816                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9817 #endif
9818
9819 #ifdef PTHREAD_CREATE_DETACHED
9820         } else {
9821                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9822 #endif
9823         }
9824         if( status ) return status;
9825 #endif
9826
9827         status = pthread_create( &t, &attr, task, NULL );
9828         if( status ) return status;
9829
9830 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9831         if( detach ) {
9832                 /* give thread a chance to complete */
9833                 /* it should remain joinable and hence detachable */
9834                 sleep( 1 );
9835
9836                 status = pthread_detach( t );
9837                 if( status ) return status;
9838         }
9839 #endif
9840
9841 #else
9842         /* Draft 4 pthreads */
9843         status = pthread_create( &t, pthread_attr_default, task, NULL );
9844         if( status ) return status;
9845
9846         if( detach ) {
9847                 /* give thread a chance to complete */
9848                 /* it should remain joinable and hence detachable */
9849                 sleep( 1 );
9850
9851                 status = pthread_detach( &t );
9852                 if( status ) return status;
9853         }
9854 #endif
9855
9856 #ifdef HAVE_LINUX_THREADS
9857         pthread_kill_other_threads_np();
9858 #endif
9859
9860         return 0;
9861
9862 }
9863
9864 EOF
9865 if { (eval echo configure:9866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9866 then
9867   ol_cv_pthread_lpthread=yes
9868 else
9869   echo "configure: failed program was:" >&5
9870   cat conftest.$ac_ext >&5
9871   rm -fr conftest*
9872   ol_cv_pthread_lpthread=no
9873 fi
9874 rm -fr conftest*
9875 fi
9876
9877
9878                 # restore the LIBS
9879                 LIBS="$ol_LIBS"
9880         
9881 fi
9882
9883 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9884
9885         if test $ol_cv_pthread_lpthread = yes ; then
9886                 ol_link_pthreads="-lpthread"
9887                 ol_link_threads=posix
9888         fi
9889 fi
9890
9891                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9892 if test "$ol_link_threads" = no ; then
9893         # try -lc_r
9894         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9895 echo "configure:9896: checking for pthread link with -lc_r" >&5
9896 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9897   echo $ac_n "(cached) $ac_c" 1>&6
9898 else
9899   
9900                 # save the flags
9901                 ol_LIBS="$LIBS"
9902                 LIBS="-lc_r $LIBS"
9903
9904                 if test "$cross_compiling" = yes; then
9905   cat > conftest.$ac_ext <<EOF
9906 #line 9907 "configure"
9907 #include "confdefs.h"
9908 /* pthread test headers */
9909 #include <pthread.h>
9910 #ifndef NULL
9911 #define NULL (void*)0
9912 #endif
9913
9914 static void *task(p)
9915         void *p;
9916 {
9917         return (void *) (p == NULL);
9918 }
9919
9920 int main() {
9921
9922         /* pthread test function */
9923         pthread_t t;
9924         int status;
9925         int detach = 1;
9926
9927 #ifdef HAVE_PTHREADS_FINAL
9928         /* Final pthreads */
9929         pthread_attr_t attr;
9930
9931         status = pthread_attr_init(&attr);
9932         if( status ) return status;
9933
9934 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9935         if( !detach ) {
9936 #if defined( PTHREAD_CREATE_JOINABLE )
9937                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9938 #else
9939                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9940 #endif
9941
9942 #ifdef PTHREAD_CREATE_DETACHED
9943         } else {
9944                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9945 #endif
9946         }
9947         if( status ) return status;
9948 #endif
9949
9950         status = pthread_create( &t, &attr, task, NULL );
9951         if( status ) return status;
9952
9953 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9954         if( detach ) {
9955                 /* give thread a chance to complete */
9956                 /* it should remain joinable and hence detachable */
9957                 sleep( 1 );
9958
9959                 status = pthread_detach( t );
9960                 if( status ) return status;
9961         }
9962 #endif
9963
9964 #else
9965         /* Draft 4 pthreads */
9966         status = pthread_create( &t, pthread_attr_default, task, NULL );
9967         if( status ) return status;
9968
9969         if( detach ) {
9970                 /* give thread a chance to complete */
9971                 /* it should remain joinable and hence detachable */
9972                 sleep( 1 );
9973
9974                 status = pthread_detach( &t );
9975                 if( status ) return status;
9976         }
9977 #endif
9978
9979 #ifdef HAVE_LINUX_THREADS
9980         pthread_kill_other_threads_np();
9981 #endif
9982
9983         return 0;
9984
9985 ; return 0; }
9986 EOF
9987 if { (eval echo configure:9988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9988   rm -rf conftest*
9989   ol_cv_pthread_lc_r=yes
9990 else
9991   echo "configure: failed program was:" >&5
9992   cat conftest.$ac_ext >&5
9993   rm -rf conftest*
9994   ol_cv_pthread_lc_r=no
9995 fi
9996 rm -f conftest*
9997 else
9998   cat > conftest.$ac_ext <<EOF
9999 #line 10000 "configure"
10000 #include "confdefs.h"
10001 /* pthread test headers */
10002 #include <pthread.h>
10003 #ifndef NULL
10004 #define NULL (void*)0
10005 #endif
10006
10007 static void *task(p)
10008         void *p;
10009 {
10010         return (void *) (p == NULL);
10011 }
10012
10013
10014 int main(argc, argv)
10015         int argc;
10016         char **argv;
10017 {
10018
10019         /* pthread test function */
10020         pthread_t t;
10021         int status;
10022         int detach = 1;
10023
10024 #ifdef HAVE_PTHREADS_FINAL
10025         /* Final pthreads */
10026         pthread_attr_t attr;
10027
10028         status = pthread_attr_init(&attr);
10029         if( status ) return status;
10030
10031 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10032         if( !detach ) {
10033 #if defined( PTHREAD_CREATE_JOINABLE )
10034                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10035 #else
10036                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10037 #endif
10038
10039 #ifdef PTHREAD_CREATE_DETACHED
10040         } else {
10041                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10042 #endif
10043         }
10044         if( status ) return status;
10045 #endif
10046
10047         status = pthread_create( &t, &attr, task, NULL );
10048         if( status ) return status;
10049
10050 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10051         if( detach ) {
10052                 /* give thread a chance to complete */
10053                 /* it should remain joinable and hence detachable */
10054                 sleep( 1 );
10055
10056                 status = pthread_detach( t );
10057                 if( status ) return status;
10058         }
10059 #endif
10060
10061 #else
10062         /* Draft 4 pthreads */
10063         status = pthread_create( &t, pthread_attr_default, task, NULL );
10064         if( status ) return status;
10065
10066         if( detach ) {
10067                 /* give thread a chance to complete */
10068                 /* it should remain joinable and hence detachable */
10069                 sleep( 1 );
10070
10071                 status = pthread_detach( &t );
10072                 if( status ) return status;
10073         }
10074 #endif
10075
10076 #ifdef HAVE_LINUX_THREADS
10077         pthread_kill_other_threads_np();
10078 #endif
10079
10080         return 0;
10081
10082 }
10083
10084 EOF
10085 if { (eval echo configure:10086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10086 then
10087   ol_cv_pthread_lc_r=yes
10088 else
10089   echo "configure: failed program was:" >&5
10090   cat conftest.$ac_ext >&5
10091   rm -fr conftest*
10092   ol_cv_pthread_lc_r=no
10093 fi
10094 rm -fr conftest*
10095 fi
10096
10097
10098                 # restore the LIBS
10099                 LIBS="$ol_LIBS"
10100         
10101 fi
10102
10103 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10104
10105         if test $ol_cv_pthread_lc_r = yes ; then
10106                 ol_link_pthreads="-lc_r"
10107                 ol_link_threads=posix
10108         fi
10109 fi
10110
10111
10112                 # Pthread try link: -threads (ol_cv_pthread_threads)
10113 if test "$ol_link_threads" = no ; then
10114         # try -threads
10115         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10116 echo "configure:10117: checking for pthread link with -threads" >&5
10117 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10118   echo $ac_n "(cached) $ac_c" 1>&6
10119 else
10120   
10121                 # save the flags
10122                 ol_LIBS="$LIBS"
10123                 LIBS="-threads $LIBS"
10124
10125                 if test "$cross_compiling" = yes; then
10126   cat > conftest.$ac_ext <<EOF
10127 #line 10128 "configure"
10128 #include "confdefs.h"
10129 /* pthread test headers */
10130 #include <pthread.h>
10131 #ifndef NULL
10132 #define NULL (void*)0
10133 #endif
10134
10135 static void *task(p)
10136         void *p;
10137 {
10138         return (void *) (p == NULL);
10139 }
10140
10141 int main() {
10142
10143         /* pthread test function */
10144         pthread_t t;
10145         int status;
10146         int detach = 1;
10147
10148 #ifdef HAVE_PTHREADS_FINAL
10149         /* Final pthreads */
10150         pthread_attr_t attr;
10151
10152         status = pthread_attr_init(&attr);
10153         if( status ) return status;
10154
10155 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10156         if( !detach ) {
10157 #if defined( PTHREAD_CREATE_JOINABLE )
10158                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10159 #else
10160                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10161 #endif
10162
10163 #ifdef PTHREAD_CREATE_DETACHED
10164         } else {
10165                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10166 #endif
10167         }
10168         if( status ) return status;
10169 #endif
10170
10171         status = pthread_create( &t, &attr, task, NULL );
10172         if( status ) return status;
10173
10174 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10175         if( detach ) {
10176                 /* give thread a chance to complete */
10177                 /* it should remain joinable and hence detachable */
10178                 sleep( 1 );
10179
10180                 status = pthread_detach( t );
10181                 if( status ) return status;
10182         }
10183 #endif
10184
10185 #else
10186         /* Draft 4 pthreads */
10187         status = pthread_create( &t, pthread_attr_default, task, NULL );
10188         if( status ) return status;
10189
10190         if( detach ) {
10191                 /* give thread a chance to complete */
10192                 /* it should remain joinable and hence detachable */
10193                 sleep( 1 );
10194
10195                 status = pthread_detach( &t );
10196                 if( status ) return status;
10197         }
10198 #endif
10199
10200 #ifdef HAVE_LINUX_THREADS
10201         pthread_kill_other_threads_np();
10202 #endif
10203
10204         return 0;
10205
10206 ; return 0; }
10207 EOF
10208 if { (eval echo configure:10209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10209   rm -rf conftest*
10210   ol_cv_pthread_threads=yes
10211 else
10212   echo "configure: failed program was:" >&5
10213   cat conftest.$ac_ext >&5
10214   rm -rf conftest*
10215   ol_cv_pthread_threads=no
10216 fi
10217 rm -f conftest*
10218 else
10219   cat > conftest.$ac_ext <<EOF
10220 #line 10221 "configure"
10221 #include "confdefs.h"
10222 /* pthread test headers */
10223 #include <pthread.h>
10224 #ifndef NULL
10225 #define NULL (void*)0
10226 #endif
10227
10228 static void *task(p)
10229         void *p;
10230 {
10231         return (void *) (p == NULL);
10232 }
10233
10234
10235 int main(argc, argv)
10236         int argc;
10237         char **argv;
10238 {
10239
10240         /* pthread test function */
10241         pthread_t t;
10242         int status;
10243         int detach = 1;
10244
10245 #ifdef HAVE_PTHREADS_FINAL
10246         /* Final pthreads */
10247         pthread_attr_t attr;
10248
10249         status = pthread_attr_init(&attr);
10250         if( status ) return status;
10251
10252 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10253         if( !detach ) {
10254 #if defined( PTHREAD_CREATE_JOINABLE )
10255                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10256 #else
10257                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10258 #endif
10259
10260 #ifdef PTHREAD_CREATE_DETACHED
10261         } else {
10262                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10263 #endif
10264         }
10265         if( status ) return status;
10266 #endif
10267
10268         status = pthread_create( &t, &attr, task, NULL );
10269         if( status ) return status;
10270
10271 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10272         if( detach ) {
10273                 /* give thread a chance to complete */
10274                 /* it should remain joinable and hence detachable */
10275                 sleep( 1 );
10276
10277                 status = pthread_detach( t );
10278                 if( status ) return status;
10279         }
10280 #endif
10281
10282 #else
10283         /* Draft 4 pthreads */
10284         status = pthread_create( &t, pthread_attr_default, task, NULL );
10285         if( status ) return status;
10286
10287         if( detach ) {
10288                 /* give thread a chance to complete */
10289                 /* it should remain joinable and hence detachable */
10290                 sleep( 1 );
10291
10292                 status = pthread_detach( &t );
10293                 if( status ) return status;
10294         }
10295 #endif
10296
10297 #ifdef HAVE_LINUX_THREADS
10298         pthread_kill_other_threads_np();
10299 #endif
10300
10301         return 0;
10302
10303 }
10304
10305 EOF
10306 if { (eval echo configure:10307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10307 then
10308   ol_cv_pthread_threads=yes
10309 else
10310   echo "configure: failed program was:" >&5
10311   cat conftest.$ac_ext >&5
10312   rm -fr conftest*
10313   ol_cv_pthread_threads=no
10314 fi
10315 rm -fr conftest*
10316 fi
10317
10318
10319                 # restore the LIBS
10320                 LIBS="$ol_LIBS"
10321         
10322 fi
10323
10324 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10325
10326         if test $ol_cv_pthread_threads = yes ; then
10327                 ol_link_pthreads="-threads"
10328                 ol_link_threads=posix
10329         fi
10330 fi
10331
10332
10333                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10334 if test "$ol_link_threads" = no ; then
10335         # try -lpthreads -lmach -lexc -lc_r
10336         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10337 echo "configure:10338: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10338 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10339   echo $ac_n "(cached) $ac_c" 1>&6
10340 else
10341   
10342                 # save the flags
10343                 ol_LIBS="$LIBS"
10344                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10345
10346                 if test "$cross_compiling" = yes; then
10347   cat > conftest.$ac_ext <<EOF
10348 #line 10349 "configure"
10349 #include "confdefs.h"
10350 /* pthread test headers */
10351 #include <pthread.h>
10352 #ifndef NULL
10353 #define NULL (void*)0
10354 #endif
10355
10356 static void *task(p)
10357         void *p;
10358 {
10359         return (void *) (p == NULL);
10360 }
10361
10362 int main() {
10363
10364         /* pthread test function */
10365         pthread_t t;
10366         int status;
10367         int detach = 1;
10368
10369 #ifdef HAVE_PTHREADS_FINAL
10370         /* Final pthreads */
10371         pthread_attr_t attr;
10372
10373         status = pthread_attr_init(&attr);
10374         if( status ) return status;
10375
10376 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10377         if( !detach ) {
10378 #if defined( PTHREAD_CREATE_JOINABLE )
10379                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10380 #else
10381                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10382 #endif
10383
10384 #ifdef PTHREAD_CREATE_DETACHED
10385         } else {
10386                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10387 #endif
10388         }
10389         if( status ) return status;
10390 #endif
10391
10392         status = pthread_create( &t, &attr, task, NULL );
10393         if( status ) return status;
10394
10395 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10396         if( detach ) {
10397                 /* give thread a chance to complete */
10398                 /* it should remain joinable and hence detachable */
10399                 sleep( 1 );
10400
10401                 status = pthread_detach( t );
10402                 if( status ) return status;
10403         }
10404 #endif
10405
10406 #else
10407         /* Draft 4 pthreads */
10408         status = pthread_create( &t, pthread_attr_default, task, NULL );
10409         if( status ) return status;
10410
10411         if( detach ) {
10412                 /* give thread a chance to complete */
10413                 /* it should remain joinable and hence detachable */
10414                 sleep( 1 );
10415
10416                 status = pthread_detach( &t );
10417                 if( status ) return status;
10418         }
10419 #endif
10420
10421 #ifdef HAVE_LINUX_THREADS
10422         pthread_kill_other_threads_np();
10423 #endif
10424
10425         return 0;
10426
10427 ; return 0; }
10428 EOF
10429 if { (eval echo configure:10430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10430   rm -rf conftest*
10431   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10432 else
10433   echo "configure: failed program was:" >&5
10434   cat conftest.$ac_ext >&5
10435   rm -rf conftest*
10436   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10437 fi
10438 rm -f conftest*
10439 else
10440   cat > conftest.$ac_ext <<EOF
10441 #line 10442 "configure"
10442 #include "confdefs.h"
10443 /* pthread test headers */
10444 #include <pthread.h>
10445 #ifndef NULL
10446 #define NULL (void*)0
10447 #endif
10448
10449 static void *task(p)
10450         void *p;
10451 {
10452         return (void *) (p == NULL);
10453 }
10454
10455
10456 int main(argc, argv)
10457         int argc;
10458         char **argv;
10459 {
10460
10461         /* pthread test function */
10462         pthread_t t;
10463         int status;
10464         int detach = 1;
10465
10466 #ifdef HAVE_PTHREADS_FINAL
10467         /* Final pthreads */
10468         pthread_attr_t attr;
10469
10470         status = pthread_attr_init(&attr);
10471         if( status ) return status;
10472
10473 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10474         if( !detach ) {
10475 #if defined( PTHREAD_CREATE_JOINABLE )
10476                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10477 #else
10478                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10479 #endif
10480
10481 #ifdef PTHREAD_CREATE_DETACHED
10482         } else {
10483                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10484 #endif
10485         }
10486         if( status ) return status;
10487 #endif
10488
10489         status = pthread_create( &t, &attr, task, NULL );
10490         if( status ) return status;
10491
10492 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10493         if( detach ) {
10494                 /* give thread a chance to complete */
10495                 /* it should remain joinable and hence detachable */
10496                 sleep( 1 );
10497
10498                 status = pthread_detach( t );
10499                 if( status ) return status;
10500         }
10501 #endif
10502
10503 #else
10504         /* Draft 4 pthreads */
10505         status = pthread_create( &t, pthread_attr_default, task, NULL );
10506         if( status ) return status;
10507
10508         if( detach ) {
10509                 /* give thread a chance to complete */
10510                 /* it should remain joinable and hence detachable */
10511                 sleep( 1 );
10512
10513                 status = pthread_detach( &t );
10514                 if( status ) return status;
10515         }
10516 #endif
10517
10518 #ifdef HAVE_LINUX_THREADS
10519         pthread_kill_other_threads_np();
10520 #endif
10521
10522         return 0;
10523
10524 }
10525
10526 EOF
10527 if { (eval echo configure:10528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10528 then
10529   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10530 else
10531   echo "configure: failed program was:" >&5
10532   cat conftest.$ac_ext >&5
10533   rm -fr conftest*
10534   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10535 fi
10536 rm -fr conftest*
10537 fi
10538
10539
10540                 # restore the LIBS
10541                 LIBS="$ol_LIBS"
10542         
10543 fi
10544
10545 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10546
10547         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10548                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10549                 ol_link_threads=posix
10550         fi
10551 fi
10552
10553                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10554 if test "$ol_link_threads" = no ; then
10555         # try -lpthreads -lmach -lexc
10556         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10557 echo "configure:10558: checking for pthread link with -lpthreads -lmach -lexc" >&5
10558 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10559   echo $ac_n "(cached) $ac_c" 1>&6
10560 else
10561   
10562                 # save the flags
10563                 ol_LIBS="$LIBS"
10564                 LIBS="-lpthreads -lmach -lexc $LIBS"
10565
10566                 if test "$cross_compiling" = yes; then
10567   cat > conftest.$ac_ext <<EOF
10568 #line 10569 "configure"
10569 #include "confdefs.h"
10570 /* pthread test headers */
10571 #include <pthread.h>
10572 #ifndef NULL
10573 #define NULL (void*)0
10574 #endif
10575
10576 static void *task(p)
10577         void *p;
10578 {
10579         return (void *) (p == NULL);
10580 }
10581
10582 int main() {
10583
10584         /* pthread test function */
10585         pthread_t t;
10586         int status;
10587         int detach = 1;
10588
10589 #ifdef HAVE_PTHREADS_FINAL
10590         /* Final pthreads */
10591         pthread_attr_t attr;
10592
10593         status = pthread_attr_init(&attr);
10594         if( status ) return status;
10595
10596 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10597         if( !detach ) {
10598 #if defined( PTHREAD_CREATE_JOINABLE )
10599                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10600 #else
10601                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10602 #endif
10603
10604 #ifdef PTHREAD_CREATE_DETACHED
10605         } else {
10606                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10607 #endif
10608         }
10609         if( status ) return status;
10610 #endif
10611
10612         status = pthread_create( &t, &attr, task, NULL );
10613         if( status ) return status;
10614
10615 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10616         if( detach ) {
10617                 /* give thread a chance to complete */
10618                 /* it should remain joinable and hence detachable */
10619                 sleep( 1 );
10620
10621                 status = pthread_detach( t );
10622                 if( status ) return status;
10623         }
10624 #endif
10625
10626 #else
10627         /* Draft 4 pthreads */
10628         status = pthread_create( &t, pthread_attr_default, task, NULL );
10629         if( status ) return status;
10630
10631         if( detach ) {
10632                 /* give thread a chance to complete */
10633                 /* it should remain joinable and hence detachable */
10634                 sleep( 1 );
10635
10636                 status = pthread_detach( &t );
10637                 if( status ) return status;
10638         }
10639 #endif
10640
10641 #ifdef HAVE_LINUX_THREADS
10642         pthread_kill_other_threads_np();
10643 #endif
10644
10645         return 0;
10646
10647 ; return 0; }
10648 EOF
10649 if { (eval echo configure:10650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10650   rm -rf conftest*
10651   ol_cv_pthread_lpthreads_lmach_lexc=yes
10652 else
10653   echo "configure: failed program was:" >&5
10654   cat conftest.$ac_ext >&5
10655   rm -rf conftest*
10656   ol_cv_pthread_lpthreads_lmach_lexc=no
10657 fi
10658 rm -f conftest*
10659 else
10660   cat > conftest.$ac_ext <<EOF
10661 #line 10662 "configure"
10662 #include "confdefs.h"
10663 /* pthread test headers */
10664 #include <pthread.h>
10665 #ifndef NULL
10666 #define NULL (void*)0
10667 #endif
10668
10669 static void *task(p)
10670         void *p;
10671 {
10672         return (void *) (p == NULL);
10673 }
10674
10675
10676 int main(argc, argv)
10677         int argc;
10678         char **argv;
10679 {
10680
10681         /* pthread test function */
10682         pthread_t t;
10683         int status;
10684         int detach = 1;
10685
10686 #ifdef HAVE_PTHREADS_FINAL
10687         /* Final pthreads */
10688         pthread_attr_t attr;
10689
10690         status = pthread_attr_init(&attr);
10691         if( status ) return status;
10692
10693 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10694         if( !detach ) {
10695 #if defined( PTHREAD_CREATE_JOINABLE )
10696                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10697 #else
10698                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10699 #endif
10700
10701 #ifdef PTHREAD_CREATE_DETACHED
10702         } else {
10703                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10704 #endif
10705         }
10706         if( status ) return status;
10707 #endif
10708
10709         status = pthread_create( &t, &attr, task, NULL );
10710         if( status ) return status;
10711
10712 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10713         if( detach ) {
10714                 /* give thread a chance to complete */
10715                 /* it should remain joinable and hence detachable */
10716                 sleep( 1 );
10717
10718                 status = pthread_detach( t );
10719                 if( status ) return status;
10720         }
10721 #endif
10722
10723 #else
10724         /* Draft 4 pthreads */
10725         status = pthread_create( &t, pthread_attr_default, task, NULL );
10726         if( status ) return status;
10727
10728         if( detach ) {
10729                 /* give thread a chance to complete */
10730                 /* it should remain joinable and hence detachable */
10731                 sleep( 1 );
10732
10733                 status = pthread_detach( &t );
10734                 if( status ) return status;
10735         }
10736 #endif
10737
10738 #ifdef HAVE_LINUX_THREADS
10739         pthread_kill_other_threads_np();
10740 #endif
10741
10742         return 0;
10743
10744 }
10745
10746 EOF
10747 if { (eval echo configure:10748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10748 then
10749   ol_cv_pthread_lpthreads_lmach_lexc=yes
10750 else
10751   echo "configure: failed program was:" >&5
10752   cat conftest.$ac_ext >&5
10753   rm -fr conftest*
10754   ol_cv_pthread_lpthreads_lmach_lexc=no
10755 fi
10756 rm -fr conftest*
10757 fi
10758
10759
10760                 # restore the LIBS
10761                 LIBS="$ol_LIBS"
10762         
10763 fi
10764
10765 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10766
10767         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10768                 ol_link_pthreads="-lpthreads -lmach -lexc"
10769                 ol_link_threads=posix
10770         fi
10771 fi
10772
10773                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10774 if test "$ol_link_threads" = no ; then
10775         # try -lpthreads -lexc
10776         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10777 echo "configure:10778: checking for pthread link with -lpthreads -lexc" >&5
10778 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10779   echo $ac_n "(cached) $ac_c" 1>&6
10780 else
10781   
10782                 # save the flags
10783                 ol_LIBS="$LIBS"
10784                 LIBS="-lpthreads -lexc $LIBS"
10785
10786                 if test "$cross_compiling" = yes; then
10787   cat > conftest.$ac_ext <<EOF
10788 #line 10789 "configure"
10789 #include "confdefs.h"
10790 /* pthread test headers */
10791 #include <pthread.h>
10792 #ifndef NULL
10793 #define NULL (void*)0
10794 #endif
10795
10796 static void *task(p)
10797         void *p;
10798 {
10799         return (void *) (p == NULL);
10800 }
10801
10802 int main() {
10803
10804         /* pthread test function */
10805         pthread_t t;
10806         int status;
10807         int detach = 1;
10808
10809 #ifdef HAVE_PTHREADS_FINAL
10810         /* Final pthreads */
10811         pthread_attr_t attr;
10812
10813         status = pthread_attr_init(&attr);
10814         if( status ) return status;
10815
10816 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10817         if( !detach ) {
10818 #if defined( PTHREAD_CREATE_JOINABLE )
10819                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10820 #else
10821                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10822 #endif
10823
10824 #ifdef PTHREAD_CREATE_DETACHED
10825         } else {
10826                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10827 #endif
10828         }
10829         if( status ) return status;
10830 #endif
10831
10832         status = pthread_create( &t, &attr, task, NULL );
10833         if( status ) return status;
10834
10835 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10836         if( detach ) {
10837                 /* give thread a chance to complete */
10838                 /* it should remain joinable and hence detachable */
10839                 sleep( 1 );
10840
10841                 status = pthread_detach( t );
10842                 if( status ) return status;
10843         }
10844 #endif
10845
10846 #else
10847         /* Draft 4 pthreads */
10848         status = pthread_create( &t, pthread_attr_default, task, NULL );
10849         if( status ) return status;
10850
10851         if( detach ) {
10852                 /* give thread a chance to complete */
10853                 /* it should remain joinable and hence detachable */
10854                 sleep( 1 );
10855
10856                 status = pthread_detach( &t );
10857                 if( status ) return status;
10858         }
10859 #endif
10860
10861 #ifdef HAVE_LINUX_THREADS
10862         pthread_kill_other_threads_np();
10863 #endif
10864
10865         return 0;
10866
10867 ; return 0; }
10868 EOF
10869 if { (eval echo configure:10870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10870   rm -rf conftest*
10871   ol_cv_pthread_lpthreads_lexc=yes
10872 else
10873   echo "configure: failed program was:" >&5
10874   cat conftest.$ac_ext >&5
10875   rm -rf conftest*
10876   ol_cv_pthread_lpthreads_lexc=no
10877 fi
10878 rm -f conftest*
10879 else
10880   cat > conftest.$ac_ext <<EOF
10881 #line 10882 "configure"
10882 #include "confdefs.h"
10883 /* pthread test headers */
10884 #include <pthread.h>
10885 #ifndef NULL
10886 #define NULL (void*)0
10887 #endif
10888
10889 static void *task(p)
10890         void *p;
10891 {
10892         return (void *) (p == NULL);
10893 }
10894
10895
10896 int main(argc, argv)
10897         int argc;
10898         char **argv;
10899 {
10900
10901         /* pthread test function */
10902         pthread_t t;
10903         int status;
10904         int detach = 1;
10905
10906 #ifdef HAVE_PTHREADS_FINAL
10907         /* Final pthreads */
10908         pthread_attr_t attr;
10909
10910         status = pthread_attr_init(&attr);
10911         if( status ) return status;
10912
10913 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10914         if( !detach ) {
10915 #if defined( PTHREAD_CREATE_JOINABLE )
10916                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10917 #else
10918                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10919 #endif
10920
10921 #ifdef PTHREAD_CREATE_DETACHED
10922         } else {
10923                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10924 #endif
10925         }
10926         if( status ) return status;
10927 #endif
10928
10929         status = pthread_create( &t, &attr, task, NULL );
10930         if( status ) return status;
10931
10932 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10933         if( detach ) {
10934                 /* give thread a chance to complete */
10935                 /* it should remain joinable and hence detachable */
10936                 sleep( 1 );
10937
10938                 status = pthread_detach( t );
10939                 if( status ) return status;
10940         }
10941 #endif
10942
10943 #else
10944         /* Draft 4 pthreads */
10945         status = pthread_create( &t, pthread_attr_default, task, NULL );
10946         if( status ) return status;
10947
10948         if( detach ) {
10949                 /* give thread a chance to complete */
10950                 /* it should remain joinable and hence detachable */
10951                 sleep( 1 );
10952
10953                 status = pthread_detach( &t );
10954                 if( status ) return status;
10955         }
10956 #endif
10957
10958 #ifdef HAVE_LINUX_THREADS
10959         pthread_kill_other_threads_np();
10960 #endif
10961
10962         return 0;
10963
10964 }
10965
10966 EOF
10967 if { (eval echo configure:10968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10968 then
10969   ol_cv_pthread_lpthreads_lexc=yes
10970 else
10971   echo "configure: failed program was:" >&5
10972   cat conftest.$ac_ext >&5
10973   rm -fr conftest*
10974   ol_cv_pthread_lpthreads_lexc=no
10975 fi
10976 rm -fr conftest*
10977 fi
10978
10979
10980                 # restore the LIBS
10981                 LIBS="$ol_LIBS"
10982         
10983 fi
10984
10985 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10986
10987         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10988                 ol_link_pthreads="-lpthreads -lexc"
10989                 ol_link_threads=posix
10990         fi
10991 fi
10992
10993
10994                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10995 if test "$ol_link_threads" = no ; then
10996         # try -lpthreads
10997         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10998 echo "configure:10999: checking for pthread link with -lpthreads" >&5
10999 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11000   echo $ac_n "(cached) $ac_c" 1>&6
11001 else
11002   
11003                 # save the flags
11004                 ol_LIBS="$LIBS"
11005                 LIBS="-lpthreads $LIBS"
11006
11007                 if test "$cross_compiling" = yes; then
11008   cat > conftest.$ac_ext <<EOF
11009 #line 11010 "configure"
11010 #include "confdefs.h"
11011 /* pthread test headers */
11012 #include <pthread.h>
11013 #ifndef NULL
11014 #define NULL (void*)0
11015 #endif
11016
11017 static void *task(p)
11018         void *p;
11019 {
11020         return (void *) (p == NULL);
11021 }
11022
11023 int main() {
11024
11025         /* pthread test function */
11026         pthread_t t;
11027         int status;
11028         int detach = 1;
11029
11030 #ifdef HAVE_PTHREADS_FINAL
11031         /* Final pthreads */
11032         pthread_attr_t attr;
11033
11034         status = pthread_attr_init(&attr);
11035         if( status ) return status;
11036
11037 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11038         if( !detach ) {
11039 #if defined( PTHREAD_CREATE_JOINABLE )
11040                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11041 #else
11042                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11043 #endif
11044
11045 #ifdef PTHREAD_CREATE_DETACHED
11046         } else {
11047                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11048 #endif
11049         }
11050         if( status ) return status;
11051 #endif
11052
11053         status = pthread_create( &t, &attr, task, NULL );
11054         if( status ) return status;
11055
11056 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11057         if( detach ) {
11058                 /* give thread a chance to complete */
11059                 /* it should remain joinable and hence detachable */
11060                 sleep( 1 );
11061
11062                 status = pthread_detach( t );
11063                 if( status ) return status;
11064         }
11065 #endif
11066
11067 #else
11068         /* Draft 4 pthreads */
11069         status = pthread_create( &t, pthread_attr_default, task, NULL );
11070         if( status ) return status;
11071
11072         if( detach ) {
11073                 /* give thread a chance to complete */
11074                 /* it should remain joinable and hence detachable */
11075                 sleep( 1 );
11076
11077                 status = pthread_detach( &t );
11078                 if( status ) return status;
11079         }
11080 #endif
11081
11082 #ifdef HAVE_LINUX_THREADS
11083         pthread_kill_other_threads_np();
11084 #endif
11085
11086         return 0;
11087
11088 ; return 0; }
11089 EOF
11090 if { (eval echo configure:11091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11091   rm -rf conftest*
11092   ol_cv_pthread_lib_lpthreads=yes
11093 else
11094   echo "configure: failed program was:" >&5
11095   cat conftest.$ac_ext >&5
11096   rm -rf conftest*
11097   ol_cv_pthread_lib_lpthreads=no
11098 fi
11099 rm -f conftest*
11100 else
11101   cat > conftest.$ac_ext <<EOF
11102 #line 11103 "configure"
11103 #include "confdefs.h"
11104 /* pthread test headers */
11105 #include <pthread.h>
11106 #ifndef NULL
11107 #define NULL (void*)0
11108 #endif
11109
11110 static void *task(p)
11111         void *p;
11112 {
11113         return (void *) (p == NULL);
11114 }
11115
11116
11117 int main(argc, argv)
11118         int argc;
11119         char **argv;
11120 {
11121
11122         /* pthread test function */
11123         pthread_t t;
11124         int status;
11125         int detach = 1;
11126
11127 #ifdef HAVE_PTHREADS_FINAL
11128         /* Final pthreads */
11129         pthread_attr_t attr;
11130
11131         status = pthread_attr_init(&attr);
11132         if( status ) return status;
11133
11134 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11135         if( !detach ) {
11136 #if defined( PTHREAD_CREATE_JOINABLE )
11137                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11138 #else
11139                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11140 #endif
11141
11142 #ifdef PTHREAD_CREATE_DETACHED
11143         } else {
11144                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11145 #endif
11146         }
11147         if( status ) return status;
11148 #endif
11149
11150         status = pthread_create( &t, &attr, task, NULL );
11151         if( status ) return status;
11152
11153 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11154         if( detach ) {
11155                 /* give thread a chance to complete */
11156                 /* it should remain joinable and hence detachable */
11157                 sleep( 1 );
11158
11159                 status = pthread_detach( t );
11160                 if( status ) return status;
11161         }
11162 #endif
11163
11164 #else
11165         /* Draft 4 pthreads */
11166         status = pthread_create( &t, pthread_attr_default, task, NULL );
11167         if( status ) return status;
11168
11169         if( detach ) {
11170                 /* give thread a chance to complete */
11171                 /* it should remain joinable and hence detachable */
11172                 sleep( 1 );
11173
11174                 status = pthread_detach( &t );
11175                 if( status ) return status;
11176         }
11177 #endif
11178
11179 #ifdef HAVE_LINUX_THREADS
11180         pthread_kill_other_threads_np();
11181 #endif
11182
11183         return 0;
11184
11185 }
11186
11187 EOF
11188 if { (eval echo configure:11189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11189 then
11190   ol_cv_pthread_lib_lpthreads=yes
11191 else
11192   echo "configure: failed program was:" >&5
11193   cat conftest.$ac_ext >&5
11194   rm -fr conftest*
11195   ol_cv_pthread_lib_lpthreads=no
11196 fi
11197 rm -fr conftest*
11198 fi
11199
11200
11201                 # restore the LIBS
11202                 LIBS="$ol_LIBS"
11203         
11204 fi
11205
11206 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11207
11208         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11209                 ol_link_pthreads="-lpthreads"
11210                 ol_link_threads=posix
11211         fi
11212 fi
11213
11214
11215                 if test $ol_link_threads != no ; then
11216                         cat >> confdefs.h <<\EOF
11217 #define HAVE_PTHREADS 1
11218 EOF
11219
11220
11221                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11222
11223                                                 save_CPPFLAGS="$CPPFLAGS"
11224                         save_LIBS="$LIBS"
11225                         LIBS="$LTHREAD_LIBS $LIBS"
11226
11227                                                                                                 for ac_func in sched_yield pthread_yield
11228 do
11229 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11230 echo "configure:11231: checking for $ac_func" >&5
11231 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11232   echo $ac_n "(cached) $ac_c" 1>&6
11233 else
11234   cat > conftest.$ac_ext <<EOF
11235 #line 11236 "configure"
11236 #include "confdefs.h"
11237 /* System header to define __stub macros and hopefully few prototypes,
11238     which can conflict with char $ac_func(); below.  */
11239 #include <assert.h>
11240 /* Override any gcc2 internal prototype to avoid an error.  */
11241 /* We use char because int might match the return type of a gcc2
11242     builtin and then its argument prototype would still apply.  */
11243 char $ac_func();
11244 char (*f)();
11245
11246 int main() {
11247
11248 /* The GNU C library defines this for functions which it implements
11249     to always fail with ENOSYS.  Some functions are actually named
11250     something starting with __ and the normal name is an alias.  */
11251 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11252 choke me
11253 #else
11254 f = $ac_func;
11255 #endif
11256
11257 ; return 0; }
11258 EOF
11259 if { (eval echo configure:11260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11260   rm -rf conftest*
11261   eval "ac_cv_func_$ac_func=yes"
11262 else
11263   echo "configure: failed program was:" >&5
11264   cat conftest.$ac_ext >&5
11265   rm -rf conftest*
11266   eval "ac_cv_func_$ac_func=no"
11267 fi
11268 rm -f conftest*
11269 fi
11270
11271 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11272   echo "$ac_t""yes" 1>&6
11273     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11274   cat >> confdefs.h <<EOF
11275 #define $ac_tr_func 1
11276 EOF
11277  
11278 else
11279   echo "$ac_t""no" 1>&6
11280 fi
11281 done
11282
11283
11284                         if test $ac_cv_func_sched_yield = no -a \
11285                                 $ac_cv_func_pthread_yield = no ; then
11286                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11287 echo "configure:11288: checking for sched_yield in -lrt" >&5
11288 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11289 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11290   echo $ac_n "(cached) $ac_c" 1>&6
11291 else
11292   ac_save_LIBS="$LIBS"
11293 LIBS="-lrt  $LIBS"
11294 cat > conftest.$ac_ext <<EOF
11295 #line 11296 "configure"
11296 #include "confdefs.h"
11297 /* Override any gcc2 internal prototype to avoid an error.  */
11298 /* We use char because int might match the return type of a gcc2
11299     builtin and then its argument prototype would still apply.  */
11300 char sched_yield();
11301
11302 int main() {
11303 sched_yield()
11304 ; return 0; }
11305 EOF
11306 if { (eval echo configure:11307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11307   rm -rf conftest*
11308   eval "ac_cv_lib_$ac_lib_var=yes"
11309 else
11310   echo "configure: failed program was:" >&5
11311   cat conftest.$ac_ext >&5
11312   rm -rf conftest*
11313   eval "ac_cv_lib_$ac_lib_var=no"
11314 fi
11315 rm -f conftest*
11316 LIBS="$ac_save_LIBS"
11317
11318 fi
11319 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11320   echo "$ac_t""yes" 1>&6
11321   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11322                                         cat >> confdefs.h <<\EOF
11323 #define HAVE_SCHED_YIELD 1
11324 EOF
11325
11326                                         ac_cv_func_sched_yield=yes
11327 else
11328   echo "$ac_t""no" 1>&6
11329 ac_cv_func_sched_yield=no
11330 fi
11331
11332                         fi
11333                         if test $ac_cv_func_sched_yield = no -a \
11334                                 $ac_cv_func_pthread_yield = no ; then
11335                                                                                                 for ac_func in thr_yield
11336 do
11337 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11338 echo "configure:11339: checking for $ac_func" >&5
11339 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11340   echo $ac_n "(cached) $ac_c" 1>&6
11341 else
11342   cat > conftest.$ac_ext <<EOF
11343 #line 11344 "configure"
11344 #include "confdefs.h"
11345 /* System header to define __stub macros and hopefully few prototypes,
11346     which can conflict with char $ac_func(); below.  */
11347 #include <assert.h>
11348 /* Override any gcc2 internal prototype to avoid an error.  */
11349 /* We use char because int might match the return type of a gcc2
11350     builtin and then its argument prototype would still apply.  */
11351 char $ac_func();
11352 char (*f)();
11353
11354 int main() {
11355
11356 /* The GNU C library defines this for functions which it implements
11357     to always fail with ENOSYS.  Some functions are actually named
11358     something starting with __ and the normal name is an alias.  */
11359 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11360 choke me
11361 #else
11362 f = $ac_func;
11363 #endif
11364
11365 ; return 0; }
11366 EOF
11367 if { (eval echo configure:11368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11368   rm -rf conftest*
11369   eval "ac_cv_func_$ac_func=yes"
11370 else
11371   echo "configure: failed program was:" >&5
11372   cat conftest.$ac_ext >&5
11373   rm -rf conftest*
11374   eval "ac_cv_func_$ac_func=no"
11375 fi
11376 rm -f conftest*
11377 fi
11378
11379 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11380   echo "$ac_t""yes" 1>&6
11381     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11382   cat >> confdefs.h <<EOF
11383 #define $ac_tr_func 1
11384 EOF
11385  
11386 else
11387   echo "$ac_t""no" 1>&6
11388 fi
11389 done
11390
11391                         fi
11392                         if test $ac_cv_func_sched_yield = no -a \
11393                                 $ac_cv_func_pthread_yield = no -a \
11394                                 "$ac_cv_func_thr_yield" = no ; then
11395                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11396                         fi
11397
11398                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11399 do
11400 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11401 echo "configure:11402: checking for $ac_func" >&5
11402 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11403   echo $ac_n "(cached) $ac_c" 1>&6
11404 else
11405   cat > conftest.$ac_ext <<EOF
11406 #line 11407 "configure"
11407 #include "confdefs.h"
11408 /* System header to define __stub macros and hopefully few prototypes,
11409     which can conflict with char $ac_func(); below.  */
11410 #include <assert.h>
11411 /* Override any gcc2 internal prototype to avoid an error.  */
11412 /* We use char because int might match the return type of a gcc2
11413     builtin and then its argument prototype would still apply.  */
11414 char $ac_func();
11415 char (*f)();
11416
11417 int main() {
11418
11419 /* The GNU C library defines this for functions which it implements
11420     to always fail with ENOSYS.  Some functions are actually named
11421     something starting with __ and the normal name is an alias.  */
11422 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11423 choke me
11424 #else
11425 f = $ac_func;
11426 #endif
11427
11428 ; return 0; }
11429 EOF
11430 if { (eval echo configure:11431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11431   rm -rf conftest*
11432   eval "ac_cv_func_$ac_func=yes"
11433 else
11434   echo "configure: failed program was:" >&5
11435   cat conftest.$ac_ext >&5
11436   rm -rf conftest*
11437   eval "ac_cv_func_$ac_func=no"
11438 fi
11439 rm -f conftest*
11440 fi
11441
11442 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11443   echo "$ac_t""yes" 1>&6
11444     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11445   cat >> confdefs.h <<EOF
11446 #define $ac_tr_func 1
11447 EOF
11448  
11449 else
11450   echo "$ac_t""no" 1>&6
11451 fi
11452 done
11453
11454
11455                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11456 echo "configure:11457: checking for pthread_detach with <pthread.h>" >&5
11457 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11458   echo $ac_n "(cached) $ac_c" 1>&6
11459 else
11460   
11461                                                                 cat > conftest.$ac_ext <<EOF
11462 #line 11463 "configure"
11463 #include "confdefs.h"
11464
11465 #include <pthread.h>
11466 #ifndef NULL
11467 #define NULL (void*)0
11468 #endif
11469
11470 int main() {
11471 pthread_detach(NULL);
11472 ; return 0; }
11473 EOF
11474 if { (eval echo configure:11475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11475   rm -rf conftest*
11476   ol_cv_func_pthread_detach=yes
11477 else
11478   echo "configure: failed program was:" >&5
11479   cat conftest.$ac_ext >&5
11480   rm -rf conftest*
11481   ol_cv_func_pthread_detach=no
11482 fi
11483 rm -f conftest*
11484                         
11485 fi
11486
11487 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11488
11489                         if test $ol_cv_func_pthread_detach = no ; then
11490                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11491                         fi
11492
11493                         cat >> confdefs.h <<\EOF
11494 #define HAVE_PTHREAD_DETACH 1
11495 EOF
11496
11497
11498                                                 for ac_func in \
11499                                 pthread_setconcurrency \
11500                                 pthread_getconcurrency \
11501                                 thr_setconcurrency \
11502                                 thr_getconcurrency \
11503                         
11504 do
11505 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11506 echo "configure:11507: checking for $ac_func" >&5
11507 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11508   echo $ac_n "(cached) $ac_c" 1>&6
11509 else
11510   cat > conftest.$ac_ext <<EOF
11511 #line 11512 "configure"
11512 #include "confdefs.h"
11513 /* System header to define __stub macros and hopefully few prototypes,
11514     which can conflict with char $ac_func(); below.  */
11515 #include <assert.h>
11516 /* Override any gcc2 internal prototype to avoid an error.  */
11517 /* We use char because int might match the return type of a gcc2
11518     builtin and then its argument prototype would still apply.  */
11519 char $ac_func();
11520 char (*f)();
11521
11522 int main() {
11523
11524 /* The GNU C library defines this for functions which it implements
11525     to always fail with ENOSYS.  Some functions are actually named
11526     something starting with __ and the normal name is an alias.  */
11527 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11528 choke me
11529 #else
11530 f = $ac_func;
11531 #endif
11532
11533 ; return 0; }
11534 EOF
11535 if { (eval echo configure:11536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11536   rm -rf conftest*
11537   eval "ac_cv_func_$ac_func=yes"
11538 else
11539   echo "configure: failed program was:" >&5
11540   cat conftest.$ac_ext >&5
11541   rm -rf conftest*
11542   eval "ac_cv_func_$ac_func=no"
11543 fi
11544 rm -f conftest*
11545 fi
11546
11547 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11548   echo "$ac_t""yes" 1>&6
11549     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11550   cat >> confdefs.h <<EOF
11551 #define $ac_tr_func 1
11552 EOF
11553  
11554 else
11555   echo "$ac_t""no" 1>&6
11556 fi
11557 done
11558
11559
11560                         
11561         for ac_func in pthread_kill_other_threads_np
11562 do
11563 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11564 echo "configure:11565: checking for $ac_func" >&5
11565 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11566   echo $ac_n "(cached) $ac_c" 1>&6
11567 else
11568   cat > conftest.$ac_ext <<EOF
11569 #line 11570 "configure"
11570 #include "confdefs.h"
11571 /* System header to define __stub macros and hopefully few prototypes,
11572     which can conflict with char $ac_func(); below.  */
11573 #include <assert.h>
11574 /* Override any gcc2 internal prototype to avoid an error.  */
11575 /* We use char because int might match the return type of a gcc2
11576     builtin and then its argument prototype would still apply.  */
11577 char $ac_func();
11578 char (*f)();
11579
11580 int main() {
11581
11582 /* The GNU C library defines this for functions which it implements
11583     to always fail with ENOSYS.  Some functions are actually named
11584     something starting with __ and the normal name is an alias.  */
11585 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11586 choke me
11587 #else
11588 f = $ac_func;
11589 #endif
11590
11591 ; return 0; }
11592 EOF
11593 if { (eval echo configure:11594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11594   rm -rf conftest*
11595   eval "ac_cv_func_$ac_func=yes"
11596 else
11597   echo "configure: failed program was:" >&5
11598   cat conftest.$ac_ext >&5
11599   rm -rf conftest*
11600   eval "ac_cv_func_$ac_func=no"
11601 fi
11602 rm -f conftest*
11603 fi
11604
11605 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11606   echo "$ac_t""yes" 1>&6
11607     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11608   cat >> confdefs.h <<EOF
11609 #define $ac_tr_func 1
11610 EOF
11611  
11612 else
11613   echo "$ac_t""no" 1>&6
11614 fi
11615 done
11616
11617         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11618 echo "configure:11619: checking for LinuxThreads implementation" >&5
11619 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11620   echo $ac_n "(cached) $ac_c" 1>&6
11621 else
11622   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11623 fi
11624
11625 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11626
11627                         
11628         
11629         
11630         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11631 echo "configure:11632: checking for LinuxThreads consistency" >&5
11632 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11633   echo $ac_n "(cached) $ac_c" 1>&6
11634 else
11635   
11636                 if test $ol_cv_header_linux_threads = yes -a \
11637                         $ol_cv_sys_linux_threads = yes; then
11638                         ol_cv_linux_threads=yes
11639                 elif test $ol_cv_header_linux_threads = no -a \
11640                         $ol_cv_sys_linux_threads = no; then
11641                         ol_cv_linux_threads=no
11642                 else
11643                         ol_cv_linux_threads=error
11644                 fi
11645         
11646 fi
11647
11648 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11649
11650
11651                         if test $ol_cv_linux_threads = error; then
11652                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11653                         fi
11654
11655                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11656 echo "configure:11657: checking if pthread_create() works" >&5
11657 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11658   echo $ac_n "(cached) $ac_c" 1>&6
11659 else
11660   
11661                         if test "$cross_compiling" = yes; then
11662                                 ol_cv_pthread_create_works=yes
11663 else
11664   cat > conftest.$ac_ext <<EOF
11665 #line 11666 "configure"
11666 #include "confdefs.h"
11667 /* pthread test headers */
11668 #include <pthread.h>
11669 #ifndef NULL
11670 #define NULL (void*)0
11671 #endif
11672
11673 static void *task(p)
11674         void *p;
11675 {
11676         return (void *) (p == NULL);
11677 }
11678
11679
11680 int main(argc, argv)
11681         int argc;
11682         char **argv;
11683 {
11684
11685         /* pthread test function */
11686         pthread_t t;
11687         int status;
11688         int detach = 1;
11689
11690 #ifdef HAVE_PTHREADS_FINAL
11691         /* Final pthreads */
11692         pthread_attr_t attr;
11693
11694         status = pthread_attr_init(&attr);
11695         if( status ) return status;
11696
11697 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11698         if( !detach ) {
11699 #if defined( PTHREAD_CREATE_JOINABLE )
11700                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11701 #else
11702                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11703 #endif
11704
11705 #ifdef PTHREAD_CREATE_DETACHED
11706         } else {
11707                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11708 #endif
11709         }
11710         if( status ) return status;
11711 #endif
11712
11713         status = pthread_create( &t, &attr, task, NULL );
11714         if( status ) return status;
11715
11716 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11717         if( detach ) {
11718                 /* give thread a chance to complete */
11719                 /* it should remain joinable and hence detachable */
11720                 sleep( 1 );
11721
11722                 status = pthread_detach( t );
11723                 if( status ) return status;
11724         }
11725 #endif
11726
11727 #else
11728         /* Draft 4 pthreads */
11729         status = pthread_create( &t, pthread_attr_default, task, NULL );
11730         if( status ) return status;
11731
11732         if( detach ) {
11733                 /* give thread a chance to complete */
11734                 /* it should remain joinable and hence detachable */
11735                 sleep( 1 );
11736
11737                 status = pthread_detach( &t );
11738                 if( status ) return status;
11739         }
11740 #endif
11741
11742 #ifdef HAVE_LINUX_THREADS
11743         pthread_kill_other_threads_np();
11744 #endif
11745
11746         return 0;
11747
11748 }
11749
11750 EOF
11751 if { (eval echo configure:11752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11752 then
11753   ol_cv_pthread_create_works=yes
11754 else
11755   echo "configure: failed program was:" >&5
11756   cat conftest.$ac_ext >&5
11757   rm -fr conftest*
11758   ol_cv_pthread_create_works=no
11759 fi
11760 rm -fr conftest*
11761 fi
11762
11763 fi
11764
11765 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11766
11767                         if test $ol_cv_pthread_create_works = no ; then
11768                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11769                         fi
11770
11771                                                 if test $ol_with_yielding_select = auto ; then
11772                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11773 echo "configure:11774: checking if select yields when using pthreads" >&5
11774 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11775   echo $ac_n "(cached) $ac_c" 1>&6
11776 else
11777   
11778                                 if test "$cross_compiling" = yes; then
11779   ol_cv_pthread_select_yields=cross
11780 else
11781   cat > conftest.$ac_ext <<EOF
11782 #line 11783 "configure"
11783 #include "confdefs.h"
11784
11785 #include <sys/types.h>
11786 #include <sys/time.h>
11787 #include <unistd.h>
11788 #include <pthread.h>
11789 #ifndef NULL
11790 #define NULL (void*) 0
11791 #endif
11792
11793 static int fildes[2];
11794
11795 static void *task(p)
11796         void *p;
11797 {
11798         int i;
11799         struct timeval tv;
11800
11801         fd_set rfds;
11802
11803         tv.tv_sec=10;
11804         tv.tv_usec=0;
11805
11806         FD_ZERO(&rfds);
11807         FD_SET(fildes[0], &rfds);
11808
11809         /* we're not interested in any fds */
11810         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11811
11812         if(i < 0) {
11813                 perror("select");
11814                 exit(10);
11815         }
11816
11817         exit(0); /* if we exit here, the select blocked the whole process */
11818 }
11819
11820 int main(argc, argv)
11821         int argc;
11822         char **argv;
11823 {
11824         pthread_t t;
11825
11826         /* create a pipe to select */
11827         if(pipe(&fildes[0])) {
11828                 perror("select");
11829                 exit(1);
11830         }
11831
11832 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11833         (void) pthread_setconcurrency(2);
11834 #else
11835 #ifdef HAVE_THR_SETCONCURRENCY
11836         /* Set Solaris LWP concurrency to 2 */
11837         thr_setconcurrency(2);
11838 #endif
11839 #endif
11840
11841 #if HAVE_PTHREADS_D4
11842         pthread_create(&t, pthread_attr_default, task, NULL);
11843 #else
11844         pthread_create(&t, NULL, task, NULL);
11845 #endif
11846
11847 #if HAVE_SCHED_YIELD
11848         sched_yield();  /* make sure task runs first */
11849 #else
11850 #ifdef HAVE_PTHREAD_YIELD
11851         pthread_yield();        /* make sure task runs first */
11852 #endif
11853 #endif
11854
11855         exit(2);
11856 }
11857 EOF
11858 if { (eval echo configure:11859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11859 then
11860   ol_cv_pthread_select_yields=no
11861 else
11862   echo "configure: failed program was:" >&5
11863   cat conftest.$ac_ext >&5
11864   rm -fr conftest*
11865   ol_cv_pthread_select_yields=yes
11866 fi
11867 rm -fr conftest*
11868 fi
11869
11870 fi
11871
11872 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11873
11874                                 if test $ol_cv_pthread_select_yields = cross ; then
11875                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11876                                 fi
11877
11878                                 if test $ol_cv_pthread_select_yields = yes ; then
11879                                         ol_with_yielding_select=yes
11880                                 fi
11881                         fi
11882
11883                                                 CPPFLAGS="$save_CPPFLAGS"
11884                         LIBS="$save_LIBS"
11885                 else
11886                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11887                 fi
11888         fi
11889
11890         if test $ol_with_threads = posix ; then
11891                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11892         fi
11893 fi
11894
11895 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11896         -o $ol_with_threads = mach ; then
11897
11898                 for ac_hdr in mach/cthreads.h
11899 do
11900 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11901 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11902 echo "configure:11903: checking for $ac_hdr" >&5
11903 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11904   echo $ac_n "(cached) $ac_c" 1>&6
11905 else
11906   cat > conftest.$ac_ext <<EOF
11907 #line 11908 "configure"
11908 #include "confdefs.h"
11909 #include <$ac_hdr>
11910 EOF
11911 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11912 { (eval echo configure:11913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11913 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11914 if test -z "$ac_err"; then
11915   rm -rf conftest*
11916   eval "ac_cv_header_$ac_safe=yes"
11917 else
11918   echo "$ac_err" >&5
11919   echo "configure: failed program was:" >&5
11920   cat conftest.$ac_ext >&5
11921   rm -rf conftest*
11922   eval "ac_cv_header_$ac_safe=no"
11923 fi
11924 rm -f conftest*
11925 fi
11926 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11927   echo "$ac_t""yes" 1>&6
11928     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11929   cat >> confdefs.h <<EOF
11930 #define $ac_tr_hdr 1
11931 EOF
11932  
11933 else
11934   echo "$ac_t""no" 1>&6
11935 fi
11936 done
11937
11938         if test $ac_cv_header_mach_cthreads_h = yes ; then
11939                 ol_with_threads=found
11940
11941                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11942 echo "configure:11943: checking for cthread_fork" >&5
11943 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11944   echo $ac_n "(cached) $ac_c" 1>&6
11945 else
11946   cat > conftest.$ac_ext <<EOF
11947 #line 11948 "configure"
11948 #include "confdefs.h"
11949 /* System header to define __stub macros and hopefully few prototypes,
11950     which can conflict with char cthread_fork(); below.  */
11951 #include <assert.h>
11952 /* Override any gcc2 internal prototype to avoid an error.  */
11953 /* We use char because int might match the return type of a gcc2
11954     builtin and then its argument prototype would still apply.  */
11955 char cthread_fork();
11956 char (*f)();
11957
11958 int main() {
11959
11960 /* The GNU C library defines this for functions which it implements
11961     to always fail with ENOSYS.  Some functions are actually named
11962     something starting with __ and the normal name is an alias.  */
11963 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11964 choke me
11965 #else
11966 f = cthread_fork;
11967 #endif
11968
11969 ; return 0; }
11970 EOF
11971 if { (eval echo configure:11972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11972   rm -rf conftest*
11973   eval "ac_cv_func_cthread_fork=yes"
11974 else
11975   echo "configure: failed program was:" >&5
11976   cat conftest.$ac_ext >&5
11977   rm -rf conftest*
11978   eval "ac_cv_func_cthread_fork=no"
11979 fi
11980 rm -f conftest*
11981 fi
11982
11983 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11984   echo "$ac_t""yes" 1>&6
11985   ol_link_threads=yes
11986 else
11987   echo "$ac_t""no" 1>&6
11988 fi
11989
11990
11991                 if test $ol_link_threads = no ; then
11992                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11993 echo "configure:11994: checking for cthread_fork with -all_load" >&5
11994 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11995   echo $ac_n "(cached) $ac_c" 1>&6
11996 else
11997   
11998                                                                 save_LIBS="$LIBS"
11999                                 LIBS="-all_load $LIBS"
12000                                 cat > conftest.$ac_ext <<EOF
12001 #line 12002 "configure"
12002 #include "confdefs.h"
12003 #include <mach/cthreads.h>
12004 int main() {
12005
12006                                         cthread_fork((void *)0, (void *)0);
12007                                         
12008 ; return 0; }
12009 EOF
12010 if { (eval echo configure:12011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12011   rm -rf conftest*
12012   ol_cv_cthread_all_load=yes
12013 else
12014   echo "configure: failed program was:" >&5
12015   cat conftest.$ac_ext >&5
12016   rm -rf conftest*
12017   ol_cv_cthread_all_load=no
12018 fi
12019 rm -f conftest*
12020                                                                 LIBS="$save_LIBS"
12021                         
12022 fi
12023
12024 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12025
12026                         if test $ol_cv_cthread_all_load = yes ; then
12027                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12028                                 ol_link_threads=mach
12029                         fi
12030                 fi
12031
12032                 if test $ol_link_threads != no ; then
12033                         : check for cthread specific functionality here
12034                         cat >> confdefs.h <<\EOF
12035 #define HAVE_MACH_CTHREADS 1
12036 EOF
12037
12038                 else
12039                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12040                 fi
12041         fi
12042
12043         if test $ol_with_threads = mach ; then
12044                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12045         fi
12046 fi
12047
12048 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12049         -o $ol_with_threads = pth ; then
12050
12051         for ac_hdr in pth.h
12052 do
12053 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12054 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12055 echo "configure:12056: checking for $ac_hdr" >&5
12056 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12057   echo $ac_n "(cached) $ac_c" 1>&6
12058 else
12059   cat > conftest.$ac_ext <<EOF
12060 #line 12061 "configure"
12061 #include "confdefs.h"
12062 #include <$ac_hdr>
12063 EOF
12064 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12065 { (eval echo configure:12066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12066 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12067 if test -z "$ac_err"; then
12068   rm -rf conftest*
12069   eval "ac_cv_header_$ac_safe=yes"
12070 else
12071   echo "$ac_err" >&5
12072   echo "configure: failed program was:" >&5
12073   cat conftest.$ac_ext >&5
12074   rm -rf conftest*
12075   eval "ac_cv_header_$ac_safe=no"
12076 fi
12077 rm -f conftest*
12078 fi
12079 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12080   echo "$ac_t""yes" 1>&6
12081     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12082   cat >> confdefs.h <<EOF
12083 #define $ac_tr_hdr 1
12084 EOF
12085  
12086 else
12087   echo "$ac_t""no" 1>&6
12088 fi
12089 done
12090
12091
12092         if test $ac_cv_header_pth_h = yes ; then
12093                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12094 echo "configure:12095: checking for pth_version in -lpth" >&5
12095 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12096 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12097   echo $ac_n "(cached) $ac_c" 1>&6
12098 else
12099   ac_save_LIBS="$LIBS"
12100 LIBS="-lpth  $LIBS"
12101 cat > conftest.$ac_ext <<EOF
12102 #line 12103 "configure"
12103 #include "confdefs.h"
12104 /* Override any gcc2 internal prototype to avoid an error.  */
12105 /* We use char because int might match the return type of a gcc2
12106     builtin and then its argument prototype would still apply.  */
12107 char pth_version();
12108
12109 int main() {
12110 pth_version()
12111 ; return 0; }
12112 EOF
12113 if { (eval echo configure:12114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12114   rm -rf conftest*
12115   eval "ac_cv_lib_$ac_lib_var=yes"
12116 else
12117   echo "configure: failed program was:" >&5
12118   cat conftest.$ac_ext >&5
12119   rm -rf conftest*
12120   eval "ac_cv_lib_$ac_lib_var=no"
12121 fi
12122 rm -f conftest*
12123 LIBS="$ac_save_LIBS"
12124
12125 fi
12126 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12127   echo "$ac_t""yes" 1>&6
12128   have_pth=yes
12129 else
12130   echo "$ac_t""no" 1>&6
12131 have_pth=no
12132 fi
12133
12134
12135                 if test $have_pth = yes ; then
12136                         cat >> confdefs.h <<\EOF
12137 #define HAVE_GNU_PTH 1
12138 EOF
12139
12140                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12141                         ol_link_threads=pth
12142
12143                         if test $ol_with_yielding_select = auto ; then
12144                                 ol_with_yielding_select=yes
12145                         fi
12146                 fi
12147         fi
12148 fi
12149
12150 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12151         -o $ol_with_threads = lwp ; then
12152
12153                 for ac_hdr in thread.h synch.h
12154 do
12155 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12156 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12157 echo "configure:12158: checking for $ac_hdr" >&5
12158 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12159   echo $ac_n "(cached) $ac_c" 1>&6
12160 else
12161   cat > conftest.$ac_ext <<EOF
12162 #line 12163 "configure"
12163 #include "confdefs.h"
12164 #include <$ac_hdr>
12165 EOF
12166 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12167 { (eval echo configure:12168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12168 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12169 if test -z "$ac_err"; then
12170   rm -rf conftest*
12171   eval "ac_cv_header_$ac_safe=yes"
12172 else
12173   echo "$ac_err" >&5
12174   echo "configure: failed program was:" >&5
12175   cat conftest.$ac_ext >&5
12176   rm -rf conftest*
12177   eval "ac_cv_header_$ac_safe=no"
12178 fi
12179 rm -f conftest*
12180 fi
12181 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12182   echo "$ac_t""yes" 1>&6
12183     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12184   cat >> confdefs.h <<EOF
12185 #define $ac_tr_hdr 1
12186 EOF
12187  
12188 else
12189   echo "$ac_t""no" 1>&6
12190 fi
12191 done
12192
12193         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12194                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12195 echo "configure:12196: checking for thr_create in -lthread" >&5
12196 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12197 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12198   echo $ac_n "(cached) $ac_c" 1>&6
12199 else
12200   ac_save_LIBS="$LIBS"
12201 LIBS="-lthread  $LIBS"
12202 cat > conftest.$ac_ext <<EOF
12203 #line 12204 "configure"
12204 #include "confdefs.h"
12205 /* Override any gcc2 internal prototype to avoid an error.  */
12206 /* We use char because int might match the return type of a gcc2
12207     builtin and then its argument prototype would still apply.  */
12208 char thr_create();
12209
12210 int main() {
12211 thr_create()
12212 ; return 0; }
12213 EOF
12214 if { (eval echo configure:12215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12215   rm -rf conftest*
12216   eval "ac_cv_lib_$ac_lib_var=yes"
12217 else
12218   echo "configure: failed program was:" >&5
12219   cat conftest.$ac_ext >&5
12220   rm -rf conftest*
12221   eval "ac_cv_lib_$ac_lib_var=no"
12222 fi
12223 rm -f conftest*
12224 LIBS="$ac_save_LIBS"
12225
12226 fi
12227 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12228   echo "$ac_t""yes" 1>&6
12229   have_thr=yes
12230 else
12231   echo "$ac_t""no" 1>&6
12232 have_thr=no
12233 fi
12234
12235
12236                 if test $have_thr = yes ; then
12237                         cat >> confdefs.h <<\EOF
12238 #define HAVE_THR 1
12239 EOF
12240
12241                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12242                         ol_link_threads=thr
12243
12244                         if test $ol_with_yielding_select = auto ; then
12245                                 ol_with_yielding_select=yes
12246                         fi
12247
12248                                                 for ac_func in \
12249                                 thr_setconcurrency \
12250                                 thr_getconcurrency \
12251                         
12252 do
12253 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12254 echo "configure:12255: checking for $ac_func" >&5
12255 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12256   echo $ac_n "(cached) $ac_c" 1>&6
12257 else
12258   cat > conftest.$ac_ext <<EOF
12259 #line 12260 "configure"
12260 #include "confdefs.h"
12261 /* System header to define __stub macros and hopefully few prototypes,
12262     which can conflict with char $ac_func(); below.  */
12263 #include <assert.h>
12264 /* Override any gcc2 internal prototype to avoid an error.  */
12265 /* We use char because int might match the return type of a gcc2
12266     builtin and then its argument prototype would still apply.  */
12267 char $ac_func();
12268 char (*f)();
12269
12270 int main() {
12271
12272 /* The GNU C library defines this for functions which it implements
12273     to always fail with ENOSYS.  Some functions are actually named
12274     something starting with __ and the normal name is an alias.  */
12275 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12276 choke me
12277 #else
12278 f = $ac_func;
12279 #endif
12280
12281 ; return 0; }
12282 EOF
12283 if { (eval echo configure:12284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12284   rm -rf conftest*
12285   eval "ac_cv_func_$ac_func=yes"
12286 else
12287   echo "configure: failed program was:" >&5
12288   cat conftest.$ac_ext >&5
12289   rm -rf conftest*
12290   eval "ac_cv_func_$ac_func=no"
12291 fi
12292 rm -f conftest*
12293 fi
12294
12295 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12296   echo "$ac_t""yes" 1>&6
12297     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12298   cat >> confdefs.h <<EOF
12299 #define $ac_tr_func 1
12300 EOF
12301  
12302 else
12303   echo "$ac_t""no" 1>&6
12304 fi
12305 done
12306
12307                 fi
12308         fi
12309
12310                 for ac_hdr in lwp/lwp.h
12311 do
12312 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12313 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12314 echo "configure:12315: checking for $ac_hdr" >&5
12315 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12316   echo $ac_n "(cached) $ac_c" 1>&6
12317 else
12318   cat > conftest.$ac_ext <<EOF
12319 #line 12320 "configure"
12320 #include "confdefs.h"
12321 #include <$ac_hdr>
12322 EOF
12323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12324 { (eval echo configure:12325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12326 if test -z "$ac_err"; then
12327   rm -rf conftest*
12328   eval "ac_cv_header_$ac_safe=yes"
12329 else
12330   echo "$ac_err" >&5
12331   echo "configure: failed program was:" >&5
12332   cat conftest.$ac_ext >&5
12333   rm -rf conftest*
12334   eval "ac_cv_header_$ac_safe=no"
12335 fi
12336 rm -f conftest*
12337 fi
12338 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12339   echo "$ac_t""yes" 1>&6
12340     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12341   cat >> confdefs.h <<EOF
12342 #define $ac_tr_hdr 1
12343 EOF
12344  
12345 else
12346   echo "$ac_t""no" 1>&6
12347 fi
12348 done
12349
12350         if test $ac_cv_header_lwp_lwp_h = yes ; then
12351                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12352 echo "configure:12353: checking for lwp_create in -llwp" >&5
12353 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12354 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12355   echo $ac_n "(cached) $ac_c" 1>&6
12356 else
12357   ac_save_LIBS="$LIBS"
12358 LIBS="-llwp  $LIBS"
12359 cat > conftest.$ac_ext <<EOF
12360 #line 12361 "configure"
12361 #include "confdefs.h"
12362 /* Override any gcc2 internal prototype to avoid an error.  */
12363 /* We use char because int might match the return type of a gcc2
12364     builtin and then its argument prototype would still apply.  */
12365 char lwp_create();
12366
12367 int main() {
12368 lwp_create()
12369 ; return 0; }
12370 EOF
12371 if { (eval echo configure:12372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12372   rm -rf conftest*
12373   eval "ac_cv_lib_$ac_lib_var=yes"
12374 else
12375   echo "configure: failed program was:" >&5
12376   cat conftest.$ac_ext >&5
12377   rm -rf conftest*
12378   eval "ac_cv_lib_$ac_lib_var=no"
12379 fi
12380 rm -f conftest*
12381 LIBS="$ac_save_LIBS"
12382
12383 fi
12384 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12385   echo "$ac_t""yes" 1>&6
12386   have_lwp=yes
12387 else
12388   echo "$ac_t""no" 1>&6
12389 have_lwp=no
12390 fi
12391
12392
12393                 if test $have_lwp = yes ; then
12394                         cat >> confdefs.h <<\EOF
12395 #define HAVE_LWP 1
12396 EOF
12397
12398                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12399                         ol_link_threads=lwp
12400
12401                         if test $ol_with_yielding_select = auto ; then
12402                                 ol_with_yielding_select=no
12403                         fi
12404                 fi
12405         fi
12406 fi
12407
12408 if test $ol_with_yielding_select = yes ; then
12409         cat >> confdefs.h <<\EOF
12410 #define HAVE_YIELDING_SELECT 1
12411 EOF
12412
12413 fi
12414
12415 if test $ol_with_threads = manual ; then
12416                 ol_link_threads=yes
12417
12418         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12419
12420         for ac_hdr in pthread.h sched.h
12421 do
12422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12424 echo "configure:12425: checking for $ac_hdr" >&5
12425 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12426   echo $ac_n "(cached) $ac_c" 1>&6
12427 else
12428   cat > conftest.$ac_ext <<EOF
12429 #line 12430 "configure"
12430 #include "confdefs.h"
12431 #include <$ac_hdr>
12432 EOF
12433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12434 { (eval echo configure:12435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12436 if test -z "$ac_err"; then
12437   rm -rf conftest*
12438   eval "ac_cv_header_$ac_safe=yes"
12439 else
12440   echo "$ac_err" >&5
12441   echo "configure: failed program was:" >&5
12442   cat conftest.$ac_ext >&5
12443   rm -rf conftest*
12444   eval "ac_cv_header_$ac_safe=no"
12445 fi
12446 rm -f conftest*
12447 fi
12448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12449   echo "$ac_t""yes" 1>&6
12450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12451   cat >> confdefs.h <<EOF
12452 #define $ac_tr_hdr 1
12453 EOF
12454  
12455 else
12456   echo "$ac_t""no" 1>&6
12457 fi
12458 done
12459
12460         for ac_func in sched_yield pthread_yield
12461 do
12462 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12463 echo "configure:12464: checking for $ac_func" >&5
12464 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12465   echo $ac_n "(cached) $ac_c" 1>&6
12466 else
12467   cat > conftest.$ac_ext <<EOF
12468 #line 12469 "configure"
12469 #include "confdefs.h"
12470 /* System header to define __stub macros and hopefully few prototypes,
12471     which can conflict with char $ac_func(); below.  */
12472 #include <assert.h>
12473 /* Override any gcc2 internal prototype to avoid an error.  */
12474 /* We use char because int might match the return type of a gcc2
12475     builtin and then its argument prototype would still apply.  */
12476 char $ac_func();
12477 char (*f)();
12478
12479 int main() {
12480
12481 /* The GNU C library defines this for functions which it implements
12482     to always fail with ENOSYS.  Some functions are actually named
12483     something starting with __ and the normal name is an alias.  */
12484 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12485 choke me
12486 #else
12487 f = $ac_func;
12488 #endif
12489
12490 ; return 0; }
12491 EOF
12492 if { (eval echo configure:12493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12493   rm -rf conftest*
12494   eval "ac_cv_func_$ac_func=yes"
12495 else
12496   echo "configure: failed program was:" >&5
12497   cat conftest.$ac_ext >&5
12498   rm -rf conftest*
12499   eval "ac_cv_func_$ac_func=no"
12500 fi
12501 rm -f conftest*
12502 fi
12503
12504 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12505   echo "$ac_t""yes" 1>&6
12506     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12507   cat >> confdefs.h <<EOF
12508 #define $ac_tr_func 1
12509 EOF
12510  
12511 else
12512   echo "$ac_t""no" 1>&6
12513 fi
12514 done
12515
12516         
12517         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12518 echo "configure:12519: checking for LinuxThreads pthread.h" >&5
12519 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12520   echo $ac_n "(cached) $ac_c" 1>&6
12521 else
12522   cat > conftest.$ac_ext <<EOF
12523 #line 12524 "configure"
12524 #include "confdefs.h"
12525 #include <pthread.h>
12526 EOF
12527 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12528   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12529   rm -rf conftest*
12530   ol_cv_header_linux_threads=yes
12531 else
12532   rm -rf conftest*
12533   ol_cv_header_linux_threads=no
12534 fi
12535 rm -f conftest*
12536
12537                 
12538 fi
12539
12540 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12541         if test $ol_cv_header_linux_threads = yes; then
12542                 cat >> confdefs.h <<\EOF
12543 #define HAVE_LINUX_THREADS 1
12544 EOF
12545
12546         fi
12547
12548
12549         for ac_hdr in mach/cthreads.h
12550 do
12551 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12552 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12553 echo "configure:12554: checking for $ac_hdr" >&5
12554 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12555   echo $ac_n "(cached) $ac_c" 1>&6
12556 else
12557   cat > conftest.$ac_ext <<EOF
12558 #line 12559 "configure"
12559 #include "confdefs.h"
12560 #include <$ac_hdr>
12561 EOF
12562 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12563 { (eval echo configure:12564: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12564 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12565 if test -z "$ac_err"; then
12566   rm -rf conftest*
12567   eval "ac_cv_header_$ac_safe=yes"
12568 else
12569   echo "$ac_err" >&5
12570   echo "configure: failed program was:" >&5
12571   cat conftest.$ac_ext >&5
12572   rm -rf conftest*
12573   eval "ac_cv_header_$ac_safe=no"
12574 fi
12575 rm -f conftest*
12576 fi
12577 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12578   echo "$ac_t""yes" 1>&6
12579     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12580   cat >> confdefs.h <<EOF
12581 #define $ac_tr_hdr 1
12582 EOF
12583  
12584 else
12585   echo "$ac_t""no" 1>&6
12586 fi
12587 done
12588
12589         for ac_hdr in lwp/lwp.h
12590 do
12591 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12592 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12593 echo "configure:12594: checking for $ac_hdr" >&5
12594 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12595   echo $ac_n "(cached) $ac_c" 1>&6
12596 else
12597   cat > conftest.$ac_ext <<EOF
12598 #line 12599 "configure"
12599 #include "confdefs.h"
12600 #include <$ac_hdr>
12601 EOF
12602 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12603 { (eval echo configure:12604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12604 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12605 if test -z "$ac_err"; then
12606   rm -rf conftest*
12607   eval "ac_cv_header_$ac_safe=yes"
12608 else
12609   echo "$ac_err" >&5
12610   echo "configure: failed program was:" >&5
12611   cat conftest.$ac_ext >&5
12612   rm -rf conftest*
12613   eval "ac_cv_header_$ac_safe=no"
12614 fi
12615 rm -f conftest*
12616 fi
12617 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12618   echo "$ac_t""yes" 1>&6
12619     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12620   cat >> confdefs.h <<EOF
12621 #define $ac_tr_hdr 1
12622 EOF
12623  
12624 else
12625   echo "$ac_t""no" 1>&6
12626 fi
12627 done
12628
12629         for ac_hdr in thread.h synch.h
12630 do
12631 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12632 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12633 echo "configure:12634: checking for $ac_hdr" >&5
12634 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12635   echo $ac_n "(cached) $ac_c" 1>&6
12636 else
12637   cat > conftest.$ac_ext <<EOF
12638 #line 12639 "configure"
12639 #include "confdefs.h"
12640 #include <$ac_hdr>
12641 EOF
12642 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12643 { (eval echo configure:12644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12644 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12645 if test -z "$ac_err"; then
12646   rm -rf conftest*
12647   eval "ac_cv_header_$ac_safe=yes"
12648 else
12649   echo "$ac_err" >&5
12650   echo "configure: failed program was:" >&5
12651   cat conftest.$ac_ext >&5
12652   rm -rf conftest*
12653   eval "ac_cv_header_$ac_safe=no"
12654 fi
12655 rm -f conftest*
12656 fi
12657 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12658   echo "$ac_t""yes" 1>&6
12659     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12660   cat >> confdefs.h <<EOF
12661 #define $ac_tr_hdr 1
12662 EOF
12663  
12664 else
12665   echo "$ac_t""no" 1>&6
12666 fi
12667 done
12668
12669 fi
12670
12671 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12672                         cat >> confdefs.h <<\EOF
12673 #define REENTRANT 1
12674 EOF
12675
12676         cat >> confdefs.h <<\EOF
12677 #define _REENTRANT 1
12678 EOF
12679
12680         cat >> confdefs.h <<\EOF
12681 #define THREAD_SAFE 1
12682 EOF
12683
12684         cat >> confdefs.h <<\EOF
12685 #define _THREAD_SAFE 1
12686 EOF
12687
12688         cat >> confdefs.h <<\EOF
12689 #define THREADSAFE 1
12690 EOF
12691
12692         cat >> confdefs.h <<\EOF
12693 #define _THREADSAFE 1
12694 EOF
12695
12696         cat >> confdefs.h <<\EOF
12697 #define _SGI_MP_SOURCE 1
12698 EOF
12699
12700
12701                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12702 echo "configure:12703: checking for thread specific errno" >&5
12703 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12704   echo $ac_n "(cached) $ac_c" 1>&6
12705 else
12706   
12707                 cat > conftest.$ac_ext <<EOF
12708 #line 12709 "configure"
12709 #include "confdefs.h"
12710 #include <errno.h>
12711 int main() {
12712 errno = 0;
12713 ; return 0; }
12714 EOF
12715 if { (eval echo configure:12716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12716   rm -rf conftest*
12717   ol_cv_errno_thread_specific=yes
12718 else
12719   echo "configure: failed program was:" >&5
12720   cat conftest.$ac_ext >&5
12721   rm -rf conftest*
12722   ol_cv_errno_thread_specific=no
12723 fi
12724 rm -f conftest*
12725         
12726 fi
12727
12728 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12729
12730                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12731 echo "configure:12732: checking for thread specific h_errno" >&5
12732 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12733   echo $ac_n "(cached) $ac_c" 1>&6
12734 else
12735   
12736                 cat > conftest.$ac_ext <<EOF
12737 #line 12738 "configure"
12738 #include "confdefs.h"
12739 #include <netdb.h>
12740 int main() {
12741 h_errno = 0;
12742 ; return 0; }
12743 EOF
12744 if { (eval echo configure:12745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12745   rm -rf conftest*
12746   ol_cv_h_errno_thread_specific=yes
12747 else
12748   echo "configure: failed program was:" >&5
12749   cat conftest.$ac_ext >&5
12750   rm -rf conftest*
12751   ol_cv_h_errno_thread_specific=no
12752 fi
12753 rm -f conftest*
12754         
12755 fi
12756
12757 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12758
12759         if test $ol_cv_errno_thread_specific != yes \
12760                 -o $ol_cv_h_errno_thread_specific != yes ; then
12761                 LIBS="$LTHREAD_LIBS $LIBS"
12762                 LTHREAD_LIBS=""
12763         fi
12764
12765 fi  
12766
12767 if test $ol_link_threads = no ; then
12768         if test $ol_with_threads = yes ; then
12769                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12770         fi
12771
12772         if test $ol_with_threads = auto ; then
12773                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12774                 ol_with_threads=no
12775         fi
12776
12777         cat >> confdefs.h <<\EOF
12778 #define NO_THREADS 1
12779 EOF
12780
12781         LTHREAD_LIBS=""
12782 fi
12783
12784 if test $ol_link_threads != no ; then
12785         cat >> confdefs.h <<\EOF
12786 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12787 EOF
12788
12789 fi
12790
12791 ol_link_ldbm=no 
12792
12793 if test $ol_with_ldbm_api = auto \
12794         -o $ol_with_ldbm_api = berkeley \
12795         -o $ol_with_ldbm_api = bcompat ; then
12796
12797         if test $ol_with_ldbm_api = bcompat; then \
12798                 ol_cv_berkeley_db=no
12799 for ac_hdr in db_185.h db.h
12800 do
12801 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12802 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12803 echo "configure:12804: checking for $ac_hdr" >&5
12804 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12805   echo $ac_n "(cached) $ac_c" 1>&6
12806 else
12807   cat > conftest.$ac_ext <<EOF
12808 #line 12809 "configure"
12809 #include "confdefs.h"
12810 #include <$ac_hdr>
12811 EOF
12812 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12813 { (eval echo configure:12814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12814 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12815 if test -z "$ac_err"; then
12816   rm -rf conftest*
12817   eval "ac_cv_header_$ac_safe=yes"
12818 else
12819   echo "$ac_err" >&5
12820   echo "configure: failed program was:" >&5
12821   cat conftest.$ac_ext >&5
12822   rm -rf conftest*
12823   eval "ac_cv_header_$ac_safe=no"
12824 fi
12825 rm -f conftest*
12826 fi
12827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12828   echo "$ac_t""yes" 1>&6
12829     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12830   cat >> confdefs.h <<EOF
12831 #define $ac_tr_hdr 1
12832 EOF
12833  
12834 else
12835   echo "$ac_t""no" 1>&6
12836 fi
12837 done
12838
12839 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12840         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12841 echo "configure:12842: checking if Berkeley DB header compatibility" >&5
12842 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12843   echo $ac_n "(cached) $ac_c" 1>&6
12844 else
12845   
12846                 cat > conftest.$ac_ext <<EOF
12847 #line 12848 "configure"
12848 #include "confdefs.h"
12849
12850 #if HAVE_DB_185_H
12851 #       include <db_185.h>
12852 #else
12853 #       include <db.h>
12854 #endif
12855
12856  /* this check could be improved */
12857 #ifndef DB_VERSION_MAJOR
12858 #       define DB_VERSION_MAJOR 1
12859 #endif
12860
12861 #if DB_VERSION_MAJOR == 1 
12862         __db_version_1
12863 #endif
12864
12865 EOF
12866 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12867   egrep "__db_version_1" >/dev/null 2>&1; then
12868   rm -rf conftest*
12869   ol_cv_header_db1=yes
12870 else
12871   rm -rf conftest*
12872   ol_cv_header_db1=no
12873 fi
12874 rm -f conftest*
12875
12876 fi
12877
12878 echo "$ac_t""$ol_cv_header_db1" 1>&6
12879
12880         if test $ol_cv_header_db1 = yes ; then
12881                 ol_cv_lib_db=no
12882 if test $ol_cv_lib_db = no ; then
12883         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12884 echo "configure:12885: checking for Berkeley DB link (default)" >&5
12885 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12886   echo $ac_n "(cached) $ac_c" 1>&6
12887 else
12888   
12889         ol_DB_LIB=
12890         ol_LIBS=$LIBS
12891         LIBS="$ol_DB_LIB $LIBS"
12892
12893         cat > conftest.$ac_ext <<EOF
12894 #line 12895 "configure"
12895 #include "confdefs.h"
12896
12897 #ifdef HAVE_DB_185_H
12898 # include <db_185.h>
12899 #else
12900 # include <db.h>
12901 #endif
12902
12903 #ifndef DB_VERSION_MAJOR
12904 # define DB_VERSION_MAJOR 1
12905 #endif
12906
12907 #ifndef NULL
12908 #define NULL ((void*)0)
12909 #endif
12910
12911 int main() {
12912
12913 #if DB_VERSION_MAJOR > 1
12914         {
12915                 char *version;
12916                 int major, minor, patch;
12917
12918                 version = db_version( &major, &minor, &patch );
12919
12920                 if( major != DB_VERSION_MAJOR ||
12921                         minor < DB_VERSION_MINOR )
12922                 {
12923                         printf("Berkeley DB version mismatch\n"
12924                                 "\texpected: %s\n\tgot: %s\n",
12925                                 DB_VERSION_STRING, version);
12926                         return 1;
12927                 }
12928         }
12929 #endif
12930
12931 #if DB_VERSION_MAJOR > 2
12932         db_env_create( NULL, 0 );
12933 #elif DB_VERSION_MAJOR > 1
12934         db_appexit( NULL );
12935 #else
12936         (void) dbopen( NULL, 0, 0, 0, NULL);
12937 #endif
12938
12939 ; return 0; }
12940 EOF
12941 if { (eval echo configure:12942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12942   rm -rf conftest*
12943   ol_cv_db_none=yes
12944 else
12945   echo "configure: failed program was:" >&5
12946   cat conftest.$ac_ext >&5
12947   rm -rf conftest*
12948   ol_cv_db_none=no
12949 fi
12950 rm -f conftest*
12951
12952         LIBS="$ol_LIBS"
12953
12954 fi
12955
12956 echo "$ac_t""$ol_cv_db_none" 1>&6
12957
12958         if test $ol_cv_db_none = yes ; then
12959                 ol_cv_lib_db=yes
12960         fi
12961 fi
12962
12963 if test $ol_cv_lib_db = no ; then
12964         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12965 echo "configure:12966: checking for Berkeley DB link (-ldb)" >&5
12966 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12967   echo $ac_n "(cached) $ac_c" 1>&6
12968 else
12969   
12970         ol_DB_LIB=-ldb
12971         ol_LIBS=$LIBS
12972         LIBS="$ol_DB_LIB $LIBS"
12973
12974         cat > conftest.$ac_ext <<EOF
12975 #line 12976 "configure"
12976 #include "confdefs.h"
12977
12978 #ifdef HAVE_DB_185_H
12979 # include <db_185.h>
12980 #else
12981 # include <db.h>
12982 #endif
12983
12984 #ifndef DB_VERSION_MAJOR
12985 # define DB_VERSION_MAJOR 1
12986 #endif
12987
12988 #ifndef NULL
12989 #define NULL ((void*)0)
12990 #endif
12991
12992 int main() {
12993
12994 #if DB_VERSION_MAJOR > 1
12995         {
12996                 char *version;
12997                 int major, minor, patch;
12998
12999                 version = db_version( &major, &minor, &patch );
13000
13001                 if( major != DB_VERSION_MAJOR ||
13002                         minor < DB_VERSION_MINOR )
13003                 {
13004                         printf("Berkeley DB version mismatch\n"
13005                                 "\texpected: %s\n\tgot: %s\n",
13006                                 DB_VERSION_STRING, version);
13007                         return 1;
13008                 }
13009         }
13010 #endif
13011
13012 #if DB_VERSION_MAJOR > 2
13013         db_env_create( NULL, 0 );
13014 #elif DB_VERSION_MAJOR > 1
13015         db_appexit( NULL );
13016 #else
13017         (void) dbopen( NULL, 0, 0, 0, NULL);
13018 #endif
13019
13020 ; return 0; }
13021 EOF
13022 if { (eval echo configure:13023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13023   rm -rf conftest*
13024   ol_cv_db_db=yes
13025 else
13026   echo "configure: failed program was:" >&5
13027   cat conftest.$ac_ext >&5
13028   rm -rf conftest*
13029   ol_cv_db_db=no
13030 fi
13031 rm -f conftest*
13032
13033         LIBS="$ol_LIBS"
13034
13035 fi
13036
13037 echo "$ac_t""$ol_cv_db_db" 1>&6
13038
13039         if test $ol_cv_db_db = yes ; then
13040                 ol_cv_lib_db=-ldb
13041         fi
13042 fi
13043
13044 if test $ol_cv_lib_db = no ; then
13045         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13046 echo "configure:13047: checking for Berkeley DB link (-ldb3)" >&5
13047 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13048   echo $ac_n "(cached) $ac_c" 1>&6
13049 else
13050   
13051         ol_DB_LIB=-ldb3
13052         ol_LIBS=$LIBS
13053         LIBS="$ol_DB_LIB $LIBS"
13054
13055         cat > conftest.$ac_ext <<EOF
13056 #line 13057 "configure"
13057 #include "confdefs.h"
13058
13059 #ifdef HAVE_DB_185_H
13060 # include <db_185.h>
13061 #else
13062 # include <db.h>
13063 #endif
13064
13065 #ifndef DB_VERSION_MAJOR
13066 # define DB_VERSION_MAJOR 1
13067 #endif
13068
13069 #ifndef NULL
13070 #define NULL ((void*)0)
13071 #endif
13072
13073 int main() {
13074
13075 #if DB_VERSION_MAJOR > 1
13076         {
13077                 char *version;
13078                 int major, minor, patch;
13079
13080                 version = db_version( &major, &minor, &patch );
13081
13082                 if( major != DB_VERSION_MAJOR ||
13083                         minor < DB_VERSION_MINOR )
13084                 {
13085                         printf("Berkeley DB version mismatch\n"
13086                                 "\texpected: %s\n\tgot: %s\n",
13087                                 DB_VERSION_STRING, version);
13088                         return 1;
13089                 }
13090         }
13091 #endif
13092
13093 #if DB_VERSION_MAJOR > 2
13094         db_env_create( NULL, 0 );
13095 #elif DB_VERSION_MAJOR > 1
13096         db_appexit( NULL );
13097 #else
13098         (void) dbopen( NULL, 0, 0, 0, NULL);
13099 #endif
13100
13101 ; return 0; }
13102 EOF
13103 if { (eval echo configure:13104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13104   rm -rf conftest*
13105   ol_cv_db_db3=yes
13106 else
13107   echo "configure: failed program was:" >&5
13108   cat conftest.$ac_ext >&5
13109   rm -rf conftest*
13110   ol_cv_db_db3=no
13111 fi
13112 rm -f conftest*
13113
13114         LIBS="$ol_LIBS"
13115
13116 fi
13117
13118 echo "$ac_t""$ol_cv_db_db3" 1>&6
13119
13120         if test $ol_cv_db_db3 = yes ; then
13121                 ol_cv_lib_db=-ldb3
13122         fi
13123 fi
13124
13125 if test $ol_cv_lib_db = no ; then
13126         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13127 echo "configure:13128: checking for Berkeley DB link (-ldb2)" >&5
13128 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13129   echo $ac_n "(cached) $ac_c" 1>&6
13130 else
13131   
13132         ol_DB_LIB=-ldb2
13133         ol_LIBS=$LIBS
13134         LIBS="$ol_DB_LIB $LIBS"
13135
13136         cat > conftest.$ac_ext <<EOF
13137 #line 13138 "configure"
13138 #include "confdefs.h"
13139
13140 #ifdef HAVE_DB_185_H
13141 # include <db_185.h>
13142 #else
13143 # include <db.h>
13144 #endif
13145
13146 #ifndef DB_VERSION_MAJOR
13147 # define DB_VERSION_MAJOR 1
13148 #endif
13149
13150 #ifndef NULL
13151 #define NULL ((void*)0)
13152 #endif
13153
13154 int main() {
13155
13156 #if DB_VERSION_MAJOR > 1
13157         {
13158                 char *version;
13159                 int major, minor, patch;
13160
13161                 version = db_version( &major, &minor, &patch );
13162
13163                 if( major != DB_VERSION_MAJOR ||
13164                         minor < DB_VERSION_MINOR )
13165                 {
13166                         printf("Berkeley DB version mismatch\n"
13167                                 "\texpected: %s\n\tgot: %s\n",
13168                                 DB_VERSION_STRING, version);
13169                         return 1;
13170                 }
13171         }
13172 #endif
13173
13174 #if DB_VERSION_MAJOR > 2
13175         db_env_create( NULL, 0 );
13176 #elif DB_VERSION_MAJOR > 1
13177         db_appexit( NULL );
13178 #else
13179         (void) dbopen( NULL, 0, 0, 0, NULL);
13180 #endif
13181
13182 ; return 0; }
13183 EOF
13184 if { (eval echo configure:13185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13185   rm -rf conftest*
13186   ol_cv_db_db2=yes
13187 else
13188   echo "configure: failed program was:" >&5
13189   cat conftest.$ac_ext >&5
13190   rm -rf conftest*
13191   ol_cv_db_db2=no
13192 fi
13193 rm -f conftest*
13194
13195         LIBS="$ol_LIBS"
13196
13197 fi
13198
13199 echo "$ac_t""$ol_cv_db_db2" 1>&6
13200
13201         if test $ol_cv_db_db2 = yes ; then
13202                 ol_cv_lib_db=-ldb2
13203         fi
13204 fi
13205
13206 if test $ol_cv_lib_db = no ; then
13207         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13208 echo "configure:13209: checking for Berkeley DB link (-ldb1)" >&5
13209 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13210   echo $ac_n "(cached) $ac_c" 1>&6
13211 else
13212   
13213         ol_DB_LIB=-ldb1
13214         ol_LIBS=$LIBS
13215         LIBS="$ol_DB_LIB $LIBS"
13216
13217         cat > conftest.$ac_ext <<EOF
13218 #line 13219 "configure"
13219 #include "confdefs.h"
13220
13221 #ifdef HAVE_DB_185_H
13222 # include <db_185.h>
13223 #else
13224 # include <db.h>
13225 #endif
13226
13227 #ifndef DB_VERSION_MAJOR
13228 # define DB_VERSION_MAJOR 1
13229 #endif
13230
13231 #ifndef NULL
13232 #define NULL ((void*)0)
13233 #endif
13234
13235 int main() {
13236
13237 #if DB_VERSION_MAJOR > 1
13238         {
13239                 char *version;
13240                 int major, minor, patch;
13241
13242                 version = db_version( &major, &minor, &patch );
13243
13244                 if( major != DB_VERSION_MAJOR ||
13245                         minor < DB_VERSION_MINOR )
13246                 {
13247                         printf("Berkeley DB version mismatch\n"
13248                                 "\texpected: %s\n\tgot: %s\n",
13249                                 DB_VERSION_STRING, version);
13250                         return 1;
13251                 }
13252         }
13253 #endif
13254
13255 #if DB_VERSION_MAJOR > 2
13256         db_env_create( NULL, 0 );
13257 #elif DB_VERSION_MAJOR > 1
13258         db_appexit( NULL );
13259 #else
13260         (void) dbopen( NULL, 0, 0, 0, NULL);
13261 #endif
13262
13263 ; return 0; }
13264 EOF
13265 if { (eval echo configure:13266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13266   rm -rf conftest*
13267   ol_cv_db_db1=yes
13268 else
13269   echo "configure: failed program was:" >&5
13270   cat conftest.$ac_ext >&5
13271   rm -rf conftest*
13272   ol_cv_db_db1=no
13273 fi
13274 rm -f conftest*
13275
13276         LIBS="$ol_LIBS"
13277
13278 fi
13279
13280 echo "$ac_t""$ol_cv_db_db1" 1>&6
13281
13282         if test $ol_cv_db_db1 = yes ; then
13283                 ol_cv_lib_db=-ldb1
13284         fi
13285 fi
13286
13287
13288                 if test "$ol_cv_lib_db" != no ; then
13289                         ol_cv_berkeley_db=yes
13290                 fi
13291         fi
13292 fi
13293
13294         else
13295                 ol_cv_berkeley_db=no
13296 for ac_hdr in db.h
13297 do
13298 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13299 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13300 echo "configure:13301: checking for $ac_hdr" >&5
13301 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13302   echo $ac_n "(cached) $ac_c" 1>&6
13303 else
13304   cat > conftest.$ac_ext <<EOF
13305 #line 13306 "configure"
13306 #include "confdefs.h"
13307 #include <$ac_hdr>
13308 EOF
13309 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13310 { (eval echo configure:13311: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13311 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13312 if test -z "$ac_err"; then
13313   rm -rf conftest*
13314   eval "ac_cv_header_$ac_safe=yes"
13315 else
13316   echo "$ac_err" >&5
13317   echo "configure: failed program was:" >&5
13318   cat conftest.$ac_ext >&5
13319   rm -rf conftest*
13320   eval "ac_cv_header_$ac_safe=no"
13321 fi
13322 rm -f conftest*
13323 fi
13324 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13325   echo "$ac_t""yes" 1>&6
13326     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13327   cat >> confdefs.h <<EOF
13328 #define $ac_tr_hdr 1
13329 EOF
13330  
13331 else
13332   echo "$ac_t""no" 1>&6
13333 fi
13334 done
13335
13336 if test $ac_cv_header_db_h = yes; then
13337         ol_cv_lib_db=no
13338 if test $ol_cv_lib_db = no ; then
13339         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13340 echo "configure:13341: checking for Berkeley DB link (default)" >&5
13341 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13342   echo $ac_n "(cached) $ac_c" 1>&6
13343 else
13344   
13345         ol_DB_LIB=
13346         ol_LIBS=$LIBS
13347         LIBS="$ol_DB_LIB $LIBS"
13348
13349         cat > conftest.$ac_ext <<EOF
13350 #line 13351 "configure"
13351 #include "confdefs.h"
13352
13353 #ifdef HAVE_DB_185_H
13354 # include <db_185.h>
13355 #else
13356 # include <db.h>
13357 #endif
13358
13359 #ifndef DB_VERSION_MAJOR
13360 # define DB_VERSION_MAJOR 1
13361 #endif
13362
13363 #ifndef NULL
13364 #define NULL ((void*)0)
13365 #endif
13366
13367 int main() {
13368
13369 #if DB_VERSION_MAJOR > 1
13370         {
13371                 char *version;
13372                 int major, minor, patch;
13373
13374                 version = db_version( &major, &minor, &patch );
13375
13376                 if( major != DB_VERSION_MAJOR ||
13377                         minor < DB_VERSION_MINOR )
13378                 {
13379                         printf("Berkeley DB version mismatch\n"
13380                                 "\texpected: %s\n\tgot: %s\n",
13381                                 DB_VERSION_STRING, version);
13382                         return 1;
13383                 }
13384         }
13385 #endif
13386
13387 #if DB_VERSION_MAJOR > 2
13388         db_env_create( NULL, 0 );
13389 #elif DB_VERSION_MAJOR > 1
13390         db_appexit( NULL );
13391 #else
13392         (void) dbopen( NULL, 0, 0, 0, NULL);
13393 #endif
13394
13395 ; return 0; }
13396 EOF
13397 if { (eval echo configure:13398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13398   rm -rf conftest*
13399   ol_cv_db_none=yes
13400 else
13401   echo "configure: failed program was:" >&5
13402   cat conftest.$ac_ext >&5
13403   rm -rf conftest*
13404   ol_cv_db_none=no
13405 fi
13406 rm -f conftest*
13407
13408         LIBS="$ol_LIBS"
13409
13410 fi
13411
13412 echo "$ac_t""$ol_cv_db_none" 1>&6
13413
13414         if test $ol_cv_db_none = yes ; then
13415                 ol_cv_lib_db=yes
13416         fi
13417 fi
13418
13419 if test $ol_cv_lib_db = no ; then
13420         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13421 echo "configure:13422: checking for Berkeley DB link (-ldb)" >&5
13422 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13423   echo $ac_n "(cached) $ac_c" 1>&6
13424 else
13425   
13426         ol_DB_LIB=-ldb
13427         ol_LIBS=$LIBS
13428         LIBS="$ol_DB_LIB $LIBS"
13429
13430         cat > conftest.$ac_ext <<EOF
13431 #line 13432 "configure"
13432 #include "confdefs.h"
13433
13434 #ifdef HAVE_DB_185_H
13435 # include <db_185.h>
13436 #else
13437 # include <db.h>
13438 #endif
13439
13440 #ifndef DB_VERSION_MAJOR
13441 # define DB_VERSION_MAJOR 1
13442 #endif
13443
13444 #ifndef NULL
13445 #define NULL ((void*)0)
13446 #endif
13447
13448 int main() {
13449
13450 #if DB_VERSION_MAJOR > 1
13451         {
13452                 char *version;
13453                 int major, minor, patch;
13454
13455                 version = db_version( &major, &minor, &patch );
13456
13457                 if( major != DB_VERSION_MAJOR ||
13458                         minor < DB_VERSION_MINOR )
13459                 {
13460                         printf("Berkeley DB version mismatch\n"
13461                                 "\texpected: %s\n\tgot: %s\n",
13462                                 DB_VERSION_STRING, version);
13463                         return 1;
13464                 }
13465         }
13466 #endif
13467
13468 #if DB_VERSION_MAJOR > 2
13469         db_env_create( NULL, 0 );
13470 #elif DB_VERSION_MAJOR > 1
13471         db_appexit( NULL );
13472 #else
13473         (void) dbopen( NULL, 0, 0, 0, NULL);
13474 #endif
13475
13476 ; return 0; }
13477 EOF
13478 if { (eval echo configure:13479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13479   rm -rf conftest*
13480   ol_cv_db_db=yes
13481 else
13482   echo "configure: failed program was:" >&5
13483   cat conftest.$ac_ext >&5
13484   rm -rf conftest*
13485   ol_cv_db_db=no
13486 fi
13487 rm -f conftest*
13488
13489         LIBS="$ol_LIBS"
13490
13491 fi
13492
13493 echo "$ac_t""$ol_cv_db_db" 1>&6
13494
13495         if test $ol_cv_db_db = yes ; then
13496                 ol_cv_lib_db=-ldb
13497         fi
13498 fi
13499
13500 if test $ol_cv_lib_db = no ; then
13501         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13502 echo "configure:13503: checking for Berkeley DB link (-ldb3)" >&5
13503 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13504   echo $ac_n "(cached) $ac_c" 1>&6
13505 else
13506   
13507         ol_DB_LIB=-ldb3
13508         ol_LIBS=$LIBS
13509         LIBS="$ol_DB_LIB $LIBS"
13510
13511         cat > conftest.$ac_ext <<EOF
13512 #line 13513 "configure"
13513 #include "confdefs.h"
13514
13515 #ifdef HAVE_DB_185_H
13516 # include <db_185.h>
13517 #else
13518 # include <db.h>
13519 #endif
13520
13521 #ifndef DB_VERSION_MAJOR
13522 # define DB_VERSION_MAJOR 1
13523 #endif
13524
13525 #ifndef NULL
13526 #define NULL ((void*)0)
13527 #endif
13528
13529 int main() {
13530
13531 #if DB_VERSION_MAJOR > 1
13532         {
13533                 char *version;
13534                 int major, minor, patch;
13535
13536                 version = db_version( &major, &minor, &patch );
13537
13538                 if( major != DB_VERSION_MAJOR ||
13539                         minor < DB_VERSION_MINOR )
13540                 {
13541                         printf("Berkeley DB version mismatch\n"
13542                                 "\texpected: %s\n\tgot: %s\n",
13543                                 DB_VERSION_STRING, version);
13544                         return 1;
13545                 }
13546         }
13547 #endif
13548
13549 #if DB_VERSION_MAJOR > 2
13550         db_env_create( NULL, 0 );
13551 #elif DB_VERSION_MAJOR > 1
13552         db_appexit( NULL );
13553 #else
13554         (void) dbopen( NULL, 0, 0, 0, NULL);
13555 #endif
13556
13557 ; return 0; }
13558 EOF
13559 if { (eval echo configure:13560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13560   rm -rf conftest*
13561   ol_cv_db_db3=yes
13562 else
13563   echo "configure: failed program was:" >&5
13564   cat conftest.$ac_ext >&5
13565   rm -rf conftest*
13566   ol_cv_db_db3=no
13567 fi
13568 rm -f conftest*
13569
13570         LIBS="$ol_LIBS"
13571
13572 fi
13573
13574 echo "$ac_t""$ol_cv_db_db3" 1>&6
13575
13576         if test $ol_cv_db_db3 = yes ; then
13577                 ol_cv_lib_db=-ldb3
13578         fi
13579 fi
13580
13581 if test $ol_cv_lib_db = no ; then
13582         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13583 echo "configure:13584: checking for Berkeley DB link (-ldb2)" >&5
13584 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13585   echo $ac_n "(cached) $ac_c" 1>&6
13586 else
13587   
13588         ol_DB_LIB=-ldb2
13589         ol_LIBS=$LIBS
13590         LIBS="$ol_DB_LIB $LIBS"
13591
13592         cat > conftest.$ac_ext <<EOF
13593 #line 13594 "configure"
13594 #include "confdefs.h"
13595
13596 #ifdef HAVE_DB_185_H
13597 # include <db_185.h>
13598 #else
13599 # include <db.h>
13600 #endif
13601
13602 #ifndef DB_VERSION_MAJOR
13603 # define DB_VERSION_MAJOR 1
13604 #endif
13605
13606 #ifndef NULL
13607 #define NULL ((void*)0)
13608 #endif
13609
13610 int main() {
13611
13612 #if DB_VERSION_MAJOR > 1
13613         {
13614                 char *version;
13615                 int major, minor, patch;
13616
13617                 version = db_version( &major, &minor, &patch );
13618
13619                 if( major != DB_VERSION_MAJOR ||
13620                         minor < DB_VERSION_MINOR )
13621                 {
13622                         printf("Berkeley DB version mismatch\n"
13623                                 "\texpected: %s\n\tgot: %s\n",
13624                                 DB_VERSION_STRING, version);
13625                         return 1;
13626                 }
13627         }
13628 #endif
13629
13630 #if DB_VERSION_MAJOR > 2
13631         db_env_create( NULL, 0 );
13632 #elif DB_VERSION_MAJOR > 1
13633         db_appexit( NULL );
13634 #else
13635         (void) dbopen( NULL, 0, 0, 0, NULL);
13636 #endif
13637
13638 ; return 0; }
13639 EOF
13640 if { (eval echo configure:13641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13641   rm -rf conftest*
13642   ol_cv_db_db2=yes
13643 else
13644   echo "configure: failed program was:" >&5
13645   cat conftest.$ac_ext >&5
13646   rm -rf conftest*
13647   ol_cv_db_db2=no
13648 fi
13649 rm -f conftest*
13650
13651         LIBS="$ol_LIBS"
13652
13653 fi
13654
13655 echo "$ac_t""$ol_cv_db_db2" 1>&6
13656
13657         if test $ol_cv_db_db2 = yes ; then
13658                 ol_cv_lib_db=-ldb2
13659         fi
13660 fi
13661
13662 if test $ol_cv_lib_db = no ; then
13663         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13664 echo "configure:13665: checking for Berkeley DB link (-ldb1)" >&5
13665 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13666   echo $ac_n "(cached) $ac_c" 1>&6
13667 else
13668   
13669         ol_DB_LIB=-ldb1
13670         ol_LIBS=$LIBS
13671         LIBS="$ol_DB_LIB $LIBS"
13672
13673         cat > conftest.$ac_ext <<EOF
13674 #line 13675 "configure"
13675 #include "confdefs.h"
13676
13677 #ifdef HAVE_DB_185_H
13678 # include <db_185.h>
13679 #else
13680 # include <db.h>
13681 #endif
13682
13683 #ifndef DB_VERSION_MAJOR
13684 # define DB_VERSION_MAJOR 1
13685 #endif
13686
13687 #ifndef NULL
13688 #define NULL ((void*)0)
13689 #endif
13690
13691 int main() {
13692
13693 #if DB_VERSION_MAJOR > 1
13694         {
13695                 char *version;
13696                 int major, minor, patch;
13697
13698                 version = db_version( &major, &minor, &patch );
13699
13700                 if( major != DB_VERSION_MAJOR ||
13701                         minor < DB_VERSION_MINOR )
13702                 {
13703                         printf("Berkeley DB version mismatch\n"
13704                                 "\texpected: %s\n\tgot: %s\n",
13705                                 DB_VERSION_STRING, version);
13706                         return 1;
13707                 }
13708         }
13709 #endif
13710
13711 #if DB_VERSION_MAJOR > 2
13712         db_env_create( NULL, 0 );
13713 #elif DB_VERSION_MAJOR > 1
13714         db_appexit( NULL );
13715 #else
13716         (void) dbopen( NULL, 0, 0, 0, NULL);
13717 #endif
13718
13719 ; return 0; }
13720 EOF
13721 if { (eval echo configure:13722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13722   rm -rf conftest*
13723   ol_cv_db_db1=yes
13724 else
13725   echo "configure: failed program was:" >&5
13726   cat conftest.$ac_ext >&5
13727   rm -rf conftest*
13728   ol_cv_db_db1=no
13729 fi
13730 rm -f conftest*
13731
13732         LIBS="$ol_LIBS"
13733
13734 fi
13735
13736 echo "$ac_t""$ol_cv_db_db1" 1>&6
13737
13738         if test $ol_cv_db_db1 = yes ; then
13739                 ol_cv_lib_db=-ldb1
13740         fi
13741 fi
13742
13743
13744         if test "$ol_cv_lib_db" != no ; then
13745                 ol_cv_berkeley_db=yes
13746                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13747 echo "configure:13748: checking for Berkeley DB thread support" >&5
13748 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13749   echo $ac_n "(cached) $ac_c" 1>&6
13750 else
13751   
13752         ol_LIBS="$LIBS"
13753         if test $ol_cv_lib_db != yes ; then
13754                 LIBS="$ol_cv_lib_db"
13755         fi
13756
13757         if test "$cross_compiling" = yes; then
13758   ol_cv_berkeley_db_thread=cross
13759 else
13760   cat > conftest.$ac_ext <<EOF
13761 #line 13762 "configure"
13762 #include "confdefs.h"
13763
13764 #ifdef HAVE_DB_185_H
13765         choke me;
13766 #else
13767 #include <db.h>
13768 #endif
13769 #ifndef NULL
13770 #define NULL ((void *)0)
13771 #endif
13772 main()
13773 {
13774         int rc;
13775         u_int32_t flags = DB_CREATE |
13776 #ifdef DB_PRIVATE
13777                 DB_PRIVATE |
13778 #endif
13779                 DB_THREAD;
13780
13781 #if DB_VERSION_MAJOR > 2
13782         DB_ENV *env = NULL;
13783
13784         rc = db_env_create( &env, 0 );
13785
13786         flags |= DB_INIT_MPOOL;
13787 #ifdef DB_MPOOL_PRIVATE
13788         flags |= DB_MPOOL_PRIVATE;
13789 #endif
13790
13791         if( rc ) {
13792                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13793                 return rc;
13794         }
13795
13796 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13797         rc = env->open( env, NULL, flags, 0 );
13798 #else
13799         rc = env->open( env, NULL, NULL, flags, 0 );
13800 #endif
13801
13802         if ( rc == 0 ) {
13803                 rc = env->close( env, 0 );
13804         }
13805
13806         if( rc ) {
13807                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13808                 return rc;
13809         }
13810
13811 #else
13812         DB_ENV env;
13813         memset( &env, '\0', sizeof(env) );
13814
13815         rc = db_appinit( NULL, NULL, &env, flags );
13816
13817         if( rc == 0 ) {
13818                 db_appexit( &env );
13819         }
13820
13821         unlink("__db_mpool.share");
13822         unlink("__db_lock.share");
13823 #endif
13824
13825         return rc;
13826 }
13827 EOF
13828 if { (eval echo configure:13829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13829 then
13830   ol_cv_berkeley_db_thread=yes
13831 else
13832   echo "configure: failed program was:" >&5
13833   cat conftest.$ac_ext >&5
13834   rm -fr conftest*
13835   ol_cv_berkeley_db_thread=no
13836 fi
13837 rm -fr conftest*
13838 fi
13839
13840
13841         LIBS="$ol_LIBS"
13842
13843         if test $ol_cv_berkeley_db_thread != no ; then
13844                 cat >> confdefs.h <<\EOF
13845 #define HAVE_BERKELEY_DB_THREAD 1
13846 EOF
13847
13848         fi
13849
13850 fi
13851
13852 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13853         fi
13854 fi
13855
13856         fi
13857
13858         if test $ol_cv_berkeley_db != no ; then
13859                 cat >> confdefs.h <<\EOF
13860 #define HAVE_BERKELEY_DB 1
13861 EOF
13862
13863
13864                 ol_link_ldbm=berkeley
13865                 ol_with_ldbm_api=berkeley
13866
13867                 if test $ol_with_ldbm_type = hash ; then
13868                         cat >> confdefs.h <<\EOF
13869 #define LDBM_USE_DBHASH 1
13870 EOF
13871
13872                 else
13873                         cat >> confdefs.h <<\EOF
13874 #define LDBM_USE_DBBTREE 1
13875 EOF
13876
13877                 fi
13878
13879                                                 if test $ol_cv_lib_db != yes ; then
13880                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13881                 fi
13882         fi
13883 fi
13884
13885 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
13886         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
13887 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
13888         ol_enable_bdb=yes
13889 fi
13890
13891 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13892         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13893         ol_with_ldbm_api=none
13894 fi
13895
13896 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13897         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13898 echo "configure:13899: checking for MDBM library" >&5
13899 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13900   echo $ac_n "(cached) $ac_c" 1>&6
13901 else
13902         ol_LIBS="$LIBS"
13903         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13904 echo "configure:13905: checking for mdbm_set_chain" >&5
13905 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13906   echo $ac_n "(cached) $ac_c" 1>&6
13907 else
13908   cat > conftest.$ac_ext <<EOF
13909 #line 13910 "configure"
13910 #include "confdefs.h"
13911 /* System header to define __stub macros and hopefully few prototypes,
13912     which can conflict with char mdbm_set_chain(); below.  */
13913 #include <assert.h>
13914 /* Override any gcc2 internal prototype to avoid an error.  */
13915 /* We use char because int might match the return type of a gcc2
13916     builtin and then its argument prototype would still apply.  */
13917 char mdbm_set_chain();
13918 char (*f)();
13919
13920 int main() {
13921
13922 /* The GNU C library defines this for functions which it implements
13923     to always fail with ENOSYS.  Some functions are actually named
13924     something starting with __ and the normal name is an alias.  */
13925 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13926 choke me
13927 #else
13928 f = mdbm_set_chain;
13929 #endif
13930
13931 ; return 0; }
13932 EOF
13933 if { (eval echo configure:13934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13934   rm -rf conftest*
13935   eval "ac_cv_func_mdbm_set_chain=yes"
13936 else
13937   echo "configure: failed program was:" >&5
13938   cat conftest.$ac_ext >&5
13939   rm -rf conftest*
13940   eval "ac_cv_func_mdbm_set_chain=no"
13941 fi
13942 rm -f conftest*
13943 fi
13944
13945 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13946   echo "$ac_t""yes" 1>&6
13947   ol_cv_lib_mdbm=yes
13948 else
13949   echo "$ac_t""no" 1>&6
13950
13951                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13952 echo "configure:13953: checking for mdbm_set_chain in -lmdbm" >&5
13953 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13954 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13955   echo $ac_n "(cached) $ac_c" 1>&6
13956 else
13957   ac_save_LIBS="$LIBS"
13958 LIBS="-lmdbm  $LIBS"
13959 cat > conftest.$ac_ext <<EOF
13960 #line 13961 "configure"
13961 #include "confdefs.h"
13962 /* Override any gcc2 internal prototype to avoid an error.  */
13963 /* We use char because int might match the return type of a gcc2
13964     builtin and then its argument prototype would still apply.  */
13965 char mdbm_set_chain();
13966
13967 int main() {
13968 mdbm_set_chain()
13969 ; return 0; }
13970 EOF
13971 if { (eval echo configure:13972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13972   rm -rf conftest*
13973   eval "ac_cv_lib_$ac_lib_var=yes"
13974 else
13975   echo "configure: failed program was:" >&5
13976   cat conftest.$ac_ext >&5
13977   rm -rf conftest*
13978   eval "ac_cv_lib_$ac_lib_var=no"
13979 fi
13980 rm -f conftest*
13981 LIBS="$ac_save_LIBS"
13982
13983 fi
13984 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13985   echo "$ac_t""yes" 1>&6
13986   ol_cv_lib_mdbm=-lmdbm
13987 else
13988   echo "$ac_t""no" 1>&6
13989 ol_cv_lib_mdbm=no
13990 fi
13991
13992         
13993 fi
13994
13995         LIBS="$ol_LIBS"
13996
13997 fi
13998
13999 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14000
14001
14002  for ac_hdr in mdbm.h
14003 do
14004 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14005 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14006 echo "configure:14007: checking for $ac_hdr" >&5
14007 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14008   echo $ac_n "(cached) $ac_c" 1>&6
14009 else
14010   cat > conftest.$ac_ext <<EOF
14011 #line 14012 "configure"
14012 #include "confdefs.h"
14013 #include <$ac_hdr>
14014 EOF
14015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14016 { (eval echo configure:14017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14017 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14018 if test -z "$ac_err"; then
14019   rm -rf conftest*
14020   eval "ac_cv_header_$ac_safe=yes"
14021 else
14022   echo "$ac_err" >&5
14023   echo "configure: failed program was:" >&5
14024   cat conftest.$ac_ext >&5
14025   rm -rf conftest*
14026   eval "ac_cv_header_$ac_safe=no"
14027 fi
14028 rm -f conftest*
14029 fi
14030 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14031   echo "$ac_t""yes" 1>&6
14032     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14033   cat >> confdefs.h <<EOF
14034 #define $ac_tr_hdr 1
14035 EOF
14036  
14037 else
14038   echo "$ac_t""no" 1>&6
14039 fi
14040 done
14041
14042  echo $ac_n "checking for db""... $ac_c" 1>&6
14043 echo "configure:14044: checking for db" >&5
14044 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14045   echo $ac_n "(cached) $ac_c" 1>&6
14046 else
14047   
14048         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14049                 ol_cv_mdbm=no
14050         else
14051                 ol_cv_mdbm=yes
14052         fi
14053
14054 fi
14055
14056 echo "$ac_t""$ol_cv_mdbm" 1>&6
14057  if test $ol_cv_mdbm = yes ; then
14058         cat >> confdefs.h <<\EOF
14059 #define HAVE_MDBM 1
14060 EOF
14061
14062  fi
14063
14064
14065         if test $ol_cv_mdbm = yes ; then
14066                 ol_link_ldbm=mdbm
14067                 ol_with_ldbm_api=mdbm
14068                 if test $ol_cv_lib_mdbm != yes ; then
14069                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14070                 fi
14071         fi
14072 fi
14073
14074 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14075         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14076 echo "configure:14077: checking for GDBM library" >&5
14077 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14078   echo $ac_n "(cached) $ac_c" 1>&6
14079 else
14080         ol_LIBS="$LIBS"
14081         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14082 echo "configure:14083: checking for gdbm_open" >&5
14083 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14084   echo $ac_n "(cached) $ac_c" 1>&6
14085 else
14086   cat > conftest.$ac_ext <<EOF
14087 #line 14088 "configure"
14088 #include "confdefs.h"
14089 /* System header to define __stub macros and hopefully few prototypes,
14090     which can conflict with char gdbm_open(); below.  */
14091 #include <assert.h>
14092 /* Override any gcc2 internal prototype to avoid an error.  */
14093 /* We use char because int might match the return type of a gcc2
14094     builtin and then its argument prototype would still apply.  */
14095 char gdbm_open();
14096 char (*f)();
14097
14098 int main() {
14099
14100 /* The GNU C library defines this for functions which it implements
14101     to always fail with ENOSYS.  Some functions are actually named
14102     something starting with __ and the normal name is an alias.  */
14103 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14104 choke me
14105 #else
14106 f = gdbm_open;
14107 #endif
14108
14109 ; return 0; }
14110 EOF
14111 if { (eval echo configure:14112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14112   rm -rf conftest*
14113   eval "ac_cv_func_gdbm_open=yes"
14114 else
14115   echo "configure: failed program was:" >&5
14116   cat conftest.$ac_ext >&5
14117   rm -rf conftest*
14118   eval "ac_cv_func_gdbm_open=no"
14119 fi
14120 rm -f conftest*
14121 fi
14122
14123 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14124   echo "$ac_t""yes" 1>&6
14125   ol_cv_lib_gdbm=yes
14126 else
14127   echo "$ac_t""no" 1>&6
14128
14129                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14130 echo "configure:14131: checking for gdbm_open in -lgdbm" >&5
14131 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14132 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14133   echo $ac_n "(cached) $ac_c" 1>&6
14134 else
14135   ac_save_LIBS="$LIBS"
14136 LIBS="-lgdbm  $LIBS"
14137 cat > conftest.$ac_ext <<EOF
14138 #line 14139 "configure"
14139 #include "confdefs.h"
14140 /* Override any gcc2 internal prototype to avoid an error.  */
14141 /* We use char because int might match the return type of a gcc2
14142     builtin and then its argument prototype would still apply.  */
14143 char gdbm_open();
14144
14145 int main() {
14146 gdbm_open()
14147 ; return 0; }
14148 EOF
14149 if { (eval echo configure:14150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14150   rm -rf conftest*
14151   eval "ac_cv_lib_$ac_lib_var=yes"
14152 else
14153   echo "configure: failed program was:" >&5
14154   cat conftest.$ac_ext >&5
14155   rm -rf conftest*
14156   eval "ac_cv_lib_$ac_lib_var=no"
14157 fi
14158 rm -f conftest*
14159 LIBS="$ac_save_LIBS"
14160
14161 fi
14162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14163   echo "$ac_t""yes" 1>&6
14164   ol_cv_lib_gdbm=-lgdbm
14165 else
14166   echo "$ac_t""no" 1>&6
14167 ol_cv_lib_gdbm=no
14168 fi
14169
14170         
14171 fi
14172
14173         LIBS="$ol_LIBS"
14174
14175 fi
14176
14177 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14178
14179
14180  for ac_hdr in gdbm.h
14181 do
14182 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14183 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14184 echo "configure:14185: checking for $ac_hdr" >&5
14185 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14186   echo $ac_n "(cached) $ac_c" 1>&6
14187 else
14188   cat > conftest.$ac_ext <<EOF
14189 #line 14190 "configure"
14190 #include "confdefs.h"
14191 #include <$ac_hdr>
14192 EOF
14193 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14194 { (eval echo configure:14195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14195 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14196 if test -z "$ac_err"; then
14197   rm -rf conftest*
14198   eval "ac_cv_header_$ac_safe=yes"
14199 else
14200   echo "$ac_err" >&5
14201   echo "configure: failed program was:" >&5
14202   cat conftest.$ac_ext >&5
14203   rm -rf conftest*
14204   eval "ac_cv_header_$ac_safe=no"
14205 fi
14206 rm -f conftest*
14207 fi
14208 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14209   echo "$ac_t""yes" 1>&6
14210     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14211   cat >> confdefs.h <<EOF
14212 #define $ac_tr_hdr 1
14213 EOF
14214  
14215 else
14216   echo "$ac_t""no" 1>&6
14217 fi
14218 done
14219
14220  echo $ac_n "checking for db""... $ac_c" 1>&6
14221 echo "configure:14222: checking for db" >&5
14222 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14223   echo $ac_n "(cached) $ac_c" 1>&6
14224 else
14225   
14226         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14227                 ol_cv_gdbm=no
14228         else
14229                 ol_cv_gdbm=yes
14230         fi
14231
14232 fi
14233
14234 echo "$ac_t""$ol_cv_gdbm" 1>&6
14235  if test $ol_cv_gdbm = yes ; then
14236         cat >> confdefs.h <<\EOF
14237 #define HAVE_GDBM 1
14238 EOF
14239
14240  fi
14241
14242
14243         if test $ol_cv_gdbm = yes ; then
14244                 ol_link_ldbm=gdbm
14245                 ol_with_ldbm_api=gdbm
14246
14247                 if test $ol_cv_lib_gdbm != yes ; then
14248                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14249                 fi
14250         fi
14251 fi
14252
14253 if test $ol_with_ldbm_api = ndbm ; then
14254         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14255 echo "configure:14256: checking for NDBM library" >&5
14256 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14257   echo $ac_n "(cached) $ac_c" 1>&6
14258 else
14259         ol_LIBS="$LIBS"
14260         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14261 echo "configure:14262: checking for dbm_open" >&5
14262 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14263   echo $ac_n "(cached) $ac_c" 1>&6
14264 else
14265   cat > conftest.$ac_ext <<EOF
14266 #line 14267 "configure"
14267 #include "confdefs.h"
14268 /* System header to define __stub macros and hopefully few prototypes,
14269     which can conflict with char dbm_open(); below.  */
14270 #include <assert.h>
14271 /* Override any gcc2 internal prototype to avoid an error.  */
14272 /* We use char because int might match the return type of a gcc2
14273     builtin and then its argument prototype would still apply.  */
14274 char dbm_open();
14275 char (*f)();
14276
14277 int main() {
14278
14279 /* The GNU C library defines this for functions which it implements
14280     to always fail with ENOSYS.  Some functions are actually named
14281     something starting with __ and the normal name is an alias.  */
14282 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14283 choke me
14284 #else
14285 f = dbm_open;
14286 #endif
14287
14288 ; return 0; }
14289 EOF
14290 if { (eval echo configure:14291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14291   rm -rf conftest*
14292   eval "ac_cv_func_dbm_open=yes"
14293 else
14294   echo "configure: failed program was:" >&5
14295   cat conftest.$ac_ext >&5
14296   rm -rf conftest*
14297   eval "ac_cv_func_dbm_open=no"
14298 fi
14299 rm -f conftest*
14300 fi
14301
14302 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14303   echo "$ac_t""yes" 1>&6
14304   ol_cv_lib_ndbm=yes
14305 else
14306   echo "$ac_t""no" 1>&6
14307
14308                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14309 echo "configure:14310: checking for dbm_open in -lndbm" >&5
14310 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14311 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14312   echo $ac_n "(cached) $ac_c" 1>&6
14313 else
14314   ac_save_LIBS="$LIBS"
14315 LIBS="-lndbm  $LIBS"
14316 cat > conftest.$ac_ext <<EOF
14317 #line 14318 "configure"
14318 #include "confdefs.h"
14319 /* Override any gcc2 internal prototype to avoid an error.  */
14320 /* We use char because int might match the return type of a gcc2
14321     builtin and then its argument prototype would still apply.  */
14322 char dbm_open();
14323
14324 int main() {
14325 dbm_open()
14326 ; return 0; }
14327 EOF
14328 if { (eval echo configure:14329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14329   rm -rf conftest*
14330   eval "ac_cv_lib_$ac_lib_var=yes"
14331 else
14332   echo "configure: failed program was:" >&5
14333   cat conftest.$ac_ext >&5
14334   rm -rf conftest*
14335   eval "ac_cv_lib_$ac_lib_var=no"
14336 fi
14337 rm -f conftest*
14338 LIBS="$ac_save_LIBS"
14339
14340 fi
14341 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14342   echo "$ac_t""yes" 1>&6
14343   ol_cv_lib_ndbm=-lndbm
14344 else
14345   echo "$ac_t""no" 1>&6
14346
14347                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14348 echo "configure:14349: checking for dbm_open in -ldbm" >&5
14349 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14350 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14351   echo $ac_n "(cached) $ac_c" 1>&6
14352 else
14353   ac_save_LIBS="$LIBS"
14354 LIBS="-ldbm  $LIBS"
14355 cat > conftest.$ac_ext <<EOF
14356 #line 14357 "configure"
14357 #include "confdefs.h"
14358 /* Override any gcc2 internal prototype to avoid an error.  */
14359 /* We use char because int might match the return type of a gcc2
14360     builtin and then its argument prototype would still apply.  */
14361 char dbm_open();
14362
14363 int main() {
14364 dbm_open()
14365 ; return 0; }
14366 EOF
14367 if { (eval echo configure:14368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14368   rm -rf conftest*
14369   eval "ac_cv_lib_$ac_lib_var=yes"
14370 else
14371   echo "configure: failed program was:" >&5
14372   cat conftest.$ac_ext >&5
14373   rm -rf conftest*
14374   eval "ac_cv_lib_$ac_lib_var=no"
14375 fi
14376 rm -f conftest*
14377 LIBS="$ac_save_LIBS"
14378
14379 fi
14380 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14381   echo "$ac_t""yes" 1>&6
14382   ol_cv_lib_ndbm=-ldbm
14383 else
14384   echo "$ac_t""no" 1>&6
14385 ol_cv_lib_ndbm=no
14386 fi
14387                 
14388 fi
14389
14390         
14391 fi
14392
14393         LIBS="$ol_LIBS"
14394
14395 fi
14396
14397 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14398
14399
14400  for ac_hdr in ndbm.h
14401 do
14402 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14403 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14404 echo "configure:14405: checking for $ac_hdr" >&5
14405 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14406   echo $ac_n "(cached) $ac_c" 1>&6
14407 else
14408   cat > conftest.$ac_ext <<EOF
14409 #line 14410 "configure"
14410 #include "confdefs.h"
14411 #include <$ac_hdr>
14412 EOF
14413 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14414 { (eval echo configure:14415: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14415 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14416 if test -z "$ac_err"; then
14417   rm -rf conftest*
14418   eval "ac_cv_header_$ac_safe=yes"
14419 else
14420   echo "$ac_err" >&5
14421   echo "configure: failed program was:" >&5
14422   cat conftest.$ac_ext >&5
14423   rm -rf conftest*
14424   eval "ac_cv_header_$ac_safe=no"
14425 fi
14426 rm -f conftest*
14427 fi
14428 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14429   echo "$ac_t""yes" 1>&6
14430     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14431   cat >> confdefs.h <<EOF
14432 #define $ac_tr_hdr 1
14433 EOF
14434  
14435 else
14436   echo "$ac_t""no" 1>&6
14437 fi
14438 done
14439
14440  echo $ac_n "checking for db""... $ac_c" 1>&6
14441 echo "configure:14442: checking for db" >&5
14442 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14443   echo $ac_n "(cached) $ac_c" 1>&6
14444 else
14445   
14446         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14447                 ol_cv_ndbm=no
14448         else
14449                 ol_cv_ndbm=yes
14450         fi
14451
14452 fi
14453
14454 echo "$ac_t""$ol_cv_ndbm" 1>&6
14455  if test $ol_cv_ndbm = yes ; then
14456         cat >> confdefs.h <<\EOF
14457 #define HAVE_NDBM 1
14458 EOF
14459
14460  fi
14461
14462
14463         if test $ol_cv_ndbm = yes ; then
14464                 ol_link_ldbm=ndbm
14465                 ol_with_ldbm_api=ndbm
14466
14467                 if test $ol_cv_lib_ndbm != yes ; then
14468                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14469                 fi
14470         fi
14471 fi
14472
14473 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14474         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14475         if test $ol_enable_ldbm = yes ; then
14476                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14477         fi
14478
14479         echo "configure: warning: disabling LDBM" 1>&2
14480         ol_enable_ldbm=no
14481 fi
14482
14483 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14484         LINK_BINS_DYNAMIC="yes"
14485 else
14486         LINK_BINS_DYNAMIC="no"
14487 fi
14488
14489 if test $ol_enable_wrappers != no ; then
14490         for ac_hdr in tcpd.h
14491 do
14492 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14493 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14494 echo "configure:14495: checking for $ac_hdr" >&5
14495 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14496   echo $ac_n "(cached) $ac_c" 1>&6
14497 else
14498   cat > conftest.$ac_ext <<EOF
14499 #line 14500 "configure"
14500 #include "confdefs.h"
14501 #include <$ac_hdr>
14502 EOF
14503 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14504 { (eval echo configure:14505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14505 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14506 if test -z "$ac_err"; then
14507   rm -rf conftest*
14508   eval "ac_cv_header_$ac_safe=yes"
14509 else
14510   echo "$ac_err" >&5
14511   echo "configure: failed program was:" >&5
14512   cat conftest.$ac_ext >&5
14513   rm -rf conftest*
14514   eval "ac_cv_header_$ac_safe=no"
14515 fi
14516 rm -f conftest*
14517 fi
14518 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14519   echo "$ac_t""yes" 1>&6
14520     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14521   cat >> confdefs.h <<EOF
14522 #define $ac_tr_hdr 1
14523 EOF
14524  
14525 else
14526   echo "$ac_t""no" 1>&6
14527 fi
14528 done
14529
14530
14531         if test $ac_cv_header_tcpd_h != yes ; then
14532                 have_wrappers=no
14533         else
14534                 cat > conftest.$ac_ext <<EOF
14535 #line 14536 "configure"
14536 #include "confdefs.h"
14537
14538 int allow_severity = 0;
14539 int deny_severity  = 0;
14540                 
14541 int main() {
14542 hosts_access()
14543 ; return 0; }
14544 EOF
14545 if { (eval echo configure:14546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14546   rm -rf conftest*
14547   have_wrappers=yes
14548 else
14549   echo "configure: failed program was:" >&5
14550   cat conftest.$ac_ext >&5
14551   rm -rf conftest*
14552   have_wrappers=no
14553 fi
14554 rm -f conftest*
14555         fi
14556
14557         if test $have_wrappers = yes ; then
14558                 cat >> confdefs.h <<\EOF
14559 #define HAVE_TCPD 1
14560 EOF
14561
14562                 WRAP_LIBS="-lwrap"
14563
14564                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14565 echo "configure:14566: checking for main in -lnsl" >&5
14566 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14567 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14568   echo $ac_n "(cached) $ac_c" 1>&6
14569 else
14570   ac_save_LIBS="$LIBS"
14571 LIBS="-lnsl  $LIBS"
14572 cat > conftest.$ac_ext <<EOF
14573 #line 14574 "configure"
14574 #include "confdefs.h"
14575
14576 int main() {
14577 main()
14578 ; return 0; }
14579 EOF
14580 if { (eval echo configure:14581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14581   rm -rf conftest*
14582   eval "ac_cv_lib_$ac_lib_var=yes"
14583 else
14584   echo "configure: failed program was:" >&5
14585   cat conftest.$ac_ext >&5
14586   rm -rf conftest*
14587   eval "ac_cv_lib_$ac_lib_var=no"
14588 fi
14589 rm -f conftest*
14590 LIBS="$ac_save_LIBS"
14591
14592 fi
14593 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14594   echo "$ac_t""yes" 1>&6
14595     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14596     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14597   cat >> confdefs.h <<EOF
14598 #define $ac_tr_lib 1
14599 EOF
14600
14601   LIBS="-lnsl $LIBS"
14602
14603 else
14604   echo "$ac_t""no" 1>&6
14605 fi
14606
14607         else
14608                 echo "configure: warning: could not find -lwrap" 1>&2
14609                 if test $ol_enable_wrappers = yes ; then
14610                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14611                 fi
14612
14613                 echo "configure: warning: disabling wrappers support" 1>&2
14614                 ol_enable_wrappers=no
14615                 WRAP_LIBS=""
14616         fi
14617 fi
14618
14619 if test $ol_enable_syslog != no ; then
14620         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14621 echo "configure:14622: checking for openlog" >&5
14622 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14623   echo $ac_n "(cached) $ac_c" 1>&6
14624 else
14625   cat > conftest.$ac_ext <<EOF
14626 #line 14627 "configure"
14627 #include "confdefs.h"
14628 /* System header to define __stub macros and hopefully few prototypes,
14629     which can conflict with char openlog(); below.  */
14630 #include <assert.h>
14631 /* Override any gcc2 internal prototype to avoid an error.  */
14632 /* We use char because int might match the return type of a gcc2
14633     builtin and then its argument prototype would still apply.  */
14634 char openlog();
14635 char (*f)();
14636
14637 int main() {
14638
14639 /* The GNU C library defines this for functions which it implements
14640     to always fail with ENOSYS.  Some functions are actually named
14641     something starting with __ and the normal name is an alias.  */
14642 #if defined (__stub_openlog) || defined (__stub___openlog)
14643 choke me
14644 #else
14645 f = openlog;
14646 #endif
14647
14648 ; return 0; }
14649 EOF
14650 if { (eval echo configure:14651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14651   rm -rf conftest*
14652   eval "ac_cv_func_openlog=yes"
14653 else
14654   echo "configure: failed program was:" >&5
14655   cat conftest.$ac_ext >&5
14656   rm -rf conftest*
14657   eval "ac_cv_func_openlog=no"
14658 fi
14659 rm -f conftest*
14660 fi
14661
14662 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14663   echo "$ac_t""yes" 1>&6
14664   :
14665 else
14666   echo "$ac_t""no" 1>&6
14667 fi
14668
14669         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14670                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14671         fi
14672         ol_enable_syslog=$ac_cv_func_openlog
14673 fi
14674
14675
14676 ol_link_sql=no
14677 if test $ol_enable_sql != no ; then
14678         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14679 echo "configure:14680: checking for SQLDriverConnect in -liodbc" >&5
14680 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14681 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14682   echo $ac_n "(cached) $ac_c" 1>&6
14683 else
14684   ac_save_LIBS="$LIBS"
14685 LIBS="-liodbc  $LIBS"
14686 cat > conftest.$ac_ext <<EOF
14687 #line 14688 "configure"
14688 #include "confdefs.h"
14689 /* Override any gcc2 internal prototype to avoid an error.  */
14690 /* We use char because int might match the return type of a gcc2
14691     builtin and then its argument prototype would still apply.  */
14692 char SQLDriverConnect();
14693
14694 int main() {
14695 SQLDriverConnect()
14696 ; return 0; }
14697 EOF
14698 if { (eval echo configure:14699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14699   rm -rf conftest*
14700   eval "ac_cv_lib_$ac_lib_var=yes"
14701 else
14702   echo "configure: failed program was:" >&5
14703   cat conftest.$ac_ext >&5
14704   rm -rf conftest*
14705   eval "ac_cv_lib_$ac_lib_var=no"
14706 fi
14707 rm -f conftest*
14708 LIBS="$ac_save_LIBS"
14709
14710 fi
14711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14712   echo "$ac_t""yes" 1>&6
14713   have_iodbc=yes
14714 else
14715   echo "$ac_t""no" 1>&6
14716 have_iodbc=no
14717 fi
14718
14719         if test $have_iodbc = yes ; then
14720                 ol_link_sql="-liodbc"
14721         else
14722                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14723 echo "configure:14724: checking for SQLDriverConnect in -lodbc" >&5
14724 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14725 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14726   echo $ac_n "(cached) $ac_c" 1>&6
14727 else
14728   ac_save_LIBS="$LIBS"
14729 LIBS="-lodbc  $LIBS"
14730 cat > conftest.$ac_ext <<EOF
14731 #line 14732 "configure"
14732 #include "confdefs.h"
14733 /* Override any gcc2 internal prototype to avoid an error.  */
14734 /* We use char because int might match the return type of a gcc2
14735     builtin and then its argument prototype would still apply.  */
14736 char SQLDriverConnect();
14737
14738 int main() {
14739 SQLDriverConnect()
14740 ; return 0; }
14741 EOF
14742 if { (eval echo configure:14743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14743   rm -rf conftest*
14744   eval "ac_cv_lib_$ac_lib_var=yes"
14745 else
14746   echo "configure: failed program was:" >&5
14747   cat conftest.$ac_ext >&5
14748   rm -rf conftest*
14749   eval "ac_cv_lib_$ac_lib_var=no"
14750 fi
14751 rm -f conftest*
14752 LIBS="$ac_save_LIBS"
14753
14754 fi
14755 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14756   echo "$ac_t""yes" 1>&6
14757   have_odbc=yes
14758 else
14759   echo "$ac_t""no" 1>&6
14760 have_odbc=no
14761 fi
14762
14763                 if test $have_odbc = yes ; then
14764                         ol_link_sql="-lodbc"
14765                 fi
14766         fi
14767
14768         if test $ol_link_sql != no ; then
14769                 SLAPD_SQL_LIBS="$ol_link_sql"
14770
14771         elif test $ol_enable_sql != auto ; then
14772                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14773         fi
14774 fi
14775
14776 if test $ol_enable_tcl != no ; then
14777         for ac_hdr in tcl.h
14778 do
14779 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14780 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14781 echo "configure:14782: checking for $ac_hdr" >&5
14782 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14783   echo $ac_n "(cached) $ac_c" 1>&6
14784 else
14785   cat > conftest.$ac_ext <<EOF
14786 #line 14787 "configure"
14787 #include "confdefs.h"
14788 #include <$ac_hdr>
14789 EOF
14790 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14791 { (eval echo configure:14792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14792 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14793 if test -z "$ac_err"; then
14794   rm -rf conftest*
14795   eval "ac_cv_header_$ac_safe=yes"
14796 else
14797   echo "$ac_err" >&5
14798   echo "configure: failed program was:" >&5
14799   cat conftest.$ac_ext >&5
14800   rm -rf conftest*
14801   eval "ac_cv_header_$ac_safe=no"
14802 fi
14803 rm -f conftest*
14804 fi
14805 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14806   echo "$ac_t""yes" 1>&6
14807     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14808   cat >> confdefs.h <<EOF
14809 #define $ac_tr_hdr 1
14810 EOF
14811  
14812 else
14813   echo "$ac_t""no" 1>&6
14814 fi
14815 done
14816
14817
14818         if test $ac_cv_header_tcl_h != yes ; then
14819                 have_tcl=no
14820         else
14821                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14822                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14823 echo "configure:14824: checking for main in -l$lib" >&5
14824 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
14825 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14826   echo $ac_n "(cached) $ac_c" 1>&6
14827 else
14828   ac_save_LIBS="$LIBS"
14829 LIBS="-l$lib  $LIBS"
14830 cat > conftest.$ac_ext <<EOF
14831 #line 14832 "configure"
14832 #include "confdefs.h"
14833
14834 int main() {
14835 main()
14836 ; return 0; }
14837 EOF
14838 if { (eval echo configure:14839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14839   rm -rf conftest*
14840   eval "ac_cv_lib_$ac_lib_var=yes"
14841 else
14842   echo "configure: failed program was:" >&5
14843   cat conftest.$ac_ext >&5
14844   rm -rf conftest*
14845   eval "ac_cv_lib_$ac_lib_var=no"
14846 fi
14847 rm -f conftest*
14848 LIBS="$ac_save_LIBS"
14849
14850 fi
14851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14852   echo "$ac_t""yes" 1>&6
14853   have_tcl=yes
14854                            if test x"$ol_with_tcl_module" = "xstatic" ; then
14855                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
14856                            else
14857                                MOD_TCL_LIB="-l${lib}"
14858                            fi;break
14859 else
14860   echo "$ac_t""no" 1>&6
14861 have_tcl=no
14862 fi
14863
14864                 done
14865         fi
14866
14867         if test $have_tcl != yes ; then
14868                 echo "configure: warning: could not find -ltcl" 1>&2
14869                 if test $ol_enable_tcl = yes ; then
14870                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
14871                 fi
14872
14873                 ol_enable_tcl=no
14874         fi
14875 fi
14876
14877 ol_link_termcap=no
14878 for ac_hdr in termcap.h ncurses.h
14879 do
14880 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14881 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14882 echo "configure:14883: checking for $ac_hdr" >&5
14883 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14884   echo $ac_n "(cached) $ac_c" 1>&6
14885 else
14886   cat > conftest.$ac_ext <<EOF
14887 #line 14888 "configure"
14888 #include "confdefs.h"
14889 #include <$ac_hdr>
14890 EOF
14891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14892 { (eval echo configure:14893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14894 if test -z "$ac_err"; then
14895   rm -rf conftest*
14896   eval "ac_cv_header_$ac_safe=yes"
14897 else
14898   echo "$ac_err" >&5
14899   echo "configure: failed program was:" >&5
14900   cat conftest.$ac_ext >&5
14901   rm -rf conftest*
14902   eval "ac_cv_header_$ac_safe=no"
14903 fi
14904 rm -f conftest*
14905 fi
14906 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14907   echo "$ac_t""yes" 1>&6
14908     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14909   cat >> confdefs.h <<EOF
14910 #define $ac_tr_hdr 1
14911 EOF
14912  
14913 else
14914   echo "$ac_t""no" 1>&6
14915 fi
14916 done
14917
14918
14919 if test $ol_link_termcap = no ; then
14920         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14921 echo "configure:14922: checking for tputs in -ltermcap" >&5
14922 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14923 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14924   echo $ac_n "(cached) $ac_c" 1>&6
14925 else
14926   ac_save_LIBS="$LIBS"
14927 LIBS="-ltermcap  $LIBS"
14928 cat > conftest.$ac_ext <<EOF
14929 #line 14930 "configure"
14930 #include "confdefs.h"
14931 /* Override any gcc2 internal prototype to avoid an error.  */
14932 /* We use char because int might match the return type of a gcc2
14933     builtin and then its argument prototype would still apply.  */
14934 char tputs();
14935
14936 int main() {
14937 tputs()
14938 ; return 0; }
14939 EOF
14940 if { (eval echo configure:14941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14941   rm -rf conftest*
14942   eval "ac_cv_lib_$ac_lib_var=yes"
14943 else
14944   echo "configure: failed program was:" >&5
14945   cat conftest.$ac_ext >&5
14946   rm -rf conftest*
14947   eval "ac_cv_lib_$ac_lib_var=no"
14948 fi
14949 rm -f conftest*
14950 LIBS="$ac_save_LIBS"
14951
14952 fi
14953 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14954   echo "$ac_t""yes" 1>&6
14955   have_termcap=yes
14956 else
14957   echo "$ac_t""no" 1>&6
14958 have_termcap=no
14959 fi
14960
14961         if test $have_termcap = yes ; then
14962                 cat >> confdefs.h <<\EOF
14963 #define HAVE_TERMCAP 1
14964 EOF
14965
14966                 ol_link_termcap=yes
14967                 TERMCAP_LIBS=-ltermcap
14968         fi
14969 fi
14970
14971 if test $ol_link_termcap = no ; then
14972         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14973 echo "configure:14974: checking for initscr in -lncurses" >&5
14974 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14975 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14976   echo $ac_n "(cached) $ac_c" 1>&6
14977 else
14978   ac_save_LIBS="$LIBS"
14979 LIBS="-lncurses  $LIBS"
14980 cat > conftest.$ac_ext <<EOF
14981 #line 14982 "configure"
14982 #include "confdefs.h"
14983 /* Override any gcc2 internal prototype to avoid an error.  */
14984 /* We use char because int might match the return type of a gcc2
14985     builtin and then its argument prototype would still apply.  */
14986 char initscr();
14987
14988 int main() {
14989 initscr()
14990 ; return 0; }
14991 EOF
14992 if { (eval echo configure:14993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14993   rm -rf conftest*
14994   eval "ac_cv_lib_$ac_lib_var=yes"
14995 else
14996   echo "configure: failed program was:" >&5
14997   cat conftest.$ac_ext >&5
14998   rm -rf conftest*
14999   eval "ac_cv_lib_$ac_lib_var=no"
15000 fi
15001 rm -f conftest*
15002 LIBS="$ac_save_LIBS"
15003
15004 fi
15005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15006   echo "$ac_t""yes" 1>&6
15007   have_ncurses=yes
15008 else
15009   echo "$ac_t""no" 1>&6
15010 have_ncurses=no
15011 fi
15012
15013         if test $have_ncurses = yes ; then
15014                 cat >> confdefs.h <<\EOF
15015 #define HAVE_NCURSES 1
15016 EOF
15017
15018                 ol_link_termcap=yes
15019                 TERMCAP_LIBS=-lncurses
15020         fi
15021 fi
15022
15023 if test $ol_link_termcap = no ; then
15024         cat >> confdefs.h <<\EOF
15025 #define NO_TERMCAP 1
15026 EOF
15027
15028         TERMCAP_LIBS=
15029 fi
15030
15031 ol_link_sasl=no
15032 ol_link_spasswd=no
15033 if test $ol_with_cyrus_sasl != no ; then
15034         for ac_hdr in sasl.h
15035 do
15036 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15037 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15038 echo "configure:15039: checking for $ac_hdr" >&5
15039 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15040   echo $ac_n "(cached) $ac_c" 1>&6
15041 else
15042   cat > conftest.$ac_ext <<EOF
15043 #line 15044 "configure"
15044 #include "confdefs.h"
15045 #include <$ac_hdr>
15046 EOF
15047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15048 { (eval echo configure:15049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15049 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15050 if test -z "$ac_err"; then
15051   rm -rf conftest*
15052   eval "ac_cv_header_$ac_safe=yes"
15053 else
15054   echo "$ac_err" >&5
15055   echo "configure: failed program was:" >&5
15056   cat conftest.$ac_ext >&5
15057   rm -rf conftest*
15058   eval "ac_cv_header_$ac_safe=no"
15059 fi
15060 rm -f conftest*
15061 fi
15062 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15063   echo "$ac_t""yes" 1>&6
15064     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15065   cat >> confdefs.h <<EOF
15066 #define $ac_tr_hdr 1
15067 EOF
15068  
15069 else
15070   echo "$ac_t""no" 1>&6
15071 fi
15072 done
15073
15074
15075         if test $ac_cv_header_sasl_h = yes ; then
15076                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15077 echo "configure:15078: checking for sasl_client_init in -lsasl" >&5
15078 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15079 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15080   echo $ac_n "(cached) $ac_c" 1>&6
15081 else
15082   ac_save_LIBS="$LIBS"
15083 LIBS="-lsasl  $LIBS"
15084 cat > conftest.$ac_ext <<EOF
15085 #line 15086 "configure"
15086 #include "confdefs.h"
15087 /* Override any gcc2 internal prototype to avoid an error.  */
15088 /* We use char because int might match the return type of a gcc2
15089     builtin and then its argument prototype would still apply.  */
15090 char sasl_client_init();
15091
15092 int main() {
15093 sasl_client_init()
15094 ; return 0; }
15095 EOF
15096 if { (eval echo configure:15097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15097   rm -rf conftest*
15098   eval "ac_cv_lib_$ac_lib_var=yes"
15099 else
15100   echo "configure: failed program was:" >&5
15101   cat conftest.$ac_ext >&5
15102   rm -rf conftest*
15103   eval "ac_cv_lib_$ac_lib_var=no"
15104 fi
15105 rm -f conftest*
15106 LIBS="$ac_save_LIBS"
15107
15108 fi
15109 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15110   echo "$ac_t""yes" 1>&6
15111   have_cyrus_sasl=yes
15112 else
15113   echo "$ac_t""no" 1>&6
15114 have_cyrus_sasl=no
15115 fi
15116
15117
15118                 if test $have_cyrus_sasl != no ; then
15119                         SASL_LIBS="-lsasl"
15120                         cat >> confdefs.h <<\EOF
15121 #define HAVE_CYRUS_SASL 1
15122 EOF
15123
15124                         ol_link_sasl=yes
15125                 fi
15126         fi
15127
15128         if test $ol_link_sasl = no ; then
15129                 if test $ol_with_cyrus_sasl != auto ; then
15130                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15131                 else
15132                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15133                         echo "configure: warning: SASL authentication not supported!" 1>&2
15134                         if test $ol_link_tls = no ; then
15135                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15136                         fi
15137                 fi
15138
15139         elif test $ol_enable_spasswd != no ; then
15140                 ol_link_spasswd=yes
15141         fi
15142
15143 else
15144         echo "configure: warning: SASL authentication not supported!" 1>&2
15145         if test $ol_link_tls = no ; then
15146                 echo "configure: warning: Strong authentication not supported!" 1>&2
15147         fi
15148 fi
15149
15150 if test $cross_compiling != yes ; then
15151         dev=no
15152         if test -r /dev/urandom ; then
15153                 dev="/dev/urandom";
15154         elif test -r /idev/urandom ; then
15155                 dev="/idev/urandom";
15156         elif test -r /dev/srandom ; then
15157                 dev="/dev/srandom";
15158         elif test -r /dev/random ; then
15159                 dev="/dev/random";
15160         elif test -r /idev/random ; then
15161                 dev="/idev/random";
15162         fi
15163
15164         if test $dev != no ; then
15165                 cat >> confdefs.h <<EOF
15166 #define URANDOM_DEVICE "$dev"
15167 EOF
15168
15169         fi
15170 fi
15171
15172 ol_link_fetch=no
15173 if test $ol_with_fetch != no ; then
15174         ol_LIBS=$LIBS
15175 LIBS="-lfetch -lcom_err $LIBS"
15176 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15177 echo "configure:15178: checking fetch(3) library" >&5
15178 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15179   echo $ac_n "(cached) $ac_c" 1>&6
15180 else
15181   
15182         cat > conftest.$ac_ext <<EOF
15183 #line 15184 "configure"
15184 #include "confdefs.h"
15185
15186 #include <sys/param.h>
15187 #include <stdio.h>
15188 #include <fetch.h>
15189 int main() {
15190 struct url *u = fetchParseURL("file:///"); 
15191 ; return 0; }
15192 EOF
15193 if { (eval echo configure:15194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15194   rm -rf conftest*
15195   ol_cv_lib_fetch=yes
15196 else
15197   echo "configure: failed program was:" >&5
15198   cat conftest.$ac_ext >&5
15199   rm -rf conftest*
15200   ol_cv_lib_fetch=no
15201 fi
15202 rm -f conftest*
15203 fi
15204
15205 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15206 LIBS=$ol_LIBS
15207 if test $ol_cv_lib_fetch != no ; then
15208         ol_link_fetch="-lfetch -lcom_err"
15209         cat >> confdefs.h <<\EOF
15210 #define HAVE_FETCH 1
15211 EOF
15212
15213 fi
15214
15215
15216         if test $ol_cv_lib_fetch != no ; then
15217                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15218                 ol_link_fetch=freebsd
15219
15220         elif test $ol_with_fetch != auto ; then
15221                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15222         fi 
15223 fi
15224
15225 ol_link_readline=no
15226 if test $ol_with_readline != no ; then
15227         for ac_hdr in readline/readline.h readline/history.h
15228 do
15229 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15230 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15231 echo "configure:15232: checking for $ac_hdr" >&5
15232 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15233   echo $ac_n "(cached) $ac_c" 1>&6
15234 else
15235   cat > conftest.$ac_ext <<EOF
15236 #line 15237 "configure"
15237 #include "confdefs.h"
15238 #include <$ac_hdr>
15239 EOF
15240 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15241 { (eval echo configure:15242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15242 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15243 if test -z "$ac_err"; then
15244   rm -rf conftest*
15245   eval "ac_cv_header_$ac_safe=yes"
15246 else
15247   echo "$ac_err" >&5
15248   echo "configure: failed program was:" >&5
15249   cat conftest.$ac_ext >&5
15250   rm -rf conftest*
15251   eval "ac_cv_header_$ac_safe=no"
15252 fi
15253 rm -f conftest*
15254 fi
15255 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15256   echo "$ac_t""yes" 1>&6
15257     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15258   cat >> confdefs.h <<EOF
15259 #define $ac_tr_hdr 1
15260 EOF
15261  
15262 else
15263   echo "$ac_t""no" 1>&6
15264 fi
15265 done
15266
15267
15268         if test $ac_cv_header_readline_readline_h = yes ; then
15269                 save_LIBS="$LIBS"
15270                 LIBS="$TERMCAP_LIBS $LIBS"
15271                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15272 echo "configure:15273: checking for readline in -lreadline" >&5
15273 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15274 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15275   echo $ac_n "(cached) $ac_c" 1>&6
15276 else
15277   ac_save_LIBS="$LIBS"
15278 LIBS="-lreadline  $LIBS"
15279 cat > conftest.$ac_ext <<EOF
15280 #line 15281 "configure"
15281 #include "confdefs.h"
15282 /* Override any gcc2 internal prototype to avoid an error.  */
15283 /* We use char because int might match the return type of a gcc2
15284     builtin and then its argument prototype would still apply.  */
15285 char readline();
15286
15287 int main() {
15288 readline()
15289 ; return 0; }
15290 EOF
15291 if { (eval echo configure:15292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15292   rm -rf conftest*
15293   eval "ac_cv_lib_$ac_lib_var=yes"
15294 else
15295   echo "configure: failed program was:" >&5
15296   cat conftest.$ac_ext >&5
15297   rm -rf conftest*
15298   eval "ac_cv_lib_$ac_lib_var=no"
15299 fi
15300 rm -f conftest*
15301 LIBS="$ac_save_LIBS"
15302
15303 fi
15304 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15305   echo "$ac_t""yes" 1>&6
15306   have_readline=yes
15307 else
15308   echo "$ac_t""no" 1>&6
15309 have_readline=no
15310 fi
15311
15312                 LIBS="$save_LIBS"
15313                         
15314                 if test $have_readline = yes ; then
15315                         ol_with_readline=found
15316                         ol_link_readline=yes
15317
15318                         READLINE_LIBS="-lreadline"
15319                 fi
15320         fi
15321 fi
15322
15323 if test $ol_link_readline = yes ; then
15324         cat >> confdefs.h <<\EOF
15325 #define HAVE_READLINE 1
15326 EOF
15327
15328 fi
15329
15330
15331 if test $ol_enable_crypt != no ; then
15332         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15333 echo "configure:15334: checking for crypt" >&5
15334 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15335   echo $ac_n "(cached) $ac_c" 1>&6
15336 else
15337   cat > conftest.$ac_ext <<EOF
15338 #line 15339 "configure"
15339 #include "confdefs.h"
15340 /* System header to define __stub macros and hopefully few prototypes,
15341     which can conflict with char crypt(); below.  */
15342 #include <assert.h>
15343 /* Override any gcc2 internal prototype to avoid an error.  */
15344 /* We use char because int might match the return type of a gcc2
15345     builtin and then its argument prototype would still apply.  */
15346 char crypt();
15347 char (*f)();
15348
15349 int main() {
15350
15351 /* The GNU C library defines this for functions which it implements
15352     to always fail with ENOSYS.  Some functions are actually named
15353     something starting with __ and the normal name is an alias.  */
15354 #if defined (__stub_crypt) || defined (__stub___crypt)
15355 choke me
15356 #else
15357 f = crypt;
15358 #endif
15359
15360 ; return 0; }
15361 EOF
15362 if { (eval echo configure:15363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15363   rm -rf conftest*
15364   eval "ac_cv_func_crypt=yes"
15365 else
15366   echo "configure: failed program was:" >&5
15367   cat conftest.$ac_ext >&5
15368   rm -rf conftest*
15369   eval "ac_cv_func_crypt=no"
15370 fi
15371 rm -f conftest*
15372 fi
15373
15374 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15375   echo "$ac_t""yes" 1>&6
15376   have_crypt=yes
15377 else
15378   echo "$ac_t""no" 1>&6
15379
15380                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15381 echo "configure:15382: checking for crypt in -lcrypt" >&5
15382 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15383 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15384   echo $ac_n "(cached) $ac_c" 1>&6
15385 else
15386   ac_save_LIBS="$LIBS"
15387 LIBS="-lcrypt  $LIBS"
15388 cat > conftest.$ac_ext <<EOF
15389 #line 15390 "configure"
15390 #include "confdefs.h"
15391 /* Override any gcc2 internal prototype to avoid an error.  */
15392 /* We use char because int might match the return type of a gcc2
15393     builtin and then its argument prototype would still apply.  */
15394 char crypt();
15395
15396 int main() {
15397 crypt()
15398 ; return 0; }
15399 EOF
15400 if { (eval echo configure:15401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15401   rm -rf conftest*
15402   eval "ac_cv_lib_$ac_lib_var=yes"
15403 else
15404   echo "configure: failed program was:" >&5
15405   cat conftest.$ac_ext >&5
15406   rm -rf conftest*
15407   eval "ac_cv_lib_$ac_lib_var=no"
15408 fi
15409 rm -f conftest*
15410 LIBS="$ac_save_LIBS"
15411
15412 fi
15413 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15414   echo "$ac_t""yes" 1>&6
15415   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15416                         have_crypt=yes
15417 else
15418   echo "$ac_t""no" 1>&6
15419 have_crypt=no
15420 fi
15421
15422 fi
15423
15424
15425         if test $have_crypt = yes ; then
15426                 cat >> confdefs.h <<\EOF
15427 #define HAVE_CRYPT 1
15428 EOF
15429
15430         else
15431                 echo "configure: warning: could not find crypt" 1>&2
15432                 if test $ol_enable_crypt = yes ; then
15433                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15434                 fi
15435
15436                 echo "configure: warning: disabling crypt support" 1>&2
15437                 ol_enable_crypt=no
15438         fi
15439 fi
15440
15441 if test $ol_enable_proctitle != no ; then
15442         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15443 echo "configure:15444: checking for setproctitle" >&5
15444 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15445   echo $ac_n "(cached) $ac_c" 1>&6
15446 else
15447   cat > conftest.$ac_ext <<EOF
15448 #line 15449 "configure"
15449 #include "confdefs.h"
15450 /* System header to define __stub macros and hopefully few prototypes,
15451     which can conflict with char setproctitle(); below.  */
15452 #include <assert.h>
15453 /* Override any gcc2 internal prototype to avoid an error.  */
15454 /* We use char because int might match the return type of a gcc2
15455     builtin and then its argument prototype would still apply.  */
15456 char setproctitle();
15457 char (*f)();
15458
15459 int main() {
15460
15461 /* The GNU C library defines this for functions which it implements
15462     to always fail with ENOSYS.  Some functions are actually named
15463     something starting with __ and the normal name is an alias.  */
15464 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15465 choke me
15466 #else
15467 f = setproctitle;
15468 #endif
15469
15470 ; return 0; }
15471 EOF
15472 if { (eval echo configure:15473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15473   rm -rf conftest*
15474   eval "ac_cv_func_setproctitle=yes"
15475 else
15476   echo "configure: failed program was:" >&5
15477   cat conftest.$ac_ext >&5
15478   rm -rf conftest*
15479   eval "ac_cv_func_setproctitle=no"
15480 fi
15481 rm -f conftest*
15482 fi
15483
15484 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15485   echo "$ac_t""yes" 1>&6
15486   have_setproctitle=yes
15487 else
15488   echo "$ac_t""no" 1>&6
15489
15490                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15491 echo "configure:15492: checking for setproctitle in -lutil" >&5
15492 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15493 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15494   echo $ac_n "(cached) $ac_c" 1>&6
15495 else
15496   ac_save_LIBS="$LIBS"
15497 LIBS="-lutil  $LIBS"
15498 cat > conftest.$ac_ext <<EOF
15499 #line 15500 "configure"
15500 #include "confdefs.h"
15501 /* Override any gcc2 internal prototype to avoid an error.  */
15502 /* We use char because int might match the return type of a gcc2
15503     builtin and then its argument prototype would still apply.  */
15504 char setproctitle();
15505
15506 int main() {
15507 setproctitle()
15508 ; return 0; }
15509 EOF
15510 if { (eval echo configure:15511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15511   rm -rf conftest*
15512   eval "ac_cv_lib_$ac_lib_var=yes"
15513 else
15514   echo "configure: failed program was:" >&5
15515   cat conftest.$ac_ext >&5
15516   rm -rf conftest*
15517   eval "ac_cv_lib_$ac_lib_var=no"
15518 fi
15519 rm -f conftest*
15520 LIBS="$ac_save_LIBS"
15521
15522 fi
15523 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15524   echo "$ac_t""yes" 1>&6
15525   have_setproctitle=yes
15526                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15527 else
15528   echo "$ac_t""no" 1>&6
15529 have_setproctitle=no
15530                         LIBOBJS="$LIBOBJS setproctitle.o"
15531                         LIBSRCS="$LIBSRCS setproctitle.c"
15532 fi
15533
15534 fi
15535
15536
15537         if test $have_setproctitle = yes ; then
15538                 cat >> confdefs.h <<\EOF
15539 #define HAVE_SETPROCTITLE 1
15540 EOF
15541
15542         fi
15543 fi
15544
15545 if test $ol_enable_slp != no ; then
15546         for ac_hdr in slp.h 
15547 do
15548 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15549 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15550 echo "configure:15551: checking for $ac_hdr" >&5
15551 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15552   echo $ac_n "(cached) $ac_c" 1>&6
15553 else
15554   cat > conftest.$ac_ext <<EOF
15555 #line 15556 "configure"
15556 #include "confdefs.h"
15557 #include <$ac_hdr>
15558 EOF
15559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15560 { (eval echo configure:15561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15562 if test -z "$ac_err"; then
15563   rm -rf conftest*
15564   eval "ac_cv_header_$ac_safe=yes"
15565 else
15566   echo "$ac_err" >&5
15567   echo "configure: failed program was:" >&5
15568   cat conftest.$ac_ext >&5
15569   rm -rf conftest*
15570   eval "ac_cv_header_$ac_safe=no"
15571 fi
15572 rm -f conftest*
15573 fi
15574 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15575   echo "$ac_t""yes" 1>&6
15576     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15577   cat >> confdefs.h <<EOF
15578 #define $ac_tr_hdr 1
15579 EOF
15580  
15581 else
15582   echo "$ac_t""no" 1>&6
15583 fi
15584 done
15585
15586
15587         if test $ac_cv_header_slp_h = yes ; then
15588                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15589 echo "configure:15590: checking for SLPOpen in -lslp" >&5
15590 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15591 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15592   echo $ac_n "(cached) $ac_c" 1>&6
15593 else
15594   ac_save_LIBS="$LIBS"
15595 LIBS="-lslp  $LIBS"
15596 cat > conftest.$ac_ext <<EOF
15597 #line 15598 "configure"
15598 #include "confdefs.h"
15599 /* Override any gcc2 internal prototype to avoid an error.  */
15600 /* We use char because int might match the return type of a gcc2
15601     builtin and then its argument prototype would still apply.  */
15602 char SLPOpen();
15603
15604 int main() {
15605 SLPOpen()
15606 ; return 0; }
15607 EOF
15608 if { (eval echo configure:15609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15609   rm -rf conftest*
15610   eval "ac_cv_lib_$ac_lib_var=yes"
15611 else
15612   echo "configure: failed program was:" >&5
15613   cat conftest.$ac_ext >&5
15614   rm -rf conftest*
15615   eval "ac_cv_lib_$ac_lib_var=no"
15616 fi
15617 rm -f conftest*
15618 LIBS="$ac_save_LIBS"
15619
15620 fi
15621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15622   echo "$ac_t""yes" 1>&6
15623   have_slp=yes
15624 else
15625   echo "$ac_t""no" 1>&6
15626 have_slp=no
15627 fi
15628
15629                 if test $have_slp = yes ; then
15630                         cat >> confdefs.h <<\EOF
15631 #define HAVE_SLP 1
15632 EOF
15633
15634                         SLAPD_SLP_LIBS=-lslp
15635                 fi
15636
15637         elif test $ol_enable_slp = yes ; then
15638                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15639         fi
15640 fi
15641
15642 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15643 echo "configure:15644: checking for ANSI C header files" >&5
15644 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15645   echo $ac_n "(cached) $ac_c" 1>&6
15646 else
15647   cat > conftest.$ac_ext <<EOF
15648 #line 15649 "configure"
15649 #include "confdefs.h"
15650 #include <stdlib.h>
15651 #include <stdarg.h>
15652 #include <string.h>
15653 #include <float.h>
15654 EOF
15655 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15656 { (eval echo configure:15657: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15657 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15658 if test -z "$ac_err"; then
15659   rm -rf conftest*
15660   ac_cv_header_stdc=yes
15661 else
15662   echo "$ac_err" >&5
15663   echo "configure: failed program was:" >&5
15664   cat conftest.$ac_ext >&5
15665   rm -rf conftest*
15666   ac_cv_header_stdc=no
15667 fi
15668 rm -f conftest*
15669
15670 if test $ac_cv_header_stdc = yes; then
15671   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15672 cat > conftest.$ac_ext <<EOF
15673 #line 15674 "configure"
15674 #include "confdefs.h"
15675 #include <string.h>
15676 EOF
15677 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15678   egrep "memchr" >/dev/null 2>&1; then
15679   :
15680 else
15681   rm -rf conftest*
15682   ac_cv_header_stdc=no
15683 fi
15684 rm -f conftest*
15685
15686 fi
15687
15688 if test $ac_cv_header_stdc = yes; then
15689   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15690 cat > conftest.$ac_ext <<EOF
15691 #line 15692 "configure"
15692 #include "confdefs.h"
15693 #include <stdlib.h>
15694 EOF
15695 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15696   egrep "free" >/dev/null 2>&1; then
15697   :
15698 else
15699   rm -rf conftest*
15700   ac_cv_header_stdc=no
15701 fi
15702 rm -f conftest*
15703
15704 fi
15705
15706 if test $ac_cv_header_stdc = yes; then
15707   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15708 if test "$cross_compiling" = yes; then
15709   :
15710 else
15711   cat > conftest.$ac_ext <<EOF
15712 #line 15713 "configure"
15713 #include "confdefs.h"
15714 #include <ctype.h>
15715 #if ((' ' & 0x0FF) == 0x020)
15716 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15717 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15718 #else
15719 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15720  || ('j' <= (c) && (c) <= 'r') \
15721  || ('s' <= (c) && (c) <= 'z'))
15722 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15723 #endif
15724 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15725 int main () { int i; for (i = 0; i < 256; i++)
15726 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15727 exit (0); }
15728
15729 EOF
15730 if { (eval echo configure:15731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15731 then
15732   :
15733 else
15734   echo "configure: failed program was:" >&5
15735   cat conftest.$ac_ext >&5
15736   rm -fr conftest*
15737   ac_cv_header_stdc=no
15738 fi
15739 rm -fr conftest*
15740 fi
15741
15742 fi
15743 fi
15744
15745 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15746 if test $ac_cv_header_stdc = yes; then
15747   cat >> confdefs.h <<\EOF
15748 #define STDC_HEADERS 1
15749 EOF
15750
15751 fi
15752
15753 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15754 echo "configure:15755: checking for mode_t" >&5
15755 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15756   echo $ac_n "(cached) $ac_c" 1>&6
15757 else
15758   cat > conftest.$ac_ext <<EOF
15759 #line 15760 "configure"
15760 #include "confdefs.h"
15761 #include <sys/types.h>
15762 #if STDC_HEADERS
15763 #include <stdlib.h>
15764 #include <stddef.h>
15765 #endif
15766
15767 EOF
15768 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15769   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15770   rm -rf conftest*
15771   eval "ac_cv_type_mode_t=yes"
15772 else
15773   rm -rf conftest*
15774   eval "ac_cv_type_mode_t=no"
15775 fi
15776 rm -f conftest*
15777
15778 fi
15779 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15780   echo "$ac_t""yes" 1>&6
15781 else
15782   echo "$ac_t""no" 1>&6
15783   cat >> confdefs.h <<EOF
15784 #define mode_t int
15785 EOF
15786
15787 fi
15788
15789 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15790 echo "configure:15791: checking for off_t" >&5
15791 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15792   echo $ac_n "(cached) $ac_c" 1>&6
15793 else
15794   cat > conftest.$ac_ext <<EOF
15795 #line 15796 "configure"
15796 #include "confdefs.h"
15797 #include <sys/types.h>
15798 #if STDC_HEADERS
15799 #include <stdlib.h>
15800 #include <stddef.h>
15801 #endif
15802
15803 EOF
15804 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15805   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15806   rm -rf conftest*
15807   eval "ac_cv_type_off_t=yes"
15808 else
15809   rm -rf conftest*
15810   eval "ac_cv_type_off_t=no"
15811 fi
15812 rm -f conftest*
15813
15814 fi
15815 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15816   echo "$ac_t""yes" 1>&6
15817 else
15818   echo "$ac_t""no" 1>&6
15819   cat >> confdefs.h <<EOF
15820 #define off_t long
15821 EOF
15822
15823 fi
15824
15825 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15826 echo "configure:15827: checking for pid_t" >&5
15827 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15828   echo $ac_n "(cached) $ac_c" 1>&6
15829 else
15830   cat > conftest.$ac_ext <<EOF
15831 #line 15832 "configure"
15832 #include "confdefs.h"
15833 #include <sys/types.h>
15834 #if STDC_HEADERS
15835 #include <stdlib.h>
15836 #include <stddef.h>
15837 #endif
15838
15839 EOF
15840 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15841   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15842   rm -rf conftest*
15843   eval "ac_cv_type_pid_t=yes"
15844 else
15845   rm -rf conftest*
15846   eval "ac_cv_type_pid_t=no"
15847 fi
15848 rm -f conftest*
15849
15850 fi
15851 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15852   echo "$ac_t""yes" 1>&6
15853 else
15854   echo "$ac_t""no" 1>&6
15855   cat >> confdefs.h <<EOF
15856 #define pid_t int
15857 EOF
15858
15859 fi
15860
15861 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15862 echo "configure:15863: checking for ptrdiff_t" >&5
15863 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15864   echo $ac_n "(cached) $ac_c" 1>&6
15865 else
15866   cat > conftest.$ac_ext <<EOF
15867 #line 15868 "configure"
15868 #include "confdefs.h"
15869 #include <stddef.h>
15870 int main() {
15871 ptrdiff_t p
15872 ; return 0; }
15873 EOF
15874 if { (eval echo configure:15875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15875   rm -rf conftest*
15876   am_cv_type_ptrdiff_t=yes
15877 else
15878   echo "configure: failed program was:" >&5
15879   cat conftest.$ac_ext >&5
15880   rm -rf conftest*
15881   am_cv_type_ptrdiff_t=no
15882 fi
15883 rm -f conftest*
15884 fi
15885
15886 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15887    if test $am_cv_type_ptrdiff_t = yes; then
15888      cat >> confdefs.h <<\EOF
15889 #define HAVE_PTRDIFF_T 1
15890 EOF
15891
15892    fi
15893
15894 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15895 echo "configure:15896: checking return type of signal handlers" >&5
15896 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15897   echo $ac_n "(cached) $ac_c" 1>&6
15898 else
15899   cat > conftest.$ac_ext <<EOF
15900 #line 15901 "configure"
15901 #include "confdefs.h"
15902 #include <sys/types.h>
15903 #include <signal.h>
15904 #ifdef signal
15905 #undef signal
15906 #endif
15907 #ifdef __cplusplus
15908 extern "C" void (*signal (int, void (*)(int)))(int);
15909 #else
15910 void (*signal ()) ();
15911 #endif
15912
15913 int main() {
15914 int i;
15915 ; return 0; }
15916 EOF
15917 if { (eval echo configure:15918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15918   rm -rf conftest*
15919   ac_cv_type_signal=void
15920 else
15921   echo "configure: failed program was:" >&5
15922   cat conftest.$ac_ext >&5
15923   rm -rf conftest*
15924   ac_cv_type_signal=int
15925 fi
15926 rm -f conftest*
15927 fi
15928
15929 echo "$ac_t""$ac_cv_type_signal" 1>&6
15930 cat >> confdefs.h <<EOF
15931 #define RETSIGTYPE $ac_cv_type_signal
15932 EOF
15933
15934
15935 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15936 echo "configure:15937: checking for size_t" >&5
15937 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15938   echo $ac_n "(cached) $ac_c" 1>&6
15939 else
15940   cat > conftest.$ac_ext <<EOF
15941 #line 15942 "configure"
15942 #include "confdefs.h"
15943 #include <sys/types.h>
15944 #if STDC_HEADERS
15945 #include <stdlib.h>
15946 #include <stddef.h>
15947 #endif
15948
15949 EOF
15950 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15951   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15952   rm -rf conftest*
15953   eval "ac_cv_type_size_t=yes"
15954 else
15955   rm -rf conftest*
15956   eval "ac_cv_type_size_t=no"
15957 fi
15958 rm -f conftest*
15959
15960 fi
15961 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15962   echo "$ac_t""yes" 1>&6
15963 else
15964   echo "$ac_t""no" 1>&6
15965   cat >> confdefs.h <<EOF
15966 #define size_t unsigned
15967 EOF
15968
15969 fi
15970
15971
15972 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15973 echo "configure:15974: checking for ssize_t" >&5
15974 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15975   echo $ac_n "(cached) $ac_c" 1>&6
15976 else
15977   cat > conftest.$ac_ext <<EOF
15978 #line 15979 "configure"
15979 #include "confdefs.h"
15980 #include <sys/types.h>
15981 #if STDC_HEADERS
15982 #include <stdlib.h>
15983 #include <stddef.h>
15984 #endif
15985
15986 EOF
15987 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15988   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15989   rm -rf conftest*
15990   eval "ac_cv_type_ssize_t=yes"
15991 else
15992   rm -rf conftest*
15993   eval "ac_cv_type_ssize_t=no"
15994 fi
15995 rm -f conftest*
15996
15997 fi
15998 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15999   echo "$ac_t""yes" 1>&6
16000 else
16001   echo "$ac_t""no" 1>&6
16002   cat >> confdefs.h <<EOF
16003 #define ssize_t signed int
16004 EOF
16005
16006 fi
16007
16008 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16009 echo "configure:16010: checking for caddr_t" >&5
16010 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16011   echo $ac_n "(cached) $ac_c" 1>&6
16012 else
16013   cat > conftest.$ac_ext <<EOF
16014 #line 16015 "configure"
16015 #include "confdefs.h"
16016 #include <sys/types.h>
16017 #if STDC_HEADERS
16018 #include <stdlib.h>
16019 #include <stddef.h>
16020 #endif
16021
16022 EOF
16023 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16024   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16025   rm -rf conftest*
16026   eval "ac_cv_type_caddr_t=yes"
16027 else
16028   rm -rf conftest*
16029   eval "ac_cv_type_caddr_t=no"
16030 fi
16031 rm -f conftest*
16032
16033 fi
16034 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16035   echo "$ac_t""yes" 1>&6
16036 else
16037   echo "$ac_t""no" 1>&6
16038   cat >> confdefs.h <<EOF
16039 #define caddr_t char *
16040 EOF
16041
16042 fi
16043
16044
16045 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16046 echo "configure:16047: checking for socklen_t" >&5
16047 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16048   echo $ac_n "(cached) $ac_c" 1>&6
16049 else
16050   cat > conftest.$ac_ext <<EOF
16051 #line 16052 "configure"
16052 #include "confdefs.h"
16053
16054 #ifdef HAVE_SYS_TYPES_H
16055 #include <sys/types.h>
16056 #endif
16057 #ifdef HAVE_SYS_SOCKET_H
16058 #include <sys/socket.h>
16059 #endif
16060
16061 int main() {
16062 socklen_t len;
16063 ; return 0; }
16064 EOF
16065 if { (eval echo configure:16066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16066   rm -rf conftest*
16067   ol_cv_type_socklen_t=yes
16068 else
16069   echo "configure: failed program was:" >&5
16070   cat conftest.$ac_ext >&5
16071   rm -rf conftest*
16072   ol_cv_type_socklen_t=no
16073 fi
16074 rm -f conftest*
16075 fi
16076
16077 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16078   if test $ol_cv_type_socklen_t = no; then
16079     cat >> confdefs.h <<\EOF
16080 #define socklen_t int
16081 EOF
16082
16083   fi
16084  
16085 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16086 echo "configure:16087: checking for member st_blksize in aggregate type struct stat" >&5
16087 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16088   echo $ac_n "(cached) $ac_c" 1>&6
16089 else
16090   cat > conftest.$ac_ext <<EOF
16091 #line 16092 "configure"
16092 #include "confdefs.h"
16093 #include <sys/types.h>
16094 #include <sys/stat.h>
16095 int main() {
16096 struct stat foo; foo.st_blksize;
16097 ; return 0; }
16098 EOF
16099 if { (eval echo configure:16100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16100   rm -rf conftest*
16101   ac_cv_c_struct_member_st_blksize=yes
16102 else
16103   echo "configure: failed program was:" >&5
16104   cat conftest.$ac_ext >&5
16105   rm -rf conftest*
16106   ac_cv_c_struct_member_st_blksize=no
16107 fi
16108 rm -f conftest*
16109 fi
16110
16111 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16112 st_blksize="$ac_cv_c_struct_member_st_blksize"
16113 if test $ac_cv_c_struct_member_st_blksize = yes; then
16114   cat >> confdefs.h <<\EOF
16115 #define HAVE_ST_BLKSIZE 1
16116 EOF
16117
16118 fi
16119
16120 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16121 echo "configure:16122: checking whether time.h and sys/time.h may both be included" >&5
16122 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16123   echo $ac_n "(cached) $ac_c" 1>&6
16124 else
16125   cat > conftest.$ac_ext <<EOF
16126 #line 16127 "configure"
16127 #include "confdefs.h"
16128 #include <sys/types.h>
16129 #include <sys/time.h>
16130 #include <time.h>
16131 int main() {
16132 struct tm *tp;
16133 ; return 0; }
16134 EOF
16135 if { (eval echo configure:16136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16136   rm -rf conftest*
16137   ac_cv_header_time=yes
16138 else
16139   echo "configure: failed program was:" >&5
16140   cat conftest.$ac_ext >&5
16141   rm -rf conftest*
16142   ac_cv_header_time=no
16143 fi
16144 rm -f conftest*
16145 fi
16146
16147 echo "$ac_t""$ac_cv_header_time" 1>&6
16148 if test $ac_cv_header_time = yes; then
16149   cat >> confdefs.h <<\EOF
16150 #define TIME_WITH_SYS_TIME 1
16151 EOF
16152
16153 fi
16154
16155 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16156 echo "configure:16157: checking whether struct tm is in sys/time.h or time.h" >&5
16157 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16158   echo $ac_n "(cached) $ac_c" 1>&6
16159 else
16160   cat > conftest.$ac_ext <<EOF
16161 #line 16162 "configure"
16162 #include "confdefs.h"
16163 #include <sys/types.h>
16164 #include <time.h>
16165 int main() {
16166 struct tm *tp; tp->tm_sec;
16167 ; return 0; }
16168 EOF
16169 if { (eval echo configure:16170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16170   rm -rf conftest*
16171   ac_cv_struct_tm=time.h
16172 else
16173   echo "configure: failed program was:" >&5
16174   cat conftest.$ac_ext >&5
16175   rm -rf conftest*
16176   ac_cv_struct_tm=sys/time.h
16177 fi
16178 rm -f conftest*
16179 fi
16180
16181 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16182 if test $ac_cv_struct_tm = sys/time.h; then
16183   cat >> confdefs.h <<\EOF
16184 #define TM_IN_SYS_TIME 1
16185 EOF
16186
16187 fi
16188
16189 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16190 echo "configure:16191: checking for uid_t in sys/types.h" >&5
16191 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16192   echo $ac_n "(cached) $ac_c" 1>&6
16193 else
16194   cat > conftest.$ac_ext <<EOF
16195 #line 16196 "configure"
16196 #include "confdefs.h"
16197 #include <sys/types.h>
16198 EOF
16199 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16200   egrep "uid_t" >/dev/null 2>&1; then
16201   rm -rf conftest*
16202   ac_cv_type_uid_t=yes
16203 else
16204   rm -rf conftest*
16205   ac_cv_type_uid_t=no
16206 fi
16207 rm -f conftest*
16208
16209 fi
16210
16211 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16212 if test $ac_cv_type_uid_t = no; then
16213   cat >> confdefs.h <<\EOF
16214 #define uid_t int
16215 EOF
16216
16217   cat >> confdefs.h <<\EOF
16218 #define gid_t int
16219 EOF
16220
16221 fi
16222
16223 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16224 echo "configure:16225: checking for sig_atomic_t" >&5
16225 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16226   echo $ac_n "(cached) $ac_c" 1>&6
16227 else
16228   cat > conftest.$ac_ext <<EOF
16229 #line 16230 "configure"
16230 #include "confdefs.h"
16231 #include <signal.h>
16232 int main() {
16233 sig_atomic_t atomic;
16234 ; return 0; }
16235 EOF
16236 if { (eval echo configure:16237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16237   rm -rf conftest*
16238   ol_cv_type_sig_atomic_t=yes
16239 else
16240   echo "configure: failed program was:" >&5
16241   cat conftest.$ac_ext >&5
16242   rm -rf conftest*
16243   ol_cv_type_sig_atomic_t=no
16244 fi
16245 rm -f conftest*
16246 fi
16247
16248 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16249   if test $ol_cv_type_sig_atomic_t = no; then
16250     cat >> confdefs.h <<\EOF
16251 #define sig_atomic_t int
16252 EOF
16253
16254   fi
16255  
16256
16257
16258 # test for pw_gecos in struct passwd
16259 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16260 echo "configure:16261: checking struct passwd for pw_gecos" >&5
16261 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16262   echo $ac_n "(cached) $ac_c" 1>&6
16263 else
16264   
16265         cat > conftest.$ac_ext <<EOF
16266 #line 16267 "configure"
16267 #include "confdefs.h"
16268 #include <pwd.h>
16269 int main() {
16270
16271         struct passwd pwd;
16272         pwd.pw_gecos = pwd.pw_name;
16273
16274 ; return 0; }
16275 EOF
16276 if { (eval echo configure:16277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16277   rm -rf conftest*
16278   ol_cv_struct_passwd_pw_gecos=yes
16279 else
16280   echo "configure: failed program was:" >&5
16281   cat conftest.$ac_ext >&5
16282   rm -rf conftest*
16283   ol_cv_struct_passwd_pw_gecos=no
16284 fi
16285 rm -f conftest*
16286 fi
16287
16288 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16289 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16290         cat >> confdefs.h <<\EOF
16291 #define HAVE_PW_GECOS 1
16292 EOF
16293
16294 fi
16295
16296 # test for pw_passwd in struct passwd
16297 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16298 echo "configure:16299: checking struct passwd for pw_passwd" >&5
16299 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16300   echo $ac_n "(cached) $ac_c" 1>&6
16301 else
16302   
16303         cat > conftest.$ac_ext <<EOF
16304 #line 16305 "configure"
16305 #include "confdefs.h"
16306 #include <pwd.h>
16307 int main() {
16308
16309         struct passwd pwd;
16310         pwd.pw_passwd = pwd.pw_name;
16311
16312 ; return 0; }
16313 EOF
16314 if { (eval echo configure:16315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16315   rm -rf conftest*
16316   ol_cv_struct_passwd_pw_passwd=yes
16317 else
16318   echo "configure: failed program was:" >&5
16319   cat conftest.$ac_ext >&5
16320   rm -rf conftest*
16321   ol_cv_struct_passwd_pw_passwd=no
16322 fi
16323 rm -f conftest*
16324 fi
16325
16326 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16327 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16328         cat >> confdefs.h <<\EOF
16329 #define HAVE_PW_PASSWD 1
16330 EOF
16331
16332 fi
16333
16334
16335 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16336 echo "configure:16337: checking if toupper() requires islower()" >&5
16337 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16338   echo $ac_n "(cached) $ac_c" 1>&6
16339 else
16340   
16341         if test "$cross_compiling" = yes; then
16342   ol_cv_c_upper_lower=safe
16343 else
16344   cat > conftest.$ac_ext <<EOF
16345 #line 16346 "configure"
16346 #include "confdefs.h"
16347
16348 #include <ctype.h>
16349 main()
16350 {
16351         if ('C' == toupper('C'))
16352                 exit(0);
16353         else
16354                 exit(1);
16355 }
16356 EOF
16357 if { (eval echo configure:16358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16358 then
16359   ol_cv_c_upper_lower=no
16360 else
16361   echo "configure: failed program was:" >&5
16362   cat conftest.$ac_ext >&5
16363   rm -fr conftest*
16364   ol_cv_c_upper_lower=yes
16365 fi
16366 rm -fr conftest*
16367 fi
16368
16369 fi
16370
16371 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16372 if test $ol_cv_c_upper_lower != no ; then
16373         cat >> confdefs.h <<\EOF
16374 #define C_UPPER_LOWER 1
16375 EOF
16376
16377 fi
16378
16379 echo $ac_n "checking for working const""... $ac_c" 1>&6
16380 echo "configure:16381: checking for working const" >&5
16381 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16382   echo $ac_n "(cached) $ac_c" 1>&6
16383 else
16384   cat > conftest.$ac_ext <<EOF
16385 #line 16386 "configure"
16386 #include "confdefs.h"
16387
16388 int main() {
16389
16390 /* Ultrix mips cc rejects this.  */
16391 typedef int charset[2]; const charset x;
16392 /* SunOS 4.1.1 cc rejects this.  */
16393 char const *const *ccp;
16394 char **p;
16395 /* NEC SVR4.0.2 mips cc rejects this.  */
16396 struct point {int x, y;};
16397 static struct point const zero = {0,0};
16398 /* AIX XL C 1.02.0.0 rejects this.
16399    It does not let you subtract one const X* pointer from another in an arm
16400    of an if-expression whose if-part is not a constant expression */
16401 const char *g = "string";
16402 ccp = &g + (g ? g-g : 0);
16403 /* HPUX 7.0 cc rejects these. */
16404 ++ccp;
16405 p = (char**) ccp;
16406 ccp = (char const *const *) p;
16407 { /* SCO 3.2v4 cc rejects this.  */
16408   char *t;
16409   char const *s = 0 ? (char *) 0 : (char const *) 0;
16410
16411   *t++ = 0;
16412 }
16413 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16414   int x[] = {25, 17};
16415   const int *foo = &x[0];
16416   ++foo;
16417 }
16418 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16419   typedef const int *iptr;
16420   iptr p = 0;
16421   ++p;
16422 }
16423 { /* AIX XL C 1.02.0.0 rejects this saying
16424      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16425   struct s { int j; const int *ap[3]; };
16426   struct s *b; b->j = 5;
16427 }
16428 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16429   const int foo = 10;
16430 }
16431
16432 ; return 0; }
16433 EOF
16434 if { (eval echo configure:16435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16435   rm -rf conftest*
16436   ac_cv_c_const=yes
16437 else
16438   echo "configure: failed program was:" >&5
16439   cat conftest.$ac_ext >&5
16440   rm -rf conftest*
16441   ac_cv_c_const=no
16442 fi
16443 rm -f conftest*
16444 fi
16445
16446 echo "$ac_t""$ac_cv_c_const" 1>&6
16447 if test $ac_cv_c_const = no; then
16448   cat >> confdefs.h <<\EOF
16449 #define const 
16450 EOF
16451
16452 fi
16453
16454 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16455 echo "configure:16456: checking if compiler understands volatile" >&5
16456 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16457   echo $ac_n "(cached) $ac_c" 1>&6
16458 else
16459   cat > conftest.$ac_ext <<EOF
16460 #line 16461 "configure"
16461 #include "confdefs.h"
16462 int x, y, z;
16463 int main() {
16464 volatile int a; int * volatile b = x ? &y : &z;
16465       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16466       *b = 0;
16467 ; return 0; }
16468 EOF
16469 if { (eval echo configure:16470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16470   rm -rf conftest*
16471   ol_cv_c_volatile=yes
16472 else
16473   echo "configure: failed program was:" >&5
16474   cat conftest.$ac_ext >&5
16475   rm -rf conftest*
16476   ol_cv_c_volatile=no
16477 fi
16478 rm -f conftest*
16479 fi
16480
16481 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16482   if test $ol_cv_c_volatile = yes; then
16483     : 
16484   else
16485     cat >> confdefs.h <<\EOF
16486 #define volatile 
16487 EOF
16488
16489   fi
16490  
16491
16492 if test $cross_compiling = yes ; then
16493         cat >> confdefs.h <<\EOF
16494 #define CROSS_COMPILING 1
16495 EOF
16496
16497 else
16498         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16499 echo "configure:16500: checking whether byte ordering is bigendian" >&5
16500 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16501   echo $ac_n "(cached) $ac_c" 1>&6
16502 else
16503   ac_cv_c_bigendian=unknown
16504 # See if sys/param.h defines the BYTE_ORDER macro.
16505 cat > conftest.$ac_ext <<EOF
16506 #line 16507 "configure"
16507 #include "confdefs.h"
16508 #include <sys/types.h>
16509 #include <sys/param.h>
16510 int main() {
16511
16512 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16513  bogus endian macros
16514 #endif
16515 ; return 0; }
16516 EOF
16517 if { (eval echo configure:16518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16518   rm -rf conftest*
16519   # It does; now see whether it defined to BIG_ENDIAN or not.
16520 cat > conftest.$ac_ext <<EOF
16521 #line 16522 "configure"
16522 #include "confdefs.h"
16523 #include <sys/types.h>
16524 #include <sys/param.h>
16525 int main() {
16526
16527 #if BYTE_ORDER != BIG_ENDIAN
16528  not big endian
16529 #endif
16530 ; return 0; }
16531 EOF
16532 if { (eval echo configure:16533: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16533   rm -rf conftest*
16534   ac_cv_c_bigendian=yes
16535 else
16536   echo "configure: failed program was:" >&5
16537   cat conftest.$ac_ext >&5
16538   rm -rf conftest*
16539   ac_cv_c_bigendian=no
16540 fi
16541 rm -f conftest*
16542 else
16543   echo "configure: failed program was:" >&5
16544   cat conftest.$ac_ext >&5
16545 fi
16546 rm -f conftest*
16547 if test $ac_cv_c_bigendian = unknown; then
16548 if test "$cross_compiling" = yes; then
16549     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16550 else
16551   cat > conftest.$ac_ext <<EOF
16552 #line 16553 "configure"
16553 #include "confdefs.h"
16554 main () {
16555   /* Are we little or big endian?  From Harbison&Steele.  */
16556   union
16557   {
16558     long l;
16559     char c[sizeof (long)];
16560   } u;
16561   u.l = 1;
16562   exit (u.c[sizeof (long) - 1] == 1);
16563 }
16564 EOF
16565 if { (eval echo configure:16566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16566 then
16567   ac_cv_c_bigendian=no
16568 else
16569   echo "configure: failed program was:" >&5
16570   cat conftest.$ac_ext >&5
16571   rm -fr conftest*
16572   ac_cv_c_bigendian=yes
16573 fi
16574 rm -fr conftest*
16575 fi
16576
16577 fi
16578 fi
16579
16580 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16581 if test $ac_cv_c_bigendian = yes; then
16582   cat >> confdefs.h <<\EOF
16583 #define WORDS_BIGENDIAN 1
16584 EOF
16585
16586 fi
16587
16588 fi
16589
16590 echo $ac_n "checking size of short""... $ac_c" 1>&6
16591 echo "configure:16592: checking size of short" >&5 
16592 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16593   echo $ac_n "(cached) $ac_c" 1>&6
16594 else
16595   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16596   cat > conftest.$ac_ext <<EOF
16597 #line 16598 "configure"
16598 #include "confdefs.h"
16599 #include "confdefs.h" 
16600 #include <sys/types.h> 
16601  
16602
16603 int main() {
16604 switch (0) case 0: case (sizeof (short) == $ac_size):;
16605 ; return 0; }
16606 EOF
16607 if { (eval echo configure:16608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16608   rm -rf conftest*
16609   ac_cv_sizeof_short=$ac_size
16610 else
16611   echo "configure: failed program was:" >&5
16612   cat conftest.$ac_ext >&5
16613 fi
16614 rm -f conftest* 
16615   if test x$ac_cv_sizeof_short != x ; then break; fi 
16616 done 
16617
16618 fi
16619  
16620 if test x$ac_cv_sizeof_short = x ; then 
16621   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16622 fi 
16623 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16624 cat >> confdefs.h <<EOF
16625 #define SIZEOF_SHORT $ac_cv_sizeof_short
16626 EOF
16627  
16628  
16629 echo $ac_n "checking size of int""... $ac_c" 1>&6
16630 echo "configure:16631: checking size of int" >&5 
16631 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16632   echo $ac_n "(cached) $ac_c" 1>&6
16633 else
16634   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16635   cat > conftest.$ac_ext <<EOF
16636 #line 16637 "configure"
16637 #include "confdefs.h"
16638 #include "confdefs.h" 
16639 #include <sys/types.h> 
16640  
16641
16642 int main() {
16643 switch (0) case 0: case (sizeof (int) == $ac_size):;
16644 ; return 0; }
16645 EOF
16646 if { (eval echo configure:16647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16647   rm -rf conftest*
16648   ac_cv_sizeof_int=$ac_size
16649 else
16650   echo "configure: failed program was:" >&5
16651   cat conftest.$ac_ext >&5
16652 fi
16653 rm -f conftest* 
16654   if test x$ac_cv_sizeof_int != x ; then break; fi 
16655 done 
16656
16657 fi
16658  
16659 if test x$ac_cv_sizeof_int = x ; then 
16660   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16661 fi 
16662 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16663 cat >> confdefs.h <<EOF
16664 #define SIZEOF_INT $ac_cv_sizeof_int
16665 EOF
16666  
16667  
16668 echo $ac_n "checking size of long""... $ac_c" 1>&6
16669 echo "configure:16670: checking size of long" >&5 
16670 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16671   echo $ac_n "(cached) $ac_c" 1>&6
16672 else
16673   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16674   cat > conftest.$ac_ext <<EOF
16675 #line 16676 "configure"
16676 #include "confdefs.h"
16677 #include "confdefs.h" 
16678 #include <sys/types.h> 
16679  
16680
16681 int main() {
16682 switch (0) case 0: case (sizeof (long) == $ac_size):;
16683 ; return 0; }
16684 EOF
16685 if { (eval echo configure:16686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16686   rm -rf conftest*
16687   ac_cv_sizeof_long=$ac_size
16688 else
16689   echo "configure: failed program was:" >&5
16690   cat conftest.$ac_ext >&5
16691 fi
16692 rm -f conftest* 
16693   if test x$ac_cv_sizeof_long != x ; then break; fi 
16694 done 
16695
16696 fi
16697  
16698 if test x$ac_cv_sizeof_long = x ; then 
16699   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16700 fi 
16701 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16702 cat >> confdefs.h <<EOF
16703 #define SIZEOF_LONG $ac_cv_sizeof_long
16704 EOF
16705  
16706
16707
16708 if test "$ac_cv_sizeof_int" -lt 4 ; then
16709         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16710
16711         cat >> confdefs.h <<\EOF
16712 #define LBER_INT_T long
16713 EOF
16714
16715 else
16716         cat >> confdefs.h <<\EOF
16717 #define LBER_INT_T int
16718 EOF
16719
16720 fi
16721
16722 cat >> confdefs.h <<\EOF
16723 #define LBER_LEN_T long
16724 EOF
16725
16726 cat >> confdefs.h <<\EOF
16727 #define LBER_SOCKET_T int
16728 EOF
16729
16730 cat >> confdefs.h <<\EOF
16731 #define LBER_TAG_T long
16732 EOF
16733
16734
16735 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16736 echo "configure:16737: checking for 8-bit clean memcmp" >&5
16737 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16738   echo $ac_n "(cached) $ac_c" 1>&6
16739 else
16740   if test "$cross_compiling" = yes; then
16741   ac_cv_func_memcmp_clean=no
16742 else
16743   cat > conftest.$ac_ext <<EOF
16744 #line 16745 "configure"
16745 #include "confdefs.h"
16746
16747 main()
16748 {
16749   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16750   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16751 }
16752
16753 EOF
16754 if { (eval echo configure:16755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16755 then
16756   ac_cv_func_memcmp_clean=yes
16757 else
16758   echo "configure: failed program was:" >&5
16759   cat conftest.$ac_ext >&5
16760   rm -fr conftest*
16761   ac_cv_func_memcmp_clean=no
16762 fi
16763 rm -fr conftest*
16764 fi
16765
16766 fi
16767
16768 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16769 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16770
16771 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16772 echo "configure:16773: checking for strftime" >&5
16773 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16774   echo $ac_n "(cached) $ac_c" 1>&6
16775 else
16776   cat > conftest.$ac_ext <<EOF
16777 #line 16778 "configure"
16778 #include "confdefs.h"
16779 /* System header to define __stub macros and hopefully few prototypes,
16780     which can conflict with char strftime(); below.  */
16781 #include <assert.h>
16782 /* Override any gcc2 internal prototype to avoid an error.  */
16783 /* We use char because int might match the return type of a gcc2
16784     builtin and then its argument prototype would still apply.  */
16785 char strftime();
16786 char (*f)();
16787
16788 int main() {
16789
16790 /* The GNU C library defines this for functions which it implements
16791     to always fail with ENOSYS.  Some functions are actually named
16792     something starting with __ and the normal name is an alias.  */
16793 #if defined (__stub_strftime) || defined (__stub___strftime)
16794 choke me
16795 #else
16796 f = strftime;
16797 #endif
16798
16799 ; return 0; }
16800 EOF
16801 if { (eval echo configure:16802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16802   rm -rf conftest*
16803   eval "ac_cv_func_strftime=yes"
16804 else
16805   echo "configure: failed program was:" >&5
16806   cat conftest.$ac_ext >&5
16807   rm -rf conftest*
16808   eval "ac_cv_func_strftime=no"
16809 fi
16810 rm -f conftest*
16811 fi
16812
16813 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16814   echo "$ac_t""yes" 1>&6
16815   cat >> confdefs.h <<\EOF
16816 #define HAVE_STRFTIME 1
16817 EOF
16818
16819 else
16820   echo "$ac_t""no" 1>&6
16821 # strftime is in -lintl on SCO UNIX.
16822 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16823 echo "configure:16824: checking for strftime in -lintl" >&5
16824 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16825 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16826   echo $ac_n "(cached) $ac_c" 1>&6
16827 else
16828   ac_save_LIBS="$LIBS"
16829 LIBS="-lintl  $LIBS"
16830 cat > conftest.$ac_ext <<EOF
16831 #line 16832 "configure"
16832 #include "confdefs.h"
16833 /* Override any gcc2 internal prototype to avoid an error.  */
16834 /* We use char because int might match the return type of a gcc2
16835     builtin and then its argument prototype would still apply.  */
16836 char strftime();
16837
16838 int main() {
16839 strftime()
16840 ; return 0; }
16841 EOF
16842 if { (eval echo configure:16843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16843   rm -rf conftest*
16844   eval "ac_cv_lib_$ac_lib_var=yes"
16845 else
16846   echo "configure: failed program was:" >&5
16847   cat conftest.$ac_ext >&5
16848   rm -rf conftest*
16849   eval "ac_cv_lib_$ac_lib_var=no"
16850 fi
16851 rm -f conftest*
16852 LIBS="$ac_save_LIBS"
16853
16854 fi
16855 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16856   echo "$ac_t""yes" 1>&6
16857   cat >> confdefs.h <<\EOF
16858 #define HAVE_STRFTIME 1
16859 EOF
16860
16861 LIBS="-lintl $LIBS"
16862 else
16863   echo "$ac_t""no" 1>&6
16864 fi
16865
16866 fi
16867
16868
16869 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16870 echo "configure:16871: checking for inet_aton()" >&5
16871 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16872   echo $ac_n "(cached) $ac_c" 1>&6
16873 else
16874   cat > conftest.$ac_ext <<EOF
16875 #line 16876 "configure"
16876 #include "confdefs.h"
16877
16878 #ifdef HAVE_SYS_TYPES_H
16879 #       include <sys/types.h>
16880 #endif
16881 #ifdef HAVE_SYS_SOCKET_H
16882 #       include <sys/socket.h>
16883 #       ifdef HAVE_SYS_SELECT_H
16884 #               include <sys/select.h>
16885 #       endif
16886 #       include <netinet/in.h>
16887 #       ifdef HAVE_ARPA_INET_H
16888 #               include <arpa/inet.h>
16889 #       endif
16890 #endif
16891
16892 int main() {
16893 struct in_addr in;
16894 int rc = inet_aton( "255.255.255.255", &in );
16895 ; return 0; }
16896 EOF
16897 if { (eval echo configure:16898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16898   rm -rf conftest*
16899   ol_cv_func_inet_aton=yes
16900 else
16901   echo "configure: failed program was:" >&5
16902   cat conftest.$ac_ext >&5
16903   rm -rf conftest*
16904   ol_cv_func_inet_aton=no
16905 fi
16906 rm -f conftest*
16907 fi
16908
16909 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16910   if test $ol_cv_func_inet_aton != no; then
16911     cat >> confdefs.h <<\EOF
16912 #define HAVE_INET_ATON 1
16913 EOF
16914
16915   fi
16916  
16917
16918 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16919 echo "configure:16920: checking for _spawnlp" >&5
16920 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16921   echo $ac_n "(cached) $ac_c" 1>&6
16922 else
16923   cat > conftest.$ac_ext <<EOF
16924 #line 16925 "configure"
16925 #include "confdefs.h"
16926 /* System header to define __stub macros and hopefully few prototypes,
16927     which can conflict with char _spawnlp(); below.  */
16928 #include <assert.h>
16929 /* Override any gcc2 internal prototype to avoid an error.  */
16930 /* We use char because int might match the return type of a gcc2
16931     builtin and then its argument prototype would still apply.  */
16932 char _spawnlp();
16933 char (*f)();
16934
16935 int main() {
16936
16937 /* The GNU C library defines this for functions which it implements
16938     to always fail with ENOSYS.  Some functions are actually named
16939     something starting with __ and the normal name is an alias.  */
16940 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16941 choke me
16942 #else
16943 f = _spawnlp;
16944 #endif
16945
16946 ; return 0; }
16947 EOF
16948 if { (eval echo configure:16949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16949   rm -rf conftest*
16950   eval "ac_cv_func__spawnlp=yes"
16951 else
16952   echo "configure: failed program was:" >&5
16953   cat conftest.$ac_ext >&5
16954   rm -rf conftest*
16955   eval "ac_cv_func__spawnlp=no"
16956 fi
16957 rm -f conftest*
16958 fi
16959
16960 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16961   echo "$ac_t""yes" 1>&6
16962   cat >> confdefs.h <<\EOF
16963 #define HAVE_SPAWNLP 1
16964 EOF
16965
16966 else
16967   echo "$ac_t""no" 1>&6
16968 fi
16969
16970
16971 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16972 echo "configure:16973: checking for _snprintf" >&5
16973 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16974   echo $ac_n "(cached) $ac_c" 1>&6
16975 else
16976   cat > conftest.$ac_ext <<EOF
16977 #line 16978 "configure"
16978 #include "confdefs.h"
16979 /* System header to define __stub macros and hopefully few prototypes,
16980     which can conflict with char _snprintf(); below.  */
16981 #include <assert.h>
16982 /* Override any gcc2 internal prototype to avoid an error.  */
16983 /* We use char because int might match the return type of a gcc2
16984     builtin and then its argument prototype would still apply.  */
16985 char _snprintf();
16986 char (*f)();
16987
16988 int main() {
16989
16990 /* The GNU C library defines this for functions which it implements
16991     to always fail with ENOSYS.  Some functions are actually named
16992     something starting with __ and the normal name is an alias.  */
16993 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16994 choke me
16995 #else
16996 f = _snprintf;
16997 #endif
16998
16999 ; return 0; }
17000 EOF
17001 if { (eval echo configure:17002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17002   rm -rf conftest*
17003   eval "ac_cv_func__snprintf=yes"
17004 else
17005   echo "configure: failed program was:" >&5
17006   cat conftest.$ac_ext >&5
17007   rm -rf conftest*
17008   eval "ac_cv_func__snprintf=no"
17009 fi
17010 rm -f conftest*
17011 fi
17012
17013 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17014   echo "$ac_t""yes" 1>&6
17015   ac_cv_func_snprintf=yes
17016         cat >> confdefs.h <<\EOF
17017 #define snprintf _snprintf
17018 EOF
17019
17020
17021 else
17022   echo "$ac_t""no" 1>&6
17023 fi
17024
17025
17026 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17027 echo "configure:17028: checking for _vsnprintf" >&5
17028 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17029   echo $ac_n "(cached) $ac_c" 1>&6
17030 else
17031   cat > conftest.$ac_ext <<EOF
17032 #line 17033 "configure"
17033 #include "confdefs.h"
17034 /* System header to define __stub macros and hopefully few prototypes,
17035     which can conflict with char _vsnprintf(); below.  */
17036 #include <assert.h>
17037 /* Override any gcc2 internal prototype to avoid an error.  */
17038 /* We use char because int might match the return type of a gcc2
17039     builtin and then its argument prototype would still apply.  */
17040 char _vsnprintf();
17041 char (*f)();
17042
17043 int main() {
17044
17045 /* The GNU C library defines this for functions which it implements
17046     to always fail with ENOSYS.  Some functions are actually named
17047     something starting with __ and the normal name is an alias.  */
17048 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17049 choke me
17050 #else
17051 f = _vsnprintf;
17052 #endif
17053
17054 ; return 0; }
17055 EOF
17056 if { (eval echo configure:17057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17057   rm -rf conftest*
17058   eval "ac_cv_func__vsnprintf=yes"
17059 else
17060   echo "configure: failed program was:" >&5
17061   cat conftest.$ac_ext >&5
17062   rm -rf conftest*
17063   eval "ac_cv_func__vsnprintf=no"
17064 fi
17065 rm -f conftest*
17066 fi
17067
17068 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17069   echo "$ac_t""yes" 1>&6
17070   ac_cv_func_vsnprintf=yes
17071         cat >> confdefs.h <<\EOF
17072 #define vsnprintf _vsnprintf
17073 EOF
17074
17075
17076 else
17077   echo "$ac_t""no" 1>&6
17078 fi
17079
17080
17081 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17082 echo "configure:17083: checking for vprintf" >&5
17083 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17084   echo $ac_n "(cached) $ac_c" 1>&6
17085 else
17086   cat > conftest.$ac_ext <<EOF
17087 #line 17088 "configure"
17088 #include "confdefs.h"
17089 /* System header to define __stub macros and hopefully few prototypes,
17090     which can conflict with char vprintf(); below.  */
17091 #include <assert.h>
17092 /* Override any gcc2 internal prototype to avoid an error.  */
17093 /* We use char because int might match the return type of a gcc2
17094     builtin and then its argument prototype would still apply.  */
17095 char vprintf();
17096 char (*f)();
17097
17098 int main() {
17099
17100 /* The GNU C library defines this for functions which it implements
17101     to always fail with ENOSYS.  Some functions are actually named
17102     something starting with __ and the normal name is an alias.  */
17103 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17104 choke me
17105 #else
17106 f = vprintf;
17107 #endif
17108
17109 ; return 0; }
17110 EOF
17111 if { (eval echo configure:17112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17112   rm -rf conftest*
17113   eval "ac_cv_func_vprintf=yes"
17114 else
17115   echo "configure: failed program was:" >&5
17116   cat conftest.$ac_ext >&5
17117   rm -rf conftest*
17118   eval "ac_cv_func_vprintf=no"
17119 fi
17120 rm -f conftest*
17121 fi
17122
17123 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17124   echo "$ac_t""yes" 1>&6
17125   cat >> confdefs.h <<\EOF
17126 #define HAVE_VPRINTF 1
17127 EOF
17128
17129 else
17130   echo "$ac_t""no" 1>&6
17131 fi
17132
17133 if test "$ac_cv_func_vprintf" != yes; then
17134 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17135 echo "configure:17136: checking for _doprnt" >&5
17136 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17137   echo $ac_n "(cached) $ac_c" 1>&6
17138 else
17139   cat > conftest.$ac_ext <<EOF
17140 #line 17141 "configure"
17141 #include "confdefs.h"
17142 /* System header to define __stub macros and hopefully few prototypes,
17143     which can conflict with char _doprnt(); below.  */
17144 #include <assert.h>
17145 /* Override any gcc2 internal prototype to avoid an error.  */
17146 /* We use char because int might match the return type of a gcc2
17147     builtin and then its argument prototype would still apply.  */
17148 char _doprnt();
17149 char (*f)();
17150
17151 int main() {
17152
17153 /* The GNU C library defines this for functions which it implements
17154     to always fail with ENOSYS.  Some functions are actually named
17155     something starting with __ and the normal name is an alias.  */
17156 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17157 choke me
17158 #else
17159 f = _doprnt;
17160 #endif
17161
17162 ; return 0; }
17163 EOF
17164 if { (eval echo configure:17165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17165   rm -rf conftest*
17166   eval "ac_cv_func__doprnt=yes"
17167 else
17168   echo "configure: failed program was:" >&5
17169   cat conftest.$ac_ext >&5
17170   rm -rf conftest*
17171   eval "ac_cv_func__doprnt=no"
17172 fi
17173 rm -f conftest*
17174 fi
17175
17176 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17177   echo "$ac_t""yes" 1>&6
17178   cat >> confdefs.h <<\EOF
17179 #define HAVE_DOPRNT 1
17180 EOF
17181
17182 else
17183   echo "$ac_t""no" 1>&6
17184 fi
17185
17186 fi
17187
17188
17189 if test $ac_cv_func_vprintf = yes ; then
17190                 for ac_func in vsnprintf vsprintf
17191 do
17192 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17193 echo "configure:17194: checking for $ac_func" >&5
17194 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17195   echo $ac_n "(cached) $ac_c" 1>&6
17196 else
17197   cat > conftest.$ac_ext <<EOF
17198 #line 17199 "configure"
17199 #include "confdefs.h"
17200 /* System header to define __stub macros and hopefully few prototypes,
17201     which can conflict with char $ac_func(); below.  */
17202 #include <assert.h>
17203 /* Override any gcc2 internal prototype to avoid an error.  */
17204 /* We use char because int might match the return type of a gcc2
17205     builtin and then its argument prototype would still apply.  */
17206 char $ac_func();
17207 char (*f)();
17208
17209 int main() {
17210
17211 /* The GNU C library defines this for functions which it implements
17212     to always fail with ENOSYS.  Some functions are actually named
17213     something starting with __ and the normal name is an alias.  */
17214 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17215 choke me
17216 #else
17217 f = $ac_func;
17218 #endif
17219
17220 ; return 0; }
17221 EOF
17222 if { (eval echo configure:17223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17223   rm -rf conftest*
17224   eval "ac_cv_func_$ac_func=yes"
17225 else
17226   echo "configure: failed program was:" >&5
17227   cat conftest.$ac_ext >&5
17228   rm -rf conftest*
17229   eval "ac_cv_func_$ac_func=no"
17230 fi
17231 rm -f conftest*
17232 fi
17233
17234 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17235   echo "$ac_t""yes" 1>&6
17236     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17237   cat >> confdefs.h <<EOF
17238 #define $ac_tr_func 1
17239 EOF
17240  
17241 else
17242   echo "$ac_t""no" 1>&6
17243 fi
17244 done
17245
17246 fi
17247
17248 for ac_func in \
17249         bcopy                   \
17250         closesocket             \
17251         chroot                  \
17252         endgrent                \
17253         endpwent                \
17254         fcntl                   \
17255         flock                   \
17256         getdtablesize   \
17257         getgrgid                \
17258         gethostname             \
17259         getpass                 \
17260         getpassphrase   \
17261         getpwuid                \
17262         getpwnam                \
17263         getspnam                \
17264         gettimeofday    \
17265         initgroups              \
17266         lockf                   \
17267         memcpy                  \
17268         memmove                 \
17269         pipe                    \
17270         read                    \
17271         recv                    \
17272         recvfrom                \
17273         setpwfile               \
17274         setgid                  \
17275         setegid                 \
17276         setsid                  \
17277         setuid                  \
17278         seteuid                 \
17279         sigaction               \
17280         signal                  \
17281         sigset                  \
17282         strdup                  \
17283         strerror                \
17284         strpbrk                 \
17285         strrchr                 \
17286         strsep                  \
17287         strstr                  \
17288         strtol                  \
17289         strtoul                 \
17290         strspn                  \
17291         sysconf                 \
17292         usleep                  \
17293         waitpid                 \
17294         wait4                   \
17295         write                   \
17296         send                    \
17297         sendto                  \
17298
17299 do
17300 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17301 echo "configure:17302: checking for $ac_func" >&5
17302 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17303   echo $ac_n "(cached) $ac_c" 1>&6
17304 else
17305   cat > conftest.$ac_ext <<EOF
17306 #line 17307 "configure"
17307 #include "confdefs.h"
17308 /* System header to define __stub macros and hopefully few prototypes,
17309     which can conflict with char $ac_func(); below.  */
17310 #include <assert.h>
17311 /* Override any gcc2 internal prototype to avoid an error.  */
17312 /* We use char because int might match the return type of a gcc2
17313     builtin and then its argument prototype would still apply.  */
17314 char $ac_func();
17315 char (*f)();
17316
17317 int main() {
17318
17319 /* The GNU C library defines this for functions which it implements
17320     to always fail with ENOSYS.  Some functions are actually named
17321     something starting with __ and the normal name is an alias.  */
17322 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17323 choke me
17324 #else
17325 f = $ac_func;
17326 #endif
17327
17328 ; return 0; }
17329 EOF
17330 if { (eval echo configure:17331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17331   rm -rf conftest*
17332   eval "ac_cv_func_$ac_func=yes"
17333 else
17334   echo "configure: failed program was:" >&5
17335   cat conftest.$ac_ext >&5
17336   rm -rf conftest*
17337   eval "ac_cv_func_$ac_func=no"
17338 fi
17339 rm -f conftest*
17340 fi
17341
17342 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17343   echo "$ac_t""yes" 1>&6
17344     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17345   cat >> confdefs.h <<EOF
17346 #define $ac_tr_func 1
17347 EOF
17348  
17349 else
17350   echo "$ac_t""no" 1>&6
17351 fi
17352 done
17353
17354
17355 for ac_func in getopt
17356 do
17357 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17358 echo "configure:17359: checking for $ac_func" >&5
17359 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17360   echo $ac_n "(cached) $ac_c" 1>&6
17361 else
17362   cat > conftest.$ac_ext <<EOF
17363 #line 17364 "configure"
17364 #include "confdefs.h"
17365 /* System header to define __stub macros and hopefully few prototypes,
17366     which can conflict with char $ac_func(); below.  */
17367 #include <assert.h>
17368 /* Override any gcc2 internal prototype to avoid an error.  */
17369 /* We use char because int might match the return type of a gcc2
17370     builtin and then its argument prototype would still apply.  */
17371 char $ac_func();
17372 char (*f)();
17373
17374 int main() {
17375
17376 /* The GNU C library defines this for functions which it implements
17377     to always fail with ENOSYS.  Some functions are actually named
17378     something starting with __ and the normal name is an alias.  */
17379 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17380 choke me
17381 #else
17382 f = $ac_func;
17383 #endif
17384
17385 ; return 0; }
17386 EOF
17387 if { (eval echo configure:17388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17388   rm -rf conftest*
17389   eval "ac_cv_func_$ac_func=yes"
17390 else
17391   echo "configure: failed program was:" >&5
17392   cat conftest.$ac_ext >&5
17393   rm -rf conftest*
17394   eval "ac_cv_func_$ac_func=no"
17395 fi
17396 rm -f conftest*
17397 fi
17398
17399 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17400   echo "$ac_t""yes" 1>&6
17401     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17402   cat >> confdefs.h <<EOF
17403 #define $ac_tr_func 1
17404 EOF
17405  
17406 else
17407   echo "$ac_t""no" 1>&6
17408 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17409 fi
17410 done
17411
17412
17413
17414 if test "$ac_cv_func_getopt" != yes; then
17415     LIBSRCS="$LIBSRCS getopt.c"
17416 fi
17417
17418 # Check Configuration
17419 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17420 echo "configure:17421: checking declaration of sys_errlist" >&5
17421 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17422   echo $ac_n "(cached) $ac_c" 1>&6
17423 else
17424   
17425         cat > conftest.$ac_ext <<EOF
17426 #line 17427 "configure"
17427 #include "confdefs.h"
17428
17429 #include <stdio.h>
17430 #include <sys/types.h>
17431 #include <errno.h>
17432 #ifdef WINNT
17433 #include <stdlib.h>
17434 #endif 
17435 int main() {
17436 char *c = (char *) *sys_errlist
17437 ; return 0; }
17438 EOF
17439 if { (eval echo configure:17440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17440   rm -rf conftest*
17441   ol_cv_dcl_sys_errlist=yes
17442         ol_cv_have_sys_errlist=yes
17443 else
17444   echo "configure: failed program was:" >&5
17445   cat conftest.$ac_ext >&5
17446   rm -rf conftest*
17447   ol_cv_dcl_sys_errlist=no
17448 fi
17449 rm -f conftest*
17450 fi
17451
17452 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17453 #
17454 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17455 if test $ol_cv_dcl_sys_errlist = no ; then
17456         cat >> confdefs.h <<\EOF
17457 #define DECL_SYS_ERRLIST 1
17458 EOF
17459
17460
17461         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17462 echo "configure:17463: checking existence of sys_errlist" >&5
17463 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17464   echo $ac_n "(cached) $ac_c" 1>&6
17465 else
17466   
17467                 cat > conftest.$ac_ext <<EOF
17468 #line 17469 "configure"
17469 #include "confdefs.h"
17470 #include <errno.h>
17471 int main() {
17472 char *c = (char *) *sys_errlist
17473 ; return 0; }
17474 EOF
17475 if { (eval echo configure:17476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17476   rm -rf conftest*
17477   ol_cv_have_sys_errlist=yes
17478 else
17479   echo "configure: failed program was:" >&5
17480   cat conftest.$ac_ext >&5
17481   rm -rf conftest*
17482   ol_cv_have_sys_errlist=no
17483 fi
17484 rm -f conftest*
17485 fi
17486
17487 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17488 fi
17489 if test $ol_cv_have_sys_errlist = yes ; then
17490         cat >> confdefs.h <<\EOF
17491 #define HAVE_SYS_ERRLIST 1
17492 EOF
17493
17494 fi
17495
17496
17497
17498 if test "$ol_enable_debug" != no ; then
17499         cat >> confdefs.h <<\EOF
17500 #define LDAP_DEBUG 1
17501 EOF
17502
17503 fi
17504 if test "$ol_enable_syslog" = yes ; then
17505         cat >> confdefs.h <<\EOF
17506 #define LDAP_SYSLOG 1
17507 EOF
17508
17509 fi
17510 if test "$ol_enable_cache" = no ; then
17511         cat >> confdefs.h <<\EOF
17512 #define LDAP_NOCACHE 1
17513 EOF
17514
17515 fi
17516 if test "$ol_link_kbind" != no ; then
17517         cat >> confdefs.h <<\EOF
17518 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17519 EOF
17520
17521 fi
17522 if test "$ol_enable_proctitle" != no ; then
17523         cat >> confdefs.h <<\EOF
17524 #define LDAP_PROCTITLE 1
17525 EOF
17526
17527 fi
17528 if test "$ol_enable_referrals" != no ; then
17529         cat >> confdefs.h <<\EOF
17530 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17531 EOF
17532
17533 fi
17534 if test "$ol_enable_local" != no; then
17535         cat >> confdefs.h <<\EOF
17536 #define LDAP_PF_LOCAL 1
17537 EOF
17538
17539 fi
17540 if test "$ol_link_ipv6" != no; then
17541         cat >> confdefs.h <<\EOF
17542 #define LDAP_PF_INET6 1
17543 EOF
17544
17545 fi
17546 if test "$ol_enable_cleartext" != no ; then
17547         cat >> confdefs.h <<\EOF
17548 #define SLAPD_CLEARTEXT 1
17549 EOF
17550
17551 fi
17552 if test "$ol_enable_crypt" != no ; then
17553         cat >> confdefs.h <<\EOF
17554 #define SLAPD_CRYPT 1
17555 EOF
17556
17557 fi
17558 if test "$ol_link_kpasswd" != no ; then
17559         cat >> confdefs.h <<\EOF
17560 #define SLAPD_KPASSWD 1
17561 EOF
17562
17563 fi
17564 if test "$ol_link_spasswd" != no ; then
17565         cat >> confdefs.h <<\EOF
17566 #define SLAPD_SPASSWD 1
17567 EOF
17568
17569 fi
17570 if test "$ol_enable_phonetic" != no ; then
17571         cat >> confdefs.h <<\EOF
17572 #define SLAPD_PHONETIC 1
17573 EOF
17574
17575 fi
17576 if test "$ol_enable_rlookups" != no ; then
17577         cat >> confdefs.h <<\EOF
17578 #define SLAPD_RLOOKUPS 1
17579 EOF
17580
17581 fi
17582 if test "$ol_enable_aci" != no ; then
17583         cat >> confdefs.h <<\EOF
17584 #define SLAPD_ACI_ENABLED 1
17585 EOF
17586
17587 fi
17588
17589 if test "$ol_link_modules" != no ; then
17590         cat >> confdefs.h <<\EOF
17591 #define SLAPD_MODULES 1
17592 EOF
17593
17594         BUILD_SLAPD=yes
17595         SLAPD_MODULES_LDFLAGS="-dlopen self"
17596 fi
17597
17598 if test "$ol_enable_bdb" != no ; then
17599         cat >> confdefs.h <<\EOF
17600 #define SLAPD_BDB 1
17601 EOF
17602
17603         BUILD_SLAPD=yes
17604         BUILD_BDB=yes
17605         if test "$ol_with_bdb_module" != static ; then
17606                 cat >> confdefs.h <<\EOF
17607 #define SLAPD_BDB_DYNAMIC 1
17608 EOF
17609
17610                 BUILD_BDB=mod
17611                 BUILD_BDB_DYNAMIC=shared
17612                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17613         fi
17614 fi
17615
17616 if test "$ol_link_dnssrv" != no ; then
17617         cat >> confdefs.h <<\EOF
17618 #define SLAPD_DNSSRV 1
17619 EOF
17620
17621         BUILD_SLAPD=yes
17622         BUILD_DNSSRV=yes
17623         if test "$ol_with_dnssrv_module" != static ; then
17624                 cat >> confdefs.h <<\EOF
17625 #define SLAPD_DNSSRV_DYNAMIC 1
17626 EOF
17627
17628                 BUILD_DNSSRV=mod
17629                 BUILD_DNSSRV_DYNAMIC=shared
17630                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17631         fi
17632 fi
17633
17634 if test "$ol_enable_ldap" != no ; then
17635         cat >> confdefs.h <<\EOF
17636 #define SLAPD_LDAP 1
17637 EOF
17638
17639         BUILD_SLAPD=yes
17640         BUILD_LDAP=yes
17641         if test "$ol_with_ldap_module" != static ; then
17642                 cat >> confdefs.h <<\EOF
17643 #define SLAPD_LDAP_DYNAMIC 1
17644 EOF
17645
17646                 BUILD_LDAP=mod
17647                 BUILD_LDAP_DYNAMIC=shared
17648                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17649         fi
17650 fi
17651
17652 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17653         cat >> confdefs.h <<\EOF
17654 #define SLAPD_LDBM 1
17655 EOF
17656
17657         BUILD_SLAPD=yes
17658         BUILD_LDBM=yes
17659         LDBM_LIB="-lldbm"
17660         if test "$ol_with_ldbm_module" != static ; then
17661                 cat >> confdefs.h <<\EOF
17662 #define SLAPD_LDBM_DYNAMIC 1
17663 EOF
17664
17665                 BUILD_LDBM=mod
17666                 BUILD_LDBM_DYNAMIC=shared
17667                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17668         fi
17669 fi
17670
17671 if test "$ol_enable_meta" != no ; then
17672         if test "$ol_enable_ldap" = no ; then
17673                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17674         fi
17675         if test "$ol_enable_rewrite" = no ; then
17676                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17677         fi
17678         cat >> confdefs.h <<\EOF
17679 #define SLAPD_META 1
17680 EOF
17681
17682         BUILD_SLAPD=yes
17683         BUILD_META=yes
17684         if test "$ol_with_meta_module" != static ; then
17685                 cat >> confdefs.h <<\EOF
17686 #define SLAPD_META_DYNAMIC 1
17687 EOF
17688
17689                 BUILD_META=mod
17690                 BUILD_META_DYNAMIC=shared
17691                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17692         fi
17693 fi
17694
17695 if test "$ol_enable_monitor" != no ; then
17696         cat >> confdefs.h <<\EOF
17697 #define SLAPD_MONITOR 1
17698 EOF
17699
17700         BUILD_SLAPD=yes
17701         BUILD_MONITOR=yes
17702         if test "$ol_with_monitor_module" != static ; then
17703                 cat >> confdefs.h <<\EOF
17704 #define SLAPD_MONITOR_DYNAMIC 1
17705 EOF
17706
17707                 BUILD_MONITOR=mod
17708                 BUILD_MONITOR_DYNAMIC=shared
17709                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17710         fi
17711 fi
17712
17713 if test "$ol_enable_passwd" != no ; then
17714         cat >> confdefs.h <<\EOF
17715 #define SLAPD_PASSWD 1
17716 EOF
17717
17718         BUILD_SLAPD=yes
17719         BUILD_PASSWD=yes
17720         if test "$ol_with_passwd_module" != static ; then
17721                 cat >> confdefs.h <<\EOF
17722 #define SLAPD_PASSWD_DYNAMIC 1
17723 EOF
17724
17725                 BUILD_PASSWD=mod
17726                 BUILD_PASSWD_DYNAMIC=shared
17727                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17728         fi
17729 fi
17730
17731 if test "$ol_link_perl" != no ; then
17732         cat >> confdefs.h <<\EOF
17733 #define SLAPD_PERL 1
17734 EOF
17735
17736         BUILD_SLAPD=yes
17737         BUILD_PERL=yes
17738         if test "$ol_with_perl_module" != static ; then
17739                 cat >> confdefs.h <<\EOF
17740 #define SLAPD_PERL_DYNAMIC 1
17741 EOF
17742
17743                 BUILD_PERL=mod
17744                 BUILD_PERL_DYNAMIC=shared
17745                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17746         fi
17747 fi
17748
17749 if test "$ol_enable_shell" != no ; then
17750         cat >> confdefs.h <<\EOF
17751 #define SLAPD_SHELL 1
17752 EOF
17753
17754         BUILD_SLAPD=yes
17755         BUILD_SHELL=yes
17756         if test "$ol_with_shell_module" != static ; then
17757                 cat >> confdefs.h <<\EOF
17758 #define SLAPD_SHELL_DYNAMIC 1
17759 EOF
17760
17761                 BUILD_SHELL=mod
17762                 BUILD_SHELL_DYNAMIC=shared
17763                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17764         fi
17765 fi
17766
17767 if test "$ol_enable_tcl" != no ; then
17768         cat >> confdefs.h <<\EOF
17769 #define SLAPD_TCL 1
17770 EOF
17771
17772         BUILD_SLAPD=yes
17773         BUILD_TCL=yes
17774         if test "$ol_with_tcl_module" != static; then
17775                 cat >> confdefs.h <<\EOF
17776 #define SLAPD_TCL_DYNAMIC 1
17777 EOF
17778
17779                 BUILD_TCL=mod
17780                 BUILD_TCL_DYNAMIC=shared
17781                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17782         fi
17783 fi
17784
17785 if test "$ol_link_sql" != no ; then
17786         cat >> confdefs.h <<\EOF
17787 #define SLAPD_SQL 1
17788 EOF
17789
17790         BUILD_SLAPD=yes
17791         BUILD_SQL=yes
17792         if test "$ol_with_sql_module" != static; then
17793                 cat >> confdefs.h <<\EOF
17794 #define SLAPD_SQL_DYNAMIC 1
17795 EOF
17796
17797                 BUILD_SQL=mod
17798                 BUILD_SQL_DYNAMIC=shared
17799                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17800         fi
17801 fi
17802
17803 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17804         $BUILD_SLAPD = yes ; then
17805         BUILD_SLURPD=yes
17806 fi
17807
17808 if test "$ol_enable_rewrite" != no ; then
17809         cat >> confdefs.h <<\EOF
17810 #define ENABLE_REWRITE 1
17811 EOF
17812
17813         BUILD_REWRITE=yes
17814         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17815 fi
17816
17817
17818 if test "$LINK_BINS_DYNAMIC" = yes; then
17819     LIB_LINKAGE=DYN
17820     LT_LIB_LINKAGE=shared
17821 else
17822     LIB_LINKAGE=STAT
17823     LT_LIB_LINKAGE=static
17824 fi
17825
17826 if test "$ac_cv_mingw32" = yes ; then
17827     PLAT=NT
17828     DYN_EXT=dll
17829 else
17830     PLAT=UNIX
17831     DYN_EXT=so
17832 fi
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842   
17843   
17844   
17845   
17846   
17847   
17848   
17849   
17850   
17851   
17852   
17853   
17854   
17855   
17856   
17857   
17858   
17859   
17860   
17861   
17862   
17863   
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903 trap '' 1 2 15
17904
17905 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17906
17907 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17908 # Let make expand exec_prefix.
17909 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17910
17911 # Any assignment to VPATH causes Sun make to only execute
17912 # the first set of double-colon rules, so remove it if not needed.
17913 # If there is a colon in the path, we need to keep it.
17914 if test "x$srcdir" = x.; then
17915   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17916 fi
17917
17918 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17919
17920 DEFS=-DHAVE_CONFIG_H
17921
17922 # Without the "./", some shells look in PATH for config.status.
17923 : ${CONFIG_STATUS=./config.status}
17924
17925 echo creating $CONFIG_STATUS
17926 rm -f $CONFIG_STATUS
17927 cat > $CONFIG_STATUS <<EOF
17928 #! /bin/sh
17929 # Generated automatically by configure.
17930 # Run this file to recreate the current configuration.
17931 # This directory was configured as follows,
17932 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17933 #
17934 # $0 $ac_configure_args
17935 #
17936 # Compiler output produced by configure, useful for debugging
17937 # configure, is in ./config.log if it exists.
17938
17939 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17940 for ac_option
17941 do
17942   case "\$ac_option" in
17943   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17944     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17945     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17946   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17947     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17948     exit 0 ;;
17949   -help | --help | --hel | --he | --h)
17950     echo "\$ac_cs_usage"; exit 0 ;;
17951   *) echo "\$ac_cs_usage"; exit 1 ;;
17952   esac
17953 done
17954
17955 ac_given_srcdir=$srcdir
17956 ac_given_INSTALL="$INSTALL"
17957
17958 trap 'rm -fr `echo "\
17959 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17960 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17961 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17962 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17963 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17964 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17965 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17966 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17967 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17968 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17969 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17970 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17971 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17972 include/Makefile:build/top.mk:include/Makefile.in \
17973 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17974 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17975 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17976 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17977 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17978 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17979 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17980 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17981 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17982 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17983 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17984 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17985 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17986 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17987 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17988 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17989 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17990 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
17991 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17992 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17993 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17994 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17995 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17996 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17997 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17998 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17999 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18000 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18001  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18002 EOF
18003 cat >> $CONFIG_STATUS <<EOF
18004
18005 # Protect against being on the right side of a sed subst in config.status.
18006 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18007  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18008 $ac_vpsub
18009 $extrasub
18010 s%@SHELL@%$SHELL%g
18011 s%@CFLAGS@%$CFLAGS%g
18012 s%@CPPFLAGS@%$CPPFLAGS%g
18013 s%@CXXFLAGS@%$CXXFLAGS%g
18014 s%@FFLAGS@%$FFLAGS%g
18015 s%@DEFS@%$DEFS%g
18016 s%@LDFLAGS@%$LDFLAGS%g
18017 s%@LIBS@%$LIBS%g
18018 s%@exec_prefix@%$exec_prefix%g
18019 s%@prefix@%$prefix%g
18020 s%@program_transform_name@%$program_transform_name%g
18021 s%@bindir@%$bindir%g
18022 s%@sbindir@%$sbindir%g
18023 s%@libexecdir@%$libexecdir%g
18024 s%@datadir@%$datadir%g
18025 s%@sysconfdir@%$sysconfdir%g
18026 s%@sharedstatedir@%$sharedstatedir%g
18027 s%@localstatedir@%$localstatedir%g
18028 s%@libdir@%$libdir%g
18029 s%@includedir@%$includedir%g
18030 s%@oldincludedir@%$oldincludedir%g
18031 s%@infodir@%$infodir%g
18032 s%@mandir@%$mandir%g
18033 s%@host@%$host%g
18034 s%@host_alias@%$host_alias%g
18035 s%@host_cpu@%$host_cpu%g
18036 s%@host_vendor@%$host_vendor%g
18037 s%@host_os@%$host_os%g
18038 s%@target@%$target%g
18039 s%@target_alias@%$target_alias%g
18040 s%@target_cpu@%$target_cpu%g
18041 s%@target_vendor@%$target_vendor%g
18042 s%@target_os@%$target_os%g
18043 s%@build@%$build%g
18044 s%@build_alias@%$build_alias%g
18045 s%@build_cpu@%$build_cpu%g
18046 s%@build_vendor@%$build_vendor%g
18047 s%@build_os@%$build_os%g
18048 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18049 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18050 s%@INSTALL_DATA@%$INSTALL_DATA%g
18051 s%@PACKAGE@%$PACKAGE%g
18052 s%@VERSION@%$VERSION%g
18053 s%@ACLOCAL@%$ACLOCAL%g
18054 s%@AUTOCONF@%$AUTOCONF%g
18055 s%@AUTOMAKE@%$AUTOMAKE%g
18056 s%@AUTOHEADER@%$AUTOHEADER%g
18057 s%@MAKEINFO@%$MAKEINFO%g
18058 s%@install_sh@%$install_sh%g
18059 s%@AMTAR@%$AMTAR%g
18060 s%@AWK@%$AWK%g
18061 s%@AMTARFLAGS@%$AMTARFLAGS%g
18062 s%@SET_MAKE@%$SET_MAKE%g
18063 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18064 s%@top_builddir@%$top_builddir%g
18065 s%@ldap_subdir@%$ldap_subdir%g
18066 s%@CC@%$CC%g
18067 s%@RANLIB@%$RANLIB%g
18068 s%@LN_S@%$LN_S%g
18069 s%@DLLTOOL@%$DLLTOOL%g
18070 s%@AS@%$AS%g
18071 s%@OBJDUMP@%$OBJDUMP%g
18072 s%@LIBTOOL@%$LIBTOOL%g
18073 s%@LN_H@%$LN_H%g
18074 s%@SENDMAIL@%$SENDMAIL%g
18075 s%@EDITOR@%$EDITOR%g
18076 s%@FINGER@%$FINGER%g
18077 s%@PERLBIN@%$PERLBIN%g
18078 s%@CPP@%$CPP%g
18079 s%@EXEEXT@%$EXEEXT%g
18080 s%@OBJEXT@%$OBJEXT%g
18081 s%@OL_MKDEP@%$OL_MKDEP%g
18082 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18083 s%@LIBOBJS@%$LIBOBJS%g
18084 s%@LIBSRCS@%$LIBSRCS%g
18085 s%@PLAT@%$PLAT%g
18086 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
18087 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
18088 s%@DYN_EXT@%$DYN_EXT%g
18089 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18090 s%@BUILD_BDB@%$BUILD_BDB%g
18091 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18092 s%@BUILD_LDAP@%$BUILD_LDAP%g
18093 s%@BUILD_LDBM@%$BUILD_LDBM%g
18094 s%@BUILD_META@%$BUILD_META%g
18095 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18096 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18097 s%@BUILD_PERL@%$BUILD_PERL%g
18098 s%@BUILD_SHELL@%$BUILD_SHELL%g
18099 s%@BUILD_SQL@%$BUILD_SQL%g
18100 s%@BUILD_TCL@%$BUILD_TCL%g
18101 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18102 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18103 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18104 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18105 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18106 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18107 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18108 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18109 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18110 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18111 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18112 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18113 s%@LDBM_LIB@%$LDBM_LIB%g
18114 s%@LDAP_LIBS@%$LDAP_LIBS%g
18115 s%@LDIF_LIBS@%$LDIF_LIBS%g
18116 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18117 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18118 s%@LDBM_LIBS@%$LDBM_LIBS%g
18119 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18120 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18121 s%@WRAP_LIBS@%$WRAP_LIBS%g
18122 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18123 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
18124 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18125 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18126 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18127 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18128 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18129 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18130 s%@KRB4_LIBS@%$KRB4_LIBS%g
18131 s%@KRB5_LIBS@%$KRB5_LIBS%g
18132 s%@READLINE_LIBS@%$READLINE_LIBS%g
18133 s%@SASL_LIBS@%$SASL_LIBS%g
18134 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18135 s%@TLS_LIBS@%$TLS_LIBS%g
18136 s%@MODULES_LIBS@%$MODULES_LIBS%g
18137 s%@AUTH_LIBS@%$AUTH_LIBS%g
18138 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18139 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18140 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18141 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18142
18143 CEOF
18144 EOF
18145
18146 cat >> $CONFIG_STATUS <<\EOF
18147
18148 # Split the substitutions into bite-sized pieces for seds with
18149 # small command number limits, like on Digital OSF/1 and HP-UX.
18150 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18151 ac_file=1 # Number of current file.
18152 ac_beg=1 # First line for current file.
18153 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18154 ac_more_lines=:
18155 ac_sed_cmds=""
18156 while $ac_more_lines; do
18157   if test $ac_beg -gt 1; then
18158     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18159   else
18160     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18161   fi
18162   if test ! -s conftest.s$ac_file; then
18163     ac_more_lines=false
18164     rm -f conftest.s$ac_file
18165   else
18166     if test -z "$ac_sed_cmds"; then
18167       ac_sed_cmds="sed -f conftest.s$ac_file"
18168     else
18169       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18170     fi
18171     ac_file=`expr $ac_file + 1`
18172     ac_beg=$ac_end
18173     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18174   fi
18175 done
18176 if test -z "$ac_sed_cmds"; then
18177   ac_sed_cmds=cat
18178 fi
18179 EOF
18180
18181 cat >> $CONFIG_STATUS <<EOF
18182
18183 CONFIG_FILES=\${CONFIG_FILES-"\
18184 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18185 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18186 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18187 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18188 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18189 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18190 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18191 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18192 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18193 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18194 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18195 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18196 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18197 include/Makefile:build/top.mk:include/Makefile.in \
18198 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18199 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18200 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18201 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18202 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18203 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18204 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18205 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18206 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18207 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18208 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18209 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18210 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18211 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18212 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18213 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18214 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18215 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18216 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18217 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18218 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18219 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18220 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18221 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18222 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18223 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18224 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18225 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18226 "}
18227 EOF
18228 cat >> $CONFIG_STATUS <<\EOF
18229 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18230   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18231   case "$ac_file" in
18232   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18233        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18234   *) ac_file_in="${ac_file}.in" ;;
18235   esac
18236
18237   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18238
18239   # Remove last slash and all that follows it.  Not all systems have dirname.
18240   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18241   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18242     # The file is in a subdirectory.
18243     test ! -d "$ac_dir" && mkdir "$ac_dir"
18244     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18245     # A "../" for each directory in $ac_dir_suffix.
18246     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18247   else
18248     ac_dir_suffix= ac_dots=
18249   fi
18250
18251   case "$ac_given_srcdir" in
18252   .)  srcdir=.
18253       if test -z "$ac_dots"; then top_srcdir=.
18254       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18255   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18256   *) # Relative path.
18257     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18258     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18259   esac
18260
18261   case "$ac_given_INSTALL" in
18262   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18263   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18264   esac
18265
18266   echo creating "$ac_file"
18267   rm -f "$ac_file"
18268   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18269   case "$ac_file" in
18270   *[Mm]akefile*) ac_comsub="1i\\
18271 # $configure_input" ;;
18272   *) ac_comsub= ;;
18273   esac
18274
18275   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18276   sed -e "$ac_comsub
18277 s%@configure_input@%$configure_input%g
18278 s%@srcdir@%$srcdir%g
18279 s%@top_srcdir@%$top_srcdir%g
18280 s%@INSTALL@%$INSTALL%g
18281 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18282 fi; done
18283 rm -f conftest.s*
18284
18285 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18286 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18287 #
18288 # ac_d sets the value in "#define NAME VALUE" lines.
18289 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18290 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18291 ac_dC='\3'
18292 ac_dD='%g'
18293 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18294 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18295 ac_uB='\([      ]\)%\1#\2define\3'
18296 ac_uC=' '
18297 ac_uD='\4%g'
18298 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18299 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18300 ac_eB='$%\1#\2define\3'
18301 ac_eC=' '
18302 ac_eD='%g'
18303
18304 if test "${CONFIG_HEADERS+set}" != set; then
18305 EOF
18306 cat >> $CONFIG_STATUS <<EOF
18307   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18308 EOF
18309 cat >> $CONFIG_STATUS <<\EOF
18310 fi
18311 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18312   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18313   case "$ac_file" in
18314   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18315        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18316   *) ac_file_in="${ac_file}.in" ;;
18317   esac
18318
18319   echo creating $ac_file
18320
18321   rm -f conftest.frag conftest.in conftest.out
18322   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18323   cat $ac_file_inputs > conftest.in
18324
18325 EOF
18326
18327 # Transform confdefs.h into a sed script conftest.vals that substitutes
18328 # the proper values into config.h.in to produce config.h.  And first:
18329 # Protect against being on the right side of a sed subst in config.status.
18330 # Protect against being in an unquoted here document in config.status.
18331 rm -f conftest.vals
18332 cat > conftest.hdr <<\EOF
18333 s/[\\&%]/\\&/g
18334 s%[\\$`]%\\&%g
18335 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18336 s%ac_d%ac_u%gp
18337 s%ac_u%ac_e%gp
18338 EOF
18339 sed -n -f conftest.hdr confdefs.h > conftest.vals
18340 rm -f conftest.hdr
18341
18342 # This sed command replaces #undef with comments.  This is necessary, for
18343 # example, in the case of _POSIX_SOURCE, which is predefined and required
18344 # on some systems where configure will not decide to define it.
18345 cat >> conftest.vals <<\EOF
18346 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18347 EOF
18348
18349 # Break up conftest.vals because some shells have a limit on
18350 # the size of here documents, and old seds have small limits too.
18351
18352 rm -f conftest.tail
18353 while :
18354 do
18355   ac_lines=`grep -c . conftest.vals`
18356   # grep -c gives empty output for an empty file on some AIX systems.
18357   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18358   # Write a limited-size here document to conftest.frag.
18359   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18360   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18361   echo 'CEOF
18362   sed -f conftest.frag conftest.in > conftest.out
18363   rm -f conftest.in
18364   mv conftest.out conftest.in
18365 ' >> $CONFIG_STATUS
18366   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18367   rm -f conftest.vals
18368   mv conftest.tail conftest.vals
18369 done
18370 rm -f conftest.vals
18371
18372 cat >> $CONFIG_STATUS <<\EOF
18373   rm -f conftest.frag conftest.h
18374   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18375   cat conftest.in >> conftest.h
18376   rm -f conftest.in
18377   if cmp -s $ac_file conftest.h 2>/dev/null; then
18378     echo "$ac_file is unchanged"
18379     rm -f conftest.h
18380   else
18381     # Remove last slash and all that follows it.  Not all systems have dirname.
18382       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18383       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18384       # The file is in a subdirectory.
18385       test ! -d "$ac_dir" && mkdir "$ac_dir"
18386     fi
18387     rm -f $ac_file
18388     mv conftest.h $ac_file
18389   fi
18390 fi; done
18391
18392 EOF
18393 cat >> $CONFIG_STATUS <<EOF
18394
18395 EOF
18396 cat >> $CONFIG_STATUS <<\EOF
18397
18398 date > stamp-h
18399 echo Please \"make depend\" to build dependencies
18400
18401 exit 0
18402 EOF
18403 chmod +x $CONFIG_STATUS
18404 rm -fr confdefs* $ac_clean_files
18405 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18406