]> git.sur5r.net Git - openldap/blob - configure
Patches for modify/modrdn to work with BDB_USE_BINARY_RW.
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.369 2001/10/04 13:28:01 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_module = 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 in -lbind""... $ac_c" 1>&6
5832 echo "configure:5833: checking for res_query in -lbind" >&5
5833 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5835   echo $ac_n "(cached) $ac_c" 1>&6
5836 else
5837   ac_save_LIBS="$LIBS"
5838 LIBS="-lbind  $LIBS"
5839 cat > conftest.$ac_ext <<EOF
5840 #line 5841 "configure"
5841 #include "confdefs.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
5847 int main() {
5848 res_query()
5849 ; return 0; }
5850 EOF
5851 if { (eval echo configure:5852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5852   rm -rf conftest*
5853   eval "ac_cv_lib_$ac_lib_var=yes"
5854 else
5855   echo "configure: failed program was:" >&5
5856   cat conftest.$ac_ext >&5
5857   rm -rf conftest*
5858   eval "ac_cv_lib_$ac_lib_var=no"
5859 fi
5860 rm -f conftest*
5861 LIBS="$ac_save_LIBS"
5862
5863 fi
5864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5865   echo "$ac_t""yes" 1>&6
5866     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5867     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5868   cat >> confdefs.h <<EOF
5869 #define $ac_tr_lib 1
5870 EOF
5871
5872   LIBS="-lbind $LIBS"
5873
5874 else
5875   echo "$ac_t""no" 1>&6
5876 fi
5877
5878         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5879 fi
5880
5881 if test $ac_cv_func_res_query = no ; then 
5882         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5883 echo "configure:5884: checking for __res_query in -lbind" >&5
5884 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5885 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5886   echo $ac_n "(cached) $ac_c" 1>&6
5887 else
5888   ac_save_LIBS="$LIBS"
5889 LIBS="-lbind  $LIBS"
5890 cat > conftest.$ac_ext <<EOF
5891 #line 5892 "configure"
5892 #include "confdefs.h"
5893 /* Override any gcc2 internal prototype to avoid an error.  */
5894 /* We use char because int might match the return type of a gcc2
5895     builtin and then its argument prototype would still apply.  */
5896 char __res_query();
5897
5898 int main() {
5899 __res_query()
5900 ; return 0; }
5901 EOF
5902 if { (eval echo configure:5903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5903   rm -rf conftest*
5904   eval "ac_cv_lib_$ac_lib_var=yes"
5905 else
5906   echo "configure: failed program was:" >&5
5907   cat conftest.$ac_ext >&5
5908   rm -rf conftest*
5909   eval "ac_cv_lib_$ac_lib_var=no"
5910 fi
5911 rm -f conftest*
5912 LIBS="$ac_save_LIBS"
5913
5914 fi
5915 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5916   echo "$ac_t""yes" 1>&6
5917     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5918     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5919   cat >> confdefs.h <<EOF
5920 #define $ac_tr_lib 1
5921 EOF
5922
5923   LIBS="-lbind $LIBS"
5924
5925 else
5926   echo "$ac_t""no" 1>&6
5927 fi
5928
5929         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5930 fi
5931
5932 if test $ac_cv_func_res_query = no ; then 
5933         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5934 echo "configure:5935: checking for res_query in -lresolv" >&5
5935 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5936 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5937   echo $ac_n "(cached) $ac_c" 1>&6
5938 else
5939   ac_save_LIBS="$LIBS"
5940 LIBS="-lresolv  $LIBS"
5941 cat > conftest.$ac_ext <<EOF
5942 #line 5943 "configure"
5943 #include "confdefs.h"
5944 /* Override any gcc2 internal prototype to avoid an error.  */
5945 /* We use char because int might match the return type of a gcc2
5946     builtin and then its argument prototype would still apply.  */
5947 char res_query();
5948
5949 int main() {
5950 res_query()
5951 ; return 0; }
5952 EOF
5953 if { (eval echo configure:5954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5954   rm -rf conftest*
5955   eval "ac_cv_lib_$ac_lib_var=yes"
5956 else
5957   echo "configure: failed program was:" >&5
5958   cat conftest.$ac_ext >&5
5959   rm -rf conftest*
5960   eval "ac_cv_lib_$ac_lib_var=no"
5961 fi
5962 rm -f conftest*
5963 LIBS="$ac_save_LIBS"
5964
5965 fi
5966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5967   echo "$ac_t""yes" 1>&6
5968     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5969     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5970   cat >> confdefs.h <<EOF
5971 #define $ac_tr_lib 1
5972 EOF
5973
5974   LIBS="-lresolv $LIBS"
5975
5976 else
5977   echo "$ac_t""no" 1>&6
5978 fi
5979
5980         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5981 fi
5982
5983 if test "$ac_cv_func_res_query" = yes ; then
5984         cat >> confdefs.h <<\EOF
5985 #define HAVE_RES_QUERY 1
5986 EOF
5987
5988
5989         if test $ol_enable_dnssrv != no ; then
5990                 ol_link_dnssrv=yes
5991         fi
5992 fi
5993
5994 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5995         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5996 fi
5997
5998 for ac_func in getaddrinfo inet_ntop 
5999 do
6000 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6001 echo "configure:6002: checking for $ac_func" >&5
6002 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6003   echo $ac_n "(cached) $ac_c" 1>&6
6004 else
6005   cat > conftest.$ac_ext <<EOF
6006 #line 6007 "configure"
6007 #include "confdefs.h"
6008 /* System header to define __stub macros and hopefully few prototypes,
6009     which can conflict with char $ac_func(); below.  */
6010 #include <assert.h>
6011 /* Override any gcc2 internal prototype to avoid an error.  */
6012 /* We use char because int might match the return type of a gcc2
6013     builtin and then its argument prototype would still apply.  */
6014 char $ac_func();
6015 char (*f)();
6016
6017 int main() {
6018
6019 /* The GNU C library defines this for functions which it implements
6020     to always fail with ENOSYS.  Some functions are actually named
6021     something starting with __ and the normal name is an alias.  */
6022 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6023 choke me
6024 #else
6025 f = $ac_func;
6026 #endif
6027
6028 ; return 0; }
6029 EOF
6030 if { (eval echo configure:6031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6031   rm -rf conftest*
6032   eval "ac_cv_func_$ac_func=yes"
6033 else
6034   echo "configure: failed program was:" >&5
6035   cat conftest.$ac_ext >&5
6036   rm -rf conftest*
6037   eval "ac_cv_func_$ac_func=no"
6038 fi
6039 rm -f conftest*
6040 fi
6041
6042 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6043   echo "$ac_t""yes" 1>&6
6044     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6045   cat >> confdefs.h <<EOF
6046 #define $ac_tr_func 1
6047 EOF
6048  
6049 else
6050   echo "$ac_t""no" 1>&6
6051 fi
6052 done
6053
6054
6055 ol_link_ipv6=no
6056 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6057         if test $ol_enable_ipv6 = yes ; then
6058                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6059         fi
6060 else
6061         for ac_func in gai_strerror 
6062 do
6063 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6064 echo "configure:6065: checking for $ac_func" >&5
6065 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6066   echo $ac_n "(cached) $ac_c" 1>&6
6067 else
6068   cat > conftest.$ac_ext <<EOF
6069 #line 6070 "configure"
6070 #include "confdefs.h"
6071 /* System header to define __stub macros and hopefully few prototypes,
6072     which can conflict with char $ac_func(); below.  */
6073 #include <assert.h>
6074 /* Override any gcc2 internal prototype to avoid an error.  */
6075 /* We use char because int might match the return type of a gcc2
6076     builtin and then its argument prototype would still apply.  */
6077 char $ac_func();
6078 char (*f)();
6079
6080 int main() {
6081
6082 /* The GNU C library defines this for functions which it implements
6083     to always fail with ENOSYS.  Some functions are actually named
6084     something starting with __ and the normal name is an alias.  */
6085 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6086 choke me
6087 #else
6088 f = $ac_func;
6089 #endif
6090
6091 ; return 0; }
6092 EOF
6093 if { (eval echo configure:6094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6094   rm -rf conftest*
6095   eval "ac_cv_func_$ac_func=yes"
6096 else
6097   echo "configure: failed program was:" >&5
6098   cat conftest.$ac_ext >&5
6099   rm -rf conftest*
6100   eval "ac_cv_func_$ac_func=no"
6101 fi
6102 rm -f conftest*
6103 fi
6104
6105 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6106   echo "$ac_t""yes" 1>&6
6107     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6108   cat >> confdefs.h <<EOF
6109 #define $ac_tr_func 1
6110 EOF
6111  
6112 else
6113   echo "$ac_t""no" 1>&6
6114 fi
6115 done
6116
6117
6118         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6119 echo "configure:6120: checking INET6_ADDRSTRLEN" >&5
6120 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6121   echo $ac_n "(cached) $ac_c" 1>&6
6122 else
6123   
6124                 cat > conftest.$ac_ext <<EOF
6125 #line 6126 "configure"
6126 #include "confdefs.h"
6127
6128 #                       include <netinet/in.h>
6129 #                       ifdef INET6_ADDRSTRLEN
6130                                 __has_inet6_addrstrlen__;
6131 #                       endif
6132                 
6133 EOF
6134 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6135   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6136   rm -rf conftest*
6137   ol_cv_inet6_addrstrlen=yes
6138 else
6139   rm -rf conftest*
6140   ol_cv_inet6_addrstrlen=no
6141 fi
6142 rm -f conftest*
6143
6144 fi
6145
6146 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6147
6148         if test $ol_cv_inet6_addrstrlen = yes ; then
6149                 ol_link_ipv6=yes
6150         elif test $ol_enable_ipv6 = yes ; then
6151                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6152         fi
6153 fi
6154
6155 if test $ol_enable_local != no ; then
6156         for ac_hdr in sys/un.h 
6157 do
6158 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6159 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6160 echo "configure:6161: checking for $ac_hdr" >&5
6161 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6162   echo $ac_n "(cached) $ac_c" 1>&6
6163 else
6164   cat > conftest.$ac_ext <<EOF
6165 #line 6166 "configure"
6166 #include "confdefs.h"
6167 #include <$ac_hdr>
6168 EOF
6169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6170 { (eval echo configure:6171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6172 if test -z "$ac_err"; then
6173   rm -rf conftest*
6174   eval "ac_cv_header_$ac_safe=yes"
6175 else
6176   echo "$ac_err" >&5
6177   echo "configure: failed program was:" >&5
6178   cat conftest.$ac_ext >&5
6179   rm -rf conftest*
6180   eval "ac_cv_header_$ac_safe=no"
6181 fi
6182 rm -f conftest*
6183 fi
6184 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6185   echo "$ac_t""yes" 1>&6
6186     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6187   cat >> confdefs.h <<EOF
6188 #define $ac_tr_hdr 1
6189 EOF
6190  
6191 else
6192   echo "$ac_t""no" 1>&6
6193 fi
6194 done
6195
6196
6197         if test $ol_enable_local = auto ; then
6198                 ol_enable_local=$ac_cv_header_sys_un_h
6199         elif test $ac_cv_header_sys_un_h = no ; then
6200                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6201         fi
6202 fi
6203
6204 ol_link_kbind=no
6205 ol_link_kpasswd=no
6206 ol_link_krb5=no
6207 ol_link_krb4=no
6208
6209 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6210         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6211         -o $ol_with_kerberos = k425 ; then
6212
6213         for ac_hdr in krb5.h
6214 do
6215 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6216 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6217 echo "configure:6218: checking for $ac_hdr" >&5
6218 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6219   echo $ac_n "(cached) $ac_c" 1>&6
6220 else
6221   cat > conftest.$ac_ext <<EOF
6222 #line 6223 "configure"
6223 #include "confdefs.h"
6224 #include <$ac_hdr>
6225 EOF
6226 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6227 { (eval echo configure:6228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6228 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6229 if test -z "$ac_err"; then
6230   rm -rf conftest*
6231   eval "ac_cv_header_$ac_safe=yes"
6232 else
6233   echo "$ac_err" >&5
6234   echo "configure: failed program was:" >&5
6235   cat conftest.$ac_ext >&5
6236   rm -rf conftest*
6237   eval "ac_cv_header_$ac_safe=no"
6238 fi
6239 rm -f conftest*
6240 fi
6241 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6242   echo "$ac_t""yes" 1>&6
6243     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6244   cat >> confdefs.h <<EOF
6245 #define $ac_tr_hdr 1
6246 EOF
6247  
6248 else
6249   echo "$ac_t""no" 1>&6
6250 fi
6251 done
6252
6253
6254         if test $ac_cv_header_krb5_h = yes ; then
6255                                 for ac_hdr in heim_err.h
6256 do
6257 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6258 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6259 echo "configure:6260: checking for $ac_hdr" >&5
6260 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6261   echo $ac_n "(cached) $ac_c" 1>&6
6262 else
6263   cat > conftest.$ac_ext <<EOF
6264 #line 6265 "configure"
6265 #include "confdefs.h"
6266 #include <$ac_hdr>
6267 EOF
6268 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6269 { (eval echo configure:6270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6270 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6271 if test -z "$ac_err"; then
6272   rm -rf conftest*
6273   eval "ac_cv_header_$ac_safe=yes"
6274 else
6275   echo "$ac_err" >&5
6276   echo "configure: failed program was:" >&5
6277   cat conftest.$ac_ext >&5
6278   rm -rf conftest*
6279   eval "ac_cv_header_$ac_safe=no"
6280 fi
6281 rm -f conftest*
6282 fi
6283 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6284   echo "$ac_t""yes" 1>&6
6285     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6286   cat >> confdefs.h <<EOF
6287 #define $ac_tr_hdr 1
6288 EOF
6289  
6290 else
6291   echo "$ac_t""no" 1>&6
6292 fi
6293 done
6294
6295                 if test $ac_cv_header_heim_err_h = yes ; then
6296                         krb5_impl=heimdal
6297                 else
6298                         krb5_impl=mit
6299                 fi
6300
6301                 if test $krb5_impl = mit; then
6302                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6303 echo "configure:6304: checking for main in -lk5crypto" >&5
6304 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6305 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6306   echo $ac_n "(cached) $ac_c" 1>&6
6307 else
6308   ac_save_LIBS="$LIBS"
6309 LIBS="-lk5crypto  $LIBS"
6310 cat > conftest.$ac_ext <<EOF
6311 #line 6312 "configure"
6312 #include "confdefs.h"
6313
6314 int main() {
6315 main()
6316 ; return 0; }
6317 EOF
6318 if { (eval echo configure:6319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6319   rm -rf conftest*
6320   eval "ac_cv_lib_$ac_lib_var=yes"
6321 else
6322   echo "configure: failed program was:" >&5
6323   cat conftest.$ac_ext >&5
6324   rm -rf conftest*
6325   eval "ac_cv_lib_$ac_lib_var=no"
6326 fi
6327 rm -f conftest*
6328 LIBS="$ac_save_LIBS"
6329
6330 fi
6331 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6332   echo "$ac_t""yes" 1>&6
6333   krb5crypto=k5crypto
6334 else
6335   echo "$ac_t""no" 1>&6
6336 krb5crypto=crypto
6337 fi
6338
6339
6340                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6341 echo "configure:6342: checking for main in -lkrb5" >&5
6342 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6343 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6344   echo $ac_n "(cached) $ac_c" 1>&6
6345 else
6346   ac_save_LIBS="$LIBS"
6347 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6348 cat > conftest.$ac_ext <<EOF
6349 #line 6350 "configure"
6350 #include "confdefs.h"
6351
6352 int main() {
6353 main()
6354 ; return 0; }
6355 EOF
6356 if { (eval echo configure:6357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6357   rm -rf conftest*
6358   eval "ac_cv_lib_$ac_lib_var=yes"
6359 else
6360   echo "configure: failed program was:" >&5
6361   cat conftest.$ac_ext >&5
6362   rm -rf conftest*
6363   eval "ac_cv_lib_$ac_lib_var=no"
6364 fi
6365 rm -f conftest*
6366 LIBS="$ac_save_LIBS"
6367
6368 fi
6369 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6370   echo "$ac_t""yes" 1>&6
6371   have_krb5=yes
6372                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6373 else
6374   echo "$ac_t""no" 1>&6
6375 have_krb5=no
6376 fi
6377
6378
6379                 elif test $krb5_impl = heimdal; then
6380                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6381 echo "configure:6382: checking for main in -lkrb5" >&5
6382 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6383 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6384   echo $ac_n "(cached) $ac_c" 1>&6
6385 else
6386   ac_save_LIBS="$LIBS"
6387 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6388 cat > conftest.$ac_ext <<EOF
6389 #line 6390 "configure"
6390 #include "confdefs.h"
6391
6392 int main() {
6393 main()
6394 ; return 0; }
6395 EOF
6396 if { (eval echo configure:6397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6397   rm -rf conftest*
6398   eval "ac_cv_lib_$ac_lib_var=yes"
6399 else
6400   echo "configure: failed program was:" >&5
6401   cat conftest.$ac_ext >&5
6402   rm -rf conftest*
6403   eval "ac_cv_lib_$ac_lib_var=no"
6404 fi
6405 rm -f conftest*
6406 LIBS="$ac_save_LIBS"
6407
6408 fi
6409 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6410   echo "$ac_t""yes" 1>&6
6411   have_krb5=yes
6412                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6413 else
6414   echo "$ac_t""no" 1>&6
6415 have_krb5=no
6416 fi
6417
6418
6419                         cat >> confdefs.h <<\EOF
6420 #define HAVE_HEIMDAL_KERBEROS 1
6421 EOF
6422
6423
6424                 else
6425                         have_krb5=no
6426                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6427                 fi
6428
6429                 if test $have_krb5 = yes ; then
6430                         ol_link_krb5=yes
6431
6432                         cat >> confdefs.h <<\EOF
6433 #define HAVE_KRB5 1
6434 EOF
6435
6436
6437                         if test $ol_enable_kpasswd != no ; then
6438                                 ol_link_kpasswd=yes;
6439                         fi
6440
6441                         if test $ol_with_kerberos = k5only ; then
6442                                 ol_with_kerberos=found
6443                         fi
6444
6445                 elif test $ol_with_kerberos != auto ; then
6446                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6447                 fi
6448
6449         fi
6450 fi
6451
6452 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6453         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6454
6455         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6456 do
6457 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6458 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6459 echo "configure:6460: checking for $ac_hdr" >&5
6460 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6461   echo $ac_n "(cached) $ac_c" 1>&6
6462 else
6463   cat > conftest.$ac_ext <<EOF
6464 #line 6465 "configure"
6465 #include "confdefs.h"
6466 #include <$ac_hdr>
6467 EOF
6468 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6469 { (eval echo configure:6470: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6470 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6471 if test -z "$ac_err"; then
6472   rm -rf conftest*
6473   eval "ac_cv_header_$ac_safe=yes"
6474 else
6475   echo "$ac_err" >&5
6476   echo "configure: failed program was:" >&5
6477   cat conftest.$ac_ext >&5
6478   rm -rf conftest*
6479   eval "ac_cv_header_$ac_safe=no"
6480 fi
6481 rm -f conftest*
6482 fi
6483 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6484   echo "$ac_t""yes" 1>&6
6485     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6486   cat >> confdefs.h <<EOF
6487 #define $ac_tr_hdr 1
6488 EOF
6489  
6490 else
6491   echo "$ac_t""no" 1>&6
6492 fi
6493 done
6494
6495
6496         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6497                 if test $krb5_impl = mit; then
6498                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6499 echo "configure:6500: checking for main in -lkrb4" >&5
6500 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6501 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6502   echo $ac_n "(cached) $ac_c" 1>&6
6503 else
6504   ac_save_LIBS="$LIBS"
6505 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6506 cat > conftest.$ac_ext <<EOF
6507 #line 6508 "configure"
6508 #include "confdefs.h"
6509
6510 int main() {
6511 main()
6512 ; return 0; }
6513 EOF
6514 if { (eval echo configure:6515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6515   rm -rf conftest*
6516   eval "ac_cv_lib_$ac_lib_var=yes"
6517 else
6518   echo "configure: failed program was:" >&5
6519   cat conftest.$ac_ext >&5
6520   rm -rf conftest*
6521   eval "ac_cv_lib_$ac_lib_var=no"
6522 fi
6523 rm -f conftest*
6524 LIBS="$ac_save_LIBS"
6525
6526 fi
6527 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6528   echo "$ac_t""yes" 1>&6
6529   have_k425=yes
6530                                 KRB4_LIBS="-lkrb4 -ldes425"
6531 else
6532   echo "$ac_t""no" 1>&6
6533 have_k425=no
6534 fi
6535
6536
6537                 elif test $krb5_impl = heimdal; then
6538                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6539 echo "configure:6540: checking for main in -lkrb4" >&5
6540 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6541 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6542   echo $ac_n "(cached) $ac_c" 1>&6
6543 else
6544   ac_save_LIBS="$LIBS"
6545 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6546 cat > conftest.$ac_ext <<EOF
6547 #line 6548 "configure"
6548 #include "confdefs.h"
6549
6550 int main() {
6551 main()
6552 ; return 0; }
6553 EOF
6554 if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6555   rm -rf conftest*
6556   eval "ac_cv_lib_$ac_lib_var=yes"
6557 else
6558   echo "configure: failed program was:" >&5
6559   cat conftest.$ac_ext >&5
6560   rm -rf conftest*
6561   eval "ac_cv_lib_$ac_lib_var=no"
6562 fi
6563 rm -f conftest*
6564 LIBS="$ac_save_LIBS"
6565
6566 fi
6567 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6568   echo "$ac_t""yes" 1>&6
6569   have_k425=yes
6570                                 KRB4_LIBS="-lkrb4"
6571 else
6572   echo "$ac_t""no" 1>&6
6573 have_k425=no
6574 fi
6575
6576
6577                 else
6578                         have_425=no
6579                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6580                 fi
6581
6582                 if test $have_k425 = yes ; then
6583                         ol_with_kerberos=found
6584                         ol_link_krb4=yes
6585
6586                         cat >> confdefs.h <<\EOF
6587 #define HAVE_KRB425 1
6588 EOF
6589
6590                         cat >> confdefs.h <<\EOF
6591 #define HAVE_KRB4 1
6592 EOF
6593
6594
6595                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6596 echo "configure:6597: checking for des_debug in Kerberos libraries" >&5
6597 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6598   echo $ac_n "(cached) $ac_c" 1>&6
6599 else
6600   
6601                                                                 save_LIBS="$LIBS"
6602                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6603                                 cat > conftest.$ac_ext <<EOF
6604 #line 6605 "configure"
6605 #include "confdefs.h"
6606
6607 #include <kerberosIV/krb.h>
6608 #include <kerberosIV/des.h>
6609 extern int des_debug;
6610
6611 int main() {
6612
6613 des_debug = 1;
6614
6615 ; return 0; }
6616 EOF
6617 if { (eval echo configure:6618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6618   rm -rf conftest*
6619   ol_cv_var_des_debug=yes
6620 else
6621   echo "configure: failed program was:" >&5
6622   cat conftest.$ac_ext >&5
6623   rm -rf conftest*
6624   ol_cv_var_des_debug=no
6625 fi
6626 rm -f conftest*
6627                                                                 LIBS="$save_LIBS"
6628                         
6629 fi
6630
6631 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6632
6633                         if test $ol_cv_var_des_debug = yes ; then
6634                                 cat >> confdefs.h <<\EOF
6635 #define HAVE_DES_DEBUG 1
6636 EOF
6637
6638                         fi
6639
6640                         LIBS="$save_LIBS"
6641                 fi
6642         fi
6643 fi
6644
6645 if test $ol_link_krb5 = yes ; then
6646         ol_with_kerberos=found
6647 fi
6648
6649 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6650         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6651
6652         for ac_hdr in krb.h des.h krb-archaeology.h 
6653 do
6654 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6655 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6656 echo "configure:6657: checking for $ac_hdr" >&5
6657 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6658   echo $ac_n "(cached) $ac_c" 1>&6
6659 else
6660   cat > conftest.$ac_ext <<EOF
6661 #line 6662 "configure"
6662 #include "confdefs.h"
6663 #include <$ac_hdr>
6664 EOF
6665 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6666 { (eval echo configure:6667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6667 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6668 if test -z "$ac_err"; then
6669   rm -rf conftest*
6670   eval "ac_cv_header_$ac_safe=yes"
6671 else
6672   echo "$ac_err" >&5
6673   echo "configure: failed program was:" >&5
6674   cat conftest.$ac_ext >&5
6675   rm -rf conftest*
6676   eval "ac_cv_header_$ac_safe=no"
6677 fi
6678 rm -f conftest*
6679 fi
6680 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6681   echo "$ac_t""yes" 1>&6
6682     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6683   cat >> confdefs.h <<EOF
6684 #define $ac_tr_hdr 1
6685 EOF
6686  
6687 else
6688   echo "$ac_t""no" 1>&6
6689 fi
6690 done
6691
6692
6693         if test $ac_cv_header_krb_h = yes ; then
6694                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6695 echo "configure:6696: checking for main in -lkrb" >&5
6696 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6697 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6698   echo $ac_n "(cached) $ac_c" 1>&6
6699 else
6700   ac_save_LIBS="$LIBS"
6701 LIBS="-lkrb -ldes $LIBS"
6702 cat > conftest.$ac_ext <<EOF
6703 #line 6704 "configure"
6704 #include "confdefs.h"
6705
6706 int main() {
6707 main()
6708 ; return 0; }
6709 EOF
6710 if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6711   rm -rf conftest*
6712   eval "ac_cv_lib_$ac_lib_var=yes"
6713 else
6714   echo "configure: failed program was:" >&5
6715   cat conftest.$ac_ext >&5
6716   rm -rf conftest*
6717   eval "ac_cv_lib_$ac_lib_var=no"
6718 fi
6719 rm -f conftest*
6720 LIBS="$ac_save_LIBS"
6721
6722 fi
6723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6724   echo "$ac_t""yes" 1>&6
6725   have_k4=yes
6726 else
6727   echo "$ac_t""no" 1>&6
6728 have_k4=no
6729 fi
6730
6731
6732                 if test $have_k4 = yes ; then
6733                         ol_with_kerberos=found
6734                         ol_link_krb4=yes
6735
6736                         cat >> confdefs.h <<\EOF
6737 #define HAVE_KRB4 1
6738 EOF
6739
6740
6741                         KRB4_LIBS="-lkrb -ldes"
6742
6743                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6744                                 cat >> confdefs.h <<\EOF
6745 #define HAVE_KTH_KERBEROS 1
6746 EOF
6747
6748                         fi
6749                 fi
6750         fi
6751 fi
6752
6753 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6754         ol_link_kpasswd=yes
6755 fi
6756
6757 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6758         ol_link_kbind=yes
6759
6760 elif test $ol_enable_kbind = yes ; then
6761         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6762 fi
6763
6764 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6765         cat >> confdefs.h <<\EOF
6766 #define HAVE_KERBEROS 1
6767 EOF
6768
6769
6770 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6771         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6772 fi
6773
6774 ol_link_tls=no
6775 if test $ol_with_tls != no ; then
6776         for ac_hdr in openssl/ssl.h ssl.h
6777 do
6778 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6779 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6780 echo "configure:6781: checking for $ac_hdr" >&5
6781 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6782   echo $ac_n "(cached) $ac_c" 1>&6
6783 else
6784   cat > conftest.$ac_ext <<EOF
6785 #line 6786 "configure"
6786 #include "confdefs.h"
6787 #include <$ac_hdr>
6788 EOF
6789 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6790 { (eval echo configure:6791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6791 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6792 if test -z "$ac_err"; then
6793   rm -rf conftest*
6794   eval "ac_cv_header_$ac_safe=yes"
6795 else
6796   echo "$ac_err" >&5
6797   echo "configure: failed program was:" >&5
6798   cat conftest.$ac_ext >&5
6799   rm -rf conftest*
6800   eval "ac_cv_header_$ac_safe=no"
6801 fi
6802 rm -f conftest*
6803 fi
6804 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6805   echo "$ac_t""yes" 1>&6
6806     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6807   cat >> confdefs.h <<EOF
6808 #define $ac_tr_hdr 1
6809 EOF
6810  
6811 else
6812   echo "$ac_t""no" 1>&6
6813 fi
6814 done
6815
6816         
6817         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6818                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6819 echo "configure:6820: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6820 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6821 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6822   echo $ac_n "(cached) $ac_c" 1>&6
6823 else
6824   ac_save_LIBS="$LIBS"
6825 LIBS="-lssl -lcrypto $LIBS"
6826 cat > conftest.$ac_ext <<EOF
6827 #line 6828 "configure"
6828 #include "confdefs.h"
6829 /* Override any gcc2 internal prototype to avoid an error.  */
6830 /* We use char because int might match the return type of a gcc2
6831     builtin and then its argument prototype would still apply.  */
6832 char SSLeay_add_ssl_algorithms();
6833
6834 int main() {
6835 SSLeay_add_ssl_algorithms()
6836 ; return 0; }
6837 EOF
6838 if { (eval echo configure:6839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6839   rm -rf conftest*
6840   eval "ac_cv_lib_$ac_lib_var=yes"
6841 else
6842   echo "configure: failed program was:" >&5
6843   cat conftest.$ac_ext >&5
6844   rm -rf conftest*
6845   eval "ac_cv_lib_$ac_lib_var=no"
6846 fi
6847 rm -f conftest*
6848 LIBS="$ac_save_LIBS"
6849
6850 fi
6851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6852   echo "$ac_t""yes" 1>&6
6853   have_ssleay=yes
6854                         need_rsaref=no
6855 else
6856   echo "$ac_t""no" 1>&6
6857 have_ssleay=no
6858 fi
6859
6860                         
6861                 if test $have_ssleay = no ; then
6862                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6863 echo "configure:6864: checking for SSL_library_init in -lssl" >&5
6864 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6866   echo $ac_n "(cached) $ac_c" 1>&6
6867 else
6868   ac_save_LIBS="$LIBS"
6869 LIBS="-lssl -lcrypto $LIBS"
6870 cat > conftest.$ac_ext <<EOF
6871 #line 6872 "configure"
6872 #include "confdefs.h"
6873 /* Override any gcc2 internal prototype to avoid an error.  */
6874 /* We use char because int might match the return type of a gcc2
6875     builtin and then its argument prototype would still apply.  */
6876 char SSL_library_init();
6877
6878 int main() {
6879 SSL_library_init()
6880 ; return 0; }
6881 EOF
6882 if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6883   rm -rf conftest*
6884   eval "ac_cv_lib_$ac_lib_var=yes"
6885 else
6886   echo "configure: failed program was:" >&5
6887   cat conftest.$ac_ext >&5
6888   rm -rf conftest*
6889   eval "ac_cv_lib_$ac_lib_var=no"
6890 fi
6891 rm -f conftest*
6892 LIBS="$ac_save_LIBS"
6893
6894 fi
6895 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6896   echo "$ac_t""yes" 1>&6
6897   have_ssleay=yes
6898                                 need_rsaref=no
6899 else
6900   echo "$ac_t""no" 1>&6
6901 have_ssleay=no
6902 fi
6903
6904                 fi
6905
6906                 if test $have_ssleay = no ; then
6907                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6908 echo "configure:6909: checking for ssl3_accept in -lssl" >&5
6909 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6910 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6911   echo $ac_n "(cached) $ac_c" 1>&6
6912 else
6913   ac_save_LIBS="$LIBS"
6914 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6915 cat > conftest.$ac_ext <<EOF
6916 #line 6917 "configure"
6917 #include "confdefs.h"
6918 /* Override any gcc2 internal prototype to avoid an error.  */
6919 /* We use char because int might match the return type of a gcc2
6920     builtin and then its argument prototype would still apply.  */
6921 char ssl3_accept();
6922
6923 int main() {
6924 ssl3_accept()
6925 ; return 0; }
6926 EOF
6927 if { (eval echo configure:6928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6928   rm -rf conftest*
6929   eval "ac_cv_lib_$ac_lib_var=yes"
6930 else
6931   echo "configure: failed program was:" >&5
6932   cat conftest.$ac_ext >&5
6933   rm -rf conftest*
6934   eval "ac_cv_lib_$ac_lib_var=no"
6935 fi
6936 rm -f conftest*
6937 LIBS="$ac_save_LIBS"
6938
6939 fi
6940 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6941   echo "$ac_t""yes" 1>&6
6942   have_ssleay=yes
6943                                 need_rsaref=yes
6944 else
6945   echo "$ac_t""no" 1>&6
6946 have_ssleay=no
6947 fi
6948
6949                 fi
6950
6951                 if test $have_ssleay = yes ; then
6952                         ol_with_tls=found
6953                         ol_link_tls=yes
6954
6955                         cat >> confdefs.h <<\EOF
6956 #define HAVE_SSLEAY 1
6957 EOF
6958
6959
6960                         if test $need_rsaref = yes; then
6961                                 cat >> confdefs.h <<\EOF
6962 #define HAVE_RSAREF 1
6963 EOF
6964
6965
6966                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6967                         else
6968                                 TLS_LIBS="-lssl -lcrypto"
6969                         fi
6970                 fi
6971         fi
6972
6973 else
6974         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6975 fi
6976
6977 if test $ol_link_tls = yes ; then
6978         cat >> confdefs.h <<\EOF
6979 #define HAVE_TLS 1
6980 EOF
6981
6982
6983 elif test $ol_with_tls = auto ; then
6984         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6985         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6986
6987 elif test $ol_with_tls != no ; then
6988         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6989 fi
6990
6991 if test $ol_enable_lmpasswd != no; then
6992         if test $ol_link_tls != yes ; then
6993                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
6994         fi
6995
6996         cat >> confdefs.h <<\EOF
6997 #define SLAPD_LMHASH 1
6998 EOF
6999
7000 fi
7001
7002 for ac_func in \
7003         ctime_r                 \
7004         gethostbyname_r gethostbyaddr_r \
7005
7006 do
7007 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7008 echo "configure:7009: checking for $ac_func" >&5
7009 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7010   echo $ac_n "(cached) $ac_c" 1>&6
7011 else
7012   cat > conftest.$ac_ext <<EOF
7013 #line 7014 "configure"
7014 #include "confdefs.h"
7015 /* System header to define __stub macros and hopefully few prototypes,
7016     which can conflict with char $ac_func(); below.  */
7017 #include <assert.h>
7018 /* Override any gcc2 internal prototype to avoid an error.  */
7019 /* We use char because int might match the return type of a gcc2
7020     builtin and then its argument prototype would still apply.  */
7021 char $ac_func();
7022 char (*f)();
7023
7024 int main() {
7025
7026 /* The GNU C library defines this for functions which it implements
7027     to always fail with ENOSYS.  Some functions are actually named
7028     something starting with __ and the normal name is an alias.  */
7029 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7030 choke me
7031 #else
7032 f = $ac_func;
7033 #endif
7034
7035 ; return 0; }
7036 EOF
7037 if { (eval echo configure:7038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7038   rm -rf conftest*
7039   eval "ac_cv_func_$ac_func=yes"
7040 else
7041   echo "configure: failed program was:" >&5
7042   cat conftest.$ac_ext >&5
7043   rm -rf conftest*
7044   eval "ac_cv_func_$ac_func=no"
7045 fi
7046 rm -f conftest*
7047 fi
7048
7049 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7050   echo "$ac_t""yes" 1>&6
7051     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7052   cat >> confdefs.h <<EOF
7053 #define $ac_tr_func 1
7054 EOF
7055  
7056 else
7057   echo "$ac_t""no" 1>&6
7058 fi
7059 done
7060
7061
7062 if test "$ac_cv_func_ctime_r" = no ; then
7063         ol_cv_func_ctime_r_nargs=0
7064 else
7065         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7066 echo "configure:7067: checking number of arguments of ctime_r" >&5
7067 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7068   echo $ac_n "(cached) $ac_c" 1>&6
7069 else
7070   cat > conftest.$ac_ext <<EOF
7071 #line 7072 "configure"
7072 #include "confdefs.h"
7073 #include <time.h>
7074 int main() {
7075 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7076 ; return 0; }
7077 EOF
7078 if { (eval echo configure:7079: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7079   rm -rf conftest*
7080   ol_cv_func_ctime_r_nargs3=yes
7081 else
7082   echo "configure: failed program was:" >&5
7083   cat conftest.$ac_ext >&5
7084   rm -rf conftest*
7085   ol_cv_func_ctime_r_nargs3=no
7086 fi
7087 rm -f conftest*
7088
7089         cat > conftest.$ac_ext <<EOF
7090 #line 7091 "configure"
7091 #include "confdefs.h"
7092 #include <time.h>
7093 int main() {
7094 time_t ti; char *buffer; ctime_r(&ti,buffer);
7095 ; return 0; }
7096 EOF
7097 if { (eval echo configure:7098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7098   rm -rf conftest*
7099   ol_cv_func_ctime_r_nargs2=yes
7100 else
7101   echo "configure: failed program was:" >&5
7102   cat conftest.$ac_ext >&5
7103   rm -rf conftest*
7104   ol_cv_func_ctime_r_nargs2=no
7105 fi
7106 rm -f conftest*
7107
7108         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7109                 $ol_cv_func_ctime_r_nargs2 = no ; then
7110
7111                 ol_cv_func_ctime_r_nargs=3
7112
7113         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7114                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7115
7116                 ol_cv_func_ctime_r_nargs=2
7117
7118         else
7119                 ol_cv_func_ctime_r_nargs=0
7120         fi
7121   
7122 fi
7123
7124 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7125
7126   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7127         cat >> confdefs.h <<EOF
7128 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7129 EOF
7130
7131   fi
7132
7133 fi
7134
7135 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7136         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7137 echo "configure:7138: checking number of arguments of gethostbyname_r" >&5
7138 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7139   echo $ac_n "(cached) $ac_c" 1>&6
7140 else
7141   cat > conftest.$ac_ext <<EOF
7142 #line 7143 "configure"
7143 #include "confdefs.h"
7144 #include <sys/types.h>
7145 #include <sys/socket.h>
7146 #include <netinet/in.h>
7147 #include <netdb.h>
7148 #define BUFSIZE (sizeof(struct hostent)+10)
7149 int main() {
7150 struct hostent hent; char buffer[BUFSIZE];
7151                 int bufsize=BUFSIZE;int h_errno;
7152                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7153                         buffer, bufsize, &h_errno);
7154 ; return 0; }
7155 EOF
7156 if { (eval echo configure:7157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7157   rm -rf conftest*
7158   ol_cv_func_gethostbyname_r_nargs5=yes
7159 else
7160   echo "configure: failed program was:" >&5
7161   cat conftest.$ac_ext >&5
7162   rm -rf conftest*
7163   ol_cv_func_gethostbyname_r_nargs5=no
7164 fi
7165 rm -f conftest*
7166
7167         cat > conftest.$ac_ext <<EOF
7168 #line 7169 "configure"
7169 #include "confdefs.h"
7170 #include <sys/types.h>
7171 #include <sys/socket.h>
7172 #include <netinet/in.h>
7173 #include <netdb.h>
7174 #define BUFSIZE (sizeof(struct hostent)+10)
7175 int main() {
7176 struct hostent hent;struct hostent *rhent;
7177                 char buffer[BUFSIZE];
7178                 int bufsize=BUFSIZE;int h_errno;
7179                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7180                         &rhent, &h_errno);
7181 ; return 0; }
7182 EOF
7183 if { (eval echo configure:7184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7184   rm -rf conftest*
7185   ol_cv_func_gethostbyname_r_nargs6=yes
7186 else
7187   echo "configure: failed program was:" >&5
7188   cat conftest.$ac_ext >&5
7189   rm -rf conftest*
7190   ol_cv_func_gethostbyname_r_nargs6=no
7191 fi
7192 rm -f conftest*
7193
7194         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7195                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7196
7197                 ol_cv_func_gethostbyname_r_nargs=5
7198
7199         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7200                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7201
7202                 ol_cv_func_gethostbyname_r_nargs=6
7203
7204         else
7205                 ol_cv_func_gethostbyname_r_nargs=0
7206         fi
7207   
7208 fi
7209
7210 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7211   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7212         cat >> confdefs.h <<EOF
7213 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7214 EOF
7215
7216   fi
7217
7218 else
7219         ol_cv_func_gethostbyname_r_nargs=0
7220 fi
7221  
7222 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7223         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7224 echo "configure:7225: checking number of arguments of gethostbyaddr_r" >&5
7225 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7226   echo $ac_n "(cached) $ac_c" 1>&6
7227 else
7228   cat > conftest.$ac_ext <<EOF
7229 #line 7230 "configure"
7230 #include "confdefs.h"
7231 #include <sys/types.h>
7232 #include <sys/socket.h>
7233 #include <netinet/in.h>
7234 #include <netdb.h>
7235 #define BUFSIZE (sizeof(struct hostent)+10)
7236 int main() {
7237 struct hostent hent; char buffer[BUFSIZE]; 
7238             struct in_addr add;
7239             size_t alen=sizeof(struct in_addr);
7240             int bufsize=BUFSIZE;int h_errno;
7241                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7242                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7243 ; return 0; }
7244 EOF
7245 if { (eval echo configure:7246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7246   rm -rf conftest*
7247   ol_cv_func_gethostbyaddr_r_nargs7=yes
7248 else
7249   echo "configure: failed program was:" >&5
7250   cat conftest.$ac_ext >&5
7251   rm -rf conftest*
7252   ol_cv_func_gethostbyaddr_r_nargs7=no
7253 fi
7254 rm -f conftest*
7255
7256         cat > conftest.$ac_ext <<EOF
7257 #line 7258 "configure"
7258 #include "confdefs.h"
7259 #include <sys/types.h>
7260 #include <sys/socket.h>
7261 #include <netinet/in.h>
7262 #include <netdb.h>
7263 #define BUFSIZE (sizeof(struct hostent)+10)
7264 int main() {
7265 struct hostent hent;
7266                 struct hostent *rhent; char buffer[BUFSIZE]; 
7267                 struct in_addr add;
7268                 size_t alen=sizeof(struct in_addr);
7269                 int bufsize=BUFSIZE;int h_errno;
7270                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7271                         alen, AF_INET, &hent, buffer, bufsize, 
7272                         &rhent, &h_errno);
7273 ; return 0; }
7274 EOF
7275 if { (eval echo configure:7276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7276   rm -rf conftest*
7277   ol_cv_func_gethostbyaddr_r_nargs8=yes
7278 else
7279   echo "configure: failed program was:" >&5
7280   cat conftest.$ac_ext >&5
7281   rm -rf conftest*
7282   ol_cv_func_gethostbyaddr_r_nargs8=no
7283 fi
7284 rm -f conftest*
7285
7286         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7287                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7288
7289                 ol_cv_func_gethostbyaddr_r_nargs=7
7290
7291         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7292                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7293
7294                 ol_cv_func_gethostbyaddr_r_nargs=8
7295
7296         else
7297                 ol_cv_func_gethostbyaddr_r_nargs=0
7298         fi
7299   
7300 fi
7301
7302 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7303   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7304     cat >> confdefs.h <<EOF
7305 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7306 EOF
7307
7308   fi
7309
7310 else
7311         ol_cv_func_gethostbyaddr_r_nargs=0
7312 fi
7313
7314 if test "$ac_cv_func_ctime_r" = yes \
7315         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7316         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7317         -a "$ac_cv_func_gethostbyname_r" = yes \
7318         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7319         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7320         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7321         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7322         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7323         ; then
7324  
7325         cat >> confdefs.h <<\EOF
7326 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7327 EOF
7328
7329 fi
7330
7331 ol_link_threads=no
7332
7333 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7334         -o $ol_with_threads = nt ; then
7335
7336         
7337         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7338 echo "configure:7339: checking for _beginthread" >&5
7339 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7340   echo $ac_n "(cached) $ac_c" 1>&6
7341 else
7342   cat > conftest.$ac_ext <<EOF
7343 #line 7344 "configure"
7344 #include "confdefs.h"
7345 /* System header to define __stub macros and hopefully few prototypes,
7346     which can conflict with char _beginthread(); below.  */
7347 #include <assert.h>
7348 /* Override any gcc2 internal prototype to avoid an error.  */
7349 /* We use char because int might match the return type of a gcc2
7350     builtin and then its argument prototype would still apply.  */
7351 char _beginthread();
7352 char (*f)();
7353
7354 int main() {
7355
7356 /* The GNU C library defines this for functions which it implements
7357     to always fail with ENOSYS.  Some functions are actually named
7358     something starting with __ and the normal name is an alias.  */
7359 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7360 choke me
7361 #else
7362 f = _beginthread;
7363 #endif
7364
7365 ; return 0; }
7366 EOF
7367 if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7368   rm -rf conftest*
7369   eval "ac_cv_func__beginthread=yes"
7370 else
7371   echo "configure: failed program was:" >&5
7372   cat conftest.$ac_ext >&5
7373   rm -rf conftest*
7374   eval "ac_cv_func__beginthread=no"
7375 fi
7376 rm -f conftest*
7377 fi
7378
7379 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7380   echo "$ac_t""yes" 1>&6
7381   :
7382 else
7383   echo "$ac_t""no" 1>&6
7384 fi
7385
7386
7387         if test $ac_cv_func__beginthread = yes ; then
7388                 cat >> confdefs.h <<\EOF
7389 #define HAVE_NT_THREADS 1
7390 EOF
7391
7392         fi
7393
7394
7395         if test "$ol_cv_nt_threads" = yes ; then
7396         ol_link_threads=nt
7397         ol_with_threads=found
7398         ol_with_yielding_select=yes
7399
7400                 cat >> confdefs.h <<\EOF
7401 #define HAVE_NT_SERVICE_MANAGER 1
7402 EOF
7403
7404                 cat >> confdefs.h <<\EOF
7405 #define HAVE_NT_EVENT_LOG 1
7406 EOF
7407
7408         fi
7409
7410         if test $ol_with_threads = nt ; then
7411                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7412         fi
7413 fi
7414
7415 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7416         -o $ol_with_threads = posix ; then
7417
7418         for ac_hdr in pthread.h
7419 do
7420 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7421 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7422 echo "configure:7423: checking for $ac_hdr" >&5
7423 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7424   echo $ac_n "(cached) $ac_c" 1>&6
7425 else
7426   cat > conftest.$ac_ext <<EOF
7427 #line 7428 "configure"
7428 #include "confdefs.h"
7429 #include <$ac_hdr>
7430 EOF
7431 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7432 { (eval echo configure:7433: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7433 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7434 if test -z "$ac_err"; then
7435   rm -rf conftest*
7436   eval "ac_cv_header_$ac_safe=yes"
7437 else
7438   echo "$ac_err" >&5
7439   echo "configure: failed program was:" >&5
7440   cat conftest.$ac_ext >&5
7441   rm -rf conftest*
7442   eval "ac_cv_header_$ac_safe=no"
7443 fi
7444 rm -f conftest*
7445 fi
7446 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7447   echo "$ac_t""yes" 1>&6
7448     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7449   cat >> confdefs.h <<EOF
7450 #define $ac_tr_hdr 1
7451 EOF
7452  
7453 else
7454   echo "$ac_t""no" 1>&6
7455 fi
7456 done
7457
7458
7459         if test $ac_cv_header_pthread_h = yes ; then
7460                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7461 echo "configure:7462: checking POSIX thread version" >&5
7462 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7463   echo $ac_n "(cached) $ac_c" 1>&6
7464 else
7465   
7466         cat > conftest.$ac_ext <<EOF
7467 #line 7468 "configure"
7468 #include "confdefs.h"
7469
7470 #               include <pthread.h>
7471                 /* this check could be improved */
7472 #               ifdef PTHREAD_ONCE_INIT
7473                         pthread_version_final;
7474 #               endif
7475         
7476 EOF
7477 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7478   egrep "pthread_version_final" >/dev/null 2>&1; then
7479   rm -rf conftest*
7480   ol_pthread_final=yes
7481 else
7482   rm -rf conftest*
7483   ol_pthread_final=no
7484 fi
7485 rm -f conftest*
7486
7487
7488         cat > conftest.$ac_ext <<EOF
7489 #line 7490 "configure"
7490 #include "confdefs.h"
7491
7492 #               include <pthread.h>
7493                 /* this check could be improved */
7494 #               ifdef pthread_once_init
7495                         pthread_version_draft4;
7496 #               endif
7497         
7498 EOF
7499 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7500   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7501   rm -rf conftest*
7502   ol_pthread_draft4=yes
7503 else
7504   rm -rf conftest*
7505   ol_pthread_draft4=no
7506 fi
7507 rm -f conftest*
7508
7509
7510         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7511                 ol_cv_pthread_version=final
7512         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7513                 ol_cv_pthread_version=draft4
7514         else
7515                 ol_cv_pthread_version=unknown
7516         fi
7517
7518 fi
7519
7520 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7521
7522
7523                 if test $ol_cv_pthread_version = final ; then
7524                         cat >> confdefs.h <<\EOF
7525 #define HAVE_PTHREADS_FINAL 1
7526 EOF
7527
7528                 elif test $ol_cv_pthread_version = draft4 ; then
7529                         cat >> confdefs.h <<\EOF
7530 #define HAVE_PTHREADS_D4 1
7531 EOF
7532
7533                 else
7534                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7535                 fi
7536
7537                 # consider threads found
7538                 ol_with_threads=found
7539
7540                 
7541         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7542 echo "configure:7543: checking for LinuxThreads pthread.h" >&5
7543 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7544   echo $ac_n "(cached) $ac_c" 1>&6
7545 else
7546   cat > conftest.$ac_ext <<EOF
7547 #line 7548 "configure"
7548 #include "confdefs.h"
7549 #include <pthread.h>
7550 EOF
7551 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7552   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7553   rm -rf conftest*
7554   ol_cv_header_linux_threads=yes
7555 else
7556   rm -rf conftest*
7557   ol_cv_header_linux_threads=no
7558 fi
7559 rm -f conftest*
7560
7561                 
7562 fi
7563
7564 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7565         if test $ol_cv_header_linux_threads = yes; then
7566                 cat >> confdefs.h <<\EOF
7567 #define HAVE_LINUX_THREADS 1
7568 EOF
7569
7570         fi
7571
7572                 
7573         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7574 echo "configure:7575: checking for GNU Pth pthread.h" >&5
7575 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7576   echo $ac_n "(cached) $ac_c" 1>&6
7577 else
7578   cat > conftest.$ac_ext <<EOF
7579 #line 7580 "configure"
7580 #include "confdefs.h"
7581 #include <pthread.h>
7582 #ifdef _POSIX_THREAD_IS_GNU_PTH
7583         __gnu_pth__;
7584 #endif
7585
7586 EOF
7587 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7588   egrep "__gnu_pth__" >/dev/null 2>&1; then
7589   rm -rf conftest*
7590   ol_cv_header_gnu_pth_pthread_h=yes
7591 else
7592   rm -rf conftest*
7593   ol_cv_header_gnu_pth_pthread_h=no
7594 fi
7595 rm -f conftest*
7596
7597                 
7598 fi
7599
7600 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7601
7602
7603                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7604                         for ac_hdr in sched.h
7605 do
7606 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7607 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7608 echo "configure:7609: checking for $ac_hdr" >&5
7609 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7610   echo $ac_n "(cached) $ac_c" 1>&6
7611 else
7612   cat > conftest.$ac_ext <<EOF
7613 #line 7614 "configure"
7614 #include "confdefs.h"
7615 #include <$ac_hdr>
7616 EOF
7617 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7618 { (eval echo configure:7619: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7619 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7620 if test -z "$ac_err"; then
7621   rm -rf conftest*
7622   eval "ac_cv_header_$ac_safe=yes"
7623 else
7624   echo "$ac_err" >&5
7625   echo "configure: failed program was:" >&5
7626   cat conftest.$ac_ext >&5
7627   rm -rf conftest*
7628   eval "ac_cv_header_$ac_safe=no"
7629 fi
7630 rm -f conftest*
7631 fi
7632 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7633   echo "$ac_t""yes" 1>&6
7634     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7635   cat >> confdefs.h <<EOF
7636 #define $ac_tr_hdr 1
7637 EOF
7638  
7639 else
7640   echo "$ac_t""no" 1>&6
7641 fi
7642 done
7643
7644                 fi
7645
7646                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7647                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7648 echo "configure:7649: checking for pthread_create in default libraries" >&5
7649 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7650   echo $ac_n "(cached) $ac_c" 1>&6
7651 else
7652   
7653                 if test "$cross_compiling" = yes; then
7654   cat > conftest.$ac_ext <<EOF
7655 #line 7656 "configure"
7656 #include "confdefs.h"
7657 /* pthread test headers */
7658 #include <pthread.h>
7659 #ifndef NULL
7660 #define NULL (void*)0
7661 #endif
7662
7663 static void *task(p)
7664         void *p;
7665 {
7666         return (void *) (p == NULL);
7667 }
7668
7669 int main() {
7670
7671         /* pthread test function */
7672         pthread_t t;
7673         int status;
7674         int detach = 1;
7675
7676 #ifdef HAVE_PTHREADS_FINAL
7677         /* Final pthreads */
7678         pthread_attr_t attr;
7679
7680         status = pthread_attr_init(&attr);
7681         if( status ) return status;
7682
7683 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7684         if( !detach ) {
7685 #if defined( PTHREAD_CREATE_JOINABLE )
7686                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7687 #else
7688                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7689 #endif
7690
7691 #ifdef PTHREAD_CREATE_DETACHED
7692         } else {
7693                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7694 #endif
7695         }
7696         if( status ) return status;
7697 #endif
7698
7699         status = pthread_create( &t, &attr, task, NULL );
7700         if( status ) return status;
7701
7702 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7703         if( detach ) {
7704                 /* give thread a chance to complete */
7705                 /* it should remain joinable and hence detachable */
7706                 sleep( 1 );
7707
7708                 status = pthread_detach( t );
7709                 if( status ) return status;
7710         }
7711 #endif
7712
7713 #else
7714         /* Draft 4 pthreads */
7715         status = pthread_create( &t, pthread_attr_default, task, NULL );
7716         if( status ) return status;
7717
7718         if( detach ) {
7719                 /* give thread a chance to complete */
7720                 /* it should remain joinable and hence detachable */
7721                 sleep( 1 );
7722
7723                 status = pthread_detach( &t );
7724                 if( status ) return status;
7725         }
7726 #endif
7727
7728 #ifdef HAVE_LINUX_THREADS
7729         pthread_kill_other_threads_np();
7730 #endif
7731
7732         return 0;
7733
7734 ; return 0; }
7735 EOF
7736 if { (eval echo configure:7737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7737   rm -rf conftest*
7738   ol_cv_pthread_create=yes
7739 else
7740   echo "configure: failed program was:" >&5
7741   cat conftest.$ac_ext >&5
7742   rm -rf conftest*
7743   ol_cv_pthread_create=no
7744 fi
7745 rm -f conftest*
7746 else
7747   cat > conftest.$ac_ext <<EOF
7748 #line 7749 "configure"
7749 #include "confdefs.h"
7750 /* pthread test headers */
7751 #include <pthread.h>
7752 #ifndef NULL
7753 #define NULL (void*)0
7754 #endif
7755
7756 static void *task(p)
7757         void *p;
7758 {
7759         return (void *) (p == NULL);
7760 }
7761
7762
7763 int main(argc, argv)
7764         int argc;
7765         char **argv;
7766 {
7767
7768         /* pthread test function */
7769         pthread_t t;
7770         int status;
7771         int detach = 1;
7772
7773 #ifdef HAVE_PTHREADS_FINAL
7774         /* Final pthreads */
7775         pthread_attr_t attr;
7776
7777         status = pthread_attr_init(&attr);
7778         if( status ) return status;
7779
7780 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7781         if( !detach ) {
7782 #if defined( PTHREAD_CREATE_JOINABLE )
7783                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7784 #else
7785                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7786 #endif
7787
7788 #ifdef PTHREAD_CREATE_DETACHED
7789         } else {
7790                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7791 #endif
7792         }
7793         if( status ) return status;
7794 #endif
7795
7796         status = pthread_create( &t, &attr, task, NULL );
7797         if( status ) return status;
7798
7799 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7800         if( detach ) {
7801                 /* give thread a chance to complete */
7802                 /* it should remain joinable and hence detachable */
7803                 sleep( 1 );
7804
7805                 status = pthread_detach( t );
7806                 if( status ) return status;
7807         }
7808 #endif
7809
7810 #else
7811         /* Draft 4 pthreads */
7812         status = pthread_create( &t, pthread_attr_default, task, NULL );
7813         if( status ) return status;
7814
7815         if( detach ) {
7816                 /* give thread a chance to complete */
7817                 /* it should remain joinable and hence detachable */
7818                 sleep( 1 );
7819
7820                 status = pthread_detach( &t );
7821                 if( status ) return status;
7822         }
7823 #endif
7824
7825 #ifdef HAVE_LINUX_THREADS
7826         pthread_kill_other_threads_np();
7827 #endif
7828
7829         return 0;
7830
7831 }
7832
7833 EOF
7834 if { (eval echo configure:7835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7835 then
7836   ol_cv_pthread_create=yes
7837 else
7838   echo "configure: failed program was:" >&5
7839   cat conftest.$ac_ext >&5
7840   rm -fr conftest*
7841   ol_cv_pthread_create=no
7842 fi
7843 rm -fr conftest*
7844 fi
7845
7846 fi
7847
7848 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7849
7850                 if test $ol_cv_pthread_create != no ; then
7851                         ol_link_threads=posix
7852                         ol_link_pthreads=""
7853                 fi
7854                 
7855                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7856 if test "$ol_link_threads" = no ; then
7857         # try -kthread
7858         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7859 echo "configure:7860: checking for pthread link with -kthread" >&5
7860 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7861   echo $ac_n "(cached) $ac_c" 1>&6
7862 else
7863   
7864                 # save the flags
7865                 ol_LIBS="$LIBS"
7866                 LIBS="-kthread $LIBS"
7867
7868                 if test "$cross_compiling" = yes; then
7869   cat > conftest.$ac_ext <<EOF
7870 #line 7871 "configure"
7871 #include "confdefs.h"
7872 /* pthread test headers */
7873 #include <pthread.h>
7874 #ifndef NULL
7875 #define NULL (void*)0
7876 #endif
7877
7878 static void *task(p)
7879         void *p;
7880 {
7881         return (void *) (p == NULL);
7882 }
7883
7884 int main() {
7885
7886         /* pthread test function */
7887         pthread_t t;
7888         int status;
7889         int detach = 1;
7890
7891 #ifdef HAVE_PTHREADS_FINAL
7892         /* Final pthreads */
7893         pthread_attr_t attr;
7894
7895         status = pthread_attr_init(&attr);
7896         if( status ) return status;
7897
7898 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7899         if( !detach ) {
7900 #if defined( PTHREAD_CREATE_JOINABLE )
7901                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7902 #else
7903                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7904 #endif
7905
7906 #ifdef PTHREAD_CREATE_DETACHED
7907         } else {
7908                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7909 #endif
7910         }
7911         if( status ) return status;
7912 #endif
7913
7914         status = pthread_create( &t, &attr, task, NULL );
7915         if( status ) return status;
7916
7917 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7918         if( detach ) {
7919                 /* give thread a chance to complete */
7920                 /* it should remain joinable and hence detachable */
7921                 sleep( 1 );
7922
7923                 status = pthread_detach( t );
7924                 if( status ) return status;
7925         }
7926 #endif
7927
7928 #else
7929         /* Draft 4 pthreads */
7930         status = pthread_create( &t, pthread_attr_default, task, NULL );
7931         if( status ) return status;
7932
7933         if( detach ) {
7934                 /* give thread a chance to complete */
7935                 /* it should remain joinable and hence detachable */
7936                 sleep( 1 );
7937
7938                 status = pthread_detach( &t );
7939                 if( status ) return status;
7940         }
7941 #endif
7942
7943 #ifdef HAVE_LINUX_THREADS
7944         pthread_kill_other_threads_np();
7945 #endif
7946
7947         return 0;
7948
7949 ; return 0; }
7950 EOF
7951 if { (eval echo configure:7952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7952   rm -rf conftest*
7953   ol_cv_pthread_kthread=yes
7954 else
7955   echo "configure: failed program was:" >&5
7956   cat conftest.$ac_ext >&5
7957   rm -rf conftest*
7958   ol_cv_pthread_kthread=no
7959 fi
7960 rm -f conftest*
7961 else
7962   cat > conftest.$ac_ext <<EOF
7963 #line 7964 "configure"
7964 #include "confdefs.h"
7965 /* pthread test headers */
7966 #include <pthread.h>
7967 #ifndef NULL
7968 #define NULL (void*)0
7969 #endif
7970
7971 static void *task(p)
7972         void *p;
7973 {
7974         return (void *) (p == NULL);
7975 }
7976
7977
7978 int main(argc, argv)
7979         int argc;
7980         char **argv;
7981 {
7982
7983         /* pthread test function */
7984         pthread_t t;
7985         int status;
7986         int detach = 1;
7987
7988 #ifdef HAVE_PTHREADS_FINAL
7989         /* Final pthreads */
7990         pthread_attr_t attr;
7991
7992         status = pthread_attr_init(&attr);
7993         if( status ) return status;
7994
7995 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7996         if( !detach ) {
7997 #if defined( PTHREAD_CREATE_JOINABLE )
7998                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7999 #else
8000                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8001 #endif
8002
8003 #ifdef PTHREAD_CREATE_DETACHED
8004         } else {
8005                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8006 #endif
8007         }
8008         if( status ) return status;
8009 #endif
8010
8011         status = pthread_create( &t, &attr, task, NULL );
8012         if( status ) return status;
8013
8014 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8015         if( detach ) {
8016                 /* give thread a chance to complete */
8017                 /* it should remain joinable and hence detachable */
8018                 sleep( 1 );
8019
8020                 status = pthread_detach( t );
8021                 if( status ) return status;
8022         }
8023 #endif
8024
8025 #else
8026         /* Draft 4 pthreads */
8027         status = pthread_create( &t, pthread_attr_default, task, NULL );
8028         if( status ) return status;
8029
8030         if( detach ) {
8031                 /* give thread a chance to complete */
8032                 /* it should remain joinable and hence detachable */
8033                 sleep( 1 );
8034
8035                 status = pthread_detach( &t );
8036                 if( status ) return status;
8037         }
8038 #endif
8039
8040 #ifdef HAVE_LINUX_THREADS
8041         pthread_kill_other_threads_np();
8042 #endif
8043
8044         return 0;
8045
8046 }
8047
8048 EOF
8049 if { (eval echo configure:8050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8050 then
8051   ol_cv_pthread_kthread=yes
8052 else
8053   echo "configure: failed program was:" >&5
8054   cat conftest.$ac_ext >&5
8055   rm -fr conftest*
8056   ol_cv_pthread_kthread=no
8057 fi
8058 rm -fr conftest*
8059 fi
8060
8061
8062                 # restore the LIBS
8063                 LIBS="$ol_LIBS"
8064         
8065 fi
8066
8067 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8068
8069         if test $ol_cv_pthread_kthread = yes ; then
8070                 ol_link_pthreads="-kthread"
8071                 ol_link_threads=posix
8072         fi
8073 fi
8074
8075                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8076 if test "$ol_link_threads" = no ; then
8077         # try -pthread
8078         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8079 echo "configure:8080: checking for pthread link with -pthread" >&5
8080 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8081   echo $ac_n "(cached) $ac_c" 1>&6
8082 else
8083   
8084                 # save the flags
8085                 ol_LIBS="$LIBS"
8086                 LIBS="-pthread $LIBS"
8087
8088                 if test "$cross_compiling" = yes; then
8089   cat > conftest.$ac_ext <<EOF
8090 #line 8091 "configure"
8091 #include "confdefs.h"
8092 /* pthread test headers */
8093 #include <pthread.h>
8094 #ifndef NULL
8095 #define NULL (void*)0
8096 #endif
8097
8098 static void *task(p)
8099         void *p;
8100 {
8101         return (void *) (p == NULL);
8102 }
8103
8104 int main() {
8105
8106         /* pthread test function */
8107         pthread_t t;
8108         int status;
8109         int detach = 1;
8110
8111 #ifdef HAVE_PTHREADS_FINAL
8112         /* Final pthreads */
8113         pthread_attr_t attr;
8114
8115         status = pthread_attr_init(&attr);
8116         if( status ) return status;
8117
8118 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8119         if( !detach ) {
8120 #if defined( PTHREAD_CREATE_JOINABLE )
8121                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8122 #else
8123                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8124 #endif
8125
8126 #ifdef PTHREAD_CREATE_DETACHED
8127         } else {
8128                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8129 #endif
8130         }
8131         if( status ) return status;
8132 #endif
8133
8134         status = pthread_create( &t, &attr, task, NULL );
8135         if( status ) return status;
8136
8137 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8138         if( detach ) {
8139                 /* give thread a chance to complete */
8140                 /* it should remain joinable and hence detachable */
8141                 sleep( 1 );
8142
8143                 status = pthread_detach( t );
8144                 if( status ) return status;
8145         }
8146 #endif
8147
8148 #else
8149         /* Draft 4 pthreads */
8150         status = pthread_create( &t, pthread_attr_default, task, NULL );
8151         if( status ) return status;
8152
8153         if( detach ) {
8154                 /* give thread a chance to complete */
8155                 /* it should remain joinable and hence detachable */
8156                 sleep( 1 );
8157
8158                 status = pthread_detach( &t );
8159                 if( status ) return status;
8160         }
8161 #endif
8162
8163 #ifdef HAVE_LINUX_THREADS
8164         pthread_kill_other_threads_np();
8165 #endif
8166
8167         return 0;
8168
8169 ; return 0; }
8170 EOF
8171 if { (eval echo configure:8172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8172   rm -rf conftest*
8173   ol_cv_pthread_pthread=yes
8174 else
8175   echo "configure: failed program was:" >&5
8176   cat conftest.$ac_ext >&5
8177   rm -rf conftest*
8178   ol_cv_pthread_pthread=no
8179 fi
8180 rm -f conftest*
8181 else
8182   cat > conftest.$ac_ext <<EOF
8183 #line 8184 "configure"
8184 #include "confdefs.h"
8185 /* pthread test headers */
8186 #include <pthread.h>
8187 #ifndef NULL
8188 #define NULL (void*)0
8189 #endif
8190
8191 static void *task(p)
8192         void *p;
8193 {
8194         return (void *) (p == NULL);
8195 }
8196
8197
8198 int main(argc, argv)
8199         int argc;
8200         char **argv;
8201 {
8202
8203         /* pthread test function */
8204         pthread_t t;
8205         int status;
8206         int detach = 1;
8207
8208 #ifdef HAVE_PTHREADS_FINAL
8209         /* Final pthreads */
8210         pthread_attr_t attr;
8211
8212         status = pthread_attr_init(&attr);
8213         if( status ) return status;
8214
8215 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8216         if( !detach ) {
8217 #if defined( PTHREAD_CREATE_JOINABLE )
8218                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8219 #else
8220                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8221 #endif
8222
8223 #ifdef PTHREAD_CREATE_DETACHED
8224         } else {
8225                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8226 #endif
8227         }
8228         if( status ) return status;
8229 #endif
8230
8231         status = pthread_create( &t, &attr, task, NULL );
8232         if( status ) return status;
8233
8234 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8235         if( detach ) {
8236                 /* give thread a chance to complete */
8237                 /* it should remain joinable and hence detachable */
8238                 sleep( 1 );
8239
8240                 status = pthread_detach( t );
8241                 if( status ) return status;
8242         }
8243 #endif
8244
8245 #else
8246         /* Draft 4 pthreads */
8247         status = pthread_create( &t, pthread_attr_default, task, NULL );
8248         if( status ) return status;
8249
8250         if( detach ) {
8251                 /* give thread a chance to complete */
8252                 /* it should remain joinable and hence detachable */
8253                 sleep( 1 );
8254
8255                 status = pthread_detach( &t );
8256                 if( status ) return status;
8257         }
8258 #endif
8259
8260 #ifdef HAVE_LINUX_THREADS
8261         pthread_kill_other_threads_np();
8262 #endif
8263
8264         return 0;
8265
8266 }
8267
8268 EOF
8269 if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8270 then
8271   ol_cv_pthread_pthread=yes
8272 else
8273   echo "configure: failed program was:" >&5
8274   cat conftest.$ac_ext >&5
8275   rm -fr conftest*
8276   ol_cv_pthread_pthread=no
8277 fi
8278 rm -fr conftest*
8279 fi
8280
8281
8282                 # restore the LIBS
8283                 LIBS="$ol_LIBS"
8284         
8285 fi
8286
8287 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8288
8289         if test $ol_cv_pthread_pthread = yes ; then
8290                 ol_link_pthreads="-pthread"
8291                 ol_link_threads=posix
8292         fi
8293 fi
8294
8295                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8296 if test "$ol_link_threads" = no ; then
8297         # try -pthreads
8298         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8299 echo "configure:8300: checking for pthread link with -pthreads" >&5
8300 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8301   echo $ac_n "(cached) $ac_c" 1>&6
8302 else
8303   
8304                 # save the flags
8305                 ol_LIBS="$LIBS"
8306                 LIBS="-pthreads $LIBS"
8307
8308                 if test "$cross_compiling" = yes; then
8309   cat > conftest.$ac_ext <<EOF
8310 #line 8311 "configure"
8311 #include "confdefs.h"
8312 /* pthread test headers */
8313 #include <pthread.h>
8314 #ifndef NULL
8315 #define NULL (void*)0
8316 #endif
8317
8318 static void *task(p)
8319         void *p;
8320 {
8321         return (void *) (p == NULL);
8322 }
8323
8324 int main() {
8325
8326         /* pthread test function */
8327         pthread_t t;
8328         int status;
8329         int detach = 1;
8330
8331 #ifdef HAVE_PTHREADS_FINAL
8332         /* Final pthreads */
8333         pthread_attr_t attr;
8334
8335         status = pthread_attr_init(&attr);
8336         if( status ) return status;
8337
8338 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8339         if( !detach ) {
8340 #if defined( PTHREAD_CREATE_JOINABLE )
8341                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8342 #else
8343                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8344 #endif
8345
8346 #ifdef PTHREAD_CREATE_DETACHED
8347         } else {
8348                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8349 #endif
8350         }
8351         if( status ) return status;
8352 #endif
8353
8354         status = pthread_create( &t, &attr, task, NULL );
8355         if( status ) return status;
8356
8357 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8358         if( detach ) {
8359                 /* give thread a chance to complete */
8360                 /* it should remain joinable and hence detachable */
8361                 sleep( 1 );
8362
8363                 status = pthread_detach( t );
8364                 if( status ) return status;
8365         }
8366 #endif
8367
8368 #else
8369         /* Draft 4 pthreads */
8370         status = pthread_create( &t, pthread_attr_default, task, NULL );
8371         if( status ) return status;
8372
8373         if( detach ) {
8374                 /* give thread a chance to complete */
8375                 /* it should remain joinable and hence detachable */
8376                 sleep( 1 );
8377
8378                 status = pthread_detach( &t );
8379                 if( status ) return status;
8380         }
8381 #endif
8382
8383 #ifdef HAVE_LINUX_THREADS
8384         pthread_kill_other_threads_np();
8385 #endif
8386
8387         return 0;
8388
8389 ; return 0; }
8390 EOF
8391 if { (eval echo configure:8392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8392   rm -rf conftest*
8393   ol_cv_pthread_pthreads=yes
8394 else
8395   echo "configure: failed program was:" >&5
8396   cat conftest.$ac_ext >&5
8397   rm -rf conftest*
8398   ol_cv_pthread_pthreads=no
8399 fi
8400 rm -f conftest*
8401 else
8402   cat > conftest.$ac_ext <<EOF
8403 #line 8404 "configure"
8404 #include "confdefs.h"
8405 /* pthread test headers */
8406 #include <pthread.h>
8407 #ifndef NULL
8408 #define NULL (void*)0
8409 #endif
8410
8411 static void *task(p)
8412         void *p;
8413 {
8414         return (void *) (p == NULL);
8415 }
8416
8417
8418 int main(argc, argv)
8419         int argc;
8420         char **argv;
8421 {
8422
8423         /* pthread test function */
8424         pthread_t t;
8425         int status;
8426         int detach = 1;
8427
8428 #ifdef HAVE_PTHREADS_FINAL
8429         /* Final pthreads */
8430         pthread_attr_t attr;
8431
8432         status = pthread_attr_init(&attr);
8433         if( status ) return status;
8434
8435 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8436         if( !detach ) {
8437 #if defined( PTHREAD_CREATE_JOINABLE )
8438                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8439 #else
8440                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8441 #endif
8442
8443 #ifdef PTHREAD_CREATE_DETACHED
8444         } else {
8445                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8446 #endif
8447         }
8448         if( status ) return status;
8449 #endif
8450
8451         status = pthread_create( &t, &attr, task, NULL );
8452         if( status ) return status;
8453
8454 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8455         if( detach ) {
8456                 /* give thread a chance to complete */
8457                 /* it should remain joinable and hence detachable */
8458                 sleep( 1 );
8459
8460                 status = pthread_detach( t );
8461                 if( status ) return status;
8462         }
8463 #endif
8464
8465 #else
8466         /* Draft 4 pthreads */
8467         status = pthread_create( &t, pthread_attr_default, task, NULL );
8468         if( status ) return status;
8469
8470         if( detach ) {
8471                 /* give thread a chance to complete */
8472                 /* it should remain joinable and hence detachable */
8473                 sleep( 1 );
8474
8475                 status = pthread_detach( &t );
8476                 if( status ) return status;
8477         }
8478 #endif
8479
8480 #ifdef HAVE_LINUX_THREADS
8481         pthread_kill_other_threads_np();
8482 #endif
8483
8484         return 0;
8485
8486 }
8487
8488 EOF
8489 if { (eval echo configure:8490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8490 then
8491   ol_cv_pthread_pthreads=yes
8492 else
8493   echo "configure: failed program was:" >&5
8494   cat conftest.$ac_ext >&5
8495   rm -fr conftest*
8496   ol_cv_pthread_pthreads=no
8497 fi
8498 rm -fr conftest*
8499 fi
8500
8501
8502                 # restore the LIBS
8503                 LIBS="$ol_LIBS"
8504         
8505 fi
8506
8507 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8508
8509         if test $ol_cv_pthread_pthreads = yes ; then
8510                 ol_link_pthreads="-pthreads"
8511                 ol_link_threads=posix
8512         fi
8513 fi
8514
8515                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8516 if test "$ol_link_threads" = no ; then
8517         # try -mthreads
8518         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8519 echo "configure:8520: checking for pthread link with -mthreads" >&5
8520 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8521   echo $ac_n "(cached) $ac_c" 1>&6
8522 else
8523   
8524                 # save the flags
8525                 ol_LIBS="$LIBS"
8526                 LIBS="-mthreads $LIBS"
8527
8528                 if test "$cross_compiling" = yes; then
8529   cat > conftest.$ac_ext <<EOF
8530 #line 8531 "configure"
8531 #include "confdefs.h"
8532 /* pthread test headers */
8533 #include <pthread.h>
8534 #ifndef NULL
8535 #define NULL (void*)0
8536 #endif
8537
8538 static void *task(p)
8539         void *p;
8540 {
8541         return (void *) (p == NULL);
8542 }
8543
8544 int main() {
8545
8546         /* pthread test function */
8547         pthread_t t;
8548         int status;
8549         int detach = 1;
8550
8551 #ifdef HAVE_PTHREADS_FINAL
8552         /* Final pthreads */
8553         pthread_attr_t attr;
8554
8555         status = pthread_attr_init(&attr);
8556         if( status ) return status;
8557
8558 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8559         if( !detach ) {
8560 #if defined( PTHREAD_CREATE_JOINABLE )
8561                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8562 #else
8563                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8564 #endif
8565
8566 #ifdef PTHREAD_CREATE_DETACHED
8567         } else {
8568                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8569 #endif
8570         }
8571         if( status ) return status;
8572 #endif
8573
8574         status = pthread_create( &t, &attr, task, NULL );
8575         if( status ) return status;
8576
8577 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8578         if( detach ) {
8579                 /* give thread a chance to complete */
8580                 /* it should remain joinable and hence detachable */
8581                 sleep( 1 );
8582
8583                 status = pthread_detach( t );
8584                 if( status ) return status;
8585         }
8586 #endif
8587
8588 #else
8589         /* Draft 4 pthreads */
8590         status = pthread_create( &t, pthread_attr_default, task, NULL );
8591         if( status ) return status;
8592
8593         if( detach ) {
8594                 /* give thread a chance to complete */
8595                 /* it should remain joinable and hence detachable */
8596                 sleep( 1 );
8597
8598                 status = pthread_detach( &t );
8599                 if( status ) return status;
8600         }
8601 #endif
8602
8603 #ifdef HAVE_LINUX_THREADS
8604         pthread_kill_other_threads_np();
8605 #endif
8606
8607         return 0;
8608
8609 ; return 0; }
8610 EOF
8611 if { (eval echo configure:8612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8612   rm -rf conftest*
8613   ol_cv_pthread_mthreads=yes
8614 else
8615   echo "configure: failed program was:" >&5
8616   cat conftest.$ac_ext >&5
8617   rm -rf conftest*
8618   ol_cv_pthread_mthreads=no
8619 fi
8620 rm -f conftest*
8621 else
8622   cat > conftest.$ac_ext <<EOF
8623 #line 8624 "configure"
8624 #include "confdefs.h"
8625 /* pthread test headers */
8626 #include <pthread.h>
8627 #ifndef NULL
8628 #define NULL (void*)0
8629 #endif
8630
8631 static void *task(p)
8632         void *p;
8633 {
8634         return (void *) (p == NULL);
8635 }
8636
8637
8638 int main(argc, argv)
8639         int argc;
8640         char **argv;
8641 {
8642
8643         /* pthread test function */
8644         pthread_t t;
8645         int status;
8646         int detach = 1;
8647
8648 #ifdef HAVE_PTHREADS_FINAL
8649         /* Final pthreads */
8650         pthread_attr_t attr;
8651
8652         status = pthread_attr_init(&attr);
8653         if( status ) return status;
8654
8655 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8656         if( !detach ) {
8657 #if defined( PTHREAD_CREATE_JOINABLE )
8658                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8659 #else
8660                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8661 #endif
8662
8663 #ifdef PTHREAD_CREATE_DETACHED
8664         } else {
8665                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8666 #endif
8667         }
8668         if( status ) return status;
8669 #endif
8670
8671         status = pthread_create( &t, &attr, task, NULL );
8672         if( status ) return status;
8673
8674 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8675         if( detach ) {
8676                 /* give thread a chance to complete */
8677                 /* it should remain joinable and hence detachable */
8678                 sleep( 1 );
8679
8680                 status = pthread_detach( t );
8681                 if( status ) return status;
8682         }
8683 #endif
8684
8685 #else
8686         /* Draft 4 pthreads */
8687         status = pthread_create( &t, pthread_attr_default, task, NULL );
8688         if( status ) return status;
8689
8690         if( detach ) {
8691                 /* give thread a chance to complete */
8692                 /* it should remain joinable and hence detachable */
8693                 sleep( 1 );
8694
8695                 status = pthread_detach( &t );
8696                 if( status ) return status;
8697         }
8698 #endif
8699
8700 #ifdef HAVE_LINUX_THREADS
8701         pthread_kill_other_threads_np();
8702 #endif
8703
8704         return 0;
8705
8706 }
8707
8708 EOF
8709 if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8710 then
8711   ol_cv_pthread_mthreads=yes
8712 else
8713   echo "configure: failed program was:" >&5
8714   cat conftest.$ac_ext >&5
8715   rm -fr conftest*
8716   ol_cv_pthread_mthreads=no
8717 fi
8718 rm -fr conftest*
8719 fi
8720
8721
8722                 # restore the LIBS
8723                 LIBS="$ol_LIBS"
8724         
8725 fi
8726
8727 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8728
8729         if test $ol_cv_pthread_mthreads = yes ; then
8730                 ol_link_pthreads="-mthreads"
8731                 ol_link_threads=posix
8732         fi
8733 fi
8734
8735                 # Pthread try link: -thread (ol_cv_pthread_thread)
8736 if test "$ol_link_threads" = no ; then
8737         # try -thread
8738         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8739 echo "configure:8740: checking for pthread link with -thread" >&5
8740 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8741   echo $ac_n "(cached) $ac_c" 1>&6
8742 else
8743   
8744                 # save the flags
8745                 ol_LIBS="$LIBS"
8746                 LIBS="-thread $LIBS"
8747
8748                 if test "$cross_compiling" = yes; then
8749   cat > conftest.$ac_ext <<EOF
8750 #line 8751 "configure"
8751 #include "confdefs.h"
8752 /* pthread test headers */
8753 #include <pthread.h>
8754 #ifndef NULL
8755 #define NULL (void*)0
8756 #endif
8757
8758 static void *task(p)
8759         void *p;
8760 {
8761         return (void *) (p == NULL);
8762 }
8763
8764 int main() {
8765
8766         /* pthread test function */
8767         pthread_t t;
8768         int status;
8769         int detach = 1;
8770
8771 #ifdef HAVE_PTHREADS_FINAL
8772         /* Final pthreads */
8773         pthread_attr_t attr;
8774
8775         status = pthread_attr_init(&attr);
8776         if( status ) return status;
8777
8778 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8779         if( !detach ) {
8780 #if defined( PTHREAD_CREATE_JOINABLE )
8781                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8782 #else
8783                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8784 #endif
8785
8786 #ifdef PTHREAD_CREATE_DETACHED
8787         } else {
8788                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8789 #endif
8790         }
8791         if( status ) return status;
8792 #endif
8793
8794         status = pthread_create( &t, &attr, task, NULL );
8795         if( status ) return status;
8796
8797 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8798         if( detach ) {
8799                 /* give thread a chance to complete */
8800                 /* it should remain joinable and hence detachable */
8801                 sleep( 1 );
8802
8803                 status = pthread_detach( t );
8804                 if( status ) return status;
8805         }
8806 #endif
8807
8808 #else
8809         /* Draft 4 pthreads */
8810         status = pthread_create( &t, pthread_attr_default, task, NULL );
8811         if( status ) return status;
8812
8813         if( detach ) {
8814                 /* give thread a chance to complete */
8815                 /* it should remain joinable and hence detachable */
8816                 sleep( 1 );
8817
8818                 status = pthread_detach( &t );
8819                 if( status ) return status;
8820         }
8821 #endif
8822
8823 #ifdef HAVE_LINUX_THREADS
8824         pthread_kill_other_threads_np();
8825 #endif
8826
8827         return 0;
8828
8829 ; return 0; }
8830 EOF
8831 if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8832   rm -rf conftest*
8833   ol_cv_pthread_thread=yes
8834 else
8835   echo "configure: failed program was:" >&5
8836   cat conftest.$ac_ext >&5
8837   rm -rf conftest*
8838   ol_cv_pthread_thread=no
8839 fi
8840 rm -f conftest*
8841 else
8842   cat > conftest.$ac_ext <<EOF
8843 #line 8844 "configure"
8844 #include "confdefs.h"
8845 /* pthread test headers */
8846 #include <pthread.h>
8847 #ifndef NULL
8848 #define NULL (void*)0
8849 #endif
8850
8851 static void *task(p)
8852         void *p;
8853 {
8854         return (void *) (p == NULL);
8855 }
8856
8857
8858 int main(argc, argv)
8859         int argc;
8860         char **argv;
8861 {
8862
8863         /* pthread test function */
8864         pthread_t t;
8865         int status;
8866         int detach = 1;
8867
8868 #ifdef HAVE_PTHREADS_FINAL
8869         /* Final pthreads */
8870         pthread_attr_t attr;
8871
8872         status = pthread_attr_init(&attr);
8873         if( status ) return status;
8874
8875 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8876         if( !detach ) {
8877 #if defined( PTHREAD_CREATE_JOINABLE )
8878                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8879 #else
8880                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8881 #endif
8882
8883 #ifdef PTHREAD_CREATE_DETACHED
8884         } else {
8885                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8886 #endif
8887         }
8888         if( status ) return status;
8889 #endif
8890
8891         status = pthread_create( &t, &attr, task, NULL );
8892         if( status ) return status;
8893
8894 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8895         if( detach ) {
8896                 /* give thread a chance to complete */
8897                 /* it should remain joinable and hence detachable */
8898                 sleep( 1 );
8899
8900                 status = pthread_detach( t );
8901                 if( status ) return status;
8902         }
8903 #endif
8904
8905 #else
8906         /* Draft 4 pthreads */
8907         status = pthread_create( &t, pthread_attr_default, task, NULL );
8908         if( status ) return status;
8909
8910         if( detach ) {
8911                 /* give thread a chance to complete */
8912                 /* it should remain joinable and hence detachable */
8913                 sleep( 1 );
8914
8915                 status = pthread_detach( &t );
8916                 if( status ) return status;
8917         }
8918 #endif
8919
8920 #ifdef HAVE_LINUX_THREADS
8921         pthread_kill_other_threads_np();
8922 #endif
8923
8924         return 0;
8925
8926 }
8927
8928 EOF
8929 if { (eval echo configure:8930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8930 then
8931   ol_cv_pthread_thread=yes
8932 else
8933   echo "configure: failed program was:" >&5
8934   cat conftest.$ac_ext >&5
8935   rm -fr conftest*
8936   ol_cv_pthread_thread=no
8937 fi
8938 rm -fr conftest*
8939 fi
8940
8941
8942                 # restore the LIBS
8943                 LIBS="$ol_LIBS"
8944         
8945 fi
8946
8947 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8948
8949         if test $ol_cv_pthread_thread = yes ; then
8950                 ol_link_pthreads="-thread"
8951                 ol_link_threads=posix
8952         fi
8953 fi
8954
8955
8956                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8957 if test "$ol_link_threads" = no ; then
8958         # try -lpthread -lmach -lexc -lc_r
8959         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8960 echo "configure:8961: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8961 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8962   echo $ac_n "(cached) $ac_c" 1>&6
8963 else
8964   
8965                 # save the flags
8966                 ol_LIBS="$LIBS"
8967                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8968
8969                 if test "$cross_compiling" = yes; then
8970   cat > conftest.$ac_ext <<EOF
8971 #line 8972 "configure"
8972 #include "confdefs.h"
8973 /* pthread test headers */
8974 #include <pthread.h>
8975 #ifndef NULL
8976 #define NULL (void*)0
8977 #endif
8978
8979 static void *task(p)
8980         void *p;
8981 {
8982         return (void *) (p == NULL);
8983 }
8984
8985 int main() {
8986
8987         /* pthread test function */
8988         pthread_t t;
8989         int status;
8990         int detach = 1;
8991
8992 #ifdef HAVE_PTHREADS_FINAL
8993         /* Final pthreads */
8994         pthread_attr_t attr;
8995
8996         status = pthread_attr_init(&attr);
8997         if( status ) return status;
8998
8999 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9000         if( !detach ) {
9001 #if defined( PTHREAD_CREATE_JOINABLE )
9002                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9003 #else
9004                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9005 #endif
9006
9007 #ifdef PTHREAD_CREATE_DETACHED
9008         } else {
9009                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9010 #endif
9011         }
9012         if( status ) return status;
9013 #endif
9014
9015         status = pthread_create( &t, &attr, task, NULL );
9016         if( status ) return status;
9017
9018 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9019         if( detach ) {
9020                 /* give thread a chance to complete */
9021                 /* it should remain joinable and hence detachable */
9022                 sleep( 1 );
9023
9024                 status = pthread_detach( t );
9025                 if( status ) return status;
9026         }
9027 #endif
9028
9029 #else
9030         /* Draft 4 pthreads */
9031         status = pthread_create( &t, pthread_attr_default, task, NULL );
9032         if( status ) return status;
9033
9034         if( detach ) {
9035                 /* give thread a chance to complete */
9036                 /* it should remain joinable and hence detachable */
9037                 sleep( 1 );
9038
9039                 status = pthread_detach( &t );
9040                 if( status ) return status;
9041         }
9042 #endif
9043
9044 #ifdef HAVE_LINUX_THREADS
9045         pthread_kill_other_threads_np();
9046 #endif
9047
9048         return 0;
9049
9050 ; return 0; }
9051 EOF
9052 if { (eval echo configure:9053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9053   rm -rf conftest*
9054   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9055 else
9056   echo "configure: failed program was:" >&5
9057   cat conftest.$ac_ext >&5
9058   rm -rf conftest*
9059   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9060 fi
9061 rm -f conftest*
9062 else
9063   cat > conftest.$ac_ext <<EOF
9064 #line 9065 "configure"
9065 #include "confdefs.h"
9066 /* pthread test headers */
9067 #include <pthread.h>
9068 #ifndef NULL
9069 #define NULL (void*)0
9070 #endif
9071
9072 static void *task(p)
9073         void *p;
9074 {
9075         return (void *) (p == NULL);
9076 }
9077
9078
9079 int main(argc, argv)
9080         int argc;
9081         char **argv;
9082 {
9083
9084         /* pthread test function */
9085         pthread_t t;
9086         int status;
9087         int detach = 1;
9088
9089 #ifdef HAVE_PTHREADS_FINAL
9090         /* Final pthreads */
9091         pthread_attr_t attr;
9092
9093         status = pthread_attr_init(&attr);
9094         if( status ) return status;
9095
9096 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9097         if( !detach ) {
9098 #if defined( PTHREAD_CREATE_JOINABLE )
9099                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9100 #else
9101                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9102 #endif
9103
9104 #ifdef PTHREAD_CREATE_DETACHED
9105         } else {
9106                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9107 #endif
9108         }
9109         if( status ) return status;
9110 #endif
9111
9112         status = pthread_create( &t, &attr, task, NULL );
9113         if( status ) return status;
9114
9115 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9116         if( detach ) {
9117                 /* give thread a chance to complete */
9118                 /* it should remain joinable and hence detachable */
9119                 sleep( 1 );
9120
9121                 status = pthread_detach( t );
9122                 if( status ) return status;
9123         }
9124 #endif
9125
9126 #else
9127         /* Draft 4 pthreads */
9128         status = pthread_create( &t, pthread_attr_default, task, NULL );
9129         if( status ) return status;
9130
9131         if( detach ) {
9132                 /* give thread a chance to complete */
9133                 /* it should remain joinable and hence detachable */
9134                 sleep( 1 );
9135
9136                 status = pthread_detach( &t );
9137                 if( status ) return status;
9138         }
9139 #endif
9140
9141 #ifdef HAVE_LINUX_THREADS
9142         pthread_kill_other_threads_np();
9143 #endif
9144
9145         return 0;
9146
9147 }
9148
9149 EOF
9150 if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9151 then
9152   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9153 else
9154   echo "configure: failed program was:" >&5
9155   cat conftest.$ac_ext >&5
9156   rm -fr conftest*
9157   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9158 fi
9159 rm -fr conftest*
9160 fi
9161
9162
9163                 # restore the LIBS
9164                 LIBS="$ol_LIBS"
9165         
9166 fi
9167
9168 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9169
9170         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9171                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9172                 ol_link_threads=posix
9173         fi
9174 fi
9175
9176                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9177 if test "$ol_link_threads" = no ; then
9178         # try -lpthread -lmach -lexc
9179         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9180 echo "configure:9181: checking for pthread link with -lpthread -lmach -lexc" >&5
9181 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9182   echo $ac_n "(cached) $ac_c" 1>&6
9183 else
9184   
9185                 # save the flags
9186                 ol_LIBS="$LIBS"
9187                 LIBS="-lpthread -lmach -lexc $LIBS"
9188
9189                 if test "$cross_compiling" = yes; then
9190   cat > conftest.$ac_ext <<EOF
9191 #line 9192 "configure"
9192 #include "confdefs.h"
9193 /* pthread test headers */
9194 #include <pthread.h>
9195 #ifndef NULL
9196 #define NULL (void*)0
9197 #endif
9198
9199 static void *task(p)
9200         void *p;
9201 {
9202         return (void *) (p == NULL);
9203 }
9204
9205 int main() {
9206
9207         /* pthread test function */
9208         pthread_t t;
9209         int status;
9210         int detach = 1;
9211
9212 #ifdef HAVE_PTHREADS_FINAL
9213         /* Final pthreads */
9214         pthread_attr_t attr;
9215
9216         status = pthread_attr_init(&attr);
9217         if( status ) return status;
9218
9219 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9220         if( !detach ) {
9221 #if defined( PTHREAD_CREATE_JOINABLE )
9222                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9223 #else
9224                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9225 #endif
9226
9227 #ifdef PTHREAD_CREATE_DETACHED
9228         } else {
9229                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9230 #endif
9231         }
9232         if( status ) return status;
9233 #endif
9234
9235         status = pthread_create( &t, &attr, task, NULL );
9236         if( status ) return status;
9237
9238 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9239         if( detach ) {
9240                 /* give thread a chance to complete */
9241                 /* it should remain joinable and hence detachable */
9242                 sleep( 1 );
9243
9244                 status = pthread_detach( t );
9245                 if( status ) return status;
9246         }
9247 #endif
9248
9249 #else
9250         /* Draft 4 pthreads */
9251         status = pthread_create( &t, pthread_attr_default, task, NULL );
9252         if( status ) return status;
9253
9254         if( detach ) {
9255                 /* give thread a chance to complete */
9256                 /* it should remain joinable and hence detachable */
9257                 sleep( 1 );
9258
9259                 status = pthread_detach( &t );
9260                 if( status ) return status;
9261         }
9262 #endif
9263
9264 #ifdef HAVE_LINUX_THREADS
9265         pthread_kill_other_threads_np();
9266 #endif
9267
9268         return 0;
9269
9270 ; return 0; }
9271 EOF
9272 if { (eval echo configure:9273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9273   rm -rf conftest*
9274   ol_cv_pthread_lpthread_lmach_lexc=yes
9275 else
9276   echo "configure: failed program was:" >&5
9277   cat conftest.$ac_ext >&5
9278   rm -rf conftest*
9279   ol_cv_pthread_lpthread_lmach_lexc=no
9280 fi
9281 rm -f conftest*
9282 else
9283   cat > conftest.$ac_ext <<EOF
9284 #line 9285 "configure"
9285 #include "confdefs.h"
9286 /* pthread test headers */
9287 #include <pthread.h>
9288 #ifndef NULL
9289 #define NULL (void*)0
9290 #endif
9291
9292 static void *task(p)
9293         void *p;
9294 {
9295         return (void *) (p == NULL);
9296 }
9297
9298
9299 int main(argc, argv)
9300         int argc;
9301         char **argv;
9302 {
9303
9304         /* pthread test function */
9305         pthread_t t;
9306         int status;
9307         int detach = 1;
9308
9309 #ifdef HAVE_PTHREADS_FINAL
9310         /* Final pthreads */
9311         pthread_attr_t attr;
9312
9313         status = pthread_attr_init(&attr);
9314         if( status ) return status;
9315
9316 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9317         if( !detach ) {
9318 #if defined( PTHREAD_CREATE_JOINABLE )
9319                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9320 #else
9321                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9322 #endif
9323
9324 #ifdef PTHREAD_CREATE_DETACHED
9325         } else {
9326                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9327 #endif
9328         }
9329         if( status ) return status;
9330 #endif
9331
9332         status = pthread_create( &t, &attr, task, NULL );
9333         if( status ) return status;
9334
9335 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9336         if( detach ) {
9337                 /* give thread a chance to complete */
9338                 /* it should remain joinable and hence detachable */
9339                 sleep( 1 );
9340
9341                 status = pthread_detach( t );
9342                 if( status ) return status;
9343         }
9344 #endif
9345
9346 #else
9347         /* Draft 4 pthreads */
9348         status = pthread_create( &t, pthread_attr_default, task, NULL );
9349         if( status ) return status;
9350
9351         if( detach ) {
9352                 /* give thread a chance to complete */
9353                 /* it should remain joinable and hence detachable */
9354                 sleep( 1 );
9355
9356                 status = pthread_detach( &t );
9357                 if( status ) return status;
9358         }
9359 #endif
9360
9361 #ifdef HAVE_LINUX_THREADS
9362         pthread_kill_other_threads_np();
9363 #endif
9364
9365         return 0;
9366
9367 }
9368
9369 EOF
9370 if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9371 then
9372   ol_cv_pthread_lpthread_lmach_lexc=yes
9373 else
9374   echo "configure: failed program was:" >&5
9375   cat conftest.$ac_ext >&5
9376   rm -fr conftest*
9377   ol_cv_pthread_lpthread_lmach_lexc=no
9378 fi
9379 rm -fr conftest*
9380 fi
9381
9382
9383                 # restore the LIBS
9384                 LIBS="$ol_LIBS"
9385         
9386 fi
9387
9388 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9389
9390         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9391                 ol_link_pthreads="-lpthread -lmach -lexc"
9392                 ol_link_threads=posix
9393         fi
9394 fi
9395
9396
9397                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9398 if test "$ol_link_threads" = no ; then
9399         # try -lpthread -Wl,-woff,85
9400         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9401 echo "configure:9402: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9402 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9403   echo $ac_n "(cached) $ac_c" 1>&6
9404 else
9405   
9406                 # save the flags
9407                 ol_LIBS="$LIBS"
9408                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9409
9410                 if test "$cross_compiling" = yes; then
9411   cat > conftest.$ac_ext <<EOF
9412 #line 9413 "configure"
9413 #include "confdefs.h"
9414 /* pthread test headers */
9415 #include <pthread.h>
9416 #ifndef NULL
9417 #define NULL (void*)0
9418 #endif
9419
9420 static void *task(p)
9421         void *p;
9422 {
9423         return (void *) (p == NULL);
9424 }
9425
9426 int main() {
9427
9428         /* pthread test function */
9429         pthread_t t;
9430         int status;
9431         int detach = 1;
9432
9433 #ifdef HAVE_PTHREADS_FINAL
9434         /* Final pthreads */
9435         pthread_attr_t attr;
9436
9437         status = pthread_attr_init(&attr);
9438         if( status ) return status;
9439
9440 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9441         if( !detach ) {
9442 #if defined( PTHREAD_CREATE_JOINABLE )
9443                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9444 #else
9445                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9446 #endif
9447
9448 #ifdef PTHREAD_CREATE_DETACHED
9449         } else {
9450                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9451 #endif
9452         }
9453         if( status ) return status;
9454 #endif
9455
9456         status = pthread_create( &t, &attr, task, NULL );
9457         if( status ) return status;
9458
9459 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9460         if( detach ) {
9461                 /* give thread a chance to complete */
9462                 /* it should remain joinable and hence detachable */
9463                 sleep( 1 );
9464
9465                 status = pthread_detach( t );
9466                 if( status ) return status;
9467         }
9468 #endif
9469
9470 #else
9471         /* Draft 4 pthreads */
9472         status = pthread_create( &t, pthread_attr_default, task, NULL );
9473         if( status ) return status;
9474
9475         if( detach ) {
9476                 /* give thread a chance to complete */
9477                 /* it should remain joinable and hence detachable */
9478                 sleep( 1 );
9479
9480                 status = pthread_detach( &t );
9481                 if( status ) return status;
9482         }
9483 #endif
9484
9485 #ifdef HAVE_LINUX_THREADS
9486         pthread_kill_other_threads_np();
9487 #endif
9488
9489         return 0;
9490
9491 ; return 0; }
9492 EOF
9493 if { (eval echo configure:9494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9494   rm -rf conftest*
9495   ol_cv_pthread_lib_lpthread_woff=yes
9496 else
9497   echo "configure: failed program was:" >&5
9498   cat conftest.$ac_ext >&5
9499   rm -rf conftest*
9500   ol_cv_pthread_lib_lpthread_woff=no
9501 fi
9502 rm -f conftest*
9503 else
9504   cat > conftest.$ac_ext <<EOF
9505 #line 9506 "configure"
9506 #include "confdefs.h"
9507 /* pthread test headers */
9508 #include <pthread.h>
9509 #ifndef NULL
9510 #define NULL (void*)0
9511 #endif
9512
9513 static void *task(p)
9514         void *p;
9515 {
9516         return (void *) (p == NULL);
9517 }
9518
9519
9520 int main(argc, argv)
9521         int argc;
9522         char **argv;
9523 {
9524
9525         /* pthread test function */
9526         pthread_t t;
9527         int status;
9528         int detach = 1;
9529
9530 #ifdef HAVE_PTHREADS_FINAL
9531         /* Final pthreads */
9532         pthread_attr_t attr;
9533
9534         status = pthread_attr_init(&attr);
9535         if( status ) return status;
9536
9537 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9538         if( !detach ) {
9539 #if defined( PTHREAD_CREATE_JOINABLE )
9540                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9541 #else
9542                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9543 #endif
9544
9545 #ifdef PTHREAD_CREATE_DETACHED
9546         } else {
9547                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9548 #endif
9549         }
9550         if( status ) return status;
9551 #endif
9552
9553         status = pthread_create( &t, &attr, task, NULL );
9554         if( status ) return status;
9555
9556 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9557         if( detach ) {
9558                 /* give thread a chance to complete */
9559                 /* it should remain joinable and hence detachable */
9560                 sleep( 1 );
9561
9562                 status = pthread_detach( t );
9563                 if( status ) return status;
9564         }
9565 #endif
9566
9567 #else
9568         /* Draft 4 pthreads */
9569         status = pthread_create( &t, pthread_attr_default, task, NULL );
9570         if( status ) return status;
9571
9572         if( detach ) {
9573                 /* give thread a chance to complete */
9574                 /* it should remain joinable and hence detachable */
9575                 sleep( 1 );
9576
9577                 status = pthread_detach( &t );
9578                 if( status ) return status;
9579         }
9580 #endif
9581
9582 #ifdef HAVE_LINUX_THREADS
9583         pthread_kill_other_threads_np();
9584 #endif
9585
9586         return 0;
9587
9588 }
9589
9590 EOF
9591 if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9592 then
9593   ol_cv_pthread_lib_lpthread_woff=yes
9594 else
9595   echo "configure: failed program was:" >&5
9596   cat conftest.$ac_ext >&5
9597   rm -fr conftest*
9598   ol_cv_pthread_lib_lpthread_woff=no
9599 fi
9600 rm -fr conftest*
9601 fi
9602
9603
9604                 # restore the LIBS
9605                 LIBS="$ol_LIBS"
9606         
9607 fi
9608
9609 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9610
9611         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9612                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9613                 ol_link_threads=posix
9614         fi
9615 fi
9616
9617
9618                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9619 if test "$ol_link_threads" = no ; then
9620         # try -lpthread
9621         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9622 echo "configure:9623: checking for pthread link with -lpthread" >&5
9623 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9624   echo $ac_n "(cached) $ac_c" 1>&6
9625 else
9626   
9627                 # save the flags
9628                 ol_LIBS="$LIBS"
9629                 LIBS="-lpthread $LIBS"
9630
9631                 if test "$cross_compiling" = yes; then
9632   cat > conftest.$ac_ext <<EOF
9633 #line 9634 "configure"
9634 #include "confdefs.h"
9635 /* pthread test headers */
9636 #include <pthread.h>
9637 #ifndef NULL
9638 #define NULL (void*)0
9639 #endif
9640
9641 static void *task(p)
9642         void *p;
9643 {
9644         return (void *) (p == NULL);
9645 }
9646
9647 int main() {
9648
9649         /* pthread test function */
9650         pthread_t t;
9651         int status;
9652         int detach = 1;
9653
9654 #ifdef HAVE_PTHREADS_FINAL
9655         /* Final pthreads */
9656         pthread_attr_t attr;
9657
9658         status = pthread_attr_init(&attr);
9659         if( status ) return status;
9660
9661 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9662         if( !detach ) {
9663 #if defined( PTHREAD_CREATE_JOINABLE )
9664                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9665 #else
9666                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9667 #endif
9668
9669 #ifdef PTHREAD_CREATE_DETACHED
9670         } else {
9671                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9672 #endif
9673         }
9674         if( status ) return status;
9675 #endif
9676
9677         status = pthread_create( &t, &attr, task, NULL );
9678         if( status ) return status;
9679
9680 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9681         if( detach ) {
9682                 /* give thread a chance to complete */
9683                 /* it should remain joinable and hence detachable */
9684                 sleep( 1 );
9685
9686                 status = pthread_detach( t );
9687                 if( status ) return status;
9688         }
9689 #endif
9690
9691 #else
9692         /* Draft 4 pthreads */
9693         status = pthread_create( &t, pthread_attr_default, task, NULL );
9694         if( status ) return status;
9695
9696         if( detach ) {
9697                 /* give thread a chance to complete */
9698                 /* it should remain joinable and hence detachable */
9699                 sleep( 1 );
9700
9701                 status = pthread_detach( &t );
9702                 if( status ) return status;
9703         }
9704 #endif
9705
9706 #ifdef HAVE_LINUX_THREADS
9707         pthread_kill_other_threads_np();
9708 #endif
9709
9710         return 0;
9711
9712 ; return 0; }
9713 EOF
9714 if { (eval echo configure:9715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9715   rm -rf conftest*
9716   ol_cv_pthread_lpthread=yes
9717 else
9718   echo "configure: failed program was:" >&5
9719   cat conftest.$ac_ext >&5
9720   rm -rf conftest*
9721   ol_cv_pthread_lpthread=no
9722 fi
9723 rm -f conftest*
9724 else
9725   cat > conftest.$ac_ext <<EOF
9726 #line 9727 "configure"
9727 #include "confdefs.h"
9728 /* pthread test headers */
9729 #include <pthread.h>
9730 #ifndef NULL
9731 #define NULL (void*)0
9732 #endif
9733
9734 static void *task(p)
9735         void *p;
9736 {
9737         return (void *) (p == NULL);
9738 }
9739
9740
9741 int main(argc, argv)
9742         int argc;
9743         char **argv;
9744 {
9745
9746         /* pthread test function */
9747         pthread_t t;
9748         int status;
9749         int detach = 1;
9750
9751 #ifdef HAVE_PTHREADS_FINAL
9752         /* Final pthreads */
9753         pthread_attr_t attr;
9754
9755         status = pthread_attr_init(&attr);
9756         if( status ) return status;
9757
9758 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9759         if( !detach ) {
9760 #if defined( PTHREAD_CREATE_JOINABLE )
9761                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9762 #else
9763                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9764 #endif
9765
9766 #ifdef PTHREAD_CREATE_DETACHED
9767         } else {
9768                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9769 #endif
9770         }
9771         if( status ) return status;
9772 #endif
9773
9774         status = pthread_create( &t, &attr, task, NULL );
9775         if( status ) return status;
9776
9777 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9778         if( detach ) {
9779                 /* give thread a chance to complete */
9780                 /* it should remain joinable and hence detachable */
9781                 sleep( 1 );
9782
9783                 status = pthread_detach( t );
9784                 if( status ) return status;
9785         }
9786 #endif
9787
9788 #else
9789         /* Draft 4 pthreads */
9790         status = pthread_create( &t, pthread_attr_default, task, NULL );
9791         if( status ) return status;
9792
9793         if( detach ) {
9794                 /* give thread a chance to complete */
9795                 /* it should remain joinable and hence detachable */
9796                 sleep( 1 );
9797
9798                 status = pthread_detach( &t );
9799                 if( status ) return status;
9800         }
9801 #endif
9802
9803 #ifdef HAVE_LINUX_THREADS
9804         pthread_kill_other_threads_np();
9805 #endif
9806
9807         return 0;
9808
9809 }
9810
9811 EOF
9812 if { (eval echo configure:9813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9813 then
9814   ol_cv_pthread_lpthread=yes
9815 else
9816   echo "configure: failed program was:" >&5
9817   cat conftest.$ac_ext >&5
9818   rm -fr conftest*
9819   ol_cv_pthread_lpthread=no
9820 fi
9821 rm -fr conftest*
9822 fi
9823
9824
9825                 # restore the LIBS
9826                 LIBS="$ol_LIBS"
9827         
9828 fi
9829
9830 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9831
9832         if test $ol_cv_pthread_lpthread = yes ; then
9833                 ol_link_pthreads="-lpthread"
9834                 ol_link_threads=posix
9835         fi
9836 fi
9837
9838                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9839 if test "$ol_link_threads" = no ; then
9840         # try -lc_r
9841         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9842 echo "configure:9843: checking for pthread link with -lc_r" >&5
9843 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9844   echo $ac_n "(cached) $ac_c" 1>&6
9845 else
9846   
9847                 # save the flags
9848                 ol_LIBS="$LIBS"
9849                 LIBS="-lc_r $LIBS"
9850
9851                 if test "$cross_compiling" = yes; then
9852   cat > conftest.$ac_ext <<EOF
9853 #line 9854 "configure"
9854 #include "confdefs.h"
9855 /* pthread test headers */
9856 #include <pthread.h>
9857 #ifndef NULL
9858 #define NULL (void*)0
9859 #endif
9860
9861 static void *task(p)
9862         void *p;
9863 {
9864         return (void *) (p == NULL);
9865 }
9866
9867 int main() {
9868
9869         /* pthread test function */
9870         pthread_t t;
9871         int status;
9872         int detach = 1;
9873
9874 #ifdef HAVE_PTHREADS_FINAL
9875         /* Final pthreads */
9876         pthread_attr_t attr;
9877
9878         status = pthread_attr_init(&attr);
9879         if( status ) return status;
9880
9881 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9882         if( !detach ) {
9883 #if defined( PTHREAD_CREATE_JOINABLE )
9884                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9885 #else
9886                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9887 #endif
9888
9889 #ifdef PTHREAD_CREATE_DETACHED
9890         } else {
9891                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9892 #endif
9893         }
9894         if( status ) return status;
9895 #endif
9896
9897         status = pthread_create( &t, &attr, task, NULL );
9898         if( status ) return status;
9899
9900 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9901         if( detach ) {
9902                 /* give thread a chance to complete */
9903                 /* it should remain joinable and hence detachable */
9904                 sleep( 1 );
9905
9906                 status = pthread_detach( t );
9907                 if( status ) return status;
9908         }
9909 #endif
9910
9911 #else
9912         /* Draft 4 pthreads */
9913         status = pthread_create( &t, pthread_attr_default, task, NULL );
9914         if( status ) return status;
9915
9916         if( detach ) {
9917                 /* give thread a chance to complete */
9918                 /* it should remain joinable and hence detachable */
9919                 sleep( 1 );
9920
9921                 status = pthread_detach( &t );
9922                 if( status ) return status;
9923         }
9924 #endif
9925
9926 #ifdef HAVE_LINUX_THREADS
9927         pthread_kill_other_threads_np();
9928 #endif
9929
9930         return 0;
9931
9932 ; return 0; }
9933 EOF
9934 if { (eval echo configure:9935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9935   rm -rf conftest*
9936   ol_cv_pthread_lc_r=yes
9937 else
9938   echo "configure: failed program was:" >&5
9939   cat conftest.$ac_ext >&5
9940   rm -rf conftest*
9941   ol_cv_pthread_lc_r=no
9942 fi
9943 rm -f conftest*
9944 else
9945   cat > conftest.$ac_ext <<EOF
9946 #line 9947 "configure"
9947 #include "confdefs.h"
9948 /* pthread test headers */
9949 #include <pthread.h>
9950 #ifndef NULL
9951 #define NULL (void*)0
9952 #endif
9953
9954 static void *task(p)
9955         void *p;
9956 {
9957         return (void *) (p == NULL);
9958 }
9959
9960
9961 int main(argc, argv)
9962         int argc;
9963         char **argv;
9964 {
9965
9966         /* pthread test function */
9967         pthread_t t;
9968         int status;
9969         int detach = 1;
9970
9971 #ifdef HAVE_PTHREADS_FINAL
9972         /* Final pthreads */
9973         pthread_attr_t attr;
9974
9975         status = pthread_attr_init(&attr);
9976         if( status ) return status;
9977
9978 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9979         if( !detach ) {
9980 #if defined( PTHREAD_CREATE_JOINABLE )
9981                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9982 #else
9983                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9984 #endif
9985
9986 #ifdef PTHREAD_CREATE_DETACHED
9987         } else {
9988                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9989 #endif
9990         }
9991         if( status ) return status;
9992 #endif
9993
9994         status = pthread_create( &t, &attr, task, NULL );
9995         if( status ) return status;
9996
9997 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9998         if( detach ) {
9999                 /* give thread a chance to complete */
10000                 /* it should remain joinable and hence detachable */
10001                 sleep( 1 );
10002
10003                 status = pthread_detach( t );
10004                 if( status ) return status;
10005         }
10006 #endif
10007
10008 #else
10009         /* Draft 4 pthreads */
10010         status = pthread_create( &t, pthread_attr_default, task, NULL );
10011         if( status ) return status;
10012
10013         if( detach ) {
10014                 /* give thread a chance to complete */
10015                 /* it should remain joinable and hence detachable */
10016                 sleep( 1 );
10017
10018                 status = pthread_detach( &t );
10019                 if( status ) return status;
10020         }
10021 #endif
10022
10023 #ifdef HAVE_LINUX_THREADS
10024         pthread_kill_other_threads_np();
10025 #endif
10026
10027         return 0;
10028
10029 }
10030
10031 EOF
10032 if { (eval echo configure:10033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10033 then
10034   ol_cv_pthread_lc_r=yes
10035 else
10036   echo "configure: failed program was:" >&5
10037   cat conftest.$ac_ext >&5
10038   rm -fr conftest*
10039   ol_cv_pthread_lc_r=no
10040 fi
10041 rm -fr conftest*
10042 fi
10043
10044
10045                 # restore the LIBS
10046                 LIBS="$ol_LIBS"
10047         
10048 fi
10049
10050 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10051
10052         if test $ol_cv_pthread_lc_r = yes ; then
10053                 ol_link_pthreads="-lc_r"
10054                 ol_link_threads=posix
10055         fi
10056 fi
10057
10058
10059                 # Pthread try link: -threads (ol_cv_pthread_threads)
10060 if test "$ol_link_threads" = no ; then
10061         # try -threads
10062         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10063 echo "configure:10064: checking for pthread link with -threads" >&5
10064 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10065   echo $ac_n "(cached) $ac_c" 1>&6
10066 else
10067   
10068                 # save the flags
10069                 ol_LIBS="$LIBS"
10070                 LIBS="-threads $LIBS"
10071
10072                 if test "$cross_compiling" = yes; then
10073   cat > conftest.$ac_ext <<EOF
10074 #line 10075 "configure"
10075 #include "confdefs.h"
10076 /* pthread test headers */
10077 #include <pthread.h>
10078 #ifndef NULL
10079 #define NULL (void*)0
10080 #endif
10081
10082 static void *task(p)
10083         void *p;
10084 {
10085         return (void *) (p == NULL);
10086 }
10087
10088 int main() {
10089
10090         /* pthread test function */
10091         pthread_t t;
10092         int status;
10093         int detach = 1;
10094
10095 #ifdef HAVE_PTHREADS_FINAL
10096         /* Final pthreads */
10097         pthread_attr_t attr;
10098
10099         status = pthread_attr_init(&attr);
10100         if( status ) return status;
10101
10102 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10103         if( !detach ) {
10104 #if defined( PTHREAD_CREATE_JOINABLE )
10105                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10106 #else
10107                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10108 #endif
10109
10110 #ifdef PTHREAD_CREATE_DETACHED
10111         } else {
10112                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10113 #endif
10114         }
10115         if( status ) return status;
10116 #endif
10117
10118         status = pthread_create( &t, &attr, task, NULL );
10119         if( status ) return status;
10120
10121 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10122         if( detach ) {
10123                 /* give thread a chance to complete */
10124                 /* it should remain joinable and hence detachable */
10125                 sleep( 1 );
10126
10127                 status = pthread_detach( t );
10128                 if( status ) return status;
10129         }
10130 #endif
10131
10132 #else
10133         /* Draft 4 pthreads */
10134         status = pthread_create( &t, pthread_attr_default, task, NULL );
10135         if( status ) return status;
10136
10137         if( detach ) {
10138                 /* give thread a chance to complete */
10139                 /* it should remain joinable and hence detachable */
10140                 sleep( 1 );
10141
10142                 status = pthread_detach( &t );
10143                 if( status ) return status;
10144         }
10145 #endif
10146
10147 #ifdef HAVE_LINUX_THREADS
10148         pthread_kill_other_threads_np();
10149 #endif
10150
10151         return 0;
10152
10153 ; return 0; }
10154 EOF
10155 if { (eval echo configure:10156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10156   rm -rf conftest*
10157   ol_cv_pthread_threads=yes
10158 else
10159   echo "configure: failed program was:" >&5
10160   cat conftest.$ac_ext >&5
10161   rm -rf conftest*
10162   ol_cv_pthread_threads=no
10163 fi
10164 rm -f conftest*
10165 else
10166   cat > conftest.$ac_ext <<EOF
10167 #line 10168 "configure"
10168 #include "confdefs.h"
10169 /* pthread test headers */
10170 #include <pthread.h>
10171 #ifndef NULL
10172 #define NULL (void*)0
10173 #endif
10174
10175 static void *task(p)
10176         void *p;
10177 {
10178         return (void *) (p == NULL);
10179 }
10180
10181
10182 int main(argc, argv)
10183         int argc;
10184         char **argv;
10185 {
10186
10187         /* pthread test function */
10188         pthread_t t;
10189         int status;
10190         int detach = 1;
10191
10192 #ifdef HAVE_PTHREADS_FINAL
10193         /* Final pthreads */
10194         pthread_attr_t attr;
10195
10196         status = pthread_attr_init(&attr);
10197         if( status ) return status;
10198
10199 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10200         if( !detach ) {
10201 #if defined( PTHREAD_CREATE_JOINABLE )
10202                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10203 #else
10204                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10205 #endif
10206
10207 #ifdef PTHREAD_CREATE_DETACHED
10208         } else {
10209                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10210 #endif
10211         }
10212         if( status ) return status;
10213 #endif
10214
10215         status = pthread_create( &t, &attr, task, NULL );
10216         if( status ) return status;
10217
10218 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10219         if( detach ) {
10220                 /* give thread a chance to complete */
10221                 /* it should remain joinable and hence detachable */
10222                 sleep( 1 );
10223
10224                 status = pthread_detach( t );
10225                 if( status ) return status;
10226         }
10227 #endif
10228
10229 #else
10230         /* Draft 4 pthreads */
10231         status = pthread_create( &t, pthread_attr_default, task, NULL );
10232         if( status ) return status;
10233
10234         if( detach ) {
10235                 /* give thread a chance to complete */
10236                 /* it should remain joinable and hence detachable */
10237                 sleep( 1 );
10238
10239                 status = pthread_detach( &t );
10240                 if( status ) return status;
10241         }
10242 #endif
10243
10244 #ifdef HAVE_LINUX_THREADS
10245         pthread_kill_other_threads_np();
10246 #endif
10247
10248         return 0;
10249
10250 }
10251
10252 EOF
10253 if { (eval echo configure:10254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10254 then
10255   ol_cv_pthread_threads=yes
10256 else
10257   echo "configure: failed program was:" >&5
10258   cat conftest.$ac_ext >&5
10259   rm -fr conftest*
10260   ol_cv_pthread_threads=no
10261 fi
10262 rm -fr conftest*
10263 fi
10264
10265
10266                 # restore the LIBS
10267                 LIBS="$ol_LIBS"
10268         
10269 fi
10270
10271 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10272
10273         if test $ol_cv_pthread_threads = yes ; then
10274                 ol_link_pthreads="-threads"
10275                 ol_link_threads=posix
10276         fi
10277 fi
10278
10279
10280                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10281 if test "$ol_link_threads" = no ; then
10282         # try -lpthreads -lmach -lexc -lc_r
10283         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10284 echo "configure:10285: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10285 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10286   echo $ac_n "(cached) $ac_c" 1>&6
10287 else
10288   
10289                 # save the flags
10290                 ol_LIBS="$LIBS"
10291                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10292
10293                 if test "$cross_compiling" = yes; then
10294   cat > conftest.$ac_ext <<EOF
10295 #line 10296 "configure"
10296 #include "confdefs.h"
10297 /* pthread test headers */
10298 #include <pthread.h>
10299 #ifndef NULL
10300 #define NULL (void*)0
10301 #endif
10302
10303 static void *task(p)
10304         void *p;
10305 {
10306         return (void *) (p == NULL);
10307 }
10308
10309 int main() {
10310
10311         /* pthread test function */
10312         pthread_t t;
10313         int status;
10314         int detach = 1;
10315
10316 #ifdef HAVE_PTHREADS_FINAL
10317         /* Final pthreads */
10318         pthread_attr_t attr;
10319
10320         status = pthread_attr_init(&attr);
10321         if( status ) return status;
10322
10323 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10324         if( !detach ) {
10325 #if defined( PTHREAD_CREATE_JOINABLE )
10326                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10327 #else
10328                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10329 #endif
10330
10331 #ifdef PTHREAD_CREATE_DETACHED
10332         } else {
10333                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10334 #endif
10335         }
10336         if( status ) return status;
10337 #endif
10338
10339         status = pthread_create( &t, &attr, task, NULL );
10340         if( status ) return status;
10341
10342 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10343         if( detach ) {
10344                 /* give thread a chance to complete */
10345                 /* it should remain joinable and hence detachable */
10346                 sleep( 1 );
10347
10348                 status = pthread_detach( t );
10349                 if( status ) return status;
10350         }
10351 #endif
10352
10353 #else
10354         /* Draft 4 pthreads */
10355         status = pthread_create( &t, pthread_attr_default, task, NULL );
10356         if( status ) return status;
10357
10358         if( detach ) {
10359                 /* give thread a chance to complete */
10360                 /* it should remain joinable and hence detachable */
10361                 sleep( 1 );
10362
10363                 status = pthread_detach( &t );
10364                 if( status ) return status;
10365         }
10366 #endif
10367
10368 #ifdef HAVE_LINUX_THREADS
10369         pthread_kill_other_threads_np();
10370 #endif
10371
10372         return 0;
10373
10374 ; return 0; }
10375 EOF
10376 if { (eval echo configure:10377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10377   rm -rf conftest*
10378   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10379 else
10380   echo "configure: failed program was:" >&5
10381   cat conftest.$ac_ext >&5
10382   rm -rf conftest*
10383   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10384 fi
10385 rm -f conftest*
10386 else
10387   cat > conftest.$ac_ext <<EOF
10388 #line 10389 "configure"
10389 #include "confdefs.h"
10390 /* pthread test headers */
10391 #include <pthread.h>
10392 #ifndef NULL
10393 #define NULL (void*)0
10394 #endif
10395
10396 static void *task(p)
10397         void *p;
10398 {
10399         return (void *) (p == NULL);
10400 }
10401
10402
10403 int main(argc, argv)
10404         int argc;
10405         char **argv;
10406 {
10407
10408         /* pthread test function */
10409         pthread_t t;
10410         int status;
10411         int detach = 1;
10412
10413 #ifdef HAVE_PTHREADS_FINAL
10414         /* Final pthreads */
10415         pthread_attr_t attr;
10416
10417         status = pthread_attr_init(&attr);
10418         if( status ) return status;
10419
10420 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10421         if( !detach ) {
10422 #if defined( PTHREAD_CREATE_JOINABLE )
10423                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10424 #else
10425                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10426 #endif
10427
10428 #ifdef PTHREAD_CREATE_DETACHED
10429         } else {
10430                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10431 #endif
10432         }
10433         if( status ) return status;
10434 #endif
10435
10436         status = pthread_create( &t, &attr, task, NULL );
10437         if( status ) return status;
10438
10439 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10440         if( detach ) {
10441                 /* give thread a chance to complete */
10442                 /* it should remain joinable and hence detachable */
10443                 sleep( 1 );
10444
10445                 status = pthread_detach( t );
10446                 if( status ) return status;
10447         }
10448 #endif
10449
10450 #else
10451         /* Draft 4 pthreads */
10452         status = pthread_create( &t, pthread_attr_default, task, NULL );
10453         if( status ) return status;
10454
10455         if( detach ) {
10456                 /* give thread a chance to complete */
10457                 /* it should remain joinable and hence detachable */
10458                 sleep( 1 );
10459
10460                 status = pthread_detach( &t );
10461                 if( status ) return status;
10462         }
10463 #endif
10464
10465 #ifdef HAVE_LINUX_THREADS
10466         pthread_kill_other_threads_np();
10467 #endif
10468
10469         return 0;
10470
10471 }
10472
10473 EOF
10474 if { (eval echo configure:10475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10475 then
10476   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10477 else
10478   echo "configure: failed program was:" >&5
10479   cat conftest.$ac_ext >&5
10480   rm -fr conftest*
10481   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10482 fi
10483 rm -fr conftest*
10484 fi
10485
10486
10487                 # restore the LIBS
10488                 LIBS="$ol_LIBS"
10489         
10490 fi
10491
10492 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10493
10494         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10495                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10496                 ol_link_threads=posix
10497         fi
10498 fi
10499
10500                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10501 if test "$ol_link_threads" = no ; then
10502         # try -lpthreads -lmach -lexc
10503         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10504 echo "configure:10505: checking for pthread link with -lpthreads -lmach -lexc" >&5
10505 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10506   echo $ac_n "(cached) $ac_c" 1>&6
10507 else
10508   
10509                 # save the flags
10510                 ol_LIBS="$LIBS"
10511                 LIBS="-lpthreads -lmach -lexc $LIBS"
10512
10513                 if test "$cross_compiling" = yes; then
10514   cat > conftest.$ac_ext <<EOF
10515 #line 10516 "configure"
10516 #include "confdefs.h"
10517 /* pthread test headers */
10518 #include <pthread.h>
10519 #ifndef NULL
10520 #define NULL (void*)0
10521 #endif
10522
10523 static void *task(p)
10524         void *p;
10525 {
10526         return (void *) (p == NULL);
10527 }
10528
10529 int main() {
10530
10531         /* pthread test function */
10532         pthread_t t;
10533         int status;
10534         int detach = 1;
10535
10536 #ifdef HAVE_PTHREADS_FINAL
10537         /* Final pthreads */
10538         pthread_attr_t attr;
10539
10540         status = pthread_attr_init(&attr);
10541         if( status ) return status;
10542
10543 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10544         if( !detach ) {
10545 #if defined( PTHREAD_CREATE_JOINABLE )
10546                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10547 #else
10548                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10549 #endif
10550
10551 #ifdef PTHREAD_CREATE_DETACHED
10552         } else {
10553                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10554 #endif
10555         }
10556         if( status ) return status;
10557 #endif
10558
10559         status = pthread_create( &t, &attr, task, NULL );
10560         if( status ) return status;
10561
10562 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10563         if( detach ) {
10564                 /* give thread a chance to complete */
10565                 /* it should remain joinable and hence detachable */
10566                 sleep( 1 );
10567
10568                 status = pthread_detach( t );
10569                 if( status ) return status;
10570         }
10571 #endif
10572
10573 #else
10574         /* Draft 4 pthreads */
10575         status = pthread_create( &t, pthread_attr_default, task, NULL );
10576         if( status ) return status;
10577
10578         if( detach ) {
10579                 /* give thread a chance to complete */
10580                 /* it should remain joinable and hence detachable */
10581                 sleep( 1 );
10582
10583                 status = pthread_detach( &t );
10584                 if( status ) return status;
10585         }
10586 #endif
10587
10588 #ifdef HAVE_LINUX_THREADS
10589         pthread_kill_other_threads_np();
10590 #endif
10591
10592         return 0;
10593
10594 ; return 0; }
10595 EOF
10596 if { (eval echo configure:10597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10597   rm -rf conftest*
10598   ol_cv_pthread_lpthreads_lmach_lexc=yes
10599 else
10600   echo "configure: failed program was:" >&5
10601   cat conftest.$ac_ext >&5
10602   rm -rf conftest*
10603   ol_cv_pthread_lpthreads_lmach_lexc=no
10604 fi
10605 rm -f conftest*
10606 else
10607   cat > conftest.$ac_ext <<EOF
10608 #line 10609 "configure"
10609 #include "confdefs.h"
10610 /* pthread test headers */
10611 #include <pthread.h>
10612 #ifndef NULL
10613 #define NULL (void*)0
10614 #endif
10615
10616 static void *task(p)
10617         void *p;
10618 {
10619         return (void *) (p == NULL);
10620 }
10621
10622
10623 int main(argc, argv)
10624         int argc;
10625         char **argv;
10626 {
10627
10628         /* pthread test function */
10629         pthread_t t;
10630         int status;
10631         int detach = 1;
10632
10633 #ifdef HAVE_PTHREADS_FINAL
10634         /* Final pthreads */
10635         pthread_attr_t attr;
10636
10637         status = pthread_attr_init(&attr);
10638         if( status ) return status;
10639
10640 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10641         if( !detach ) {
10642 #if defined( PTHREAD_CREATE_JOINABLE )
10643                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10644 #else
10645                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10646 #endif
10647
10648 #ifdef PTHREAD_CREATE_DETACHED
10649         } else {
10650                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10651 #endif
10652         }
10653         if( status ) return status;
10654 #endif
10655
10656         status = pthread_create( &t, &attr, task, NULL );
10657         if( status ) return status;
10658
10659 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10660         if( detach ) {
10661                 /* give thread a chance to complete */
10662                 /* it should remain joinable and hence detachable */
10663                 sleep( 1 );
10664
10665                 status = pthread_detach( t );
10666                 if( status ) return status;
10667         }
10668 #endif
10669
10670 #else
10671         /* Draft 4 pthreads */
10672         status = pthread_create( &t, pthread_attr_default, task, NULL );
10673         if( status ) return status;
10674
10675         if( detach ) {
10676                 /* give thread a chance to complete */
10677                 /* it should remain joinable and hence detachable */
10678                 sleep( 1 );
10679
10680                 status = pthread_detach( &t );
10681                 if( status ) return status;
10682         }
10683 #endif
10684
10685 #ifdef HAVE_LINUX_THREADS
10686         pthread_kill_other_threads_np();
10687 #endif
10688
10689         return 0;
10690
10691 }
10692
10693 EOF
10694 if { (eval echo configure:10695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10695 then
10696   ol_cv_pthread_lpthreads_lmach_lexc=yes
10697 else
10698   echo "configure: failed program was:" >&5
10699   cat conftest.$ac_ext >&5
10700   rm -fr conftest*
10701   ol_cv_pthread_lpthreads_lmach_lexc=no
10702 fi
10703 rm -fr conftest*
10704 fi
10705
10706
10707                 # restore the LIBS
10708                 LIBS="$ol_LIBS"
10709         
10710 fi
10711
10712 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10713
10714         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10715                 ol_link_pthreads="-lpthreads -lmach -lexc"
10716                 ol_link_threads=posix
10717         fi
10718 fi
10719
10720                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10721 if test "$ol_link_threads" = no ; then
10722         # try -lpthreads -lexc
10723         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10724 echo "configure:10725: checking for pthread link with -lpthreads -lexc" >&5
10725 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10726   echo $ac_n "(cached) $ac_c" 1>&6
10727 else
10728   
10729                 # save the flags
10730                 ol_LIBS="$LIBS"
10731                 LIBS="-lpthreads -lexc $LIBS"
10732
10733                 if test "$cross_compiling" = yes; then
10734   cat > conftest.$ac_ext <<EOF
10735 #line 10736 "configure"
10736 #include "confdefs.h"
10737 /* pthread test headers */
10738 #include <pthread.h>
10739 #ifndef NULL
10740 #define NULL (void*)0
10741 #endif
10742
10743 static void *task(p)
10744         void *p;
10745 {
10746         return (void *) (p == NULL);
10747 }
10748
10749 int main() {
10750
10751         /* pthread test function */
10752         pthread_t t;
10753         int status;
10754         int detach = 1;
10755
10756 #ifdef HAVE_PTHREADS_FINAL
10757         /* Final pthreads */
10758         pthread_attr_t attr;
10759
10760         status = pthread_attr_init(&attr);
10761         if( status ) return status;
10762
10763 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10764         if( !detach ) {
10765 #if defined( PTHREAD_CREATE_JOINABLE )
10766                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10767 #else
10768                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10769 #endif
10770
10771 #ifdef PTHREAD_CREATE_DETACHED
10772         } else {
10773                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10774 #endif
10775         }
10776         if( status ) return status;
10777 #endif
10778
10779         status = pthread_create( &t, &attr, task, NULL );
10780         if( status ) return status;
10781
10782 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10783         if( detach ) {
10784                 /* give thread a chance to complete */
10785                 /* it should remain joinable and hence detachable */
10786                 sleep( 1 );
10787
10788                 status = pthread_detach( t );
10789                 if( status ) return status;
10790         }
10791 #endif
10792
10793 #else
10794         /* Draft 4 pthreads */
10795         status = pthread_create( &t, pthread_attr_default, task, NULL );
10796         if( status ) return status;
10797
10798         if( detach ) {
10799                 /* give thread a chance to complete */
10800                 /* it should remain joinable and hence detachable */
10801                 sleep( 1 );
10802
10803                 status = pthread_detach( &t );
10804                 if( status ) return status;
10805         }
10806 #endif
10807
10808 #ifdef HAVE_LINUX_THREADS
10809         pthread_kill_other_threads_np();
10810 #endif
10811
10812         return 0;
10813
10814 ; return 0; }
10815 EOF
10816 if { (eval echo configure:10817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10817   rm -rf conftest*
10818   ol_cv_pthread_lpthreads_lexc=yes
10819 else
10820   echo "configure: failed program was:" >&5
10821   cat conftest.$ac_ext >&5
10822   rm -rf conftest*
10823   ol_cv_pthread_lpthreads_lexc=no
10824 fi
10825 rm -f conftest*
10826 else
10827   cat > conftest.$ac_ext <<EOF
10828 #line 10829 "configure"
10829 #include "confdefs.h"
10830 /* pthread test headers */
10831 #include <pthread.h>
10832 #ifndef NULL
10833 #define NULL (void*)0
10834 #endif
10835
10836 static void *task(p)
10837         void *p;
10838 {
10839         return (void *) (p == NULL);
10840 }
10841
10842
10843 int main(argc, argv)
10844         int argc;
10845         char **argv;
10846 {
10847
10848         /* pthread test function */
10849         pthread_t t;
10850         int status;
10851         int detach = 1;
10852
10853 #ifdef HAVE_PTHREADS_FINAL
10854         /* Final pthreads */
10855         pthread_attr_t attr;
10856
10857         status = pthread_attr_init(&attr);
10858         if( status ) return status;
10859
10860 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10861         if( !detach ) {
10862 #if defined( PTHREAD_CREATE_JOINABLE )
10863                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10864 #else
10865                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10866 #endif
10867
10868 #ifdef PTHREAD_CREATE_DETACHED
10869         } else {
10870                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10871 #endif
10872         }
10873         if( status ) return status;
10874 #endif
10875
10876         status = pthread_create( &t, &attr, task, NULL );
10877         if( status ) return status;
10878
10879 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10880         if( detach ) {
10881                 /* give thread a chance to complete */
10882                 /* it should remain joinable and hence detachable */
10883                 sleep( 1 );
10884
10885                 status = pthread_detach( t );
10886                 if( status ) return status;
10887         }
10888 #endif
10889
10890 #else
10891         /* Draft 4 pthreads */
10892         status = pthread_create( &t, pthread_attr_default, task, NULL );
10893         if( status ) return status;
10894
10895         if( detach ) {
10896                 /* give thread a chance to complete */
10897                 /* it should remain joinable and hence detachable */
10898                 sleep( 1 );
10899
10900                 status = pthread_detach( &t );
10901                 if( status ) return status;
10902         }
10903 #endif
10904
10905 #ifdef HAVE_LINUX_THREADS
10906         pthread_kill_other_threads_np();
10907 #endif
10908
10909         return 0;
10910
10911 }
10912
10913 EOF
10914 if { (eval echo configure:10915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10915 then
10916   ol_cv_pthread_lpthreads_lexc=yes
10917 else
10918   echo "configure: failed program was:" >&5
10919   cat conftest.$ac_ext >&5
10920   rm -fr conftest*
10921   ol_cv_pthread_lpthreads_lexc=no
10922 fi
10923 rm -fr conftest*
10924 fi
10925
10926
10927                 # restore the LIBS
10928                 LIBS="$ol_LIBS"
10929         
10930 fi
10931
10932 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10933
10934         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10935                 ol_link_pthreads="-lpthreads -lexc"
10936                 ol_link_threads=posix
10937         fi
10938 fi
10939
10940
10941                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10942 if test "$ol_link_threads" = no ; then
10943         # try -lpthreads
10944         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10945 echo "configure:10946: checking for pthread link with -lpthreads" >&5
10946 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10947   echo $ac_n "(cached) $ac_c" 1>&6
10948 else
10949   
10950                 # save the flags
10951                 ol_LIBS="$LIBS"
10952                 LIBS="-lpthreads $LIBS"
10953
10954                 if test "$cross_compiling" = yes; then
10955   cat > conftest.$ac_ext <<EOF
10956 #line 10957 "configure"
10957 #include "confdefs.h"
10958 /* pthread test headers */
10959 #include <pthread.h>
10960 #ifndef NULL
10961 #define NULL (void*)0
10962 #endif
10963
10964 static void *task(p)
10965         void *p;
10966 {
10967         return (void *) (p == NULL);
10968 }
10969
10970 int main() {
10971
10972         /* pthread test function */
10973         pthread_t t;
10974         int status;
10975         int detach = 1;
10976
10977 #ifdef HAVE_PTHREADS_FINAL
10978         /* Final pthreads */
10979         pthread_attr_t attr;
10980
10981         status = pthread_attr_init(&attr);
10982         if( status ) return status;
10983
10984 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10985         if( !detach ) {
10986 #if defined( PTHREAD_CREATE_JOINABLE )
10987                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10988 #else
10989                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10990 #endif
10991
10992 #ifdef PTHREAD_CREATE_DETACHED
10993         } else {
10994                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10995 #endif
10996         }
10997         if( status ) return status;
10998 #endif
10999
11000         status = pthread_create( &t, &attr, task, NULL );
11001         if( status ) return status;
11002
11003 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11004         if( detach ) {
11005                 /* give thread a chance to complete */
11006                 /* it should remain joinable and hence detachable */
11007                 sleep( 1 );
11008
11009                 status = pthread_detach( t );
11010                 if( status ) return status;
11011         }
11012 #endif
11013
11014 #else
11015         /* Draft 4 pthreads */
11016         status = pthread_create( &t, pthread_attr_default, task, NULL );
11017         if( status ) return status;
11018
11019         if( detach ) {
11020                 /* give thread a chance to complete */
11021                 /* it should remain joinable and hence detachable */
11022                 sleep( 1 );
11023
11024                 status = pthread_detach( &t );
11025                 if( status ) return status;
11026         }
11027 #endif
11028
11029 #ifdef HAVE_LINUX_THREADS
11030         pthread_kill_other_threads_np();
11031 #endif
11032
11033         return 0;
11034
11035 ; return 0; }
11036 EOF
11037 if { (eval echo configure:11038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11038   rm -rf conftest*
11039   ol_cv_pthread_lib_lpthreads=yes
11040 else
11041   echo "configure: failed program was:" >&5
11042   cat conftest.$ac_ext >&5
11043   rm -rf conftest*
11044   ol_cv_pthread_lib_lpthreads=no
11045 fi
11046 rm -f conftest*
11047 else
11048   cat > conftest.$ac_ext <<EOF
11049 #line 11050 "configure"
11050 #include "confdefs.h"
11051 /* pthread test headers */
11052 #include <pthread.h>
11053 #ifndef NULL
11054 #define NULL (void*)0
11055 #endif
11056
11057 static void *task(p)
11058         void *p;
11059 {
11060         return (void *) (p == NULL);
11061 }
11062
11063
11064 int main(argc, argv)
11065         int argc;
11066         char **argv;
11067 {
11068
11069         /* pthread test function */
11070         pthread_t t;
11071         int status;
11072         int detach = 1;
11073
11074 #ifdef HAVE_PTHREADS_FINAL
11075         /* Final pthreads */
11076         pthread_attr_t attr;
11077
11078         status = pthread_attr_init(&attr);
11079         if( status ) return status;
11080
11081 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11082         if( !detach ) {
11083 #if defined( PTHREAD_CREATE_JOINABLE )
11084                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11085 #else
11086                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11087 #endif
11088
11089 #ifdef PTHREAD_CREATE_DETACHED
11090         } else {
11091                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11092 #endif
11093         }
11094         if( status ) return status;
11095 #endif
11096
11097         status = pthread_create( &t, &attr, task, NULL );
11098         if( status ) return status;
11099
11100 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11101         if( detach ) {
11102                 /* give thread a chance to complete */
11103                 /* it should remain joinable and hence detachable */
11104                 sleep( 1 );
11105
11106                 status = pthread_detach( t );
11107                 if( status ) return status;
11108         }
11109 #endif
11110
11111 #else
11112         /* Draft 4 pthreads */
11113         status = pthread_create( &t, pthread_attr_default, task, NULL );
11114         if( status ) return status;
11115
11116         if( detach ) {
11117                 /* give thread a chance to complete */
11118                 /* it should remain joinable and hence detachable */
11119                 sleep( 1 );
11120
11121                 status = pthread_detach( &t );
11122                 if( status ) return status;
11123         }
11124 #endif
11125
11126 #ifdef HAVE_LINUX_THREADS
11127         pthread_kill_other_threads_np();
11128 #endif
11129
11130         return 0;
11131
11132 }
11133
11134 EOF
11135 if { (eval echo configure:11136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11136 then
11137   ol_cv_pthread_lib_lpthreads=yes
11138 else
11139   echo "configure: failed program was:" >&5
11140   cat conftest.$ac_ext >&5
11141   rm -fr conftest*
11142   ol_cv_pthread_lib_lpthreads=no
11143 fi
11144 rm -fr conftest*
11145 fi
11146
11147
11148                 # restore the LIBS
11149                 LIBS="$ol_LIBS"
11150         
11151 fi
11152
11153 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11154
11155         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11156                 ol_link_pthreads="-lpthreads"
11157                 ol_link_threads=posix
11158         fi
11159 fi
11160
11161
11162                 if test $ol_link_threads != no ; then
11163                         cat >> confdefs.h <<\EOF
11164 #define HAVE_PTHREADS 1
11165 EOF
11166
11167
11168                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11169
11170                                                 save_CPPFLAGS="$CPPFLAGS"
11171                         save_LIBS="$LIBS"
11172                         LIBS="$LTHREAD_LIBS $LIBS"
11173
11174                                                                                                 for ac_func in sched_yield pthread_yield
11175 do
11176 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11177 echo "configure:11178: checking for $ac_func" >&5
11178 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11179   echo $ac_n "(cached) $ac_c" 1>&6
11180 else
11181   cat > conftest.$ac_ext <<EOF
11182 #line 11183 "configure"
11183 #include "confdefs.h"
11184 /* System header to define __stub macros and hopefully few prototypes,
11185     which can conflict with char $ac_func(); below.  */
11186 #include <assert.h>
11187 /* Override any gcc2 internal prototype to avoid an error.  */
11188 /* We use char because int might match the return type of a gcc2
11189     builtin and then its argument prototype would still apply.  */
11190 char $ac_func();
11191 char (*f)();
11192
11193 int main() {
11194
11195 /* The GNU C library defines this for functions which it implements
11196     to always fail with ENOSYS.  Some functions are actually named
11197     something starting with __ and the normal name is an alias.  */
11198 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11199 choke me
11200 #else
11201 f = $ac_func;
11202 #endif
11203
11204 ; return 0; }
11205 EOF
11206 if { (eval echo configure:11207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11207   rm -rf conftest*
11208   eval "ac_cv_func_$ac_func=yes"
11209 else
11210   echo "configure: failed program was:" >&5
11211   cat conftest.$ac_ext >&5
11212   rm -rf conftest*
11213   eval "ac_cv_func_$ac_func=no"
11214 fi
11215 rm -f conftest*
11216 fi
11217
11218 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11219   echo "$ac_t""yes" 1>&6
11220     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11221   cat >> confdefs.h <<EOF
11222 #define $ac_tr_func 1
11223 EOF
11224  
11225 else
11226   echo "$ac_t""no" 1>&6
11227 fi
11228 done
11229
11230
11231                         if test $ac_cv_func_sched_yield = no -a \
11232                                 $ac_cv_func_pthread_yield = no ; then
11233                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11234 echo "configure:11235: checking for sched_yield in -lrt" >&5
11235 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11236 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11237   echo $ac_n "(cached) $ac_c" 1>&6
11238 else
11239   ac_save_LIBS="$LIBS"
11240 LIBS="-lrt  $LIBS"
11241 cat > conftest.$ac_ext <<EOF
11242 #line 11243 "configure"
11243 #include "confdefs.h"
11244 /* Override any gcc2 internal prototype to avoid an error.  */
11245 /* We use char because int might match the return type of a gcc2
11246     builtin and then its argument prototype would still apply.  */
11247 char sched_yield();
11248
11249 int main() {
11250 sched_yield()
11251 ; return 0; }
11252 EOF
11253 if { (eval echo configure:11254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11254   rm -rf conftest*
11255   eval "ac_cv_lib_$ac_lib_var=yes"
11256 else
11257   echo "configure: failed program was:" >&5
11258   cat conftest.$ac_ext >&5
11259   rm -rf conftest*
11260   eval "ac_cv_lib_$ac_lib_var=no"
11261 fi
11262 rm -f conftest*
11263 LIBS="$ac_save_LIBS"
11264
11265 fi
11266 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11267   echo "$ac_t""yes" 1>&6
11268   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11269                                         cat >> confdefs.h <<\EOF
11270 #define HAVE_SCHED_YIELD 1
11271 EOF
11272
11273                                         ac_cv_func_sched_yield=yes
11274 else
11275   echo "$ac_t""no" 1>&6
11276 ac_cv_func_sched_yield=no
11277 fi
11278
11279                         fi
11280                         if test $ac_cv_func_sched_yield = no -a \
11281                                 $ac_cv_func_pthread_yield = no ; then
11282                                                                                                 for ac_func in thr_yield
11283 do
11284 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11285 echo "configure:11286: checking for $ac_func" >&5
11286 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11287   echo $ac_n "(cached) $ac_c" 1>&6
11288 else
11289   cat > conftest.$ac_ext <<EOF
11290 #line 11291 "configure"
11291 #include "confdefs.h"
11292 /* System header to define __stub macros and hopefully few prototypes,
11293     which can conflict with char $ac_func(); below.  */
11294 #include <assert.h>
11295 /* Override any gcc2 internal prototype to avoid an error.  */
11296 /* We use char because int might match the return type of a gcc2
11297     builtin and then its argument prototype would still apply.  */
11298 char $ac_func();
11299 char (*f)();
11300
11301 int main() {
11302
11303 /* The GNU C library defines this for functions which it implements
11304     to always fail with ENOSYS.  Some functions are actually named
11305     something starting with __ and the normal name is an alias.  */
11306 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11307 choke me
11308 #else
11309 f = $ac_func;
11310 #endif
11311
11312 ; return 0; }
11313 EOF
11314 if { (eval echo configure:11315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11315   rm -rf conftest*
11316   eval "ac_cv_func_$ac_func=yes"
11317 else
11318   echo "configure: failed program was:" >&5
11319   cat conftest.$ac_ext >&5
11320   rm -rf conftest*
11321   eval "ac_cv_func_$ac_func=no"
11322 fi
11323 rm -f conftest*
11324 fi
11325
11326 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11327   echo "$ac_t""yes" 1>&6
11328     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11329   cat >> confdefs.h <<EOF
11330 #define $ac_tr_func 1
11331 EOF
11332  
11333 else
11334   echo "$ac_t""no" 1>&6
11335 fi
11336 done
11337
11338                         fi
11339                         if test $ac_cv_func_sched_yield = no -a \
11340                                 $ac_cv_func_pthread_yield = no -a \
11341                                 "$ac_cv_func_thr_yield" = no ; then
11342                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11343                         fi
11344
11345                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11346 do
11347 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11348 echo "configure:11349: checking for $ac_func" >&5
11349 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11350   echo $ac_n "(cached) $ac_c" 1>&6
11351 else
11352   cat > conftest.$ac_ext <<EOF
11353 #line 11354 "configure"
11354 #include "confdefs.h"
11355 /* System header to define __stub macros and hopefully few prototypes,
11356     which can conflict with char $ac_func(); below.  */
11357 #include <assert.h>
11358 /* Override any gcc2 internal prototype to avoid an error.  */
11359 /* We use char because int might match the return type of a gcc2
11360     builtin and then its argument prototype would still apply.  */
11361 char $ac_func();
11362 char (*f)();
11363
11364 int main() {
11365
11366 /* The GNU C library defines this for functions which it implements
11367     to always fail with ENOSYS.  Some functions are actually named
11368     something starting with __ and the normal name is an alias.  */
11369 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11370 choke me
11371 #else
11372 f = $ac_func;
11373 #endif
11374
11375 ; return 0; }
11376 EOF
11377 if { (eval echo configure:11378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11378   rm -rf conftest*
11379   eval "ac_cv_func_$ac_func=yes"
11380 else
11381   echo "configure: failed program was:" >&5
11382   cat conftest.$ac_ext >&5
11383   rm -rf conftest*
11384   eval "ac_cv_func_$ac_func=no"
11385 fi
11386 rm -f conftest*
11387 fi
11388
11389 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11390   echo "$ac_t""yes" 1>&6
11391     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11392   cat >> confdefs.h <<EOF
11393 #define $ac_tr_func 1
11394 EOF
11395  
11396 else
11397   echo "$ac_t""no" 1>&6
11398 fi
11399 done
11400
11401
11402                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11403 echo "configure:11404: checking for pthread_detach with <pthread.h>" >&5
11404 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11405   echo $ac_n "(cached) $ac_c" 1>&6
11406 else
11407   
11408                                                                 cat > conftest.$ac_ext <<EOF
11409 #line 11410 "configure"
11410 #include "confdefs.h"
11411
11412 #include <pthread.h>
11413 #ifndef NULL
11414 #define NULL (void*)0
11415 #endif
11416
11417 int main() {
11418 pthread_detach(NULL);
11419 ; return 0; }
11420 EOF
11421 if { (eval echo configure:11422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11422   rm -rf conftest*
11423   ol_cv_func_pthread_detach=yes
11424 else
11425   echo "configure: failed program was:" >&5
11426   cat conftest.$ac_ext >&5
11427   rm -rf conftest*
11428   ol_cv_func_pthread_detach=no
11429 fi
11430 rm -f conftest*
11431                         
11432 fi
11433
11434 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11435
11436                         if test $ol_cv_func_pthread_detach = no ; then
11437                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11438                         fi
11439
11440                         cat >> confdefs.h <<\EOF
11441 #define HAVE_PTHREAD_DETACH 1
11442 EOF
11443
11444
11445                                                 for ac_func in \
11446                                 pthread_setconcurrency \
11447                                 pthread_getconcurrency \
11448                                 thr_setconcurrency \
11449                                 thr_getconcurrency \
11450                         
11451 do
11452 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11453 echo "configure:11454: checking for $ac_func" >&5
11454 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11455   echo $ac_n "(cached) $ac_c" 1>&6
11456 else
11457   cat > conftest.$ac_ext <<EOF
11458 #line 11459 "configure"
11459 #include "confdefs.h"
11460 /* System header to define __stub macros and hopefully few prototypes,
11461     which can conflict with char $ac_func(); below.  */
11462 #include <assert.h>
11463 /* Override any gcc2 internal prototype to avoid an error.  */
11464 /* We use char because int might match the return type of a gcc2
11465     builtin and then its argument prototype would still apply.  */
11466 char $ac_func();
11467 char (*f)();
11468
11469 int main() {
11470
11471 /* The GNU C library defines this for functions which it implements
11472     to always fail with ENOSYS.  Some functions are actually named
11473     something starting with __ and the normal name is an alias.  */
11474 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11475 choke me
11476 #else
11477 f = $ac_func;
11478 #endif
11479
11480 ; return 0; }
11481 EOF
11482 if { (eval echo configure:11483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11483   rm -rf conftest*
11484   eval "ac_cv_func_$ac_func=yes"
11485 else
11486   echo "configure: failed program was:" >&5
11487   cat conftest.$ac_ext >&5
11488   rm -rf conftest*
11489   eval "ac_cv_func_$ac_func=no"
11490 fi
11491 rm -f conftest*
11492 fi
11493
11494 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11495   echo "$ac_t""yes" 1>&6
11496     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11497   cat >> confdefs.h <<EOF
11498 #define $ac_tr_func 1
11499 EOF
11500  
11501 else
11502   echo "$ac_t""no" 1>&6
11503 fi
11504 done
11505
11506
11507                         
11508         for ac_func in pthread_kill_other_threads_np
11509 do
11510 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11511 echo "configure:11512: checking for $ac_func" >&5
11512 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11513   echo $ac_n "(cached) $ac_c" 1>&6
11514 else
11515   cat > conftest.$ac_ext <<EOF
11516 #line 11517 "configure"
11517 #include "confdefs.h"
11518 /* System header to define __stub macros and hopefully few prototypes,
11519     which can conflict with char $ac_func(); below.  */
11520 #include <assert.h>
11521 /* Override any gcc2 internal prototype to avoid an error.  */
11522 /* We use char because int might match the return type of a gcc2
11523     builtin and then its argument prototype would still apply.  */
11524 char $ac_func();
11525 char (*f)();
11526
11527 int main() {
11528
11529 /* The GNU C library defines this for functions which it implements
11530     to always fail with ENOSYS.  Some functions are actually named
11531     something starting with __ and the normal name is an alias.  */
11532 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11533 choke me
11534 #else
11535 f = $ac_func;
11536 #endif
11537
11538 ; return 0; }
11539 EOF
11540 if { (eval echo configure:11541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11541   rm -rf conftest*
11542   eval "ac_cv_func_$ac_func=yes"
11543 else
11544   echo "configure: failed program was:" >&5
11545   cat conftest.$ac_ext >&5
11546   rm -rf conftest*
11547   eval "ac_cv_func_$ac_func=no"
11548 fi
11549 rm -f conftest*
11550 fi
11551
11552 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11553   echo "$ac_t""yes" 1>&6
11554     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11555   cat >> confdefs.h <<EOF
11556 #define $ac_tr_func 1
11557 EOF
11558  
11559 else
11560   echo "$ac_t""no" 1>&6
11561 fi
11562 done
11563
11564         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11565 echo "configure:11566: checking for LinuxThreads implementation" >&5
11566 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11567   echo $ac_n "(cached) $ac_c" 1>&6
11568 else
11569   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11570 fi
11571
11572 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11573
11574                         
11575         
11576         
11577         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11578 echo "configure:11579: checking for LinuxThreads consistency" >&5
11579 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11580   echo $ac_n "(cached) $ac_c" 1>&6
11581 else
11582   
11583                 if test $ol_cv_header_linux_threads = yes -a \
11584                         $ol_cv_sys_linux_threads = yes; then
11585                         ol_cv_linux_threads=yes
11586                 elif test $ol_cv_header_linux_threads = no -a \
11587                         $ol_cv_sys_linux_threads = no; then
11588                         ol_cv_linux_threads=no
11589                 else
11590                         ol_cv_linux_threads=error
11591                 fi
11592         
11593 fi
11594
11595 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11596
11597
11598                         if test $ol_cv_linux_threads = error; then
11599                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11600                         fi
11601
11602                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11603 echo "configure:11604: checking if pthread_create() works" >&5
11604 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11605   echo $ac_n "(cached) $ac_c" 1>&6
11606 else
11607   
11608                         if test "$cross_compiling" = yes; then
11609                                 ol_cv_pthread_create_works=yes
11610 else
11611   cat > conftest.$ac_ext <<EOF
11612 #line 11613 "configure"
11613 #include "confdefs.h"
11614 /* pthread test headers */
11615 #include <pthread.h>
11616 #ifndef NULL
11617 #define NULL (void*)0
11618 #endif
11619
11620 static void *task(p)
11621         void *p;
11622 {
11623         return (void *) (p == NULL);
11624 }
11625
11626
11627 int main(argc, argv)
11628         int argc;
11629         char **argv;
11630 {
11631
11632         /* pthread test function */
11633         pthread_t t;
11634         int status;
11635         int detach = 1;
11636
11637 #ifdef HAVE_PTHREADS_FINAL
11638         /* Final pthreads */
11639         pthread_attr_t attr;
11640
11641         status = pthread_attr_init(&attr);
11642         if( status ) return status;
11643
11644 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11645         if( !detach ) {
11646 #if defined( PTHREAD_CREATE_JOINABLE )
11647                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11648 #else
11649                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11650 #endif
11651
11652 #ifdef PTHREAD_CREATE_DETACHED
11653         } else {
11654                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11655 #endif
11656         }
11657         if( status ) return status;
11658 #endif
11659
11660         status = pthread_create( &t, &attr, task, NULL );
11661         if( status ) return status;
11662
11663 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11664         if( detach ) {
11665                 /* give thread a chance to complete */
11666                 /* it should remain joinable and hence detachable */
11667                 sleep( 1 );
11668
11669                 status = pthread_detach( t );
11670                 if( status ) return status;
11671         }
11672 #endif
11673
11674 #else
11675         /* Draft 4 pthreads */
11676         status = pthread_create( &t, pthread_attr_default, task, NULL );
11677         if( status ) return status;
11678
11679         if( detach ) {
11680                 /* give thread a chance to complete */
11681                 /* it should remain joinable and hence detachable */
11682                 sleep( 1 );
11683
11684                 status = pthread_detach( &t );
11685                 if( status ) return status;
11686         }
11687 #endif
11688
11689 #ifdef HAVE_LINUX_THREADS
11690         pthread_kill_other_threads_np();
11691 #endif
11692
11693         return 0;
11694
11695 }
11696
11697 EOF
11698 if { (eval echo configure:11699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11699 then
11700   ol_cv_pthread_create_works=yes
11701 else
11702   echo "configure: failed program was:" >&5
11703   cat conftest.$ac_ext >&5
11704   rm -fr conftest*
11705   ol_cv_pthread_create_works=no
11706 fi
11707 rm -fr conftest*
11708 fi
11709
11710 fi
11711
11712 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11713
11714                         if test $ol_cv_pthread_create_works = no ; then
11715                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11716                         fi
11717
11718                                                 if test $ol_with_yielding_select = auto ; then
11719                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11720 echo "configure:11721: checking if select yields when using pthreads" >&5
11721 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11722   echo $ac_n "(cached) $ac_c" 1>&6
11723 else
11724   
11725                                 if test "$cross_compiling" = yes; then
11726   ol_cv_pthread_select_yields=cross
11727 else
11728   cat > conftest.$ac_ext <<EOF
11729 #line 11730 "configure"
11730 #include "confdefs.h"
11731
11732 #include <sys/types.h>
11733 #include <sys/time.h>
11734 #include <unistd.h>
11735 #include <pthread.h>
11736 #ifndef NULL
11737 #define NULL (void*) 0
11738 #endif
11739
11740 static int fildes[2];
11741
11742 static void *task(p)
11743         void *p;
11744 {
11745         int i;
11746         struct timeval tv;
11747
11748         fd_set rfds;
11749
11750         tv.tv_sec=10;
11751         tv.tv_usec=0;
11752
11753         FD_ZERO(&rfds);
11754         FD_SET(fildes[0], &rfds);
11755
11756         /* we're not interested in any fds */
11757         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11758
11759         if(i < 0) {
11760                 perror("select");
11761                 exit(10);
11762         }
11763
11764         exit(0); /* if we exit here, the select blocked the whole process */
11765 }
11766
11767 int main(argc, argv)
11768         int argc;
11769         char **argv;
11770 {
11771         pthread_t t;
11772
11773         /* create a pipe to select */
11774         if(pipe(&fildes[0])) {
11775                 perror("select");
11776                 exit(1);
11777         }
11778
11779 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11780         (void) pthread_setconcurrency(2);
11781 #else
11782 #ifdef HAVE_THR_SETCONCURRENCY
11783         /* Set Solaris LWP concurrency to 2 */
11784         thr_setconcurrency(2);
11785 #endif
11786 #endif
11787
11788 #if HAVE_PTHREADS_D4
11789         pthread_create(&t, pthread_attr_default, task, NULL);
11790 #else
11791         pthread_create(&t, NULL, task, NULL);
11792 #endif
11793
11794 #if HAVE_SCHED_YIELD
11795         sched_yield();  /* make sure task runs first */
11796 #else
11797 #ifdef HAVE_PTHREAD_YIELD
11798         pthread_yield();        /* make sure task runs first */
11799 #endif
11800 #endif
11801
11802         exit(2);
11803 }
11804 EOF
11805 if { (eval echo configure:11806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11806 then
11807   ol_cv_pthread_select_yields=no
11808 else
11809   echo "configure: failed program was:" >&5
11810   cat conftest.$ac_ext >&5
11811   rm -fr conftest*
11812   ol_cv_pthread_select_yields=yes
11813 fi
11814 rm -fr conftest*
11815 fi
11816
11817 fi
11818
11819 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11820
11821                                 if test $ol_cv_pthread_select_yields = cross ; then
11822                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11823                                 fi
11824
11825                                 if test $ol_cv_pthread_select_yields = yes ; then
11826                                         ol_with_yielding_select=yes
11827                                 fi
11828                         fi
11829
11830                                                 CPPFLAGS="$save_CPPFLAGS"
11831                         LIBS="$save_LIBS"
11832                 else
11833                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11834                 fi
11835         fi
11836
11837         if test $ol_with_threads = posix ; then
11838                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11839         fi
11840 fi
11841
11842 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11843         -o $ol_with_threads = mach ; then
11844
11845                 for ac_hdr in mach/cthreads.h
11846 do
11847 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11848 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11849 echo "configure:11850: checking for $ac_hdr" >&5
11850 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11851   echo $ac_n "(cached) $ac_c" 1>&6
11852 else
11853   cat > conftest.$ac_ext <<EOF
11854 #line 11855 "configure"
11855 #include "confdefs.h"
11856 #include <$ac_hdr>
11857 EOF
11858 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11859 { (eval echo configure:11860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11860 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11861 if test -z "$ac_err"; then
11862   rm -rf conftest*
11863   eval "ac_cv_header_$ac_safe=yes"
11864 else
11865   echo "$ac_err" >&5
11866   echo "configure: failed program was:" >&5
11867   cat conftest.$ac_ext >&5
11868   rm -rf conftest*
11869   eval "ac_cv_header_$ac_safe=no"
11870 fi
11871 rm -f conftest*
11872 fi
11873 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11874   echo "$ac_t""yes" 1>&6
11875     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11876   cat >> confdefs.h <<EOF
11877 #define $ac_tr_hdr 1
11878 EOF
11879  
11880 else
11881   echo "$ac_t""no" 1>&6
11882 fi
11883 done
11884
11885         if test $ac_cv_header_mach_cthreads_h = yes ; then
11886                 ol_with_threads=found
11887
11888                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11889 echo "configure:11890: checking for cthread_fork" >&5
11890 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11891   echo $ac_n "(cached) $ac_c" 1>&6
11892 else
11893   cat > conftest.$ac_ext <<EOF
11894 #line 11895 "configure"
11895 #include "confdefs.h"
11896 /* System header to define __stub macros and hopefully few prototypes,
11897     which can conflict with char cthread_fork(); below.  */
11898 #include <assert.h>
11899 /* Override any gcc2 internal prototype to avoid an error.  */
11900 /* We use char because int might match the return type of a gcc2
11901     builtin and then its argument prototype would still apply.  */
11902 char cthread_fork();
11903 char (*f)();
11904
11905 int main() {
11906
11907 /* The GNU C library defines this for functions which it implements
11908     to always fail with ENOSYS.  Some functions are actually named
11909     something starting with __ and the normal name is an alias.  */
11910 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11911 choke me
11912 #else
11913 f = cthread_fork;
11914 #endif
11915
11916 ; return 0; }
11917 EOF
11918 if { (eval echo configure:11919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11919   rm -rf conftest*
11920   eval "ac_cv_func_cthread_fork=yes"
11921 else
11922   echo "configure: failed program was:" >&5
11923   cat conftest.$ac_ext >&5
11924   rm -rf conftest*
11925   eval "ac_cv_func_cthread_fork=no"
11926 fi
11927 rm -f conftest*
11928 fi
11929
11930 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11931   echo "$ac_t""yes" 1>&6
11932   ol_link_threads=yes
11933 else
11934   echo "$ac_t""no" 1>&6
11935 fi
11936
11937
11938                 if test $ol_link_threads = no ; then
11939                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11940 echo "configure:11941: checking for cthread_fork with -all_load" >&5
11941 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11942   echo $ac_n "(cached) $ac_c" 1>&6
11943 else
11944   
11945                                                                 save_LIBS="$LIBS"
11946                                 LIBS="-all_load $LIBS"
11947                                 cat > conftest.$ac_ext <<EOF
11948 #line 11949 "configure"
11949 #include "confdefs.h"
11950 #include <mach/cthreads.h>
11951 int main() {
11952
11953                                         cthread_fork((void *)0, (void *)0);
11954                                         
11955 ; return 0; }
11956 EOF
11957 if { (eval echo configure:11958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11958   rm -rf conftest*
11959   ol_cv_cthread_all_load=yes
11960 else
11961   echo "configure: failed program was:" >&5
11962   cat conftest.$ac_ext >&5
11963   rm -rf conftest*
11964   ol_cv_cthread_all_load=no
11965 fi
11966 rm -f conftest*
11967                                                                 LIBS="$save_LIBS"
11968                         
11969 fi
11970
11971 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11972
11973                         if test $ol_cv_cthread_all_load = yes ; then
11974                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11975                                 ol_link_threads=mach
11976                         fi
11977                 fi
11978
11979                 if test $ol_link_threads != no ; then
11980                         : check for cthread specific functionality here
11981                         cat >> confdefs.h <<\EOF
11982 #define HAVE_MACH_CTHREADS 1
11983 EOF
11984
11985                 else
11986                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11987                 fi
11988         fi
11989
11990         if test $ol_with_threads = mach ; then
11991                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11992         fi
11993 fi
11994
11995 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11996         -o $ol_with_threads = pth ; then
11997
11998         for ac_hdr in pth.h
11999 do
12000 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12001 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12002 echo "configure:12003: checking for $ac_hdr" >&5
12003 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12004   echo $ac_n "(cached) $ac_c" 1>&6
12005 else
12006   cat > conftest.$ac_ext <<EOF
12007 #line 12008 "configure"
12008 #include "confdefs.h"
12009 #include <$ac_hdr>
12010 EOF
12011 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12012 { (eval echo configure:12013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12013 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12014 if test -z "$ac_err"; then
12015   rm -rf conftest*
12016   eval "ac_cv_header_$ac_safe=yes"
12017 else
12018   echo "$ac_err" >&5
12019   echo "configure: failed program was:" >&5
12020   cat conftest.$ac_ext >&5
12021   rm -rf conftest*
12022   eval "ac_cv_header_$ac_safe=no"
12023 fi
12024 rm -f conftest*
12025 fi
12026 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12027   echo "$ac_t""yes" 1>&6
12028     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12029   cat >> confdefs.h <<EOF
12030 #define $ac_tr_hdr 1
12031 EOF
12032  
12033 else
12034   echo "$ac_t""no" 1>&6
12035 fi
12036 done
12037
12038
12039         if test $ac_cv_header_pth_h = yes ; then
12040                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12041 echo "configure:12042: checking for pth_version in -lpth" >&5
12042 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12043 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12044   echo $ac_n "(cached) $ac_c" 1>&6
12045 else
12046   ac_save_LIBS="$LIBS"
12047 LIBS="-lpth  $LIBS"
12048 cat > conftest.$ac_ext <<EOF
12049 #line 12050 "configure"
12050 #include "confdefs.h"
12051 /* Override any gcc2 internal prototype to avoid an error.  */
12052 /* We use char because int might match the return type of a gcc2
12053     builtin and then its argument prototype would still apply.  */
12054 char pth_version();
12055
12056 int main() {
12057 pth_version()
12058 ; return 0; }
12059 EOF
12060 if { (eval echo configure:12061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12061   rm -rf conftest*
12062   eval "ac_cv_lib_$ac_lib_var=yes"
12063 else
12064   echo "configure: failed program was:" >&5
12065   cat conftest.$ac_ext >&5
12066   rm -rf conftest*
12067   eval "ac_cv_lib_$ac_lib_var=no"
12068 fi
12069 rm -f conftest*
12070 LIBS="$ac_save_LIBS"
12071
12072 fi
12073 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12074   echo "$ac_t""yes" 1>&6
12075   have_pth=yes
12076 else
12077   echo "$ac_t""no" 1>&6
12078 have_pth=no
12079 fi
12080
12081
12082                 if test $have_pth = yes ; then
12083                         cat >> confdefs.h <<\EOF
12084 #define HAVE_GNU_PTH 1
12085 EOF
12086
12087                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12088                         ol_link_threads=pth
12089
12090                         if test $ol_with_yielding_select = auto ; then
12091                                 ol_with_yielding_select=yes
12092                         fi
12093                 fi
12094         fi
12095 fi
12096
12097 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12098         -o $ol_with_threads = lwp ; then
12099
12100                 for ac_hdr in thread.h synch.h
12101 do
12102 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12103 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12104 echo "configure:12105: checking for $ac_hdr" >&5
12105 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12106   echo $ac_n "(cached) $ac_c" 1>&6
12107 else
12108   cat > conftest.$ac_ext <<EOF
12109 #line 12110 "configure"
12110 #include "confdefs.h"
12111 #include <$ac_hdr>
12112 EOF
12113 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12114 { (eval echo configure:12115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12115 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12116 if test -z "$ac_err"; then
12117   rm -rf conftest*
12118   eval "ac_cv_header_$ac_safe=yes"
12119 else
12120   echo "$ac_err" >&5
12121   echo "configure: failed program was:" >&5
12122   cat conftest.$ac_ext >&5
12123   rm -rf conftest*
12124   eval "ac_cv_header_$ac_safe=no"
12125 fi
12126 rm -f conftest*
12127 fi
12128 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12129   echo "$ac_t""yes" 1>&6
12130     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12131   cat >> confdefs.h <<EOF
12132 #define $ac_tr_hdr 1
12133 EOF
12134  
12135 else
12136   echo "$ac_t""no" 1>&6
12137 fi
12138 done
12139
12140         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12141                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12142 echo "configure:12143: checking for thr_create in -lthread" >&5
12143 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12144 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12145   echo $ac_n "(cached) $ac_c" 1>&6
12146 else
12147   ac_save_LIBS="$LIBS"
12148 LIBS="-lthread  $LIBS"
12149 cat > conftest.$ac_ext <<EOF
12150 #line 12151 "configure"
12151 #include "confdefs.h"
12152 /* Override any gcc2 internal prototype to avoid an error.  */
12153 /* We use char because int might match the return type of a gcc2
12154     builtin and then its argument prototype would still apply.  */
12155 char thr_create();
12156
12157 int main() {
12158 thr_create()
12159 ; return 0; }
12160 EOF
12161 if { (eval echo configure:12162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12162   rm -rf conftest*
12163   eval "ac_cv_lib_$ac_lib_var=yes"
12164 else
12165   echo "configure: failed program was:" >&5
12166   cat conftest.$ac_ext >&5
12167   rm -rf conftest*
12168   eval "ac_cv_lib_$ac_lib_var=no"
12169 fi
12170 rm -f conftest*
12171 LIBS="$ac_save_LIBS"
12172
12173 fi
12174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12175   echo "$ac_t""yes" 1>&6
12176   have_thr=yes
12177 else
12178   echo "$ac_t""no" 1>&6
12179 have_thr=no
12180 fi
12181
12182
12183                 if test $have_thr = yes ; then
12184                         cat >> confdefs.h <<\EOF
12185 #define HAVE_THR 1
12186 EOF
12187
12188                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12189                         ol_link_threads=thr
12190
12191                         if test $ol_with_yielding_select = auto ; then
12192                                 ol_with_yielding_select=yes
12193                         fi
12194
12195                                                 for ac_func in \
12196                                 thr_setconcurrency \
12197                                 thr_getconcurrency \
12198                         
12199 do
12200 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12201 echo "configure:12202: checking for $ac_func" >&5
12202 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12203   echo $ac_n "(cached) $ac_c" 1>&6
12204 else
12205   cat > conftest.$ac_ext <<EOF
12206 #line 12207 "configure"
12207 #include "confdefs.h"
12208 /* System header to define __stub macros and hopefully few prototypes,
12209     which can conflict with char $ac_func(); below.  */
12210 #include <assert.h>
12211 /* Override any gcc2 internal prototype to avoid an error.  */
12212 /* We use char because int might match the return type of a gcc2
12213     builtin and then its argument prototype would still apply.  */
12214 char $ac_func();
12215 char (*f)();
12216
12217 int main() {
12218
12219 /* The GNU C library defines this for functions which it implements
12220     to always fail with ENOSYS.  Some functions are actually named
12221     something starting with __ and the normal name is an alias.  */
12222 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12223 choke me
12224 #else
12225 f = $ac_func;
12226 #endif
12227
12228 ; return 0; }
12229 EOF
12230 if { (eval echo configure:12231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12231   rm -rf conftest*
12232   eval "ac_cv_func_$ac_func=yes"
12233 else
12234   echo "configure: failed program was:" >&5
12235   cat conftest.$ac_ext >&5
12236   rm -rf conftest*
12237   eval "ac_cv_func_$ac_func=no"
12238 fi
12239 rm -f conftest*
12240 fi
12241
12242 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12243   echo "$ac_t""yes" 1>&6
12244     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12245   cat >> confdefs.h <<EOF
12246 #define $ac_tr_func 1
12247 EOF
12248  
12249 else
12250   echo "$ac_t""no" 1>&6
12251 fi
12252 done
12253
12254                 fi
12255         fi
12256
12257                 for ac_hdr in lwp/lwp.h
12258 do
12259 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12260 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12261 echo "configure:12262: checking for $ac_hdr" >&5
12262 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12263   echo $ac_n "(cached) $ac_c" 1>&6
12264 else
12265   cat > conftest.$ac_ext <<EOF
12266 #line 12267 "configure"
12267 #include "confdefs.h"
12268 #include <$ac_hdr>
12269 EOF
12270 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12271 { (eval echo configure:12272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12272 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12273 if test -z "$ac_err"; then
12274   rm -rf conftest*
12275   eval "ac_cv_header_$ac_safe=yes"
12276 else
12277   echo "$ac_err" >&5
12278   echo "configure: failed program was:" >&5
12279   cat conftest.$ac_ext >&5
12280   rm -rf conftest*
12281   eval "ac_cv_header_$ac_safe=no"
12282 fi
12283 rm -f conftest*
12284 fi
12285 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12286   echo "$ac_t""yes" 1>&6
12287     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12288   cat >> confdefs.h <<EOF
12289 #define $ac_tr_hdr 1
12290 EOF
12291  
12292 else
12293   echo "$ac_t""no" 1>&6
12294 fi
12295 done
12296
12297         if test $ac_cv_header_lwp_lwp_h = yes ; then
12298                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12299 echo "configure:12300: checking for lwp_create in -llwp" >&5
12300 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12301 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12302   echo $ac_n "(cached) $ac_c" 1>&6
12303 else
12304   ac_save_LIBS="$LIBS"
12305 LIBS="-llwp  $LIBS"
12306 cat > conftest.$ac_ext <<EOF
12307 #line 12308 "configure"
12308 #include "confdefs.h"
12309 /* Override any gcc2 internal prototype to avoid an error.  */
12310 /* We use char because int might match the return type of a gcc2
12311     builtin and then its argument prototype would still apply.  */
12312 char lwp_create();
12313
12314 int main() {
12315 lwp_create()
12316 ; return 0; }
12317 EOF
12318 if { (eval echo configure:12319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12319   rm -rf conftest*
12320   eval "ac_cv_lib_$ac_lib_var=yes"
12321 else
12322   echo "configure: failed program was:" >&5
12323   cat conftest.$ac_ext >&5
12324   rm -rf conftest*
12325   eval "ac_cv_lib_$ac_lib_var=no"
12326 fi
12327 rm -f conftest*
12328 LIBS="$ac_save_LIBS"
12329
12330 fi
12331 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12332   echo "$ac_t""yes" 1>&6
12333   have_lwp=yes
12334 else
12335   echo "$ac_t""no" 1>&6
12336 have_lwp=no
12337 fi
12338
12339
12340                 if test $have_lwp = yes ; then
12341                         cat >> confdefs.h <<\EOF
12342 #define HAVE_LWP 1
12343 EOF
12344
12345                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12346                         ol_link_threads=lwp
12347
12348                         if test $ol_with_yielding_select = auto ; then
12349                                 ol_with_yielding_select=no
12350                         fi
12351                 fi
12352         fi
12353 fi
12354
12355 if test $ol_with_yielding_select = yes ; then
12356         cat >> confdefs.h <<\EOF
12357 #define HAVE_YIELDING_SELECT 1
12358 EOF
12359
12360 fi
12361
12362 if test $ol_with_threads = manual ; then
12363                 ol_link_threads=yes
12364
12365         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12366
12367         for ac_hdr in pthread.h sched.h
12368 do
12369 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12370 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12371 echo "configure:12372: checking for $ac_hdr" >&5
12372 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12373   echo $ac_n "(cached) $ac_c" 1>&6
12374 else
12375   cat > conftest.$ac_ext <<EOF
12376 #line 12377 "configure"
12377 #include "confdefs.h"
12378 #include <$ac_hdr>
12379 EOF
12380 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12381 { (eval echo configure:12382: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12382 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12383 if test -z "$ac_err"; then
12384   rm -rf conftest*
12385   eval "ac_cv_header_$ac_safe=yes"
12386 else
12387   echo "$ac_err" >&5
12388   echo "configure: failed program was:" >&5
12389   cat conftest.$ac_ext >&5
12390   rm -rf conftest*
12391   eval "ac_cv_header_$ac_safe=no"
12392 fi
12393 rm -f conftest*
12394 fi
12395 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12396   echo "$ac_t""yes" 1>&6
12397     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12398   cat >> confdefs.h <<EOF
12399 #define $ac_tr_hdr 1
12400 EOF
12401  
12402 else
12403   echo "$ac_t""no" 1>&6
12404 fi
12405 done
12406
12407         for ac_func in sched_yield pthread_yield
12408 do
12409 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12410 echo "configure:12411: checking for $ac_func" >&5
12411 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12412   echo $ac_n "(cached) $ac_c" 1>&6
12413 else
12414   cat > conftest.$ac_ext <<EOF
12415 #line 12416 "configure"
12416 #include "confdefs.h"
12417 /* System header to define __stub macros and hopefully few prototypes,
12418     which can conflict with char $ac_func(); below.  */
12419 #include <assert.h>
12420 /* Override any gcc2 internal prototype to avoid an error.  */
12421 /* We use char because int might match the return type of a gcc2
12422     builtin and then its argument prototype would still apply.  */
12423 char $ac_func();
12424 char (*f)();
12425
12426 int main() {
12427
12428 /* The GNU C library defines this for functions which it implements
12429     to always fail with ENOSYS.  Some functions are actually named
12430     something starting with __ and the normal name is an alias.  */
12431 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12432 choke me
12433 #else
12434 f = $ac_func;
12435 #endif
12436
12437 ; return 0; }
12438 EOF
12439 if { (eval echo configure:12440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12440   rm -rf conftest*
12441   eval "ac_cv_func_$ac_func=yes"
12442 else
12443   echo "configure: failed program was:" >&5
12444   cat conftest.$ac_ext >&5
12445   rm -rf conftest*
12446   eval "ac_cv_func_$ac_func=no"
12447 fi
12448 rm -f conftest*
12449 fi
12450
12451 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12452   echo "$ac_t""yes" 1>&6
12453     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12454   cat >> confdefs.h <<EOF
12455 #define $ac_tr_func 1
12456 EOF
12457  
12458 else
12459   echo "$ac_t""no" 1>&6
12460 fi
12461 done
12462
12463         
12464         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12465 echo "configure:12466: checking for LinuxThreads pthread.h" >&5
12466 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12467   echo $ac_n "(cached) $ac_c" 1>&6
12468 else
12469   cat > conftest.$ac_ext <<EOF
12470 #line 12471 "configure"
12471 #include "confdefs.h"
12472 #include <pthread.h>
12473 EOF
12474 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12475   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12476   rm -rf conftest*
12477   ol_cv_header_linux_threads=yes
12478 else
12479   rm -rf conftest*
12480   ol_cv_header_linux_threads=no
12481 fi
12482 rm -f conftest*
12483
12484                 
12485 fi
12486
12487 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12488         if test $ol_cv_header_linux_threads = yes; then
12489                 cat >> confdefs.h <<\EOF
12490 #define HAVE_LINUX_THREADS 1
12491 EOF
12492
12493         fi
12494
12495
12496         for ac_hdr in mach/cthreads.h
12497 do
12498 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12499 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12500 echo "configure:12501: checking for $ac_hdr" >&5
12501 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12502   echo $ac_n "(cached) $ac_c" 1>&6
12503 else
12504   cat > conftest.$ac_ext <<EOF
12505 #line 12506 "configure"
12506 #include "confdefs.h"
12507 #include <$ac_hdr>
12508 EOF
12509 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12510 { (eval echo configure:12511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12511 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12512 if test -z "$ac_err"; then
12513   rm -rf conftest*
12514   eval "ac_cv_header_$ac_safe=yes"
12515 else
12516   echo "$ac_err" >&5
12517   echo "configure: failed program was:" >&5
12518   cat conftest.$ac_ext >&5
12519   rm -rf conftest*
12520   eval "ac_cv_header_$ac_safe=no"
12521 fi
12522 rm -f conftest*
12523 fi
12524 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12525   echo "$ac_t""yes" 1>&6
12526     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12527   cat >> confdefs.h <<EOF
12528 #define $ac_tr_hdr 1
12529 EOF
12530  
12531 else
12532   echo "$ac_t""no" 1>&6
12533 fi
12534 done
12535
12536         for ac_hdr in lwp/lwp.h
12537 do
12538 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12539 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12540 echo "configure:12541: checking for $ac_hdr" >&5
12541 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12542   echo $ac_n "(cached) $ac_c" 1>&6
12543 else
12544   cat > conftest.$ac_ext <<EOF
12545 #line 12546 "configure"
12546 #include "confdefs.h"
12547 #include <$ac_hdr>
12548 EOF
12549 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12550 { (eval echo configure:12551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12551 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12552 if test -z "$ac_err"; then
12553   rm -rf conftest*
12554   eval "ac_cv_header_$ac_safe=yes"
12555 else
12556   echo "$ac_err" >&5
12557   echo "configure: failed program was:" >&5
12558   cat conftest.$ac_ext >&5
12559   rm -rf conftest*
12560   eval "ac_cv_header_$ac_safe=no"
12561 fi
12562 rm -f conftest*
12563 fi
12564 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12565   echo "$ac_t""yes" 1>&6
12566     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12567   cat >> confdefs.h <<EOF
12568 #define $ac_tr_hdr 1
12569 EOF
12570  
12571 else
12572   echo "$ac_t""no" 1>&6
12573 fi
12574 done
12575
12576         for ac_hdr in thread.h synch.h
12577 do
12578 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12579 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12580 echo "configure:12581: checking for $ac_hdr" >&5
12581 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12582   echo $ac_n "(cached) $ac_c" 1>&6
12583 else
12584   cat > conftest.$ac_ext <<EOF
12585 #line 12586 "configure"
12586 #include "confdefs.h"
12587 #include <$ac_hdr>
12588 EOF
12589 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12590 { (eval echo configure:12591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12591 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12592 if test -z "$ac_err"; then
12593   rm -rf conftest*
12594   eval "ac_cv_header_$ac_safe=yes"
12595 else
12596   echo "$ac_err" >&5
12597   echo "configure: failed program was:" >&5
12598   cat conftest.$ac_ext >&5
12599   rm -rf conftest*
12600   eval "ac_cv_header_$ac_safe=no"
12601 fi
12602 rm -f conftest*
12603 fi
12604 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12605   echo "$ac_t""yes" 1>&6
12606     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12607   cat >> confdefs.h <<EOF
12608 #define $ac_tr_hdr 1
12609 EOF
12610  
12611 else
12612   echo "$ac_t""no" 1>&6
12613 fi
12614 done
12615
12616 fi
12617
12618 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12619                         cat >> confdefs.h <<\EOF
12620 #define REENTRANT 1
12621 EOF
12622
12623         cat >> confdefs.h <<\EOF
12624 #define _REENTRANT 1
12625 EOF
12626
12627         cat >> confdefs.h <<\EOF
12628 #define THREAD_SAFE 1
12629 EOF
12630
12631         cat >> confdefs.h <<\EOF
12632 #define _THREAD_SAFE 1
12633 EOF
12634
12635         cat >> confdefs.h <<\EOF
12636 #define THREADSAFE 1
12637 EOF
12638
12639         cat >> confdefs.h <<\EOF
12640 #define _THREADSAFE 1
12641 EOF
12642
12643         cat >> confdefs.h <<\EOF
12644 #define _SGI_MP_SOURCE 1
12645 EOF
12646
12647
12648                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12649 echo "configure:12650: checking for thread specific errno" >&5
12650 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12651   echo $ac_n "(cached) $ac_c" 1>&6
12652 else
12653   
12654                 cat > conftest.$ac_ext <<EOF
12655 #line 12656 "configure"
12656 #include "confdefs.h"
12657 #include <errno.h>
12658 int main() {
12659 errno = 0;
12660 ; return 0; }
12661 EOF
12662 if { (eval echo configure:12663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12663   rm -rf conftest*
12664   ol_cv_errno_thread_specific=yes
12665 else
12666   echo "configure: failed program was:" >&5
12667   cat conftest.$ac_ext >&5
12668   rm -rf conftest*
12669   ol_cv_errno_thread_specific=no
12670 fi
12671 rm -f conftest*
12672         
12673 fi
12674
12675 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12676
12677                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12678 echo "configure:12679: checking for thread specific h_errno" >&5
12679 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12680   echo $ac_n "(cached) $ac_c" 1>&6
12681 else
12682   
12683                 cat > conftest.$ac_ext <<EOF
12684 #line 12685 "configure"
12685 #include "confdefs.h"
12686 #include <netdb.h>
12687 int main() {
12688 h_errno = 0;
12689 ; return 0; }
12690 EOF
12691 if { (eval echo configure:12692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12692   rm -rf conftest*
12693   ol_cv_h_errno_thread_specific=yes
12694 else
12695   echo "configure: failed program was:" >&5
12696   cat conftest.$ac_ext >&5
12697   rm -rf conftest*
12698   ol_cv_h_errno_thread_specific=no
12699 fi
12700 rm -f conftest*
12701         
12702 fi
12703
12704 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12705
12706         if test $ol_cv_errno_thread_specific != yes \
12707                 -o $ol_cv_h_errno_thread_specific != yes ; then
12708                 LIBS="$LTHREAD_LIBS $LIBS"
12709                 LTHREAD_LIBS=""
12710         fi
12711
12712 fi  
12713
12714 if test $ol_link_threads = no ; then
12715         if test $ol_with_threads = yes ; then
12716                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12717         fi
12718
12719         if test $ol_with_threads = auto ; then
12720                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12721                 ol_with_threads=no
12722         fi
12723
12724         cat >> confdefs.h <<\EOF
12725 #define NO_THREADS 1
12726 EOF
12727
12728         LTHREAD_LIBS=""
12729 fi
12730
12731 if test $ol_link_threads != no ; then
12732         cat >> confdefs.h <<\EOF
12733 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12734 EOF
12735
12736 fi
12737
12738 ol_link_ldbm=no 
12739
12740 if test $ol_with_ldbm_api = auto \
12741         -o $ol_with_ldbm_api = berkeley \
12742         -o $ol_with_ldbm_api = bcompat ; then
12743
12744         if test $ol_with_ldbm_api = bcompat; then \
12745                 ol_cv_berkeley_db=no
12746 for ac_hdr in db_185.h db.h
12747 do
12748 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12749 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12750 echo "configure:12751: checking for $ac_hdr" >&5
12751 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12752   echo $ac_n "(cached) $ac_c" 1>&6
12753 else
12754   cat > conftest.$ac_ext <<EOF
12755 #line 12756 "configure"
12756 #include "confdefs.h"
12757 #include <$ac_hdr>
12758 EOF
12759 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12760 { (eval echo configure:12761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12761 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12762 if test -z "$ac_err"; then
12763   rm -rf conftest*
12764   eval "ac_cv_header_$ac_safe=yes"
12765 else
12766   echo "$ac_err" >&5
12767   echo "configure: failed program was:" >&5
12768   cat conftest.$ac_ext >&5
12769   rm -rf conftest*
12770   eval "ac_cv_header_$ac_safe=no"
12771 fi
12772 rm -f conftest*
12773 fi
12774 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12775   echo "$ac_t""yes" 1>&6
12776     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12777   cat >> confdefs.h <<EOF
12778 #define $ac_tr_hdr 1
12779 EOF
12780  
12781 else
12782   echo "$ac_t""no" 1>&6
12783 fi
12784 done
12785
12786 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12787         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12788 echo "configure:12789: checking if Berkeley DB header compatibility" >&5
12789 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12790   echo $ac_n "(cached) $ac_c" 1>&6
12791 else
12792   
12793                 cat > conftest.$ac_ext <<EOF
12794 #line 12795 "configure"
12795 #include "confdefs.h"
12796
12797 #if HAVE_DB_185_H
12798 #       include <db_185.h>
12799 #else
12800 #       include <db.h>
12801 #endif
12802
12803  /* this check could be improved */
12804 #ifndef DB_VERSION_MAJOR
12805 #       define DB_VERSION_MAJOR 1
12806 #endif
12807
12808 #if DB_VERSION_MAJOR == 1 
12809         __db_version_1
12810 #endif
12811
12812 EOF
12813 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12814   egrep "__db_version_1" >/dev/null 2>&1; then
12815   rm -rf conftest*
12816   ol_cv_header_db1=yes
12817 else
12818   rm -rf conftest*
12819   ol_cv_header_db1=no
12820 fi
12821 rm -f conftest*
12822
12823 fi
12824
12825 echo "$ac_t""$ol_cv_header_db1" 1>&6
12826
12827         if test $ol_cv_header_db1 = yes ; then
12828                 ol_cv_lib_db=no
12829 if test $ol_cv_lib_db = no ; then
12830         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12831 echo "configure:12832: checking for Berkeley DB link (default)" >&5
12832 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12833   echo $ac_n "(cached) $ac_c" 1>&6
12834 else
12835   
12836         ol_DB_LIB=
12837         ol_LIBS=$LIBS
12838         LIBS="$ol_DB_LIB $LIBS"
12839
12840         cat > conftest.$ac_ext <<EOF
12841 #line 12842 "configure"
12842 #include "confdefs.h"
12843
12844 #ifdef HAVE_DB_185_H
12845 # include <db_185.h>
12846 #else
12847 # include <db.h>
12848 #endif
12849
12850 #ifndef DB_VERSION_MAJOR
12851 # define DB_VERSION_MAJOR 1
12852 #endif
12853
12854 #ifndef NULL
12855 #define NULL ((void*)0)
12856 #endif
12857
12858 int main() {
12859
12860 #if DB_VERSION_MAJOR > 1
12861         {
12862                 char *version;
12863                 int major, minor, patch;
12864
12865                 version = db_version( &major, &minor, &patch );
12866
12867                 if( major != DB_VERSION_MAJOR ||
12868                         minor < DB_VERSION_MINOR )
12869                 {
12870                         printf("Berkeley DB version mismatch\n"
12871                                 "\texpected: %s\n\tgot: %s\n",
12872                                 DB_VERSION_STRING, version);
12873                         return 1;
12874                 }
12875         }
12876 #endif
12877
12878 #if DB_VERSION_MAJOR > 2
12879         db_env_create( NULL, 0 );
12880 #elif DB_VERSION_MAJOR > 1
12881         db_appexit( NULL );
12882 #else
12883         (void) dbopen( NULL, 0, 0, 0, NULL);
12884 #endif
12885
12886 ; return 0; }
12887 EOF
12888 if { (eval echo configure:12889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12889   rm -rf conftest*
12890   ol_cv_db_none=yes
12891 else
12892   echo "configure: failed program was:" >&5
12893   cat conftest.$ac_ext >&5
12894   rm -rf conftest*
12895   ol_cv_db_none=no
12896 fi
12897 rm -f conftest*
12898
12899         LIBS="$ol_LIBS"
12900
12901 fi
12902
12903 echo "$ac_t""$ol_cv_db_none" 1>&6
12904
12905         if test $ol_cv_db_none = yes ; then
12906                 ol_cv_lib_db=yes
12907         fi
12908 fi
12909
12910 if test $ol_cv_lib_db = no ; then
12911         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12912 echo "configure:12913: checking for Berkeley DB link (-ldb)" >&5
12913 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12914   echo $ac_n "(cached) $ac_c" 1>&6
12915 else
12916   
12917         ol_DB_LIB=-ldb
12918         ol_LIBS=$LIBS
12919         LIBS="$ol_DB_LIB $LIBS"
12920
12921         cat > conftest.$ac_ext <<EOF
12922 #line 12923 "configure"
12923 #include "confdefs.h"
12924
12925 #ifdef HAVE_DB_185_H
12926 # include <db_185.h>
12927 #else
12928 # include <db.h>
12929 #endif
12930
12931 #ifndef DB_VERSION_MAJOR
12932 # define DB_VERSION_MAJOR 1
12933 #endif
12934
12935 #ifndef NULL
12936 #define NULL ((void*)0)
12937 #endif
12938
12939 int main() {
12940
12941 #if DB_VERSION_MAJOR > 1
12942         {
12943                 char *version;
12944                 int major, minor, patch;
12945
12946                 version = db_version( &major, &minor, &patch );
12947
12948                 if( major != DB_VERSION_MAJOR ||
12949                         minor < DB_VERSION_MINOR )
12950                 {
12951                         printf("Berkeley DB version mismatch\n"
12952                                 "\texpected: %s\n\tgot: %s\n",
12953                                 DB_VERSION_STRING, version);
12954                         return 1;
12955                 }
12956         }
12957 #endif
12958
12959 #if DB_VERSION_MAJOR > 2
12960         db_env_create( NULL, 0 );
12961 #elif DB_VERSION_MAJOR > 1
12962         db_appexit( NULL );
12963 #else
12964         (void) dbopen( NULL, 0, 0, 0, NULL);
12965 #endif
12966
12967 ; return 0; }
12968 EOF
12969 if { (eval echo configure:12970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12970   rm -rf conftest*
12971   ol_cv_db_db=yes
12972 else
12973   echo "configure: failed program was:" >&5
12974   cat conftest.$ac_ext >&5
12975   rm -rf conftest*
12976   ol_cv_db_db=no
12977 fi
12978 rm -f conftest*
12979
12980         LIBS="$ol_LIBS"
12981
12982 fi
12983
12984 echo "$ac_t""$ol_cv_db_db" 1>&6
12985
12986         if test $ol_cv_db_db = yes ; then
12987                 ol_cv_lib_db=-ldb
12988         fi
12989 fi
12990
12991 if test $ol_cv_lib_db = no ; then
12992         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12993 echo "configure:12994: checking for Berkeley DB link (-ldb3)" >&5
12994 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12995   echo $ac_n "(cached) $ac_c" 1>&6
12996 else
12997   
12998         ol_DB_LIB=-ldb3
12999         ol_LIBS=$LIBS
13000         LIBS="$ol_DB_LIB $LIBS"
13001
13002         cat > conftest.$ac_ext <<EOF
13003 #line 13004 "configure"
13004 #include "confdefs.h"
13005
13006 #ifdef HAVE_DB_185_H
13007 # include <db_185.h>
13008 #else
13009 # include <db.h>
13010 #endif
13011
13012 #ifndef DB_VERSION_MAJOR
13013 # define DB_VERSION_MAJOR 1
13014 #endif
13015
13016 #ifndef NULL
13017 #define NULL ((void*)0)
13018 #endif
13019
13020 int main() {
13021
13022 #if DB_VERSION_MAJOR > 1
13023         {
13024                 char *version;
13025                 int major, minor, patch;
13026
13027                 version = db_version( &major, &minor, &patch );
13028
13029                 if( major != DB_VERSION_MAJOR ||
13030                         minor < DB_VERSION_MINOR )
13031                 {
13032                         printf("Berkeley DB version mismatch\n"
13033                                 "\texpected: %s\n\tgot: %s\n",
13034                                 DB_VERSION_STRING, version);
13035                         return 1;
13036                 }
13037         }
13038 #endif
13039
13040 #if DB_VERSION_MAJOR > 2
13041         db_env_create( NULL, 0 );
13042 #elif DB_VERSION_MAJOR > 1
13043         db_appexit( NULL );
13044 #else
13045         (void) dbopen( NULL, 0, 0, 0, NULL);
13046 #endif
13047
13048 ; return 0; }
13049 EOF
13050 if { (eval echo configure:13051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13051   rm -rf conftest*
13052   ol_cv_db_db3=yes
13053 else
13054   echo "configure: failed program was:" >&5
13055   cat conftest.$ac_ext >&5
13056   rm -rf conftest*
13057   ol_cv_db_db3=no
13058 fi
13059 rm -f conftest*
13060
13061         LIBS="$ol_LIBS"
13062
13063 fi
13064
13065 echo "$ac_t""$ol_cv_db_db3" 1>&6
13066
13067         if test $ol_cv_db_db3 = yes ; then
13068                 ol_cv_lib_db=-ldb3
13069         fi
13070 fi
13071
13072 if test $ol_cv_lib_db = no ; then
13073         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13074 echo "configure:13075: checking for Berkeley DB link (-ldb2)" >&5
13075 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13076   echo $ac_n "(cached) $ac_c" 1>&6
13077 else
13078   
13079         ol_DB_LIB=-ldb2
13080         ol_LIBS=$LIBS
13081         LIBS="$ol_DB_LIB $LIBS"
13082
13083         cat > conftest.$ac_ext <<EOF
13084 #line 13085 "configure"
13085 #include "confdefs.h"
13086
13087 #ifdef HAVE_DB_185_H
13088 # include <db_185.h>
13089 #else
13090 # include <db.h>
13091 #endif
13092
13093 #ifndef DB_VERSION_MAJOR
13094 # define DB_VERSION_MAJOR 1
13095 #endif
13096
13097 #ifndef NULL
13098 #define NULL ((void*)0)
13099 #endif
13100
13101 int main() {
13102
13103 #if DB_VERSION_MAJOR > 1
13104         {
13105                 char *version;
13106                 int major, minor, patch;
13107
13108                 version = db_version( &major, &minor, &patch );
13109
13110                 if( major != DB_VERSION_MAJOR ||
13111                         minor < DB_VERSION_MINOR )
13112                 {
13113                         printf("Berkeley DB version mismatch\n"
13114                                 "\texpected: %s\n\tgot: %s\n",
13115                                 DB_VERSION_STRING, version);
13116                         return 1;
13117                 }
13118         }
13119 #endif
13120
13121 #if DB_VERSION_MAJOR > 2
13122         db_env_create( NULL, 0 );
13123 #elif DB_VERSION_MAJOR > 1
13124         db_appexit( NULL );
13125 #else
13126         (void) dbopen( NULL, 0, 0, 0, NULL);
13127 #endif
13128
13129 ; return 0; }
13130 EOF
13131 if { (eval echo configure:13132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13132   rm -rf conftest*
13133   ol_cv_db_db2=yes
13134 else
13135   echo "configure: failed program was:" >&5
13136   cat conftest.$ac_ext >&5
13137   rm -rf conftest*
13138   ol_cv_db_db2=no
13139 fi
13140 rm -f conftest*
13141
13142         LIBS="$ol_LIBS"
13143
13144 fi
13145
13146 echo "$ac_t""$ol_cv_db_db2" 1>&6
13147
13148         if test $ol_cv_db_db2 = yes ; then
13149                 ol_cv_lib_db=-ldb2
13150         fi
13151 fi
13152
13153 if test $ol_cv_lib_db = no ; then
13154         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13155 echo "configure:13156: checking for Berkeley DB link (-ldb1)" >&5
13156 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13157   echo $ac_n "(cached) $ac_c" 1>&6
13158 else
13159   
13160         ol_DB_LIB=-ldb1
13161         ol_LIBS=$LIBS
13162         LIBS="$ol_DB_LIB $LIBS"
13163
13164         cat > conftest.$ac_ext <<EOF
13165 #line 13166 "configure"
13166 #include "confdefs.h"
13167
13168 #ifdef HAVE_DB_185_H
13169 # include <db_185.h>
13170 #else
13171 # include <db.h>
13172 #endif
13173
13174 #ifndef DB_VERSION_MAJOR
13175 # define DB_VERSION_MAJOR 1
13176 #endif
13177
13178 #ifndef NULL
13179 #define NULL ((void*)0)
13180 #endif
13181
13182 int main() {
13183
13184 #if DB_VERSION_MAJOR > 1
13185         {
13186                 char *version;
13187                 int major, minor, patch;
13188
13189                 version = db_version( &major, &minor, &patch );
13190
13191                 if( major != DB_VERSION_MAJOR ||
13192                         minor < DB_VERSION_MINOR )
13193                 {
13194                         printf("Berkeley DB version mismatch\n"
13195                                 "\texpected: %s\n\tgot: %s\n",
13196                                 DB_VERSION_STRING, version);
13197                         return 1;
13198                 }
13199         }
13200 #endif
13201
13202 #if DB_VERSION_MAJOR > 2
13203         db_env_create( NULL, 0 );
13204 #elif DB_VERSION_MAJOR > 1
13205         db_appexit( NULL );
13206 #else
13207         (void) dbopen( NULL, 0, 0, 0, NULL);
13208 #endif
13209
13210 ; return 0; }
13211 EOF
13212 if { (eval echo configure:13213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13213   rm -rf conftest*
13214   ol_cv_db_db1=yes
13215 else
13216   echo "configure: failed program was:" >&5
13217   cat conftest.$ac_ext >&5
13218   rm -rf conftest*
13219   ol_cv_db_db1=no
13220 fi
13221 rm -f conftest*
13222
13223         LIBS="$ol_LIBS"
13224
13225 fi
13226
13227 echo "$ac_t""$ol_cv_db_db1" 1>&6
13228
13229         if test $ol_cv_db_db1 = yes ; then
13230                 ol_cv_lib_db=-ldb1
13231         fi
13232 fi
13233
13234
13235                 if test "$ol_cv_lib_db" != no ; then
13236                         ol_cv_berkeley_db=yes
13237                 fi
13238         fi
13239 fi
13240
13241         else
13242                 ol_cv_berkeley_db=no
13243 for ac_hdr in db.h
13244 do
13245 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13246 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13247 echo "configure:13248: checking for $ac_hdr" >&5
13248 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13249   echo $ac_n "(cached) $ac_c" 1>&6
13250 else
13251   cat > conftest.$ac_ext <<EOF
13252 #line 13253 "configure"
13253 #include "confdefs.h"
13254 #include <$ac_hdr>
13255 EOF
13256 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13257 { (eval echo configure:13258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13258 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13259 if test -z "$ac_err"; then
13260   rm -rf conftest*
13261   eval "ac_cv_header_$ac_safe=yes"
13262 else
13263   echo "$ac_err" >&5
13264   echo "configure: failed program was:" >&5
13265   cat conftest.$ac_ext >&5
13266   rm -rf conftest*
13267   eval "ac_cv_header_$ac_safe=no"
13268 fi
13269 rm -f conftest*
13270 fi
13271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13272   echo "$ac_t""yes" 1>&6
13273     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13274   cat >> confdefs.h <<EOF
13275 #define $ac_tr_hdr 1
13276 EOF
13277  
13278 else
13279   echo "$ac_t""no" 1>&6
13280 fi
13281 done
13282
13283 if test $ac_cv_header_db_h = yes; then
13284         ol_cv_lib_db=no
13285 if test $ol_cv_lib_db = no ; then
13286         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13287 echo "configure:13288: checking for Berkeley DB link (default)" >&5
13288 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13289   echo $ac_n "(cached) $ac_c" 1>&6
13290 else
13291   
13292         ol_DB_LIB=
13293         ol_LIBS=$LIBS
13294         LIBS="$ol_DB_LIB $LIBS"
13295
13296         cat > conftest.$ac_ext <<EOF
13297 #line 13298 "configure"
13298 #include "confdefs.h"
13299
13300 #ifdef HAVE_DB_185_H
13301 # include <db_185.h>
13302 #else
13303 # include <db.h>
13304 #endif
13305
13306 #ifndef DB_VERSION_MAJOR
13307 # define DB_VERSION_MAJOR 1
13308 #endif
13309
13310 #ifndef NULL
13311 #define NULL ((void*)0)
13312 #endif
13313
13314 int main() {
13315
13316 #if DB_VERSION_MAJOR > 1
13317         {
13318                 char *version;
13319                 int major, minor, patch;
13320
13321                 version = db_version( &major, &minor, &patch );
13322
13323                 if( major != DB_VERSION_MAJOR ||
13324                         minor < DB_VERSION_MINOR )
13325                 {
13326                         printf("Berkeley DB version mismatch\n"
13327                                 "\texpected: %s\n\tgot: %s\n",
13328                                 DB_VERSION_STRING, version);
13329                         return 1;
13330                 }
13331         }
13332 #endif
13333
13334 #if DB_VERSION_MAJOR > 2
13335         db_env_create( NULL, 0 );
13336 #elif DB_VERSION_MAJOR > 1
13337         db_appexit( NULL );
13338 #else
13339         (void) dbopen( NULL, 0, 0, 0, NULL);
13340 #endif
13341
13342 ; return 0; }
13343 EOF
13344 if { (eval echo configure:13345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13345   rm -rf conftest*
13346   ol_cv_db_none=yes
13347 else
13348   echo "configure: failed program was:" >&5
13349   cat conftest.$ac_ext >&5
13350   rm -rf conftest*
13351   ol_cv_db_none=no
13352 fi
13353 rm -f conftest*
13354
13355         LIBS="$ol_LIBS"
13356
13357 fi
13358
13359 echo "$ac_t""$ol_cv_db_none" 1>&6
13360
13361         if test $ol_cv_db_none = yes ; then
13362                 ol_cv_lib_db=yes
13363         fi
13364 fi
13365
13366 if test $ol_cv_lib_db = no ; then
13367         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13368 echo "configure:13369: checking for Berkeley DB link (-ldb)" >&5
13369 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13370   echo $ac_n "(cached) $ac_c" 1>&6
13371 else
13372   
13373         ol_DB_LIB=-ldb
13374         ol_LIBS=$LIBS
13375         LIBS="$ol_DB_LIB $LIBS"
13376
13377         cat > conftest.$ac_ext <<EOF
13378 #line 13379 "configure"
13379 #include "confdefs.h"
13380
13381 #ifdef HAVE_DB_185_H
13382 # include <db_185.h>
13383 #else
13384 # include <db.h>
13385 #endif
13386
13387 #ifndef DB_VERSION_MAJOR
13388 # define DB_VERSION_MAJOR 1
13389 #endif
13390
13391 #ifndef NULL
13392 #define NULL ((void*)0)
13393 #endif
13394
13395 int main() {
13396
13397 #if DB_VERSION_MAJOR > 1
13398         {
13399                 char *version;
13400                 int major, minor, patch;
13401
13402                 version = db_version( &major, &minor, &patch );
13403
13404                 if( major != DB_VERSION_MAJOR ||
13405                         minor < DB_VERSION_MINOR )
13406                 {
13407                         printf("Berkeley DB version mismatch\n"
13408                                 "\texpected: %s\n\tgot: %s\n",
13409                                 DB_VERSION_STRING, version);
13410                         return 1;
13411                 }
13412         }
13413 #endif
13414
13415 #if DB_VERSION_MAJOR > 2
13416         db_env_create( NULL, 0 );
13417 #elif DB_VERSION_MAJOR > 1
13418         db_appexit( NULL );
13419 #else
13420         (void) dbopen( NULL, 0, 0, 0, NULL);
13421 #endif
13422
13423 ; return 0; }
13424 EOF
13425 if { (eval echo configure:13426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13426   rm -rf conftest*
13427   ol_cv_db_db=yes
13428 else
13429   echo "configure: failed program was:" >&5
13430   cat conftest.$ac_ext >&5
13431   rm -rf conftest*
13432   ol_cv_db_db=no
13433 fi
13434 rm -f conftest*
13435
13436         LIBS="$ol_LIBS"
13437
13438 fi
13439
13440 echo "$ac_t""$ol_cv_db_db" 1>&6
13441
13442         if test $ol_cv_db_db = yes ; then
13443                 ol_cv_lib_db=-ldb
13444         fi
13445 fi
13446
13447 if test $ol_cv_lib_db = no ; then
13448         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13449 echo "configure:13450: checking for Berkeley DB link (-ldb3)" >&5
13450 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13451   echo $ac_n "(cached) $ac_c" 1>&6
13452 else
13453   
13454         ol_DB_LIB=-ldb3
13455         ol_LIBS=$LIBS
13456         LIBS="$ol_DB_LIB $LIBS"
13457
13458         cat > conftest.$ac_ext <<EOF
13459 #line 13460 "configure"
13460 #include "confdefs.h"
13461
13462 #ifdef HAVE_DB_185_H
13463 # include <db_185.h>
13464 #else
13465 # include <db.h>
13466 #endif
13467
13468 #ifndef DB_VERSION_MAJOR
13469 # define DB_VERSION_MAJOR 1
13470 #endif
13471
13472 #ifndef NULL
13473 #define NULL ((void*)0)
13474 #endif
13475
13476 int main() {
13477
13478 #if DB_VERSION_MAJOR > 1
13479         {
13480                 char *version;
13481                 int major, minor, patch;
13482
13483                 version = db_version( &major, &minor, &patch );
13484
13485                 if( major != DB_VERSION_MAJOR ||
13486                         minor < DB_VERSION_MINOR )
13487                 {
13488                         printf("Berkeley DB version mismatch\n"
13489                                 "\texpected: %s\n\tgot: %s\n",
13490                                 DB_VERSION_STRING, version);
13491                         return 1;
13492                 }
13493         }
13494 #endif
13495
13496 #if DB_VERSION_MAJOR > 2
13497         db_env_create( NULL, 0 );
13498 #elif DB_VERSION_MAJOR > 1
13499         db_appexit( NULL );
13500 #else
13501         (void) dbopen( NULL, 0, 0, 0, NULL);
13502 #endif
13503
13504 ; return 0; }
13505 EOF
13506 if { (eval echo configure:13507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13507   rm -rf conftest*
13508   ol_cv_db_db3=yes
13509 else
13510   echo "configure: failed program was:" >&5
13511   cat conftest.$ac_ext >&5
13512   rm -rf conftest*
13513   ol_cv_db_db3=no
13514 fi
13515 rm -f conftest*
13516
13517         LIBS="$ol_LIBS"
13518
13519 fi
13520
13521 echo "$ac_t""$ol_cv_db_db3" 1>&6
13522
13523         if test $ol_cv_db_db3 = yes ; then
13524                 ol_cv_lib_db=-ldb3
13525         fi
13526 fi
13527
13528 if test $ol_cv_lib_db = no ; then
13529         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13530 echo "configure:13531: checking for Berkeley DB link (-ldb2)" >&5
13531 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13532   echo $ac_n "(cached) $ac_c" 1>&6
13533 else
13534   
13535         ol_DB_LIB=-ldb2
13536         ol_LIBS=$LIBS
13537         LIBS="$ol_DB_LIB $LIBS"
13538
13539         cat > conftest.$ac_ext <<EOF
13540 #line 13541 "configure"
13541 #include "confdefs.h"
13542
13543 #ifdef HAVE_DB_185_H
13544 # include <db_185.h>
13545 #else
13546 # include <db.h>
13547 #endif
13548
13549 #ifndef DB_VERSION_MAJOR
13550 # define DB_VERSION_MAJOR 1
13551 #endif
13552
13553 #ifndef NULL
13554 #define NULL ((void*)0)
13555 #endif
13556
13557 int main() {
13558
13559 #if DB_VERSION_MAJOR > 1
13560         {
13561                 char *version;
13562                 int major, minor, patch;
13563
13564                 version = db_version( &major, &minor, &patch );
13565
13566                 if( major != DB_VERSION_MAJOR ||
13567                         minor < DB_VERSION_MINOR )
13568                 {
13569                         printf("Berkeley DB version mismatch\n"
13570                                 "\texpected: %s\n\tgot: %s\n",
13571                                 DB_VERSION_STRING, version);
13572                         return 1;
13573                 }
13574         }
13575 #endif
13576
13577 #if DB_VERSION_MAJOR > 2
13578         db_env_create( NULL, 0 );
13579 #elif DB_VERSION_MAJOR > 1
13580         db_appexit( NULL );
13581 #else
13582         (void) dbopen( NULL, 0, 0, 0, NULL);
13583 #endif
13584
13585 ; return 0; }
13586 EOF
13587 if { (eval echo configure:13588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13588   rm -rf conftest*
13589   ol_cv_db_db2=yes
13590 else
13591   echo "configure: failed program was:" >&5
13592   cat conftest.$ac_ext >&5
13593   rm -rf conftest*
13594   ol_cv_db_db2=no
13595 fi
13596 rm -f conftest*
13597
13598         LIBS="$ol_LIBS"
13599
13600 fi
13601
13602 echo "$ac_t""$ol_cv_db_db2" 1>&6
13603
13604         if test $ol_cv_db_db2 = yes ; then
13605                 ol_cv_lib_db=-ldb2
13606         fi
13607 fi
13608
13609 if test $ol_cv_lib_db = no ; then
13610         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13611 echo "configure:13612: checking for Berkeley DB link (-ldb1)" >&5
13612 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13613   echo $ac_n "(cached) $ac_c" 1>&6
13614 else
13615   
13616         ol_DB_LIB=-ldb1
13617         ol_LIBS=$LIBS
13618         LIBS="$ol_DB_LIB $LIBS"
13619
13620         cat > conftest.$ac_ext <<EOF
13621 #line 13622 "configure"
13622 #include "confdefs.h"
13623
13624 #ifdef HAVE_DB_185_H
13625 # include <db_185.h>
13626 #else
13627 # include <db.h>
13628 #endif
13629
13630 #ifndef DB_VERSION_MAJOR
13631 # define DB_VERSION_MAJOR 1
13632 #endif
13633
13634 #ifndef NULL
13635 #define NULL ((void*)0)
13636 #endif
13637
13638 int main() {
13639
13640 #if DB_VERSION_MAJOR > 1
13641         {
13642                 char *version;
13643                 int major, minor, patch;
13644
13645                 version = db_version( &major, &minor, &patch );
13646
13647                 if( major != DB_VERSION_MAJOR ||
13648                         minor < DB_VERSION_MINOR )
13649                 {
13650                         printf("Berkeley DB version mismatch\n"
13651                                 "\texpected: %s\n\tgot: %s\n",
13652                                 DB_VERSION_STRING, version);
13653                         return 1;
13654                 }
13655         }
13656 #endif
13657
13658 #if DB_VERSION_MAJOR > 2
13659         db_env_create( NULL, 0 );
13660 #elif DB_VERSION_MAJOR > 1
13661         db_appexit( NULL );
13662 #else
13663         (void) dbopen( NULL, 0, 0, 0, NULL);
13664 #endif
13665
13666 ; return 0; }
13667 EOF
13668 if { (eval echo configure:13669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13669   rm -rf conftest*
13670   ol_cv_db_db1=yes
13671 else
13672   echo "configure: failed program was:" >&5
13673   cat conftest.$ac_ext >&5
13674   rm -rf conftest*
13675   ol_cv_db_db1=no
13676 fi
13677 rm -f conftest*
13678
13679         LIBS="$ol_LIBS"
13680
13681 fi
13682
13683 echo "$ac_t""$ol_cv_db_db1" 1>&6
13684
13685         if test $ol_cv_db_db1 = yes ; then
13686                 ol_cv_lib_db=-ldb1
13687         fi
13688 fi
13689
13690
13691         if test "$ol_cv_lib_db" != no ; then
13692                 ol_cv_berkeley_db=yes
13693                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13694 echo "configure:13695: checking for Berkeley DB thread support" >&5
13695 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13696   echo $ac_n "(cached) $ac_c" 1>&6
13697 else
13698   
13699         ol_LIBS="$LIBS"
13700         if test $ol_cv_lib_db != yes ; then
13701                 LIBS="$ol_cv_lib_db"
13702         fi
13703
13704         if test "$cross_compiling" = yes; then
13705   ol_cv_berkeley_db_thread=cross
13706 else
13707   cat > conftest.$ac_ext <<EOF
13708 #line 13709 "configure"
13709 #include "confdefs.h"
13710
13711 #ifdef HAVE_DB_185_H
13712         choke me;
13713 #else
13714 #include <db.h>
13715 #endif
13716 #ifndef NULL
13717 #define NULL ((void *)0)
13718 #endif
13719 main()
13720 {
13721         int rc;
13722         u_int32_t flags = DB_CREATE |
13723 #ifdef DB_PRIVATE
13724                 DB_PRIVATE |
13725 #endif
13726                 DB_THREAD;
13727
13728 #if DB_VERSION_MAJOR > 2
13729         DB_ENV *env = NULL;
13730
13731         rc = db_env_create( &env, 0 );
13732
13733         flags |= DB_INIT_MPOOL;
13734 #ifdef DB_MPOOL_PRIVATE
13735         flags |= DB_MPOOL_PRIVATE;
13736 #endif
13737
13738         if( rc ) {
13739                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13740                 return rc;
13741         }
13742
13743 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13744         rc = env->open( env, NULL, flags, 0 );
13745 #else
13746         rc = env->open( env, NULL, NULL, flags, 0 );
13747 #endif
13748
13749         if ( rc == 0 ) {
13750                 rc = env->close( env, 0 );
13751         }
13752
13753         if( rc ) {
13754                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13755                 return rc;
13756         }
13757
13758 #else
13759         DB_ENV env;
13760         memset( &env, '\0', sizeof(env) );
13761
13762         rc = db_appinit( NULL, NULL, &env, flags );
13763
13764         if( rc == 0 ) {
13765                 db_appexit( &env );
13766         }
13767
13768         unlink("__db_mpool.share");
13769         unlink("__db_lock.share");
13770 #endif
13771
13772         return rc;
13773 }
13774 EOF
13775 if { (eval echo configure:13776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13776 then
13777   ol_cv_berkeley_db_thread=yes
13778 else
13779   echo "configure: failed program was:" >&5
13780   cat conftest.$ac_ext >&5
13781   rm -fr conftest*
13782   ol_cv_berkeley_db_thread=no
13783 fi
13784 rm -fr conftest*
13785 fi
13786
13787
13788         LIBS="$ol_LIBS"
13789
13790         if test $ol_cv_berkeley_db_thread != no ; then
13791                 cat >> confdefs.h <<\EOF
13792 #define HAVE_BERKELEY_DB_THREAD 1
13793 EOF
13794
13795         fi
13796
13797 fi
13798
13799 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13800         fi
13801 fi
13802
13803         fi
13804
13805         if test $ol_cv_berkeley_db != no ; then
13806                 cat >> confdefs.h <<\EOF
13807 #define HAVE_BERKELEY_DB 1
13808 EOF
13809
13810
13811                 ol_link_ldbm=berkeley
13812                 ol_with_ldbm_api=berkeley
13813
13814                 if test $ol_with_ldbm_type = hash ; then
13815                         cat >> confdefs.h <<\EOF
13816 #define LDBM_USE_DBHASH 1
13817 EOF
13818
13819                 else
13820                         cat >> confdefs.h <<\EOF
13821 #define LDBM_USE_DBBTREE 1
13822 EOF
13823
13824                 fi
13825
13826                                                 if test $ol_cv_lib_db != yes ; then
13827                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13828                 fi
13829         fi
13830 fi
13831
13832 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
13833         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
13834 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
13835         ol_enable_bdb=yes
13836 fi
13837
13838 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13839         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13840         ol_with_ldbm_api=none
13841 fi
13842
13843 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13844         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13845 echo "configure:13846: checking for MDBM library" >&5
13846 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13847   echo $ac_n "(cached) $ac_c" 1>&6
13848 else
13849         ol_LIBS="$LIBS"
13850         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13851 echo "configure:13852: checking for mdbm_set_chain" >&5
13852 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13853   echo $ac_n "(cached) $ac_c" 1>&6
13854 else
13855   cat > conftest.$ac_ext <<EOF
13856 #line 13857 "configure"
13857 #include "confdefs.h"
13858 /* System header to define __stub macros and hopefully few prototypes,
13859     which can conflict with char mdbm_set_chain(); below.  */
13860 #include <assert.h>
13861 /* Override any gcc2 internal prototype to avoid an error.  */
13862 /* We use char because int might match the return type of a gcc2
13863     builtin and then its argument prototype would still apply.  */
13864 char mdbm_set_chain();
13865 char (*f)();
13866
13867 int main() {
13868
13869 /* The GNU C library defines this for functions which it implements
13870     to always fail with ENOSYS.  Some functions are actually named
13871     something starting with __ and the normal name is an alias.  */
13872 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13873 choke me
13874 #else
13875 f = mdbm_set_chain;
13876 #endif
13877
13878 ; return 0; }
13879 EOF
13880 if { (eval echo configure:13881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13881   rm -rf conftest*
13882   eval "ac_cv_func_mdbm_set_chain=yes"
13883 else
13884   echo "configure: failed program was:" >&5
13885   cat conftest.$ac_ext >&5
13886   rm -rf conftest*
13887   eval "ac_cv_func_mdbm_set_chain=no"
13888 fi
13889 rm -f conftest*
13890 fi
13891
13892 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13893   echo "$ac_t""yes" 1>&6
13894   ol_cv_lib_mdbm=yes
13895 else
13896   echo "$ac_t""no" 1>&6
13897
13898                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13899 echo "configure:13900: checking for mdbm_set_chain in -lmdbm" >&5
13900 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13901 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13902   echo $ac_n "(cached) $ac_c" 1>&6
13903 else
13904   ac_save_LIBS="$LIBS"
13905 LIBS="-lmdbm  $LIBS"
13906 cat > conftest.$ac_ext <<EOF
13907 #line 13908 "configure"
13908 #include "confdefs.h"
13909 /* Override any gcc2 internal prototype to avoid an error.  */
13910 /* We use char because int might match the return type of a gcc2
13911     builtin and then its argument prototype would still apply.  */
13912 char mdbm_set_chain();
13913
13914 int main() {
13915 mdbm_set_chain()
13916 ; return 0; }
13917 EOF
13918 if { (eval echo configure:13919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13919   rm -rf conftest*
13920   eval "ac_cv_lib_$ac_lib_var=yes"
13921 else
13922   echo "configure: failed program was:" >&5
13923   cat conftest.$ac_ext >&5
13924   rm -rf conftest*
13925   eval "ac_cv_lib_$ac_lib_var=no"
13926 fi
13927 rm -f conftest*
13928 LIBS="$ac_save_LIBS"
13929
13930 fi
13931 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13932   echo "$ac_t""yes" 1>&6
13933   ol_cv_lib_mdbm=-lmdbm
13934 else
13935   echo "$ac_t""no" 1>&6
13936 ol_cv_lib_mdbm=no
13937 fi
13938
13939         
13940 fi
13941
13942         LIBS="$ol_LIBS"
13943
13944 fi
13945
13946 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13947
13948
13949  for ac_hdr in mdbm.h
13950 do
13951 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13952 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13953 echo "configure:13954: checking for $ac_hdr" >&5
13954 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13955   echo $ac_n "(cached) $ac_c" 1>&6
13956 else
13957   cat > conftest.$ac_ext <<EOF
13958 #line 13959 "configure"
13959 #include "confdefs.h"
13960 #include <$ac_hdr>
13961 EOF
13962 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13963 { (eval echo configure:13964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13964 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13965 if test -z "$ac_err"; then
13966   rm -rf conftest*
13967   eval "ac_cv_header_$ac_safe=yes"
13968 else
13969   echo "$ac_err" >&5
13970   echo "configure: failed program was:" >&5
13971   cat conftest.$ac_ext >&5
13972   rm -rf conftest*
13973   eval "ac_cv_header_$ac_safe=no"
13974 fi
13975 rm -f conftest*
13976 fi
13977 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13978   echo "$ac_t""yes" 1>&6
13979     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13980   cat >> confdefs.h <<EOF
13981 #define $ac_tr_hdr 1
13982 EOF
13983  
13984 else
13985   echo "$ac_t""no" 1>&6
13986 fi
13987 done
13988
13989  echo $ac_n "checking for db""... $ac_c" 1>&6
13990 echo "configure:13991: checking for db" >&5
13991 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13992   echo $ac_n "(cached) $ac_c" 1>&6
13993 else
13994   
13995         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13996                 ol_cv_mdbm=no
13997         else
13998                 ol_cv_mdbm=yes
13999         fi
14000
14001 fi
14002
14003 echo "$ac_t""$ol_cv_mdbm" 1>&6
14004  if test $ol_cv_mdbm = yes ; then
14005         cat >> confdefs.h <<\EOF
14006 #define HAVE_MDBM 1
14007 EOF
14008
14009  fi
14010
14011
14012         if test $ol_cv_mdbm = yes ; then
14013                 ol_link_ldbm=mdbm
14014                 ol_with_ldbm_api=mdbm
14015                 if test $ol_cv_lib_mdbm != yes ; then
14016                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14017                 fi
14018         fi
14019 fi
14020
14021 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14022         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14023 echo "configure:14024: checking for GDBM library" >&5
14024 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14025   echo $ac_n "(cached) $ac_c" 1>&6
14026 else
14027         ol_LIBS="$LIBS"
14028         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14029 echo "configure:14030: checking for gdbm_open" >&5
14030 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14031   echo $ac_n "(cached) $ac_c" 1>&6
14032 else
14033   cat > conftest.$ac_ext <<EOF
14034 #line 14035 "configure"
14035 #include "confdefs.h"
14036 /* System header to define __stub macros and hopefully few prototypes,
14037     which can conflict with char gdbm_open(); below.  */
14038 #include <assert.h>
14039 /* Override any gcc2 internal prototype to avoid an error.  */
14040 /* We use char because int might match the return type of a gcc2
14041     builtin and then its argument prototype would still apply.  */
14042 char gdbm_open();
14043 char (*f)();
14044
14045 int main() {
14046
14047 /* The GNU C library defines this for functions which it implements
14048     to always fail with ENOSYS.  Some functions are actually named
14049     something starting with __ and the normal name is an alias.  */
14050 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14051 choke me
14052 #else
14053 f = gdbm_open;
14054 #endif
14055
14056 ; return 0; }
14057 EOF
14058 if { (eval echo configure:14059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14059   rm -rf conftest*
14060   eval "ac_cv_func_gdbm_open=yes"
14061 else
14062   echo "configure: failed program was:" >&5
14063   cat conftest.$ac_ext >&5
14064   rm -rf conftest*
14065   eval "ac_cv_func_gdbm_open=no"
14066 fi
14067 rm -f conftest*
14068 fi
14069
14070 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14071   echo "$ac_t""yes" 1>&6
14072   ol_cv_lib_gdbm=yes
14073 else
14074   echo "$ac_t""no" 1>&6
14075
14076                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14077 echo "configure:14078: checking for gdbm_open in -lgdbm" >&5
14078 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14079 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14080   echo $ac_n "(cached) $ac_c" 1>&6
14081 else
14082   ac_save_LIBS="$LIBS"
14083 LIBS="-lgdbm  $LIBS"
14084 cat > conftest.$ac_ext <<EOF
14085 #line 14086 "configure"
14086 #include "confdefs.h"
14087 /* Override any gcc2 internal prototype to avoid an error.  */
14088 /* We use char because int might match the return type of a gcc2
14089     builtin and then its argument prototype would still apply.  */
14090 char gdbm_open();
14091
14092 int main() {
14093 gdbm_open()
14094 ; return 0; }
14095 EOF
14096 if { (eval echo configure:14097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14097   rm -rf conftest*
14098   eval "ac_cv_lib_$ac_lib_var=yes"
14099 else
14100   echo "configure: failed program was:" >&5
14101   cat conftest.$ac_ext >&5
14102   rm -rf conftest*
14103   eval "ac_cv_lib_$ac_lib_var=no"
14104 fi
14105 rm -f conftest*
14106 LIBS="$ac_save_LIBS"
14107
14108 fi
14109 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14110   echo "$ac_t""yes" 1>&6
14111   ol_cv_lib_gdbm=-lgdbm
14112 else
14113   echo "$ac_t""no" 1>&6
14114 ol_cv_lib_gdbm=no
14115 fi
14116
14117         
14118 fi
14119
14120         LIBS="$ol_LIBS"
14121
14122 fi
14123
14124 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14125
14126
14127  for ac_hdr in gdbm.h
14128 do
14129 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14130 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14131 echo "configure:14132: checking for $ac_hdr" >&5
14132 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14133   echo $ac_n "(cached) $ac_c" 1>&6
14134 else
14135   cat > conftest.$ac_ext <<EOF
14136 #line 14137 "configure"
14137 #include "confdefs.h"
14138 #include <$ac_hdr>
14139 EOF
14140 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14141 { (eval echo configure:14142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14142 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14143 if test -z "$ac_err"; then
14144   rm -rf conftest*
14145   eval "ac_cv_header_$ac_safe=yes"
14146 else
14147   echo "$ac_err" >&5
14148   echo "configure: failed program was:" >&5
14149   cat conftest.$ac_ext >&5
14150   rm -rf conftest*
14151   eval "ac_cv_header_$ac_safe=no"
14152 fi
14153 rm -f conftest*
14154 fi
14155 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14156   echo "$ac_t""yes" 1>&6
14157     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14158   cat >> confdefs.h <<EOF
14159 #define $ac_tr_hdr 1
14160 EOF
14161  
14162 else
14163   echo "$ac_t""no" 1>&6
14164 fi
14165 done
14166
14167  echo $ac_n "checking for db""... $ac_c" 1>&6
14168 echo "configure:14169: checking for db" >&5
14169 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14170   echo $ac_n "(cached) $ac_c" 1>&6
14171 else
14172   
14173         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14174                 ol_cv_gdbm=no
14175         else
14176                 ol_cv_gdbm=yes
14177         fi
14178
14179 fi
14180
14181 echo "$ac_t""$ol_cv_gdbm" 1>&6
14182  if test $ol_cv_gdbm = yes ; then
14183         cat >> confdefs.h <<\EOF
14184 #define HAVE_GDBM 1
14185 EOF
14186
14187  fi
14188
14189
14190         if test $ol_cv_gdbm = yes ; then
14191                 ol_link_ldbm=gdbm
14192                 ol_with_ldbm_api=gdbm
14193
14194                 if test $ol_cv_lib_gdbm != yes ; then
14195                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14196                 fi
14197         fi
14198 fi
14199
14200 if test $ol_with_ldbm_api = ndbm ; then
14201         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14202 echo "configure:14203: checking for NDBM library" >&5
14203 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14204   echo $ac_n "(cached) $ac_c" 1>&6
14205 else
14206         ol_LIBS="$LIBS"
14207         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14208 echo "configure:14209: checking for dbm_open" >&5
14209 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14210   echo $ac_n "(cached) $ac_c" 1>&6
14211 else
14212   cat > conftest.$ac_ext <<EOF
14213 #line 14214 "configure"
14214 #include "confdefs.h"
14215 /* System header to define __stub macros and hopefully few prototypes,
14216     which can conflict with char dbm_open(); below.  */
14217 #include <assert.h>
14218 /* Override any gcc2 internal prototype to avoid an error.  */
14219 /* We use char because int might match the return type of a gcc2
14220     builtin and then its argument prototype would still apply.  */
14221 char dbm_open();
14222 char (*f)();
14223
14224 int main() {
14225
14226 /* The GNU C library defines this for functions which it implements
14227     to always fail with ENOSYS.  Some functions are actually named
14228     something starting with __ and the normal name is an alias.  */
14229 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14230 choke me
14231 #else
14232 f = dbm_open;
14233 #endif
14234
14235 ; return 0; }
14236 EOF
14237 if { (eval echo configure:14238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14238   rm -rf conftest*
14239   eval "ac_cv_func_dbm_open=yes"
14240 else
14241   echo "configure: failed program was:" >&5
14242   cat conftest.$ac_ext >&5
14243   rm -rf conftest*
14244   eval "ac_cv_func_dbm_open=no"
14245 fi
14246 rm -f conftest*
14247 fi
14248
14249 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14250   echo "$ac_t""yes" 1>&6
14251   ol_cv_lib_ndbm=yes
14252 else
14253   echo "$ac_t""no" 1>&6
14254
14255                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14256 echo "configure:14257: checking for dbm_open in -lndbm" >&5
14257 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14259   echo $ac_n "(cached) $ac_c" 1>&6
14260 else
14261   ac_save_LIBS="$LIBS"
14262 LIBS="-lndbm  $LIBS"
14263 cat > conftest.$ac_ext <<EOF
14264 #line 14265 "configure"
14265 #include "confdefs.h"
14266 /* Override any gcc2 internal prototype to avoid an error.  */
14267 /* We use char because int might match the return type of a gcc2
14268     builtin and then its argument prototype would still apply.  */
14269 char dbm_open();
14270
14271 int main() {
14272 dbm_open()
14273 ; return 0; }
14274 EOF
14275 if { (eval echo configure:14276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14276   rm -rf conftest*
14277   eval "ac_cv_lib_$ac_lib_var=yes"
14278 else
14279   echo "configure: failed program was:" >&5
14280   cat conftest.$ac_ext >&5
14281   rm -rf conftest*
14282   eval "ac_cv_lib_$ac_lib_var=no"
14283 fi
14284 rm -f conftest*
14285 LIBS="$ac_save_LIBS"
14286
14287 fi
14288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14289   echo "$ac_t""yes" 1>&6
14290   ol_cv_lib_ndbm=-lndbm
14291 else
14292   echo "$ac_t""no" 1>&6
14293
14294                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14295 echo "configure:14296: checking for dbm_open in -ldbm" >&5
14296 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14297 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14298   echo $ac_n "(cached) $ac_c" 1>&6
14299 else
14300   ac_save_LIBS="$LIBS"
14301 LIBS="-ldbm  $LIBS"
14302 cat > conftest.$ac_ext <<EOF
14303 #line 14304 "configure"
14304 #include "confdefs.h"
14305 /* Override any gcc2 internal prototype to avoid an error.  */
14306 /* We use char because int might match the return type of a gcc2
14307     builtin and then its argument prototype would still apply.  */
14308 char dbm_open();
14309
14310 int main() {
14311 dbm_open()
14312 ; return 0; }
14313 EOF
14314 if { (eval echo configure:14315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14315   rm -rf conftest*
14316   eval "ac_cv_lib_$ac_lib_var=yes"
14317 else
14318   echo "configure: failed program was:" >&5
14319   cat conftest.$ac_ext >&5
14320   rm -rf conftest*
14321   eval "ac_cv_lib_$ac_lib_var=no"
14322 fi
14323 rm -f conftest*
14324 LIBS="$ac_save_LIBS"
14325
14326 fi
14327 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14328   echo "$ac_t""yes" 1>&6
14329   ol_cv_lib_ndbm=-ldbm
14330 else
14331   echo "$ac_t""no" 1>&6
14332 ol_cv_lib_ndbm=no
14333 fi
14334                 
14335 fi
14336
14337         
14338 fi
14339
14340         LIBS="$ol_LIBS"
14341
14342 fi
14343
14344 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14345
14346
14347  for ac_hdr in ndbm.h
14348 do
14349 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14350 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14351 echo "configure:14352: checking for $ac_hdr" >&5
14352 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14353   echo $ac_n "(cached) $ac_c" 1>&6
14354 else
14355   cat > conftest.$ac_ext <<EOF
14356 #line 14357 "configure"
14357 #include "confdefs.h"
14358 #include <$ac_hdr>
14359 EOF
14360 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14361 { (eval echo configure:14362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14362 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14363 if test -z "$ac_err"; then
14364   rm -rf conftest*
14365   eval "ac_cv_header_$ac_safe=yes"
14366 else
14367   echo "$ac_err" >&5
14368   echo "configure: failed program was:" >&5
14369   cat conftest.$ac_ext >&5
14370   rm -rf conftest*
14371   eval "ac_cv_header_$ac_safe=no"
14372 fi
14373 rm -f conftest*
14374 fi
14375 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14376   echo "$ac_t""yes" 1>&6
14377     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14378   cat >> confdefs.h <<EOF
14379 #define $ac_tr_hdr 1
14380 EOF
14381  
14382 else
14383   echo "$ac_t""no" 1>&6
14384 fi
14385 done
14386
14387  echo $ac_n "checking for db""... $ac_c" 1>&6
14388 echo "configure:14389: checking for db" >&5
14389 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14390   echo $ac_n "(cached) $ac_c" 1>&6
14391 else
14392   
14393         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14394                 ol_cv_ndbm=no
14395         else
14396                 ol_cv_ndbm=yes
14397         fi
14398
14399 fi
14400
14401 echo "$ac_t""$ol_cv_ndbm" 1>&6
14402  if test $ol_cv_ndbm = yes ; then
14403         cat >> confdefs.h <<\EOF
14404 #define HAVE_NDBM 1
14405 EOF
14406
14407  fi
14408
14409
14410         if test $ol_cv_ndbm = yes ; then
14411                 ol_link_ldbm=ndbm
14412                 ol_with_ldbm_api=ndbm
14413
14414                 if test $ol_cv_lib_ndbm != yes ; then
14415                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14416                 fi
14417         fi
14418 fi
14419
14420 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14421         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14422         if test $ol_enable_ldbm = yes ; then
14423                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14424         fi
14425
14426         echo "configure: warning: disabling LDBM" 1>&2
14427         ol_enable_ldbm=no
14428 fi
14429
14430 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14431         LINK_BINS_DYNAMIC="yes"
14432 else
14433         LINK_BINS_DYNAMIC="no"
14434 fi
14435
14436 if test $ol_enable_wrappers != no ; then
14437         for ac_hdr in tcpd.h
14438 do
14439 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14440 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14441 echo "configure:14442: checking for $ac_hdr" >&5
14442 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14443   echo $ac_n "(cached) $ac_c" 1>&6
14444 else
14445   cat > conftest.$ac_ext <<EOF
14446 #line 14447 "configure"
14447 #include "confdefs.h"
14448 #include <$ac_hdr>
14449 EOF
14450 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14451 { (eval echo configure:14452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14452 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14453 if test -z "$ac_err"; then
14454   rm -rf conftest*
14455   eval "ac_cv_header_$ac_safe=yes"
14456 else
14457   echo "$ac_err" >&5
14458   echo "configure: failed program was:" >&5
14459   cat conftest.$ac_ext >&5
14460   rm -rf conftest*
14461   eval "ac_cv_header_$ac_safe=no"
14462 fi
14463 rm -f conftest*
14464 fi
14465 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14466   echo "$ac_t""yes" 1>&6
14467     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14468   cat >> confdefs.h <<EOF
14469 #define $ac_tr_hdr 1
14470 EOF
14471  
14472 else
14473   echo "$ac_t""no" 1>&6
14474 fi
14475 done
14476
14477
14478         if test $ac_cv_header_tcpd_h != yes ; then
14479                 have_wrappers=no
14480         else
14481                 cat > conftest.$ac_ext <<EOF
14482 #line 14483 "configure"
14483 #include "confdefs.h"
14484
14485 int allow_severity = 0;
14486 int deny_severity  = 0;
14487                 
14488 int main() {
14489 hosts_access()
14490 ; return 0; }
14491 EOF
14492 if { (eval echo configure:14493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14493   rm -rf conftest*
14494   have_wrappers=yes
14495 else
14496   echo "configure: failed program was:" >&5
14497   cat conftest.$ac_ext >&5
14498   rm -rf conftest*
14499   have_wrappers=no
14500 fi
14501 rm -f conftest*
14502         fi
14503
14504         if test $have_wrappers = yes ; then
14505                 cat >> confdefs.h <<\EOF
14506 #define HAVE_TCPD 1
14507 EOF
14508
14509                 WRAP_LIBS="-lwrap"
14510
14511                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14512 echo "configure:14513: checking for main in -lnsl" >&5
14513 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14514 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14515   echo $ac_n "(cached) $ac_c" 1>&6
14516 else
14517   ac_save_LIBS="$LIBS"
14518 LIBS="-lnsl  $LIBS"
14519 cat > conftest.$ac_ext <<EOF
14520 #line 14521 "configure"
14521 #include "confdefs.h"
14522
14523 int main() {
14524 main()
14525 ; return 0; }
14526 EOF
14527 if { (eval echo configure:14528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14528   rm -rf conftest*
14529   eval "ac_cv_lib_$ac_lib_var=yes"
14530 else
14531   echo "configure: failed program was:" >&5
14532   cat conftest.$ac_ext >&5
14533   rm -rf conftest*
14534   eval "ac_cv_lib_$ac_lib_var=no"
14535 fi
14536 rm -f conftest*
14537 LIBS="$ac_save_LIBS"
14538
14539 fi
14540 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14541   echo "$ac_t""yes" 1>&6
14542     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14543     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14544   cat >> confdefs.h <<EOF
14545 #define $ac_tr_lib 1
14546 EOF
14547
14548   LIBS="-lnsl $LIBS"
14549
14550 else
14551   echo "$ac_t""no" 1>&6
14552 fi
14553
14554         else
14555                 echo "configure: warning: could not find -lwrap" 1>&2
14556                 if test $ol_enable_wrappers = yes ; then
14557                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14558                 fi
14559
14560                 echo "configure: warning: disabling wrappers support" 1>&2
14561                 ol_enable_wrappers=no
14562                 WRAP_LIBS=""
14563         fi
14564 fi
14565
14566 if test $ol_enable_syslog != no ; then
14567         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14568 echo "configure:14569: checking for openlog" >&5
14569 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14570   echo $ac_n "(cached) $ac_c" 1>&6
14571 else
14572   cat > conftest.$ac_ext <<EOF
14573 #line 14574 "configure"
14574 #include "confdefs.h"
14575 /* System header to define __stub macros and hopefully few prototypes,
14576     which can conflict with char openlog(); below.  */
14577 #include <assert.h>
14578 /* Override any gcc2 internal prototype to avoid an error.  */
14579 /* We use char because int might match the return type of a gcc2
14580     builtin and then its argument prototype would still apply.  */
14581 char openlog();
14582 char (*f)();
14583
14584 int main() {
14585
14586 /* The GNU C library defines this for functions which it implements
14587     to always fail with ENOSYS.  Some functions are actually named
14588     something starting with __ and the normal name is an alias.  */
14589 #if defined (__stub_openlog) || defined (__stub___openlog)
14590 choke me
14591 #else
14592 f = openlog;
14593 #endif
14594
14595 ; return 0; }
14596 EOF
14597 if { (eval echo configure:14598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14598   rm -rf conftest*
14599   eval "ac_cv_func_openlog=yes"
14600 else
14601   echo "configure: failed program was:" >&5
14602   cat conftest.$ac_ext >&5
14603   rm -rf conftest*
14604   eval "ac_cv_func_openlog=no"
14605 fi
14606 rm -f conftest*
14607 fi
14608
14609 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14610   echo "$ac_t""yes" 1>&6
14611   :
14612 else
14613   echo "$ac_t""no" 1>&6
14614 fi
14615
14616         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14617                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14618         fi
14619         ol_enable_syslog=$ac_cv_func_openlog
14620 fi
14621
14622
14623 ol_link_sql=no
14624 if test $ol_enable_sql != no ; then
14625         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14626 echo "configure:14627: checking for SQLDriverConnect in -liodbc" >&5
14627 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14628 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14629   echo $ac_n "(cached) $ac_c" 1>&6
14630 else
14631   ac_save_LIBS="$LIBS"
14632 LIBS="-liodbc  $LIBS"
14633 cat > conftest.$ac_ext <<EOF
14634 #line 14635 "configure"
14635 #include "confdefs.h"
14636 /* Override any gcc2 internal prototype to avoid an error.  */
14637 /* We use char because int might match the return type of a gcc2
14638     builtin and then its argument prototype would still apply.  */
14639 char SQLDriverConnect();
14640
14641 int main() {
14642 SQLDriverConnect()
14643 ; return 0; }
14644 EOF
14645 if { (eval echo configure:14646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14646   rm -rf conftest*
14647   eval "ac_cv_lib_$ac_lib_var=yes"
14648 else
14649   echo "configure: failed program was:" >&5
14650   cat conftest.$ac_ext >&5
14651   rm -rf conftest*
14652   eval "ac_cv_lib_$ac_lib_var=no"
14653 fi
14654 rm -f conftest*
14655 LIBS="$ac_save_LIBS"
14656
14657 fi
14658 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14659   echo "$ac_t""yes" 1>&6
14660   have_iodbc=yes
14661 else
14662   echo "$ac_t""no" 1>&6
14663 have_iodbc=no
14664 fi
14665
14666         if test $have_iodbc = yes ; then
14667                 ol_link_sql="-liodbc"
14668         else
14669                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14670 echo "configure:14671: checking for SQLDriverConnect in -lodbc" >&5
14671 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14672 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14673   echo $ac_n "(cached) $ac_c" 1>&6
14674 else
14675   ac_save_LIBS="$LIBS"
14676 LIBS="-lodbc  $LIBS"
14677 cat > conftest.$ac_ext <<EOF
14678 #line 14679 "configure"
14679 #include "confdefs.h"
14680 /* Override any gcc2 internal prototype to avoid an error.  */
14681 /* We use char because int might match the return type of a gcc2
14682     builtin and then its argument prototype would still apply.  */
14683 char SQLDriverConnect();
14684
14685 int main() {
14686 SQLDriverConnect()
14687 ; return 0; }
14688 EOF
14689 if { (eval echo configure:14690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14690   rm -rf conftest*
14691   eval "ac_cv_lib_$ac_lib_var=yes"
14692 else
14693   echo "configure: failed program was:" >&5
14694   cat conftest.$ac_ext >&5
14695   rm -rf conftest*
14696   eval "ac_cv_lib_$ac_lib_var=no"
14697 fi
14698 rm -f conftest*
14699 LIBS="$ac_save_LIBS"
14700
14701 fi
14702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14703   echo "$ac_t""yes" 1>&6
14704   have_odbc=yes
14705 else
14706   echo "$ac_t""no" 1>&6
14707 have_odbc=no
14708 fi
14709
14710                 if test $have_odbc = yes ; then
14711                         ol_link_sql="-lodbc"
14712                 fi
14713         fi
14714
14715         if test $ol_link_sql != no ; then
14716                 SLAPD_SQL_LIBS="$ol_link_sql"
14717
14718         elif test $ol_enable_sql != auto ; then
14719                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14720         fi
14721 fi
14722
14723 if test $ol_enable_tcl != no ; then
14724         for ac_hdr in tcl.h
14725 do
14726 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14727 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14728 echo "configure:14729: checking for $ac_hdr" >&5
14729 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14730   echo $ac_n "(cached) $ac_c" 1>&6
14731 else
14732   cat > conftest.$ac_ext <<EOF
14733 #line 14734 "configure"
14734 #include "confdefs.h"
14735 #include <$ac_hdr>
14736 EOF
14737 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14738 { (eval echo configure:14739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14739 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14740 if test -z "$ac_err"; then
14741   rm -rf conftest*
14742   eval "ac_cv_header_$ac_safe=yes"
14743 else
14744   echo "$ac_err" >&5
14745   echo "configure: failed program was:" >&5
14746   cat conftest.$ac_ext >&5
14747   rm -rf conftest*
14748   eval "ac_cv_header_$ac_safe=no"
14749 fi
14750 rm -f conftest*
14751 fi
14752 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14753   echo "$ac_t""yes" 1>&6
14754     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14755   cat >> confdefs.h <<EOF
14756 #define $ac_tr_hdr 1
14757 EOF
14758  
14759 else
14760   echo "$ac_t""no" 1>&6
14761 fi
14762 done
14763
14764
14765         if test $ac_cv_header_tcl_h != yes ; then
14766                 have_tcl=no
14767         else
14768                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14769                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14770 echo "configure:14771: checking for main in -l$lib" >&5
14771 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
14772 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14773   echo $ac_n "(cached) $ac_c" 1>&6
14774 else
14775   ac_save_LIBS="$LIBS"
14776 LIBS="-l$lib  $LIBS"
14777 cat > conftest.$ac_ext <<EOF
14778 #line 14779 "configure"
14779 #include "confdefs.h"
14780
14781 int main() {
14782 main()
14783 ; return 0; }
14784 EOF
14785 if { (eval echo configure:14786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14786   rm -rf conftest*
14787   eval "ac_cv_lib_$ac_lib_var=yes"
14788 else
14789   echo "configure: failed program was:" >&5
14790   cat conftest.$ac_ext >&5
14791   rm -rf conftest*
14792   eval "ac_cv_lib_$ac_lib_var=no"
14793 fi
14794 rm -f conftest*
14795 LIBS="$ac_save_LIBS"
14796
14797 fi
14798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14799   echo "$ac_t""yes" 1>&6
14800   have_tcl=yes
14801                            if test x"$ol_with_tcl_module" = "xstatic" ; then
14802                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
14803                            else
14804                                MOD_TCL_LIB="-l${lib}"
14805                            fi;break
14806 else
14807   echo "$ac_t""no" 1>&6
14808 have_tcl=no
14809 fi
14810
14811                 done
14812         fi
14813
14814         if test $have_tcl != yes ; then
14815                 echo "configure: warning: could not find -ltcl" 1>&2
14816                 if test $ol_enable_tcl = yes ; then
14817                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
14818                 fi
14819
14820                 ol_enable_tcl=no
14821         fi
14822 fi
14823
14824 ol_link_termcap=no
14825 for ac_hdr in termcap.h ncurses.h
14826 do
14827 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14828 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14829 echo "configure:14830: checking for $ac_hdr" >&5
14830 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14831   echo $ac_n "(cached) $ac_c" 1>&6
14832 else
14833   cat > conftest.$ac_ext <<EOF
14834 #line 14835 "configure"
14835 #include "confdefs.h"
14836 #include <$ac_hdr>
14837 EOF
14838 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14839 { (eval echo configure:14840: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14840 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14841 if test -z "$ac_err"; then
14842   rm -rf conftest*
14843   eval "ac_cv_header_$ac_safe=yes"
14844 else
14845   echo "$ac_err" >&5
14846   echo "configure: failed program was:" >&5
14847   cat conftest.$ac_ext >&5
14848   rm -rf conftest*
14849   eval "ac_cv_header_$ac_safe=no"
14850 fi
14851 rm -f conftest*
14852 fi
14853 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14854   echo "$ac_t""yes" 1>&6
14855     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14856   cat >> confdefs.h <<EOF
14857 #define $ac_tr_hdr 1
14858 EOF
14859  
14860 else
14861   echo "$ac_t""no" 1>&6
14862 fi
14863 done
14864
14865
14866 if test $ol_link_termcap = no ; then
14867         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14868 echo "configure:14869: checking for tputs in -ltermcap" >&5
14869 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14870 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14871   echo $ac_n "(cached) $ac_c" 1>&6
14872 else
14873   ac_save_LIBS="$LIBS"
14874 LIBS="-ltermcap  $LIBS"
14875 cat > conftest.$ac_ext <<EOF
14876 #line 14877 "configure"
14877 #include "confdefs.h"
14878 /* Override any gcc2 internal prototype to avoid an error.  */
14879 /* We use char because int might match the return type of a gcc2
14880     builtin and then its argument prototype would still apply.  */
14881 char tputs();
14882
14883 int main() {
14884 tputs()
14885 ; return 0; }
14886 EOF
14887 if { (eval echo configure:14888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14888   rm -rf conftest*
14889   eval "ac_cv_lib_$ac_lib_var=yes"
14890 else
14891   echo "configure: failed program was:" >&5
14892   cat conftest.$ac_ext >&5
14893   rm -rf conftest*
14894   eval "ac_cv_lib_$ac_lib_var=no"
14895 fi
14896 rm -f conftest*
14897 LIBS="$ac_save_LIBS"
14898
14899 fi
14900 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14901   echo "$ac_t""yes" 1>&6
14902   have_termcap=yes
14903 else
14904   echo "$ac_t""no" 1>&6
14905 have_termcap=no
14906 fi
14907
14908         if test $have_termcap = yes ; then
14909                 cat >> confdefs.h <<\EOF
14910 #define HAVE_TERMCAP 1
14911 EOF
14912
14913                 ol_link_termcap=yes
14914                 TERMCAP_LIBS=-ltermcap
14915         fi
14916 fi
14917
14918 if test $ol_link_termcap = no ; then
14919         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14920 echo "configure:14921: checking for initscr in -lncurses" >&5
14921 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14922 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14923   echo $ac_n "(cached) $ac_c" 1>&6
14924 else
14925   ac_save_LIBS="$LIBS"
14926 LIBS="-lncurses  $LIBS"
14927 cat > conftest.$ac_ext <<EOF
14928 #line 14929 "configure"
14929 #include "confdefs.h"
14930 /* Override any gcc2 internal prototype to avoid an error.  */
14931 /* We use char because int might match the return type of a gcc2
14932     builtin and then its argument prototype would still apply.  */
14933 char initscr();
14934
14935 int main() {
14936 initscr()
14937 ; return 0; }
14938 EOF
14939 if { (eval echo configure:14940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14940   rm -rf conftest*
14941   eval "ac_cv_lib_$ac_lib_var=yes"
14942 else
14943   echo "configure: failed program was:" >&5
14944   cat conftest.$ac_ext >&5
14945   rm -rf conftest*
14946   eval "ac_cv_lib_$ac_lib_var=no"
14947 fi
14948 rm -f conftest*
14949 LIBS="$ac_save_LIBS"
14950
14951 fi
14952 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14953   echo "$ac_t""yes" 1>&6
14954   have_ncurses=yes
14955 else
14956   echo "$ac_t""no" 1>&6
14957 have_ncurses=no
14958 fi
14959
14960         if test $have_ncurses = yes ; then
14961                 cat >> confdefs.h <<\EOF
14962 #define HAVE_NCURSES 1
14963 EOF
14964
14965                 ol_link_termcap=yes
14966                 TERMCAP_LIBS=-lncurses
14967         fi
14968 fi
14969
14970 if test $ol_link_termcap = no ; then
14971         cat >> confdefs.h <<\EOF
14972 #define NO_TERMCAP 1
14973 EOF
14974
14975         TERMCAP_LIBS=
14976 fi
14977
14978 ol_link_sasl=no
14979 ol_link_spasswd=no
14980 if test $ol_with_cyrus_sasl != no ; then
14981         for ac_hdr in sasl.h
14982 do
14983 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14984 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14985 echo "configure:14986: checking for $ac_hdr" >&5
14986 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14987   echo $ac_n "(cached) $ac_c" 1>&6
14988 else
14989   cat > conftest.$ac_ext <<EOF
14990 #line 14991 "configure"
14991 #include "confdefs.h"
14992 #include <$ac_hdr>
14993 EOF
14994 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14995 { (eval echo configure:14996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14996 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14997 if test -z "$ac_err"; then
14998   rm -rf conftest*
14999   eval "ac_cv_header_$ac_safe=yes"
15000 else
15001   echo "$ac_err" >&5
15002   echo "configure: failed program was:" >&5
15003   cat conftest.$ac_ext >&5
15004   rm -rf conftest*
15005   eval "ac_cv_header_$ac_safe=no"
15006 fi
15007 rm -f conftest*
15008 fi
15009 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15010   echo "$ac_t""yes" 1>&6
15011     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15012   cat >> confdefs.h <<EOF
15013 #define $ac_tr_hdr 1
15014 EOF
15015  
15016 else
15017   echo "$ac_t""no" 1>&6
15018 fi
15019 done
15020
15021
15022         if test $ac_cv_header_sasl_h = yes ; then
15023                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15024 echo "configure:15025: checking for sasl_client_init in -lsasl" >&5
15025 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15026 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15027   echo $ac_n "(cached) $ac_c" 1>&6
15028 else
15029   ac_save_LIBS="$LIBS"
15030 LIBS="-lsasl  $LIBS"
15031 cat > conftest.$ac_ext <<EOF
15032 #line 15033 "configure"
15033 #include "confdefs.h"
15034 /* Override any gcc2 internal prototype to avoid an error.  */
15035 /* We use char because int might match the return type of a gcc2
15036     builtin and then its argument prototype would still apply.  */
15037 char sasl_client_init();
15038
15039 int main() {
15040 sasl_client_init()
15041 ; return 0; }
15042 EOF
15043 if { (eval echo configure:15044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15044   rm -rf conftest*
15045   eval "ac_cv_lib_$ac_lib_var=yes"
15046 else
15047   echo "configure: failed program was:" >&5
15048   cat conftest.$ac_ext >&5
15049   rm -rf conftest*
15050   eval "ac_cv_lib_$ac_lib_var=no"
15051 fi
15052 rm -f conftest*
15053 LIBS="$ac_save_LIBS"
15054
15055 fi
15056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15057   echo "$ac_t""yes" 1>&6
15058   have_cyrus_sasl=yes
15059 else
15060   echo "$ac_t""no" 1>&6
15061 have_cyrus_sasl=no
15062 fi
15063
15064
15065                 if test $have_cyrus_sasl != no ; then
15066                         SASL_LIBS="-lsasl"
15067                         cat >> confdefs.h <<\EOF
15068 #define HAVE_CYRUS_SASL 1
15069 EOF
15070
15071                         ol_link_sasl=yes
15072                 fi
15073         fi
15074
15075         if test $ol_link_sasl = no ; then
15076                 if test $ol_with_cyrus_sasl != auto ; then
15077                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15078                 else
15079                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15080                         echo "configure: warning: SASL authentication not supported!" 1>&2
15081                         if test $ol_link_tls = no ; then
15082                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15083                         fi
15084                 fi
15085
15086         elif test $ol_enable_spasswd != no ; then
15087                 ol_link_spasswd=yes
15088         fi
15089
15090 else
15091         echo "configure: warning: SASL authentication not supported!" 1>&2
15092         if test $ol_link_tls = no ; then
15093                 echo "configure: warning: Strong authentication not supported!" 1>&2
15094         fi
15095 fi
15096
15097 if test $cross_compiling != yes ; then
15098         dev=no
15099         if test -r /dev/urandom ; then
15100                 dev="/dev/urandom";
15101         elif test -r /idev/urandom ; then
15102                 dev="/idev/urandom";
15103         elif test -r /dev/srandom ; then
15104                 dev="/dev/srandom";
15105         elif test -r /dev/random ; then
15106                 dev="/dev/random";
15107         elif test -r /idev/random ; then
15108                 dev="/idev/random";
15109         fi
15110
15111         if test $dev != no ; then
15112                 cat >> confdefs.h <<EOF
15113 #define URANDOM_DEVICE "$dev"
15114 EOF
15115
15116         fi
15117 fi
15118
15119 ol_link_fetch=no
15120 if test $ol_with_fetch != no ; then
15121         ol_LIBS=$LIBS
15122 LIBS="-lfetch -lcom_err $LIBS"
15123 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15124 echo "configure:15125: checking fetch(3) library" >&5
15125 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15126   echo $ac_n "(cached) $ac_c" 1>&6
15127 else
15128   
15129         cat > conftest.$ac_ext <<EOF
15130 #line 15131 "configure"
15131 #include "confdefs.h"
15132
15133 #include <sys/param.h>
15134 #include <stdio.h>
15135 #include <fetch.h>
15136 int main() {
15137 struct url *u = fetchParseURL("file:///"); 
15138 ; return 0; }
15139 EOF
15140 if { (eval echo configure:15141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15141   rm -rf conftest*
15142   ol_cv_lib_fetch=yes
15143 else
15144   echo "configure: failed program was:" >&5
15145   cat conftest.$ac_ext >&5
15146   rm -rf conftest*
15147   ol_cv_lib_fetch=no
15148 fi
15149 rm -f conftest*
15150 fi
15151
15152 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15153 LIBS=$ol_LIBS
15154 if test $ol_cv_lib_fetch != no ; then
15155         ol_link_fetch="-lfetch -lcom_err"
15156         cat >> confdefs.h <<\EOF
15157 #define HAVE_FETCH 1
15158 EOF
15159
15160 fi
15161
15162
15163         if test $ol_cv_lib_fetch != no ; then
15164                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15165                 ol_link_fetch=freebsd
15166
15167         elif test $ol_with_fetch != auto ; then
15168                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15169         fi 
15170 fi
15171
15172 ol_link_readline=no
15173 if test $ol_with_readline != no ; then
15174         for ac_hdr in readline/readline.h readline/history.h
15175 do
15176 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15177 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15178 echo "configure:15179: checking for $ac_hdr" >&5
15179 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15180   echo $ac_n "(cached) $ac_c" 1>&6
15181 else
15182   cat > conftest.$ac_ext <<EOF
15183 #line 15184 "configure"
15184 #include "confdefs.h"
15185 #include <$ac_hdr>
15186 EOF
15187 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15188 { (eval echo configure:15189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15189 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15190 if test -z "$ac_err"; then
15191   rm -rf conftest*
15192   eval "ac_cv_header_$ac_safe=yes"
15193 else
15194   echo "$ac_err" >&5
15195   echo "configure: failed program was:" >&5
15196   cat conftest.$ac_ext >&5
15197   rm -rf conftest*
15198   eval "ac_cv_header_$ac_safe=no"
15199 fi
15200 rm -f conftest*
15201 fi
15202 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15203   echo "$ac_t""yes" 1>&6
15204     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15205   cat >> confdefs.h <<EOF
15206 #define $ac_tr_hdr 1
15207 EOF
15208  
15209 else
15210   echo "$ac_t""no" 1>&6
15211 fi
15212 done
15213
15214
15215         if test $ac_cv_header_readline_readline_h = yes ; then
15216                 save_LIBS="$LIBS"
15217                 LIBS="$TERMCAP_LIBS $LIBS"
15218                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15219 echo "configure:15220: checking for readline in -lreadline" >&5
15220 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15221 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15222   echo $ac_n "(cached) $ac_c" 1>&6
15223 else
15224   ac_save_LIBS="$LIBS"
15225 LIBS="-lreadline  $LIBS"
15226 cat > conftest.$ac_ext <<EOF
15227 #line 15228 "configure"
15228 #include "confdefs.h"
15229 /* Override any gcc2 internal prototype to avoid an error.  */
15230 /* We use char because int might match the return type of a gcc2
15231     builtin and then its argument prototype would still apply.  */
15232 char readline();
15233
15234 int main() {
15235 readline()
15236 ; return 0; }
15237 EOF
15238 if { (eval echo configure:15239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15239   rm -rf conftest*
15240   eval "ac_cv_lib_$ac_lib_var=yes"
15241 else
15242   echo "configure: failed program was:" >&5
15243   cat conftest.$ac_ext >&5
15244   rm -rf conftest*
15245   eval "ac_cv_lib_$ac_lib_var=no"
15246 fi
15247 rm -f conftest*
15248 LIBS="$ac_save_LIBS"
15249
15250 fi
15251 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15252   echo "$ac_t""yes" 1>&6
15253   have_readline=yes
15254 else
15255   echo "$ac_t""no" 1>&6
15256 have_readline=no
15257 fi
15258
15259                 LIBS="$save_LIBS"
15260                         
15261                 if test $have_readline = yes ; then
15262                         ol_with_readline=found
15263                         ol_link_readline=yes
15264
15265                         READLINE_LIBS="-lreadline"
15266                 fi
15267         fi
15268 fi
15269
15270 if test $ol_link_readline = yes ; then
15271         cat >> confdefs.h <<\EOF
15272 #define HAVE_READLINE 1
15273 EOF
15274
15275 fi
15276
15277
15278 if test $ol_enable_crypt != no ; then
15279         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15280 echo "configure:15281: checking for crypt" >&5
15281 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15282   echo $ac_n "(cached) $ac_c" 1>&6
15283 else
15284   cat > conftest.$ac_ext <<EOF
15285 #line 15286 "configure"
15286 #include "confdefs.h"
15287 /* System header to define __stub macros and hopefully few prototypes,
15288     which can conflict with char crypt(); below.  */
15289 #include <assert.h>
15290 /* Override any gcc2 internal prototype to avoid an error.  */
15291 /* We use char because int might match the return type of a gcc2
15292     builtin and then its argument prototype would still apply.  */
15293 char crypt();
15294 char (*f)();
15295
15296 int main() {
15297
15298 /* The GNU C library defines this for functions which it implements
15299     to always fail with ENOSYS.  Some functions are actually named
15300     something starting with __ and the normal name is an alias.  */
15301 #if defined (__stub_crypt) || defined (__stub___crypt)
15302 choke me
15303 #else
15304 f = crypt;
15305 #endif
15306
15307 ; return 0; }
15308 EOF
15309 if { (eval echo configure:15310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15310   rm -rf conftest*
15311   eval "ac_cv_func_crypt=yes"
15312 else
15313   echo "configure: failed program was:" >&5
15314   cat conftest.$ac_ext >&5
15315   rm -rf conftest*
15316   eval "ac_cv_func_crypt=no"
15317 fi
15318 rm -f conftest*
15319 fi
15320
15321 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15322   echo "$ac_t""yes" 1>&6
15323   have_crypt=yes
15324 else
15325   echo "$ac_t""no" 1>&6
15326
15327                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15328 echo "configure:15329: checking for crypt in -lcrypt" >&5
15329 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15330 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15331   echo $ac_n "(cached) $ac_c" 1>&6
15332 else
15333   ac_save_LIBS="$LIBS"
15334 LIBS="-lcrypt  $LIBS"
15335 cat > conftest.$ac_ext <<EOF
15336 #line 15337 "configure"
15337 #include "confdefs.h"
15338 /* Override any gcc2 internal prototype to avoid an error.  */
15339 /* We use char because int might match the return type of a gcc2
15340     builtin and then its argument prototype would still apply.  */
15341 char crypt();
15342
15343 int main() {
15344 crypt()
15345 ; return 0; }
15346 EOF
15347 if { (eval echo configure:15348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15348   rm -rf conftest*
15349   eval "ac_cv_lib_$ac_lib_var=yes"
15350 else
15351   echo "configure: failed program was:" >&5
15352   cat conftest.$ac_ext >&5
15353   rm -rf conftest*
15354   eval "ac_cv_lib_$ac_lib_var=no"
15355 fi
15356 rm -f conftest*
15357 LIBS="$ac_save_LIBS"
15358
15359 fi
15360 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15361   echo "$ac_t""yes" 1>&6
15362   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15363                         have_crypt=yes
15364 else
15365   echo "$ac_t""no" 1>&6
15366 have_crypt=no
15367 fi
15368
15369 fi
15370
15371
15372         if test $have_crypt = yes ; then
15373                 cat >> confdefs.h <<\EOF
15374 #define HAVE_CRYPT 1
15375 EOF
15376
15377         else
15378                 echo "configure: warning: could not find crypt" 1>&2
15379                 if test $ol_enable_crypt = yes ; then
15380                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15381                 fi
15382
15383                 echo "configure: warning: disabling crypt support" 1>&2
15384                 ol_enable_crypt=no
15385         fi
15386 fi
15387
15388 if test $ol_enable_proctitle != no ; then
15389         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15390 echo "configure:15391: checking for setproctitle" >&5
15391 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15392   echo $ac_n "(cached) $ac_c" 1>&6
15393 else
15394   cat > conftest.$ac_ext <<EOF
15395 #line 15396 "configure"
15396 #include "confdefs.h"
15397 /* System header to define __stub macros and hopefully few prototypes,
15398     which can conflict with char setproctitle(); below.  */
15399 #include <assert.h>
15400 /* Override any gcc2 internal prototype to avoid an error.  */
15401 /* We use char because int might match the return type of a gcc2
15402     builtin and then its argument prototype would still apply.  */
15403 char setproctitle();
15404 char (*f)();
15405
15406 int main() {
15407
15408 /* The GNU C library defines this for functions which it implements
15409     to always fail with ENOSYS.  Some functions are actually named
15410     something starting with __ and the normal name is an alias.  */
15411 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15412 choke me
15413 #else
15414 f = setproctitle;
15415 #endif
15416
15417 ; return 0; }
15418 EOF
15419 if { (eval echo configure:15420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15420   rm -rf conftest*
15421   eval "ac_cv_func_setproctitle=yes"
15422 else
15423   echo "configure: failed program was:" >&5
15424   cat conftest.$ac_ext >&5
15425   rm -rf conftest*
15426   eval "ac_cv_func_setproctitle=no"
15427 fi
15428 rm -f conftest*
15429 fi
15430
15431 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15432   echo "$ac_t""yes" 1>&6
15433   have_setproctitle=yes
15434 else
15435   echo "$ac_t""no" 1>&6
15436
15437                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15438 echo "configure:15439: checking for setproctitle in -lutil" >&5
15439 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15440 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15441   echo $ac_n "(cached) $ac_c" 1>&6
15442 else
15443   ac_save_LIBS="$LIBS"
15444 LIBS="-lutil  $LIBS"
15445 cat > conftest.$ac_ext <<EOF
15446 #line 15447 "configure"
15447 #include "confdefs.h"
15448 /* Override any gcc2 internal prototype to avoid an error.  */
15449 /* We use char because int might match the return type of a gcc2
15450     builtin and then its argument prototype would still apply.  */
15451 char setproctitle();
15452
15453 int main() {
15454 setproctitle()
15455 ; return 0; }
15456 EOF
15457 if { (eval echo configure:15458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15458   rm -rf conftest*
15459   eval "ac_cv_lib_$ac_lib_var=yes"
15460 else
15461   echo "configure: failed program was:" >&5
15462   cat conftest.$ac_ext >&5
15463   rm -rf conftest*
15464   eval "ac_cv_lib_$ac_lib_var=no"
15465 fi
15466 rm -f conftest*
15467 LIBS="$ac_save_LIBS"
15468
15469 fi
15470 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15471   echo "$ac_t""yes" 1>&6
15472   have_setproctitle=yes
15473                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15474 else
15475   echo "$ac_t""no" 1>&6
15476 have_setproctitle=no
15477                         LIBOBJS="$LIBOBJS setproctitle.o"
15478                         LIBSRCS="$LIBSRCS setproctitle.c"
15479 fi
15480
15481 fi
15482
15483
15484         if test $have_setproctitle = yes ; then
15485                 cat >> confdefs.h <<\EOF
15486 #define HAVE_SETPROCTITLE 1
15487 EOF
15488
15489         fi
15490 fi
15491
15492 if test $ol_enable_slp != no ; then
15493         for ac_hdr in slp.h 
15494 do
15495 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15496 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15497 echo "configure:15498: checking for $ac_hdr" >&5
15498 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15499   echo $ac_n "(cached) $ac_c" 1>&6
15500 else
15501   cat > conftest.$ac_ext <<EOF
15502 #line 15503 "configure"
15503 #include "confdefs.h"
15504 #include <$ac_hdr>
15505 EOF
15506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15507 { (eval echo configure:15508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15509 if test -z "$ac_err"; then
15510   rm -rf conftest*
15511   eval "ac_cv_header_$ac_safe=yes"
15512 else
15513   echo "$ac_err" >&5
15514   echo "configure: failed program was:" >&5
15515   cat conftest.$ac_ext >&5
15516   rm -rf conftest*
15517   eval "ac_cv_header_$ac_safe=no"
15518 fi
15519 rm -f conftest*
15520 fi
15521 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15522   echo "$ac_t""yes" 1>&6
15523     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15524   cat >> confdefs.h <<EOF
15525 #define $ac_tr_hdr 1
15526 EOF
15527  
15528 else
15529   echo "$ac_t""no" 1>&6
15530 fi
15531 done
15532
15533
15534         if test $ac_cv_header_slp_h = yes ; then
15535                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15536 echo "configure:15537: checking for SLPOpen in -lslp" >&5
15537 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15538 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15539   echo $ac_n "(cached) $ac_c" 1>&6
15540 else
15541   ac_save_LIBS="$LIBS"
15542 LIBS="-lslp  $LIBS"
15543 cat > conftest.$ac_ext <<EOF
15544 #line 15545 "configure"
15545 #include "confdefs.h"
15546 /* Override any gcc2 internal prototype to avoid an error.  */
15547 /* We use char because int might match the return type of a gcc2
15548     builtin and then its argument prototype would still apply.  */
15549 char SLPOpen();
15550
15551 int main() {
15552 SLPOpen()
15553 ; return 0; }
15554 EOF
15555 if { (eval echo configure:15556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15556   rm -rf conftest*
15557   eval "ac_cv_lib_$ac_lib_var=yes"
15558 else
15559   echo "configure: failed program was:" >&5
15560   cat conftest.$ac_ext >&5
15561   rm -rf conftest*
15562   eval "ac_cv_lib_$ac_lib_var=no"
15563 fi
15564 rm -f conftest*
15565 LIBS="$ac_save_LIBS"
15566
15567 fi
15568 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15569   echo "$ac_t""yes" 1>&6
15570   have_slp=yes
15571 else
15572   echo "$ac_t""no" 1>&6
15573 have_slp=no
15574 fi
15575
15576                 if test $have_slp = yes ; then
15577                         cat >> confdefs.h <<\EOF
15578 #define HAVE_SLP 1
15579 EOF
15580
15581                         SLAPD_SLP_LIBS=-lslp
15582                 fi
15583
15584         elif test $ol_enable_slp = yes ; then
15585                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15586         fi
15587 fi
15588
15589 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15590 echo "configure:15591: checking for ANSI C header files" >&5
15591 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15592   echo $ac_n "(cached) $ac_c" 1>&6
15593 else
15594   cat > conftest.$ac_ext <<EOF
15595 #line 15596 "configure"
15596 #include "confdefs.h"
15597 #include <stdlib.h>
15598 #include <stdarg.h>
15599 #include <string.h>
15600 #include <float.h>
15601 EOF
15602 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15603 { (eval echo configure:15604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15604 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15605 if test -z "$ac_err"; then
15606   rm -rf conftest*
15607   ac_cv_header_stdc=yes
15608 else
15609   echo "$ac_err" >&5
15610   echo "configure: failed program was:" >&5
15611   cat conftest.$ac_ext >&5
15612   rm -rf conftest*
15613   ac_cv_header_stdc=no
15614 fi
15615 rm -f conftest*
15616
15617 if test $ac_cv_header_stdc = yes; then
15618   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15619 cat > conftest.$ac_ext <<EOF
15620 #line 15621 "configure"
15621 #include "confdefs.h"
15622 #include <string.h>
15623 EOF
15624 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15625   egrep "memchr" >/dev/null 2>&1; then
15626   :
15627 else
15628   rm -rf conftest*
15629   ac_cv_header_stdc=no
15630 fi
15631 rm -f conftest*
15632
15633 fi
15634
15635 if test $ac_cv_header_stdc = yes; then
15636   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15637 cat > conftest.$ac_ext <<EOF
15638 #line 15639 "configure"
15639 #include "confdefs.h"
15640 #include <stdlib.h>
15641 EOF
15642 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15643   egrep "free" >/dev/null 2>&1; then
15644   :
15645 else
15646   rm -rf conftest*
15647   ac_cv_header_stdc=no
15648 fi
15649 rm -f conftest*
15650
15651 fi
15652
15653 if test $ac_cv_header_stdc = yes; then
15654   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15655 if test "$cross_compiling" = yes; then
15656   :
15657 else
15658   cat > conftest.$ac_ext <<EOF
15659 #line 15660 "configure"
15660 #include "confdefs.h"
15661 #include <ctype.h>
15662 #if ((' ' & 0x0FF) == 0x020)
15663 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15664 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15665 #else
15666 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15667  || ('j' <= (c) && (c) <= 'r') \
15668  || ('s' <= (c) && (c) <= 'z'))
15669 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15670 #endif
15671 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15672 int main () { int i; for (i = 0; i < 256; i++)
15673 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15674 exit (0); }
15675
15676 EOF
15677 if { (eval echo configure:15678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15678 then
15679   :
15680 else
15681   echo "configure: failed program was:" >&5
15682   cat conftest.$ac_ext >&5
15683   rm -fr conftest*
15684   ac_cv_header_stdc=no
15685 fi
15686 rm -fr conftest*
15687 fi
15688
15689 fi
15690 fi
15691
15692 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15693 if test $ac_cv_header_stdc = yes; then
15694   cat >> confdefs.h <<\EOF
15695 #define STDC_HEADERS 1
15696 EOF
15697
15698 fi
15699
15700 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15701 echo "configure:15702: checking for mode_t" >&5
15702 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15703   echo $ac_n "(cached) $ac_c" 1>&6
15704 else
15705   cat > conftest.$ac_ext <<EOF
15706 #line 15707 "configure"
15707 #include "confdefs.h"
15708 #include <sys/types.h>
15709 #if STDC_HEADERS
15710 #include <stdlib.h>
15711 #include <stddef.h>
15712 #endif
15713
15714 EOF
15715 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15716   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15717   rm -rf conftest*
15718   eval "ac_cv_type_mode_t=yes"
15719 else
15720   rm -rf conftest*
15721   eval "ac_cv_type_mode_t=no"
15722 fi
15723 rm -f conftest*
15724
15725 fi
15726 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15727   echo "$ac_t""yes" 1>&6
15728 else
15729   echo "$ac_t""no" 1>&6
15730   cat >> confdefs.h <<EOF
15731 #define mode_t int
15732 EOF
15733
15734 fi
15735
15736 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15737 echo "configure:15738: checking for off_t" >&5
15738 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15739   echo $ac_n "(cached) $ac_c" 1>&6
15740 else
15741   cat > conftest.$ac_ext <<EOF
15742 #line 15743 "configure"
15743 #include "confdefs.h"
15744 #include <sys/types.h>
15745 #if STDC_HEADERS
15746 #include <stdlib.h>
15747 #include <stddef.h>
15748 #endif
15749
15750 EOF
15751 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15752   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15753   rm -rf conftest*
15754   eval "ac_cv_type_off_t=yes"
15755 else
15756   rm -rf conftest*
15757   eval "ac_cv_type_off_t=no"
15758 fi
15759 rm -f conftest*
15760
15761 fi
15762 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15763   echo "$ac_t""yes" 1>&6
15764 else
15765   echo "$ac_t""no" 1>&6
15766   cat >> confdefs.h <<EOF
15767 #define off_t long
15768 EOF
15769
15770 fi
15771
15772 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15773 echo "configure:15774: checking for pid_t" >&5
15774 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15775   echo $ac_n "(cached) $ac_c" 1>&6
15776 else
15777   cat > conftest.$ac_ext <<EOF
15778 #line 15779 "configure"
15779 #include "confdefs.h"
15780 #include <sys/types.h>
15781 #if STDC_HEADERS
15782 #include <stdlib.h>
15783 #include <stddef.h>
15784 #endif
15785
15786 EOF
15787 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15788   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15789   rm -rf conftest*
15790   eval "ac_cv_type_pid_t=yes"
15791 else
15792   rm -rf conftest*
15793   eval "ac_cv_type_pid_t=no"
15794 fi
15795 rm -f conftest*
15796
15797 fi
15798 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15799   echo "$ac_t""yes" 1>&6
15800 else
15801   echo "$ac_t""no" 1>&6
15802   cat >> confdefs.h <<EOF
15803 #define pid_t int
15804 EOF
15805
15806 fi
15807
15808 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15809 echo "configure:15810: checking for ptrdiff_t" >&5
15810 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15811   echo $ac_n "(cached) $ac_c" 1>&6
15812 else
15813   cat > conftest.$ac_ext <<EOF
15814 #line 15815 "configure"
15815 #include "confdefs.h"
15816 #include <stddef.h>
15817 int main() {
15818 ptrdiff_t p
15819 ; return 0; }
15820 EOF
15821 if { (eval echo configure:15822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15822   rm -rf conftest*
15823   am_cv_type_ptrdiff_t=yes
15824 else
15825   echo "configure: failed program was:" >&5
15826   cat conftest.$ac_ext >&5
15827   rm -rf conftest*
15828   am_cv_type_ptrdiff_t=no
15829 fi
15830 rm -f conftest*
15831 fi
15832
15833 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15834    if test $am_cv_type_ptrdiff_t = yes; then
15835      cat >> confdefs.h <<\EOF
15836 #define HAVE_PTRDIFF_T 1
15837 EOF
15838
15839    fi
15840
15841 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15842 echo "configure:15843: checking return type of signal handlers" >&5
15843 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15844   echo $ac_n "(cached) $ac_c" 1>&6
15845 else
15846   cat > conftest.$ac_ext <<EOF
15847 #line 15848 "configure"
15848 #include "confdefs.h"
15849 #include <sys/types.h>
15850 #include <signal.h>
15851 #ifdef signal
15852 #undef signal
15853 #endif
15854 #ifdef __cplusplus
15855 extern "C" void (*signal (int, void (*)(int)))(int);
15856 #else
15857 void (*signal ()) ();
15858 #endif
15859
15860 int main() {
15861 int i;
15862 ; return 0; }
15863 EOF
15864 if { (eval echo configure:15865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15865   rm -rf conftest*
15866   ac_cv_type_signal=void
15867 else
15868   echo "configure: failed program was:" >&5
15869   cat conftest.$ac_ext >&5
15870   rm -rf conftest*
15871   ac_cv_type_signal=int
15872 fi
15873 rm -f conftest*
15874 fi
15875
15876 echo "$ac_t""$ac_cv_type_signal" 1>&6
15877 cat >> confdefs.h <<EOF
15878 #define RETSIGTYPE $ac_cv_type_signal
15879 EOF
15880
15881
15882 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15883 echo "configure:15884: checking for size_t" >&5
15884 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15885   echo $ac_n "(cached) $ac_c" 1>&6
15886 else
15887   cat > conftest.$ac_ext <<EOF
15888 #line 15889 "configure"
15889 #include "confdefs.h"
15890 #include <sys/types.h>
15891 #if STDC_HEADERS
15892 #include <stdlib.h>
15893 #include <stddef.h>
15894 #endif
15895
15896 EOF
15897 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15898   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15899   rm -rf conftest*
15900   eval "ac_cv_type_size_t=yes"
15901 else
15902   rm -rf conftest*
15903   eval "ac_cv_type_size_t=no"
15904 fi
15905 rm -f conftest*
15906
15907 fi
15908 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15909   echo "$ac_t""yes" 1>&6
15910 else
15911   echo "$ac_t""no" 1>&6
15912   cat >> confdefs.h <<EOF
15913 #define size_t unsigned
15914 EOF
15915
15916 fi
15917
15918
15919 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15920 echo "configure:15921: checking for ssize_t" >&5
15921 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15922   echo $ac_n "(cached) $ac_c" 1>&6
15923 else
15924   cat > conftest.$ac_ext <<EOF
15925 #line 15926 "configure"
15926 #include "confdefs.h"
15927 #include <sys/types.h>
15928 #if STDC_HEADERS
15929 #include <stdlib.h>
15930 #include <stddef.h>
15931 #endif
15932
15933 EOF
15934 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15935   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15936   rm -rf conftest*
15937   eval "ac_cv_type_ssize_t=yes"
15938 else
15939   rm -rf conftest*
15940   eval "ac_cv_type_ssize_t=no"
15941 fi
15942 rm -f conftest*
15943
15944 fi
15945 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15946   echo "$ac_t""yes" 1>&6
15947 else
15948   echo "$ac_t""no" 1>&6
15949   cat >> confdefs.h <<EOF
15950 #define ssize_t signed int
15951 EOF
15952
15953 fi
15954
15955 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15956 echo "configure:15957: checking for caddr_t" >&5
15957 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15958   echo $ac_n "(cached) $ac_c" 1>&6
15959 else
15960   cat > conftest.$ac_ext <<EOF
15961 #line 15962 "configure"
15962 #include "confdefs.h"
15963 #include <sys/types.h>
15964 #if STDC_HEADERS
15965 #include <stdlib.h>
15966 #include <stddef.h>
15967 #endif
15968
15969 EOF
15970 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15971   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15972   rm -rf conftest*
15973   eval "ac_cv_type_caddr_t=yes"
15974 else
15975   rm -rf conftest*
15976   eval "ac_cv_type_caddr_t=no"
15977 fi
15978 rm -f conftest*
15979
15980 fi
15981 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15982   echo "$ac_t""yes" 1>&6
15983 else
15984   echo "$ac_t""no" 1>&6
15985   cat >> confdefs.h <<EOF
15986 #define caddr_t char *
15987 EOF
15988
15989 fi
15990
15991
15992 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15993 echo "configure:15994: checking for socklen_t" >&5
15994 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15995   echo $ac_n "(cached) $ac_c" 1>&6
15996 else
15997   cat > conftest.$ac_ext <<EOF
15998 #line 15999 "configure"
15999 #include "confdefs.h"
16000
16001 #ifdef HAVE_SYS_TYPES_H
16002 #include <sys/types.h>
16003 #endif
16004 #ifdef HAVE_SYS_SOCKET_H
16005 #include <sys/socket.h>
16006 #endif
16007
16008 int main() {
16009 socklen_t len;
16010 ; return 0; }
16011 EOF
16012 if { (eval echo configure:16013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16013   rm -rf conftest*
16014   ol_cv_type_socklen_t=yes
16015 else
16016   echo "configure: failed program was:" >&5
16017   cat conftest.$ac_ext >&5
16018   rm -rf conftest*
16019   ol_cv_type_socklen_t=no
16020 fi
16021 rm -f conftest*
16022 fi
16023
16024 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16025   if test $ol_cv_type_socklen_t = no; then
16026     cat >> confdefs.h <<\EOF
16027 #define socklen_t int
16028 EOF
16029
16030   fi
16031  
16032 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16033 echo "configure:16034: checking for member st_blksize in aggregate type struct stat" >&5
16034 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16035   echo $ac_n "(cached) $ac_c" 1>&6
16036 else
16037   cat > conftest.$ac_ext <<EOF
16038 #line 16039 "configure"
16039 #include "confdefs.h"
16040 #include <sys/types.h>
16041 #include <sys/stat.h>
16042 int main() {
16043 struct stat foo; foo.st_blksize;
16044 ; return 0; }
16045 EOF
16046 if { (eval echo configure:16047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16047   rm -rf conftest*
16048   ac_cv_c_struct_member_st_blksize=yes
16049 else
16050   echo "configure: failed program was:" >&5
16051   cat conftest.$ac_ext >&5
16052   rm -rf conftest*
16053   ac_cv_c_struct_member_st_blksize=no
16054 fi
16055 rm -f conftest*
16056 fi
16057
16058 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16059 st_blksize="$ac_cv_c_struct_member_st_blksize"
16060 if test $ac_cv_c_struct_member_st_blksize = yes; then
16061   cat >> confdefs.h <<\EOF
16062 #define HAVE_ST_BLKSIZE 1
16063 EOF
16064
16065 fi
16066
16067 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16068 echo "configure:16069: checking whether time.h and sys/time.h may both be included" >&5
16069 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16070   echo $ac_n "(cached) $ac_c" 1>&6
16071 else
16072   cat > conftest.$ac_ext <<EOF
16073 #line 16074 "configure"
16074 #include "confdefs.h"
16075 #include <sys/types.h>
16076 #include <sys/time.h>
16077 #include <time.h>
16078 int main() {
16079 struct tm *tp;
16080 ; return 0; }
16081 EOF
16082 if { (eval echo configure:16083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16083   rm -rf conftest*
16084   ac_cv_header_time=yes
16085 else
16086   echo "configure: failed program was:" >&5
16087   cat conftest.$ac_ext >&5
16088   rm -rf conftest*
16089   ac_cv_header_time=no
16090 fi
16091 rm -f conftest*
16092 fi
16093
16094 echo "$ac_t""$ac_cv_header_time" 1>&6
16095 if test $ac_cv_header_time = yes; then
16096   cat >> confdefs.h <<\EOF
16097 #define TIME_WITH_SYS_TIME 1
16098 EOF
16099
16100 fi
16101
16102 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16103 echo "configure:16104: checking whether struct tm is in sys/time.h or time.h" >&5
16104 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16105   echo $ac_n "(cached) $ac_c" 1>&6
16106 else
16107   cat > conftest.$ac_ext <<EOF
16108 #line 16109 "configure"
16109 #include "confdefs.h"
16110 #include <sys/types.h>
16111 #include <time.h>
16112 int main() {
16113 struct tm *tp; tp->tm_sec;
16114 ; return 0; }
16115 EOF
16116 if { (eval echo configure:16117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16117   rm -rf conftest*
16118   ac_cv_struct_tm=time.h
16119 else
16120   echo "configure: failed program was:" >&5
16121   cat conftest.$ac_ext >&5
16122   rm -rf conftest*
16123   ac_cv_struct_tm=sys/time.h
16124 fi
16125 rm -f conftest*
16126 fi
16127
16128 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16129 if test $ac_cv_struct_tm = sys/time.h; then
16130   cat >> confdefs.h <<\EOF
16131 #define TM_IN_SYS_TIME 1
16132 EOF
16133
16134 fi
16135
16136 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16137 echo "configure:16138: checking for uid_t in sys/types.h" >&5
16138 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16139   echo $ac_n "(cached) $ac_c" 1>&6
16140 else
16141   cat > conftest.$ac_ext <<EOF
16142 #line 16143 "configure"
16143 #include "confdefs.h"
16144 #include <sys/types.h>
16145 EOF
16146 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16147   egrep "uid_t" >/dev/null 2>&1; then
16148   rm -rf conftest*
16149   ac_cv_type_uid_t=yes
16150 else
16151   rm -rf conftest*
16152   ac_cv_type_uid_t=no
16153 fi
16154 rm -f conftest*
16155
16156 fi
16157
16158 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16159 if test $ac_cv_type_uid_t = no; then
16160   cat >> confdefs.h <<\EOF
16161 #define uid_t int
16162 EOF
16163
16164   cat >> confdefs.h <<\EOF
16165 #define gid_t int
16166 EOF
16167
16168 fi
16169
16170 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16171 echo "configure:16172: checking for sig_atomic_t" >&5
16172 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16173   echo $ac_n "(cached) $ac_c" 1>&6
16174 else
16175   cat > conftest.$ac_ext <<EOF
16176 #line 16177 "configure"
16177 #include "confdefs.h"
16178 #include <signal.h>
16179 int main() {
16180 sig_atomic_t atomic;
16181 ; return 0; }
16182 EOF
16183 if { (eval echo configure:16184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16184   rm -rf conftest*
16185   ol_cv_type_sig_atomic_t=yes
16186 else
16187   echo "configure: failed program was:" >&5
16188   cat conftest.$ac_ext >&5
16189   rm -rf conftest*
16190   ol_cv_type_sig_atomic_t=no
16191 fi
16192 rm -f conftest*
16193 fi
16194
16195 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16196   if test $ol_cv_type_sig_atomic_t = no; then
16197     cat >> confdefs.h <<\EOF
16198 #define sig_atomic_t int
16199 EOF
16200
16201   fi
16202  
16203
16204
16205 # test for pw_gecos in struct passwd
16206 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16207 echo "configure:16208: checking struct passwd for pw_gecos" >&5
16208 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16209   echo $ac_n "(cached) $ac_c" 1>&6
16210 else
16211   
16212         cat > conftest.$ac_ext <<EOF
16213 #line 16214 "configure"
16214 #include "confdefs.h"
16215 #include <pwd.h>
16216 int main() {
16217
16218         struct passwd pwd;
16219         pwd.pw_gecos = pwd.pw_name;
16220
16221 ; return 0; }
16222 EOF
16223 if { (eval echo configure:16224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16224   rm -rf conftest*
16225   ol_cv_struct_passwd_pw_gecos=yes
16226 else
16227   echo "configure: failed program was:" >&5
16228   cat conftest.$ac_ext >&5
16229   rm -rf conftest*
16230   ol_cv_struct_passwd_pw_gecos=no
16231 fi
16232 rm -f conftest*
16233 fi
16234
16235 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16236 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16237         cat >> confdefs.h <<\EOF
16238 #define HAVE_PW_GECOS 1
16239 EOF
16240
16241 fi
16242
16243 # test for pw_passwd in struct passwd
16244 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16245 echo "configure:16246: checking struct passwd for pw_passwd" >&5
16246 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16247   echo $ac_n "(cached) $ac_c" 1>&6
16248 else
16249   
16250         cat > conftest.$ac_ext <<EOF
16251 #line 16252 "configure"
16252 #include "confdefs.h"
16253 #include <pwd.h>
16254 int main() {
16255
16256         struct passwd pwd;
16257         pwd.pw_passwd = pwd.pw_name;
16258
16259 ; return 0; }
16260 EOF
16261 if { (eval echo configure:16262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16262   rm -rf conftest*
16263   ol_cv_struct_passwd_pw_passwd=yes
16264 else
16265   echo "configure: failed program was:" >&5
16266   cat conftest.$ac_ext >&5
16267   rm -rf conftest*
16268   ol_cv_struct_passwd_pw_passwd=no
16269 fi
16270 rm -f conftest*
16271 fi
16272
16273 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16274 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16275         cat >> confdefs.h <<\EOF
16276 #define HAVE_PW_PASSWD 1
16277 EOF
16278
16279 fi
16280
16281
16282 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16283 echo "configure:16284: checking if toupper() requires islower()" >&5
16284 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16285   echo $ac_n "(cached) $ac_c" 1>&6
16286 else
16287   
16288         if test "$cross_compiling" = yes; then
16289   ol_cv_c_upper_lower=safe
16290 else
16291   cat > conftest.$ac_ext <<EOF
16292 #line 16293 "configure"
16293 #include "confdefs.h"
16294
16295 #include <ctype.h>
16296 main()
16297 {
16298         if ('C' == toupper('C'))
16299                 exit(0);
16300         else
16301                 exit(1);
16302 }
16303 EOF
16304 if { (eval echo configure:16305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16305 then
16306   ol_cv_c_upper_lower=no
16307 else
16308   echo "configure: failed program was:" >&5
16309   cat conftest.$ac_ext >&5
16310   rm -fr conftest*
16311   ol_cv_c_upper_lower=yes
16312 fi
16313 rm -fr conftest*
16314 fi
16315
16316 fi
16317
16318 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16319 if test $ol_cv_c_upper_lower != no ; then
16320         cat >> confdefs.h <<\EOF
16321 #define C_UPPER_LOWER 1
16322 EOF
16323
16324 fi
16325
16326 echo $ac_n "checking for working const""... $ac_c" 1>&6
16327 echo "configure:16328: checking for working const" >&5
16328 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16329   echo $ac_n "(cached) $ac_c" 1>&6
16330 else
16331   cat > conftest.$ac_ext <<EOF
16332 #line 16333 "configure"
16333 #include "confdefs.h"
16334
16335 int main() {
16336
16337 /* Ultrix mips cc rejects this.  */
16338 typedef int charset[2]; const charset x;
16339 /* SunOS 4.1.1 cc rejects this.  */
16340 char const *const *ccp;
16341 char **p;
16342 /* NEC SVR4.0.2 mips cc rejects this.  */
16343 struct point {int x, y;};
16344 static struct point const zero = {0,0};
16345 /* AIX XL C 1.02.0.0 rejects this.
16346    It does not let you subtract one const X* pointer from another in an arm
16347    of an if-expression whose if-part is not a constant expression */
16348 const char *g = "string";
16349 ccp = &g + (g ? g-g : 0);
16350 /* HPUX 7.0 cc rejects these. */
16351 ++ccp;
16352 p = (char**) ccp;
16353 ccp = (char const *const *) p;
16354 { /* SCO 3.2v4 cc rejects this.  */
16355   char *t;
16356   char const *s = 0 ? (char *) 0 : (char const *) 0;
16357
16358   *t++ = 0;
16359 }
16360 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16361   int x[] = {25, 17};
16362   const int *foo = &x[0];
16363   ++foo;
16364 }
16365 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16366   typedef const int *iptr;
16367   iptr p = 0;
16368   ++p;
16369 }
16370 { /* AIX XL C 1.02.0.0 rejects this saying
16371      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16372   struct s { int j; const int *ap[3]; };
16373   struct s *b; b->j = 5;
16374 }
16375 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16376   const int foo = 10;
16377 }
16378
16379 ; return 0; }
16380 EOF
16381 if { (eval echo configure:16382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16382   rm -rf conftest*
16383   ac_cv_c_const=yes
16384 else
16385   echo "configure: failed program was:" >&5
16386   cat conftest.$ac_ext >&5
16387   rm -rf conftest*
16388   ac_cv_c_const=no
16389 fi
16390 rm -f conftest*
16391 fi
16392
16393 echo "$ac_t""$ac_cv_c_const" 1>&6
16394 if test $ac_cv_c_const = no; then
16395   cat >> confdefs.h <<\EOF
16396 #define const 
16397 EOF
16398
16399 fi
16400
16401 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16402 echo "configure:16403: checking if compiler understands volatile" >&5
16403 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16404   echo $ac_n "(cached) $ac_c" 1>&6
16405 else
16406   cat > conftest.$ac_ext <<EOF
16407 #line 16408 "configure"
16408 #include "confdefs.h"
16409 int x, y, z;
16410 int main() {
16411 volatile int a; int * volatile b = x ? &y : &z;
16412       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16413       *b = 0;
16414 ; return 0; }
16415 EOF
16416 if { (eval echo configure:16417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16417   rm -rf conftest*
16418   ol_cv_c_volatile=yes
16419 else
16420   echo "configure: failed program was:" >&5
16421   cat conftest.$ac_ext >&5
16422   rm -rf conftest*
16423   ol_cv_c_volatile=no
16424 fi
16425 rm -f conftest*
16426 fi
16427
16428 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16429   if test $ol_cv_c_volatile = yes; then
16430     : 
16431   else
16432     cat >> confdefs.h <<\EOF
16433 #define volatile 
16434 EOF
16435
16436   fi
16437  
16438
16439 if test $cross_compiling = yes ; then
16440         cat >> confdefs.h <<\EOF
16441 #define CROSS_COMPILING 1
16442 EOF
16443
16444 else
16445         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16446 echo "configure:16447: checking whether byte ordering is bigendian" >&5
16447 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16448   echo $ac_n "(cached) $ac_c" 1>&6
16449 else
16450   ac_cv_c_bigendian=unknown
16451 # See if sys/param.h defines the BYTE_ORDER macro.
16452 cat > conftest.$ac_ext <<EOF
16453 #line 16454 "configure"
16454 #include "confdefs.h"
16455 #include <sys/types.h>
16456 #include <sys/param.h>
16457 int main() {
16458
16459 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16460  bogus endian macros
16461 #endif
16462 ; return 0; }
16463 EOF
16464 if { (eval echo configure:16465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16465   rm -rf conftest*
16466   # It does; now see whether it defined to BIG_ENDIAN or not.
16467 cat > conftest.$ac_ext <<EOF
16468 #line 16469 "configure"
16469 #include "confdefs.h"
16470 #include <sys/types.h>
16471 #include <sys/param.h>
16472 int main() {
16473
16474 #if BYTE_ORDER != BIG_ENDIAN
16475  not big endian
16476 #endif
16477 ; return 0; }
16478 EOF
16479 if { (eval echo configure:16480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16480   rm -rf conftest*
16481   ac_cv_c_bigendian=yes
16482 else
16483   echo "configure: failed program was:" >&5
16484   cat conftest.$ac_ext >&5
16485   rm -rf conftest*
16486   ac_cv_c_bigendian=no
16487 fi
16488 rm -f conftest*
16489 else
16490   echo "configure: failed program was:" >&5
16491   cat conftest.$ac_ext >&5
16492 fi
16493 rm -f conftest*
16494 if test $ac_cv_c_bigendian = unknown; then
16495 if test "$cross_compiling" = yes; then
16496     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16497 else
16498   cat > conftest.$ac_ext <<EOF
16499 #line 16500 "configure"
16500 #include "confdefs.h"
16501 main () {
16502   /* Are we little or big endian?  From Harbison&Steele.  */
16503   union
16504   {
16505     long l;
16506     char c[sizeof (long)];
16507   } u;
16508   u.l = 1;
16509   exit (u.c[sizeof (long) - 1] == 1);
16510 }
16511 EOF
16512 if { (eval echo configure:16513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16513 then
16514   ac_cv_c_bigendian=no
16515 else
16516   echo "configure: failed program was:" >&5
16517   cat conftest.$ac_ext >&5
16518   rm -fr conftest*
16519   ac_cv_c_bigendian=yes
16520 fi
16521 rm -fr conftest*
16522 fi
16523
16524 fi
16525 fi
16526
16527 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16528 if test $ac_cv_c_bigendian = yes; then
16529   cat >> confdefs.h <<\EOF
16530 #define WORDS_BIGENDIAN 1
16531 EOF
16532
16533 fi
16534
16535 fi
16536
16537 echo $ac_n "checking size of short""... $ac_c" 1>&6
16538 echo "configure:16539: checking size of short" >&5 
16539 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16540   echo $ac_n "(cached) $ac_c" 1>&6
16541 else
16542   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16543   cat > conftest.$ac_ext <<EOF
16544 #line 16545 "configure"
16545 #include "confdefs.h"
16546 #include "confdefs.h" 
16547 #include <sys/types.h> 
16548  
16549
16550 int main() {
16551 switch (0) case 0: case (sizeof (short) == $ac_size):;
16552 ; return 0; }
16553 EOF
16554 if { (eval echo configure:16555: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16555   rm -rf conftest*
16556   ac_cv_sizeof_short=$ac_size
16557 else
16558   echo "configure: failed program was:" >&5
16559   cat conftest.$ac_ext >&5
16560 fi
16561 rm -f conftest* 
16562   if test x$ac_cv_sizeof_short != x ; then break; fi 
16563 done 
16564
16565 fi
16566  
16567 if test x$ac_cv_sizeof_short = x ; then 
16568   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16569 fi 
16570 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16571 cat >> confdefs.h <<EOF
16572 #define SIZEOF_SHORT $ac_cv_sizeof_short
16573 EOF
16574  
16575  
16576 echo $ac_n "checking size of int""... $ac_c" 1>&6
16577 echo "configure:16578: checking size of int" >&5 
16578 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16579   echo $ac_n "(cached) $ac_c" 1>&6
16580 else
16581   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16582   cat > conftest.$ac_ext <<EOF
16583 #line 16584 "configure"
16584 #include "confdefs.h"
16585 #include "confdefs.h" 
16586 #include <sys/types.h> 
16587  
16588
16589 int main() {
16590 switch (0) case 0: case (sizeof (int) == $ac_size):;
16591 ; return 0; }
16592 EOF
16593 if { (eval echo configure:16594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16594   rm -rf conftest*
16595   ac_cv_sizeof_int=$ac_size
16596 else
16597   echo "configure: failed program was:" >&5
16598   cat conftest.$ac_ext >&5
16599 fi
16600 rm -f conftest* 
16601   if test x$ac_cv_sizeof_int != x ; then break; fi 
16602 done 
16603
16604 fi
16605  
16606 if test x$ac_cv_sizeof_int = x ; then 
16607   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16608 fi 
16609 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16610 cat >> confdefs.h <<EOF
16611 #define SIZEOF_INT $ac_cv_sizeof_int
16612 EOF
16613  
16614  
16615 echo $ac_n "checking size of long""... $ac_c" 1>&6
16616 echo "configure:16617: checking size of long" >&5 
16617 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16618   echo $ac_n "(cached) $ac_c" 1>&6
16619 else
16620   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16621   cat > conftest.$ac_ext <<EOF
16622 #line 16623 "configure"
16623 #include "confdefs.h"
16624 #include "confdefs.h" 
16625 #include <sys/types.h> 
16626  
16627
16628 int main() {
16629 switch (0) case 0: case (sizeof (long) == $ac_size):;
16630 ; return 0; }
16631 EOF
16632 if { (eval echo configure:16633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16633   rm -rf conftest*
16634   ac_cv_sizeof_long=$ac_size
16635 else
16636   echo "configure: failed program was:" >&5
16637   cat conftest.$ac_ext >&5
16638 fi
16639 rm -f conftest* 
16640   if test x$ac_cv_sizeof_long != x ; then break; fi 
16641 done 
16642
16643 fi
16644  
16645 if test x$ac_cv_sizeof_long = x ; then 
16646   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16647 fi 
16648 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16649 cat >> confdefs.h <<EOF
16650 #define SIZEOF_LONG $ac_cv_sizeof_long
16651 EOF
16652  
16653
16654
16655 if test "$ac_cv_sizeof_int" -lt 4 ; then
16656         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16657
16658         cat >> confdefs.h <<\EOF
16659 #define LBER_INT_T long
16660 EOF
16661
16662 else
16663         cat >> confdefs.h <<\EOF
16664 #define LBER_INT_T int
16665 EOF
16666
16667 fi
16668
16669 cat >> confdefs.h <<\EOF
16670 #define LBER_LEN_T long
16671 EOF
16672
16673 cat >> confdefs.h <<\EOF
16674 #define LBER_SOCKET_T int
16675 EOF
16676
16677 cat >> confdefs.h <<\EOF
16678 #define LBER_TAG_T long
16679 EOF
16680
16681
16682 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16683 echo "configure:16684: checking for 8-bit clean memcmp" >&5
16684 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16685   echo $ac_n "(cached) $ac_c" 1>&6
16686 else
16687   if test "$cross_compiling" = yes; then
16688   ac_cv_func_memcmp_clean=no
16689 else
16690   cat > conftest.$ac_ext <<EOF
16691 #line 16692 "configure"
16692 #include "confdefs.h"
16693
16694 main()
16695 {
16696   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16697   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16698 }
16699
16700 EOF
16701 if { (eval echo configure:16702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16702 then
16703   ac_cv_func_memcmp_clean=yes
16704 else
16705   echo "configure: failed program was:" >&5
16706   cat conftest.$ac_ext >&5
16707   rm -fr conftest*
16708   ac_cv_func_memcmp_clean=no
16709 fi
16710 rm -fr conftest*
16711 fi
16712
16713 fi
16714
16715 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16716 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16717
16718 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16719 echo "configure:16720: checking for strftime" >&5
16720 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16721   echo $ac_n "(cached) $ac_c" 1>&6
16722 else
16723   cat > conftest.$ac_ext <<EOF
16724 #line 16725 "configure"
16725 #include "confdefs.h"
16726 /* System header to define __stub macros and hopefully few prototypes,
16727     which can conflict with char strftime(); below.  */
16728 #include <assert.h>
16729 /* Override any gcc2 internal prototype to avoid an error.  */
16730 /* We use char because int might match the return type of a gcc2
16731     builtin and then its argument prototype would still apply.  */
16732 char strftime();
16733 char (*f)();
16734
16735 int main() {
16736
16737 /* The GNU C library defines this for functions which it implements
16738     to always fail with ENOSYS.  Some functions are actually named
16739     something starting with __ and the normal name is an alias.  */
16740 #if defined (__stub_strftime) || defined (__stub___strftime)
16741 choke me
16742 #else
16743 f = strftime;
16744 #endif
16745
16746 ; return 0; }
16747 EOF
16748 if { (eval echo configure:16749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16749   rm -rf conftest*
16750   eval "ac_cv_func_strftime=yes"
16751 else
16752   echo "configure: failed program was:" >&5
16753   cat conftest.$ac_ext >&5
16754   rm -rf conftest*
16755   eval "ac_cv_func_strftime=no"
16756 fi
16757 rm -f conftest*
16758 fi
16759
16760 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16761   echo "$ac_t""yes" 1>&6
16762   cat >> confdefs.h <<\EOF
16763 #define HAVE_STRFTIME 1
16764 EOF
16765
16766 else
16767   echo "$ac_t""no" 1>&6
16768 # strftime is in -lintl on SCO UNIX.
16769 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16770 echo "configure:16771: checking for strftime in -lintl" >&5
16771 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16772 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16773   echo $ac_n "(cached) $ac_c" 1>&6
16774 else
16775   ac_save_LIBS="$LIBS"
16776 LIBS="-lintl  $LIBS"
16777 cat > conftest.$ac_ext <<EOF
16778 #line 16779 "configure"
16779 #include "confdefs.h"
16780 /* Override any gcc2 internal prototype to avoid an error.  */
16781 /* We use char because int might match the return type of a gcc2
16782     builtin and then its argument prototype would still apply.  */
16783 char strftime();
16784
16785 int main() {
16786 strftime()
16787 ; return 0; }
16788 EOF
16789 if { (eval echo configure:16790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16790   rm -rf conftest*
16791   eval "ac_cv_lib_$ac_lib_var=yes"
16792 else
16793   echo "configure: failed program was:" >&5
16794   cat conftest.$ac_ext >&5
16795   rm -rf conftest*
16796   eval "ac_cv_lib_$ac_lib_var=no"
16797 fi
16798 rm -f conftest*
16799 LIBS="$ac_save_LIBS"
16800
16801 fi
16802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16803   echo "$ac_t""yes" 1>&6
16804   cat >> confdefs.h <<\EOF
16805 #define HAVE_STRFTIME 1
16806 EOF
16807
16808 LIBS="-lintl $LIBS"
16809 else
16810   echo "$ac_t""no" 1>&6
16811 fi
16812
16813 fi
16814
16815
16816 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16817 echo "configure:16818: checking for inet_aton()" >&5
16818 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16819   echo $ac_n "(cached) $ac_c" 1>&6
16820 else
16821   cat > conftest.$ac_ext <<EOF
16822 #line 16823 "configure"
16823 #include "confdefs.h"
16824
16825 #ifdef HAVE_SYS_TYPES_H
16826 #       include <sys/types.h>
16827 #endif
16828 #ifdef HAVE_SYS_SOCKET_H
16829 #       include <sys/socket.h>
16830 #       ifdef HAVE_SYS_SELECT_H
16831 #               include <sys/select.h>
16832 #       endif
16833 #       include <netinet/in.h>
16834 #       ifdef HAVE_ARPA_INET_H
16835 #               include <arpa/inet.h>
16836 #       endif
16837 #endif
16838
16839 int main() {
16840 struct in_addr in;
16841 int rc = inet_aton( "255.255.255.255", &in );
16842 ; return 0; }
16843 EOF
16844 if { (eval echo configure:16845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16845   rm -rf conftest*
16846   ol_cv_func_inet_aton=yes
16847 else
16848   echo "configure: failed program was:" >&5
16849   cat conftest.$ac_ext >&5
16850   rm -rf conftest*
16851   ol_cv_func_inet_aton=no
16852 fi
16853 rm -f conftest*
16854 fi
16855
16856 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16857   if test $ol_cv_func_inet_aton != no; then
16858     cat >> confdefs.h <<\EOF
16859 #define HAVE_INET_ATON 1
16860 EOF
16861
16862   fi
16863  
16864
16865 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16866 echo "configure:16867: checking for _spawnlp" >&5
16867 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16868   echo $ac_n "(cached) $ac_c" 1>&6
16869 else
16870   cat > conftest.$ac_ext <<EOF
16871 #line 16872 "configure"
16872 #include "confdefs.h"
16873 /* System header to define __stub macros and hopefully few prototypes,
16874     which can conflict with char _spawnlp(); below.  */
16875 #include <assert.h>
16876 /* Override any gcc2 internal prototype to avoid an error.  */
16877 /* We use char because int might match the return type of a gcc2
16878     builtin and then its argument prototype would still apply.  */
16879 char _spawnlp();
16880 char (*f)();
16881
16882 int main() {
16883
16884 /* The GNU C library defines this for functions which it implements
16885     to always fail with ENOSYS.  Some functions are actually named
16886     something starting with __ and the normal name is an alias.  */
16887 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16888 choke me
16889 #else
16890 f = _spawnlp;
16891 #endif
16892
16893 ; return 0; }
16894 EOF
16895 if { (eval echo configure:16896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16896   rm -rf conftest*
16897   eval "ac_cv_func__spawnlp=yes"
16898 else
16899   echo "configure: failed program was:" >&5
16900   cat conftest.$ac_ext >&5
16901   rm -rf conftest*
16902   eval "ac_cv_func__spawnlp=no"
16903 fi
16904 rm -f conftest*
16905 fi
16906
16907 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16908   echo "$ac_t""yes" 1>&6
16909   cat >> confdefs.h <<\EOF
16910 #define HAVE_SPAWNLP 1
16911 EOF
16912
16913 else
16914   echo "$ac_t""no" 1>&6
16915 fi
16916
16917
16918 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16919 echo "configure:16920: checking for _snprintf" >&5
16920 if eval "test \"\${ac_cv_func__snprintf+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 _snprintf(); 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 _snprintf();
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__snprintf) || defined (__stub____snprintf)
16941 choke me
16942 #else
16943 f = _snprintf;
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__snprintf=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__snprintf=no"
16956 fi
16957 rm -f conftest*
16958 fi
16959
16960 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16961   echo "$ac_t""yes" 1>&6
16962   ac_cv_func_snprintf=yes
16963         cat >> confdefs.h <<\EOF
16964 #define snprintf _snprintf
16965 EOF
16966
16967
16968 else
16969   echo "$ac_t""no" 1>&6
16970 fi
16971
16972
16973 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16974 echo "configure:16975: checking for _vsnprintf" >&5
16975 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16976   echo $ac_n "(cached) $ac_c" 1>&6
16977 else
16978   cat > conftest.$ac_ext <<EOF
16979 #line 16980 "configure"
16980 #include "confdefs.h"
16981 /* System header to define __stub macros and hopefully few prototypes,
16982     which can conflict with char _vsnprintf(); below.  */
16983 #include <assert.h>
16984 /* Override any gcc2 internal prototype to avoid an error.  */
16985 /* We use char because int might match the return type of a gcc2
16986     builtin and then its argument prototype would still apply.  */
16987 char _vsnprintf();
16988 char (*f)();
16989
16990 int main() {
16991
16992 /* The GNU C library defines this for functions which it implements
16993     to always fail with ENOSYS.  Some functions are actually named
16994     something starting with __ and the normal name is an alias.  */
16995 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16996 choke me
16997 #else
16998 f = _vsnprintf;
16999 #endif
17000
17001 ; return 0; }
17002 EOF
17003 if { (eval echo configure:17004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17004   rm -rf conftest*
17005   eval "ac_cv_func__vsnprintf=yes"
17006 else
17007   echo "configure: failed program was:" >&5
17008   cat conftest.$ac_ext >&5
17009   rm -rf conftest*
17010   eval "ac_cv_func__vsnprintf=no"
17011 fi
17012 rm -f conftest*
17013 fi
17014
17015 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17016   echo "$ac_t""yes" 1>&6
17017   ac_cv_func_vsnprintf=yes
17018         cat >> confdefs.h <<\EOF
17019 #define vsnprintf _vsnprintf
17020 EOF
17021
17022
17023 else
17024   echo "$ac_t""no" 1>&6
17025 fi
17026
17027
17028 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17029 echo "configure:17030: checking for vprintf" >&5
17030 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17031   echo $ac_n "(cached) $ac_c" 1>&6
17032 else
17033   cat > conftest.$ac_ext <<EOF
17034 #line 17035 "configure"
17035 #include "confdefs.h"
17036 /* System header to define __stub macros and hopefully few prototypes,
17037     which can conflict with char vprintf(); below.  */
17038 #include <assert.h>
17039 /* Override any gcc2 internal prototype to avoid an error.  */
17040 /* We use char because int might match the return type of a gcc2
17041     builtin and then its argument prototype would still apply.  */
17042 char vprintf();
17043 char (*f)();
17044
17045 int main() {
17046
17047 /* The GNU C library defines this for functions which it implements
17048     to always fail with ENOSYS.  Some functions are actually named
17049     something starting with __ and the normal name is an alias.  */
17050 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17051 choke me
17052 #else
17053 f = vprintf;
17054 #endif
17055
17056 ; return 0; }
17057 EOF
17058 if { (eval echo configure:17059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17059   rm -rf conftest*
17060   eval "ac_cv_func_vprintf=yes"
17061 else
17062   echo "configure: failed program was:" >&5
17063   cat conftest.$ac_ext >&5
17064   rm -rf conftest*
17065   eval "ac_cv_func_vprintf=no"
17066 fi
17067 rm -f conftest*
17068 fi
17069
17070 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17071   echo "$ac_t""yes" 1>&6
17072   cat >> confdefs.h <<\EOF
17073 #define HAVE_VPRINTF 1
17074 EOF
17075
17076 else
17077   echo "$ac_t""no" 1>&6
17078 fi
17079
17080 if test "$ac_cv_func_vprintf" != yes; then
17081 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17082 echo "configure:17083: checking for _doprnt" >&5
17083 if eval "test \"\${ac_cv_func__doprnt+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 _doprnt(); 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 _doprnt();
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__doprnt) || defined (__stub____doprnt)
17104 choke me
17105 #else
17106 f = _doprnt;
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__doprnt=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__doprnt=no"
17119 fi
17120 rm -f conftest*
17121 fi
17122
17123 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17124   echo "$ac_t""yes" 1>&6
17125   cat >> confdefs.h <<\EOF
17126 #define HAVE_DOPRNT 1
17127 EOF
17128
17129 else
17130   echo "$ac_t""no" 1>&6
17131 fi
17132
17133 fi
17134
17135
17136 if test $ac_cv_func_vprintf = yes ; then
17137                 for ac_func in vsnprintf vsprintf
17138 do
17139 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17140 echo "configure:17141: checking for $ac_func" >&5
17141 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17142   echo $ac_n "(cached) $ac_c" 1>&6
17143 else
17144   cat > conftest.$ac_ext <<EOF
17145 #line 17146 "configure"
17146 #include "confdefs.h"
17147 /* System header to define __stub macros and hopefully few prototypes,
17148     which can conflict with char $ac_func(); below.  */
17149 #include <assert.h>
17150 /* Override any gcc2 internal prototype to avoid an error.  */
17151 /* We use char because int might match the return type of a gcc2
17152     builtin and then its argument prototype would still apply.  */
17153 char $ac_func();
17154 char (*f)();
17155
17156 int main() {
17157
17158 /* The GNU C library defines this for functions which it implements
17159     to always fail with ENOSYS.  Some functions are actually named
17160     something starting with __ and the normal name is an alias.  */
17161 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17162 choke me
17163 #else
17164 f = $ac_func;
17165 #endif
17166
17167 ; return 0; }
17168 EOF
17169 if { (eval echo configure:17170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17170   rm -rf conftest*
17171   eval "ac_cv_func_$ac_func=yes"
17172 else
17173   echo "configure: failed program was:" >&5
17174   cat conftest.$ac_ext >&5
17175   rm -rf conftest*
17176   eval "ac_cv_func_$ac_func=no"
17177 fi
17178 rm -f conftest*
17179 fi
17180
17181 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17182   echo "$ac_t""yes" 1>&6
17183     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17184   cat >> confdefs.h <<EOF
17185 #define $ac_tr_func 1
17186 EOF
17187  
17188 else
17189   echo "$ac_t""no" 1>&6
17190 fi
17191 done
17192
17193 fi
17194
17195 for ac_func in \
17196         bcopy                   \
17197         closesocket             \
17198         chroot                  \
17199         endgrent                \
17200         endpwent                \
17201         fcntl                   \
17202         flock                   \
17203         getdtablesize   \
17204         getgrgid                \
17205         gethostname             \
17206         getpass                 \
17207         getpassphrase   \
17208         getpwuid                \
17209         getpwnam                \
17210         getspnam                \
17211         gettimeofday    \
17212         initgroups              \
17213         lockf                   \
17214         memcpy                  \
17215         memmove                 \
17216         pipe                    \
17217         read                    \
17218         recv                    \
17219         recvfrom                \
17220         setpwfile               \
17221         setgid                  \
17222         setegid                 \
17223         setsid                  \
17224         setuid                  \
17225         seteuid                 \
17226         sigaction               \
17227         signal                  \
17228         sigset                  \
17229         strdup                  \
17230         strerror                \
17231         strpbrk                 \
17232         strrchr                 \
17233         strsep                  \
17234         strstr                  \
17235         strtol                  \
17236         strtoul                 \
17237         strspn                  \
17238         sysconf                 \
17239         waitpid                 \
17240         wait4                   \
17241         write                   \
17242         send                    \
17243         sendto                  \
17244
17245 do
17246 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17247 echo "configure:17248: checking for $ac_func" >&5
17248 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17249   echo $ac_n "(cached) $ac_c" 1>&6
17250 else
17251   cat > conftest.$ac_ext <<EOF
17252 #line 17253 "configure"
17253 #include "confdefs.h"
17254 /* System header to define __stub macros and hopefully few prototypes,
17255     which can conflict with char $ac_func(); below.  */
17256 #include <assert.h>
17257 /* Override any gcc2 internal prototype to avoid an error.  */
17258 /* We use char because int might match the return type of a gcc2
17259     builtin and then its argument prototype would still apply.  */
17260 char $ac_func();
17261 char (*f)();
17262
17263 int main() {
17264
17265 /* The GNU C library defines this for functions which it implements
17266     to always fail with ENOSYS.  Some functions are actually named
17267     something starting with __ and the normal name is an alias.  */
17268 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17269 choke me
17270 #else
17271 f = $ac_func;
17272 #endif
17273
17274 ; return 0; }
17275 EOF
17276 if { (eval echo configure:17277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17277   rm -rf conftest*
17278   eval "ac_cv_func_$ac_func=yes"
17279 else
17280   echo "configure: failed program was:" >&5
17281   cat conftest.$ac_ext >&5
17282   rm -rf conftest*
17283   eval "ac_cv_func_$ac_func=no"
17284 fi
17285 rm -f conftest*
17286 fi
17287
17288 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17289   echo "$ac_t""yes" 1>&6
17290     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17291   cat >> confdefs.h <<EOF
17292 #define $ac_tr_func 1
17293 EOF
17294  
17295 else
17296   echo "$ac_t""no" 1>&6
17297 fi
17298 done
17299
17300
17301 for ac_func in getopt
17302 do
17303 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17304 echo "configure:17305: checking for $ac_func" >&5
17305 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17306   echo $ac_n "(cached) $ac_c" 1>&6
17307 else
17308   cat > conftest.$ac_ext <<EOF
17309 #line 17310 "configure"
17310 #include "confdefs.h"
17311 /* System header to define __stub macros and hopefully few prototypes,
17312     which can conflict with char $ac_func(); below.  */
17313 #include <assert.h>
17314 /* Override any gcc2 internal prototype to avoid an error.  */
17315 /* We use char because int might match the return type of a gcc2
17316     builtin and then its argument prototype would still apply.  */
17317 char $ac_func();
17318 char (*f)();
17319
17320 int main() {
17321
17322 /* The GNU C library defines this for functions which it implements
17323     to always fail with ENOSYS.  Some functions are actually named
17324     something starting with __ and the normal name is an alias.  */
17325 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17326 choke me
17327 #else
17328 f = $ac_func;
17329 #endif
17330
17331 ; return 0; }
17332 EOF
17333 if { (eval echo configure:17334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17334   rm -rf conftest*
17335   eval "ac_cv_func_$ac_func=yes"
17336 else
17337   echo "configure: failed program was:" >&5
17338   cat conftest.$ac_ext >&5
17339   rm -rf conftest*
17340   eval "ac_cv_func_$ac_func=no"
17341 fi
17342 rm -f conftest*
17343 fi
17344
17345 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17346   echo "$ac_t""yes" 1>&6
17347     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17348   cat >> confdefs.h <<EOF
17349 #define $ac_tr_func 1
17350 EOF
17351  
17352 else
17353   echo "$ac_t""no" 1>&6
17354 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17355 fi
17356 done
17357
17358
17359
17360 if test "$ac_cv_func_getopt" != yes; then
17361     LIBSRCS="$LIBSRCS getopt.c"
17362 fi
17363
17364 # Check Configuration
17365 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17366 echo "configure:17367: checking declaration of sys_errlist" >&5
17367 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17368   echo $ac_n "(cached) $ac_c" 1>&6
17369 else
17370   
17371         cat > conftest.$ac_ext <<EOF
17372 #line 17373 "configure"
17373 #include "confdefs.h"
17374
17375 #include <stdio.h>
17376 #include <sys/types.h>
17377 #include <errno.h>
17378 #ifdef WINNT
17379 #include <stdlib.h>
17380 #endif 
17381 int main() {
17382 char *c = (char *) *sys_errlist
17383 ; return 0; }
17384 EOF
17385 if { (eval echo configure:17386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17386   rm -rf conftest*
17387   ol_cv_dcl_sys_errlist=yes
17388         ol_cv_have_sys_errlist=yes
17389 else
17390   echo "configure: failed program was:" >&5
17391   cat conftest.$ac_ext >&5
17392   rm -rf conftest*
17393   ol_cv_dcl_sys_errlist=no
17394 fi
17395 rm -f conftest*
17396 fi
17397
17398 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17399 #
17400 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17401 if test $ol_cv_dcl_sys_errlist = no ; then
17402         cat >> confdefs.h <<\EOF
17403 #define DECL_SYS_ERRLIST 1
17404 EOF
17405
17406
17407         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17408 echo "configure:17409: checking existence of sys_errlist" >&5
17409 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17410   echo $ac_n "(cached) $ac_c" 1>&6
17411 else
17412   
17413                 cat > conftest.$ac_ext <<EOF
17414 #line 17415 "configure"
17415 #include "confdefs.h"
17416 #include <errno.h>
17417 int main() {
17418 char *c = (char *) *sys_errlist
17419 ; return 0; }
17420 EOF
17421 if { (eval echo configure:17422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17422   rm -rf conftest*
17423   ol_cv_have_sys_errlist=yes
17424 else
17425   echo "configure: failed program was:" >&5
17426   cat conftest.$ac_ext >&5
17427   rm -rf conftest*
17428   ol_cv_have_sys_errlist=no
17429 fi
17430 rm -f conftest*
17431 fi
17432
17433 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17434 fi
17435 if test $ol_cv_have_sys_errlist = yes ; then
17436         cat >> confdefs.h <<\EOF
17437 #define HAVE_SYS_ERRLIST 1
17438 EOF
17439
17440 fi
17441
17442
17443
17444 if test "$ol_enable_debug" != no ; then
17445         cat >> confdefs.h <<\EOF
17446 #define LDAP_DEBUG 1
17447 EOF
17448
17449 fi
17450 if test "$ol_enable_syslog" = yes ; then
17451         cat >> confdefs.h <<\EOF
17452 #define LDAP_SYSLOG 1
17453 EOF
17454
17455 fi
17456 if test "$ol_enable_cache" = no ; then
17457         cat >> confdefs.h <<\EOF
17458 #define LDAP_NOCACHE 1
17459 EOF
17460
17461 fi
17462 if test "$ol_link_kbind" != no ; then
17463         cat >> confdefs.h <<\EOF
17464 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17465 EOF
17466
17467 fi
17468 if test "$ol_enable_proctitle" != no ; then
17469         cat >> confdefs.h <<\EOF
17470 #define LDAP_PROCTITLE 1
17471 EOF
17472
17473 fi
17474 if test "$ol_enable_referrals" != no ; then
17475         cat >> confdefs.h <<\EOF
17476 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17477 EOF
17478
17479 fi
17480 if test "$ol_enable_local" != no; then
17481         cat >> confdefs.h <<\EOF
17482 #define LDAP_PF_LOCAL 1
17483 EOF
17484
17485 fi
17486 if test "$ol_link_ipv6" != no; then
17487         cat >> confdefs.h <<\EOF
17488 #define LDAP_PF_INET6 1
17489 EOF
17490
17491 fi
17492 if test "$ol_enable_cleartext" != no ; then
17493         cat >> confdefs.h <<\EOF
17494 #define SLAPD_CLEARTEXT 1
17495 EOF
17496
17497 fi
17498 if test "$ol_enable_crypt" != no ; then
17499         cat >> confdefs.h <<\EOF
17500 #define SLAPD_CRYPT 1
17501 EOF
17502
17503 fi
17504 if test "$ol_link_kpasswd" != no ; then
17505         cat >> confdefs.h <<\EOF
17506 #define SLAPD_KPASSWD 1
17507 EOF
17508
17509 fi
17510 if test "$ol_link_spasswd" != no ; then
17511         cat >> confdefs.h <<\EOF
17512 #define SLAPD_SPASSWD 1
17513 EOF
17514
17515 fi
17516 if test "$ol_enable_phonetic" != no ; then
17517         cat >> confdefs.h <<\EOF
17518 #define SLAPD_PHONETIC 1
17519 EOF
17520
17521 fi
17522 if test "$ol_enable_rlookups" != no ; then
17523         cat >> confdefs.h <<\EOF
17524 #define SLAPD_RLOOKUPS 1
17525 EOF
17526
17527 fi
17528 if test "$ol_enable_aci" != no ; then
17529         cat >> confdefs.h <<\EOF
17530 #define SLAPD_ACI_ENABLED 1
17531 EOF
17532
17533 fi
17534
17535 if test "$ol_link_modules" != no ; then
17536         cat >> confdefs.h <<\EOF
17537 #define SLAPD_MODULES 1
17538 EOF
17539
17540         BUILD_SLAPD=yes
17541         SLAPD_MODULES_LDFLAGS="-dlopen self"
17542 fi
17543
17544 if test "$ol_enable_bdb" != no ; then
17545         cat >> confdefs.h <<\EOF
17546 #define SLAPD_BDB 1
17547 EOF
17548
17549         BUILD_SLAPD=yes
17550         BUILD_BDB=yes
17551         if test "$ol_with_bdb_module" != static ; then
17552                 cat >> confdefs.h <<\EOF
17553 #define SLAPD_BDB_DYNAMIC 1
17554 EOF
17555
17556                 BUILD_BDB=mod
17557                 BUILD_BDB_DYNAMIC=shared
17558                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17559         fi
17560 fi
17561
17562 if test "$ol_link_dnssrv" != no ; then
17563         cat >> confdefs.h <<\EOF
17564 #define SLAPD_DNSSRV 1
17565 EOF
17566
17567         BUILD_SLAPD=yes
17568         BUILD_DNSSRV=yes
17569         if test "$ol_with_dnssrv_module" != static ; then
17570                 cat >> confdefs.h <<\EOF
17571 #define SLAPD_DNSSRV_DYNAMIC 1
17572 EOF
17573
17574                 BUILD_DNSSRV=mod
17575                 BUILD_DNSSRV_DYNAMIC=shared
17576                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17577         fi
17578 fi
17579
17580 if test "$ol_enable_ldap" != no ; then
17581         cat >> confdefs.h <<\EOF
17582 #define SLAPD_LDAP 1
17583 EOF
17584
17585         BUILD_SLAPD=yes
17586         BUILD_LDAP=yes
17587         if test "$ol_with_ldap_module" != static ; then
17588                 cat >> confdefs.h <<\EOF
17589 #define SLAPD_LDAP_DYNAMIC 1
17590 EOF
17591
17592                 BUILD_LDAP=mod
17593                 BUILD_LDAP_DYNAMIC=shared
17594                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17595         fi
17596 fi
17597
17598 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17599         cat >> confdefs.h <<\EOF
17600 #define SLAPD_LDBM 1
17601 EOF
17602
17603         BUILD_SLAPD=yes
17604         BUILD_LDBM=yes
17605         LDBM_LIB="-lldbm"
17606         if test "$ol_with_ldbm_module" != static ; then
17607                 cat >> confdefs.h <<\EOF
17608 #define SLAPD_LDBM_DYNAMIC 1
17609 EOF
17610
17611                 BUILD_LDBM=mod
17612                 BUILD_LDBM_DYNAMIC=shared
17613                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17614         fi
17615 fi
17616
17617 if test "$ol_enable_meta" != no ; then
17618         if test "$ol_enable_ldap" = no ; then
17619                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17620         fi
17621         if test "$ol_enable_rewrite" = no ; then
17622                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17623         fi
17624         cat >> confdefs.h <<\EOF
17625 #define SLAPD_META 1
17626 EOF
17627
17628         BUILD_SLAPD=yes
17629         BUILD_META=yes
17630         if test "$ol_with_meta_module" != static ; then
17631                 cat >> confdefs.h <<\EOF
17632 #define SLAPD_META_DYNAMIC 1
17633 EOF
17634
17635                 BUILD_META=mod
17636                 BUILD_META_DYNAMIC=shared
17637                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17638         fi
17639 fi
17640
17641 if test "$ol_enable_monitor" != no ; then
17642         cat >> confdefs.h <<\EOF
17643 #define SLAPD_MONITOR 1
17644 EOF
17645
17646         BUILD_SLAPD=yes
17647         BUILD_MONITOR=yes
17648         if test "$ol_with_monitor_module" != static ; then
17649                 cat >> confdefs.h <<\EOF
17650 #define SLAPD_MONITOR_DYNAMIC 1
17651 EOF
17652
17653                 BUILD_MONITOR=mod
17654                 BUILD_MONITOR_DYNAMIC=shared
17655                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17656         fi
17657 fi
17658
17659 if test "$ol_enable_passwd" != no ; then
17660         cat >> confdefs.h <<\EOF
17661 #define SLAPD_PASSWD 1
17662 EOF
17663
17664         BUILD_SLAPD=yes
17665         BUILD_PASSWD=yes
17666         if test "$ol_with_passwd_module" != static ; then
17667                 cat >> confdefs.h <<\EOF
17668 #define SLAPD_PASSWD_DYNAMIC 1
17669 EOF
17670
17671                 BUILD_PASSWD=mod
17672                 BUILD_PASSWD_DYNAMIC=shared
17673                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17674         fi
17675 fi
17676
17677 if test "$ol_link_perl" != no ; then
17678         cat >> confdefs.h <<\EOF
17679 #define SLAPD_PERL 1
17680 EOF
17681
17682         BUILD_SLAPD=yes
17683         BUILD_PERL=yes
17684         if test "$ol_with_perl_module" != static ; then
17685                 cat >> confdefs.h <<\EOF
17686 #define SLAPD_PERL_DYNAMIC 1
17687 EOF
17688
17689                 BUILD_PERL=mod
17690                 BUILD_PERL_DYNAMIC=shared
17691                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17692         fi
17693 fi
17694
17695 if test "$ol_enable_shell" != no ; then
17696         cat >> confdefs.h <<\EOF
17697 #define SLAPD_SHELL 1
17698 EOF
17699
17700         BUILD_SLAPD=yes
17701         BUILD_SHELL=yes
17702         if test "$ol_with_shell_module" != static ; then
17703                 cat >> confdefs.h <<\EOF
17704 #define SLAPD_SHELL_DYNAMIC 1
17705 EOF
17706
17707                 BUILD_SHELL=mod
17708                 BUILD_SHELL_DYNAMIC=shared
17709                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17710         fi
17711 fi
17712
17713 if test "$ol_enable_tcl" != no ; then
17714         cat >> confdefs.h <<\EOF
17715 #define SLAPD_TCL 1
17716 EOF
17717
17718         BUILD_SLAPD=yes
17719         BUILD_TCL=yes
17720         if test "$ol_with_tcl_module" != static; then
17721                 cat >> confdefs.h <<\EOF
17722 #define SLAPD_TCL_DYNAMIC 1
17723 EOF
17724
17725                 BUILD_TCL=mod
17726                 BUILD_TCL_DYNAMIC=shared
17727                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17728         fi
17729 fi
17730
17731 if test "$ol_link_sql" != no ; then
17732         cat >> confdefs.h <<\EOF
17733 #define SLAPD_SQL 1
17734 EOF
17735
17736         BUILD_SLAPD=yes
17737         BUILD_SQL=yes
17738         if test "$ol_with_sql_module" != static; then
17739                 cat >> confdefs.h <<\EOF
17740 #define SLAPD_SQL_DYNAMIC 1
17741 EOF
17742
17743                 BUILD_SQL=mod
17744                 BUILD_SQL_DYNAMIC=shared
17745                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17746         fi
17747 fi
17748
17749 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17750         $BUILD_SLAPD = yes ; then
17751         BUILD_SLURPD=yes
17752 fi
17753
17754 if test "$ol_enable_rewrite" != no ; then
17755         cat >> confdefs.h <<\EOF
17756 #define ENABLE_REWRITE 1
17757 EOF
17758
17759         BUILD_REWRITE=yes
17760         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17761 fi
17762
17763
17764 if test "$LINK_BINS_DYNAMIC" = yes; then
17765     LIB_LINKAGE=DYN
17766     LT_LIB_LINKAGE=shared
17767 else
17768     LIB_LINKAGE=STAT
17769     LT_LIB_LINKAGE=static
17770 fi
17771
17772 if test "$ac_cv_mingw32" = yes ; then
17773     PLAT=NT
17774     DYN_EXT=dll
17775 else
17776     PLAT=UNIX
17777     DYN_EXT=so
17778 fi
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788   
17789   
17790   
17791   
17792   
17793   
17794   
17795   
17796   
17797   
17798   
17799   
17800   
17801   
17802   
17803   
17804   
17805   
17806   
17807   
17808   
17809   
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849 trap '' 1 2 15
17850
17851 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17852
17853 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17854 # Let make expand exec_prefix.
17855 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17856
17857 # Any assignment to VPATH causes Sun make to only execute
17858 # the first set of double-colon rules, so remove it if not needed.
17859 # If there is a colon in the path, we need to keep it.
17860 if test "x$srcdir" = x.; then
17861   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17862 fi
17863
17864 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17865
17866 DEFS=-DHAVE_CONFIG_H
17867
17868 # Without the "./", some shells look in PATH for config.status.
17869 : ${CONFIG_STATUS=./config.status}
17870
17871 echo creating $CONFIG_STATUS
17872 rm -f $CONFIG_STATUS
17873 cat > $CONFIG_STATUS <<EOF
17874 #! /bin/sh
17875 # Generated automatically by configure.
17876 # Run this file to recreate the current configuration.
17877 # This directory was configured as follows,
17878 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17879 #
17880 # $0 $ac_configure_args
17881 #
17882 # Compiler output produced by configure, useful for debugging
17883 # configure, is in ./config.log if it exists.
17884
17885 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17886 for ac_option
17887 do
17888   case "\$ac_option" in
17889   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17890     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17891     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17892   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17893     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17894     exit 0 ;;
17895   -help | --help | --hel | --he | --h)
17896     echo "\$ac_cs_usage"; exit 0 ;;
17897   *) echo "\$ac_cs_usage"; exit 1 ;;
17898   esac
17899 done
17900
17901 ac_given_srcdir=$srcdir
17902 ac_given_INSTALL="$INSTALL"
17903
17904 trap 'rm -fr `echo "\
17905 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17906 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17907 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17908 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17909 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17910 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17911 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17912 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17913 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17914 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17915 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17916 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17917 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17918 include/Makefile:build/top.mk:include/Makefile.in \
17919 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17920 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17921 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17922 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17923 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17924 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17925 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17926 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17927 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17928 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17929 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17930 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17931 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17932 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17933 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17934 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17935 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17936 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
17937 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17938 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17939 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17940 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17941 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17942 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17943 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17944 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17945 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17946 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17947 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17948 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17949  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17950 EOF
17951 cat >> $CONFIG_STATUS <<EOF
17952
17953 # Protect against being on the right side of a sed subst in config.status.
17954 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17955  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17956 $ac_vpsub
17957 $extrasub
17958 s%@SHELL@%$SHELL%g
17959 s%@CFLAGS@%$CFLAGS%g
17960 s%@CPPFLAGS@%$CPPFLAGS%g
17961 s%@CXXFLAGS@%$CXXFLAGS%g
17962 s%@FFLAGS@%$FFLAGS%g
17963 s%@DEFS@%$DEFS%g
17964 s%@LDFLAGS@%$LDFLAGS%g
17965 s%@LIBS@%$LIBS%g
17966 s%@exec_prefix@%$exec_prefix%g
17967 s%@prefix@%$prefix%g
17968 s%@program_transform_name@%$program_transform_name%g
17969 s%@bindir@%$bindir%g
17970 s%@sbindir@%$sbindir%g
17971 s%@libexecdir@%$libexecdir%g
17972 s%@datadir@%$datadir%g
17973 s%@sysconfdir@%$sysconfdir%g
17974 s%@sharedstatedir@%$sharedstatedir%g
17975 s%@localstatedir@%$localstatedir%g
17976 s%@libdir@%$libdir%g
17977 s%@includedir@%$includedir%g
17978 s%@oldincludedir@%$oldincludedir%g
17979 s%@infodir@%$infodir%g
17980 s%@mandir@%$mandir%g
17981 s%@host@%$host%g
17982 s%@host_alias@%$host_alias%g
17983 s%@host_cpu@%$host_cpu%g
17984 s%@host_vendor@%$host_vendor%g
17985 s%@host_os@%$host_os%g
17986 s%@target@%$target%g
17987 s%@target_alias@%$target_alias%g
17988 s%@target_cpu@%$target_cpu%g
17989 s%@target_vendor@%$target_vendor%g
17990 s%@target_os@%$target_os%g
17991 s%@build@%$build%g
17992 s%@build_alias@%$build_alias%g
17993 s%@build_cpu@%$build_cpu%g
17994 s%@build_vendor@%$build_vendor%g
17995 s%@build_os@%$build_os%g
17996 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17997 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17998 s%@INSTALL_DATA@%$INSTALL_DATA%g
17999 s%@PACKAGE@%$PACKAGE%g
18000 s%@VERSION@%$VERSION%g
18001 s%@ACLOCAL@%$ACLOCAL%g
18002 s%@AUTOCONF@%$AUTOCONF%g
18003 s%@AUTOMAKE@%$AUTOMAKE%g
18004 s%@AUTOHEADER@%$AUTOHEADER%g
18005 s%@MAKEINFO@%$MAKEINFO%g
18006 s%@install_sh@%$install_sh%g
18007 s%@AMTAR@%$AMTAR%g
18008 s%@AWK@%$AWK%g
18009 s%@AMTARFLAGS@%$AMTARFLAGS%g
18010 s%@SET_MAKE@%$SET_MAKE%g
18011 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18012 s%@top_builddir@%$top_builddir%g
18013 s%@ldap_subdir@%$ldap_subdir%g
18014 s%@CC@%$CC%g
18015 s%@RANLIB@%$RANLIB%g
18016 s%@LN_S@%$LN_S%g
18017 s%@DLLTOOL@%$DLLTOOL%g
18018 s%@AS@%$AS%g
18019 s%@OBJDUMP@%$OBJDUMP%g
18020 s%@LIBTOOL@%$LIBTOOL%g
18021 s%@LN_H@%$LN_H%g
18022 s%@SENDMAIL@%$SENDMAIL%g
18023 s%@EDITOR@%$EDITOR%g
18024 s%@FINGER@%$FINGER%g
18025 s%@PERLBIN@%$PERLBIN%g
18026 s%@CPP@%$CPP%g
18027 s%@EXEEXT@%$EXEEXT%g
18028 s%@OBJEXT@%$OBJEXT%g
18029 s%@OL_MKDEP@%$OL_MKDEP%g
18030 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18031 s%@LIBOBJS@%$LIBOBJS%g
18032 s%@LIBSRCS@%$LIBSRCS%g
18033 s%@PLAT@%$PLAT%g
18034 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
18035 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
18036 s%@DYN_EXT@%$DYN_EXT%g
18037 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18038 s%@BUILD_BDB@%$BUILD_BDB%g
18039 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18040 s%@BUILD_LDAP@%$BUILD_LDAP%g
18041 s%@BUILD_LDBM@%$BUILD_LDBM%g
18042 s%@BUILD_META@%$BUILD_META%g
18043 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18044 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18045 s%@BUILD_PERL@%$BUILD_PERL%g
18046 s%@BUILD_SHELL@%$BUILD_SHELL%g
18047 s%@BUILD_SQL@%$BUILD_SQL%g
18048 s%@BUILD_TCL@%$BUILD_TCL%g
18049 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18050 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18051 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18052 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18053 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18054 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18055 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18056 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18057 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18058 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18059 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18060 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18061 s%@LDBM_LIB@%$LDBM_LIB%g
18062 s%@LDAP_LIBS@%$LDAP_LIBS%g
18063 s%@LDIF_LIBS@%$LDIF_LIBS%g
18064 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18065 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18066 s%@LDBM_LIBS@%$LDBM_LIBS%g
18067 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18068 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18069 s%@WRAP_LIBS@%$WRAP_LIBS%g
18070 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18071 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
18072 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18073 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18074 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18075 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18076 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18077 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18078 s%@KRB4_LIBS@%$KRB4_LIBS%g
18079 s%@KRB5_LIBS@%$KRB5_LIBS%g
18080 s%@READLINE_LIBS@%$READLINE_LIBS%g
18081 s%@SASL_LIBS@%$SASL_LIBS%g
18082 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18083 s%@TLS_LIBS@%$TLS_LIBS%g
18084 s%@MODULES_LIBS@%$MODULES_LIBS%g
18085 s%@AUTH_LIBS@%$AUTH_LIBS%g
18086 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18087 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18088 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18089 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18090
18091 CEOF
18092 EOF
18093
18094 cat >> $CONFIG_STATUS <<\EOF
18095
18096 # Split the substitutions into bite-sized pieces for seds with
18097 # small command number limits, like on Digital OSF/1 and HP-UX.
18098 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18099 ac_file=1 # Number of current file.
18100 ac_beg=1 # First line for current file.
18101 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18102 ac_more_lines=:
18103 ac_sed_cmds=""
18104 while $ac_more_lines; do
18105   if test $ac_beg -gt 1; then
18106     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18107   else
18108     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18109   fi
18110   if test ! -s conftest.s$ac_file; then
18111     ac_more_lines=false
18112     rm -f conftest.s$ac_file
18113   else
18114     if test -z "$ac_sed_cmds"; then
18115       ac_sed_cmds="sed -f conftest.s$ac_file"
18116     else
18117       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18118     fi
18119     ac_file=`expr $ac_file + 1`
18120     ac_beg=$ac_end
18121     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18122   fi
18123 done
18124 if test -z "$ac_sed_cmds"; then
18125   ac_sed_cmds=cat
18126 fi
18127 EOF
18128
18129 cat >> $CONFIG_STATUS <<EOF
18130
18131 CONFIG_FILES=\${CONFIG_FILES-"\
18132 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18133 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18134 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18135 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18136 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18137 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18138 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18139 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18140 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18141 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18142 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18143 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18144 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18145 include/Makefile:build/top.mk:include/Makefile.in \
18146 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18147 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18148 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18149 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18150 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18151 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18152 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18153 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18154 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18155 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18156 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18157 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18158 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18159 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18160 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18161 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18162 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18163 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18164 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18165 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18166 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18167 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18168 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18169 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18170 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18171 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18172 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18173 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18174 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
18175 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
18176 "}
18177 EOF
18178 cat >> $CONFIG_STATUS <<\EOF
18179 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18180   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18181   case "$ac_file" in
18182   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18183        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18184   *) ac_file_in="${ac_file}.in" ;;
18185   esac
18186
18187   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18188
18189   # Remove last slash and all that follows it.  Not all systems have dirname.
18190   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18191   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18192     # The file is in a subdirectory.
18193     test ! -d "$ac_dir" && mkdir "$ac_dir"
18194     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18195     # A "../" for each directory in $ac_dir_suffix.
18196     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18197   else
18198     ac_dir_suffix= ac_dots=
18199   fi
18200
18201   case "$ac_given_srcdir" in
18202   .)  srcdir=.
18203       if test -z "$ac_dots"; then top_srcdir=.
18204       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18205   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18206   *) # Relative path.
18207     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18208     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18209   esac
18210
18211   case "$ac_given_INSTALL" in
18212   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18213   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18214   esac
18215
18216   echo creating "$ac_file"
18217   rm -f "$ac_file"
18218   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18219   case "$ac_file" in
18220   *[Mm]akefile*) ac_comsub="1i\\
18221 # $configure_input" ;;
18222   *) ac_comsub= ;;
18223   esac
18224
18225   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18226   sed -e "$ac_comsub
18227 s%@configure_input@%$configure_input%g
18228 s%@srcdir@%$srcdir%g
18229 s%@top_srcdir@%$top_srcdir%g
18230 s%@INSTALL@%$INSTALL%g
18231 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18232 fi; done
18233 rm -f conftest.s*
18234
18235 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18236 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18237 #
18238 # ac_d sets the value in "#define NAME VALUE" lines.
18239 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18240 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18241 ac_dC='\3'
18242 ac_dD='%g'
18243 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18244 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18245 ac_uB='\([      ]\)%\1#\2define\3'
18246 ac_uC=' '
18247 ac_uD='\4%g'
18248 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18249 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18250 ac_eB='$%\1#\2define\3'
18251 ac_eC=' '
18252 ac_eD='%g'
18253
18254 if test "${CONFIG_HEADERS+set}" != set; then
18255 EOF
18256 cat >> $CONFIG_STATUS <<EOF
18257   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18258 EOF
18259 cat >> $CONFIG_STATUS <<\EOF
18260 fi
18261 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18262   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18263   case "$ac_file" in
18264   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18265        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18266   *) ac_file_in="${ac_file}.in" ;;
18267   esac
18268
18269   echo creating $ac_file
18270
18271   rm -f conftest.frag conftest.in conftest.out
18272   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18273   cat $ac_file_inputs > conftest.in
18274
18275 EOF
18276
18277 # Transform confdefs.h into a sed script conftest.vals that substitutes
18278 # the proper values into config.h.in to produce config.h.  And first:
18279 # Protect against being on the right side of a sed subst in config.status.
18280 # Protect against being in an unquoted here document in config.status.
18281 rm -f conftest.vals
18282 cat > conftest.hdr <<\EOF
18283 s/[\\&%]/\\&/g
18284 s%[\\$`]%\\&%g
18285 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18286 s%ac_d%ac_u%gp
18287 s%ac_u%ac_e%gp
18288 EOF
18289 sed -n -f conftest.hdr confdefs.h > conftest.vals
18290 rm -f conftest.hdr
18291
18292 # This sed command replaces #undef with comments.  This is necessary, for
18293 # example, in the case of _POSIX_SOURCE, which is predefined and required
18294 # on some systems where configure will not decide to define it.
18295 cat >> conftest.vals <<\EOF
18296 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18297 EOF
18298
18299 # Break up conftest.vals because some shells have a limit on
18300 # the size of here documents, and old seds have small limits too.
18301
18302 rm -f conftest.tail
18303 while :
18304 do
18305   ac_lines=`grep -c . conftest.vals`
18306   # grep -c gives empty output for an empty file on some AIX systems.
18307   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18308   # Write a limited-size here document to conftest.frag.
18309   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18310   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18311   echo 'CEOF
18312   sed -f conftest.frag conftest.in > conftest.out
18313   rm -f conftest.in
18314   mv conftest.out conftest.in
18315 ' >> $CONFIG_STATUS
18316   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18317   rm -f conftest.vals
18318   mv conftest.tail conftest.vals
18319 done
18320 rm -f conftest.vals
18321
18322 cat >> $CONFIG_STATUS <<\EOF
18323   rm -f conftest.frag conftest.h
18324   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18325   cat conftest.in >> conftest.h
18326   rm -f conftest.in
18327   if cmp -s $ac_file conftest.h 2>/dev/null; then
18328     echo "$ac_file is unchanged"
18329     rm -f conftest.h
18330   else
18331     # Remove last slash and all that follows it.  Not all systems have dirname.
18332       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18333       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18334       # The file is in a subdirectory.
18335       test ! -d "$ac_dir" && mkdir "$ac_dir"
18336     fi
18337     rm -f $ac_file
18338     mv conftest.h $ac_file
18339   fi
18340 fi; done
18341
18342 EOF
18343 cat >> $CONFIG_STATUS <<EOF
18344
18345 EOF
18346 cat >> $CONFIG_STATUS <<\EOF
18347
18348 date > stamp-h
18349 echo Please \"make depend\" to build dependencies
18350
18351 exit 0
18352 EOF
18353 chmod +x $CONFIG_STATUS
18354 rm -fr confdefs* $ac_clean_files
18355 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18356