]> git.sur5r.net Git - openldap/blob - configure
DB4 changes
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.395 2002/01/21 02:12:41 kurt Exp  
4
5 # Copyright 1998-2002 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-2002 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 [yes]"
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 [no]"
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="yes"
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="no"
1971 fi
1972 # end --enable-ldbm
1973 # OpenLDAP --with-ldbm_api
1974         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1975 if test "${with_ldbm_api+set}" = set; then
1976   withval="$with_ldbm_api"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1986         fi
1987         ol_with_ldbm_api="$ol_arg"
1988
1989 else
1990         ol_with_ldbm_api="auto"
1991 fi
1992 # end --with-ldbm_api
1993
1994 # OpenLDAP --with-ldbm_module
1995         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1996 if test "${with_ldbm_module+set}" = set; then
1997   withval="$with_ldbm_module"
1998   
1999         ol_arg=invalid
2000         for ol_val in static dynamic ; do
2001                 if test "$withval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2007         fi
2008         ol_with_ldbm_module="$ol_arg"
2009
2010 else
2011         ol_with_ldbm_module="static"
2012 fi
2013 # end --with-ldbm_module
2014
2015 # OpenLDAP --with-ldbm_type
2016         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2017 if test "${with_ldbm_type+set}" = set; then
2018   withval="$with_ldbm_type"
2019   
2020         ol_arg=invalid
2021         for ol_val in auto btree hash ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2028         fi
2029         ol_with_ldbm_type="$ol_arg"
2030
2031 else
2032         ol_with_ldbm_type="auto"
2033 fi
2034 # end --with-ldbm_type
2035
2036 # OpenLDAP --enable-meta
2037         # Check whether --enable-meta or --disable-meta was given.
2038 if test "${enable_meta+set}" = set; then
2039   enableval="$enable_meta"
2040   
2041         ol_arg=invalid
2042         for ol_val in auto yes no ; do
2043                 if test "$enableval" = "$ol_val" ; then
2044                         ol_arg="$ol_val"
2045                 fi
2046         done
2047         if test "$ol_arg" = "invalid" ; then
2048                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2049         fi
2050         ol_enable_meta="$ol_arg"
2051
2052 else
2053         ol_enable_meta="no"
2054 fi
2055 # end --enable-meta
2056 # OpenLDAP --with-meta_module
2057         # Check whether --with-meta_module or --without-meta_module was given.
2058 if test "${with_meta_module+set}" = set; then
2059   withval="$with_meta_module"
2060   
2061         ol_arg=invalid
2062         for ol_val in static dynamic ; do
2063                 if test "$withval" = "$ol_val" ; then
2064                         ol_arg="$ol_val"
2065                 fi
2066         done
2067         if test "$ol_arg" = "invalid" ; then
2068                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2069         fi
2070         ol_with_meta_module="$ol_arg"
2071
2072 else
2073         ol_with_meta_module="static"
2074 fi
2075 # end --with-meta_module
2076
2077 # OpenLDAP --enable-monitor
2078         # Check whether --enable-monitor or --disable-monitor was given.
2079 if test "${enable_monitor+set}" = set; then
2080   enableval="$enable_monitor"
2081   
2082         ol_arg=invalid
2083         for ol_val in auto yes no ; do
2084                 if test "$enableval" = "$ol_val" ; then
2085                         ol_arg="$ol_val"
2086                 fi
2087         done
2088         if test "$ol_arg" = "invalid" ; then
2089                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2090         fi
2091         ol_enable_monitor="$ol_arg"
2092
2093 else
2094         ol_enable_monitor="no"
2095 fi
2096 # end --enable-monitor
2097 # OpenLDAP --with-monitor_module
2098         # Check whether --with-monitor_module or --without-monitor_module was given.
2099 if test "${with_monitor_module+set}" = set; then
2100   withval="$with_monitor_module"
2101   
2102         ol_arg=invalid
2103         for ol_val in static dynamic ; do
2104                 if test "$withval" = "$ol_val" ; then
2105                         ol_arg="$ol_val"
2106                 fi
2107         done
2108         if test "$ol_arg" = "invalid" ; then
2109                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2110         fi
2111         ol_with_monitor_module="$ol_arg"
2112
2113 else
2114         ol_with_monitor_module="static"
2115 fi
2116 # end --with-monitor_module
2117
2118 # OpenLDAP --enable-passwd
2119         # Check whether --enable-passwd or --disable-passwd was given.
2120 if test "${enable_passwd+set}" = set; then
2121   enableval="$enable_passwd"
2122   
2123         ol_arg=invalid
2124         for ol_val in auto yes no ; do
2125                 if test "$enableval" = "$ol_val" ; then
2126                         ol_arg="$ol_val"
2127                 fi
2128         done
2129         if test "$ol_arg" = "invalid" ; then
2130                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2131         fi
2132         ol_enable_passwd="$ol_arg"
2133
2134 else
2135         ol_enable_passwd="no"
2136 fi
2137 # end --enable-passwd
2138 # OpenLDAP --with-passwd_module
2139         # Check whether --with-passwd_module or --without-passwd_module was given.
2140 if test "${with_passwd_module+set}" = set; then
2141   withval="$with_passwd_module"
2142   
2143         ol_arg=invalid
2144         for ol_val in static dynamic ; do
2145                 if test "$withval" = "$ol_val" ; then
2146                         ol_arg="$ol_val"
2147                 fi
2148         done
2149         if test "$ol_arg" = "invalid" ; then
2150                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2151         fi
2152         ol_with_passwd_module="$ol_arg"
2153
2154 else
2155         ol_with_passwd_module="static"
2156 fi
2157 # end --with-passwd_module
2158
2159 # OpenLDAP --enable-perl
2160         # Check whether --enable-perl or --disable-perl was given.
2161 if test "${enable_perl+set}" = set; then
2162   enableval="$enable_perl"
2163   
2164         ol_arg=invalid
2165         for ol_val in auto yes no ; do
2166                 if test "$enableval" = "$ol_val" ; then
2167                         ol_arg="$ol_val"
2168                 fi
2169         done
2170         if test "$ol_arg" = "invalid" ; then
2171                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2172         fi
2173         ol_enable_perl="$ol_arg"
2174
2175 else
2176         ol_enable_perl="no"
2177 fi
2178 # end --enable-perl
2179 # OpenLDAP --with-perl_module
2180         # Check whether --with-perl_module or --without-perl_module was given.
2181 if test "${with_perl_module+set}" = set; then
2182   withval="$with_perl_module"
2183   
2184         ol_arg=invalid
2185         for ol_val in static dynamic ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2192         fi
2193         ol_with_perl_module="$ol_arg"
2194
2195 else
2196         ol_with_perl_module="static"
2197 fi
2198 # end --with-perl_module
2199
2200 # OpenLDAP --enable-shell
2201         # Check whether --enable-shell or --disable-shell was given.
2202 if test "${enable_shell+set}" = set; then
2203   enableval="$enable_shell"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2213         fi
2214         ol_enable_shell="$ol_arg"
2215
2216 else
2217         ol_enable_shell="no"
2218 fi
2219 # end --enable-shell
2220 # OpenLDAP --with-shell_module
2221         # Check whether --with-shell_module or --without-shell_module was given.
2222 if test "${with_shell_module+set}" = set; then
2223   withval="$with_shell_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_shell_module="$ol_arg"
2235
2236 else
2237         ol_with_shell_module="static"
2238 fi
2239 # end --with-shell_module
2240
2241 # OpenLDAP --enable-sql
2242         # Check whether --enable-sql or --disable-sql was given.
2243 if test "${enable_sql+set}" = set; then
2244   enableval="$enable_sql"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2254         fi
2255         ol_enable_sql="$ol_arg"
2256
2257 else
2258         ol_enable_sql="no"
2259 fi
2260 # end --enable-sql
2261 # OpenLDAP --with-sql_module
2262         # Check whether --with-sql_module or --without-sql_module was given.
2263 if test "${with_sql_module+set}" = set; then
2264   withval="$with_sql_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_sql_module="$ol_arg"
2276
2277 else
2278         ol_with_sql_module="static"
2279 fi
2280 # end --with-sql_module
2281
2282 # OpenLDAP --enable-tcl
2283         # Check whether --enable-tcl or --disable-tcl was given.
2284 if test "${enable_tcl+set}" = set; then
2285   enableval="$enable_tcl"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2295         fi
2296         ol_enable_tcl="$ol_arg"
2297
2298 else
2299         ol_enable_tcl="no"
2300 fi
2301 # end --enable-tcl
2302 # OpenLDAP --with-tcl_module
2303         # Check whether --with-tcl_module or --without-tcl_module was given.
2304 if test "${with_tcl_module+set}" = set; then
2305   withval="$with_tcl_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_tcl_module="$ol_arg"
2317
2318 else
2319         ol_with_tcl_module="static"
2320 fi
2321 # end --with-tcl_module
2322
2323
2324 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2325 if test "${with_xxslurpdoptions+set}" = set; then
2326   withval="$with_xxslurpdoptions"
2327   :
2328 fi
2329
2330 # OpenLDAP --enable-slurpd
2331         # Check whether --enable-slurpd or --disable-slurpd was given.
2332 if test "${enable_slurpd+set}" = set; then
2333   enableval="$enable_slurpd"
2334   
2335         ol_arg=invalid
2336         for ol_val in auto yes no ; do
2337                 if test "$enableval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2343         fi
2344         ol_enable_slurpd="$ol_arg"
2345
2346 else
2347         ol_enable_slurpd="auto"
2348 fi
2349 # end --enable-slurpd
2350
2351 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2352 if test "${with_xxliboptions+set}" = set; then
2353   withval="$with_xxliboptions"
2354   :
2355 fi
2356
2357 # Check whether --enable-static or --disable-static was given.
2358 if test "${enable_static+set}" = set; then
2359   enableval="$enable_static"
2360   p=${PACKAGE-default}
2361 case "$enableval" in
2362 yes) enable_static=yes ;;
2363 no) enable_static=no ;;
2364 *)
2365   enable_static=no
2366   # Look at the argument we got.  We use all the common list separators.
2367   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2368   for pkg in $enableval; do
2369     if test "X$pkg" = "X$p"; then
2370       enable_static=yes
2371     fi
2372   done
2373   IFS="$ac_save_ifs"
2374   ;;
2375 esac
2376 else
2377   enable_static=yes
2378 fi
2379
2380 # Check whether --enable-shared or --disable-shared was given.
2381 if test "${enable_shared+set}" = set; then
2382   enableval="$enable_shared"
2383   p=${PACKAGE-default}
2384 case "$enableval" in
2385 yes) enable_shared=yes ;;
2386 no) enable_shared=no ;;
2387 *)
2388   enable_shared=no
2389   # Look at the argument we got.  We use all the common list separators.
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2391   for pkg in $enableval; do
2392     if test "X$pkg" = "X$p"; then
2393       enable_shared=yes
2394     fi
2395   done
2396   IFS="$ac_save_ifs"
2397   ;;
2398 esac
2399 else
2400   enable_shared=yes
2401 fi
2402
2403
2404
2405 # validate options
2406 if test $ol_enable_slapd = no ; then
2407                 if test $ol_enable_bdb = yes ; then
2408                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2409         fi
2410         if test $ol_enable_dnssrv = yes ; then
2411                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2412         fi
2413         if test $ol_enable_ldap = yes ; then
2414                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2415         fi
2416         if test $ol_enable_ldbm = yes ; then
2417                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2418         fi
2419         if test $ol_enable_meta = yes ; then
2420                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2421         fi
2422         if test $ol_enable_monitor = yes ; then
2423                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2424         fi
2425         if test $ol_enable_passwd = yes ; then
2426                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2427         fi
2428         if test $ol_enable_perl = yes ; then
2429                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2430         fi
2431         if test $ol_enable_shell = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2433         fi
2434         if test $ol_enable_tcl = yes ; then
2435                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2436         fi
2437         if test $ol_enable_sql = yes ; then
2438                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2439         fi
2440         if test $ol_enable_modules = yes ; then
2441                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2442         fi
2443         if test $ol_enable_wrappers = yes ; then
2444                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2445         fi
2446         if test $ol_enable_phonetic = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2448         fi
2449         if test $ol_enable_rlookups = yes ; then
2450                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2451         fi
2452         if test $ol_enable_aci = yes ; then
2453                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2454         fi
2455         if test $ol_with_ldbm_api != auto ; then
2456                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2457         fi
2458         if test $ol_with_ldbm_type != auto ; then
2459                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2460         fi
2461         if test $ol_with_bdb_module != static ; then
2462                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2463         fi
2464         if test $ol_with_dnssrv_module != static ; then
2465                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2466         fi
2467         if test $ol_with_ldap_module != static ; then
2468                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2469         fi
2470         if test $ol_with_ldbm_module != static ; then
2471                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2472         fi
2473         if test $ol_with_meta_module != static ; then
2474                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2475         fi
2476         if test $ol_with_monitor_module != static ; then
2477                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2478         fi
2479         if test $ol_with_passwd_module != static ; then
2480                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2481         fi
2482         if test $ol_with_perl_module != static ; then
2483                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2484         fi
2485         if test $ol_with_shell_module != static ; then
2486                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2487         fi
2488         if test $ol_with_tcl_module != static ; then
2489                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2490         fi
2491         if test $ol_with_sql_module != static ; then
2492                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2493         fi
2494         if test $ol_enable_slurpd = yes ; then
2495                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2496         fi
2497         if test $ol_enable_rewrite = yes ; then
2498                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2499         fi
2500
2501         # force settings to no
2502         ol_enable_bdb=no
2503         ol_enable_dnssrv=no
2504         ol_enable_ldap=no
2505         ol_enable_ldbm=no
2506         ol_enable_meta=no
2507         ol_enable_monitor=no
2508         ol_enable_passwd=no
2509         ol_enable_perl=no
2510         ol_enable_shell=no
2511         ol_enable_tcl=no
2512         ol_enable_sql=no
2513
2514         ol_enable_modules=no
2515         ol_enable_phonetic=no
2516         ol_enable_rlookups=no
2517         ol_enable_aci=no
2518         ol_enable_wrappers=no
2519         ol_enable_dynamic=no
2520
2521         ol_with_ldbm_api=no
2522         ol_with_ldbm_type=no
2523
2524         ol_with_bdb_module=static
2525         ol_with_dnssrv_module=static
2526         ol_with_ldap_module=static
2527         ol_with_ldbm_module=static
2528         ol_with_meta_module=static
2529         ol_with_monitor_module=static
2530         ol_with_passwd_module=static
2531         ol_with_perl_module=static
2532         ol_with_shell_module=static
2533         ol_with_tcl_module=static
2534         ol_with_sql_module=static
2535
2536         ol_enable_slurpd=no
2537
2538         ol_enable_rewrite=no
2539
2540 elif test $ol_enable_ldbm = no ; then
2541         
2542         if test $ol_with_ldbm_api != auto ; then
2543                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2544         fi
2545
2546         if test $ol_with_ldbm_type != auto ; then
2547                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2548         fi
2549
2550         if test $ol_with_ldbm_module != static ; then
2551                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2552         fi
2553
2554         if test $ol_enable_modules != yes -a \
2555                 $ol_enable_bdb = no -a \
2556                 $ol_enable_dnssrv = no -a \
2557                 $ol_enable_ldap = no -a \
2558                 $ol_enable_meta = no -a \
2559                 $ol_enable_monitor = no -a \
2560                 $ol_enable_passwd = no -a \
2561                 $ol_enable_perl = no -a \
2562                 $ol_enable_shell = no -a \
2563                 $ol_enable_sql = no -a \
2564                 $ol_enable_tcl = no ; then
2565
2566                 if test $ol_enable_slapd = yes ; then
2567                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2568                 else
2569                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2570                         ol_enable_slapd=no
2571                 fi
2572         fi
2573
2574         ol_with_ldbm_api=no
2575         ol_with_ldbm_type=no
2576         ol_with_ldbm_module=static
2577
2578         if test $ol_enable_bdb != no ; then
2579                 ol_with_ldbm_api=berkeley
2580         fi
2581
2582 else
2583                 if test $ol_with_ldbm_api = gdbm -a \
2584                 $ol_with_ldbm_type = btree ; then
2585                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2586         fi
2587         if test $ol_with_ldbm_api = mdbm -a \
2588                 $ol_with_ldbm_type = btree ; then
2589                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2590         fi
2591         if test $ol_with_ldbm_api = ndbm -a \
2592                 $ol_with_ldbm_type = btree ; then
2593                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2594         fi
2595
2596         if test $ol_enable_bdb = yes ; then
2597                 if test $ol_with_ldbm_api = auto ; then
2598                         ol_with_ldbm_api=berkeley
2599                 elif test $ol_with_ldbm_api != berkeley ; then
2600                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2601                 fi
2602
2603         elif test $ol_enable_bdb = auto ; then
2604                 if test $ol_with_ldbm_api != berkeley \
2605                         -o $ol_with_ldbm_api != auto ; then
2606                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2607                         ol_enable_bdb=no
2608                 fi
2609         fi
2610 fi
2611
2612 if test $ol_enable_slurpd = yes ; then
2613                 if test $ol_with_threads = no ; then
2614                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2615         fi
2616 fi
2617
2618 if test $ol_enable_lmpasswd = yes ; then
2619         if test $ol_with_tls = no ; then
2620                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2621         fi
2622 fi
2623
2624 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2625         if test $ol_with_kerberos = no ; then
2626                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2627         elif test $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_STATIC_BACKENDS=
2693 SLAPD_DYNAMIC_BACKENDS=
2694
2695 SLAPD_PERL_LDFLAGS=
2696 MOD_PERL_LDFLAGS=
2697 PERL_CPPFLAGS=
2698
2699 SLAPD_SQL_LDFLAGS=
2700 SLAPD_SQL_LIBS=
2701 SLAPD_SQL_INCLUDES=
2702
2703 MOD_TCL_LIB=
2704 KRB4_LIBS=
2705 KRB5_LIBS=
2706 READLINE_LIBS=
2707 SASL_LIBS=
2708 TERMCAP_LIBS=
2709 TLS_LIBS=
2710 MODULES_LIBS=
2711 AUTH_LIBS=
2712
2713 SLAPD_SLP_LIBS=
2714
2715
2716
2717 cat >> confdefs.h <<\EOF
2718 #define HAVE_MKVERSION 1
2719 EOF
2720
2721
2722
2723
2724 ol_aix_threads=no
2725 case "$target" in
2726 *-*-aix*)       if test -z "$CC" ; then
2727                 case "$ol_with_threads" in
2728                 auto | yes |  posix) ol_aix_threads=yes ;;
2729                 esac
2730         fi
2731 ;;
2732 esac
2733
2734 if test $ol_aix_threads = yes ; then
2735         if test -z "${CC}" ; then
2736                 for ac_prog in cc_r xlc_r cc
2737 do
2738 # Extract the first word of "$ac_prog", so it can be a program name with args.
2739 set dummy $ac_prog; ac_word=$2
2740 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2741 echo "configure:2742: checking for $ac_word" >&5
2742 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2743   echo $ac_n "(cached) $ac_c" 1>&6
2744 else
2745   if test -n "$CC"; then
2746   ac_cv_prog_CC="$CC" # Let the user override the test.
2747 else
2748   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2749   ac_dummy="$PATH"
2750   for ac_dir in $ac_dummy; do
2751     test -z "$ac_dir" && ac_dir=.
2752     if test -f $ac_dir/$ac_word; then
2753       ac_cv_prog_CC="$ac_prog"
2754       break
2755     fi
2756   done
2757   IFS="$ac_save_ifs"
2758 fi
2759 fi
2760 CC="$ac_cv_prog_CC"
2761 if test -n "$CC"; then
2762   echo "$ac_t""$CC" 1>&6
2763 else
2764   echo "$ac_t""no" 1>&6
2765 fi
2766
2767 test -n "$CC" && break
2768 done
2769
2770
2771                 if test "$CC" = cc ; then
2772                                                 if test $ol_with_threads != auto ; then
2773                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2774                         else
2775                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2776                         fi
2777                         ol_with_threads=no
2778                 fi
2779         fi
2780
2781         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2782                 ol_with_threads=posix
2783                 ol_cv_pthread_create=yes
2784         fi
2785 fi
2786
2787 if test -z "${CC}"; then
2788         for ac_prog in cc
2789 do
2790 # Extract the first word of "$ac_prog", so it can be a program name with args.
2791 set dummy $ac_prog; ac_word=$2
2792 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2793 echo "configure:2794: checking for $ac_word" >&5
2794 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   if test -n "$CC"; then
2798   ac_cv_prog_CC="$CC" # Let the user override the test.
2799 else
2800   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2801   ac_dummy="$PATH"
2802   for ac_dir in $ac_dummy; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/$ac_word; then
2805       ac_cv_prog_CC="$ac_prog"
2806       break
2807     fi
2808   done
2809   IFS="$ac_save_ifs"
2810 fi
2811 fi
2812 CC="$ac_cv_prog_CC"
2813 if test -n "$CC"; then
2814   echo "$ac_t""$CC" 1>&6
2815 else
2816   echo "$ac_t""no" 1>&6
2817 fi
2818
2819 test -n "$CC" && break
2820 done
2821
2822 fi
2823
2824
2825 for ac_prog in ar gar
2826 do
2827 # Extract the first word of "$ac_prog", so it can be a program name with args.
2828 set dummy $ac_prog; ac_word=$2
2829 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2830 echo "configure:2831: checking for $ac_word" >&5
2831 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2832   echo $ac_n "(cached) $ac_c" 1>&6
2833 else
2834   if test -n "$AR"; then
2835   ac_cv_prog_AR="$AR" # Let the user override the test.
2836 else
2837   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2838   ac_dummy="$PATH"
2839   for ac_dir in $ac_dummy; do
2840     test -z "$ac_dir" && ac_dir=.
2841     if test -f $ac_dir/$ac_word; then
2842       ac_cv_prog_AR="$ac_prog"
2843       break
2844     fi
2845   done
2846   IFS="$ac_save_ifs"
2847 fi
2848 fi
2849 AR="$ac_cv_prog_AR"
2850 if test -n "$AR"; then
2851   echo "$ac_t""$AR" 1>&6
2852 else
2853   echo "$ac_t""no" 1>&6
2854 fi
2855
2856 test -n "$AR" && break
2857 done
2858 test -n "$AR" || AR="ar"
2859
2860
2861
2862
2863 # Check whether --enable-fast-install or --disable-fast-install was given.
2864 if test "${enable_fast_install+set}" = set; then
2865   enableval="$enable_fast_install"
2866   p=${PACKAGE-default}
2867 case "$enableval" in
2868 yes) enable_fast_install=yes ;;
2869 no) enable_fast_install=no ;;
2870 *)
2871   enable_fast_install=no
2872   # Look at the argument we got.  We use all the common list separators.
2873   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2874   for pkg in $enableval; do
2875     if test "X$pkg" = "X$p"; then
2876       enable_fast_install=yes
2877     fi
2878   done
2879   IFS="$ac_save_ifs"
2880   ;;
2881 esac
2882 else
2883   enable_fast_install=yes
2884 fi
2885
2886 # Extract the first word of "ranlib", so it can be a program name with args.
2887 set dummy ranlib; ac_word=$2
2888 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2889 echo "configure:2890: checking for $ac_word" >&5
2890 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   if test -n "$RANLIB"; then
2894   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2895 else
2896   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2897   ac_dummy="$PATH"
2898   for ac_dir in $ac_dummy; do
2899     test -z "$ac_dir" && ac_dir=.
2900     if test -f $ac_dir/$ac_word; then
2901       ac_cv_prog_RANLIB="ranlib"
2902       break
2903     fi
2904   done
2905   IFS="$ac_save_ifs"
2906   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2907 fi
2908 fi
2909 RANLIB="$ac_cv_prog_RANLIB"
2910 if test -n "$RANLIB"; then
2911   echo "$ac_t""$RANLIB" 1>&6
2912 else
2913   echo "$ac_t""no" 1>&6
2914 fi
2915
2916 # Extract the first word of "gcc", so it can be a program name with args.
2917 set dummy gcc; ac_word=$2
2918 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2919 echo "configure:2920: checking for $ac_word" >&5
2920 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2921   echo $ac_n "(cached) $ac_c" 1>&6
2922 else
2923   if test -n "$CC"; then
2924   ac_cv_prog_CC="$CC" # Let the user override the test.
2925 else
2926   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2927   ac_dummy="$PATH"
2928   for ac_dir in $ac_dummy; do
2929     test -z "$ac_dir" && ac_dir=.
2930     if test -f $ac_dir/$ac_word; then
2931       ac_cv_prog_CC="gcc"
2932       break
2933     fi
2934   done
2935   IFS="$ac_save_ifs"
2936 fi
2937 fi
2938 CC="$ac_cv_prog_CC"
2939 if test -n "$CC"; then
2940   echo "$ac_t""$CC" 1>&6
2941 else
2942   echo "$ac_t""no" 1>&6
2943 fi
2944
2945 if test -z "$CC"; then
2946   # Extract the first word of "cc", so it can be a program name with args.
2947 set dummy cc; ac_word=$2
2948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2949 echo "configure:2950: checking for $ac_word" >&5
2950 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   if test -n "$CC"; then
2954   ac_cv_prog_CC="$CC" # Let the user override the test.
2955 else
2956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2957   ac_prog_rejected=no
2958   ac_dummy="$PATH"
2959   for ac_dir in $ac_dummy; do
2960     test -z "$ac_dir" && ac_dir=.
2961     if test -f $ac_dir/$ac_word; then
2962       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2963         ac_prog_rejected=yes
2964         continue
2965       fi
2966       ac_cv_prog_CC="cc"
2967       break
2968     fi
2969   done
2970   IFS="$ac_save_ifs"
2971 if test $ac_prog_rejected = yes; then
2972   # We found a bogon in the path, so make sure we never use it.
2973   set dummy $ac_cv_prog_CC
2974   shift
2975   if test $# -gt 0; then
2976     # We chose a different compiler from the bogus one.
2977     # However, it has the same basename, so the bogon will be chosen
2978     # first if we set CC to just the basename; use the full file name.
2979     shift
2980     set dummy "$ac_dir/$ac_word" "$@"
2981     shift
2982     ac_cv_prog_CC="$@"
2983   fi
2984 fi
2985 fi
2986 fi
2987 CC="$ac_cv_prog_CC"
2988 if test -n "$CC"; then
2989   echo "$ac_t""$CC" 1>&6
2990 else
2991   echo "$ac_t""no" 1>&6
2992 fi
2993
2994   if test -z "$CC"; then
2995     case "`uname -s`" in
2996     *win32* | *WIN32* | *CYGWIN*)
2997       # Extract the first word of "cl", so it can be a program name with args.
2998 set dummy cl; ac_word=$2
2999 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3000 echo "configure:3001: checking for $ac_word" >&5
3001 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3002   echo $ac_n "(cached) $ac_c" 1>&6
3003 else
3004   if test -n "$CC"; then
3005   ac_cv_prog_CC="$CC" # Let the user override the test.
3006 else
3007   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3008   ac_dummy="$PATH"
3009   for ac_dir in $ac_dummy; do
3010     test -z "$ac_dir" && ac_dir=.
3011     if test -f $ac_dir/$ac_word; then
3012       ac_cv_prog_CC="cl"
3013       break
3014     fi
3015   done
3016   IFS="$ac_save_ifs"
3017 fi
3018 fi
3019 CC="$ac_cv_prog_CC"
3020 if test -n "$CC"; then
3021   echo "$ac_t""$CC" 1>&6
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025  ;;
3026     esac
3027   fi
3028   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3029 fi
3030
3031 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3032 echo "configure:3033: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3033
3034 ac_ext=c
3035 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3036 ac_cpp='$CPP $CPPFLAGS'
3037 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3038 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3039 cross_compiling=$ac_cv_prog_cc_cross
3040
3041 cat > conftest.$ac_ext << EOF
3042
3043 #line 3044 "configure"
3044 #include "confdefs.h"
3045
3046 main(){return(0);}
3047 EOF
3048 if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3049   ac_cv_prog_cc_works=yes
3050   # If we can't run a trivial program, we are probably using a cross compiler.
3051   if (./conftest; exit) 2>/dev/null; then
3052     ac_cv_prog_cc_cross=no
3053   else
3054     ac_cv_prog_cc_cross=yes
3055   fi
3056 else
3057   echo "configure: failed program was:" >&5
3058   cat conftest.$ac_ext >&5
3059   ac_cv_prog_cc_works=no
3060 fi
3061 rm -fr conftest*
3062 ac_ext=c
3063 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3064 ac_cpp='$CPP $CPPFLAGS'
3065 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3066 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3067 cross_compiling=$ac_cv_prog_cc_cross
3068
3069 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3070 if test $ac_cv_prog_cc_works = no; then
3071   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3072 fi
3073 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3074 echo "configure:3075: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3075 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3076 cross_compiling=$ac_cv_prog_cc_cross
3077
3078 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3079 echo "configure:3080: checking whether we are using GNU C" >&5
3080 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3081   echo $ac_n "(cached) $ac_c" 1>&6
3082 else
3083   cat > conftest.c <<EOF
3084 #ifdef __GNUC__
3085   yes;
3086 #endif
3087 EOF
3088 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3089   ac_cv_prog_gcc=yes
3090 else
3091   ac_cv_prog_gcc=no
3092 fi
3093 fi
3094
3095 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3096
3097 if test $ac_cv_prog_gcc = yes; then
3098   GCC=yes
3099 else
3100   GCC=
3101 fi
3102
3103 ac_test_CFLAGS="${CFLAGS+set}"
3104 ac_save_CFLAGS="$CFLAGS"
3105 CFLAGS=
3106 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3107 echo "configure:3108: checking whether ${CC-cc} accepts -g" >&5
3108 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   echo 'void f(){}' > conftest.c
3112 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3113   ac_cv_prog_cc_g=yes
3114 else
3115   ac_cv_prog_cc_g=no
3116 fi
3117 rm -f conftest*
3118
3119 fi
3120
3121 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3122 if test "$ac_test_CFLAGS" = set; then
3123   CFLAGS="$ac_save_CFLAGS"
3124 elif test $ac_cv_prog_cc_g = yes; then
3125   if test "$GCC" = yes; then
3126     CFLAGS="-g -O2"
3127   else
3128     CFLAGS="-g"
3129   fi
3130 else
3131   if test "$GCC" = yes; then
3132     CFLAGS="-O2"
3133   else
3134     CFLAGS=
3135   fi
3136 fi
3137
3138 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3139 if test "${with_gnu_ld+set}" = set; then
3140   withval="$with_gnu_ld"
3141   test "$withval" = no || with_gnu_ld=yes
3142 else
3143   with_gnu_ld=no
3144 fi
3145
3146 ac_prog=ld
3147 if test "$ac_cv_prog_gcc" = yes; then
3148   # Check if gcc -print-prog-name=ld gives a path.
3149   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3150 echo "configure:3151: checking for ld used by GCC" >&5
3151   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3152   case "$ac_prog" in
3153     # Accept absolute paths.
3154     [\\/]* | [A-Za-z]:[\\/]*)
3155       re_direlt='/[^/][^/]*/\.\./'
3156       # Canonicalize the path of ld
3157       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3158       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3159         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3160       done
3161       test -z "$LD" && LD="$ac_prog"
3162       ;;
3163   "")
3164     # If it fails, then pretend we aren't using GCC.
3165     ac_prog=ld
3166     ;;
3167   *)
3168     # If it is relative, then search for the first ld in PATH.
3169     with_gnu_ld=unknown
3170     ;;
3171   esac
3172 elif test "$with_gnu_ld" = yes; then
3173   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3174 echo "configure:3175: checking for GNU ld" >&5
3175 else
3176   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3177 echo "configure:3178: checking for non-GNU ld" >&5
3178 fi
3179 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3180   echo $ac_n "(cached) $ac_c" 1>&6
3181 else
3182   if test -z "$LD"; then
3183   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3184   for ac_dir in $PATH; do
3185     test -z "$ac_dir" && ac_dir=.
3186     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3187       ac_cv_path_LD="$ac_dir/$ac_prog"
3188       # Check to see if the program is GNU ld.  I'd rather use --version,
3189       # but apparently some GNU ld's only accept -v.
3190       # Break only if it was the GNU/non-GNU ld that we prefer.
3191       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3192         test "$with_gnu_ld" != no && break
3193       else
3194         test "$with_gnu_ld" != yes && break
3195       fi
3196     fi
3197   done
3198   IFS="$ac_save_ifs"
3199 else
3200   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3201 fi
3202 fi
3203
3204 LD="$ac_cv_path_LD"
3205 if test -n "$LD"; then
3206   echo "$ac_t""$LD" 1>&6
3207 else
3208   echo "$ac_t""no" 1>&6
3209 fi
3210 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3211 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3212 echo "configure:3213: checking if the linker ($LD) is GNU ld" >&5
3213 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3214   echo $ac_n "(cached) $ac_c" 1>&6
3215 else
3216   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3217 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3218   ac_cv_prog_gnu_ld=yes
3219 else
3220   ac_cv_prog_gnu_ld=no
3221 fi
3222 fi
3223
3224 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3225
3226
3227 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3228 echo "configure:3229: checking for BSD-compatible nm" >&5
3229 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   if test -n "$NM"; then
3233   # Let the user override the test.
3234   ac_cv_path_NM="$NM"
3235 else
3236   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3237   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3238     test -z "$ac_dir" && ac_dir=.
3239     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3240       # Check to see if the nm accepts a BSD-compat flag.
3241       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3242       #   nm: unknown option "B" ignored
3243       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3244         ac_cv_path_NM="$ac_dir/nm -B"
3245         break
3246       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3247         ac_cv_path_NM="$ac_dir/nm -p"
3248         break
3249       else
3250         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3251         continue # so that we can try to find one that supports BSD flags
3252       fi
3253     fi
3254   done
3255   IFS="$ac_save_ifs"
3256   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3257 fi
3258 fi
3259
3260 NM="$ac_cv_path_NM"
3261 echo "$ac_t""$NM" 1>&6
3262
3263 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3264 echo "configure:3265: checking whether ln -s works" >&5
3265 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3266   echo $ac_n "(cached) $ac_c" 1>&6
3267 else
3268   rm -f conftestdata
3269 if ln -s X conftestdata 2>/dev/null
3270 then
3271   rm -f conftestdata
3272   ac_cv_prog_LN_S="ln -s"
3273 else
3274   ac_cv_prog_LN_S=ln
3275 fi
3276 fi
3277 LN_S="$ac_cv_prog_LN_S"
3278 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3279   echo "$ac_t""yes" 1>&6
3280 else
3281   echo "$ac_t""no" 1>&6
3282 fi
3283
3284 if test $host != $build; then
3285   ac_tool_prefix=${host_alias}-
3286 else
3287   ac_tool_prefix=
3288 fi
3289
3290
3291 case "$target" in
3292 NONE) lt_target="$host" ;;
3293 *) lt_target="$target" ;;
3294 esac
3295
3296 # Check for any special flags to pass to ltconfig.
3297 libtool_flags="--cache-file=$cache_file"
3298 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3299 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3300 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3301 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3302 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3303 libtool_flags="$libtool_flags --enable-dlopen"
3304 libtool_flags="$libtool_flags --enable-win32-dll"
3305 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3306 if test "${enable_libtool_lock+set}" = set; then
3307   enableval="$enable_libtool_lock"
3308   :
3309 fi
3310
3311 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3312 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3313
3314 # Some flags need to be propagated to the compiler or linker for good
3315 # libtool support.
3316 case "$lt_target" in
3317 *-*-irix6*)
3318   # Find out which ABI we are using.
3319   echo '#line 3320 "configure"' > conftest.$ac_ext
3320   if { (eval echo configure:3321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3321     case "`/usr/bin/file conftest.o`" in
3322     *32-bit*)
3323       LD="${LD-ld} -32"
3324       ;;
3325     *N32*)
3326       LD="${LD-ld} -n32"
3327       ;;
3328     *64-bit*)
3329       LD="${LD-ld} -64"
3330       ;;
3331     esac
3332   fi
3333   rm -rf conftest*
3334   ;;
3335
3336 *-*-sco3.2v5*)
3337   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3338   SAVE_CFLAGS="$CFLAGS"
3339   CFLAGS="$CFLAGS -belf"
3340   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3341 echo "configure:3342: checking whether the C compiler needs -belf" >&5
3342 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3343   echo $ac_n "(cached) $ac_c" 1>&6
3344 else
3345   cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348
3349 int main() {
3350
3351 ; return 0; }
3352 EOF
3353 if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3354   rm -rf conftest*
3355   lt_cv_cc_needs_belf=yes
3356 else
3357   echo "configure: failed program was:" >&5
3358   cat conftest.$ac_ext >&5
3359   rm -rf conftest*
3360   lt_cv_cc_needs_belf=no
3361 fi
3362 rm -f conftest*
3363 fi
3364
3365 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3366   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3367     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3368     CFLAGS="$SAVE_CFLAGS"
3369   fi
3370   ;;
3371
3372 *-*-cygwin* | *-*-mingw*)
3373   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3374 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3375 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3376 echo "configure:3377: checking for $ac_word" >&5
3377 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3378   echo $ac_n "(cached) $ac_c" 1>&6
3379 else
3380   if test -n "$DLLTOOL"; then
3381   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3382 else
3383   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3384   ac_dummy="$PATH"
3385   for ac_dir in $ac_dummy; do
3386     test -z "$ac_dir" && ac_dir=.
3387     if test -f $ac_dir/$ac_word; then
3388       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3389       break
3390     fi
3391   done
3392   IFS="$ac_save_ifs"
3393 fi
3394 fi
3395 DLLTOOL="$ac_cv_prog_DLLTOOL"
3396 if test -n "$DLLTOOL"; then
3397   echo "$ac_t""$DLLTOOL" 1>&6
3398 else
3399   echo "$ac_t""no" 1>&6
3400 fi
3401
3402
3403 if test -z "$ac_cv_prog_DLLTOOL"; then
3404 if test -n "$ac_tool_prefix"; then
3405   # Extract the first word of "dlltool", so it can be a program name with args.
3406 set dummy dlltool; ac_word=$2
3407 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3408 echo "configure:3409: checking for $ac_word" >&5
3409 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3410   echo $ac_n "(cached) $ac_c" 1>&6
3411 else
3412   if test -n "$DLLTOOL"; then
3413   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3414 else
3415   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3416   ac_dummy="$PATH"
3417   for ac_dir in $ac_dummy; do
3418     test -z "$ac_dir" && ac_dir=.
3419     if test -f $ac_dir/$ac_word; then
3420       ac_cv_prog_DLLTOOL="dlltool"
3421       break
3422     fi
3423   done
3424   IFS="$ac_save_ifs"
3425   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3426 fi
3427 fi
3428 DLLTOOL="$ac_cv_prog_DLLTOOL"
3429 if test -n "$DLLTOOL"; then
3430   echo "$ac_t""$DLLTOOL" 1>&6
3431 else
3432   echo "$ac_t""no" 1>&6
3433 fi
3434
3435 else
3436   DLLTOOL="false"
3437 fi
3438 fi
3439
3440   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3441 set dummy ${ac_tool_prefix}as; ac_word=$2
3442 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3443 echo "configure:3444: checking for $ac_word" >&5
3444 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3445   echo $ac_n "(cached) $ac_c" 1>&6
3446 else
3447   if test -n "$AS"; then
3448   ac_cv_prog_AS="$AS" # Let the user override the test.
3449 else
3450   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3451   ac_dummy="$PATH"
3452   for ac_dir in $ac_dummy; do
3453     test -z "$ac_dir" && ac_dir=.
3454     if test -f $ac_dir/$ac_word; then
3455       ac_cv_prog_AS="${ac_tool_prefix}as"
3456       break
3457     fi
3458   done
3459   IFS="$ac_save_ifs"
3460 fi
3461 fi
3462 AS="$ac_cv_prog_AS"
3463 if test -n "$AS"; then
3464   echo "$ac_t""$AS" 1>&6
3465 else
3466   echo "$ac_t""no" 1>&6
3467 fi
3468
3469
3470 if test -z "$ac_cv_prog_AS"; then
3471 if test -n "$ac_tool_prefix"; then
3472   # Extract the first word of "as", so it can be a program name with args.
3473 set dummy as; ac_word=$2
3474 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3475 echo "configure:3476: checking for $ac_word" >&5
3476 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3477   echo $ac_n "(cached) $ac_c" 1>&6
3478 else
3479   if test -n "$AS"; then
3480   ac_cv_prog_AS="$AS" # Let the user override the test.
3481 else
3482   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3483   ac_dummy="$PATH"
3484   for ac_dir in $ac_dummy; do
3485     test -z "$ac_dir" && ac_dir=.
3486     if test -f $ac_dir/$ac_word; then
3487       ac_cv_prog_AS="as"
3488       break
3489     fi
3490   done
3491   IFS="$ac_save_ifs"
3492   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3493 fi
3494 fi
3495 AS="$ac_cv_prog_AS"
3496 if test -n "$AS"; then
3497   echo "$ac_t""$AS" 1>&6
3498 else
3499   echo "$ac_t""no" 1>&6
3500 fi
3501
3502 else
3503   AS="false"
3504 fi
3505 fi
3506
3507   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3508 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3509 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3510 echo "configure:3511: checking for $ac_word" >&5
3511 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3512   echo $ac_n "(cached) $ac_c" 1>&6
3513 else
3514   if test -n "$OBJDUMP"; then
3515   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3516 else
3517   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3518   ac_dummy="$PATH"
3519   for ac_dir in $ac_dummy; do
3520     test -z "$ac_dir" && ac_dir=.
3521     if test -f $ac_dir/$ac_word; then
3522       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3523       break
3524     fi
3525   done
3526   IFS="$ac_save_ifs"
3527 fi
3528 fi
3529 OBJDUMP="$ac_cv_prog_OBJDUMP"
3530 if test -n "$OBJDUMP"; then
3531   echo "$ac_t""$OBJDUMP" 1>&6
3532 else
3533   echo "$ac_t""no" 1>&6
3534 fi
3535
3536
3537 if test -z "$ac_cv_prog_OBJDUMP"; then
3538 if test -n "$ac_tool_prefix"; then
3539   # Extract the first word of "objdump", so it can be a program name with args.
3540 set dummy objdump; ac_word=$2
3541 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3542 echo "configure:3543: checking for $ac_word" >&5
3543 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3544   echo $ac_n "(cached) $ac_c" 1>&6
3545 else
3546   if test -n "$OBJDUMP"; then
3547   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3548 else
3549   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3550   ac_dummy="$PATH"
3551   for ac_dir in $ac_dummy; do
3552     test -z "$ac_dir" && ac_dir=.
3553     if test -f $ac_dir/$ac_word; then
3554       ac_cv_prog_OBJDUMP="objdump"
3555       break
3556     fi
3557   done
3558   IFS="$ac_save_ifs"
3559   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3560 fi
3561 fi
3562 OBJDUMP="$ac_cv_prog_OBJDUMP"
3563 if test -n "$OBJDUMP"; then
3564   echo "$ac_t""$OBJDUMP" 1>&6
3565 else
3566   echo "$ac_t""no" 1>&6
3567 fi
3568
3569 else
3570   OBJDUMP="false"
3571 fi
3572 fi
3573
3574   ;;
3575
3576 esac
3577
3578
3579 # Save cache, so that ltconfig can load it
3580
3581
3582 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3583 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3584 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3585 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3586 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3587 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3588 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3589 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3590
3591 # Reload cache, that may have been modified by ltconfig
3592
3593
3594 # This can be used to rebuild libtool when needed
3595 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3596
3597 # Always use our own libtool.
3598 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3599
3600 # Redirect the config.log output again, so that the ltconfig log is not
3601 # clobbered by the next message.
3602 exec 5>>./config.log
3603
3604
3605 for ac_prog in mawk gawk nawk awk
3606 do
3607 # Extract the first word of "$ac_prog", so it can be a program name with args.
3608 set dummy $ac_prog; ac_word=$2
3609 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3610 echo "configure:3611: checking for $ac_word" >&5
3611 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3612   echo $ac_n "(cached) $ac_c" 1>&6
3613 else
3614   if test -n "$AWK"; then
3615   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3616 else
3617   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3618   ac_dummy="$PATH"
3619   for ac_dir in $ac_dummy; do
3620     test -z "$ac_dir" && ac_dir=.
3621     if test -f $ac_dir/$ac_word; then
3622       ac_cv_prog_AWK="$ac_prog"
3623       break
3624     fi
3625   done
3626   IFS="$ac_save_ifs"
3627 fi
3628 fi
3629 AWK="$ac_cv_prog_AWK"
3630 if test -n "$AWK"; then
3631   echo "$ac_t""$AWK" 1>&6
3632 else
3633   echo "$ac_t""no" 1>&6
3634 fi
3635
3636 test -n "$AWK" && break
3637 done
3638
3639 # test for ln hardlink support
3640 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3641 echo "configure:3642: checking whether ln works" >&5
3642 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3643   echo $ac_n "(cached) $ac_c" 1>&6
3644 else
3645   rm -f conftest.src conftest.dst
3646 echo "conftest" > conftest.src
3647 if ln conftest.src conftest.dst 2>/dev/null
3648 then
3649   ol_cv_prog_LN_H="ln"
3650 else
3651   ol_cv_prog_LN_H="cp"
3652 fi
3653 rm -f conftest.src conftest.dst
3654
3655 fi
3656 LN_H="$ol_cv_prog_LN_H"
3657 if test "$ol_cv_prog_LN_H" = "ln"; then
3658         echo "$ac_t""yes" 1>&6
3659 else
3660         echo "$ac_t""no" 1>&6
3661 fi
3662
3663 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3664 echo "configure:3665: checking whether ln -s works" >&5
3665 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3666   echo $ac_n "(cached) $ac_c" 1>&6
3667 else
3668   rm -f conftestdata
3669 if ln -s X conftestdata 2>/dev/null
3670 then
3671   rm -f conftestdata
3672   ac_cv_prog_LN_S="ln -s"
3673 else
3674   ac_cv_prog_LN_S=ln
3675 fi
3676 fi
3677 LN_S="$ac_cv_prog_LN_S"
3678 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3679   echo "$ac_t""yes" 1>&6
3680 else
3681   echo "$ac_t""no" 1>&6
3682 fi
3683
3684
3685 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3686         LN_S="$LN_H"
3687 fi
3688
3689 # Extract the first word of "sendmail", so it can be a program name with args.
3690 set dummy sendmail; ac_word=$2
3691 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3692 echo "configure:3693: checking for $ac_word" >&5
3693 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3694   echo $ac_n "(cached) $ac_c" 1>&6
3695 else
3696   case "$SENDMAIL" in
3697   /*)
3698   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3699   ;;
3700   ?:/*)
3701   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3702   ;;
3703   *)
3704   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3705   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3706   for ac_dir in $ac_dummy; do 
3707     test -z "$ac_dir" && ac_dir=.
3708     if test -f $ac_dir/$ac_word; then
3709       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3710       break
3711     fi
3712   done
3713   IFS="$ac_save_ifs"
3714   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3715   ;;
3716 esac
3717 fi
3718 SENDMAIL="$ac_cv_path_SENDMAIL"
3719 if test -n "$SENDMAIL"; then
3720   echo "$ac_t""$SENDMAIL" 1>&6
3721 else
3722   echo "$ac_t""no" 1>&6
3723 fi
3724
3725 # Extract the first word of "vi", so it can be a program name with args.
3726 set dummy vi; ac_word=$2
3727 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3728 echo "configure:3729: checking for $ac_word" >&5
3729 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3730   echo $ac_n "(cached) $ac_c" 1>&6
3731 else
3732   case "$EDITOR" in
3733   /*)
3734   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3735   ;;
3736   ?:/*)
3737   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3738   ;;
3739   *)
3740   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3741   ac_dummy="$PATH:/usr/ucb"
3742   for ac_dir in $ac_dummy; do 
3743     test -z "$ac_dir" && ac_dir=.
3744     if test -f $ac_dir/$ac_word; then
3745       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3746       break
3747     fi
3748   done
3749   IFS="$ac_save_ifs"
3750   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3751   ;;
3752 esac
3753 fi
3754 EDITOR="$ac_cv_path_EDITOR"
3755 if test -n "$EDITOR"; then
3756   echo "$ac_t""$EDITOR" 1>&6
3757 else
3758   echo "$ac_t""no" 1>&6
3759 fi
3760
3761 # Extract the first word of "finger", so it can be a program name with args.
3762 set dummy finger; 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_FINGER+set}\" = set"; then
3766   echo $ac_n "(cached) $ac_c" 1>&6
3767 else
3768   case "$FINGER" in
3769   /*)
3770   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3771   ;;
3772   ?:/*)
3773   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3774   ;;
3775   *)
3776   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3777   ac_dummy="$PATH:/usr/ucb"
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_FINGER="$ac_dir/$ac_word"
3782       break
3783     fi
3784   done
3785   IFS="$ac_save_ifs"
3786   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3787   ;;
3788 esac
3789 fi
3790 FINGER="$ac_cv_path_FINGER"
3791 if test -n "$FINGER"; then
3792   echo "$ac_t""$FINGER" 1>&6
3793 else
3794   echo "$ac_t""no" 1>&6
3795 fi
3796
3797
3798 ol_link_perl=no
3799 if test $ol_enable_perl != no ; then
3800         # Extract the first word of "perl", so it can be a program name with args.
3801 set dummy perl; ac_word=$2
3802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3803 echo "configure:3804: checking for $ac_word" >&5
3804 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3805   echo $ac_n "(cached) $ac_c" 1>&6
3806 else
3807   case "$PERLBIN" in
3808   /*)
3809   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3810   ;;
3811   ?:/*)
3812   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3813   ;;
3814   *)
3815   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3816   ac_dummy="$PATH"
3817   for ac_dir in $ac_dummy; do 
3818     test -z "$ac_dir" && ac_dir=.
3819     if test -f $ac_dir/$ac_word; then
3820       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3821       break
3822     fi
3823   done
3824   IFS="$ac_save_ifs"
3825   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3826   ;;
3827 esac
3828 fi
3829 PERLBIN="$ac_cv_path_PERLBIN"
3830 if test -n "$PERLBIN"; then
3831   echo "$ac_t""$PERLBIN" 1>&6
3832 else
3833   echo "$ac_t""no" 1>&6
3834 fi
3835
3836
3837         if test "no$PERLBIN" = "no" ; then
3838                 if test $ol_enable_perl = yes ; then
3839                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3840                 fi
3841
3842         else
3843                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3844                 if test x"$ol_with_perl_module" = "xstatic" ; then
3845                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3846                 else
3847                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3848                 fi
3849                                 ol_link_perl=yes
3850         fi
3851 fi
3852
3853 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3854 echo "configure:3855: checking how to run the C preprocessor" >&5
3855 # On Suns, sometimes $CPP names a directory.
3856 if test -n "$CPP" && test -d "$CPP"; then
3857   CPP=
3858 fi
3859 if test -z "$CPP"; then
3860 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863     # This must be in double quotes, not single quotes, because CPP may get
3864   # substituted into the Makefile and "${CC-cc}" will confuse make.
3865   CPP="${CC-cc} -E"
3866   # On the NeXT, cc -E runs the code through the compiler's parser,
3867   # not just through cpp.
3868   cat > conftest.$ac_ext <<EOF
3869 #line 3870 "configure"
3870 #include "confdefs.h"
3871 #include <assert.h>
3872 Syntax Error
3873 EOF
3874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3875 { (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3877 if test -z "$ac_err"; then
3878   :
3879 else
3880   echo "$ac_err" >&5
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   CPP="${CC-cc} -E -traditional-cpp"
3885   cat > conftest.$ac_ext <<EOF
3886 #line 3887 "configure"
3887 #include "confdefs.h"
3888 #include <assert.h>
3889 Syntax Error
3890 EOF
3891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3892 { (eval echo configure:3893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3894 if test -z "$ac_err"; then
3895   :
3896 else
3897   echo "$ac_err" >&5
3898   echo "configure: failed program was:" >&5
3899   cat conftest.$ac_ext >&5
3900   rm -rf conftest*
3901   CPP="${CC-cc} -nologo -E"
3902   cat > conftest.$ac_ext <<EOF
3903 #line 3904 "configure"
3904 #include "confdefs.h"
3905 #include <assert.h>
3906 Syntax Error
3907 EOF
3908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3909 { (eval echo configure:3910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3911 if test -z "$ac_err"; then
3912   :
3913 else
3914   echo "$ac_err" >&5
3915   echo "configure: failed program was:" >&5
3916   cat conftest.$ac_ext >&5
3917   rm -rf conftest*
3918   CPP=/lib/cpp
3919 fi
3920 rm -f conftest*
3921 fi
3922 rm -f conftest*
3923 fi
3924 rm -f conftest*
3925   ac_cv_prog_CPP="$CPP"
3926 fi
3927   CPP="$ac_cv_prog_CPP"
3928 else
3929   ac_cv_prog_CPP="$CPP"
3930 fi
3931 echo "$ac_t""$CPP" 1>&6
3932
3933
3934 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3935         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3936
3937 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3938         echo "configure: warning: programs compiled here do run here..." 1>&2
3939         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3940
3941 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3942         echo "configure: warning: programs compiled here do not run here..." 1>&2
3943         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3944 fi
3945
3946 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3947 echo "configure:3948: checking for AIX" >&5
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #ifdef _AIX
3952   yes
3953 #endif
3954
3955 EOF
3956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3957   egrep "yes" >/dev/null 2>&1; then
3958   rm -rf conftest*
3959   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3960 #define _ALL_SOURCE 1
3961 EOF
3962
3963 else
3964   rm -rf conftest*
3965   echo "$ac_t""no" 1>&6
3966 fi
3967 rm -f conftest*
3968
3969
3970 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3971 echo "configure:3972: checking for POSIXized ISC" >&5
3972 if test -d /etc/conf/kconfig.d &&
3973   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3974 then
3975   echo "$ac_t""yes" 1>&6
3976   ISC=yes # If later tests want to check for ISC.
3977   cat >> confdefs.h <<\EOF
3978 #define _POSIX_SOURCE 1
3979 EOF
3980
3981   if test "$GCC" = yes; then
3982     CC="$CC -posix"
3983   else
3984     CC="$CC -Xp"
3985   fi
3986 else
3987   echo "$ac_t""no" 1>&6
3988   ISC=
3989 fi
3990
3991 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3992 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3993 echo "configure:3994: checking for minix/config.h" >&5
3994 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3995   echo $ac_n "(cached) $ac_c" 1>&6
3996 else
3997   cat > conftest.$ac_ext <<EOF
3998 #line 3999 "configure"
3999 #include "confdefs.h"
4000 #include <minix/config.h>
4001 EOF
4002 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4003 { (eval echo configure:4004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4004 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4005 if test -z "$ac_err"; then
4006   rm -rf conftest*
4007   eval "ac_cv_header_$ac_safe=yes"
4008 else
4009   echo "$ac_err" >&5
4010   echo "configure: failed program was:" >&5
4011   cat conftest.$ac_ext >&5
4012   rm -rf conftest*
4013   eval "ac_cv_header_$ac_safe=no"
4014 fi
4015 rm -f conftest*
4016 fi
4017 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4018   echo "$ac_t""yes" 1>&6
4019   MINIX=yes
4020 else
4021   echo "$ac_t""no" 1>&6
4022 MINIX=
4023 fi
4024
4025 if test "$MINIX" = yes; then
4026   cat >> confdefs.h <<\EOF
4027 #define _POSIX_SOURCE 1
4028 EOF
4029
4030   cat >> confdefs.h <<\EOF
4031 #define _POSIX_1_SOURCE 2
4032 EOF
4033
4034   cat >> confdefs.h <<\EOF
4035 #define _MINIX 1
4036 EOF
4037
4038 fi
4039
4040
4041 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4042 echo "configure:4043: checking for Cygwin environment" >&5
4043 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4044   echo $ac_n "(cached) $ac_c" 1>&6
4045 else
4046   cat > conftest.$ac_ext <<EOF
4047 #line 4048 "configure"
4048 #include "confdefs.h"
4049
4050 int main() {
4051
4052 #ifndef __CYGWIN__
4053 #define __CYGWIN__ __CYGWIN32__
4054 #endif
4055 return __CYGWIN__;
4056 ; return 0; }
4057 EOF
4058 if { (eval echo configure:4059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4059   rm -rf conftest*
4060   ac_cv_cygwin=yes
4061 else
4062   echo "configure: failed program was:" >&5
4063   cat conftest.$ac_ext >&5
4064   rm -rf conftest*
4065   ac_cv_cygwin=no
4066 fi
4067 rm -f conftest*
4068 fi
4069
4070 echo "$ac_t""$ac_cv_cygwin" 1>&6
4071 CYGWIN=
4072 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4073 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4074 echo "configure:4075: checking for mingw32 environment" >&5
4075 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4076   echo $ac_n "(cached) $ac_c" 1>&6
4077 else
4078   cat > conftest.$ac_ext <<EOF
4079 #line 4080 "configure"
4080 #include "confdefs.h"
4081
4082 int main() {
4083 return __MINGW32__;
4084 ; return 0; }
4085 EOF
4086 if { (eval echo configure:4087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4087   rm -rf conftest*
4088   ac_cv_mingw32=yes
4089 else
4090   echo "configure: failed program was:" >&5
4091   cat conftest.$ac_ext >&5
4092   rm -rf conftest*
4093   ac_cv_mingw32=no
4094 fi
4095 rm -f conftest*
4096 fi
4097
4098 echo "$ac_t""$ac_cv_mingw32" 1>&6
4099 MINGW32=
4100 test "$ac_cv_mingw32" = yes && MINGW32=yes
4101 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4102 echo "configure:4103: checking for EMX OS/2 environment" >&5
4103 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4104   echo $ac_n "(cached) $ac_c" 1>&6
4105 else
4106   cat > conftest.$ac_ext <<EOF
4107 #line 4108 "configure"
4108 #include "confdefs.h"
4109
4110 int main() {
4111 return __EMX__;
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4115   rm -rf conftest*
4116   ac_cv_emxos2=yes
4117 else
4118   echo "configure: failed program was:" >&5
4119   cat conftest.$ac_ext >&5
4120   rm -rf conftest*
4121   ac_cv_emxos2=no
4122 fi
4123 rm -f conftest*
4124 fi
4125
4126 echo "$ac_t""$ac_cv_emxos2" 1>&6
4127 EMXOS2=
4128 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4129
4130
4131
4132 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4133 echo "configure:4134: checking for executable suffix" >&5
4134 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4135   echo $ac_n "(cached) $ac_c" 1>&6
4136 else
4137   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4138   ac_cv_exeext=.exe
4139 else
4140   rm -f conftest*
4141   echo 'int main () { return 0; }' > conftest.$ac_ext
4142   ac_cv_exeext=
4143   if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4144     for file in conftest.*; do
4145       case $file in
4146       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4147       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4148       esac
4149     done
4150   else
4151     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4152   fi
4153   rm -f conftest*
4154   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4155 fi
4156 fi
4157
4158 EXEEXT=""
4159 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4160 echo "$ac_t""${ac_cv_exeext}" 1>&6
4161 ac_exeext=$EXEEXT
4162
4163 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4164 echo "configure:4165: checking for object suffix" >&5
4165 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4166   echo $ac_n "(cached) $ac_c" 1>&6
4167 else
4168   rm -f conftest*
4169 echo 'int i = 1;' > conftest.$ac_ext
4170 if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4171   for ac_file in conftest.*; do
4172     case $ac_file in
4173     *.c) ;;
4174     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4175     esac
4176   done
4177 else
4178   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4179 fi
4180 rm -f conftest*
4181 fi
4182
4183 echo "$ac_t""$ac_cv_objext" 1>&6
4184 OBJEXT=$ac_cv_objext
4185 ac_objext=$ac_cv_objext
4186
4187
4188 cat >> confdefs.h <<EOF
4189 #define EXEEXT "${EXEEXT}"
4190 EOF
4191
4192
4193 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4194 echo "configure:4195: checking for be_app in -lbe" >&5
4195 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4196 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4197   echo $ac_n "(cached) $ac_c" 1>&6
4198 else
4199   ac_save_LIBS="$LIBS"
4200 LIBS="-lbe -lroot -lnet $LIBS"
4201 cat > conftest.$ac_ext <<EOF
4202 #line 4203 "configure"
4203 #include "confdefs.h"
4204 /* Override any gcc2 internal prototype to avoid an error.  */
4205 /* We use char because int might match the return type of a gcc2
4206     builtin and then its argument prototype would still apply.  */
4207 char be_app();
4208
4209 int main() {
4210 be_app()
4211 ; return 0; }
4212 EOF
4213 if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4214   rm -rf conftest*
4215   eval "ac_cv_lib_$ac_lib_var=yes"
4216 else
4217   echo "configure: failed program was:" >&5
4218   cat conftest.$ac_ext >&5
4219   rm -rf conftest*
4220   eval "ac_cv_lib_$ac_lib_var=no"
4221 fi
4222 rm -f conftest*
4223 LIBS="$ac_save_LIBS"
4224
4225 fi
4226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4227   echo "$ac_t""yes" 1>&6
4228   LIBS="$LIBS -lbe -lroot -lnet"
4229 else
4230   echo "$ac_t""no" 1>&6
4231 :
4232 fi
4233
4234
4235
4236
4237
4238 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4239 echo "configure:4240: checking for ${CC-cc} option to accept ANSI C" >&5
4240 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4241   echo $ac_n "(cached) $ac_c" 1>&6
4242 else
4243   am_cv_prog_cc_stdc=no
4244 ac_save_CC="$CC"
4245 # Don't try gcc -ansi; that turns off useful extensions and
4246 # breaks some systems' header files.
4247 # AIX                   -qlanglvl=ansi
4248 # Ultrix and OSF/1      -std1
4249 # HP-UX 10.20 and later -Ae
4250 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4251 # SVR4                  -Xc -D__EXTENSIONS__
4252 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4253 do
4254   CC="$ac_save_CC $ac_arg"
4255   cat > conftest.$ac_ext <<EOF
4256 #line 4257 "configure"
4257 #include "confdefs.h"
4258 #include <stdarg.h>
4259 #include <stdio.h>
4260 #include <sys/types.h>
4261 #include <sys/stat.h>
4262 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4263 struct buf { int x; };
4264 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4265 static char *e (p, i)
4266      char **p;
4267      int i;
4268 {
4269   return p[i];
4270 }
4271 static char *f (char * (*g) (char **, int), char **p, ...)
4272 {
4273   char *s;
4274   va_list v;
4275   va_start (v,p);
4276   s = g (p, va_arg (v,int));
4277   va_end (v);
4278   return s;
4279 }
4280 int test (int i, double x);
4281 struct s1 {int (*f) (int a);};
4282 struct s2 {int (*f) (double a);};
4283 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4284 int argc;
4285 char **argv;
4286
4287 int main() {
4288
4289 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4290
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4294   rm -rf conftest*
4295   am_cv_prog_cc_stdc="$ac_arg"; break
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299 fi
4300 rm -f conftest*
4301 done
4302 CC="$ac_save_CC"
4303
4304 fi
4305
4306 if test -z "$am_cv_prog_cc_stdc"; then
4307   echo "$ac_t""none needed" 1>&6
4308 else
4309   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4310 fi
4311 case "x$am_cv_prog_cc_stdc" in
4312   x|xno) ;;
4313   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4314 esac
4315
4316 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4317         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4318 fi
4319
4320 # test for make depend flag
4321 OL_MKDEP=
4322 OL_MKDEP_FLAGS=
4323 if test -z "${MKDEP}"; then
4324         OL_MKDEP="${CC-cc}"
4325         if test -z "${MKDEP_FLAGS}"; then
4326                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4327 echo "configure:4328: checking for ${OL_MKDEP} depend flag" >&5
4328 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4329   echo $ac_n "(cached) $ac_c" 1>&6
4330 else
4331   
4332                         ol_cv_mkdep=no
4333                         for flag in "-M" "-xM"; do
4334                                 cat > conftest.c <<EOF
4335  noCode;
4336 EOF
4337                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4338                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4339                                 then
4340                                         if test ! -f conftest."${ac_object}" ; then
4341                                                 ol_cv_mkdep=$flag
4342                                                 OL_MKDEP_FLAGS="$flag"
4343                                                 break
4344                                         fi
4345                                 fi
4346                         done
4347                         rm -f conftest*
4348                 
4349 fi
4350
4351 echo "$ac_t""$ol_cv_mkdep" 1>&6
4352         else
4353                 cc_cv_mkdep=yes
4354                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4355         fi
4356 else
4357         cc_cv_mkdep=yes
4358         OL_MKDEP="${MKDEP}"
4359         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4360 fi
4361
4362
4363
4364 if test "${ol_cv_mkdep}" = no ; then
4365         # this will soon become an error
4366         echo "configure: warning: do not know how to generate dependencies" 1>&2
4367 fi
4368
4369 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4370 echo "configure:4371: checking for afopen in -ls" >&5
4371 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4373   echo $ac_n "(cached) $ac_c" 1>&6
4374 else
4375   ac_save_LIBS="$LIBS"
4376 LIBS="-ls  $LIBS"
4377 cat > conftest.$ac_ext <<EOF
4378 #line 4379 "configure"
4379 #include "confdefs.h"
4380 /* Override any gcc2 internal prototype to avoid an error.  */
4381 /* We use char because int might match the return type of a gcc2
4382     builtin and then its argument prototype would still apply.  */
4383 char afopen();
4384
4385 int main() {
4386 afopen()
4387 ; return 0; }
4388 EOF
4389 if { (eval echo configure:4390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4390   rm -rf conftest*
4391   eval "ac_cv_lib_$ac_lib_var=yes"
4392 else
4393   echo "configure: failed program was:" >&5
4394   cat conftest.$ac_ext >&5
4395   rm -rf conftest*
4396   eval "ac_cv_lib_$ac_lib_var=no"
4397 fi
4398 rm -f conftest*
4399 LIBS="$ac_save_LIBS"
4400
4401 fi
4402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4403   echo "$ac_t""yes" 1>&6
4404   
4405         AUTH_LIBS=-ls
4406         cat >> confdefs.h <<\EOF
4407 #define HAVE_AIX_SECURITY 1
4408 EOF
4409
4410
4411 else
4412   echo "$ac_t""no" 1>&6
4413 fi
4414
4415
4416
4417 ol_link_modules=no
4418 if test $ol_enable_modules != no ; then
4419         for ac_hdr in ltdl.h
4420 do
4421 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4422 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4423 echo "configure:4424: checking for $ac_hdr" >&5
4424 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4425   echo $ac_n "(cached) $ac_c" 1>&6
4426 else
4427   cat > conftest.$ac_ext <<EOF
4428 #line 4429 "configure"
4429 #include "confdefs.h"
4430 #include <$ac_hdr>
4431 EOF
4432 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4433 { (eval echo configure:4434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4434 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4435 if test -z "$ac_err"; then
4436   rm -rf conftest*
4437   eval "ac_cv_header_$ac_safe=yes"
4438 else
4439   echo "$ac_err" >&5
4440   echo "configure: failed program was:" >&5
4441   cat conftest.$ac_ext >&5
4442   rm -rf conftest*
4443   eval "ac_cv_header_$ac_safe=no"
4444 fi
4445 rm -f conftest*
4446 fi
4447 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4448   echo "$ac_t""yes" 1>&6
4449     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4450   cat >> confdefs.h <<EOF
4451 #define $ac_tr_hdr 1
4452 EOF
4453  
4454 else
4455   echo "$ac_t""no" 1>&6
4456 fi
4457 done
4458
4459
4460         if test $ac_cv_header_ltdl_h = no ; then
4461                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4462         fi
4463
4464         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4465 echo "configure:4466: checking for lt_dlinit in -lltdl" >&5
4466 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4467 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4468   echo $ac_n "(cached) $ac_c" 1>&6
4469 else
4470   ac_save_LIBS="$LIBS"
4471 LIBS="-lltdl  $LIBS"
4472 cat > conftest.$ac_ext <<EOF
4473 #line 4474 "configure"
4474 #include "confdefs.h"
4475 /* Override any gcc2 internal prototype to avoid an error.  */
4476 /* We use char because int might match the return type of a gcc2
4477     builtin and then its argument prototype would still apply.  */
4478 char lt_dlinit();
4479
4480 int main() {
4481 lt_dlinit()
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   eval "ac_cv_lib_$ac_lib_var=yes"
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   eval "ac_cv_lib_$ac_lib_var=no"
4492 fi
4493 rm -f conftest*
4494 LIBS="$ac_save_LIBS"
4495
4496 fi
4497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4498   echo "$ac_t""yes" 1>&6
4499   
4500                 MODULES_LIBS=-lltdl
4501                 cat >> confdefs.h <<\EOF
4502 #define HAVE_LIBLTDL 1
4503 EOF
4504
4505         
4506 else
4507   echo "$ac_t""no" 1>&6
4508 fi
4509
4510
4511         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4512                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4513         fi
4514         ol_link_modules=yes
4515 else
4516         ol_with_bdb_module=static
4517         ol_with_dnssrv_module=static
4518         ol_with_ldap_module=static
4519         ol_with_ldbm_module=static
4520         ol_with_meta_module=static
4521         ol_with_monitor_module=static
4522         ol_with_passwd_module=static
4523         ol_with_perl_module=static
4524         ol_with_shell_module=static
4525         ol_with_tcl_module=static
4526         ol_with_sql_module=static
4527 fi
4528
4529 # test for EBCDIC
4530 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4531 echo "configure:4532: checking for EBCDIC" >&5
4532 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4533   echo $ac_n "(cached) $ac_c" 1>&6
4534 else
4535   
4536         cat > conftest.$ac_ext <<EOF
4537 #line 4538 "configure"
4538 #include "confdefs.h"
4539
4540 #if !('M' == 0xd4)
4541 #include <__ASCII__/generate_error.h>
4542 #endif
4543
4544 EOF
4545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4546 { (eval echo configure:4547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4548 if test -z "$ac_err"; then
4549   rm -rf conftest*
4550   ol_cv_cpp_ebcdic=yes
4551 else
4552   echo "$ac_err" >&5
4553   echo "configure: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   rm -rf conftest*
4556   ol_cv_cpp_ebcdic=no
4557 fi
4558 rm -f conftest*
4559 fi
4560
4561 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4562 if test $ol_cv_cpp_ebcdic = yes ; then
4563         cat >> confdefs.h <<\EOF
4564 #define HAVE_EBCDIC 1
4565 EOF
4566
4567 fi
4568
4569 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4570 echo "configure:4571: checking for ANSI C header files" >&5
4571 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4572   echo $ac_n "(cached) $ac_c" 1>&6
4573 else
4574   cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 #include <stdlib.h>
4578 #include <stdarg.h>
4579 #include <string.h>
4580 #include <float.h>
4581 EOF
4582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4583 { (eval echo configure:4584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4584 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4585 if test -z "$ac_err"; then
4586   rm -rf conftest*
4587   ol_cv_header_stdc=yes
4588 else
4589   echo "$ac_err" >&5
4590   echo "configure: failed program was:" >&5
4591   cat conftest.$ac_ext >&5
4592   rm -rf conftest*
4593   ol_cv_header_stdc=no
4594 fi
4595 rm -f conftest*
4596
4597 if test $ol_cv_header_stdc = yes; then
4598   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4599 cat > conftest.$ac_ext <<EOF
4600 #line 4601 "configure"
4601 #include "confdefs.h"
4602 #include <string.h>
4603 EOF
4604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4605   egrep "memchr" >/dev/null 2>&1; then
4606   :
4607 else
4608   rm -rf conftest*
4609   ol_cv_header_stdc=no
4610 fi
4611 rm -f conftest*
4612
4613 fi
4614
4615 if test $ol_cv_header_stdc = yes; then
4616   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4617 cat > conftest.$ac_ext <<EOF
4618 #line 4619 "configure"
4619 #include "confdefs.h"
4620 #include <stdlib.h>
4621 EOF
4622 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4623   egrep "free" >/dev/null 2>&1; then
4624   :
4625 else
4626   rm -rf conftest*
4627   ol_cv_header_stdc=no
4628 fi
4629 rm -f conftest*
4630
4631 fi
4632
4633 if test $ol_cv_header_stdc = yes; then
4634   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4635 if test "$cross_compiling" = yes; then
4636   :
4637 else
4638   cat > conftest.$ac_ext <<EOF
4639 #line 4640 "configure"
4640 #include "confdefs.h"
4641 #include <ctype.h>
4642 #ifndef HAVE_EBCDIC
4643 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4644 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4645 #else
4646 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4647                 || ('j' <= (c) && (c) <= 'r') \
4648                 || ('s' <= (c) && (c) <= 'z'))
4649 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4650 #endif
4651 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4652 int main () { int i; for (i = 0; i < 256; i++)
4653 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4654 exit (0); }
4655
4656 EOF
4657 if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4658 then
4659   :
4660 else
4661   echo "configure: failed program was:" >&5
4662   cat conftest.$ac_ext >&5
4663   rm -fr conftest*
4664   ol_cv_header_stdc=no
4665 fi
4666 rm -fr conftest*
4667 fi
4668
4669 fi
4670 fi
4671
4672 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4673 if test $ol_cv_header_stdc = yes; then
4674   cat >> confdefs.h <<\EOF
4675 #define STDC_HEADERS 1
4676 EOF
4677
4678 fi
4679 ac_cv_header_stdc=disable
4680
4681
4682 if test $ol_cv_header_stdc != yes; then
4683         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4684 fi
4685
4686 ac_header_dirent=no
4687 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4688 do
4689 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4690 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4691 echo "configure:4692: checking for $ac_hdr that defines DIR" >&5
4692 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4693   echo $ac_n "(cached) $ac_c" 1>&6
4694 else
4695   cat > conftest.$ac_ext <<EOF
4696 #line 4697 "configure"
4697 #include "confdefs.h"
4698 #include <sys/types.h>
4699 #include <$ac_hdr>
4700 int main() {
4701 DIR *dirp = 0;
4702 ; return 0; }
4703 EOF
4704 if { (eval echo configure:4705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4705   rm -rf conftest*
4706   eval "ac_cv_header_dirent_$ac_safe=yes"
4707 else
4708   echo "configure: failed program was:" >&5
4709   cat conftest.$ac_ext >&5
4710   rm -rf conftest*
4711   eval "ac_cv_header_dirent_$ac_safe=no"
4712 fi
4713 rm -f conftest*
4714 fi
4715 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4716   echo "$ac_t""yes" 1>&6
4717     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4718   cat >> confdefs.h <<EOF
4719 #define $ac_tr_hdr 1
4720 EOF
4721  ac_header_dirent=$ac_hdr; break
4722 else
4723   echo "$ac_t""no" 1>&6
4724 fi
4725 done
4726 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4727 if test $ac_header_dirent = dirent.h; then
4728 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4729 echo "configure:4730: checking for opendir in -ldir" >&5
4730 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4731 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4732   echo $ac_n "(cached) $ac_c" 1>&6
4733 else
4734   ac_save_LIBS="$LIBS"
4735 LIBS="-ldir  $LIBS"
4736 cat > conftest.$ac_ext <<EOF
4737 #line 4738 "configure"
4738 #include "confdefs.h"
4739 /* Override any gcc2 internal prototype to avoid an error.  */
4740 /* We use char because int might match the return type of a gcc2
4741     builtin and then its argument prototype would still apply.  */
4742 char opendir();
4743
4744 int main() {
4745 opendir()
4746 ; return 0; }
4747 EOF
4748 if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4749   rm -rf conftest*
4750   eval "ac_cv_lib_$ac_lib_var=yes"
4751 else
4752   echo "configure: failed program was:" >&5
4753   cat conftest.$ac_ext >&5
4754   rm -rf conftest*
4755   eval "ac_cv_lib_$ac_lib_var=no"
4756 fi
4757 rm -f conftest*
4758 LIBS="$ac_save_LIBS"
4759
4760 fi
4761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4762   echo "$ac_t""yes" 1>&6
4763   LIBS="$LIBS -ldir"
4764 else
4765   echo "$ac_t""no" 1>&6
4766 fi
4767
4768 else
4769 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4770 echo "configure:4771: checking for opendir in -lx" >&5
4771 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4772 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4773   echo $ac_n "(cached) $ac_c" 1>&6
4774 else
4775   ac_save_LIBS="$LIBS"
4776 LIBS="-lx  $LIBS"
4777 cat > conftest.$ac_ext <<EOF
4778 #line 4779 "configure"
4779 #include "confdefs.h"
4780 /* Override any gcc2 internal prototype to avoid an error.  */
4781 /* We use char because int might match the return type of a gcc2
4782     builtin and then its argument prototype would still apply.  */
4783 char opendir();
4784
4785 int main() {
4786 opendir()
4787 ; return 0; }
4788 EOF
4789 if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4790   rm -rf conftest*
4791   eval "ac_cv_lib_$ac_lib_var=yes"
4792 else
4793   echo "configure: failed program was:" >&5
4794   cat conftest.$ac_ext >&5
4795   rm -rf conftest*
4796   eval "ac_cv_lib_$ac_lib_var=no"
4797 fi
4798 rm -f conftest*
4799 LIBS="$ac_save_LIBS"
4800
4801 fi
4802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4803   echo "$ac_t""yes" 1>&6
4804   LIBS="$LIBS -lx"
4805 else
4806   echo "$ac_t""no" 1>&6
4807 fi
4808
4809 fi
4810
4811 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4812 echo "configure:4813: checking for sys/wait.h that is POSIX.1 compatible" >&5
4813 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816   cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819 #include <sys/types.h>
4820 #include <sys/wait.h>
4821 #ifndef WEXITSTATUS
4822 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4823 #endif
4824 #ifndef WIFEXITED
4825 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4826 #endif
4827 int main() {
4828 int s;
4829 wait (&s);
4830 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4831 ; return 0; }
4832 EOF
4833 if { (eval echo configure:4834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4834   rm -rf conftest*
4835   ac_cv_header_sys_wait_h=yes
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840   ac_cv_header_sys_wait_h=no
4841 fi
4842 rm -f conftest*
4843 fi
4844
4845 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4846 if test $ac_cv_header_sys_wait_h = yes; then
4847   cat >> confdefs.h <<\EOF
4848 #define HAVE_SYS_WAIT_H 1
4849 EOF
4850
4851 fi
4852
4853 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4854 echo "configure:4855: checking POSIX termios" >&5
4855 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4856   echo $ac_n "(cached) $ac_c" 1>&6
4857 else
4858   cat > conftest.$ac_ext <<EOF
4859 #line 4860 "configure"
4860 #include "confdefs.h"
4861 #include <sys/types.h>
4862 #include <unistd.h>
4863 #include <termios.h>
4864 int main() {
4865 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4866    tcgetattr(0, 0);
4867 ; return 0; }
4868 EOF
4869 if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4870   rm -rf conftest*
4871   am_cv_sys_posix_termios=yes
4872 else
4873   echo "configure: failed program was:" >&5
4874   cat conftest.$ac_ext >&5
4875   rm -rf conftest*
4876   am_cv_sys_posix_termios=no
4877 fi
4878 rm -f conftest*
4879 fi
4880
4881 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4882
4883
4884  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4885 echo "configure:4886: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4886 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4887   echo $ac_n "(cached) $ac_c" 1>&6
4888 else
4889   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4890
4891   gwinsz_in_termios_h=no
4892   if test $am_cv_sys_posix_termios = yes; then
4893     cat > conftest.$ac_ext <<EOF
4894 #line 4895 "configure"
4895 #include "confdefs.h"
4896 #include <sys/types.h>
4897 #     include <termios.h>
4898 #     ifdef TIOCGWINSZ
4899         yes
4900 #     endif
4901     
4902 EOF
4903 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4904   egrep "yes" >/dev/null 2>&1; then
4905   rm -rf conftest*
4906   gwinsz_in_termios_h=yes
4907 fi
4908 rm -f conftest*
4909
4910   fi
4911
4912   if test $gwinsz_in_termios_h = no; then
4913     cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916 #include <sys/types.h>
4917 #     include <sys/ioctl.h>
4918 #     ifdef TIOCGWINSZ
4919         yes
4920 #     endif
4921     
4922 EOF
4923 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4924   egrep "yes" >/dev/null 2>&1; then
4925   rm -rf conftest*
4926   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4927 fi
4928 rm -f conftest*
4929
4930   fi
4931   
4932 fi
4933
4934 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4935   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4936     cat >> confdefs.h <<\EOF
4937 #define GWINSZ_IN_SYS_IOCTL 1
4938 EOF
4939
4940   fi
4941
4942 if test $am_cv_sys_posix_termios = yes ; then
4943         cat >> confdefs.h <<\EOF
4944 #define HAVE_POSIX_TERMIOS 1
4945 EOF
4946
4947 fi
4948
4949 for ac_hdr in \
4950         arpa/inet.h             \
4951         arpa/nameser.h  \
4952         assert.h                \
4953         conio.h                 \
4954         crypt.h                 \
4955         direct.h                \
4956         errno.h                 \
4957         fcntl.h                 \
4958         filio.h                 \
4959         getopt.h                \
4960         grp.h                   \
4961         io.h                    \
4962         libutil.h               \
4963         limits.h                \
4964         locale.h                \
4965         netinet/tcp.h   \
4966         malloc.h                \
4967         memory.h                \
4968         psap.h                  \
4969         pwd.h                   \
4970         process.h               \
4971         resolv.h                \
4972         sgtty.h                 \
4973         shadow.h                \
4974         stddef.h                \
4975         string.h                \
4976         strings.h               \
4977         sysexits.h              \
4978         sys/file.h              \
4979         sys/filio.h             \
4980         sys/errno.h             \
4981         sys/ioctl.h             \
4982         sys/param.h             \
4983         sys/resource.h  \
4984         sys/select.h    \
4985         sys/socket.h    \
4986         sys/syslog.h    \
4987         sys/time.h              \
4988         sys/types.h             \
4989         syslog.h                \
4990         termios.h               \
4991         unistd.h                \
4992         winsock.h               \
4993         winsock2.h              \
4994
4995 do
4996 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4997 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4998 echo "configure:4999: checking for $ac_hdr" >&5
4999 if eval "test \"\${ac_cv_header_$ac_safe+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 #include <$ac_hdr>
5006 EOF
5007 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5008 { (eval echo configure:5009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5009 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5010 if test -z "$ac_err"; then
5011   rm -rf conftest*
5012   eval "ac_cv_header_$ac_safe=yes"
5013 else
5014   echo "$ac_err" >&5
5015   echo "configure: failed program was:" >&5
5016   cat conftest.$ac_ext >&5
5017   rm -rf conftest*
5018   eval "ac_cv_header_$ac_safe=no"
5019 fi
5020 rm -f conftest*
5021 fi
5022 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5023   echo "$ac_t""yes" 1>&6
5024     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5025   cat >> confdefs.h <<EOF
5026 #define $ac_tr_hdr 1
5027 EOF
5028  
5029 else
5030   echo "$ac_t""no" 1>&6
5031 fi
5032 done
5033
5034
5035
5036
5037 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
5038 echo "configure:5039: checking for dlopen" >&5
5039 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5040   echo $ac_n "(cached) $ac_c" 1>&6
5041 else
5042   cat > conftest.$ac_ext <<EOF
5043 #line 5044 "configure"
5044 #include "confdefs.h"
5045 /* System header to define __stub macros and hopefully few prototypes,
5046     which can conflict with char dlopen(); below.  */
5047 #include <assert.h>
5048 /* Override any gcc2 internal prototype to avoid an error.  */
5049 /* We use char because int might match the return type of a gcc2
5050     builtin and then its argument prototype would still apply.  */
5051 char dlopen();
5052 char (*f)();
5053
5054 int main() {
5055
5056 /* The GNU C library defines this for functions which it implements
5057     to always fail with ENOSYS.  Some functions are actually named
5058     something starting with __ and the normal name is an alias.  */
5059 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5060 choke me
5061 #else
5062 f = dlopen;
5063 #endif
5064
5065 ; return 0; }
5066 EOF
5067 if { (eval echo configure:5068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5068   rm -rf conftest*
5069   eval "ac_cv_func_dlopen=yes"
5070 else
5071   echo "configure: failed program was:" >&5
5072   cat conftest.$ac_ext >&5
5073   rm -rf conftest*
5074   eval "ac_cv_func_dlopen=no"
5075 fi
5076 rm -f conftest*
5077 fi
5078
5079 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5080   echo "$ac_t""yes" 1>&6
5081   :
5082 else
5083   echo "$ac_t""no" 1>&6
5084 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5085 echo "configure:5086: checking for dlopen in -ldl" >&5
5086 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5087 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5088   echo $ac_n "(cached) $ac_c" 1>&6
5089 else
5090   ac_save_LIBS="$LIBS"
5091 LIBS="-ldl  $LIBS"
5092 cat > conftest.$ac_ext <<EOF
5093 #line 5094 "configure"
5094 #include "confdefs.h"
5095 /* Override any gcc2 internal prototype to avoid an error.  */
5096 /* We use char because int might match the return type of a gcc2
5097     builtin and then its argument prototype would still apply.  */
5098 char dlopen();
5099
5100 int main() {
5101 dlopen()
5102 ; return 0; }
5103 EOF
5104 if { (eval echo configure:5105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5105   rm -rf conftest*
5106   eval "ac_cv_lib_$ac_lib_var=yes"
5107 else
5108   echo "configure: failed program was:" >&5
5109   cat conftest.$ac_ext >&5
5110   rm -rf conftest*
5111   eval "ac_cv_lib_$ac_lib_var=no"
5112 fi
5113 rm -f conftest*
5114 LIBS="$ac_save_LIBS"
5115
5116 fi
5117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5118   echo "$ac_t""yes" 1>&6
5119     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5120     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5121   cat >> confdefs.h <<EOF
5122 #define $ac_tr_lib 1
5123 EOF
5124
5125   LIBS="-ldl $LIBS"
5126
5127 else
5128   echo "$ac_t""no" 1>&6
5129 fi
5130
5131 fi
5132
5133
5134 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5135 echo "configure:5136: checking for sigset in -lV3" >&5
5136 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5137 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5138   echo $ac_n "(cached) $ac_c" 1>&6
5139 else
5140   ac_save_LIBS="$LIBS"
5141 LIBS="-lV3  $LIBS"
5142 cat > conftest.$ac_ext <<EOF
5143 #line 5144 "configure"
5144 #include "confdefs.h"
5145 /* Override any gcc2 internal prototype to avoid an error.  */
5146 /* We use char because int might match the return type of a gcc2
5147     builtin and then its argument prototype would still apply.  */
5148 char sigset();
5149
5150 int main() {
5151 sigset()
5152 ; return 0; }
5153 EOF
5154 if { (eval echo configure:5155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5155   rm -rf conftest*
5156   eval "ac_cv_lib_$ac_lib_var=yes"
5157 else
5158   echo "configure: failed program was:" >&5
5159   cat conftest.$ac_ext >&5
5160   rm -rf conftest*
5161   eval "ac_cv_lib_$ac_lib_var=no"
5162 fi
5163 rm -f conftest*
5164 LIBS="$ac_save_LIBS"
5165
5166 fi
5167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5168   echo "$ac_t""yes" 1>&6
5169     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5170     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5171   cat >> confdefs.h <<EOF
5172 #define $ac_tr_lib 1
5173 EOF
5174
5175   LIBS="-lV3 $LIBS"
5176
5177 else
5178   echo "$ac_t""no" 1>&6
5179 fi
5180
5181
5182 echo $ac_n "checking for winsock""... $ac_c" 1>&6
5183 echo "configure:5184: checking for winsock" >&5
5184 save_LIBS="$LIBS"
5185 for curlib in ws2_32 wsock32; do
5186         LIBS="$LIBS -l$curlib"
5187         cat > conftest.$ac_ext <<EOF
5188 #line 5189 "configure"
5189 #include "confdefs.h"
5190
5191                         char socket@12();
5192                         char select@20();
5193                         char closesocket@4();
5194                         char gethostname@8();
5195                         
5196 int main() {
5197
5198                         socket@12();
5199                         select@20();
5200                         closesocket@4();
5201                         gethostname@8();
5202                         
5203 ; return 0; }
5204 EOF
5205 if { (eval echo configure:5206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5206   rm -rf conftest*
5207   have_winsock=yes
5208 else
5209   echo "configure: failed program was:" >&5
5210   cat conftest.$ac_ext >&5
5211   rm -rf conftest*
5212   have_winsock=no
5213 fi
5214 rm -f conftest*
5215
5216         if test $have_winsock = yes; then
5217                 cat >> confdefs.h <<\EOF
5218 #define HAVE_WINSOCK 1
5219 EOF
5220
5221                 ac_cv_func_socket=yes
5222                 ac_cv_func_select=yes
5223                 ac_cv_func_closesocket=yes
5224                 ac_cv_func_gethostname=yes
5225                 if test $curlib = ws2_32; then
5226                         have_winsock=winsock2
5227                         cat >> confdefs.h <<\EOF
5228 #define HAVE_WINSOCK2 1
5229 EOF
5230
5231                 fi
5232                 break
5233         fi
5234         LIBS="$save_LIBS"
5235 done
5236 echo "$ac_t""$have_winsock" 1>&6
5237
5238
5239 echo $ac_n "checking for socket""... $ac_c" 1>&6
5240 echo "configure:5241: checking for socket" >&5
5241 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5242   echo $ac_n "(cached) $ac_c" 1>&6
5243 else
5244   cat > conftest.$ac_ext <<EOF
5245 #line 5246 "configure"
5246 #include "confdefs.h"
5247 /* System header to define __stub macros and hopefully few prototypes,
5248     which can conflict with char socket(); below.  */
5249 #include <assert.h>
5250 /* Override any gcc2 internal prototype to avoid an error.  */
5251 /* We use char because int might match the return type of a gcc2
5252     builtin and then its argument prototype would still apply.  */
5253 char socket();
5254 char (*f)();
5255
5256 int main() {
5257
5258 /* The GNU C library defines this for functions which it implements
5259     to always fail with ENOSYS.  Some functions are actually named
5260     something starting with __ and the normal name is an alias.  */
5261 #if defined (__stub_socket) || defined (__stub___socket)
5262 choke me
5263 #else
5264 f = socket;
5265 #endif
5266
5267 ; return 0; }
5268 EOF
5269 if { (eval echo configure:5270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5270   rm -rf conftest*
5271   eval "ac_cv_func_socket=yes"
5272 else
5273   echo "configure: failed program was:" >&5
5274   cat conftest.$ac_ext >&5
5275   rm -rf conftest*
5276   eval "ac_cv_func_socket=no"
5277 fi
5278 rm -f conftest*
5279 fi
5280
5281 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5282   echo "$ac_t""yes" 1>&6
5283   :
5284 else
5285   echo "$ac_t""no" 1>&6
5286         
5287         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5288 echo "configure:5289: checking for main in -lsocket" >&5
5289 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5290 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5291   echo $ac_n "(cached) $ac_c" 1>&6
5292 else
5293   ac_save_LIBS="$LIBS"
5294 LIBS="-lsocket  $LIBS"
5295 cat > conftest.$ac_ext <<EOF
5296 #line 5297 "configure"
5297 #include "confdefs.h"
5298
5299 int main() {
5300 main()
5301 ; return 0; }
5302 EOF
5303 if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5304   rm -rf conftest*
5305   eval "ac_cv_lib_$ac_lib_var=yes"
5306 else
5307   echo "configure: failed program was:" >&5
5308   cat conftest.$ac_ext >&5
5309   rm -rf conftest*
5310   eval "ac_cv_lib_$ac_lib_var=no"
5311 fi
5312 rm -f conftest*
5313 LIBS="$ac_save_LIBS"
5314
5315 fi
5316 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5317   echo "$ac_t""yes" 1>&6
5318     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5319     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5320   cat >> confdefs.h <<EOF
5321 #define $ac_tr_lib 1
5322 EOF
5323
5324   LIBS="-lsocket $LIBS"
5325
5326 else
5327   echo "$ac_t""no" 1>&6
5328 fi
5329
5330         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5331 echo "configure:5332: checking for main in -lnet" >&5
5332 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5333 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5334   echo $ac_n "(cached) $ac_c" 1>&6
5335 else
5336   ac_save_LIBS="$LIBS"
5337 LIBS="-lnet  $LIBS"
5338 cat > conftest.$ac_ext <<EOF
5339 #line 5340 "configure"
5340 #include "confdefs.h"
5341
5342 int main() {
5343 main()
5344 ; return 0; }
5345 EOF
5346 if { (eval echo configure:5347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5347   rm -rf conftest*
5348   eval "ac_cv_lib_$ac_lib_var=yes"
5349 else
5350   echo "configure: failed program was:" >&5
5351   cat conftest.$ac_ext >&5
5352   rm -rf conftest*
5353   eval "ac_cv_lib_$ac_lib_var=no"
5354 fi
5355 rm -f conftest*
5356 LIBS="$ac_save_LIBS"
5357
5358 fi
5359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5360   echo "$ac_t""yes" 1>&6
5361     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5362     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5363   cat >> confdefs.h <<EOF
5364 #define $ac_tr_lib 1
5365 EOF
5366
5367   LIBS="-lnet $LIBS"
5368
5369 else
5370   echo "$ac_t""no" 1>&6
5371 fi
5372
5373         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5374 echo "configure:5375: checking for main in -lnsl_s" >&5
5375 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5376 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5377   echo $ac_n "(cached) $ac_c" 1>&6
5378 else
5379   ac_save_LIBS="$LIBS"
5380 LIBS="-lnsl_s  $LIBS"
5381 cat > conftest.$ac_ext <<EOF
5382 #line 5383 "configure"
5383 #include "confdefs.h"
5384
5385 int main() {
5386 main()
5387 ; return 0; }
5388 EOF
5389 if { (eval echo configure:5390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5390   rm -rf conftest*
5391   eval "ac_cv_lib_$ac_lib_var=yes"
5392 else
5393   echo "configure: failed program was:" >&5
5394   cat conftest.$ac_ext >&5
5395   rm -rf conftest*
5396   eval "ac_cv_lib_$ac_lib_var=no"
5397 fi
5398 rm -f conftest*
5399 LIBS="$ac_save_LIBS"
5400
5401 fi
5402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5403   echo "$ac_t""yes" 1>&6
5404     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5405     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5406   cat >> confdefs.h <<EOF
5407 #define $ac_tr_lib 1
5408 EOF
5409
5410   LIBS="-lnsl_s $LIBS"
5411
5412 else
5413   echo "$ac_t""no" 1>&6
5414 fi
5415
5416         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5417 echo "configure:5418: checking for main in -lnsl" >&5
5418 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5419 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5420   echo $ac_n "(cached) $ac_c" 1>&6
5421 else
5422   ac_save_LIBS="$LIBS"
5423 LIBS="-lnsl  $LIBS"
5424 cat > conftest.$ac_ext <<EOF
5425 #line 5426 "configure"
5426 #include "confdefs.h"
5427
5428 int main() {
5429 main()
5430 ; return 0; }
5431 EOF
5432 if { (eval echo configure:5433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5433   rm -rf conftest*
5434   eval "ac_cv_lib_$ac_lib_var=yes"
5435 else
5436   echo "configure: failed program was:" >&5
5437   cat conftest.$ac_ext >&5
5438   rm -rf conftest*
5439   eval "ac_cv_lib_$ac_lib_var=no"
5440 fi
5441 rm -f conftest*
5442 LIBS="$ac_save_LIBS"
5443
5444 fi
5445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5446   echo "$ac_t""yes" 1>&6
5447     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5448     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5449   cat >> confdefs.h <<EOF
5450 #define $ac_tr_lib 1
5451 EOF
5452
5453   LIBS="-lnsl $LIBS"
5454
5455 else
5456   echo "$ac_t""no" 1>&6
5457 fi
5458
5459         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5460 echo "configure:5461: checking for socket in -linet" >&5
5461 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5462 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5463   echo $ac_n "(cached) $ac_c" 1>&6
5464 else
5465   ac_save_LIBS="$LIBS"
5466 LIBS="-linet  $LIBS"
5467 cat > conftest.$ac_ext <<EOF
5468 #line 5469 "configure"
5469 #include "confdefs.h"
5470 /* Override any gcc2 internal prototype to avoid an error.  */
5471 /* We use char because int might match the return type of a gcc2
5472     builtin and then its argument prototype would still apply.  */
5473 char socket();
5474
5475 int main() {
5476 socket()
5477 ; return 0; }
5478 EOF
5479 if { (eval echo configure:5480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5480   rm -rf conftest*
5481   eval "ac_cv_lib_$ac_lib_var=yes"
5482 else
5483   echo "configure: failed program was:" >&5
5484   cat conftest.$ac_ext >&5
5485   rm -rf conftest*
5486   eval "ac_cv_lib_$ac_lib_var=no"
5487 fi
5488 rm -f conftest*
5489 LIBS="$ac_save_LIBS"
5490
5491 fi
5492 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5493   echo "$ac_t""yes" 1>&6
5494     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5495     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5496   cat >> confdefs.h <<EOF
5497 #define $ac_tr_lib 1
5498 EOF
5499
5500   LIBS="-linet $LIBS"
5501
5502 else
5503   echo "$ac_t""no" 1>&6
5504 fi
5505
5506         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5507 echo "configure:5508: checking for main in -lgen" >&5
5508 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5509 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5510   echo $ac_n "(cached) $ac_c" 1>&6
5511 else
5512   ac_save_LIBS="$LIBS"
5513 LIBS="-lgen  $LIBS"
5514 cat > conftest.$ac_ext <<EOF
5515 #line 5516 "configure"
5516 #include "confdefs.h"
5517
5518 int main() {
5519 main()
5520 ; return 0; }
5521 EOF
5522 if { (eval echo configure:5523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5523   rm -rf conftest*
5524   eval "ac_cv_lib_$ac_lib_var=yes"
5525 else
5526   echo "configure: failed program was:" >&5
5527   cat conftest.$ac_ext >&5
5528   rm -rf conftest*
5529   eval "ac_cv_lib_$ac_lib_var=no"
5530 fi
5531 rm -f conftest*
5532 LIBS="$ac_save_LIBS"
5533
5534 fi
5535 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5536   echo "$ac_t""yes" 1>&6
5537     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5538     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5539   cat >> confdefs.h <<EOF
5540 #define $ac_tr_lib 1
5541 EOF
5542
5543   LIBS="-lgen $LIBS"
5544
5545 else
5546   echo "$ac_t""no" 1>&6
5547 fi
5548
5549
5550 fi
5551
5552
5553 echo $ac_n "checking for select""... $ac_c" 1>&6
5554 echo "configure:5555: checking for select" >&5
5555 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5556   echo $ac_n "(cached) $ac_c" 1>&6
5557 else
5558   cat > conftest.$ac_ext <<EOF
5559 #line 5560 "configure"
5560 #include "confdefs.h"
5561 /* System header to define __stub macros and hopefully few prototypes,
5562     which can conflict with char select(); below.  */
5563 #include <assert.h>
5564 /* Override any gcc2 internal prototype to avoid an error.  */
5565 /* We use char because int might match the return type of a gcc2
5566     builtin and then its argument prototype would still apply.  */
5567 char select();
5568 char (*f)();
5569
5570 int main() {
5571
5572 /* The GNU C library defines this for functions which it implements
5573     to always fail with ENOSYS.  Some functions are actually named
5574     something starting with __ and the normal name is an alias.  */
5575 #if defined (__stub_select) || defined (__stub___select)
5576 choke me
5577 #else
5578 f = select;
5579 #endif
5580
5581 ; return 0; }
5582 EOF
5583 if { (eval echo configure:5584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5584   rm -rf conftest*
5585   eval "ac_cv_func_select=yes"
5586 else
5587   echo "configure: failed program was:" >&5
5588   cat conftest.$ac_ext >&5
5589   rm -rf conftest*
5590   eval "ac_cv_func_select=no"
5591 fi
5592 rm -f conftest*
5593 fi
5594
5595 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5596   echo "$ac_t""yes" 1>&6
5597   :
5598 else
5599   echo "$ac_t""no" 1>&6
5600 { echo "configure: error: select() required." 1>&2; exit 1; }
5601 fi
5602
5603
5604 if test "${ac_cv_header_winsock_h}" != yes; then
5605                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5606 echo "configure:5607: checking types of arguments for select()" >&5
5607  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5608   echo $ac_n "(cached) $ac_c" 1>&6
5609 else
5610    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5611   echo $ac_n "(cached) $ac_c" 1>&6
5612 else
5613     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5614   echo $ac_n "(cached) $ac_c" 1>&6
5615 else
5616      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5617      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5618       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5619        cat > conftest.$ac_ext <<EOF
5620 #line 5621 "configure"
5621 #include "confdefs.h"
5622 #ifdef HAVE_SYS_TYPES_H
5623 #include <sys/types.h>
5624 #endif
5625 #ifdef HAVE_SYS_TIME_H
5626 #include <sys/time.h>
5627 #endif
5628 #ifdef HAVE_SYS_SELECT_H
5629 #include <sys/select.h>
5630 #endif
5631 #ifdef HAVE_SYS_SOCKET_H
5632 #include <sys/socket.h>
5633 #endif
5634 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);
5635 int main() {
5636
5637 ; return 0; }
5638 EOF
5639 if { (eval echo configure:5640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5640   rm -rf conftest*
5641           ac_not_found=no ; break 3
5642 else
5643   echo "configure: failed program was:" >&5
5644   cat conftest.$ac_ext >&5
5645   rm -rf conftest*
5646   ac_not_found=yes
5647 fi
5648 rm -f conftest*
5649       done
5650      done
5651     done
5652    
5653 fi
5654   
5655 fi
5656  
5657 fi
5658  if test "$ac_not_found" = yes; then
5659   ac_cv_func_select_arg1=int 
5660   ac_cv_func_select_arg234='int *' 
5661   ac_cv_func_select_arg5='struct timeval *'
5662  fi
5663  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5664  cat >> confdefs.h <<EOF
5665 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5666 EOF
5667
5668  cat >> confdefs.h <<EOF
5669 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5670 EOF
5671
5672  cat >> confdefs.h <<EOF
5673 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5674 EOF
5675
5676
5677 fi
5678
5679
5680 for ac_hdr in regex.h 
5681 do
5682 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5683 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5684 echo "configure:5685: checking for $ac_hdr" >&5
5685 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5686   echo $ac_n "(cached) $ac_c" 1>&6
5687 else
5688   cat > conftest.$ac_ext <<EOF
5689 #line 5690 "configure"
5690 #include "confdefs.h"
5691 #include <$ac_hdr>
5692 EOF
5693 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5694 { (eval echo configure:5695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5695 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5696 if test -z "$ac_err"; then
5697   rm -rf conftest*
5698   eval "ac_cv_header_$ac_safe=yes"
5699 else
5700   echo "$ac_err" >&5
5701   echo "configure: failed program was:" >&5
5702   cat conftest.$ac_ext >&5
5703   rm -rf conftest*
5704   eval "ac_cv_header_$ac_safe=no"
5705 fi
5706 rm -f conftest*
5707 fi
5708 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5709   echo "$ac_t""yes" 1>&6
5710     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5711   cat >> confdefs.h <<EOF
5712 #define $ac_tr_hdr 1
5713 EOF
5714  
5715 else
5716   echo "$ac_t""no" 1>&6
5717 fi
5718 done
5719
5720 if test "$ac_cv_header_regex_h" != yes ; then
5721         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5722 fi
5723
5724 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
5725 echo "configure:5726: checking for library containing regfree" >&5
5726 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
5727   echo $ac_n "(cached) $ac_c" 1>&6
5728 else
5729   ac_func_search_save_LIBS="$LIBS"
5730 ac_cv_search_regfree="no"
5731 cat > conftest.$ac_ext <<EOF
5732 #line 5733 "configure"
5733 #include "confdefs.h"
5734 /* Override any gcc2 internal prototype to avoid an error.  */
5735 /* We use char because int might match the return type of a gcc2
5736     builtin and then its argument prototype would still apply.  */
5737 char regfree();
5738
5739 int main() {
5740 regfree()
5741 ; return 0; }
5742 EOF
5743 if { (eval echo configure:5744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5744   rm -rf conftest*
5745   ac_cv_search_regfree="none required"
5746 else
5747   echo "configure: failed program was:" >&5
5748   cat conftest.$ac_ext >&5
5749 fi
5750 rm -f conftest*
5751 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
5752 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
5753 cat > conftest.$ac_ext <<EOF
5754 #line 5755 "configure"
5755 #include "confdefs.h"
5756 /* Override any gcc2 internal prototype to avoid an error.  */
5757 /* We use char because int might match the return type of a gcc2
5758     builtin and then its argument prototype would still apply.  */
5759 char regfree();
5760
5761 int main() {
5762 regfree()
5763 ; return 0; }
5764 EOF
5765 if { (eval echo configure:5766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5766   rm -rf conftest*
5767   ac_cv_search_regfree="-l$ac_lib"
5768 break
5769 else
5770   echo "configure: failed program was:" >&5
5771   cat conftest.$ac_ext >&5
5772 fi
5773 rm -f conftest*
5774 done
5775 LIBS="$ac_func_search_save_LIBS"
5776 fi
5777
5778 echo "$ac_t""$ac_cv_search_regfree" 1>&6
5779 if test "$ac_cv_search_regfree" != "no"; then
5780   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
5781   :
5782 else :
5783   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5784 fi
5785
5786
5787 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5788 echo "configure:5789: checking for compatible POSIX regex" >&5
5789 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5790   echo $ac_n "(cached) $ac_c" 1>&6
5791 else
5792   
5793         if test "$cross_compiling" = yes; then
5794   ol_cv_c_posix_regex=cross
5795 else
5796   cat > conftest.$ac_ext <<EOF
5797 #line 5798 "configure"
5798 #include "confdefs.h"
5799
5800 #include <sys/types.h>
5801 #include <regex.h>
5802 static char *pattern, *string;
5803 main()
5804 {
5805         int rc;
5806         regex_t re;
5807
5808         pattern = "^A";
5809
5810         if(regcomp(&re, pattern, 0)) {
5811                 return -1;
5812         }
5813         
5814         string = "ALL MATCH";
5815         
5816         rc = regexec(&re, string, 0, (void*)0, 0);
5817
5818         regfree(&re);
5819
5820         return rc;
5821 }
5822 EOF
5823 if { (eval echo configure:5824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5824 then
5825   ol_cv_c_posix_regex=yes
5826 else
5827   echo "configure: failed program was:" >&5
5828   cat conftest.$ac_ext >&5
5829   rm -fr conftest*
5830   ol_cv_c_posix_regex=no
5831 fi
5832 rm -fr conftest*
5833 fi
5834
5835 fi
5836
5837 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5838
5839 if test "$ol_cv_c_posix_regex" = no ; then
5840         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5841 fi
5842
5843 echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
5844 echo "configure:5845: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
5845 save_LIBS="$LIBS"
5846 LIBS="$LIBS -lrpcrt4"
5847 cat > conftest.$ac_ext <<EOF
5848 #line 5849 "configure"
5849 #include "confdefs.h"
5850
5851                 char UuidCreate@4();
5852                 char UuidToStringA@8();
5853                 
5854 int main() {
5855
5856                 UuidCreate@4();
5857                 UuidToStringA@8();
5858                 
5859 ; return 0; }
5860 EOF
5861 if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5862   rm -rf conftest*
5863   need_rpcrt=yes
5864 else
5865   echo "configure: failed program was:" >&5
5866   cat conftest.$ac_ext >&5
5867   rm -rf conftest*
5868   need_rpcrt=no
5869 fi
5870 rm -f conftest*
5871 if test $need_rpcrt = yes; then
5872         SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
5873 fi
5874 LIBS="$save_LIBS"
5875 echo "$ac_t""$need_rpcrt" 1>&6
5876
5877 ol_link_dnssrv=no
5878 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5879 echo "configure:5880: checking for res_query" >&5
5880 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5881   echo $ac_n "(cached) $ac_c" 1>&6
5882 else
5883   cat > conftest.$ac_ext <<EOF
5884 #line 5885 "configure"
5885 #include "confdefs.h"
5886 /* System header to define __stub macros and hopefully few prototypes,
5887     which can conflict with char res_query(); below.  */
5888 #include <assert.h>
5889 /* Override any gcc2 internal prototype to avoid an error.  */
5890 /* We use char because int might match the return type of a gcc2
5891     builtin and then its argument prototype would still apply.  */
5892 char res_query();
5893 char (*f)();
5894
5895 int main() {
5896
5897 /* The GNU C library defines this for functions which it implements
5898     to always fail with ENOSYS.  Some functions are actually named
5899     something starting with __ and the normal name is an alias.  */
5900 #if defined (__stub_res_query) || defined (__stub___res_query)
5901 choke me
5902 #else
5903 f = res_query;
5904 #endif
5905
5906 ; return 0; }
5907 EOF
5908 if { (eval echo configure:5909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5909   rm -rf conftest*
5910   eval "ac_cv_func_res_query=yes"
5911 else
5912   echo "configure: failed program was:" >&5
5913   cat conftest.$ac_ext >&5
5914   rm -rf conftest*
5915   eval "ac_cv_func_res_query=no"
5916 fi
5917 rm -f conftest*
5918 fi
5919
5920 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5921   echo "$ac_t""yes" 1>&6
5922   :
5923 else
5924   echo "$ac_t""no" 1>&6
5925 fi
5926
5927 if test $ac_cv_func_res_query = no ; then 
5928         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5929 echo "configure:5930: checking for __res_query" >&5
5930 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5931   echo $ac_n "(cached) $ac_c" 1>&6
5932 else
5933   cat > conftest.$ac_ext <<EOF
5934 #line 5935 "configure"
5935 #include "confdefs.h"
5936 /* System header to define __stub macros and hopefully few prototypes,
5937     which can conflict with char __res_query(); below.  */
5938 #include <assert.h>
5939 /* Override any gcc2 internal prototype to avoid an error.  */
5940 /* We use char because int might match the return type of a gcc2
5941     builtin and then its argument prototype would still apply.  */
5942 char __res_query();
5943 char (*f)();
5944
5945 int main() {
5946
5947 /* The GNU C library defines this for functions which it implements
5948     to always fail with ENOSYS.  Some functions are actually named
5949     something starting with __ and the normal name is an alias.  */
5950 #if defined (__stub___res_query) || defined (__stub_____res_query)
5951 choke me
5952 #else
5953 f = __res_query;
5954 #endif
5955
5956 ; return 0; }
5957 EOF
5958 if { (eval echo configure:5959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5959   rm -rf conftest*
5960   eval "ac_cv_func___res_query=yes"
5961 else
5962   echo "configure: failed program was:" >&5
5963   cat conftest.$ac_ext >&5
5964   rm -rf conftest*
5965   eval "ac_cv_func___res_query=no"
5966 fi
5967 rm -f conftest*
5968 fi
5969
5970 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5971   echo "$ac_t""yes" 1>&6
5972   :
5973 else
5974   echo "$ac_t""no" 1>&6
5975 fi
5976
5977         ac_cv_func_res_query=$ac_cv_func___res_query
5978 fi
5979
5980 if test $ac_cv_func_res_query = no ; then 
5981         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5982 echo "configure:5983: checking for res_query in -lbind" >&5
5983 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5984 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5985   echo $ac_n "(cached) $ac_c" 1>&6
5986 else
5987   ac_save_LIBS="$LIBS"
5988 LIBS="-lbind  $LIBS"
5989 cat > conftest.$ac_ext <<EOF
5990 #line 5991 "configure"
5991 #include "confdefs.h"
5992 /* Override any gcc2 internal prototype to avoid an error.  */
5993 /* We use char because int might match the return type of a gcc2
5994     builtin and then its argument prototype would still apply.  */
5995 char res_query();
5996
5997 int main() {
5998 res_query()
5999 ; return 0; }
6000 EOF
6001 if { (eval echo configure:6002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6002   rm -rf conftest*
6003   eval "ac_cv_lib_$ac_lib_var=yes"
6004 else
6005   echo "configure: failed program was:" >&5
6006   cat conftest.$ac_ext >&5
6007   rm -rf conftest*
6008   eval "ac_cv_lib_$ac_lib_var=no"
6009 fi
6010 rm -f conftest*
6011 LIBS="$ac_save_LIBS"
6012
6013 fi
6014 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6015   echo "$ac_t""yes" 1>&6
6016     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6017     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6018   cat >> confdefs.h <<EOF
6019 #define $ac_tr_lib 1
6020 EOF
6021
6022   LIBS="-lbind $LIBS"
6023
6024 else
6025   echo "$ac_t""no" 1>&6
6026 fi
6027
6028         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
6029 fi
6030
6031 if test $ac_cv_func_res_query = no ; then 
6032         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
6033 echo "configure:6034: checking for __res_query in -lbind" >&5
6034 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
6035 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6036   echo $ac_n "(cached) $ac_c" 1>&6
6037 else
6038   ac_save_LIBS="$LIBS"
6039 LIBS="-lbind  $LIBS"
6040 cat > conftest.$ac_ext <<EOF
6041 #line 6042 "configure"
6042 #include "confdefs.h"
6043 /* Override any gcc2 internal prototype to avoid an error.  */
6044 /* We use char because int might match the return type of a gcc2
6045     builtin and then its argument prototype would still apply.  */
6046 char __res_query();
6047
6048 int main() {
6049 __res_query()
6050 ; return 0; }
6051 EOF
6052 if { (eval echo configure:6053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6053   rm -rf conftest*
6054   eval "ac_cv_lib_$ac_lib_var=yes"
6055 else
6056   echo "configure: failed program was:" >&5
6057   cat conftest.$ac_ext >&5
6058   rm -rf conftest*
6059   eval "ac_cv_lib_$ac_lib_var=no"
6060 fi
6061 rm -f conftest*
6062 LIBS="$ac_save_LIBS"
6063
6064 fi
6065 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6066   echo "$ac_t""yes" 1>&6
6067     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6068     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6069   cat >> confdefs.h <<EOF
6070 #define $ac_tr_lib 1
6071 EOF
6072
6073   LIBS="-lbind $LIBS"
6074
6075 else
6076   echo "$ac_t""no" 1>&6
6077 fi
6078
6079         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
6080 fi
6081
6082 if test $ac_cv_func_res_query = no ; then 
6083         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
6084 echo "configure:6085: checking for res_query in -lresolv" >&5
6085 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
6086 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6087   echo $ac_n "(cached) $ac_c" 1>&6
6088 else
6089   ac_save_LIBS="$LIBS"
6090 LIBS="-lresolv  $LIBS"
6091 cat > conftest.$ac_ext <<EOF
6092 #line 6093 "configure"
6093 #include "confdefs.h"
6094 /* Override any gcc2 internal prototype to avoid an error.  */
6095 /* We use char because int might match the return type of a gcc2
6096     builtin and then its argument prototype would still apply.  */
6097 char res_query();
6098
6099 int main() {
6100 res_query()
6101 ; return 0; }
6102 EOF
6103 if { (eval echo configure:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6104   rm -rf conftest*
6105   eval "ac_cv_lib_$ac_lib_var=yes"
6106 else
6107   echo "configure: failed program was:" >&5
6108   cat conftest.$ac_ext >&5
6109   rm -rf conftest*
6110   eval "ac_cv_lib_$ac_lib_var=no"
6111 fi
6112 rm -f conftest*
6113 LIBS="$ac_save_LIBS"
6114
6115 fi
6116 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6117   echo "$ac_t""yes" 1>&6
6118     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6119     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6120   cat >> confdefs.h <<EOF
6121 #define $ac_tr_lib 1
6122 EOF
6123
6124   LIBS="-lresolv $LIBS"
6125
6126 else
6127   echo "$ac_t""no" 1>&6
6128 fi
6129
6130         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6131 fi
6132
6133 if test $ac_cv_func_res_query = no ; then 
6134         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
6135 echo "configure:6136: checking for __res_query in -lresolv" >&5
6136 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
6137 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6138   echo $ac_n "(cached) $ac_c" 1>&6
6139 else
6140   ac_save_LIBS="$LIBS"
6141 LIBS="-lresolv  $LIBS"
6142 cat > conftest.$ac_ext <<EOF
6143 #line 6144 "configure"
6144 #include "confdefs.h"
6145 /* Override any gcc2 internal prototype to avoid an error.  */
6146 /* We use char because int might match the return type of a gcc2
6147     builtin and then its argument prototype would still apply.  */
6148 char __res_query();
6149
6150 int main() {
6151 __res_query()
6152 ; return 0; }
6153 EOF
6154 if { (eval echo configure:6155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6155   rm -rf conftest*
6156   eval "ac_cv_lib_$ac_lib_var=yes"
6157 else
6158   echo "configure: failed program was:" >&5
6159   cat conftest.$ac_ext >&5
6160   rm -rf conftest*
6161   eval "ac_cv_lib_$ac_lib_var=no"
6162 fi
6163 rm -f conftest*
6164 LIBS="$ac_save_LIBS"
6165
6166 fi
6167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6168   echo "$ac_t""yes" 1>&6
6169     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6170     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6171   cat >> confdefs.h <<EOF
6172 #define $ac_tr_lib 1
6173 EOF
6174
6175   LIBS="-lresolv $LIBS"
6176
6177 else
6178   echo "$ac_t""no" 1>&6
6179 fi
6180
6181         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
6182 fi
6183
6184 if test "$ac_cv_func_res_query" = yes ; then
6185         cat >> confdefs.h <<\EOF
6186 #define HAVE_RES_QUERY 1
6187 EOF
6188
6189
6190         if test $ol_enable_dnssrv != no ; then
6191                 ol_link_dnssrv=yes
6192         fi
6193 fi
6194
6195 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6196         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6197 fi
6198
6199 for ac_func in getaddrinfo gai_strerror inet_ntop 
6200 do
6201 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6202 echo "configure:6203: checking for $ac_func" >&5
6203 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6204   echo $ac_n "(cached) $ac_c" 1>&6
6205 else
6206   cat > conftest.$ac_ext <<EOF
6207 #line 6208 "configure"
6208 #include "confdefs.h"
6209 /* System header to define __stub macros and hopefully few prototypes,
6210     which can conflict with char $ac_func(); below.  */
6211 #include <assert.h>
6212 /* Override any gcc2 internal prototype to avoid an error.  */
6213 /* We use char because int might match the return type of a gcc2
6214     builtin and then its argument prototype would still apply.  */
6215 char $ac_func();
6216 char (*f)();
6217
6218 int main() {
6219
6220 /* The GNU C library defines this for functions which it implements
6221     to always fail with ENOSYS.  Some functions are actually named
6222     something starting with __ and the normal name is an alias.  */
6223 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6224 choke me
6225 #else
6226 f = $ac_func;
6227 #endif
6228
6229 ; return 0; }
6230 EOF
6231 if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6232   rm -rf conftest*
6233   eval "ac_cv_func_$ac_func=yes"
6234 else
6235   echo "configure: failed program was:" >&5
6236   cat conftest.$ac_ext >&5
6237   rm -rf conftest*
6238   eval "ac_cv_func_$ac_func=no"
6239 fi
6240 rm -f conftest*
6241 fi
6242
6243 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6244   echo "$ac_t""yes" 1>&6
6245     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6246   cat >> confdefs.h <<EOF
6247 #define $ac_tr_func 1
6248 EOF
6249  
6250 else
6251   echo "$ac_t""no" 1>&6
6252 fi
6253 done
6254
6255
6256 ol_link_ipv6=no
6257 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6258         if test $ol_enable_ipv6 = yes ; then
6259                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6260         fi
6261 elif test $ol_enable_ipv6 != no ; then
6262         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6263 echo "configure:6264: checking INET6_ADDRSTRLEN" >&5
6264 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6265   echo $ac_n "(cached) $ac_c" 1>&6
6266 else
6267   
6268                 cat > conftest.$ac_ext <<EOF
6269 #line 6270 "configure"
6270 #include "confdefs.h"
6271
6272 #                       include <netinet/in.h>
6273 #                       ifdef INET6_ADDRSTRLEN
6274                                 __has_inet6_addrstrlen__;
6275 #                       endif
6276                 
6277 EOF
6278 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6279   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6280   rm -rf conftest*
6281   ol_cv_inet6_addrstrlen=yes
6282 else
6283   rm -rf conftest*
6284   ol_cv_inet6_addrstrlen=no
6285 fi
6286 rm -f conftest*
6287
6288 fi
6289
6290 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6291
6292         if test $ol_cv_inet6_addrstrlen = yes ; then
6293                 ol_link_ipv6=yes
6294         elif test $ol_enable_ipv6 = yes ; then
6295                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6296         fi
6297 fi
6298
6299 if test $ol_enable_local != no ; then
6300         for ac_hdr in sys/un.h 
6301 do
6302 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6303 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6304 echo "configure:6305: checking for $ac_hdr" >&5
6305 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6306   echo $ac_n "(cached) $ac_c" 1>&6
6307 else
6308   cat > conftest.$ac_ext <<EOF
6309 #line 6310 "configure"
6310 #include "confdefs.h"
6311 #include <$ac_hdr>
6312 EOF
6313 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6314 { (eval echo configure:6315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6315 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6316 if test -z "$ac_err"; then
6317   rm -rf conftest*
6318   eval "ac_cv_header_$ac_safe=yes"
6319 else
6320   echo "$ac_err" >&5
6321   echo "configure: failed program was:" >&5
6322   cat conftest.$ac_ext >&5
6323   rm -rf conftest*
6324   eval "ac_cv_header_$ac_safe=no"
6325 fi
6326 rm -f conftest*
6327 fi
6328 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6329   echo "$ac_t""yes" 1>&6
6330     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6331   cat >> confdefs.h <<EOF
6332 #define $ac_tr_hdr 1
6333 EOF
6334  
6335 else
6336   echo "$ac_t""no" 1>&6
6337 fi
6338 done
6339
6340
6341         if test $ol_enable_local = auto ; then
6342                 ol_enable_local=$ac_cv_header_sys_un_h
6343         elif test $ac_cv_header_sys_un_h = no ; then
6344                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6345         fi
6346 fi
6347
6348 ol_link_kbind=no
6349 ol_link_kpasswd=no
6350 ol_link_krb5=no
6351 ol_link_krb4=no
6352
6353 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6354         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6355         -o $ol_with_kerberos = k425 ; then
6356
6357         for ac_hdr in krb5.h
6358 do
6359 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6360 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6361 echo "configure:6362: checking for $ac_hdr" >&5
6362 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6363   echo $ac_n "(cached) $ac_c" 1>&6
6364 else
6365   cat > conftest.$ac_ext <<EOF
6366 #line 6367 "configure"
6367 #include "confdefs.h"
6368 #include <$ac_hdr>
6369 EOF
6370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6371 { (eval echo configure:6372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6373 if test -z "$ac_err"; then
6374   rm -rf conftest*
6375   eval "ac_cv_header_$ac_safe=yes"
6376 else
6377   echo "$ac_err" >&5
6378   echo "configure: failed program was:" >&5
6379   cat conftest.$ac_ext >&5
6380   rm -rf conftest*
6381   eval "ac_cv_header_$ac_safe=no"
6382 fi
6383 rm -f conftest*
6384 fi
6385 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6386   echo "$ac_t""yes" 1>&6
6387     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6388   cat >> confdefs.h <<EOF
6389 #define $ac_tr_hdr 1
6390 EOF
6391  
6392 else
6393   echo "$ac_t""no" 1>&6
6394 fi
6395 done
6396
6397
6398         if test $ac_cv_header_krb5_h = yes ; then
6399                                 for ac_hdr in heim_err.h
6400 do
6401 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6402 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6403 echo "configure:6404: checking for $ac_hdr" >&5
6404 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6405   echo $ac_n "(cached) $ac_c" 1>&6
6406 else
6407   cat > conftest.$ac_ext <<EOF
6408 #line 6409 "configure"
6409 #include "confdefs.h"
6410 #include <$ac_hdr>
6411 EOF
6412 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6413 { (eval echo configure:6414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6414 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6415 if test -z "$ac_err"; then
6416   rm -rf conftest*
6417   eval "ac_cv_header_$ac_safe=yes"
6418 else
6419   echo "$ac_err" >&5
6420   echo "configure: failed program was:" >&5
6421   cat conftest.$ac_ext >&5
6422   rm -rf conftest*
6423   eval "ac_cv_header_$ac_safe=no"
6424 fi
6425 rm -f conftest*
6426 fi
6427 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6428   echo "$ac_t""yes" 1>&6
6429     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6430   cat >> confdefs.h <<EOF
6431 #define $ac_tr_hdr 1
6432 EOF
6433  
6434 else
6435   echo "$ac_t""no" 1>&6
6436 fi
6437 done
6438
6439                 if test $ac_cv_header_heim_err_h = yes ; then
6440                         krb5_impl=heimdal
6441                 else
6442                         krb5_impl=mit
6443                 fi
6444
6445                 if test $krb5_impl = mit; then
6446                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6447 echo "configure:6448: checking for main in -lk5crypto" >&5
6448 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6449 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6450   echo $ac_n "(cached) $ac_c" 1>&6
6451 else
6452   ac_save_LIBS="$LIBS"
6453 LIBS="-lk5crypto  $LIBS"
6454 cat > conftest.$ac_ext <<EOF
6455 #line 6456 "configure"
6456 #include "confdefs.h"
6457
6458 int main() {
6459 main()
6460 ; return 0; }
6461 EOF
6462 if { (eval echo configure:6463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6463   rm -rf conftest*
6464   eval "ac_cv_lib_$ac_lib_var=yes"
6465 else
6466   echo "configure: failed program was:" >&5
6467   cat conftest.$ac_ext >&5
6468   rm -rf conftest*
6469   eval "ac_cv_lib_$ac_lib_var=no"
6470 fi
6471 rm -f conftest*
6472 LIBS="$ac_save_LIBS"
6473
6474 fi
6475 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6476   echo "$ac_t""yes" 1>&6
6477   krb5crypto=k5crypto
6478 else
6479   echo "$ac_t""no" 1>&6
6480 krb5crypto=crypto
6481 fi
6482
6483
6484                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6485 echo "configure:6486: checking for main in -lkrb5" >&5
6486 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6487 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6488   echo $ac_n "(cached) $ac_c" 1>&6
6489 else
6490   ac_save_LIBS="$LIBS"
6491 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6492 cat > conftest.$ac_ext <<EOF
6493 #line 6494 "configure"
6494 #include "confdefs.h"
6495
6496 int main() {
6497 main()
6498 ; return 0; }
6499 EOF
6500 if { (eval echo configure:6501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6501   rm -rf conftest*
6502   eval "ac_cv_lib_$ac_lib_var=yes"
6503 else
6504   echo "configure: failed program was:" >&5
6505   cat conftest.$ac_ext >&5
6506   rm -rf conftest*
6507   eval "ac_cv_lib_$ac_lib_var=no"
6508 fi
6509 rm -f conftest*
6510 LIBS="$ac_save_LIBS"
6511
6512 fi
6513 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6514   echo "$ac_t""yes" 1>&6
6515   have_krb5=yes
6516                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6517 else
6518   echo "$ac_t""no" 1>&6
6519 have_krb5=no
6520 fi
6521
6522
6523                 elif test $krb5_impl = heimdal; then
6524                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6525 echo "configure:6526: checking for main in -lkrb5" >&5
6526 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6527 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6528   echo $ac_n "(cached) $ac_c" 1>&6
6529 else
6530   ac_save_LIBS="$LIBS"
6531 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6532 cat > conftest.$ac_ext <<EOF
6533 #line 6534 "configure"
6534 #include "confdefs.h"
6535
6536 int main() {
6537 main()
6538 ; return 0; }
6539 EOF
6540 if { (eval echo configure:6541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6541   rm -rf conftest*
6542   eval "ac_cv_lib_$ac_lib_var=yes"
6543 else
6544   echo "configure: failed program was:" >&5
6545   cat conftest.$ac_ext >&5
6546   rm -rf conftest*
6547   eval "ac_cv_lib_$ac_lib_var=no"
6548 fi
6549 rm -f conftest*
6550 LIBS="$ac_save_LIBS"
6551
6552 fi
6553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6554   echo "$ac_t""yes" 1>&6
6555   have_krb5=yes
6556                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6557 else
6558   echo "$ac_t""no" 1>&6
6559 have_krb5=no
6560 fi
6561
6562
6563                         cat >> confdefs.h <<\EOF
6564 #define HAVE_HEIMDAL_KERBEROS 1
6565 EOF
6566
6567
6568                 else
6569                         have_krb5=no
6570                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6571                 fi
6572
6573                 if test $have_krb5 = yes ; then
6574                         ol_link_krb5=yes
6575
6576                         cat >> confdefs.h <<\EOF
6577 #define HAVE_KRB5 1
6578 EOF
6579
6580
6581                         if test $ol_enable_kpasswd != no ; then
6582                                 ol_link_kpasswd=yes;
6583                         fi
6584
6585                         if test $ol_with_kerberos = k5only ; then
6586                                 ol_with_kerberos=found
6587                         fi
6588
6589                 elif test $ol_with_kerberos != auto ; then
6590                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6591                 fi
6592
6593         fi
6594 fi
6595
6596 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6597         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6598
6599         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6600 do
6601 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6602 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6603 echo "configure:6604: checking for $ac_hdr" >&5
6604 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6605   echo $ac_n "(cached) $ac_c" 1>&6
6606 else
6607   cat > conftest.$ac_ext <<EOF
6608 #line 6609 "configure"
6609 #include "confdefs.h"
6610 #include <$ac_hdr>
6611 EOF
6612 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6613 { (eval echo configure:6614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6614 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6615 if test -z "$ac_err"; then
6616   rm -rf conftest*
6617   eval "ac_cv_header_$ac_safe=yes"
6618 else
6619   echo "$ac_err" >&5
6620   echo "configure: failed program was:" >&5
6621   cat conftest.$ac_ext >&5
6622   rm -rf conftest*
6623   eval "ac_cv_header_$ac_safe=no"
6624 fi
6625 rm -f conftest*
6626 fi
6627 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6628   echo "$ac_t""yes" 1>&6
6629     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6630   cat >> confdefs.h <<EOF
6631 #define $ac_tr_hdr 1
6632 EOF
6633  
6634 else
6635   echo "$ac_t""no" 1>&6
6636 fi
6637 done
6638
6639
6640         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6641                 if test $krb5_impl = mit; then
6642                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6643 echo "configure:6644: checking for main in -lkrb4" >&5
6644 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6645 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6646   echo $ac_n "(cached) $ac_c" 1>&6
6647 else
6648   ac_save_LIBS="$LIBS"
6649 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6650 cat > conftest.$ac_ext <<EOF
6651 #line 6652 "configure"
6652 #include "confdefs.h"
6653
6654 int main() {
6655 main()
6656 ; return 0; }
6657 EOF
6658 if { (eval echo configure:6659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6659   rm -rf conftest*
6660   eval "ac_cv_lib_$ac_lib_var=yes"
6661 else
6662   echo "configure: failed program was:" >&5
6663   cat conftest.$ac_ext >&5
6664   rm -rf conftest*
6665   eval "ac_cv_lib_$ac_lib_var=no"
6666 fi
6667 rm -f conftest*
6668 LIBS="$ac_save_LIBS"
6669
6670 fi
6671 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6672   echo "$ac_t""yes" 1>&6
6673   have_k425=yes
6674                                 KRB4_LIBS="-lkrb4 -ldes425"
6675 else
6676   echo "$ac_t""no" 1>&6
6677 have_k425=no
6678 fi
6679
6680
6681                 elif test $krb5_impl = heimdal; then
6682                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6683 echo "configure:6684: checking for main in -lkrb4" >&5
6684 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6685 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6686   echo $ac_n "(cached) $ac_c" 1>&6
6687 else
6688   ac_save_LIBS="$LIBS"
6689 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6690 cat > conftest.$ac_ext <<EOF
6691 #line 6692 "configure"
6692 #include "confdefs.h"
6693
6694 int main() {
6695 main()
6696 ; return 0; }
6697 EOF
6698 if { (eval echo configure:6699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6699   rm -rf conftest*
6700   eval "ac_cv_lib_$ac_lib_var=yes"
6701 else
6702   echo "configure: failed program was:" >&5
6703   cat conftest.$ac_ext >&5
6704   rm -rf conftest*
6705   eval "ac_cv_lib_$ac_lib_var=no"
6706 fi
6707 rm -f conftest*
6708 LIBS="$ac_save_LIBS"
6709
6710 fi
6711 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6712   echo "$ac_t""yes" 1>&6
6713   have_k425=yes
6714                                 KRB4_LIBS="-lkrb4"
6715 else
6716   echo "$ac_t""no" 1>&6
6717 have_k425=no
6718 fi
6719
6720
6721                 else
6722                         have_425=no
6723                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6724                 fi
6725
6726                 if test $have_k425 = yes ; then
6727                         ol_with_kerberos=found
6728                         ol_link_krb4=yes
6729
6730                         cat >> confdefs.h <<\EOF
6731 #define HAVE_KRB425 1
6732 EOF
6733
6734                         cat >> confdefs.h <<\EOF
6735 #define HAVE_KRB4 1
6736 EOF
6737
6738
6739                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6740 echo "configure:6741: checking for des_debug in Kerberos libraries" >&5
6741 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6742   echo $ac_n "(cached) $ac_c" 1>&6
6743 else
6744   
6745                                                                 save_LIBS="$LIBS"
6746                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6747                                 cat > conftest.$ac_ext <<EOF
6748 #line 6749 "configure"
6749 #include "confdefs.h"
6750
6751 #include <kerberosIV/krb.h>
6752 #include <kerberosIV/des.h>
6753 extern int des_debug;
6754
6755 int main() {
6756
6757 des_debug = 1;
6758
6759 ; return 0; }
6760 EOF
6761 if { (eval echo configure:6762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6762   rm -rf conftest*
6763   ol_cv_var_des_debug=yes
6764 else
6765   echo "configure: failed program was:" >&5
6766   cat conftest.$ac_ext >&5
6767   rm -rf conftest*
6768   ol_cv_var_des_debug=no
6769 fi
6770 rm -f conftest*
6771                                                                 LIBS="$save_LIBS"
6772                         
6773 fi
6774
6775 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6776
6777                         if test $ol_cv_var_des_debug = yes ; then
6778                                 cat >> confdefs.h <<\EOF
6779 #define HAVE_DES_DEBUG 1
6780 EOF
6781
6782                         fi
6783
6784                         LIBS="$save_LIBS"
6785                 fi
6786         fi
6787 fi
6788
6789 if test $ol_link_krb5 = yes ; then
6790         ol_with_kerberos=found
6791 fi
6792
6793 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6794         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6795
6796         for ac_hdr in krb.h des.h krb-archaeology.h 
6797 do
6798 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6799 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6800 echo "configure:6801: checking for $ac_hdr" >&5
6801 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6802   echo $ac_n "(cached) $ac_c" 1>&6
6803 else
6804   cat > conftest.$ac_ext <<EOF
6805 #line 6806 "configure"
6806 #include "confdefs.h"
6807 #include <$ac_hdr>
6808 EOF
6809 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6810 { (eval echo configure:6811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6811 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6812 if test -z "$ac_err"; then
6813   rm -rf conftest*
6814   eval "ac_cv_header_$ac_safe=yes"
6815 else
6816   echo "$ac_err" >&5
6817   echo "configure: failed program was:" >&5
6818   cat conftest.$ac_ext >&5
6819   rm -rf conftest*
6820   eval "ac_cv_header_$ac_safe=no"
6821 fi
6822 rm -f conftest*
6823 fi
6824 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6825   echo "$ac_t""yes" 1>&6
6826     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6827   cat >> confdefs.h <<EOF
6828 #define $ac_tr_hdr 1
6829 EOF
6830  
6831 else
6832   echo "$ac_t""no" 1>&6
6833 fi
6834 done
6835
6836
6837         if test $ac_cv_header_krb_h = yes ; then
6838                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6839 echo "configure:6840: checking for main in -lkrb" >&5
6840 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6841 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6842   echo $ac_n "(cached) $ac_c" 1>&6
6843 else
6844   ac_save_LIBS="$LIBS"
6845 LIBS="-lkrb -ldes $LIBS"
6846 cat > conftest.$ac_ext <<EOF
6847 #line 6848 "configure"
6848 #include "confdefs.h"
6849
6850 int main() {
6851 main()
6852 ; return 0; }
6853 EOF
6854 if { (eval echo configure:6855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6855   rm -rf conftest*
6856   eval "ac_cv_lib_$ac_lib_var=yes"
6857 else
6858   echo "configure: failed program was:" >&5
6859   cat conftest.$ac_ext >&5
6860   rm -rf conftest*
6861   eval "ac_cv_lib_$ac_lib_var=no"
6862 fi
6863 rm -f conftest*
6864 LIBS="$ac_save_LIBS"
6865
6866 fi
6867 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6868   echo "$ac_t""yes" 1>&6
6869   have_k4=yes
6870 else
6871   echo "$ac_t""no" 1>&6
6872 have_k4=no
6873 fi
6874
6875
6876                 if test $have_k4 = yes ; then
6877                         ol_with_kerberos=found
6878                         ol_link_krb4=yes
6879
6880                         cat >> confdefs.h <<\EOF
6881 #define HAVE_KRB4 1
6882 EOF
6883
6884
6885                         KRB4_LIBS="-lkrb -ldes"
6886
6887                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6888                                 cat >> confdefs.h <<\EOF
6889 #define HAVE_KTH_KERBEROS 1
6890 EOF
6891
6892                         fi
6893                 fi
6894         fi
6895 fi
6896
6897 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6898         ol_link_kpasswd=yes
6899 fi
6900
6901 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6902         ol_link_kbind=yes
6903
6904 elif test $ol_enable_kbind = yes ; then
6905         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6906 fi
6907
6908 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6909         cat >> confdefs.h <<\EOF
6910 #define HAVE_KERBEROS 1
6911 EOF
6912
6913
6914 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6915         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6916 fi
6917
6918 ol_link_tls=no
6919 if test $ol_with_tls != no ; then
6920         for ac_hdr in openssl/ssl.h ssl.h
6921 do
6922 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6923 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6924 echo "configure:6925: checking for $ac_hdr" >&5
6925 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6926   echo $ac_n "(cached) $ac_c" 1>&6
6927 else
6928   cat > conftest.$ac_ext <<EOF
6929 #line 6930 "configure"
6930 #include "confdefs.h"
6931 #include <$ac_hdr>
6932 EOF
6933 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6934 { (eval echo configure:6935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6935 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6936 if test -z "$ac_err"; then
6937   rm -rf conftest*
6938   eval "ac_cv_header_$ac_safe=yes"
6939 else
6940   echo "$ac_err" >&5
6941   echo "configure: failed program was:" >&5
6942   cat conftest.$ac_ext >&5
6943   rm -rf conftest*
6944   eval "ac_cv_header_$ac_safe=no"
6945 fi
6946 rm -f conftest*
6947 fi
6948 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6949   echo "$ac_t""yes" 1>&6
6950     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6951   cat >> confdefs.h <<EOF
6952 #define $ac_tr_hdr 1
6953 EOF
6954  
6955 else
6956   echo "$ac_t""no" 1>&6
6957 fi
6958 done
6959
6960         
6961         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6962                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6963 echo "configure:6964: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6964 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6965 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6966   echo $ac_n "(cached) $ac_c" 1>&6
6967 else
6968   ac_save_LIBS="$LIBS"
6969 LIBS="-lssl -lcrypto $LIBS"
6970 cat > conftest.$ac_ext <<EOF
6971 #line 6972 "configure"
6972 #include "confdefs.h"
6973 /* Override any gcc2 internal prototype to avoid an error.  */
6974 /* We use char because int might match the return type of a gcc2
6975     builtin and then its argument prototype would still apply.  */
6976 char SSLeay_add_ssl_algorithms();
6977
6978 int main() {
6979 SSLeay_add_ssl_algorithms()
6980 ; return 0; }
6981 EOF
6982 if { (eval echo configure:6983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6983   rm -rf conftest*
6984   eval "ac_cv_lib_$ac_lib_var=yes"
6985 else
6986   echo "configure: failed program was:" >&5
6987   cat conftest.$ac_ext >&5
6988   rm -rf conftest*
6989   eval "ac_cv_lib_$ac_lib_var=no"
6990 fi
6991 rm -f conftest*
6992 LIBS="$ac_save_LIBS"
6993
6994 fi
6995 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6996   echo "$ac_t""yes" 1>&6
6997   have_ssleay=yes
6998                         need_rsaref=no
6999 else
7000   echo "$ac_t""no" 1>&6
7001 have_ssleay=no
7002 fi
7003
7004                         
7005                 if test $have_ssleay = no ; then
7006                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
7007 echo "configure:7008: checking for SSL_library_init in -lssl" >&5
7008 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
7009 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7010   echo $ac_n "(cached) $ac_c" 1>&6
7011 else
7012   ac_save_LIBS="$LIBS"
7013 LIBS="-lssl -lcrypto $LIBS"
7014 cat > conftest.$ac_ext <<EOF
7015 #line 7016 "configure"
7016 #include "confdefs.h"
7017 /* Override any gcc2 internal prototype to avoid an error.  */
7018 /* We use char because int might match the return type of a gcc2
7019     builtin and then its argument prototype would still apply.  */
7020 char SSL_library_init();
7021
7022 int main() {
7023 SSL_library_init()
7024 ; return 0; }
7025 EOF
7026 if { (eval echo configure:7027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7027   rm -rf conftest*
7028   eval "ac_cv_lib_$ac_lib_var=yes"
7029 else
7030   echo "configure: failed program was:" >&5
7031   cat conftest.$ac_ext >&5
7032   rm -rf conftest*
7033   eval "ac_cv_lib_$ac_lib_var=no"
7034 fi
7035 rm -f conftest*
7036 LIBS="$ac_save_LIBS"
7037
7038 fi
7039 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7040   echo "$ac_t""yes" 1>&6
7041   have_ssleay=yes
7042                                 need_rsaref=no
7043 else
7044   echo "$ac_t""no" 1>&6
7045 have_ssleay=no
7046 fi
7047
7048                 fi
7049
7050                 if test $have_ssleay = no ; then
7051                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
7052 echo "configure:7053: checking for ssl3_accept in -lssl" >&5
7053 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
7054 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7055   echo $ac_n "(cached) $ac_c" 1>&6
7056 else
7057   ac_save_LIBS="$LIBS"
7058 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
7059 cat > conftest.$ac_ext <<EOF
7060 #line 7061 "configure"
7061 #include "confdefs.h"
7062 /* Override any gcc2 internal prototype to avoid an error.  */
7063 /* We use char because int might match the return type of a gcc2
7064     builtin and then its argument prototype would still apply.  */
7065 char ssl3_accept();
7066
7067 int main() {
7068 ssl3_accept()
7069 ; return 0; }
7070 EOF
7071 if { (eval echo configure:7072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7072   rm -rf conftest*
7073   eval "ac_cv_lib_$ac_lib_var=yes"
7074 else
7075   echo "configure: failed program was:" >&5
7076   cat conftest.$ac_ext >&5
7077   rm -rf conftest*
7078   eval "ac_cv_lib_$ac_lib_var=no"
7079 fi
7080 rm -f conftest*
7081 LIBS="$ac_save_LIBS"
7082
7083 fi
7084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7085   echo "$ac_t""yes" 1>&6
7086   have_ssleay=yes
7087                                 need_rsaref=yes
7088 else
7089   echo "$ac_t""no" 1>&6
7090 have_ssleay=no
7091 fi
7092
7093                 fi
7094
7095                 if test $have_ssleay = yes ; then
7096                         ol_with_tls=found
7097                         ol_link_tls=yes
7098
7099                         cat >> confdefs.h <<\EOF
7100 #define HAVE_SSLEAY 1
7101 EOF
7102
7103
7104                         if test $need_rsaref = yes; then
7105                                 cat >> confdefs.h <<\EOF
7106 #define HAVE_RSAREF 1
7107 EOF
7108
7109
7110                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7111                         else
7112                                 TLS_LIBS="-lssl -lcrypto"
7113                         fi
7114                 fi
7115         fi
7116
7117 else
7118         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7119 fi
7120
7121 if test $ol_link_tls = yes ; then
7122         cat >> confdefs.h <<\EOF
7123 #define HAVE_TLS 1
7124 EOF
7125
7126
7127 elif test $ol_with_tls = auto ; then
7128         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7129         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7130
7131 elif test $ol_with_tls != no ; then
7132         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7133 fi
7134
7135 if test $ol_enable_lmpasswd != no; then
7136         if test $ol_link_tls != yes ; then
7137                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7138         fi
7139
7140         cat >> confdefs.h <<\EOF
7141 #define SLAPD_LMHASH 1
7142 EOF
7143
7144 fi
7145
7146 for ac_func in \
7147         ctime_r                 \
7148         gethostbyname_r gethostbyaddr_r \
7149
7150 do
7151 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7152 echo "configure:7153: checking for $ac_func" >&5
7153 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7154   echo $ac_n "(cached) $ac_c" 1>&6
7155 else
7156   cat > conftest.$ac_ext <<EOF
7157 #line 7158 "configure"
7158 #include "confdefs.h"
7159 /* System header to define __stub macros and hopefully few prototypes,
7160     which can conflict with char $ac_func(); below.  */
7161 #include <assert.h>
7162 /* Override any gcc2 internal prototype to avoid an error.  */
7163 /* We use char because int might match the return type of a gcc2
7164     builtin and then its argument prototype would still apply.  */
7165 char $ac_func();
7166 char (*f)();
7167
7168 int main() {
7169
7170 /* The GNU C library defines this for functions which it implements
7171     to always fail with ENOSYS.  Some functions are actually named
7172     something starting with __ and the normal name is an alias.  */
7173 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7174 choke me
7175 #else
7176 f = $ac_func;
7177 #endif
7178
7179 ; return 0; }
7180 EOF
7181 if { (eval echo configure:7182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7182   rm -rf conftest*
7183   eval "ac_cv_func_$ac_func=yes"
7184 else
7185   echo "configure: failed program was:" >&5
7186   cat conftest.$ac_ext >&5
7187   rm -rf conftest*
7188   eval "ac_cv_func_$ac_func=no"
7189 fi
7190 rm -f conftest*
7191 fi
7192
7193 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7194   echo "$ac_t""yes" 1>&6
7195     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7196   cat >> confdefs.h <<EOF
7197 #define $ac_tr_func 1
7198 EOF
7199  
7200 else
7201   echo "$ac_t""no" 1>&6
7202 fi
7203 done
7204
7205
7206 if test "$ac_cv_func_ctime_r" = no ; then
7207         ol_cv_func_ctime_r_nargs=0
7208 else
7209         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7210 echo "configure:7211: checking number of arguments of ctime_r" >&5
7211 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7212   echo $ac_n "(cached) $ac_c" 1>&6
7213 else
7214   cat > conftest.$ac_ext <<EOF
7215 #line 7216 "configure"
7216 #include "confdefs.h"
7217 #include <time.h>
7218 int main() {
7219 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7220 ; return 0; }
7221 EOF
7222 if { (eval echo configure:7223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7223   rm -rf conftest*
7224   ol_cv_func_ctime_r_nargs3=yes
7225 else
7226   echo "configure: failed program was:" >&5
7227   cat conftest.$ac_ext >&5
7228   rm -rf conftest*
7229   ol_cv_func_ctime_r_nargs3=no
7230 fi
7231 rm -f conftest*
7232
7233         cat > conftest.$ac_ext <<EOF
7234 #line 7235 "configure"
7235 #include "confdefs.h"
7236 #include <time.h>
7237 int main() {
7238 time_t ti; char *buffer; ctime_r(&ti,buffer);
7239 ; return 0; }
7240 EOF
7241 if { (eval echo configure:7242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7242   rm -rf conftest*
7243   ol_cv_func_ctime_r_nargs2=yes
7244 else
7245   echo "configure: failed program was:" >&5
7246   cat conftest.$ac_ext >&5
7247   rm -rf conftest*
7248   ol_cv_func_ctime_r_nargs2=no
7249 fi
7250 rm -f conftest*
7251
7252         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7253                 $ol_cv_func_ctime_r_nargs2 = no ; then
7254
7255                 ol_cv_func_ctime_r_nargs=3
7256
7257         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7258                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7259
7260                 ol_cv_func_ctime_r_nargs=2
7261
7262         else
7263                 ol_cv_func_ctime_r_nargs=0
7264         fi
7265   
7266 fi
7267
7268 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7269
7270   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7271         cat >> confdefs.h <<EOF
7272 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7273 EOF
7274
7275   fi
7276
7277 fi
7278
7279 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7280         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7281 echo "configure:7282: checking number of arguments of gethostbyname_r" >&5
7282 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7283   echo $ac_n "(cached) $ac_c" 1>&6
7284 else
7285   cat > conftest.$ac_ext <<EOF
7286 #line 7287 "configure"
7287 #include "confdefs.h"
7288 #include <sys/types.h>
7289 #include <sys/socket.h>
7290 #include <netinet/in.h>
7291 #include <netdb.h>
7292 #define BUFSIZE (sizeof(struct hostent)+10)
7293 int main() {
7294 struct hostent hent; char buffer[BUFSIZE];
7295                 int bufsize=BUFSIZE;int h_errno;
7296                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7297                         buffer, bufsize, &h_errno);
7298 ; return 0; }
7299 EOF
7300 if { (eval echo configure:7301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7301   rm -rf conftest*
7302   ol_cv_func_gethostbyname_r_nargs5=yes
7303 else
7304   echo "configure: failed program was:" >&5
7305   cat conftest.$ac_ext >&5
7306   rm -rf conftest*
7307   ol_cv_func_gethostbyname_r_nargs5=no
7308 fi
7309 rm -f conftest*
7310
7311         cat > conftest.$ac_ext <<EOF
7312 #line 7313 "configure"
7313 #include "confdefs.h"
7314 #include <sys/types.h>
7315 #include <sys/socket.h>
7316 #include <netinet/in.h>
7317 #include <netdb.h>
7318 #define BUFSIZE (sizeof(struct hostent)+10)
7319 int main() {
7320 struct hostent hent;struct hostent *rhent;
7321                 char buffer[BUFSIZE];
7322                 int bufsize=BUFSIZE;int h_errno;
7323                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7324                         &rhent, &h_errno);
7325 ; return 0; }
7326 EOF
7327 if { (eval echo configure:7328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7328   rm -rf conftest*
7329   ol_cv_func_gethostbyname_r_nargs6=yes
7330 else
7331   echo "configure: failed program was:" >&5
7332   cat conftest.$ac_ext >&5
7333   rm -rf conftest*
7334   ol_cv_func_gethostbyname_r_nargs6=no
7335 fi
7336 rm -f conftest*
7337
7338         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7339                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7340
7341                 ol_cv_func_gethostbyname_r_nargs=5
7342
7343         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7344                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7345
7346                 ol_cv_func_gethostbyname_r_nargs=6
7347
7348         else
7349                 ol_cv_func_gethostbyname_r_nargs=0
7350         fi
7351   
7352 fi
7353
7354 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7355   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7356         cat >> confdefs.h <<EOF
7357 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7358 EOF
7359
7360   fi
7361
7362 else
7363         ol_cv_func_gethostbyname_r_nargs=0
7364 fi
7365  
7366 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7367         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7368 echo "configure:7369: checking number of arguments of gethostbyaddr_r" >&5
7369 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7370   echo $ac_n "(cached) $ac_c" 1>&6
7371 else
7372   cat > conftest.$ac_ext <<EOF
7373 #line 7374 "configure"
7374 #include "confdefs.h"
7375 #include <sys/types.h>
7376 #include <sys/socket.h>
7377 #include <netinet/in.h>
7378 #include <netdb.h>
7379 #define BUFSIZE (sizeof(struct hostent)+10)
7380 int main() {
7381 struct hostent hent; char buffer[BUFSIZE]; 
7382             struct in_addr add;
7383             size_t alen=sizeof(struct in_addr);
7384             int bufsize=BUFSIZE;int h_errno;
7385                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7386                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7387 ; return 0; }
7388 EOF
7389 if { (eval echo configure:7390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7390   rm -rf conftest*
7391   ol_cv_func_gethostbyaddr_r_nargs7=yes
7392 else
7393   echo "configure: failed program was:" >&5
7394   cat conftest.$ac_ext >&5
7395   rm -rf conftest*
7396   ol_cv_func_gethostbyaddr_r_nargs7=no
7397 fi
7398 rm -f conftest*
7399
7400         cat > conftest.$ac_ext <<EOF
7401 #line 7402 "configure"
7402 #include "confdefs.h"
7403 #include <sys/types.h>
7404 #include <sys/socket.h>
7405 #include <netinet/in.h>
7406 #include <netdb.h>
7407 #define BUFSIZE (sizeof(struct hostent)+10)
7408 int main() {
7409 struct hostent hent;
7410                 struct hostent *rhent; char buffer[BUFSIZE]; 
7411                 struct in_addr add;
7412                 size_t alen=sizeof(struct in_addr);
7413                 int bufsize=BUFSIZE;int h_errno;
7414                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7415                         alen, AF_INET, &hent, buffer, bufsize, 
7416                         &rhent, &h_errno);
7417 ; return 0; }
7418 EOF
7419 if { (eval echo configure:7420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7420   rm -rf conftest*
7421   ol_cv_func_gethostbyaddr_r_nargs8=yes
7422 else
7423   echo "configure: failed program was:" >&5
7424   cat conftest.$ac_ext >&5
7425   rm -rf conftest*
7426   ol_cv_func_gethostbyaddr_r_nargs8=no
7427 fi
7428 rm -f conftest*
7429
7430         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7431                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7432
7433                 ol_cv_func_gethostbyaddr_r_nargs=7
7434
7435         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7436                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7437
7438                 ol_cv_func_gethostbyaddr_r_nargs=8
7439
7440         else
7441                 ol_cv_func_gethostbyaddr_r_nargs=0
7442         fi
7443   
7444 fi
7445
7446 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7447   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7448     cat >> confdefs.h <<EOF
7449 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7450 EOF
7451
7452   fi
7453
7454 else
7455         ol_cv_func_gethostbyaddr_r_nargs=0
7456 fi
7457
7458 if test "$ac_cv_func_ctime_r" = yes \
7459         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7460         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7461         -a "$ac_cv_func_gethostbyname_r" = yes \
7462         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7463         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7464         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7465         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7466         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7467         ; then
7468  
7469         cat >> confdefs.h <<\EOF
7470 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7471 EOF
7472
7473 fi
7474
7475 ol_link_threads=no
7476
7477 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7478         -o $ol_with_threads = nt ; then
7479
7480         
7481         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7482 echo "configure:7483: checking for _beginthread" >&5
7483 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7484   echo $ac_n "(cached) $ac_c" 1>&6
7485 else
7486   cat > conftest.$ac_ext <<EOF
7487 #line 7488 "configure"
7488 #include "confdefs.h"
7489 /* System header to define __stub macros and hopefully few prototypes,
7490     which can conflict with char _beginthread(); below.  */
7491 #include <assert.h>
7492 /* Override any gcc2 internal prototype to avoid an error.  */
7493 /* We use char because int might match the return type of a gcc2
7494     builtin and then its argument prototype would still apply.  */
7495 char _beginthread();
7496 char (*f)();
7497
7498 int main() {
7499
7500 /* The GNU C library defines this for functions which it implements
7501     to always fail with ENOSYS.  Some functions are actually named
7502     something starting with __ and the normal name is an alias.  */
7503 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7504 choke me
7505 #else
7506 f = _beginthread;
7507 #endif
7508
7509 ; return 0; }
7510 EOF
7511 if { (eval echo configure:7512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7512   rm -rf conftest*
7513   eval "ac_cv_func__beginthread=yes"
7514 else
7515   echo "configure: failed program was:" >&5
7516   cat conftest.$ac_ext >&5
7517   rm -rf conftest*
7518   eval "ac_cv_func__beginthread=no"
7519 fi
7520 rm -f conftest*
7521 fi
7522
7523 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7524   echo "$ac_t""yes" 1>&6
7525   :
7526 else
7527   echo "$ac_t""no" 1>&6
7528 fi
7529
7530
7531         if test $ac_cv_func__beginthread = yes ; then
7532                 cat >> confdefs.h <<\EOF
7533 #define HAVE_NT_THREADS 1
7534 EOF
7535
7536                 ol_cv_nt_threads=yes
7537         fi
7538
7539
7540         if test "$ol_cv_nt_threads" = yes ; then
7541                 ol_link_threads=nt
7542                 ol_with_threads=found
7543                 ol_with_yielding_select=yes
7544
7545                 cat >> confdefs.h <<\EOF
7546 #define HAVE_NT_SERVICE_MANAGER 1
7547 EOF
7548
7549                 cat >> confdefs.h <<\EOF
7550 #define HAVE_NT_EVENT_LOG 1
7551 EOF
7552
7553         fi
7554
7555         if test $ol_with_threads = nt ; then
7556                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7557         fi
7558 fi
7559
7560 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7561         -o $ol_with_threads = posix ; then
7562
7563         for ac_hdr in pthread.h
7564 do
7565 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7566 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7567 echo "configure:7568: checking for $ac_hdr" >&5
7568 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7569   echo $ac_n "(cached) $ac_c" 1>&6
7570 else
7571   cat > conftest.$ac_ext <<EOF
7572 #line 7573 "configure"
7573 #include "confdefs.h"
7574 #include <$ac_hdr>
7575 EOF
7576 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7577 { (eval echo configure:7578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7578 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7579 if test -z "$ac_err"; then
7580   rm -rf conftest*
7581   eval "ac_cv_header_$ac_safe=yes"
7582 else
7583   echo "$ac_err" >&5
7584   echo "configure: failed program was:" >&5
7585   cat conftest.$ac_ext >&5
7586   rm -rf conftest*
7587   eval "ac_cv_header_$ac_safe=no"
7588 fi
7589 rm -f conftest*
7590 fi
7591 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7592   echo "$ac_t""yes" 1>&6
7593     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7594   cat >> confdefs.h <<EOF
7595 #define $ac_tr_hdr 1
7596 EOF
7597  
7598 else
7599   echo "$ac_t""no" 1>&6
7600 fi
7601 done
7602
7603
7604         if test $ac_cv_header_pthread_h = yes ; then
7605                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7606 echo "configure:7607: checking POSIX thread version" >&5
7607 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7608   echo $ac_n "(cached) $ac_c" 1>&6
7609 else
7610   
7611         cat > conftest.$ac_ext <<EOF
7612 #line 7613 "configure"
7613 #include "confdefs.h"
7614
7615 #               include <pthread.h>
7616                 /* this check could be improved */
7617 #               ifdef PTHREAD_ONCE_INIT
7618                         pthread_version_final;
7619 #               endif
7620         
7621 EOF
7622 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7623   egrep "pthread_version_final" >/dev/null 2>&1; then
7624   rm -rf conftest*
7625   ol_pthread_final=yes
7626 else
7627   rm -rf conftest*
7628   ol_pthread_final=no
7629 fi
7630 rm -f conftest*
7631
7632
7633         cat > conftest.$ac_ext <<EOF
7634 #line 7635 "configure"
7635 #include "confdefs.h"
7636
7637 #               include <pthread.h>
7638                 /* this check could be improved */
7639 #               ifdef pthread_once_init
7640                         pthread_version_draft4;
7641 #               endif
7642         
7643 EOF
7644 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7645   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7646   rm -rf conftest*
7647   ol_pthread_draft4=yes
7648 else
7649   rm -rf conftest*
7650   ol_pthread_draft4=no
7651 fi
7652 rm -f conftest*
7653
7654
7655         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7656                 ol_cv_pthread_version=final
7657         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7658                 ol_cv_pthread_version=draft4
7659         else
7660                 ol_cv_pthread_version=unknown
7661         fi
7662
7663 fi
7664
7665 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7666
7667
7668                 if test $ol_cv_pthread_version = final ; then
7669                         cat >> confdefs.h <<\EOF
7670 #define HAVE_PTHREADS_FINAL 1
7671 EOF
7672
7673                 elif test $ol_cv_pthread_version = draft4 ; then
7674                         cat >> confdefs.h <<\EOF
7675 #define HAVE_PTHREADS_D4 1
7676 EOF
7677
7678                 else
7679                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7680                 fi
7681
7682                 # consider threads found
7683                 ol_with_threads=found
7684
7685                 
7686         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7687 echo "configure:7688: checking for LinuxThreads pthread.h" >&5
7688 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7689   echo $ac_n "(cached) $ac_c" 1>&6
7690 else
7691   cat > conftest.$ac_ext <<EOF
7692 #line 7693 "configure"
7693 #include "confdefs.h"
7694 #include <pthread.h>
7695 EOF
7696 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7697   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7698   rm -rf conftest*
7699   ol_cv_header_linux_threads=yes
7700 else
7701   rm -rf conftest*
7702   ol_cv_header_linux_threads=no
7703 fi
7704 rm -f conftest*
7705
7706                 
7707 fi
7708
7709 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7710         if test $ol_cv_header_linux_threads = yes; then
7711                 cat >> confdefs.h <<\EOF
7712 #define HAVE_LINUX_THREADS 1
7713 EOF
7714
7715         fi
7716
7717                 
7718         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7719 echo "configure:7720: checking for GNU Pth pthread.h" >&5
7720 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7721   echo $ac_n "(cached) $ac_c" 1>&6
7722 else
7723   cat > conftest.$ac_ext <<EOF
7724 #line 7725 "configure"
7725 #include "confdefs.h"
7726 #include <pthread.h>
7727 #ifdef _POSIX_THREAD_IS_GNU_PTH
7728         __gnu_pth__;
7729 #endif
7730
7731 EOF
7732 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7733   egrep "__gnu_pth__" >/dev/null 2>&1; then
7734   rm -rf conftest*
7735   ol_cv_header_gnu_pth_pthread_h=yes
7736 else
7737   rm -rf conftest*
7738   ol_cv_header_gnu_pth_pthread_h=no
7739 fi
7740 rm -f conftest*
7741
7742                 
7743 fi
7744
7745 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7746
7747
7748                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7749                         for ac_hdr in sched.h
7750 do
7751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7753 echo "configure:7754: checking for $ac_hdr" >&5
7754 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7755   echo $ac_n "(cached) $ac_c" 1>&6
7756 else
7757   cat > conftest.$ac_ext <<EOF
7758 #line 7759 "configure"
7759 #include "confdefs.h"
7760 #include <$ac_hdr>
7761 EOF
7762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7763 { (eval echo configure:7764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7765 if test -z "$ac_err"; then
7766   rm -rf conftest*
7767   eval "ac_cv_header_$ac_safe=yes"
7768 else
7769   echo "$ac_err" >&5
7770   echo "configure: failed program was:" >&5
7771   cat conftest.$ac_ext >&5
7772   rm -rf conftest*
7773   eval "ac_cv_header_$ac_safe=no"
7774 fi
7775 rm -f conftest*
7776 fi
7777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7778   echo "$ac_t""yes" 1>&6
7779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7780   cat >> confdefs.h <<EOF
7781 #define $ac_tr_hdr 1
7782 EOF
7783  
7784 else
7785   echo "$ac_t""no" 1>&6
7786 fi
7787 done
7788
7789                 fi
7790
7791                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7792                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7793 echo "configure:7794: checking for pthread_create in default libraries" >&5
7794 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7795   echo $ac_n "(cached) $ac_c" 1>&6
7796 else
7797   
7798                 if test "$cross_compiling" = yes; then
7799   cat > conftest.$ac_ext <<EOF
7800 #line 7801 "configure"
7801 #include "confdefs.h"
7802 /* pthread test headers */
7803 #include <pthread.h>
7804 #ifndef NULL
7805 #define NULL (void*)0
7806 #endif
7807
7808 static void *task(p)
7809         void *p;
7810 {
7811         return (void *) (p == NULL);
7812 }
7813
7814 int main() {
7815
7816         /* pthread test function */
7817         pthread_t t;
7818         int status;
7819         int detach = 1;
7820
7821 #ifdef HAVE_PTHREADS_FINAL
7822         /* Final pthreads */
7823         pthread_attr_t attr;
7824
7825         status = pthread_attr_init(&attr);
7826         if( status ) return status;
7827
7828 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7829         if( !detach ) {
7830 #if defined( PTHREAD_CREATE_JOINABLE )
7831                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7832 #else
7833                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7834 #endif
7835
7836 #ifdef PTHREAD_CREATE_DETACHED
7837         } else {
7838                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7839 #endif
7840         }
7841         if( status ) return status;
7842 #endif
7843
7844         status = pthread_create( &t, &attr, task, NULL );
7845         if( status ) return status;
7846
7847 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7848         if( detach ) {
7849                 /* give thread a chance to complete */
7850                 /* it should remain joinable and hence detachable */
7851                 sleep( 1 );
7852
7853                 status = pthread_detach( t );
7854                 if( status ) return status;
7855         }
7856 #endif
7857
7858 #else
7859         /* Draft 4 pthreads */
7860         status = pthread_create( &t, pthread_attr_default, task, NULL );
7861         if( status ) return status;
7862
7863         if( detach ) {
7864                 /* give thread a chance to complete */
7865                 /* it should remain joinable and hence detachable */
7866                 sleep( 1 );
7867
7868                 status = pthread_detach( &t );
7869                 if( status ) return status;
7870         }
7871 #endif
7872
7873 #ifdef HAVE_LINUX_THREADS
7874         pthread_kill_other_threads_np();
7875 #endif
7876
7877         return 0;
7878
7879 ; return 0; }
7880 EOF
7881 if { (eval echo configure:7882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7882   rm -rf conftest*
7883   ol_cv_pthread_create=yes
7884 else
7885   echo "configure: failed program was:" >&5
7886   cat conftest.$ac_ext >&5
7887   rm -rf conftest*
7888   ol_cv_pthread_create=no
7889 fi
7890 rm -f conftest*
7891 else
7892   cat > conftest.$ac_ext <<EOF
7893 #line 7894 "configure"
7894 #include "confdefs.h"
7895 /* pthread test headers */
7896 #include <pthread.h>
7897 #ifndef NULL
7898 #define NULL (void*)0
7899 #endif
7900
7901 static void *task(p)
7902         void *p;
7903 {
7904         return (void *) (p == NULL);
7905 }
7906
7907
7908 int main(argc, argv)
7909         int argc;
7910         char **argv;
7911 {
7912
7913         /* pthread test function */
7914         pthread_t t;
7915         int status;
7916         int detach = 1;
7917
7918 #ifdef HAVE_PTHREADS_FINAL
7919         /* Final pthreads */
7920         pthread_attr_t attr;
7921
7922         status = pthread_attr_init(&attr);
7923         if( status ) return status;
7924
7925 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7926         if( !detach ) {
7927 #if defined( PTHREAD_CREATE_JOINABLE )
7928                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7929 #else
7930                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7931 #endif
7932
7933 #ifdef PTHREAD_CREATE_DETACHED
7934         } else {
7935                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7936 #endif
7937         }
7938         if( status ) return status;
7939 #endif
7940
7941         status = pthread_create( &t, &attr, task, NULL );
7942         if( status ) return status;
7943
7944 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7945         if( detach ) {
7946                 /* give thread a chance to complete */
7947                 /* it should remain joinable and hence detachable */
7948                 sleep( 1 );
7949
7950                 status = pthread_detach( t );
7951                 if( status ) return status;
7952         }
7953 #endif
7954
7955 #else
7956         /* Draft 4 pthreads */
7957         status = pthread_create( &t, pthread_attr_default, task, NULL );
7958         if( status ) return status;
7959
7960         if( detach ) {
7961                 /* give thread a chance to complete */
7962                 /* it should remain joinable and hence detachable */
7963                 sleep( 1 );
7964
7965                 status = pthread_detach( &t );
7966                 if( status ) return status;
7967         }
7968 #endif
7969
7970 #ifdef HAVE_LINUX_THREADS
7971         pthread_kill_other_threads_np();
7972 #endif
7973
7974         return 0;
7975
7976 }
7977
7978 EOF
7979 if { (eval echo configure:7980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7980 then
7981   ol_cv_pthread_create=yes
7982 else
7983   echo "configure: failed program was:" >&5
7984   cat conftest.$ac_ext >&5
7985   rm -fr conftest*
7986   ol_cv_pthread_create=no
7987 fi
7988 rm -fr conftest*
7989 fi
7990
7991 fi
7992
7993 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7994
7995                 if test $ol_cv_pthread_create != no ; then
7996                         ol_link_threads=posix
7997                         ol_link_pthreads=""
7998                 fi
7999                 
8000                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
8001 if test "$ol_link_threads" = no ; then
8002         # try -kthread
8003         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
8004 echo "configure:8005: checking for pthread link with -kthread" >&5
8005 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
8006   echo $ac_n "(cached) $ac_c" 1>&6
8007 else
8008   
8009                 # save the flags
8010                 ol_LIBS="$LIBS"
8011                 LIBS="-kthread $LIBS"
8012
8013                 if test "$cross_compiling" = yes; then
8014   cat > conftest.$ac_ext <<EOF
8015 #line 8016 "configure"
8016 #include "confdefs.h"
8017 /* pthread test headers */
8018 #include <pthread.h>
8019 #ifndef NULL
8020 #define NULL (void*)0
8021 #endif
8022
8023 static void *task(p)
8024         void *p;
8025 {
8026         return (void *) (p == NULL);
8027 }
8028
8029 int main() {
8030
8031         /* pthread test function */
8032         pthread_t t;
8033         int status;
8034         int detach = 1;
8035
8036 #ifdef HAVE_PTHREADS_FINAL
8037         /* Final pthreads */
8038         pthread_attr_t attr;
8039
8040         status = pthread_attr_init(&attr);
8041         if( status ) return status;
8042
8043 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8044         if( !detach ) {
8045 #if defined( PTHREAD_CREATE_JOINABLE )
8046                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8047 #else
8048                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8049 #endif
8050
8051 #ifdef PTHREAD_CREATE_DETACHED
8052         } else {
8053                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8054 #endif
8055         }
8056         if( status ) return status;
8057 #endif
8058
8059         status = pthread_create( &t, &attr, task, NULL );
8060         if( status ) return status;
8061
8062 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8063         if( detach ) {
8064                 /* give thread a chance to complete */
8065                 /* it should remain joinable and hence detachable */
8066                 sleep( 1 );
8067
8068                 status = pthread_detach( t );
8069                 if( status ) return status;
8070         }
8071 #endif
8072
8073 #else
8074         /* Draft 4 pthreads */
8075         status = pthread_create( &t, pthread_attr_default, task, NULL );
8076         if( status ) return status;
8077
8078         if( detach ) {
8079                 /* give thread a chance to complete */
8080                 /* it should remain joinable and hence detachable */
8081                 sleep( 1 );
8082
8083                 status = pthread_detach( &t );
8084                 if( status ) return status;
8085         }
8086 #endif
8087
8088 #ifdef HAVE_LINUX_THREADS
8089         pthread_kill_other_threads_np();
8090 #endif
8091
8092         return 0;
8093
8094 ; return 0; }
8095 EOF
8096 if { (eval echo configure:8097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8097   rm -rf conftest*
8098   ol_cv_pthread_kthread=yes
8099 else
8100   echo "configure: failed program was:" >&5
8101   cat conftest.$ac_ext >&5
8102   rm -rf conftest*
8103   ol_cv_pthread_kthread=no
8104 fi
8105 rm -f conftest*
8106 else
8107   cat > conftest.$ac_ext <<EOF
8108 #line 8109 "configure"
8109 #include "confdefs.h"
8110 /* pthread test headers */
8111 #include <pthread.h>
8112 #ifndef NULL
8113 #define NULL (void*)0
8114 #endif
8115
8116 static void *task(p)
8117         void *p;
8118 {
8119         return (void *) (p == NULL);
8120 }
8121
8122
8123 int main(argc, argv)
8124         int argc;
8125         char **argv;
8126 {
8127
8128         /* pthread test function */
8129         pthread_t t;
8130         int status;
8131         int detach = 1;
8132
8133 #ifdef HAVE_PTHREADS_FINAL
8134         /* Final pthreads */
8135         pthread_attr_t attr;
8136
8137         status = pthread_attr_init(&attr);
8138         if( status ) return status;
8139
8140 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8141         if( !detach ) {
8142 #if defined( PTHREAD_CREATE_JOINABLE )
8143                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8144 #else
8145                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8146 #endif
8147
8148 #ifdef PTHREAD_CREATE_DETACHED
8149         } else {
8150                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8151 #endif
8152         }
8153         if( status ) return status;
8154 #endif
8155
8156         status = pthread_create( &t, &attr, task, NULL );
8157         if( status ) return status;
8158
8159 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8160         if( detach ) {
8161                 /* give thread a chance to complete */
8162                 /* it should remain joinable and hence detachable */
8163                 sleep( 1 );
8164
8165                 status = pthread_detach( t );
8166                 if( status ) return status;
8167         }
8168 #endif
8169
8170 #else
8171         /* Draft 4 pthreads */
8172         status = pthread_create( &t, pthread_attr_default, task, NULL );
8173         if( status ) return status;
8174
8175         if( detach ) {
8176                 /* give thread a chance to complete */
8177                 /* it should remain joinable and hence detachable */
8178                 sleep( 1 );
8179
8180                 status = pthread_detach( &t );
8181                 if( status ) return status;
8182         }
8183 #endif
8184
8185 #ifdef HAVE_LINUX_THREADS
8186         pthread_kill_other_threads_np();
8187 #endif
8188
8189         return 0;
8190
8191 }
8192
8193 EOF
8194 if { (eval echo configure:8195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8195 then
8196   ol_cv_pthread_kthread=yes
8197 else
8198   echo "configure: failed program was:" >&5
8199   cat conftest.$ac_ext >&5
8200   rm -fr conftest*
8201   ol_cv_pthread_kthread=no
8202 fi
8203 rm -fr conftest*
8204 fi
8205
8206
8207                 # restore the LIBS
8208                 LIBS="$ol_LIBS"
8209         
8210 fi
8211
8212 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8213
8214         if test $ol_cv_pthread_kthread = yes ; then
8215                 ol_link_pthreads="-kthread"
8216                 ol_link_threads=posix
8217         fi
8218 fi
8219
8220                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8221 if test "$ol_link_threads" = no ; then
8222         # try -pthread
8223         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8224 echo "configure:8225: checking for pthread link with -pthread" >&5
8225 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8226   echo $ac_n "(cached) $ac_c" 1>&6
8227 else
8228   
8229                 # save the flags
8230                 ol_LIBS="$LIBS"
8231                 LIBS="-pthread $LIBS"
8232
8233                 if test "$cross_compiling" = yes; then
8234   cat > conftest.$ac_ext <<EOF
8235 #line 8236 "configure"
8236 #include "confdefs.h"
8237 /* pthread test headers */
8238 #include <pthread.h>
8239 #ifndef NULL
8240 #define NULL (void*)0
8241 #endif
8242
8243 static void *task(p)
8244         void *p;
8245 {
8246         return (void *) (p == NULL);
8247 }
8248
8249 int main() {
8250
8251         /* pthread test function */
8252         pthread_t t;
8253         int status;
8254         int detach = 1;
8255
8256 #ifdef HAVE_PTHREADS_FINAL
8257         /* Final pthreads */
8258         pthread_attr_t attr;
8259
8260         status = pthread_attr_init(&attr);
8261         if( status ) return status;
8262
8263 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8264         if( !detach ) {
8265 #if defined( PTHREAD_CREATE_JOINABLE )
8266                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8267 #else
8268                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8269 #endif
8270
8271 #ifdef PTHREAD_CREATE_DETACHED
8272         } else {
8273                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8274 #endif
8275         }
8276         if( status ) return status;
8277 #endif
8278
8279         status = pthread_create( &t, &attr, task, NULL );
8280         if( status ) return status;
8281
8282 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8283         if( detach ) {
8284                 /* give thread a chance to complete */
8285                 /* it should remain joinable and hence detachable */
8286                 sleep( 1 );
8287
8288                 status = pthread_detach( t );
8289                 if( status ) return status;
8290         }
8291 #endif
8292
8293 #else
8294         /* Draft 4 pthreads */
8295         status = pthread_create( &t, pthread_attr_default, task, NULL );
8296         if( status ) return status;
8297
8298         if( detach ) {
8299                 /* give thread a chance to complete */
8300                 /* it should remain joinable and hence detachable */
8301                 sleep( 1 );
8302
8303                 status = pthread_detach( &t );
8304                 if( status ) return status;
8305         }
8306 #endif
8307
8308 #ifdef HAVE_LINUX_THREADS
8309         pthread_kill_other_threads_np();
8310 #endif
8311
8312         return 0;
8313
8314 ; return 0; }
8315 EOF
8316 if { (eval echo configure:8317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8317   rm -rf conftest*
8318   ol_cv_pthread_pthread=yes
8319 else
8320   echo "configure: failed program was:" >&5
8321   cat conftest.$ac_ext >&5
8322   rm -rf conftest*
8323   ol_cv_pthread_pthread=no
8324 fi
8325 rm -f conftest*
8326 else
8327   cat > conftest.$ac_ext <<EOF
8328 #line 8329 "configure"
8329 #include "confdefs.h"
8330 /* pthread test headers */
8331 #include <pthread.h>
8332 #ifndef NULL
8333 #define NULL (void*)0
8334 #endif
8335
8336 static void *task(p)
8337         void *p;
8338 {
8339         return (void *) (p == NULL);
8340 }
8341
8342
8343 int main(argc, argv)
8344         int argc;
8345         char **argv;
8346 {
8347
8348         /* pthread test function */
8349         pthread_t t;
8350         int status;
8351         int detach = 1;
8352
8353 #ifdef HAVE_PTHREADS_FINAL
8354         /* Final pthreads */
8355         pthread_attr_t attr;
8356
8357         status = pthread_attr_init(&attr);
8358         if( status ) return status;
8359
8360 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8361         if( !detach ) {
8362 #if defined( PTHREAD_CREATE_JOINABLE )
8363                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8364 #else
8365                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8366 #endif
8367
8368 #ifdef PTHREAD_CREATE_DETACHED
8369         } else {
8370                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8371 #endif
8372         }
8373         if( status ) return status;
8374 #endif
8375
8376         status = pthread_create( &t, &attr, task, NULL );
8377         if( status ) return status;
8378
8379 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8380         if( detach ) {
8381                 /* give thread a chance to complete */
8382                 /* it should remain joinable and hence detachable */
8383                 sleep( 1 );
8384
8385                 status = pthread_detach( t );
8386                 if( status ) return status;
8387         }
8388 #endif
8389
8390 #else
8391         /* Draft 4 pthreads */
8392         status = pthread_create( &t, pthread_attr_default, task, NULL );
8393         if( status ) return status;
8394
8395         if( detach ) {
8396                 /* give thread a chance to complete */
8397                 /* it should remain joinable and hence detachable */
8398                 sleep( 1 );
8399
8400                 status = pthread_detach( &t );
8401                 if( status ) return status;
8402         }
8403 #endif
8404
8405 #ifdef HAVE_LINUX_THREADS
8406         pthread_kill_other_threads_np();
8407 #endif
8408
8409         return 0;
8410
8411 }
8412
8413 EOF
8414 if { (eval echo configure:8415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8415 then
8416   ol_cv_pthread_pthread=yes
8417 else
8418   echo "configure: failed program was:" >&5
8419   cat conftest.$ac_ext >&5
8420   rm -fr conftest*
8421   ol_cv_pthread_pthread=no
8422 fi
8423 rm -fr conftest*
8424 fi
8425
8426
8427                 # restore the LIBS
8428                 LIBS="$ol_LIBS"
8429         
8430 fi
8431
8432 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8433
8434         if test $ol_cv_pthread_pthread = yes ; then
8435                 ol_link_pthreads="-pthread"
8436                 ol_link_threads=posix
8437         fi
8438 fi
8439
8440                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8441 if test "$ol_link_threads" = no ; then
8442         # try -pthreads
8443         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8444 echo "configure:8445: checking for pthread link with -pthreads" >&5
8445 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8446   echo $ac_n "(cached) $ac_c" 1>&6
8447 else
8448   
8449                 # save the flags
8450                 ol_LIBS="$LIBS"
8451                 LIBS="-pthreads $LIBS"
8452
8453                 if test "$cross_compiling" = yes; then
8454   cat > conftest.$ac_ext <<EOF
8455 #line 8456 "configure"
8456 #include "confdefs.h"
8457 /* pthread test headers */
8458 #include <pthread.h>
8459 #ifndef NULL
8460 #define NULL (void*)0
8461 #endif
8462
8463 static void *task(p)
8464         void *p;
8465 {
8466         return (void *) (p == NULL);
8467 }
8468
8469 int main() {
8470
8471         /* pthread test function */
8472         pthread_t t;
8473         int status;
8474         int detach = 1;
8475
8476 #ifdef HAVE_PTHREADS_FINAL
8477         /* Final pthreads */
8478         pthread_attr_t attr;
8479
8480         status = pthread_attr_init(&attr);
8481         if( status ) return status;
8482
8483 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8484         if( !detach ) {
8485 #if defined( PTHREAD_CREATE_JOINABLE )
8486                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8487 #else
8488                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8489 #endif
8490
8491 #ifdef PTHREAD_CREATE_DETACHED
8492         } else {
8493                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8494 #endif
8495         }
8496         if( status ) return status;
8497 #endif
8498
8499         status = pthread_create( &t, &attr, task, NULL );
8500         if( status ) return status;
8501
8502 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8503         if( detach ) {
8504                 /* give thread a chance to complete */
8505                 /* it should remain joinable and hence detachable */
8506                 sleep( 1 );
8507
8508                 status = pthread_detach( t );
8509                 if( status ) return status;
8510         }
8511 #endif
8512
8513 #else
8514         /* Draft 4 pthreads */
8515         status = pthread_create( &t, pthread_attr_default, task, NULL );
8516         if( status ) return status;
8517
8518         if( detach ) {
8519                 /* give thread a chance to complete */
8520                 /* it should remain joinable and hence detachable */
8521                 sleep( 1 );
8522
8523                 status = pthread_detach( &t );
8524                 if( status ) return status;
8525         }
8526 #endif
8527
8528 #ifdef HAVE_LINUX_THREADS
8529         pthread_kill_other_threads_np();
8530 #endif
8531
8532         return 0;
8533
8534 ; return 0; }
8535 EOF
8536 if { (eval echo configure:8537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8537   rm -rf conftest*
8538   ol_cv_pthread_pthreads=yes
8539 else
8540   echo "configure: failed program was:" >&5
8541   cat conftest.$ac_ext >&5
8542   rm -rf conftest*
8543   ol_cv_pthread_pthreads=no
8544 fi
8545 rm -f conftest*
8546 else
8547   cat > conftest.$ac_ext <<EOF
8548 #line 8549 "configure"
8549 #include "confdefs.h"
8550 /* pthread test headers */
8551 #include <pthread.h>
8552 #ifndef NULL
8553 #define NULL (void*)0
8554 #endif
8555
8556 static void *task(p)
8557         void *p;
8558 {
8559         return (void *) (p == NULL);
8560 }
8561
8562
8563 int main(argc, argv)
8564         int argc;
8565         char **argv;
8566 {
8567
8568         /* pthread test function */
8569         pthread_t t;
8570         int status;
8571         int detach = 1;
8572
8573 #ifdef HAVE_PTHREADS_FINAL
8574         /* Final pthreads */
8575         pthread_attr_t attr;
8576
8577         status = pthread_attr_init(&attr);
8578         if( status ) return status;
8579
8580 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8581         if( !detach ) {
8582 #if defined( PTHREAD_CREATE_JOINABLE )
8583                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8584 #else
8585                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8586 #endif
8587
8588 #ifdef PTHREAD_CREATE_DETACHED
8589         } else {
8590                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8591 #endif
8592         }
8593         if( status ) return status;
8594 #endif
8595
8596         status = pthread_create( &t, &attr, task, NULL );
8597         if( status ) return status;
8598
8599 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8600         if( detach ) {
8601                 /* give thread a chance to complete */
8602                 /* it should remain joinable and hence detachable */
8603                 sleep( 1 );
8604
8605                 status = pthread_detach( t );
8606                 if( status ) return status;
8607         }
8608 #endif
8609
8610 #else
8611         /* Draft 4 pthreads */
8612         status = pthread_create( &t, pthread_attr_default, task, NULL );
8613         if( status ) return status;
8614
8615         if( detach ) {
8616                 /* give thread a chance to complete */
8617                 /* it should remain joinable and hence detachable */
8618                 sleep( 1 );
8619
8620                 status = pthread_detach( &t );
8621                 if( status ) return status;
8622         }
8623 #endif
8624
8625 #ifdef HAVE_LINUX_THREADS
8626         pthread_kill_other_threads_np();
8627 #endif
8628
8629         return 0;
8630
8631 }
8632
8633 EOF
8634 if { (eval echo configure:8635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8635 then
8636   ol_cv_pthread_pthreads=yes
8637 else
8638   echo "configure: failed program was:" >&5
8639   cat conftest.$ac_ext >&5
8640   rm -fr conftest*
8641   ol_cv_pthread_pthreads=no
8642 fi
8643 rm -fr conftest*
8644 fi
8645
8646
8647                 # restore the LIBS
8648                 LIBS="$ol_LIBS"
8649         
8650 fi
8651
8652 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8653
8654         if test $ol_cv_pthread_pthreads = yes ; then
8655                 ol_link_pthreads="-pthreads"
8656                 ol_link_threads=posix
8657         fi
8658 fi
8659
8660                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8661 if test "$ol_link_threads" = no ; then
8662         # try -mthreads
8663         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8664 echo "configure:8665: checking for pthread link with -mthreads" >&5
8665 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8666   echo $ac_n "(cached) $ac_c" 1>&6
8667 else
8668   
8669                 # save the flags
8670                 ol_LIBS="$LIBS"
8671                 LIBS="-mthreads $LIBS"
8672
8673                 if test "$cross_compiling" = yes; then
8674   cat > conftest.$ac_ext <<EOF
8675 #line 8676 "configure"
8676 #include "confdefs.h"
8677 /* pthread test headers */
8678 #include <pthread.h>
8679 #ifndef NULL
8680 #define NULL (void*)0
8681 #endif
8682
8683 static void *task(p)
8684         void *p;
8685 {
8686         return (void *) (p == NULL);
8687 }
8688
8689 int main() {
8690
8691         /* pthread test function */
8692         pthread_t t;
8693         int status;
8694         int detach = 1;
8695
8696 #ifdef HAVE_PTHREADS_FINAL
8697         /* Final pthreads */
8698         pthread_attr_t attr;
8699
8700         status = pthread_attr_init(&attr);
8701         if( status ) return status;
8702
8703 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8704         if( !detach ) {
8705 #if defined( PTHREAD_CREATE_JOINABLE )
8706                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8707 #else
8708                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8709 #endif
8710
8711 #ifdef PTHREAD_CREATE_DETACHED
8712         } else {
8713                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8714 #endif
8715         }
8716         if( status ) return status;
8717 #endif
8718
8719         status = pthread_create( &t, &attr, task, NULL );
8720         if( status ) return status;
8721
8722 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8723         if( detach ) {
8724                 /* give thread a chance to complete */
8725                 /* it should remain joinable and hence detachable */
8726                 sleep( 1 );
8727
8728                 status = pthread_detach( t );
8729                 if( status ) return status;
8730         }
8731 #endif
8732
8733 #else
8734         /* Draft 4 pthreads */
8735         status = pthread_create( &t, pthread_attr_default, task, NULL );
8736         if( status ) return status;
8737
8738         if( detach ) {
8739                 /* give thread a chance to complete */
8740                 /* it should remain joinable and hence detachable */
8741                 sleep( 1 );
8742
8743                 status = pthread_detach( &t );
8744                 if( status ) return status;
8745         }
8746 #endif
8747
8748 #ifdef HAVE_LINUX_THREADS
8749         pthread_kill_other_threads_np();
8750 #endif
8751
8752         return 0;
8753
8754 ; return 0; }
8755 EOF
8756 if { (eval echo configure:8757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8757   rm -rf conftest*
8758   ol_cv_pthread_mthreads=yes
8759 else
8760   echo "configure: failed program was:" >&5
8761   cat conftest.$ac_ext >&5
8762   rm -rf conftest*
8763   ol_cv_pthread_mthreads=no
8764 fi
8765 rm -f conftest*
8766 else
8767   cat > conftest.$ac_ext <<EOF
8768 #line 8769 "configure"
8769 #include "confdefs.h"
8770 /* pthread test headers */
8771 #include <pthread.h>
8772 #ifndef NULL
8773 #define NULL (void*)0
8774 #endif
8775
8776 static void *task(p)
8777         void *p;
8778 {
8779         return (void *) (p == NULL);
8780 }
8781
8782
8783 int main(argc, argv)
8784         int argc;
8785         char **argv;
8786 {
8787
8788         /* pthread test function */
8789         pthread_t t;
8790         int status;
8791         int detach = 1;
8792
8793 #ifdef HAVE_PTHREADS_FINAL
8794         /* Final pthreads */
8795         pthread_attr_t attr;
8796
8797         status = pthread_attr_init(&attr);
8798         if( status ) return status;
8799
8800 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8801         if( !detach ) {
8802 #if defined( PTHREAD_CREATE_JOINABLE )
8803                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8804 #else
8805                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8806 #endif
8807
8808 #ifdef PTHREAD_CREATE_DETACHED
8809         } else {
8810                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8811 #endif
8812         }
8813         if( status ) return status;
8814 #endif
8815
8816         status = pthread_create( &t, &attr, task, NULL );
8817         if( status ) return status;
8818
8819 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8820         if( detach ) {
8821                 /* give thread a chance to complete */
8822                 /* it should remain joinable and hence detachable */
8823                 sleep( 1 );
8824
8825                 status = pthread_detach( t );
8826                 if( status ) return status;
8827         }
8828 #endif
8829
8830 #else
8831         /* Draft 4 pthreads */
8832         status = pthread_create( &t, pthread_attr_default, task, NULL );
8833         if( status ) return status;
8834
8835         if( detach ) {
8836                 /* give thread a chance to complete */
8837                 /* it should remain joinable and hence detachable */
8838                 sleep( 1 );
8839
8840                 status = pthread_detach( &t );
8841                 if( status ) return status;
8842         }
8843 #endif
8844
8845 #ifdef HAVE_LINUX_THREADS
8846         pthread_kill_other_threads_np();
8847 #endif
8848
8849         return 0;
8850
8851 }
8852
8853 EOF
8854 if { (eval echo configure:8855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8855 then
8856   ol_cv_pthread_mthreads=yes
8857 else
8858   echo "configure: failed program was:" >&5
8859   cat conftest.$ac_ext >&5
8860   rm -fr conftest*
8861   ol_cv_pthread_mthreads=no
8862 fi
8863 rm -fr conftest*
8864 fi
8865
8866
8867                 # restore the LIBS
8868                 LIBS="$ol_LIBS"
8869         
8870 fi
8871
8872 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8873
8874         if test $ol_cv_pthread_mthreads = yes ; then
8875                 ol_link_pthreads="-mthreads"
8876                 ol_link_threads=posix
8877         fi
8878 fi
8879
8880                 # Pthread try link: -thread (ol_cv_pthread_thread)
8881 if test "$ol_link_threads" = no ; then
8882         # try -thread
8883         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8884 echo "configure:8885: checking for pthread link with -thread" >&5
8885 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8886   echo $ac_n "(cached) $ac_c" 1>&6
8887 else
8888   
8889                 # save the flags
8890                 ol_LIBS="$LIBS"
8891                 LIBS="-thread $LIBS"
8892
8893                 if test "$cross_compiling" = yes; then
8894   cat > conftest.$ac_ext <<EOF
8895 #line 8896 "configure"
8896 #include "confdefs.h"
8897 /* pthread test headers */
8898 #include <pthread.h>
8899 #ifndef NULL
8900 #define NULL (void*)0
8901 #endif
8902
8903 static void *task(p)
8904         void *p;
8905 {
8906         return (void *) (p == NULL);
8907 }
8908
8909 int main() {
8910
8911         /* pthread test function */
8912         pthread_t t;
8913         int status;
8914         int detach = 1;
8915
8916 #ifdef HAVE_PTHREADS_FINAL
8917         /* Final pthreads */
8918         pthread_attr_t attr;
8919
8920         status = pthread_attr_init(&attr);
8921         if( status ) return status;
8922
8923 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8924         if( !detach ) {
8925 #if defined( PTHREAD_CREATE_JOINABLE )
8926                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8927 #else
8928                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8929 #endif
8930
8931 #ifdef PTHREAD_CREATE_DETACHED
8932         } else {
8933                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8934 #endif
8935         }
8936         if( status ) return status;
8937 #endif
8938
8939         status = pthread_create( &t, &attr, task, NULL );
8940         if( status ) return status;
8941
8942 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8943         if( detach ) {
8944                 /* give thread a chance to complete */
8945                 /* it should remain joinable and hence detachable */
8946                 sleep( 1 );
8947
8948                 status = pthread_detach( t );
8949                 if( status ) return status;
8950         }
8951 #endif
8952
8953 #else
8954         /* Draft 4 pthreads */
8955         status = pthread_create( &t, pthread_attr_default, task, NULL );
8956         if( status ) return status;
8957
8958         if( detach ) {
8959                 /* give thread a chance to complete */
8960                 /* it should remain joinable and hence detachable */
8961                 sleep( 1 );
8962
8963                 status = pthread_detach( &t );
8964                 if( status ) return status;
8965         }
8966 #endif
8967
8968 #ifdef HAVE_LINUX_THREADS
8969         pthread_kill_other_threads_np();
8970 #endif
8971
8972         return 0;
8973
8974 ; return 0; }
8975 EOF
8976 if { (eval echo configure:8977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8977   rm -rf conftest*
8978   ol_cv_pthread_thread=yes
8979 else
8980   echo "configure: failed program was:" >&5
8981   cat conftest.$ac_ext >&5
8982   rm -rf conftest*
8983   ol_cv_pthread_thread=no
8984 fi
8985 rm -f conftest*
8986 else
8987   cat > conftest.$ac_ext <<EOF
8988 #line 8989 "configure"
8989 #include "confdefs.h"
8990 /* pthread test headers */
8991 #include <pthread.h>
8992 #ifndef NULL
8993 #define NULL (void*)0
8994 #endif
8995
8996 static void *task(p)
8997         void *p;
8998 {
8999         return (void *) (p == NULL);
9000 }
9001
9002
9003 int main(argc, argv)
9004         int argc;
9005         char **argv;
9006 {
9007
9008         /* pthread test function */
9009         pthread_t t;
9010         int status;
9011         int detach = 1;
9012
9013 #ifdef HAVE_PTHREADS_FINAL
9014         /* Final pthreads */
9015         pthread_attr_t attr;
9016
9017         status = pthread_attr_init(&attr);
9018         if( status ) return status;
9019
9020 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9021         if( !detach ) {
9022 #if defined( PTHREAD_CREATE_JOINABLE )
9023                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9024 #else
9025                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9026 #endif
9027
9028 #ifdef PTHREAD_CREATE_DETACHED
9029         } else {
9030                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9031 #endif
9032         }
9033         if( status ) return status;
9034 #endif
9035
9036         status = pthread_create( &t, &attr, task, NULL );
9037         if( status ) return status;
9038
9039 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9040         if( detach ) {
9041                 /* give thread a chance to complete */
9042                 /* it should remain joinable and hence detachable */
9043                 sleep( 1 );
9044
9045                 status = pthread_detach( t );
9046                 if( status ) return status;
9047         }
9048 #endif
9049
9050 #else
9051         /* Draft 4 pthreads */
9052         status = pthread_create( &t, pthread_attr_default, task, NULL );
9053         if( status ) return status;
9054
9055         if( detach ) {
9056                 /* give thread a chance to complete */
9057                 /* it should remain joinable and hence detachable */
9058                 sleep( 1 );
9059
9060                 status = pthread_detach( &t );
9061                 if( status ) return status;
9062         }
9063 #endif
9064
9065 #ifdef HAVE_LINUX_THREADS
9066         pthread_kill_other_threads_np();
9067 #endif
9068
9069         return 0;
9070
9071 }
9072
9073 EOF
9074 if { (eval echo configure:9075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9075 then
9076   ol_cv_pthread_thread=yes
9077 else
9078   echo "configure: failed program was:" >&5
9079   cat conftest.$ac_ext >&5
9080   rm -fr conftest*
9081   ol_cv_pthread_thread=no
9082 fi
9083 rm -fr conftest*
9084 fi
9085
9086
9087                 # restore the LIBS
9088                 LIBS="$ol_LIBS"
9089         
9090 fi
9091
9092 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9093
9094         if test $ol_cv_pthread_thread = yes ; then
9095                 ol_link_pthreads="-thread"
9096                 ol_link_threads=posix
9097         fi
9098 fi
9099
9100
9101                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9102 if test "$ol_link_threads" = no ; then
9103         # try -lpthread -lmach -lexc -lc_r
9104         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9105 echo "configure:9106: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9106 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9107   echo $ac_n "(cached) $ac_c" 1>&6
9108 else
9109   
9110                 # save the flags
9111                 ol_LIBS="$LIBS"
9112                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9113
9114                 if test "$cross_compiling" = yes; then
9115   cat > conftest.$ac_ext <<EOF
9116 #line 9117 "configure"
9117 #include "confdefs.h"
9118 /* pthread test headers */
9119 #include <pthread.h>
9120 #ifndef NULL
9121 #define NULL (void*)0
9122 #endif
9123
9124 static void *task(p)
9125         void *p;
9126 {
9127         return (void *) (p == NULL);
9128 }
9129
9130 int main() {
9131
9132         /* pthread test function */
9133         pthread_t t;
9134         int status;
9135         int detach = 1;
9136
9137 #ifdef HAVE_PTHREADS_FINAL
9138         /* Final pthreads */
9139         pthread_attr_t attr;
9140
9141         status = pthread_attr_init(&attr);
9142         if( status ) return status;
9143
9144 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9145         if( !detach ) {
9146 #if defined( PTHREAD_CREATE_JOINABLE )
9147                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9148 #else
9149                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9150 #endif
9151
9152 #ifdef PTHREAD_CREATE_DETACHED
9153         } else {
9154                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9155 #endif
9156         }
9157         if( status ) return status;
9158 #endif
9159
9160         status = pthread_create( &t, &attr, task, NULL );
9161         if( status ) return status;
9162
9163 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9164         if( detach ) {
9165                 /* give thread a chance to complete */
9166                 /* it should remain joinable and hence detachable */
9167                 sleep( 1 );
9168
9169                 status = pthread_detach( t );
9170                 if( status ) return status;
9171         }
9172 #endif
9173
9174 #else
9175         /* Draft 4 pthreads */
9176         status = pthread_create( &t, pthread_attr_default, task, NULL );
9177         if( status ) return status;
9178
9179         if( detach ) {
9180                 /* give thread a chance to complete */
9181                 /* it should remain joinable and hence detachable */
9182                 sleep( 1 );
9183
9184                 status = pthread_detach( &t );
9185                 if( status ) return status;
9186         }
9187 #endif
9188
9189 #ifdef HAVE_LINUX_THREADS
9190         pthread_kill_other_threads_np();
9191 #endif
9192
9193         return 0;
9194
9195 ; return 0; }
9196 EOF
9197 if { (eval echo configure:9198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9198   rm -rf conftest*
9199   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9200 else
9201   echo "configure: failed program was:" >&5
9202   cat conftest.$ac_ext >&5
9203   rm -rf conftest*
9204   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9205 fi
9206 rm -f conftest*
9207 else
9208   cat > conftest.$ac_ext <<EOF
9209 #line 9210 "configure"
9210 #include "confdefs.h"
9211 /* pthread test headers */
9212 #include <pthread.h>
9213 #ifndef NULL
9214 #define NULL (void*)0
9215 #endif
9216
9217 static void *task(p)
9218         void *p;
9219 {
9220         return (void *) (p == NULL);
9221 }
9222
9223
9224 int main(argc, argv)
9225         int argc;
9226         char **argv;
9227 {
9228
9229         /* pthread test function */
9230         pthread_t t;
9231         int status;
9232         int detach = 1;
9233
9234 #ifdef HAVE_PTHREADS_FINAL
9235         /* Final pthreads */
9236         pthread_attr_t attr;
9237
9238         status = pthread_attr_init(&attr);
9239         if( status ) return status;
9240
9241 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9242         if( !detach ) {
9243 #if defined( PTHREAD_CREATE_JOINABLE )
9244                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9245 #else
9246                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9247 #endif
9248
9249 #ifdef PTHREAD_CREATE_DETACHED
9250         } else {
9251                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9252 #endif
9253         }
9254         if( status ) return status;
9255 #endif
9256
9257         status = pthread_create( &t, &attr, task, NULL );
9258         if( status ) return status;
9259
9260 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9261         if( detach ) {
9262                 /* give thread a chance to complete */
9263                 /* it should remain joinable and hence detachable */
9264                 sleep( 1 );
9265
9266                 status = pthread_detach( t );
9267                 if( status ) return status;
9268         }
9269 #endif
9270
9271 #else
9272         /* Draft 4 pthreads */
9273         status = pthread_create( &t, pthread_attr_default, task, NULL );
9274         if( status ) return status;
9275
9276         if( detach ) {
9277                 /* give thread a chance to complete */
9278                 /* it should remain joinable and hence detachable */
9279                 sleep( 1 );
9280
9281                 status = pthread_detach( &t );
9282                 if( status ) return status;
9283         }
9284 #endif
9285
9286 #ifdef HAVE_LINUX_THREADS
9287         pthread_kill_other_threads_np();
9288 #endif
9289
9290         return 0;
9291
9292 }
9293
9294 EOF
9295 if { (eval echo configure:9296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9296 then
9297   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9298 else
9299   echo "configure: failed program was:" >&5
9300   cat conftest.$ac_ext >&5
9301   rm -fr conftest*
9302   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9303 fi
9304 rm -fr conftest*
9305 fi
9306
9307
9308                 # restore the LIBS
9309                 LIBS="$ol_LIBS"
9310         
9311 fi
9312
9313 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9314
9315         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9316                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9317                 ol_link_threads=posix
9318         fi
9319 fi
9320
9321                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9322 if test "$ol_link_threads" = no ; then
9323         # try -lpthread -lmach -lexc
9324         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9325 echo "configure:9326: checking for pthread link with -lpthread -lmach -lexc" >&5
9326 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9327   echo $ac_n "(cached) $ac_c" 1>&6
9328 else
9329   
9330                 # save the flags
9331                 ol_LIBS="$LIBS"
9332                 LIBS="-lpthread -lmach -lexc $LIBS"
9333
9334                 if test "$cross_compiling" = yes; then
9335   cat > conftest.$ac_ext <<EOF
9336 #line 9337 "configure"
9337 #include "confdefs.h"
9338 /* pthread test headers */
9339 #include <pthread.h>
9340 #ifndef NULL
9341 #define NULL (void*)0
9342 #endif
9343
9344 static void *task(p)
9345         void *p;
9346 {
9347         return (void *) (p == NULL);
9348 }
9349
9350 int main() {
9351
9352         /* pthread test function */
9353         pthread_t t;
9354         int status;
9355         int detach = 1;
9356
9357 #ifdef HAVE_PTHREADS_FINAL
9358         /* Final pthreads */
9359         pthread_attr_t attr;
9360
9361         status = pthread_attr_init(&attr);
9362         if( status ) return status;
9363
9364 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9365         if( !detach ) {
9366 #if defined( PTHREAD_CREATE_JOINABLE )
9367                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9368 #else
9369                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9370 #endif
9371
9372 #ifdef PTHREAD_CREATE_DETACHED
9373         } else {
9374                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9375 #endif
9376         }
9377         if( status ) return status;
9378 #endif
9379
9380         status = pthread_create( &t, &attr, task, NULL );
9381         if( status ) return status;
9382
9383 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9384         if( detach ) {
9385                 /* give thread a chance to complete */
9386                 /* it should remain joinable and hence detachable */
9387                 sleep( 1 );
9388
9389                 status = pthread_detach( t );
9390                 if( status ) return status;
9391         }
9392 #endif
9393
9394 #else
9395         /* Draft 4 pthreads */
9396         status = pthread_create( &t, pthread_attr_default, task, NULL );
9397         if( status ) return status;
9398
9399         if( detach ) {
9400                 /* give thread a chance to complete */
9401                 /* it should remain joinable and hence detachable */
9402                 sleep( 1 );
9403
9404                 status = pthread_detach( &t );
9405                 if( status ) return status;
9406         }
9407 #endif
9408
9409 #ifdef HAVE_LINUX_THREADS
9410         pthread_kill_other_threads_np();
9411 #endif
9412
9413         return 0;
9414
9415 ; return 0; }
9416 EOF
9417 if { (eval echo configure:9418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9418   rm -rf conftest*
9419   ol_cv_pthread_lpthread_lmach_lexc=yes
9420 else
9421   echo "configure: failed program was:" >&5
9422   cat conftest.$ac_ext >&5
9423   rm -rf conftest*
9424   ol_cv_pthread_lpthread_lmach_lexc=no
9425 fi
9426 rm -f conftest*
9427 else
9428   cat > conftest.$ac_ext <<EOF
9429 #line 9430 "configure"
9430 #include "confdefs.h"
9431 /* pthread test headers */
9432 #include <pthread.h>
9433 #ifndef NULL
9434 #define NULL (void*)0
9435 #endif
9436
9437 static void *task(p)
9438         void *p;
9439 {
9440         return (void *) (p == NULL);
9441 }
9442
9443
9444 int main(argc, argv)
9445         int argc;
9446         char **argv;
9447 {
9448
9449         /* pthread test function */
9450         pthread_t t;
9451         int status;
9452         int detach = 1;
9453
9454 #ifdef HAVE_PTHREADS_FINAL
9455         /* Final pthreads */
9456         pthread_attr_t attr;
9457
9458         status = pthread_attr_init(&attr);
9459         if( status ) return status;
9460
9461 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9462         if( !detach ) {
9463 #if defined( PTHREAD_CREATE_JOINABLE )
9464                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9465 #else
9466                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9467 #endif
9468
9469 #ifdef PTHREAD_CREATE_DETACHED
9470         } else {
9471                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9472 #endif
9473         }
9474         if( status ) return status;
9475 #endif
9476
9477         status = pthread_create( &t, &attr, task, NULL );
9478         if( status ) return status;
9479
9480 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9481         if( detach ) {
9482                 /* give thread a chance to complete */
9483                 /* it should remain joinable and hence detachable */
9484                 sleep( 1 );
9485
9486                 status = pthread_detach( t );
9487                 if( status ) return status;
9488         }
9489 #endif
9490
9491 #else
9492         /* Draft 4 pthreads */
9493         status = pthread_create( &t, pthread_attr_default, task, NULL );
9494         if( status ) return status;
9495
9496         if( detach ) {
9497                 /* give thread a chance to complete */
9498                 /* it should remain joinable and hence detachable */
9499                 sleep( 1 );
9500
9501                 status = pthread_detach( &t );
9502                 if( status ) return status;
9503         }
9504 #endif
9505
9506 #ifdef HAVE_LINUX_THREADS
9507         pthread_kill_other_threads_np();
9508 #endif
9509
9510         return 0;
9511
9512 }
9513
9514 EOF
9515 if { (eval echo configure:9516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9516 then
9517   ol_cv_pthread_lpthread_lmach_lexc=yes
9518 else
9519   echo "configure: failed program was:" >&5
9520   cat conftest.$ac_ext >&5
9521   rm -fr conftest*
9522   ol_cv_pthread_lpthread_lmach_lexc=no
9523 fi
9524 rm -fr conftest*
9525 fi
9526
9527
9528                 # restore the LIBS
9529                 LIBS="$ol_LIBS"
9530         
9531 fi
9532
9533 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9534
9535         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9536                 ol_link_pthreads="-lpthread -lmach -lexc"
9537                 ol_link_threads=posix
9538         fi
9539 fi
9540
9541
9542                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9543 if test "$ol_link_threads" = no ; then
9544         # try -lpthread -Wl,-woff,85
9545         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9546 echo "configure:9547: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9547 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9548   echo $ac_n "(cached) $ac_c" 1>&6
9549 else
9550   
9551                 # save the flags
9552                 ol_LIBS="$LIBS"
9553                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9554
9555                 if test "$cross_compiling" = yes; then
9556   cat > conftest.$ac_ext <<EOF
9557 #line 9558 "configure"
9558 #include "confdefs.h"
9559 /* pthread test headers */
9560 #include <pthread.h>
9561 #ifndef NULL
9562 #define NULL (void*)0
9563 #endif
9564
9565 static void *task(p)
9566         void *p;
9567 {
9568         return (void *) (p == NULL);
9569 }
9570
9571 int main() {
9572
9573         /* pthread test function */
9574         pthread_t t;
9575         int status;
9576         int detach = 1;
9577
9578 #ifdef HAVE_PTHREADS_FINAL
9579         /* Final pthreads */
9580         pthread_attr_t attr;
9581
9582         status = pthread_attr_init(&attr);
9583         if( status ) return status;
9584
9585 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9586         if( !detach ) {
9587 #if defined( PTHREAD_CREATE_JOINABLE )
9588                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9589 #else
9590                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9591 #endif
9592
9593 #ifdef PTHREAD_CREATE_DETACHED
9594         } else {
9595                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9596 #endif
9597         }
9598         if( status ) return status;
9599 #endif
9600
9601         status = pthread_create( &t, &attr, task, NULL );
9602         if( status ) return status;
9603
9604 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9605         if( detach ) {
9606                 /* give thread a chance to complete */
9607                 /* it should remain joinable and hence detachable */
9608                 sleep( 1 );
9609
9610                 status = pthread_detach( t );
9611                 if( status ) return status;
9612         }
9613 #endif
9614
9615 #else
9616         /* Draft 4 pthreads */
9617         status = pthread_create( &t, pthread_attr_default, task, NULL );
9618         if( status ) return status;
9619
9620         if( detach ) {
9621                 /* give thread a chance to complete */
9622                 /* it should remain joinable and hence detachable */
9623                 sleep( 1 );
9624
9625                 status = pthread_detach( &t );
9626                 if( status ) return status;
9627         }
9628 #endif
9629
9630 #ifdef HAVE_LINUX_THREADS
9631         pthread_kill_other_threads_np();
9632 #endif
9633
9634         return 0;
9635
9636 ; return 0; }
9637 EOF
9638 if { (eval echo configure:9639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9639   rm -rf conftest*
9640   ol_cv_pthread_lib_lpthread_woff=yes
9641 else
9642   echo "configure: failed program was:" >&5
9643   cat conftest.$ac_ext >&5
9644   rm -rf conftest*
9645   ol_cv_pthread_lib_lpthread_woff=no
9646 fi
9647 rm -f conftest*
9648 else
9649   cat > conftest.$ac_ext <<EOF
9650 #line 9651 "configure"
9651 #include "confdefs.h"
9652 /* pthread test headers */
9653 #include <pthread.h>
9654 #ifndef NULL
9655 #define NULL (void*)0
9656 #endif
9657
9658 static void *task(p)
9659         void *p;
9660 {
9661         return (void *) (p == NULL);
9662 }
9663
9664
9665 int main(argc, argv)
9666         int argc;
9667         char **argv;
9668 {
9669
9670         /* pthread test function */
9671         pthread_t t;
9672         int status;
9673         int detach = 1;
9674
9675 #ifdef HAVE_PTHREADS_FINAL
9676         /* Final pthreads */
9677         pthread_attr_t attr;
9678
9679         status = pthread_attr_init(&attr);
9680         if( status ) return status;
9681
9682 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9683         if( !detach ) {
9684 #if defined( PTHREAD_CREATE_JOINABLE )
9685                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9686 #else
9687                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9688 #endif
9689
9690 #ifdef PTHREAD_CREATE_DETACHED
9691         } else {
9692                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9693 #endif
9694         }
9695         if( status ) return status;
9696 #endif
9697
9698         status = pthread_create( &t, &attr, task, NULL );
9699         if( status ) return status;
9700
9701 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9702         if( detach ) {
9703                 /* give thread a chance to complete */
9704                 /* it should remain joinable and hence detachable */
9705                 sleep( 1 );
9706
9707                 status = pthread_detach( t );
9708                 if( status ) return status;
9709         }
9710 #endif
9711
9712 #else
9713         /* Draft 4 pthreads */
9714         status = pthread_create( &t, pthread_attr_default, task, NULL );
9715         if( status ) return status;
9716
9717         if( detach ) {
9718                 /* give thread a chance to complete */
9719                 /* it should remain joinable and hence detachable */
9720                 sleep( 1 );
9721
9722                 status = pthread_detach( &t );
9723                 if( status ) return status;
9724         }
9725 #endif
9726
9727 #ifdef HAVE_LINUX_THREADS
9728         pthread_kill_other_threads_np();
9729 #endif
9730
9731         return 0;
9732
9733 }
9734
9735 EOF
9736 if { (eval echo configure:9737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9737 then
9738   ol_cv_pthread_lib_lpthread_woff=yes
9739 else
9740   echo "configure: failed program was:" >&5
9741   cat conftest.$ac_ext >&5
9742   rm -fr conftest*
9743   ol_cv_pthread_lib_lpthread_woff=no
9744 fi
9745 rm -fr conftest*
9746 fi
9747
9748
9749                 # restore the LIBS
9750                 LIBS="$ol_LIBS"
9751         
9752 fi
9753
9754 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9755
9756         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9757                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9758                 ol_link_threads=posix
9759         fi
9760 fi
9761
9762
9763                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9764 if test "$ol_link_threads" = no ; then
9765         # try -lpthread
9766         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9767 echo "configure:9768: checking for pthread link with -lpthread" >&5
9768 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9769   echo $ac_n "(cached) $ac_c" 1>&6
9770 else
9771   
9772                 # save the flags
9773                 ol_LIBS="$LIBS"
9774                 LIBS="-lpthread $LIBS"
9775
9776                 if test "$cross_compiling" = yes; then
9777   cat > conftest.$ac_ext <<EOF
9778 #line 9779 "configure"
9779 #include "confdefs.h"
9780 /* pthread test headers */
9781 #include <pthread.h>
9782 #ifndef NULL
9783 #define NULL (void*)0
9784 #endif
9785
9786 static void *task(p)
9787         void *p;
9788 {
9789         return (void *) (p == NULL);
9790 }
9791
9792 int main() {
9793
9794         /* pthread test function */
9795         pthread_t t;
9796         int status;
9797         int detach = 1;
9798
9799 #ifdef HAVE_PTHREADS_FINAL
9800         /* Final pthreads */
9801         pthread_attr_t attr;
9802
9803         status = pthread_attr_init(&attr);
9804         if( status ) return status;
9805
9806 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9807         if( !detach ) {
9808 #if defined( PTHREAD_CREATE_JOINABLE )
9809                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9810 #else
9811                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9812 #endif
9813
9814 #ifdef PTHREAD_CREATE_DETACHED
9815         } else {
9816                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9817 #endif
9818         }
9819         if( status ) return status;
9820 #endif
9821
9822         status = pthread_create( &t, &attr, task, NULL );
9823         if( status ) return status;
9824
9825 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9826         if( detach ) {
9827                 /* give thread a chance to complete */
9828                 /* it should remain joinable and hence detachable */
9829                 sleep( 1 );
9830
9831                 status = pthread_detach( t );
9832                 if( status ) return status;
9833         }
9834 #endif
9835
9836 #else
9837         /* Draft 4 pthreads */
9838         status = pthread_create( &t, pthread_attr_default, task, NULL );
9839         if( status ) return status;
9840
9841         if( detach ) {
9842                 /* give thread a chance to complete */
9843                 /* it should remain joinable and hence detachable */
9844                 sleep( 1 );
9845
9846                 status = pthread_detach( &t );
9847                 if( status ) return status;
9848         }
9849 #endif
9850
9851 #ifdef HAVE_LINUX_THREADS
9852         pthread_kill_other_threads_np();
9853 #endif
9854
9855         return 0;
9856
9857 ; return 0; }
9858 EOF
9859 if { (eval echo configure:9860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9860   rm -rf conftest*
9861   ol_cv_pthread_lpthread=yes
9862 else
9863   echo "configure: failed program was:" >&5
9864   cat conftest.$ac_ext >&5
9865   rm -rf conftest*
9866   ol_cv_pthread_lpthread=no
9867 fi
9868 rm -f conftest*
9869 else
9870   cat > conftest.$ac_ext <<EOF
9871 #line 9872 "configure"
9872 #include "confdefs.h"
9873 /* pthread test headers */
9874 #include <pthread.h>
9875 #ifndef NULL
9876 #define NULL (void*)0
9877 #endif
9878
9879 static void *task(p)
9880         void *p;
9881 {
9882         return (void *) (p == NULL);
9883 }
9884
9885
9886 int main(argc, argv)
9887         int argc;
9888         char **argv;
9889 {
9890
9891         /* pthread test function */
9892         pthread_t t;
9893         int status;
9894         int detach = 1;
9895
9896 #ifdef HAVE_PTHREADS_FINAL
9897         /* Final pthreads */
9898         pthread_attr_t attr;
9899
9900         status = pthread_attr_init(&attr);
9901         if( status ) return status;
9902
9903 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9904         if( !detach ) {
9905 #if defined( PTHREAD_CREATE_JOINABLE )
9906                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9907 #else
9908                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9909 #endif
9910
9911 #ifdef PTHREAD_CREATE_DETACHED
9912         } else {
9913                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9914 #endif
9915         }
9916         if( status ) return status;
9917 #endif
9918
9919         status = pthread_create( &t, &attr, task, NULL );
9920         if( status ) return status;
9921
9922 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9923         if( detach ) {
9924                 /* give thread a chance to complete */
9925                 /* it should remain joinable and hence detachable */
9926                 sleep( 1 );
9927
9928                 status = pthread_detach( t );
9929                 if( status ) return status;
9930         }
9931 #endif
9932
9933 #else
9934         /* Draft 4 pthreads */
9935         status = pthread_create( &t, pthread_attr_default, task, NULL );
9936         if( status ) return status;
9937
9938         if( detach ) {
9939                 /* give thread a chance to complete */
9940                 /* it should remain joinable and hence detachable */
9941                 sleep( 1 );
9942
9943                 status = pthread_detach( &t );
9944                 if( status ) return status;
9945         }
9946 #endif
9947
9948 #ifdef HAVE_LINUX_THREADS
9949         pthread_kill_other_threads_np();
9950 #endif
9951
9952         return 0;
9953
9954 }
9955
9956 EOF
9957 if { (eval echo configure:9958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9958 then
9959   ol_cv_pthread_lpthread=yes
9960 else
9961   echo "configure: failed program was:" >&5
9962   cat conftest.$ac_ext >&5
9963   rm -fr conftest*
9964   ol_cv_pthread_lpthread=no
9965 fi
9966 rm -fr conftest*
9967 fi
9968
9969
9970                 # restore the LIBS
9971                 LIBS="$ol_LIBS"
9972         
9973 fi
9974
9975 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9976
9977         if test $ol_cv_pthread_lpthread = yes ; then
9978                 ol_link_pthreads="-lpthread"
9979                 ol_link_threads=posix
9980         fi
9981 fi
9982
9983                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9984 if test "$ol_link_threads" = no ; then
9985         # try -lc_r
9986         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9987 echo "configure:9988: checking for pthread link with -lc_r" >&5
9988 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9989   echo $ac_n "(cached) $ac_c" 1>&6
9990 else
9991   
9992                 # save the flags
9993                 ol_LIBS="$LIBS"
9994                 LIBS="-lc_r $LIBS"
9995
9996                 if test "$cross_compiling" = yes; then
9997   cat > conftest.$ac_ext <<EOF
9998 #line 9999 "configure"
9999 #include "confdefs.h"
10000 /* pthread test headers */
10001 #include <pthread.h>
10002 #ifndef NULL
10003 #define NULL (void*)0
10004 #endif
10005
10006 static void *task(p)
10007         void *p;
10008 {
10009         return (void *) (p == NULL);
10010 }
10011
10012 int main() {
10013
10014         /* pthread test function */
10015         pthread_t t;
10016         int status;
10017         int detach = 1;
10018
10019 #ifdef HAVE_PTHREADS_FINAL
10020         /* Final pthreads */
10021         pthread_attr_t attr;
10022
10023         status = pthread_attr_init(&attr);
10024         if( status ) return status;
10025
10026 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10027         if( !detach ) {
10028 #if defined( PTHREAD_CREATE_JOINABLE )
10029                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10030 #else
10031                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10032 #endif
10033
10034 #ifdef PTHREAD_CREATE_DETACHED
10035         } else {
10036                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10037 #endif
10038         }
10039         if( status ) return status;
10040 #endif
10041
10042         status = pthread_create( &t, &attr, task, NULL );
10043         if( status ) return status;
10044
10045 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10046         if( detach ) {
10047                 /* give thread a chance to complete */
10048                 /* it should remain joinable and hence detachable */
10049                 sleep( 1 );
10050
10051                 status = pthread_detach( t );
10052                 if( status ) return status;
10053         }
10054 #endif
10055
10056 #else
10057         /* Draft 4 pthreads */
10058         status = pthread_create( &t, pthread_attr_default, task, NULL );
10059         if( status ) return status;
10060
10061         if( detach ) {
10062                 /* give thread a chance to complete */
10063                 /* it should remain joinable and hence detachable */
10064                 sleep( 1 );
10065
10066                 status = pthread_detach( &t );
10067                 if( status ) return status;
10068         }
10069 #endif
10070
10071 #ifdef HAVE_LINUX_THREADS
10072         pthread_kill_other_threads_np();
10073 #endif
10074
10075         return 0;
10076
10077 ; return 0; }
10078 EOF
10079 if { (eval echo configure:10080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10080   rm -rf conftest*
10081   ol_cv_pthread_lc_r=yes
10082 else
10083   echo "configure: failed program was:" >&5
10084   cat conftest.$ac_ext >&5
10085   rm -rf conftest*
10086   ol_cv_pthread_lc_r=no
10087 fi
10088 rm -f conftest*
10089 else
10090   cat > conftest.$ac_ext <<EOF
10091 #line 10092 "configure"
10092 #include "confdefs.h"
10093 /* pthread test headers */
10094 #include <pthread.h>
10095 #ifndef NULL
10096 #define NULL (void*)0
10097 #endif
10098
10099 static void *task(p)
10100         void *p;
10101 {
10102         return (void *) (p == NULL);
10103 }
10104
10105
10106 int main(argc, argv)
10107         int argc;
10108         char **argv;
10109 {
10110
10111         /* pthread test function */
10112         pthread_t t;
10113         int status;
10114         int detach = 1;
10115
10116 #ifdef HAVE_PTHREADS_FINAL
10117         /* Final pthreads */
10118         pthread_attr_t attr;
10119
10120         status = pthread_attr_init(&attr);
10121         if( status ) return status;
10122
10123 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10124         if( !detach ) {
10125 #if defined( PTHREAD_CREATE_JOINABLE )
10126                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10127 #else
10128                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10129 #endif
10130
10131 #ifdef PTHREAD_CREATE_DETACHED
10132         } else {
10133                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10134 #endif
10135         }
10136         if( status ) return status;
10137 #endif
10138
10139         status = pthread_create( &t, &attr, task, NULL );
10140         if( status ) return status;
10141
10142 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10143         if( detach ) {
10144                 /* give thread a chance to complete */
10145                 /* it should remain joinable and hence detachable */
10146                 sleep( 1 );
10147
10148                 status = pthread_detach( t );
10149                 if( status ) return status;
10150         }
10151 #endif
10152
10153 #else
10154         /* Draft 4 pthreads */
10155         status = pthread_create( &t, pthread_attr_default, task, NULL );
10156         if( status ) return status;
10157
10158         if( detach ) {
10159                 /* give thread a chance to complete */
10160                 /* it should remain joinable and hence detachable */
10161                 sleep( 1 );
10162
10163                 status = pthread_detach( &t );
10164                 if( status ) return status;
10165         }
10166 #endif
10167
10168 #ifdef HAVE_LINUX_THREADS
10169         pthread_kill_other_threads_np();
10170 #endif
10171
10172         return 0;
10173
10174 }
10175
10176 EOF
10177 if { (eval echo configure:10178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10178 then
10179   ol_cv_pthread_lc_r=yes
10180 else
10181   echo "configure: failed program was:" >&5
10182   cat conftest.$ac_ext >&5
10183   rm -fr conftest*
10184   ol_cv_pthread_lc_r=no
10185 fi
10186 rm -fr conftest*
10187 fi
10188
10189
10190                 # restore the LIBS
10191                 LIBS="$ol_LIBS"
10192         
10193 fi
10194
10195 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10196
10197         if test $ol_cv_pthread_lc_r = yes ; then
10198                 ol_link_pthreads="-lc_r"
10199                 ol_link_threads=posix
10200         fi
10201 fi
10202
10203
10204                 # Pthread try link: -threads (ol_cv_pthread_threads)
10205 if test "$ol_link_threads" = no ; then
10206         # try -threads
10207         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10208 echo "configure:10209: checking for pthread link with -threads" >&5
10209 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10210   echo $ac_n "(cached) $ac_c" 1>&6
10211 else
10212   
10213                 # save the flags
10214                 ol_LIBS="$LIBS"
10215                 LIBS="-threads $LIBS"
10216
10217                 if test "$cross_compiling" = yes; then
10218   cat > conftest.$ac_ext <<EOF
10219 #line 10220 "configure"
10220 #include "confdefs.h"
10221 /* pthread test headers */
10222 #include <pthread.h>
10223 #ifndef NULL
10224 #define NULL (void*)0
10225 #endif
10226
10227 static void *task(p)
10228         void *p;
10229 {
10230         return (void *) (p == NULL);
10231 }
10232
10233 int main() {
10234
10235         /* pthread test function */
10236         pthread_t t;
10237         int status;
10238         int detach = 1;
10239
10240 #ifdef HAVE_PTHREADS_FINAL
10241         /* Final pthreads */
10242         pthread_attr_t attr;
10243
10244         status = pthread_attr_init(&attr);
10245         if( status ) return status;
10246
10247 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10248         if( !detach ) {
10249 #if defined( PTHREAD_CREATE_JOINABLE )
10250                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10251 #else
10252                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10253 #endif
10254
10255 #ifdef PTHREAD_CREATE_DETACHED
10256         } else {
10257                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10258 #endif
10259         }
10260         if( status ) return status;
10261 #endif
10262
10263         status = pthread_create( &t, &attr, task, NULL );
10264         if( status ) return status;
10265
10266 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10267         if( detach ) {
10268                 /* give thread a chance to complete */
10269                 /* it should remain joinable and hence detachable */
10270                 sleep( 1 );
10271
10272                 status = pthread_detach( t );
10273                 if( status ) return status;
10274         }
10275 #endif
10276
10277 #else
10278         /* Draft 4 pthreads */
10279         status = pthread_create( &t, pthread_attr_default, task, NULL );
10280         if( status ) return status;
10281
10282         if( detach ) {
10283                 /* give thread a chance to complete */
10284                 /* it should remain joinable and hence detachable */
10285                 sleep( 1 );
10286
10287                 status = pthread_detach( &t );
10288                 if( status ) return status;
10289         }
10290 #endif
10291
10292 #ifdef HAVE_LINUX_THREADS
10293         pthread_kill_other_threads_np();
10294 #endif
10295
10296         return 0;
10297
10298 ; return 0; }
10299 EOF
10300 if { (eval echo configure:10301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10301   rm -rf conftest*
10302   ol_cv_pthread_threads=yes
10303 else
10304   echo "configure: failed program was:" >&5
10305   cat conftest.$ac_ext >&5
10306   rm -rf conftest*
10307   ol_cv_pthread_threads=no
10308 fi
10309 rm -f conftest*
10310 else
10311   cat > conftest.$ac_ext <<EOF
10312 #line 10313 "configure"
10313 #include "confdefs.h"
10314 /* pthread test headers */
10315 #include <pthread.h>
10316 #ifndef NULL
10317 #define NULL (void*)0
10318 #endif
10319
10320 static void *task(p)
10321         void *p;
10322 {
10323         return (void *) (p == NULL);
10324 }
10325
10326
10327 int main(argc, argv)
10328         int argc;
10329         char **argv;
10330 {
10331
10332         /* pthread test function */
10333         pthread_t t;
10334         int status;
10335         int detach = 1;
10336
10337 #ifdef HAVE_PTHREADS_FINAL
10338         /* Final pthreads */
10339         pthread_attr_t attr;
10340
10341         status = pthread_attr_init(&attr);
10342         if( status ) return status;
10343
10344 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10345         if( !detach ) {
10346 #if defined( PTHREAD_CREATE_JOINABLE )
10347                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10348 #else
10349                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10350 #endif
10351
10352 #ifdef PTHREAD_CREATE_DETACHED
10353         } else {
10354                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10355 #endif
10356         }
10357         if( status ) return status;
10358 #endif
10359
10360         status = pthread_create( &t, &attr, task, NULL );
10361         if( status ) return status;
10362
10363 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10364         if( detach ) {
10365                 /* give thread a chance to complete */
10366                 /* it should remain joinable and hence detachable */
10367                 sleep( 1 );
10368
10369                 status = pthread_detach( t );
10370                 if( status ) return status;
10371         }
10372 #endif
10373
10374 #else
10375         /* Draft 4 pthreads */
10376         status = pthread_create( &t, pthread_attr_default, task, NULL );
10377         if( status ) return status;
10378
10379         if( detach ) {
10380                 /* give thread a chance to complete */
10381                 /* it should remain joinable and hence detachable */
10382                 sleep( 1 );
10383
10384                 status = pthread_detach( &t );
10385                 if( status ) return status;
10386         }
10387 #endif
10388
10389 #ifdef HAVE_LINUX_THREADS
10390         pthread_kill_other_threads_np();
10391 #endif
10392
10393         return 0;
10394
10395 }
10396
10397 EOF
10398 if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10399 then
10400   ol_cv_pthread_threads=yes
10401 else
10402   echo "configure: failed program was:" >&5
10403   cat conftest.$ac_ext >&5
10404   rm -fr conftest*
10405   ol_cv_pthread_threads=no
10406 fi
10407 rm -fr conftest*
10408 fi
10409
10410
10411                 # restore the LIBS
10412                 LIBS="$ol_LIBS"
10413         
10414 fi
10415
10416 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10417
10418         if test $ol_cv_pthread_threads = yes ; then
10419                 ol_link_pthreads="-threads"
10420                 ol_link_threads=posix
10421         fi
10422 fi
10423
10424
10425                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10426 if test "$ol_link_threads" = no ; then
10427         # try -lpthreads -lmach -lexc -lc_r
10428         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10429 echo "configure:10430: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10430 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10431   echo $ac_n "(cached) $ac_c" 1>&6
10432 else
10433   
10434                 # save the flags
10435                 ol_LIBS="$LIBS"
10436                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10437
10438                 if test "$cross_compiling" = yes; then
10439   cat > conftest.$ac_ext <<EOF
10440 #line 10441 "configure"
10441 #include "confdefs.h"
10442 /* pthread test headers */
10443 #include <pthread.h>
10444 #ifndef NULL
10445 #define NULL (void*)0
10446 #endif
10447
10448 static void *task(p)
10449         void *p;
10450 {
10451         return (void *) (p == NULL);
10452 }
10453
10454 int main() {
10455
10456         /* pthread test function */
10457         pthread_t t;
10458         int status;
10459         int detach = 1;
10460
10461 #ifdef HAVE_PTHREADS_FINAL
10462         /* Final pthreads */
10463         pthread_attr_t attr;
10464
10465         status = pthread_attr_init(&attr);
10466         if( status ) return status;
10467
10468 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10469         if( !detach ) {
10470 #if defined( PTHREAD_CREATE_JOINABLE )
10471                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10472 #else
10473                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10474 #endif
10475
10476 #ifdef PTHREAD_CREATE_DETACHED
10477         } else {
10478                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10479 #endif
10480         }
10481         if( status ) return status;
10482 #endif
10483
10484         status = pthread_create( &t, &attr, task, NULL );
10485         if( status ) return status;
10486
10487 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10488         if( detach ) {
10489                 /* give thread a chance to complete */
10490                 /* it should remain joinable and hence detachable */
10491                 sleep( 1 );
10492
10493                 status = pthread_detach( t );
10494                 if( status ) return status;
10495         }
10496 #endif
10497
10498 #else
10499         /* Draft 4 pthreads */
10500         status = pthread_create( &t, pthread_attr_default, task, NULL );
10501         if( status ) return status;
10502
10503         if( detach ) {
10504                 /* give thread a chance to complete */
10505                 /* it should remain joinable and hence detachable */
10506                 sleep( 1 );
10507
10508                 status = pthread_detach( &t );
10509                 if( status ) return status;
10510         }
10511 #endif
10512
10513 #ifdef HAVE_LINUX_THREADS
10514         pthread_kill_other_threads_np();
10515 #endif
10516
10517         return 0;
10518
10519 ; return 0; }
10520 EOF
10521 if { (eval echo configure:10522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10522   rm -rf conftest*
10523   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10524 else
10525   echo "configure: failed program was:" >&5
10526   cat conftest.$ac_ext >&5
10527   rm -rf conftest*
10528   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10529 fi
10530 rm -f conftest*
10531 else
10532   cat > conftest.$ac_ext <<EOF
10533 #line 10534 "configure"
10534 #include "confdefs.h"
10535 /* pthread test headers */
10536 #include <pthread.h>
10537 #ifndef NULL
10538 #define NULL (void*)0
10539 #endif
10540
10541 static void *task(p)
10542         void *p;
10543 {
10544         return (void *) (p == NULL);
10545 }
10546
10547
10548 int main(argc, argv)
10549         int argc;
10550         char **argv;
10551 {
10552
10553         /* pthread test function */
10554         pthread_t t;
10555         int status;
10556         int detach = 1;
10557
10558 #ifdef HAVE_PTHREADS_FINAL
10559         /* Final pthreads */
10560         pthread_attr_t attr;
10561
10562         status = pthread_attr_init(&attr);
10563         if( status ) return status;
10564
10565 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10566         if( !detach ) {
10567 #if defined( PTHREAD_CREATE_JOINABLE )
10568                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10569 #else
10570                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10571 #endif
10572
10573 #ifdef PTHREAD_CREATE_DETACHED
10574         } else {
10575                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10576 #endif
10577         }
10578         if( status ) return status;
10579 #endif
10580
10581         status = pthread_create( &t, &attr, task, NULL );
10582         if( status ) return status;
10583
10584 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10585         if( detach ) {
10586                 /* give thread a chance to complete */
10587                 /* it should remain joinable and hence detachable */
10588                 sleep( 1 );
10589
10590                 status = pthread_detach( t );
10591                 if( status ) return status;
10592         }
10593 #endif
10594
10595 #else
10596         /* Draft 4 pthreads */
10597         status = pthread_create( &t, pthread_attr_default, task, NULL );
10598         if( status ) return status;
10599
10600         if( detach ) {
10601                 /* give thread a chance to complete */
10602                 /* it should remain joinable and hence detachable */
10603                 sleep( 1 );
10604
10605                 status = pthread_detach( &t );
10606                 if( status ) return status;
10607         }
10608 #endif
10609
10610 #ifdef HAVE_LINUX_THREADS
10611         pthread_kill_other_threads_np();
10612 #endif
10613
10614         return 0;
10615
10616 }
10617
10618 EOF
10619 if { (eval echo configure:10620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10620 then
10621   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10622 else
10623   echo "configure: failed program was:" >&5
10624   cat conftest.$ac_ext >&5
10625   rm -fr conftest*
10626   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10627 fi
10628 rm -fr conftest*
10629 fi
10630
10631
10632                 # restore the LIBS
10633                 LIBS="$ol_LIBS"
10634         
10635 fi
10636
10637 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10638
10639         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10640                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10641                 ol_link_threads=posix
10642         fi
10643 fi
10644
10645                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10646 if test "$ol_link_threads" = no ; then
10647         # try -lpthreads -lmach -lexc
10648         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10649 echo "configure:10650: checking for pthread link with -lpthreads -lmach -lexc" >&5
10650 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10651   echo $ac_n "(cached) $ac_c" 1>&6
10652 else
10653   
10654                 # save the flags
10655                 ol_LIBS="$LIBS"
10656                 LIBS="-lpthreads -lmach -lexc $LIBS"
10657
10658                 if test "$cross_compiling" = yes; then
10659   cat > conftest.$ac_ext <<EOF
10660 #line 10661 "configure"
10661 #include "confdefs.h"
10662 /* pthread test headers */
10663 #include <pthread.h>
10664 #ifndef NULL
10665 #define NULL (void*)0
10666 #endif
10667
10668 static void *task(p)
10669         void *p;
10670 {
10671         return (void *) (p == NULL);
10672 }
10673
10674 int main() {
10675
10676         /* pthread test function */
10677         pthread_t t;
10678         int status;
10679         int detach = 1;
10680
10681 #ifdef HAVE_PTHREADS_FINAL
10682         /* Final pthreads */
10683         pthread_attr_t attr;
10684
10685         status = pthread_attr_init(&attr);
10686         if( status ) return status;
10687
10688 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10689         if( !detach ) {
10690 #if defined( PTHREAD_CREATE_JOINABLE )
10691                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10692 #else
10693                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10694 #endif
10695
10696 #ifdef PTHREAD_CREATE_DETACHED
10697         } else {
10698                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10699 #endif
10700         }
10701         if( status ) return status;
10702 #endif
10703
10704         status = pthread_create( &t, &attr, task, NULL );
10705         if( status ) return status;
10706
10707 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10708         if( detach ) {
10709                 /* give thread a chance to complete */
10710                 /* it should remain joinable and hence detachable */
10711                 sleep( 1 );
10712
10713                 status = pthread_detach( t );
10714                 if( status ) return status;
10715         }
10716 #endif
10717
10718 #else
10719         /* Draft 4 pthreads */
10720         status = pthread_create( &t, pthread_attr_default, task, NULL );
10721         if( status ) return status;
10722
10723         if( detach ) {
10724                 /* give thread a chance to complete */
10725                 /* it should remain joinable and hence detachable */
10726                 sleep( 1 );
10727
10728                 status = pthread_detach( &t );
10729                 if( status ) return status;
10730         }
10731 #endif
10732
10733 #ifdef HAVE_LINUX_THREADS
10734         pthread_kill_other_threads_np();
10735 #endif
10736
10737         return 0;
10738
10739 ; return 0; }
10740 EOF
10741 if { (eval echo configure:10742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10742   rm -rf conftest*
10743   ol_cv_pthread_lpthreads_lmach_lexc=yes
10744 else
10745   echo "configure: failed program was:" >&5
10746   cat conftest.$ac_ext >&5
10747   rm -rf conftest*
10748   ol_cv_pthread_lpthreads_lmach_lexc=no
10749 fi
10750 rm -f conftest*
10751 else
10752   cat > conftest.$ac_ext <<EOF
10753 #line 10754 "configure"
10754 #include "confdefs.h"
10755 /* pthread test headers */
10756 #include <pthread.h>
10757 #ifndef NULL
10758 #define NULL (void*)0
10759 #endif
10760
10761 static void *task(p)
10762         void *p;
10763 {
10764         return (void *) (p == NULL);
10765 }
10766
10767
10768 int main(argc, argv)
10769         int argc;
10770         char **argv;
10771 {
10772
10773         /* pthread test function */
10774         pthread_t t;
10775         int status;
10776         int detach = 1;
10777
10778 #ifdef HAVE_PTHREADS_FINAL
10779         /* Final pthreads */
10780         pthread_attr_t attr;
10781
10782         status = pthread_attr_init(&attr);
10783         if( status ) return status;
10784
10785 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10786         if( !detach ) {
10787 #if defined( PTHREAD_CREATE_JOINABLE )
10788                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10789 #else
10790                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10791 #endif
10792
10793 #ifdef PTHREAD_CREATE_DETACHED
10794         } else {
10795                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10796 #endif
10797         }
10798         if( status ) return status;
10799 #endif
10800
10801         status = pthread_create( &t, &attr, task, NULL );
10802         if( status ) return status;
10803
10804 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10805         if( detach ) {
10806                 /* give thread a chance to complete */
10807                 /* it should remain joinable and hence detachable */
10808                 sleep( 1 );
10809
10810                 status = pthread_detach( t );
10811                 if( status ) return status;
10812         }
10813 #endif
10814
10815 #else
10816         /* Draft 4 pthreads */
10817         status = pthread_create( &t, pthread_attr_default, task, NULL );
10818         if( status ) return status;
10819
10820         if( detach ) {
10821                 /* give thread a chance to complete */
10822                 /* it should remain joinable and hence detachable */
10823                 sleep( 1 );
10824
10825                 status = pthread_detach( &t );
10826                 if( status ) return status;
10827         }
10828 #endif
10829
10830 #ifdef HAVE_LINUX_THREADS
10831         pthread_kill_other_threads_np();
10832 #endif
10833
10834         return 0;
10835
10836 }
10837
10838 EOF
10839 if { (eval echo configure:10840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10840 then
10841   ol_cv_pthread_lpthreads_lmach_lexc=yes
10842 else
10843   echo "configure: failed program was:" >&5
10844   cat conftest.$ac_ext >&5
10845   rm -fr conftest*
10846   ol_cv_pthread_lpthreads_lmach_lexc=no
10847 fi
10848 rm -fr conftest*
10849 fi
10850
10851
10852                 # restore the LIBS
10853                 LIBS="$ol_LIBS"
10854         
10855 fi
10856
10857 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10858
10859         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10860                 ol_link_pthreads="-lpthreads -lmach -lexc"
10861                 ol_link_threads=posix
10862         fi
10863 fi
10864
10865                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10866 if test "$ol_link_threads" = no ; then
10867         # try -lpthreads -lexc
10868         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10869 echo "configure:10870: checking for pthread link with -lpthreads -lexc" >&5
10870 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10871   echo $ac_n "(cached) $ac_c" 1>&6
10872 else
10873   
10874                 # save the flags
10875                 ol_LIBS="$LIBS"
10876                 LIBS="-lpthreads -lexc $LIBS"
10877
10878                 if test "$cross_compiling" = yes; then
10879   cat > conftest.$ac_ext <<EOF
10880 #line 10881 "configure"
10881 #include "confdefs.h"
10882 /* pthread test headers */
10883 #include <pthread.h>
10884 #ifndef NULL
10885 #define NULL (void*)0
10886 #endif
10887
10888 static void *task(p)
10889         void *p;
10890 {
10891         return (void *) (p == NULL);
10892 }
10893
10894 int main() {
10895
10896         /* pthread test function */
10897         pthread_t t;
10898         int status;
10899         int detach = 1;
10900
10901 #ifdef HAVE_PTHREADS_FINAL
10902         /* Final pthreads */
10903         pthread_attr_t attr;
10904
10905         status = pthread_attr_init(&attr);
10906         if( status ) return status;
10907
10908 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10909         if( !detach ) {
10910 #if defined( PTHREAD_CREATE_JOINABLE )
10911                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10912 #else
10913                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10914 #endif
10915
10916 #ifdef PTHREAD_CREATE_DETACHED
10917         } else {
10918                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10919 #endif
10920         }
10921         if( status ) return status;
10922 #endif
10923
10924         status = pthread_create( &t, &attr, task, NULL );
10925         if( status ) return status;
10926
10927 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10928         if( detach ) {
10929                 /* give thread a chance to complete */
10930                 /* it should remain joinable and hence detachable */
10931                 sleep( 1 );
10932
10933                 status = pthread_detach( t );
10934                 if( status ) return status;
10935         }
10936 #endif
10937
10938 #else
10939         /* Draft 4 pthreads */
10940         status = pthread_create( &t, pthread_attr_default, task, NULL );
10941         if( status ) return status;
10942
10943         if( detach ) {
10944                 /* give thread a chance to complete */
10945                 /* it should remain joinable and hence detachable */
10946                 sleep( 1 );
10947
10948                 status = pthread_detach( &t );
10949                 if( status ) return status;
10950         }
10951 #endif
10952
10953 #ifdef HAVE_LINUX_THREADS
10954         pthread_kill_other_threads_np();
10955 #endif
10956
10957         return 0;
10958
10959 ; return 0; }
10960 EOF
10961 if { (eval echo configure:10962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10962   rm -rf conftest*
10963   ol_cv_pthread_lpthreads_lexc=yes
10964 else
10965   echo "configure: failed program was:" >&5
10966   cat conftest.$ac_ext >&5
10967   rm -rf conftest*
10968   ol_cv_pthread_lpthreads_lexc=no
10969 fi
10970 rm -f conftest*
10971 else
10972   cat > conftest.$ac_ext <<EOF
10973 #line 10974 "configure"
10974 #include "confdefs.h"
10975 /* pthread test headers */
10976 #include <pthread.h>
10977 #ifndef NULL
10978 #define NULL (void*)0
10979 #endif
10980
10981 static void *task(p)
10982         void *p;
10983 {
10984         return (void *) (p == NULL);
10985 }
10986
10987
10988 int main(argc, argv)
10989         int argc;
10990         char **argv;
10991 {
10992
10993         /* pthread test function */
10994         pthread_t t;
10995         int status;
10996         int detach = 1;
10997
10998 #ifdef HAVE_PTHREADS_FINAL
10999         /* Final pthreads */
11000         pthread_attr_t attr;
11001
11002         status = pthread_attr_init(&attr);
11003         if( status ) return status;
11004
11005 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11006         if( !detach ) {
11007 #if defined( PTHREAD_CREATE_JOINABLE )
11008                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11009 #else
11010                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11011 #endif
11012
11013 #ifdef PTHREAD_CREATE_DETACHED
11014         } else {
11015                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11016 #endif
11017         }
11018         if( status ) return status;
11019 #endif
11020
11021         status = pthread_create( &t, &attr, task, NULL );
11022         if( status ) return status;
11023
11024 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11025         if( detach ) {
11026                 /* give thread a chance to complete */
11027                 /* it should remain joinable and hence detachable */
11028                 sleep( 1 );
11029
11030                 status = pthread_detach( t );
11031                 if( status ) return status;
11032         }
11033 #endif
11034
11035 #else
11036         /* Draft 4 pthreads */
11037         status = pthread_create( &t, pthread_attr_default, task, NULL );
11038         if( status ) return status;
11039
11040         if( detach ) {
11041                 /* give thread a chance to complete */
11042                 /* it should remain joinable and hence detachable */
11043                 sleep( 1 );
11044
11045                 status = pthread_detach( &t );
11046                 if( status ) return status;
11047         }
11048 #endif
11049
11050 #ifdef HAVE_LINUX_THREADS
11051         pthread_kill_other_threads_np();
11052 #endif
11053
11054         return 0;
11055
11056 }
11057
11058 EOF
11059 if { (eval echo configure:11060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11060 then
11061   ol_cv_pthread_lpthreads_lexc=yes
11062 else
11063   echo "configure: failed program was:" >&5
11064   cat conftest.$ac_ext >&5
11065   rm -fr conftest*
11066   ol_cv_pthread_lpthreads_lexc=no
11067 fi
11068 rm -fr conftest*
11069 fi
11070
11071
11072                 # restore the LIBS
11073                 LIBS="$ol_LIBS"
11074         
11075 fi
11076
11077 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
11078
11079         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
11080                 ol_link_pthreads="-lpthreads -lexc"
11081                 ol_link_threads=posix
11082         fi
11083 fi
11084
11085
11086                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
11087 if test "$ol_link_threads" = no ; then
11088         # try -lpthreads
11089         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
11090 echo "configure:11091: checking for pthread link with -lpthreads" >&5
11091 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11092   echo $ac_n "(cached) $ac_c" 1>&6
11093 else
11094   
11095                 # save the flags
11096                 ol_LIBS="$LIBS"
11097                 LIBS="-lpthreads $LIBS"
11098
11099                 if test "$cross_compiling" = yes; then
11100   cat > conftest.$ac_ext <<EOF
11101 #line 11102 "configure"
11102 #include "confdefs.h"
11103 /* pthread test headers */
11104 #include <pthread.h>
11105 #ifndef NULL
11106 #define NULL (void*)0
11107 #endif
11108
11109 static void *task(p)
11110         void *p;
11111 {
11112         return (void *) (p == NULL);
11113 }
11114
11115 int main() {
11116
11117         /* pthread test function */
11118         pthread_t t;
11119         int status;
11120         int detach = 1;
11121
11122 #ifdef HAVE_PTHREADS_FINAL
11123         /* Final pthreads */
11124         pthread_attr_t attr;
11125
11126         status = pthread_attr_init(&attr);
11127         if( status ) return status;
11128
11129 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11130         if( !detach ) {
11131 #if defined( PTHREAD_CREATE_JOINABLE )
11132                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11133 #else
11134                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11135 #endif
11136
11137 #ifdef PTHREAD_CREATE_DETACHED
11138         } else {
11139                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11140 #endif
11141         }
11142         if( status ) return status;
11143 #endif
11144
11145         status = pthread_create( &t, &attr, task, NULL );
11146         if( status ) return status;
11147
11148 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11149         if( detach ) {
11150                 /* give thread a chance to complete */
11151                 /* it should remain joinable and hence detachable */
11152                 sleep( 1 );
11153
11154                 status = pthread_detach( t );
11155                 if( status ) return status;
11156         }
11157 #endif
11158
11159 #else
11160         /* Draft 4 pthreads */
11161         status = pthread_create( &t, pthread_attr_default, task, NULL );
11162         if( status ) return status;
11163
11164         if( detach ) {
11165                 /* give thread a chance to complete */
11166                 /* it should remain joinable and hence detachable */
11167                 sleep( 1 );
11168
11169                 status = pthread_detach( &t );
11170                 if( status ) return status;
11171         }
11172 #endif
11173
11174 #ifdef HAVE_LINUX_THREADS
11175         pthread_kill_other_threads_np();
11176 #endif
11177
11178         return 0;
11179
11180 ; return 0; }
11181 EOF
11182 if { (eval echo configure:11183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11183   rm -rf conftest*
11184   ol_cv_pthread_lib_lpthreads=yes
11185 else
11186   echo "configure: failed program was:" >&5
11187   cat conftest.$ac_ext >&5
11188   rm -rf conftest*
11189   ol_cv_pthread_lib_lpthreads=no
11190 fi
11191 rm -f conftest*
11192 else
11193   cat > conftest.$ac_ext <<EOF
11194 #line 11195 "configure"
11195 #include "confdefs.h"
11196 /* pthread test headers */
11197 #include <pthread.h>
11198 #ifndef NULL
11199 #define NULL (void*)0
11200 #endif
11201
11202 static void *task(p)
11203         void *p;
11204 {
11205         return (void *) (p == NULL);
11206 }
11207
11208
11209 int main(argc, argv)
11210         int argc;
11211         char **argv;
11212 {
11213
11214         /* pthread test function */
11215         pthread_t t;
11216         int status;
11217         int detach = 1;
11218
11219 #ifdef HAVE_PTHREADS_FINAL
11220         /* Final pthreads */
11221         pthread_attr_t attr;
11222
11223         status = pthread_attr_init(&attr);
11224         if( status ) return status;
11225
11226 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11227         if( !detach ) {
11228 #if defined( PTHREAD_CREATE_JOINABLE )
11229                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11230 #else
11231                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11232 #endif
11233
11234 #ifdef PTHREAD_CREATE_DETACHED
11235         } else {
11236                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11237 #endif
11238         }
11239         if( status ) return status;
11240 #endif
11241
11242         status = pthread_create( &t, &attr, task, NULL );
11243         if( status ) return status;
11244
11245 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11246         if( detach ) {
11247                 /* give thread a chance to complete */
11248                 /* it should remain joinable and hence detachable */
11249                 sleep( 1 );
11250
11251                 status = pthread_detach( t );
11252                 if( status ) return status;
11253         }
11254 #endif
11255
11256 #else
11257         /* Draft 4 pthreads */
11258         status = pthread_create( &t, pthread_attr_default, task, NULL );
11259         if( status ) return status;
11260
11261         if( detach ) {
11262                 /* give thread a chance to complete */
11263                 /* it should remain joinable and hence detachable */
11264                 sleep( 1 );
11265
11266                 status = pthread_detach( &t );
11267                 if( status ) return status;
11268         }
11269 #endif
11270
11271 #ifdef HAVE_LINUX_THREADS
11272         pthread_kill_other_threads_np();
11273 #endif
11274
11275         return 0;
11276
11277 }
11278
11279 EOF
11280 if { (eval echo configure:11281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11281 then
11282   ol_cv_pthread_lib_lpthreads=yes
11283 else
11284   echo "configure: failed program was:" >&5
11285   cat conftest.$ac_ext >&5
11286   rm -fr conftest*
11287   ol_cv_pthread_lib_lpthreads=no
11288 fi
11289 rm -fr conftest*
11290 fi
11291
11292
11293                 # restore the LIBS
11294                 LIBS="$ol_LIBS"
11295         
11296 fi
11297
11298 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11299
11300         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11301                 ol_link_pthreads="-lpthreads"
11302                 ol_link_threads=posix
11303         fi
11304 fi
11305
11306
11307                 if test $ol_link_threads != no ; then
11308                         cat >> confdefs.h <<\EOF
11309 #define HAVE_PTHREADS 1
11310 EOF
11311
11312
11313                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11314
11315                                                 save_CPPFLAGS="$CPPFLAGS"
11316                         save_LIBS="$LIBS"
11317                         LIBS="$LTHREAD_LIBS $LIBS"
11318
11319                                                                                                 for ac_func in sched_yield pthread_yield
11320 do
11321 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11322 echo "configure:11323: checking for $ac_func" >&5
11323 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11324   echo $ac_n "(cached) $ac_c" 1>&6
11325 else
11326   cat > conftest.$ac_ext <<EOF
11327 #line 11328 "configure"
11328 #include "confdefs.h"
11329 /* System header to define __stub macros and hopefully few prototypes,
11330     which can conflict with char $ac_func(); below.  */
11331 #include <assert.h>
11332 /* Override any gcc2 internal prototype to avoid an error.  */
11333 /* We use char because int might match the return type of a gcc2
11334     builtin and then its argument prototype would still apply.  */
11335 char $ac_func();
11336 char (*f)();
11337
11338 int main() {
11339
11340 /* The GNU C library defines this for functions which it implements
11341     to always fail with ENOSYS.  Some functions are actually named
11342     something starting with __ and the normal name is an alias.  */
11343 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11344 choke me
11345 #else
11346 f = $ac_func;
11347 #endif
11348
11349 ; return 0; }
11350 EOF
11351 if { (eval echo configure:11352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11352   rm -rf conftest*
11353   eval "ac_cv_func_$ac_func=yes"
11354 else
11355   echo "configure: failed program was:" >&5
11356   cat conftest.$ac_ext >&5
11357   rm -rf conftest*
11358   eval "ac_cv_func_$ac_func=no"
11359 fi
11360 rm -f conftest*
11361 fi
11362
11363 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11364   echo "$ac_t""yes" 1>&6
11365     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11366   cat >> confdefs.h <<EOF
11367 #define $ac_tr_func 1
11368 EOF
11369  
11370 else
11371   echo "$ac_t""no" 1>&6
11372 fi
11373 done
11374
11375
11376                         if test $ac_cv_func_sched_yield = no -a \
11377                                 $ac_cv_func_pthread_yield = no ; then
11378                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11379 echo "configure:11380: checking for sched_yield in -lrt" >&5
11380 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11381 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11382   echo $ac_n "(cached) $ac_c" 1>&6
11383 else
11384   ac_save_LIBS="$LIBS"
11385 LIBS="-lrt  $LIBS"
11386 cat > conftest.$ac_ext <<EOF
11387 #line 11388 "configure"
11388 #include "confdefs.h"
11389 /* Override any gcc2 internal prototype to avoid an error.  */
11390 /* We use char because int might match the return type of a gcc2
11391     builtin and then its argument prototype would still apply.  */
11392 char sched_yield();
11393
11394 int main() {
11395 sched_yield()
11396 ; return 0; }
11397 EOF
11398 if { (eval echo configure:11399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11399   rm -rf conftest*
11400   eval "ac_cv_lib_$ac_lib_var=yes"
11401 else
11402   echo "configure: failed program was:" >&5
11403   cat conftest.$ac_ext >&5
11404   rm -rf conftest*
11405   eval "ac_cv_lib_$ac_lib_var=no"
11406 fi
11407 rm -f conftest*
11408 LIBS="$ac_save_LIBS"
11409
11410 fi
11411 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11412   echo "$ac_t""yes" 1>&6
11413   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11414                                         cat >> confdefs.h <<\EOF
11415 #define HAVE_SCHED_YIELD 1
11416 EOF
11417
11418                                         ac_cv_func_sched_yield=yes
11419 else
11420   echo "$ac_t""no" 1>&6
11421 ac_cv_func_sched_yield=no
11422 fi
11423
11424                         fi
11425                         if test $ac_cv_func_sched_yield = no -a \
11426                                 $ac_cv_func_pthread_yield = no ; then
11427                                                                                                 for ac_func in thr_yield
11428 do
11429 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11430 echo "configure:11431: checking for $ac_func" >&5
11431 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11432   echo $ac_n "(cached) $ac_c" 1>&6
11433 else
11434   cat > conftest.$ac_ext <<EOF
11435 #line 11436 "configure"
11436 #include "confdefs.h"
11437 /* System header to define __stub macros and hopefully few prototypes,
11438     which can conflict with char $ac_func(); below.  */
11439 #include <assert.h>
11440 /* Override any gcc2 internal prototype to avoid an error.  */
11441 /* We use char because int might match the return type of a gcc2
11442     builtin and then its argument prototype would still apply.  */
11443 char $ac_func();
11444 char (*f)();
11445
11446 int main() {
11447
11448 /* The GNU C library defines this for functions which it implements
11449     to always fail with ENOSYS.  Some functions are actually named
11450     something starting with __ and the normal name is an alias.  */
11451 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11452 choke me
11453 #else
11454 f = $ac_func;
11455 #endif
11456
11457 ; return 0; }
11458 EOF
11459 if { (eval echo configure:11460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11460   rm -rf conftest*
11461   eval "ac_cv_func_$ac_func=yes"
11462 else
11463   echo "configure: failed program was:" >&5
11464   cat conftest.$ac_ext >&5
11465   rm -rf conftest*
11466   eval "ac_cv_func_$ac_func=no"
11467 fi
11468 rm -f conftest*
11469 fi
11470
11471 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11472   echo "$ac_t""yes" 1>&6
11473     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11474   cat >> confdefs.h <<EOF
11475 #define $ac_tr_func 1
11476 EOF
11477  
11478 else
11479   echo "$ac_t""no" 1>&6
11480 fi
11481 done
11482
11483                         fi
11484                         if test $ac_cv_func_sched_yield = no -a \
11485                                 $ac_cv_func_pthread_yield = no -a \
11486                                 "$ac_cv_func_thr_yield" = no ; then
11487                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11488                         fi
11489
11490                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11491 do
11492 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11493 echo "configure:11494: checking for $ac_func" >&5
11494 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11495   echo $ac_n "(cached) $ac_c" 1>&6
11496 else
11497   cat > conftest.$ac_ext <<EOF
11498 #line 11499 "configure"
11499 #include "confdefs.h"
11500 /* System header to define __stub macros and hopefully few prototypes,
11501     which can conflict with char $ac_func(); below.  */
11502 #include <assert.h>
11503 /* Override any gcc2 internal prototype to avoid an error.  */
11504 /* We use char because int might match the return type of a gcc2
11505     builtin and then its argument prototype would still apply.  */
11506 char $ac_func();
11507 char (*f)();
11508
11509 int main() {
11510
11511 /* The GNU C library defines this for functions which it implements
11512     to always fail with ENOSYS.  Some functions are actually named
11513     something starting with __ and the normal name is an alias.  */
11514 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11515 choke me
11516 #else
11517 f = $ac_func;
11518 #endif
11519
11520 ; return 0; }
11521 EOF
11522 if { (eval echo configure:11523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11523   rm -rf conftest*
11524   eval "ac_cv_func_$ac_func=yes"
11525 else
11526   echo "configure: failed program was:" >&5
11527   cat conftest.$ac_ext >&5
11528   rm -rf conftest*
11529   eval "ac_cv_func_$ac_func=no"
11530 fi
11531 rm -f conftest*
11532 fi
11533
11534 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11535   echo "$ac_t""yes" 1>&6
11536     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11537   cat >> confdefs.h <<EOF
11538 #define $ac_tr_func 1
11539 EOF
11540  
11541 else
11542   echo "$ac_t""no" 1>&6
11543 fi
11544 done
11545
11546
11547                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11548 echo "configure:11549: checking for pthread_detach with <pthread.h>" >&5
11549 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11550   echo $ac_n "(cached) $ac_c" 1>&6
11551 else
11552   
11553                                                                 cat > conftest.$ac_ext <<EOF
11554 #line 11555 "configure"
11555 #include "confdefs.h"
11556
11557 #include <pthread.h>
11558 #ifndef NULL
11559 #define NULL (void*)0
11560 #endif
11561
11562 int main() {
11563 pthread_detach(NULL);
11564 ; return 0; }
11565 EOF
11566 if { (eval echo configure:11567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11567   rm -rf conftest*
11568   ol_cv_func_pthread_detach=yes
11569 else
11570   echo "configure: failed program was:" >&5
11571   cat conftest.$ac_ext >&5
11572   rm -rf conftest*
11573   ol_cv_func_pthread_detach=no
11574 fi
11575 rm -f conftest*
11576                         
11577 fi
11578
11579 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11580
11581                         if test $ol_cv_func_pthread_detach = no ; then
11582                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11583                         fi
11584
11585                         cat >> confdefs.h <<\EOF
11586 #define HAVE_PTHREAD_DETACH 1
11587 EOF
11588
11589
11590                                                 for ac_func in \
11591                                 pthread_setconcurrency \
11592                                 pthread_getconcurrency \
11593                                 thr_setconcurrency \
11594                                 thr_getconcurrency \
11595                         
11596 do
11597 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11598 echo "configure:11599: checking for $ac_func" >&5
11599 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11600   echo $ac_n "(cached) $ac_c" 1>&6
11601 else
11602   cat > conftest.$ac_ext <<EOF
11603 #line 11604 "configure"
11604 #include "confdefs.h"
11605 /* System header to define __stub macros and hopefully few prototypes,
11606     which can conflict with char $ac_func(); below.  */
11607 #include <assert.h>
11608 /* Override any gcc2 internal prototype to avoid an error.  */
11609 /* We use char because int might match the return type of a gcc2
11610     builtin and then its argument prototype would still apply.  */
11611 char $ac_func();
11612 char (*f)();
11613
11614 int main() {
11615
11616 /* The GNU C library defines this for functions which it implements
11617     to always fail with ENOSYS.  Some functions are actually named
11618     something starting with __ and the normal name is an alias.  */
11619 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11620 choke me
11621 #else
11622 f = $ac_func;
11623 #endif
11624
11625 ; return 0; }
11626 EOF
11627 if { (eval echo configure:11628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11628   rm -rf conftest*
11629   eval "ac_cv_func_$ac_func=yes"
11630 else
11631   echo "configure: failed program was:" >&5
11632   cat conftest.$ac_ext >&5
11633   rm -rf conftest*
11634   eval "ac_cv_func_$ac_func=no"
11635 fi
11636 rm -f conftest*
11637 fi
11638
11639 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11640   echo "$ac_t""yes" 1>&6
11641     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11642   cat >> confdefs.h <<EOF
11643 #define $ac_tr_func 1
11644 EOF
11645  
11646 else
11647   echo "$ac_t""no" 1>&6
11648 fi
11649 done
11650
11651
11652                         
11653         for ac_func in pthread_kill_other_threads_np
11654 do
11655 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11656 echo "configure:11657: checking for $ac_func" >&5
11657 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11658   echo $ac_n "(cached) $ac_c" 1>&6
11659 else
11660   cat > conftest.$ac_ext <<EOF
11661 #line 11662 "configure"
11662 #include "confdefs.h"
11663 /* System header to define __stub macros and hopefully few prototypes,
11664     which can conflict with char $ac_func(); below.  */
11665 #include <assert.h>
11666 /* Override any gcc2 internal prototype to avoid an error.  */
11667 /* We use char because int might match the return type of a gcc2
11668     builtin and then its argument prototype would still apply.  */
11669 char $ac_func();
11670 char (*f)();
11671
11672 int main() {
11673
11674 /* The GNU C library defines this for functions which it implements
11675     to always fail with ENOSYS.  Some functions are actually named
11676     something starting with __ and the normal name is an alias.  */
11677 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11678 choke me
11679 #else
11680 f = $ac_func;
11681 #endif
11682
11683 ; return 0; }
11684 EOF
11685 if { (eval echo configure:11686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11686   rm -rf conftest*
11687   eval "ac_cv_func_$ac_func=yes"
11688 else
11689   echo "configure: failed program was:" >&5
11690   cat conftest.$ac_ext >&5
11691   rm -rf conftest*
11692   eval "ac_cv_func_$ac_func=no"
11693 fi
11694 rm -f conftest*
11695 fi
11696
11697 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11698   echo "$ac_t""yes" 1>&6
11699     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11700   cat >> confdefs.h <<EOF
11701 #define $ac_tr_func 1
11702 EOF
11703  
11704 else
11705   echo "$ac_t""no" 1>&6
11706 fi
11707 done
11708
11709         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11710 echo "configure:11711: checking for LinuxThreads implementation" >&5
11711 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11712   echo $ac_n "(cached) $ac_c" 1>&6
11713 else
11714   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11715 fi
11716
11717 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11718
11719                         
11720         
11721         
11722         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11723 echo "configure:11724: checking for LinuxThreads consistency" >&5
11724 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11725   echo $ac_n "(cached) $ac_c" 1>&6
11726 else
11727   
11728                 if test $ol_cv_header_linux_threads = yes -a \
11729                         $ol_cv_sys_linux_threads = yes; then
11730                         ol_cv_linux_threads=yes
11731                 elif test $ol_cv_header_linux_threads = no -a \
11732                         $ol_cv_sys_linux_threads = no; then
11733                         ol_cv_linux_threads=no
11734                 else
11735                         ol_cv_linux_threads=error
11736                 fi
11737         
11738 fi
11739
11740 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11741
11742
11743                         if test $ol_cv_linux_threads = error; then
11744                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11745                         fi
11746
11747                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11748 echo "configure:11749: checking if pthread_create() works" >&5
11749 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11750   echo $ac_n "(cached) $ac_c" 1>&6
11751 else
11752   
11753                         if test "$cross_compiling" = yes; then
11754                                 ol_cv_pthread_create_works=yes
11755 else
11756   cat > conftest.$ac_ext <<EOF
11757 #line 11758 "configure"
11758 #include "confdefs.h"
11759 /* pthread test headers */
11760 #include <pthread.h>
11761 #ifndef NULL
11762 #define NULL (void*)0
11763 #endif
11764
11765 static void *task(p)
11766         void *p;
11767 {
11768         return (void *) (p == NULL);
11769 }
11770
11771
11772 int main(argc, argv)
11773         int argc;
11774         char **argv;
11775 {
11776
11777         /* pthread test function */
11778         pthread_t t;
11779         int status;
11780         int detach = 1;
11781
11782 #ifdef HAVE_PTHREADS_FINAL
11783         /* Final pthreads */
11784         pthread_attr_t attr;
11785
11786         status = pthread_attr_init(&attr);
11787         if( status ) return status;
11788
11789 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11790         if( !detach ) {
11791 #if defined( PTHREAD_CREATE_JOINABLE )
11792                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11793 #else
11794                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11795 #endif
11796
11797 #ifdef PTHREAD_CREATE_DETACHED
11798         } else {
11799                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11800 #endif
11801         }
11802         if( status ) return status;
11803 #endif
11804
11805         status = pthread_create( &t, &attr, task, NULL );
11806         if( status ) return status;
11807
11808 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11809         if( detach ) {
11810                 /* give thread a chance to complete */
11811                 /* it should remain joinable and hence detachable */
11812                 sleep( 1 );
11813
11814                 status = pthread_detach( t );
11815                 if( status ) return status;
11816         }
11817 #endif
11818
11819 #else
11820         /* Draft 4 pthreads */
11821         status = pthread_create( &t, pthread_attr_default, task, NULL );
11822         if( status ) return status;
11823
11824         if( detach ) {
11825                 /* give thread a chance to complete */
11826                 /* it should remain joinable and hence detachable */
11827                 sleep( 1 );
11828
11829                 status = pthread_detach( &t );
11830                 if( status ) return status;
11831         }
11832 #endif
11833
11834 #ifdef HAVE_LINUX_THREADS
11835         pthread_kill_other_threads_np();
11836 #endif
11837
11838         return 0;
11839
11840 }
11841
11842 EOF
11843 if { (eval echo configure:11844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11844 then
11845   ol_cv_pthread_create_works=yes
11846 else
11847   echo "configure: failed program was:" >&5
11848   cat conftest.$ac_ext >&5
11849   rm -fr conftest*
11850   ol_cv_pthread_create_works=no
11851 fi
11852 rm -fr conftest*
11853 fi
11854
11855 fi
11856
11857 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11858
11859                         if test $ol_cv_pthread_create_works = no ; then
11860                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11861                         fi
11862
11863                                                 if test $ol_with_yielding_select = auto ; then
11864                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11865 echo "configure:11866: checking if select yields when using pthreads" >&5
11866 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11867   echo $ac_n "(cached) $ac_c" 1>&6
11868 else
11869   
11870                                 if test "$cross_compiling" = yes; then
11871   ol_cv_pthread_select_yields=cross
11872 else
11873   cat > conftest.$ac_ext <<EOF
11874 #line 11875 "configure"
11875 #include "confdefs.h"
11876
11877 #include <sys/types.h>
11878 #include <sys/time.h>
11879 #include <unistd.h>
11880 #include <pthread.h>
11881 #ifndef NULL
11882 #define NULL (void*) 0
11883 #endif
11884
11885 static int fildes[2];
11886
11887 static void *task(p)
11888         void *p;
11889 {
11890         int i;
11891         struct timeval tv;
11892
11893         fd_set rfds;
11894
11895         tv.tv_sec=10;
11896         tv.tv_usec=0;
11897
11898         FD_ZERO(&rfds);
11899         FD_SET(fildes[0], &rfds);
11900
11901         /* we're not interested in any fds */
11902         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11903
11904         if(i < 0) {
11905                 perror("select");
11906                 exit(10);
11907         }
11908
11909         exit(0); /* if we exit here, the select blocked the whole process */
11910 }
11911
11912 int main(argc, argv)
11913         int argc;
11914         char **argv;
11915 {
11916         pthread_t t;
11917
11918         /* create a pipe to select */
11919         if(pipe(&fildes[0])) {
11920                 perror("select");
11921                 exit(1);
11922         }
11923
11924 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11925         (void) pthread_setconcurrency(2);
11926 #else
11927 #ifdef HAVE_THR_SETCONCURRENCY
11928         /* Set Solaris LWP concurrency to 2 */
11929         thr_setconcurrency(2);
11930 #endif
11931 #endif
11932
11933 #if HAVE_PTHREADS_D4
11934         pthread_create(&t, pthread_attr_default, task, NULL);
11935 #else
11936         pthread_create(&t, NULL, task, NULL);
11937 #endif
11938
11939 #if HAVE_SCHED_YIELD
11940         sched_yield();  /* make sure task runs first */
11941 #else
11942 #ifdef HAVE_PTHREAD_YIELD
11943         pthread_yield();        /* make sure task runs first */
11944 #endif
11945 #endif
11946
11947         exit(2);
11948 }
11949 EOF
11950 if { (eval echo configure:11951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11951 then
11952   ol_cv_pthread_select_yields=no
11953 else
11954   echo "configure: failed program was:" >&5
11955   cat conftest.$ac_ext >&5
11956   rm -fr conftest*
11957   ol_cv_pthread_select_yields=yes
11958 fi
11959 rm -fr conftest*
11960 fi
11961
11962 fi
11963
11964 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11965
11966                                 if test $ol_cv_pthread_select_yields = cross ; then
11967                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11968                                 fi
11969
11970                                 if test $ol_cv_pthread_select_yields = yes ; then
11971                                         ol_with_yielding_select=yes
11972                                 fi
11973                         fi
11974
11975                                                 CPPFLAGS="$save_CPPFLAGS"
11976                         LIBS="$save_LIBS"
11977                 else
11978                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11979                 fi
11980         fi
11981
11982         if test $ol_with_threads = posix ; then
11983                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11984         fi
11985 fi
11986
11987 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11988         -o $ol_with_threads = mach ; then
11989
11990                 for ac_hdr in mach/cthreads.h cthreads.h
11991 do
11992 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11993 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11994 echo "configure:11995: checking for $ac_hdr" >&5
11995 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11996   echo $ac_n "(cached) $ac_c" 1>&6
11997 else
11998   cat > conftest.$ac_ext <<EOF
11999 #line 12000 "configure"
12000 #include "confdefs.h"
12001 #include <$ac_hdr>
12002 EOF
12003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12004 { (eval echo configure:12005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12006 if test -z "$ac_err"; then
12007   rm -rf conftest*
12008   eval "ac_cv_header_$ac_safe=yes"
12009 else
12010   echo "$ac_err" >&5
12011   echo "configure: failed program was:" >&5
12012   cat conftest.$ac_ext >&5
12013   rm -rf conftest*
12014   eval "ac_cv_header_$ac_safe=no"
12015 fi
12016 rm -f conftest*
12017 fi
12018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12019   echo "$ac_t""yes" 1>&6
12020     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12021   cat >> confdefs.h <<EOF
12022 #define $ac_tr_hdr 1
12023 EOF
12024  
12025 else
12026   echo "$ac_t""no" 1>&6
12027 fi
12028 done
12029
12030         if test $ac_cv_header_mach_cthreads_h = yes ; then
12031                 ol_with_threads=found
12032
12033                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12034 echo "configure:12035: checking for cthread_fork" >&5
12035 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12036   echo $ac_n "(cached) $ac_c" 1>&6
12037 else
12038   cat > conftest.$ac_ext <<EOF
12039 #line 12040 "configure"
12040 #include "confdefs.h"
12041 /* System header to define __stub macros and hopefully few prototypes,
12042     which can conflict with char cthread_fork(); below.  */
12043 #include <assert.h>
12044 /* Override any gcc2 internal prototype to avoid an error.  */
12045 /* We use char because int might match the return type of a gcc2
12046     builtin and then its argument prototype would still apply.  */
12047 char cthread_fork();
12048 char (*f)();
12049
12050 int main() {
12051
12052 /* The GNU C library defines this for functions which it implements
12053     to always fail with ENOSYS.  Some functions are actually named
12054     something starting with __ and the normal name is an alias.  */
12055 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12056 choke me
12057 #else
12058 f = cthread_fork;
12059 #endif
12060
12061 ; return 0; }
12062 EOF
12063 if { (eval echo configure:12064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12064   rm -rf conftest*
12065   eval "ac_cv_func_cthread_fork=yes"
12066 else
12067   echo "configure: failed program was:" >&5
12068   cat conftest.$ac_ext >&5
12069   rm -rf conftest*
12070   eval "ac_cv_func_cthread_fork=no"
12071 fi
12072 rm -f conftest*
12073 fi
12074
12075 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12076   echo "$ac_t""yes" 1>&6
12077   ol_link_threads=yes
12078 else
12079   echo "$ac_t""no" 1>&6
12080 fi
12081
12082
12083                 if test $ol_link_threads = no ; then
12084                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
12085 echo "configure:12086: checking for cthread_fork with -all_load" >&5
12086 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
12087   echo $ac_n "(cached) $ac_c" 1>&6
12088 else
12089   
12090                                                                 save_LIBS="$LIBS"
12091                                 LIBS="-all_load $LIBS"
12092                                 cat > conftest.$ac_ext <<EOF
12093 #line 12094 "configure"
12094 #include "confdefs.h"
12095 #include <mach/cthreads.h>
12096 int main() {
12097
12098                                         cthread_fork((void *)0, (void *)0);
12099                                         
12100 ; return 0; }
12101 EOF
12102 if { (eval echo configure:12103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12103   rm -rf conftest*
12104   ol_cv_cthread_all_load=yes
12105 else
12106   echo "configure: failed program was:" >&5
12107   cat conftest.$ac_ext >&5
12108   rm -rf conftest*
12109   ol_cv_cthread_all_load=no
12110 fi
12111 rm -f conftest*
12112                                                                 LIBS="$save_LIBS"
12113                         
12114 fi
12115
12116 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12117
12118                         if test $ol_cv_cthread_all_load = yes ; then
12119                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12120                                 ol_link_threads=mach
12121                                 ol_with_threads=found
12122                         fi
12123                 fi
12124
12125         elif test $ac_cv_header_cthreads_h = yes ; then
12126                                 
12127                 ol_with_threads=found
12128  
12129                                 save_LIBS="$LIBS"
12130                 LIBS="$LIBS -lthreads"
12131                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12132 echo "configure:12133: checking for cthread_fork" >&5
12133 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12134   echo $ac_n "(cached) $ac_c" 1>&6
12135 else
12136   cat > conftest.$ac_ext <<EOF
12137 #line 12138 "configure"
12138 #include "confdefs.h"
12139 /* System header to define __stub macros and hopefully few prototypes,
12140     which can conflict with char cthread_fork(); below.  */
12141 #include <assert.h>
12142 /* Override any gcc2 internal prototype to avoid an error.  */
12143 /* We use char because int might match the return type of a gcc2
12144     builtin and then its argument prototype would still apply.  */
12145 char cthread_fork();
12146 char (*f)();
12147
12148 int main() {
12149
12150 /* The GNU C library defines this for functions which it implements
12151     to always fail with ENOSYS.  Some functions are actually named
12152     something starting with __ and the normal name is an alias.  */
12153 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12154 choke me
12155 #else
12156 f = cthread_fork;
12157 #endif
12158
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_func_cthread_fork=yes"
12164 else
12165   echo "configure: failed program was:" >&5
12166   cat conftest.$ac_ext >&5
12167   rm -rf conftest*
12168   eval "ac_cv_func_cthread_fork=no"
12169 fi
12170 rm -f conftest*
12171 fi
12172
12173 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12174   echo "$ac_t""yes" 1>&6
12175   ol_link_threads=yes
12176 else
12177   echo "$ac_t""no" 1>&6
12178 fi
12179
12180                 LIBS="$save_LIBS"
12181
12182                 if test $ol_link_threads = yes ; then
12183                         LTHREAD_LIBS="-lthreads"
12184                         ol_link_threads=mach
12185                         ol_with_threads=found
12186                 else
12187                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12188                 fi
12189
12190         elif test $ol_with_threads = mach ; then
12191                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12192         fi
12193
12194         if test $ol_link_threads = mach ; then
12195                 cat >> confdefs.h <<\EOF
12196 #define HAVE_MACH_CTHREADS 1
12197 EOF
12198
12199         elif test $ol_with_threads = found ; then
12200                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12201         fi
12202 fi
12203
12204 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12205         -o $ol_with_threads = pth ; then
12206
12207         for ac_hdr in pth.h
12208 do
12209 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12210 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12211 echo "configure:12212: checking for $ac_hdr" >&5
12212 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12213   echo $ac_n "(cached) $ac_c" 1>&6
12214 else
12215   cat > conftest.$ac_ext <<EOF
12216 #line 12217 "configure"
12217 #include "confdefs.h"
12218 #include <$ac_hdr>
12219 EOF
12220 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12221 { (eval echo configure:12222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12222 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12223 if test -z "$ac_err"; then
12224   rm -rf conftest*
12225   eval "ac_cv_header_$ac_safe=yes"
12226 else
12227   echo "$ac_err" >&5
12228   echo "configure: failed program was:" >&5
12229   cat conftest.$ac_ext >&5
12230   rm -rf conftest*
12231   eval "ac_cv_header_$ac_safe=no"
12232 fi
12233 rm -f conftest*
12234 fi
12235 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12236   echo "$ac_t""yes" 1>&6
12237     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12238   cat >> confdefs.h <<EOF
12239 #define $ac_tr_hdr 1
12240 EOF
12241  
12242 else
12243   echo "$ac_t""no" 1>&6
12244 fi
12245 done
12246
12247
12248         if test $ac_cv_header_pth_h = yes ; then
12249                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12250 echo "configure:12251: checking for pth_version in -lpth" >&5
12251 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12252 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12253   echo $ac_n "(cached) $ac_c" 1>&6
12254 else
12255   ac_save_LIBS="$LIBS"
12256 LIBS="-lpth  $LIBS"
12257 cat > conftest.$ac_ext <<EOF
12258 #line 12259 "configure"
12259 #include "confdefs.h"
12260 /* Override any gcc2 internal prototype to avoid an error.  */
12261 /* We use char because int might match the return type of a gcc2
12262     builtin and then its argument prototype would still apply.  */
12263 char pth_version();
12264
12265 int main() {
12266 pth_version()
12267 ; return 0; }
12268 EOF
12269 if { (eval echo configure:12270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12270   rm -rf conftest*
12271   eval "ac_cv_lib_$ac_lib_var=yes"
12272 else
12273   echo "configure: failed program was:" >&5
12274   cat conftest.$ac_ext >&5
12275   rm -rf conftest*
12276   eval "ac_cv_lib_$ac_lib_var=no"
12277 fi
12278 rm -f conftest*
12279 LIBS="$ac_save_LIBS"
12280
12281 fi
12282 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12283   echo "$ac_t""yes" 1>&6
12284   have_pth=yes
12285 else
12286   echo "$ac_t""no" 1>&6
12287 have_pth=no
12288 fi
12289
12290
12291                 if test $have_pth = yes ; then
12292                         cat >> confdefs.h <<\EOF
12293 #define HAVE_GNU_PTH 1
12294 EOF
12295
12296                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12297                         ol_link_threads=pth
12298                         ol_with_threads=found
12299
12300                         if test $ol_with_yielding_select = auto ; then
12301                                 ol_with_yielding_select=yes
12302                         fi
12303                 fi
12304         fi
12305 fi
12306
12307 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12308         -o $ol_with_threads = lwp ; then
12309
12310                 for ac_hdr in thread.h synch.h
12311 do
12312 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12313 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12314 echo "configure:12315: checking for $ac_hdr" >&5
12315 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12316   echo $ac_n "(cached) $ac_c" 1>&6
12317 else
12318   cat > conftest.$ac_ext <<EOF
12319 #line 12320 "configure"
12320 #include "confdefs.h"
12321 #include <$ac_hdr>
12322 EOF
12323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12324 { (eval echo configure:12325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12326 if test -z "$ac_err"; then
12327   rm -rf conftest*
12328   eval "ac_cv_header_$ac_safe=yes"
12329 else
12330   echo "$ac_err" >&5
12331   echo "configure: failed program was:" >&5
12332   cat conftest.$ac_ext >&5
12333   rm -rf conftest*
12334   eval "ac_cv_header_$ac_safe=no"
12335 fi
12336 rm -f conftest*
12337 fi
12338 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12339   echo "$ac_t""yes" 1>&6
12340     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12341   cat >> confdefs.h <<EOF
12342 #define $ac_tr_hdr 1
12343 EOF
12344  
12345 else
12346   echo "$ac_t""no" 1>&6
12347 fi
12348 done
12349
12350         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12351                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12352 echo "configure:12353: checking for thr_create in -lthread" >&5
12353 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12354 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12355   echo $ac_n "(cached) $ac_c" 1>&6
12356 else
12357   ac_save_LIBS="$LIBS"
12358 LIBS="-lthread  $LIBS"
12359 cat > conftest.$ac_ext <<EOF
12360 #line 12361 "configure"
12361 #include "confdefs.h"
12362 /* Override any gcc2 internal prototype to avoid an error.  */
12363 /* We use char because int might match the return type of a gcc2
12364     builtin and then its argument prototype would still apply.  */
12365 char thr_create();
12366
12367 int main() {
12368 thr_create()
12369 ; return 0; }
12370 EOF
12371 if { (eval echo configure:12372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12372   rm -rf conftest*
12373   eval "ac_cv_lib_$ac_lib_var=yes"
12374 else
12375   echo "configure: failed program was:" >&5
12376   cat conftest.$ac_ext >&5
12377   rm -rf conftest*
12378   eval "ac_cv_lib_$ac_lib_var=no"
12379 fi
12380 rm -f conftest*
12381 LIBS="$ac_save_LIBS"
12382
12383 fi
12384 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12385   echo "$ac_t""yes" 1>&6
12386   have_thr=yes
12387 else
12388   echo "$ac_t""no" 1>&6
12389 have_thr=no
12390 fi
12391
12392
12393                 if test $have_thr = yes ; then
12394                         cat >> confdefs.h <<\EOF
12395 #define HAVE_THR 1
12396 EOF
12397
12398                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12399                         ol_link_threads=thr
12400
12401                         if test $ol_with_yielding_select = auto ; then
12402                                 ol_with_yielding_select=yes
12403                         fi
12404
12405                                                 for ac_func in \
12406                                 thr_setconcurrency \
12407                                 thr_getconcurrency \
12408                         
12409 do
12410 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12411 echo "configure:12412: checking for $ac_func" >&5
12412 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12413   echo $ac_n "(cached) $ac_c" 1>&6
12414 else
12415   cat > conftest.$ac_ext <<EOF
12416 #line 12417 "configure"
12417 #include "confdefs.h"
12418 /* System header to define __stub macros and hopefully few prototypes,
12419     which can conflict with char $ac_func(); below.  */
12420 #include <assert.h>
12421 /* Override any gcc2 internal prototype to avoid an error.  */
12422 /* We use char because int might match the return type of a gcc2
12423     builtin and then its argument prototype would still apply.  */
12424 char $ac_func();
12425 char (*f)();
12426
12427 int main() {
12428
12429 /* The GNU C library defines this for functions which it implements
12430     to always fail with ENOSYS.  Some functions are actually named
12431     something starting with __ and the normal name is an alias.  */
12432 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12433 choke me
12434 #else
12435 f = $ac_func;
12436 #endif
12437
12438 ; return 0; }
12439 EOF
12440 if { (eval echo configure:12441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12441   rm -rf conftest*
12442   eval "ac_cv_func_$ac_func=yes"
12443 else
12444   echo "configure: failed program was:" >&5
12445   cat conftest.$ac_ext >&5
12446   rm -rf conftest*
12447   eval "ac_cv_func_$ac_func=no"
12448 fi
12449 rm -f conftest*
12450 fi
12451
12452 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12453   echo "$ac_t""yes" 1>&6
12454     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12455   cat >> confdefs.h <<EOF
12456 #define $ac_tr_func 1
12457 EOF
12458  
12459 else
12460   echo "$ac_t""no" 1>&6
12461 fi
12462 done
12463
12464                 fi
12465         fi
12466
12467                 for ac_hdr in lwp/lwp.h
12468 do
12469 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12470 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12471 echo "configure:12472: checking for $ac_hdr" >&5
12472 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12473   echo $ac_n "(cached) $ac_c" 1>&6
12474 else
12475   cat > conftest.$ac_ext <<EOF
12476 #line 12477 "configure"
12477 #include "confdefs.h"
12478 #include <$ac_hdr>
12479 EOF
12480 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12481 { (eval echo configure:12482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12482 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12483 if test -z "$ac_err"; then
12484   rm -rf conftest*
12485   eval "ac_cv_header_$ac_safe=yes"
12486 else
12487   echo "$ac_err" >&5
12488   echo "configure: failed program was:" >&5
12489   cat conftest.$ac_ext >&5
12490   rm -rf conftest*
12491   eval "ac_cv_header_$ac_safe=no"
12492 fi
12493 rm -f conftest*
12494 fi
12495 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12496   echo "$ac_t""yes" 1>&6
12497     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12498   cat >> confdefs.h <<EOF
12499 #define $ac_tr_hdr 1
12500 EOF
12501  
12502 else
12503   echo "$ac_t""no" 1>&6
12504 fi
12505 done
12506
12507         if test $ac_cv_header_lwp_lwp_h = yes ; then
12508                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12509 echo "configure:12510: checking for lwp_create in -llwp" >&5
12510 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12511 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12512   echo $ac_n "(cached) $ac_c" 1>&6
12513 else
12514   ac_save_LIBS="$LIBS"
12515 LIBS="-llwp  $LIBS"
12516 cat > conftest.$ac_ext <<EOF
12517 #line 12518 "configure"
12518 #include "confdefs.h"
12519 /* Override any gcc2 internal prototype to avoid an error.  */
12520 /* We use char because int might match the return type of a gcc2
12521     builtin and then its argument prototype would still apply.  */
12522 char lwp_create();
12523
12524 int main() {
12525 lwp_create()
12526 ; return 0; }
12527 EOF
12528 if { (eval echo configure:12529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12529   rm -rf conftest*
12530   eval "ac_cv_lib_$ac_lib_var=yes"
12531 else
12532   echo "configure: failed program was:" >&5
12533   cat conftest.$ac_ext >&5
12534   rm -rf conftest*
12535   eval "ac_cv_lib_$ac_lib_var=no"
12536 fi
12537 rm -f conftest*
12538 LIBS="$ac_save_LIBS"
12539
12540 fi
12541 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12542   echo "$ac_t""yes" 1>&6
12543   have_lwp=yes
12544 else
12545   echo "$ac_t""no" 1>&6
12546 have_lwp=no
12547 fi
12548
12549
12550                 if test $have_lwp = yes ; then
12551                         cat >> confdefs.h <<\EOF
12552 #define HAVE_LWP 1
12553 EOF
12554
12555                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12556                         ol_link_threads=lwp
12557
12558                         if test $ol_with_yielding_select = auto ; then
12559                                 ol_with_yielding_select=no
12560                         fi
12561                 fi
12562         fi
12563 fi
12564
12565 if test $ol_with_yielding_select = yes ; then
12566         cat >> confdefs.h <<\EOF
12567 #define HAVE_YIELDING_SELECT 1
12568 EOF
12569
12570 fi
12571
12572 if test $ol_with_threads = manual ; then
12573                 ol_link_threads=yes
12574
12575         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12576
12577         for ac_hdr in pthread.h sched.h
12578 do
12579 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12580 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12581 echo "configure:12582: checking for $ac_hdr" >&5
12582 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12583   echo $ac_n "(cached) $ac_c" 1>&6
12584 else
12585   cat > conftest.$ac_ext <<EOF
12586 #line 12587 "configure"
12587 #include "confdefs.h"
12588 #include <$ac_hdr>
12589 EOF
12590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12591 { (eval echo configure:12592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12593 if test -z "$ac_err"; then
12594   rm -rf conftest*
12595   eval "ac_cv_header_$ac_safe=yes"
12596 else
12597   echo "$ac_err" >&5
12598   echo "configure: failed program was:" >&5
12599   cat conftest.$ac_ext >&5
12600   rm -rf conftest*
12601   eval "ac_cv_header_$ac_safe=no"
12602 fi
12603 rm -f conftest*
12604 fi
12605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12606   echo "$ac_t""yes" 1>&6
12607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12608   cat >> confdefs.h <<EOF
12609 #define $ac_tr_hdr 1
12610 EOF
12611  
12612 else
12613   echo "$ac_t""no" 1>&6
12614 fi
12615 done
12616
12617         for ac_func in sched_yield pthread_yield
12618 do
12619 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12620 echo "configure:12621: checking for $ac_func" >&5
12621 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12622   echo $ac_n "(cached) $ac_c" 1>&6
12623 else
12624   cat > conftest.$ac_ext <<EOF
12625 #line 12626 "configure"
12626 #include "confdefs.h"
12627 /* System header to define __stub macros and hopefully few prototypes,
12628     which can conflict with char $ac_func(); below.  */
12629 #include <assert.h>
12630 /* Override any gcc2 internal prototype to avoid an error.  */
12631 /* We use char because int might match the return type of a gcc2
12632     builtin and then its argument prototype would still apply.  */
12633 char $ac_func();
12634 char (*f)();
12635
12636 int main() {
12637
12638 /* The GNU C library defines this for functions which it implements
12639     to always fail with ENOSYS.  Some functions are actually named
12640     something starting with __ and the normal name is an alias.  */
12641 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12642 choke me
12643 #else
12644 f = $ac_func;
12645 #endif
12646
12647 ; return 0; }
12648 EOF
12649 if { (eval echo configure:12650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12650   rm -rf conftest*
12651   eval "ac_cv_func_$ac_func=yes"
12652 else
12653   echo "configure: failed program was:" >&5
12654   cat conftest.$ac_ext >&5
12655   rm -rf conftest*
12656   eval "ac_cv_func_$ac_func=no"
12657 fi
12658 rm -f conftest*
12659 fi
12660
12661 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12662   echo "$ac_t""yes" 1>&6
12663     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12664   cat >> confdefs.h <<EOF
12665 #define $ac_tr_func 1
12666 EOF
12667  
12668 else
12669   echo "$ac_t""no" 1>&6
12670 fi
12671 done
12672
12673         
12674         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12675 echo "configure:12676: checking for LinuxThreads pthread.h" >&5
12676 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12677   echo $ac_n "(cached) $ac_c" 1>&6
12678 else
12679   cat > conftest.$ac_ext <<EOF
12680 #line 12681 "configure"
12681 #include "confdefs.h"
12682 #include <pthread.h>
12683 EOF
12684 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12685   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12686   rm -rf conftest*
12687   ol_cv_header_linux_threads=yes
12688 else
12689   rm -rf conftest*
12690   ol_cv_header_linux_threads=no
12691 fi
12692 rm -f conftest*
12693
12694                 
12695 fi
12696
12697 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12698         if test $ol_cv_header_linux_threads = yes; then
12699                 cat >> confdefs.h <<\EOF
12700 #define HAVE_LINUX_THREADS 1
12701 EOF
12702
12703         fi
12704
12705
12706         for ac_hdr in mach/cthreads.h
12707 do
12708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12709 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12710 echo "configure:12711: checking for $ac_hdr" >&5
12711 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12712   echo $ac_n "(cached) $ac_c" 1>&6
12713 else
12714   cat > conftest.$ac_ext <<EOF
12715 #line 12716 "configure"
12716 #include "confdefs.h"
12717 #include <$ac_hdr>
12718 EOF
12719 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12720 { (eval echo configure:12721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12721 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12722 if test -z "$ac_err"; then
12723   rm -rf conftest*
12724   eval "ac_cv_header_$ac_safe=yes"
12725 else
12726   echo "$ac_err" >&5
12727   echo "configure: failed program was:" >&5
12728   cat conftest.$ac_ext >&5
12729   rm -rf conftest*
12730   eval "ac_cv_header_$ac_safe=no"
12731 fi
12732 rm -f conftest*
12733 fi
12734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12735   echo "$ac_t""yes" 1>&6
12736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12737   cat >> confdefs.h <<EOF
12738 #define $ac_tr_hdr 1
12739 EOF
12740  
12741 else
12742   echo "$ac_t""no" 1>&6
12743 fi
12744 done
12745
12746         for ac_hdr in lwp/lwp.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         for ac_hdr in thread.h synch.h
12787 do
12788 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12789 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12790 echo "configure:12791: checking for $ac_hdr" >&5
12791 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12792   echo $ac_n "(cached) $ac_c" 1>&6
12793 else
12794   cat > conftest.$ac_ext <<EOF
12795 #line 12796 "configure"
12796 #include "confdefs.h"
12797 #include <$ac_hdr>
12798 EOF
12799 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12800 { (eval echo configure:12801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12801 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12802 if test -z "$ac_err"; then
12803   rm -rf conftest*
12804   eval "ac_cv_header_$ac_safe=yes"
12805 else
12806   echo "$ac_err" >&5
12807   echo "configure: failed program was:" >&5
12808   cat conftest.$ac_ext >&5
12809   rm -rf conftest*
12810   eval "ac_cv_header_$ac_safe=no"
12811 fi
12812 rm -f conftest*
12813 fi
12814 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12815   echo "$ac_t""yes" 1>&6
12816     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12817   cat >> confdefs.h <<EOF
12818 #define $ac_tr_hdr 1
12819 EOF
12820  
12821 else
12822   echo "$ac_t""no" 1>&6
12823 fi
12824 done
12825
12826 fi
12827
12828 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12829                         cat >> confdefs.h <<\EOF
12830 #define REENTRANT 1
12831 EOF
12832
12833         cat >> confdefs.h <<\EOF
12834 #define _REENTRANT 1
12835 EOF
12836
12837         cat >> confdefs.h <<\EOF
12838 #define THREAD_SAFE 1
12839 EOF
12840
12841         cat >> confdefs.h <<\EOF
12842 #define _THREAD_SAFE 1
12843 EOF
12844
12845         cat >> confdefs.h <<\EOF
12846 #define THREADSAFE 1
12847 EOF
12848
12849         cat >> confdefs.h <<\EOF
12850 #define _THREADSAFE 1
12851 EOF
12852
12853         cat >> confdefs.h <<\EOF
12854 #define _SGI_MP_SOURCE 1
12855 EOF
12856
12857
12858                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12859 echo "configure:12860: checking for thread specific errno" >&5
12860 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12861   echo $ac_n "(cached) $ac_c" 1>&6
12862 else
12863   
12864                 cat > conftest.$ac_ext <<EOF
12865 #line 12866 "configure"
12866 #include "confdefs.h"
12867 #include <errno.h>
12868 int main() {
12869 errno = 0;
12870 ; return 0; }
12871 EOF
12872 if { (eval echo configure:12873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12873   rm -rf conftest*
12874   ol_cv_errno_thread_specific=yes
12875 else
12876   echo "configure: failed program was:" >&5
12877   cat conftest.$ac_ext >&5
12878   rm -rf conftest*
12879   ol_cv_errno_thread_specific=no
12880 fi
12881 rm -f conftest*
12882         
12883 fi
12884
12885 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12886
12887                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12888 echo "configure:12889: checking for thread specific h_errno" >&5
12889 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12890   echo $ac_n "(cached) $ac_c" 1>&6
12891 else
12892   
12893                 cat > conftest.$ac_ext <<EOF
12894 #line 12895 "configure"
12895 #include "confdefs.h"
12896 #include <netdb.h>
12897 int main() {
12898 h_errno = 0;
12899 ; return 0; }
12900 EOF
12901 if { (eval echo configure:12902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12902   rm -rf conftest*
12903   ol_cv_h_errno_thread_specific=yes
12904 else
12905   echo "configure: failed program was:" >&5
12906   cat conftest.$ac_ext >&5
12907   rm -rf conftest*
12908   ol_cv_h_errno_thread_specific=no
12909 fi
12910 rm -f conftest*
12911         
12912 fi
12913
12914 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12915
12916         if test $ol_cv_errno_thread_specific != yes \
12917                 -o $ol_cv_h_errno_thread_specific != yes ; then
12918                 LIBS="$LTHREAD_LIBS $LIBS"
12919                 LTHREAD_LIBS=""
12920         fi
12921
12922 fi  
12923
12924 if test $ol_link_threads = no ; then
12925         if test $ol_with_threads = yes ; then
12926                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12927         fi
12928
12929         if test $ol_with_threads = auto ; then
12930                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12931                 ol_with_threads=no
12932         fi
12933
12934         cat >> confdefs.h <<\EOF
12935 #define NO_THREADS 1
12936 EOF
12937
12938         LTHREAD_LIBS=""
12939 fi
12940
12941 if test $ol_link_threads != no ; then
12942         cat >> confdefs.h <<\EOF
12943 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12944 EOF
12945
12946 fi
12947
12948 ol_link_ldbm=no 
12949
12950 if test $ol_with_ldbm_api = auto \
12951         -o $ol_with_ldbm_api = berkeley \
12952         -o $ol_with_ldbm_api = bcompat ; then
12953
12954         if test $ol_with_ldbm_api = bcompat; then \
12955                 ol_cv_berkeley_db=no
12956 for ac_hdr in db_185.h db.h
12957 do
12958 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12959 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12960 echo "configure:12961: checking for $ac_hdr" >&5
12961 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12962   echo $ac_n "(cached) $ac_c" 1>&6
12963 else
12964   cat > conftest.$ac_ext <<EOF
12965 #line 12966 "configure"
12966 #include "confdefs.h"
12967 #include <$ac_hdr>
12968 EOF
12969 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12970 { (eval echo configure:12971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12971 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12972 if test -z "$ac_err"; then
12973   rm -rf conftest*
12974   eval "ac_cv_header_$ac_safe=yes"
12975 else
12976   echo "$ac_err" >&5
12977   echo "configure: failed program was:" >&5
12978   cat conftest.$ac_ext >&5
12979   rm -rf conftest*
12980   eval "ac_cv_header_$ac_safe=no"
12981 fi
12982 rm -f conftest*
12983 fi
12984 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12985   echo "$ac_t""yes" 1>&6
12986     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12987   cat >> confdefs.h <<EOF
12988 #define $ac_tr_hdr 1
12989 EOF
12990  
12991 else
12992   echo "$ac_t""no" 1>&6
12993 fi
12994 done
12995
12996 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12997         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12998 echo "configure:12999: checking if Berkeley DB header compatibility" >&5
12999 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
13000   echo $ac_n "(cached) $ac_c" 1>&6
13001 else
13002   
13003                 cat > conftest.$ac_ext <<EOF
13004 #line 13005 "configure"
13005 #include "confdefs.h"
13006
13007 #if HAVE_DB_185_H
13008 #       include <db_185.h>
13009 #else
13010 #       include <db.h>
13011 #endif
13012
13013  /* this check could be improved */
13014 #ifndef DB_VERSION_MAJOR
13015 #       define DB_VERSION_MAJOR 1
13016 #endif
13017
13018 #if DB_VERSION_MAJOR == 1 
13019         __db_version_1
13020 #endif
13021
13022 EOF
13023 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13024   egrep "__db_version_1" >/dev/null 2>&1; then
13025   rm -rf conftest*
13026   ol_cv_header_db1=yes
13027 else
13028   rm -rf conftest*
13029   ol_cv_header_db1=no
13030 fi
13031 rm -f conftest*
13032
13033 fi
13034
13035 echo "$ac_t""$ol_cv_header_db1" 1>&6
13036
13037         if test $ol_cv_header_db1 = yes ; then
13038                 ol_cv_lib_db=no
13039 if test $ol_cv_lib_db = no ; then
13040         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13041 echo "configure:13042: checking for Berkeley DB link (default)" >&5
13042 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13043   echo $ac_n "(cached) $ac_c" 1>&6
13044 else
13045   
13046         ol_DB_LIB=
13047         ol_LIBS=$LIBS
13048         LIBS="$ol_DB_LIB $LIBS"
13049
13050         cat > conftest.$ac_ext <<EOF
13051 #line 13052 "configure"
13052 #include "confdefs.h"
13053
13054 #ifdef HAVE_DB_185_H
13055 # include <db_185.h>
13056 #else
13057 # include <db.h>
13058 #endif
13059
13060 #ifndef DB_VERSION_MAJOR
13061 # define DB_VERSION_MAJOR 1
13062 #endif
13063
13064 #ifndef NULL
13065 #define NULL ((void*)0)
13066 #endif
13067
13068 int main() {
13069
13070 #if DB_VERSION_MAJOR > 1
13071         {
13072                 char *version;
13073                 int major, minor, patch;
13074
13075                 version = db_version( &major, &minor, &patch );
13076
13077                 if( major != DB_VERSION_MAJOR ||
13078                         minor < DB_VERSION_MINOR )
13079                 {
13080                         printf("Berkeley DB version mismatch\n"
13081                                 "\texpected: %s\n\tgot: %s\n",
13082                                 DB_VERSION_STRING, version);
13083                         return 1;
13084                 }
13085         }
13086 #endif
13087
13088 #if DB_VERSION_MAJOR > 2
13089         db_env_create( NULL, 0 );
13090 #elif DB_VERSION_MAJOR > 1
13091         db_appexit( NULL );
13092 #else
13093         (void) dbopen( NULL, 0, 0, 0, NULL);
13094 #endif
13095
13096 ; return 0; }
13097 EOF
13098 if { (eval echo configure:13099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13099   rm -rf conftest*
13100   ol_cv_db_none=yes
13101 else
13102   echo "configure: failed program was:" >&5
13103   cat conftest.$ac_ext >&5
13104   rm -rf conftest*
13105   ol_cv_db_none=no
13106 fi
13107 rm -f conftest*
13108
13109         LIBS="$ol_LIBS"
13110
13111 fi
13112
13113 echo "$ac_t""$ol_cv_db_none" 1>&6
13114
13115         if test $ol_cv_db_none = yes ; then
13116                 ol_cv_lib_db=yes
13117         fi
13118 fi
13119
13120 if test $ol_cv_lib_db = no ; then
13121         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13122 echo "configure:13123: checking for Berkeley DB link (-ldb)" >&5
13123 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13124   echo $ac_n "(cached) $ac_c" 1>&6
13125 else
13126   
13127         ol_DB_LIB=-ldb
13128         ol_LIBS=$LIBS
13129         LIBS="$ol_DB_LIB $LIBS"
13130
13131         cat > conftest.$ac_ext <<EOF
13132 #line 13133 "configure"
13133 #include "confdefs.h"
13134
13135 #ifdef HAVE_DB_185_H
13136 # include <db_185.h>
13137 #else
13138 # include <db.h>
13139 #endif
13140
13141 #ifndef DB_VERSION_MAJOR
13142 # define DB_VERSION_MAJOR 1
13143 #endif
13144
13145 #ifndef NULL
13146 #define NULL ((void*)0)
13147 #endif
13148
13149 int main() {
13150
13151 #if DB_VERSION_MAJOR > 1
13152         {
13153                 char *version;
13154                 int major, minor, patch;
13155
13156                 version = db_version( &major, &minor, &patch );
13157
13158                 if( major != DB_VERSION_MAJOR ||
13159                         minor < DB_VERSION_MINOR )
13160                 {
13161                         printf("Berkeley DB version mismatch\n"
13162                                 "\texpected: %s\n\tgot: %s\n",
13163                                 DB_VERSION_STRING, version);
13164                         return 1;
13165                 }
13166         }
13167 #endif
13168
13169 #if DB_VERSION_MAJOR > 2
13170         db_env_create( NULL, 0 );
13171 #elif DB_VERSION_MAJOR > 1
13172         db_appexit( NULL );
13173 #else
13174         (void) dbopen( NULL, 0, 0, 0, NULL);
13175 #endif
13176
13177 ; return 0; }
13178 EOF
13179 if { (eval echo configure:13180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13180   rm -rf conftest*
13181   ol_cv_db_db=yes
13182 else
13183   echo "configure: failed program was:" >&5
13184   cat conftest.$ac_ext >&5
13185   rm -rf conftest*
13186   ol_cv_db_db=no
13187 fi
13188 rm -f conftest*
13189
13190         LIBS="$ol_LIBS"
13191
13192 fi
13193
13194 echo "$ac_t""$ol_cv_db_db" 1>&6
13195
13196         if test $ol_cv_db_db = yes ; then
13197                 ol_cv_lib_db=-ldb
13198         fi
13199 fi
13200
13201 if test $ol_cv_lib_db = no ; then
13202         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
13203 echo "configure:13204: checking for Berkeley DB link (-ldb4)" >&5
13204 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
13205   echo $ac_n "(cached) $ac_c" 1>&6
13206 else
13207   
13208         ol_DB_LIB=-ldb4
13209         ol_LIBS=$LIBS
13210         LIBS="$ol_DB_LIB $LIBS"
13211
13212         cat > conftest.$ac_ext <<EOF
13213 #line 13214 "configure"
13214 #include "confdefs.h"
13215
13216 #ifdef HAVE_DB_185_H
13217 # include <db_185.h>
13218 #else
13219 # include <db.h>
13220 #endif
13221
13222 #ifndef DB_VERSION_MAJOR
13223 # define DB_VERSION_MAJOR 1
13224 #endif
13225
13226 #ifndef NULL
13227 #define NULL ((void*)0)
13228 #endif
13229
13230 int main() {
13231
13232 #if DB_VERSION_MAJOR > 1
13233         {
13234                 char *version;
13235                 int major, minor, patch;
13236
13237                 version = db_version( &major, &minor, &patch );
13238
13239                 if( major != DB_VERSION_MAJOR ||
13240                         minor < DB_VERSION_MINOR )
13241                 {
13242                         printf("Berkeley DB version mismatch\n"
13243                                 "\texpected: %s\n\tgot: %s\n",
13244                                 DB_VERSION_STRING, version);
13245                         return 1;
13246                 }
13247         }
13248 #endif
13249
13250 #if DB_VERSION_MAJOR > 2
13251         db_env_create( NULL, 0 );
13252 #elif DB_VERSION_MAJOR > 1
13253         db_appexit( NULL );
13254 #else
13255         (void) dbopen( NULL, 0, 0, 0, NULL);
13256 #endif
13257
13258 ; return 0; }
13259 EOF
13260 if { (eval echo configure:13261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13261   rm -rf conftest*
13262   ol_cv_db_db4=yes
13263 else
13264   echo "configure: failed program was:" >&5
13265   cat conftest.$ac_ext >&5
13266   rm -rf conftest*
13267   ol_cv_db_db4=no
13268 fi
13269 rm -f conftest*
13270
13271         LIBS="$ol_LIBS"
13272
13273 fi
13274
13275 echo "$ac_t""$ol_cv_db_db4" 1>&6
13276
13277         if test $ol_cv_db_db4 = yes ; then
13278                 ol_cv_lib_db=-ldb4
13279         fi
13280 fi
13281
13282 if test $ol_cv_lib_db = no ; then
13283         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13284 echo "configure:13285: checking for Berkeley DB link (-ldb3)" >&5
13285 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13286   echo $ac_n "(cached) $ac_c" 1>&6
13287 else
13288   
13289         ol_DB_LIB=-ldb3
13290         ol_LIBS=$LIBS
13291         LIBS="$ol_DB_LIB $LIBS"
13292
13293         cat > conftest.$ac_ext <<EOF
13294 #line 13295 "configure"
13295 #include "confdefs.h"
13296
13297 #ifdef HAVE_DB_185_H
13298 # include <db_185.h>
13299 #else
13300 # include <db.h>
13301 #endif
13302
13303 #ifndef DB_VERSION_MAJOR
13304 # define DB_VERSION_MAJOR 1
13305 #endif
13306
13307 #ifndef NULL
13308 #define NULL ((void*)0)
13309 #endif
13310
13311 int main() {
13312
13313 #if DB_VERSION_MAJOR > 1
13314         {
13315                 char *version;
13316                 int major, minor, patch;
13317
13318                 version = db_version( &major, &minor, &patch );
13319
13320                 if( major != DB_VERSION_MAJOR ||
13321                         minor < DB_VERSION_MINOR )
13322                 {
13323                         printf("Berkeley DB version mismatch\n"
13324                                 "\texpected: %s\n\tgot: %s\n",
13325                                 DB_VERSION_STRING, version);
13326                         return 1;
13327                 }
13328         }
13329 #endif
13330
13331 #if DB_VERSION_MAJOR > 2
13332         db_env_create( NULL, 0 );
13333 #elif DB_VERSION_MAJOR > 1
13334         db_appexit( NULL );
13335 #else
13336         (void) dbopen( NULL, 0, 0, 0, NULL);
13337 #endif
13338
13339 ; return 0; }
13340 EOF
13341 if { (eval echo configure:13342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13342   rm -rf conftest*
13343   ol_cv_db_db3=yes
13344 else
13345   echo "configure: failed program was:" >&5
13346   cat conftest.$ac_ext >&5
13347   rm -rf conftest*
13348   ol_cv_db_db3=no
13349 fi
13350 rm -f conftest*
13351
13352         LIBS="$ol_LIBS"
13353
13354 fi
13355
13356 echo "$ac_t""$ol_cv_db_db3" 1>&6
13357
13358         if test $ol_cv_db_db3 = yes ; then
13359                 ol_cv_lib_db=-ldb3
13360         fi
13361 fi
13362
13363 if test $ol_cv_lib_db = no ; then
13364         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13365 echo "configure:13366: checking for Berkeley DB link (-ldb2)" >&5
13366 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13367   echo $ac_n "(cached) $ac_c" 1>&6
13368 else
13369   
13370         ol_DB_LIB=-ldb2
13371         ol_LIBS=$LIBS
13372         LIBS="$ol_DB_LIB $LIBS"
13373
13374         cat > conftest.$ac_ext <<EOF
13375 #line 13376 "configure"
13376 #include "confdefs.h"
13377
13378 #ifdef HAVE_DB_185_H
13379 # include <db_185.h>
13380 #else
13381 # include <db.h>
13382 #endif
13383
13384 #ifndef DB_VERSION_MAJOR
13385 # define DB_VERSION_MAJOR 1
13386 #endif
13387
13388 #ifndef NULL
13389 #define NULL ((void*)0)
13390 #endif
13391
13392 int main() {
13393
13394 #if DB_VERSION_MAJOR > 1
13395         {
13396                 char *version;
13397                 int major, minor, patch;
13398
13399                 version = db_version( &major, &minor, &patch );
13400
13401                 if( major != DB_VERSION_MAJOR ||
13402                         minor < DB_VERSION_MINOR )
13403                 {
13404                         printf("Berkeley DB version mismatch\n"
13405                                 "\texpected: %s\n\tgot: %s\n",
13406                                 DB_VERSION_STRING, version);
13407                         return 1;
13408                 }
13409         }
13410 #endif
13411
13412 #if DB_VERSION_MAJOR > 2
13413         db_env_create( NULL, 0 );
13414 #elif DB_VERSION_MAJOR > 1
13415         db_appexit( NULL );
13416 #else
13417         (void) dbopen( NULL, 0, 0, 0, NULL);
13418 #endif
13419
13420 ; return 0; }
13421 EOF
13422 if { (eval echo configure:13423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13423   rm -rf conftest*
13424   ol_cv_db_db2=yes
13425 else
13426   echo "configure: failed program was:" >&5
13427   cat conftest.$ac_ext >&5
13428   rm -rf conftest*
13429   ol_cv_db_db2=no
13430 fi
13431 rm -f conftest*
13432
13433         LIBS="$ol_LIBS"
13434
13435 fi
13436
13437 echo "$ac_t""$ol_cv_db_db2" 1>&6
13438
13439         if test $ol_cv_db_db2 = yes ; then
13440                 ol_cv_lib_db=-ldb2
13441         fi
13442 fi
13443
13444 if test $ol_cv_lib_db = no ; then
13445         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13446 echo "configure:13447: checking for Berkeley DB link (-ldb1)" >&5
13447 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13448   echo $ac_n "(cached) $ac_c" 1>&6
13449 else
13450   
13451         ol_DB_LIB=-ldb1
13452         ol_LIBS=$LIBS
13453         LIBS="$ol_DB_LIB $LIBS"
13454
13455         cat > conftest.$ac_ext <<EOF
13456 #line 13457 "configure"
13457 #include "confdefs.h"
13458
13459 #ifdef HAVE_DB_185_H
13460 # include <db_185.h>
13461 #else
13462 # include <db.h>
13463 #endif
13464
13465 #ifndef DB_VERSION_MAJOR
13466 # define DB_VERSION_MAJOR 1
13467 #endif
13468
13469 #ifndef NULL
13470 #define NULL ((void*)0)
13471 #endif
13472
13473 int main() {
13474
13475 #if DB_VERSION_MAJOR > 1
13476         {
13477                 char *version;
13478                 int major, minor, patch;
13479
13480                 version = db_version( &major, &minor, &patch );
13481
13482                 if( major != DB_VERSION_MAJOR ||
13483                         minor < DB_VERSION_MINOR )
13484                 {
13485                         printf("Berkeley DB version mismatch\n"
13486                                 "\texpected: %s\n\tgot: %s\n",
13487                                 DB_VERSION_STRING, version);
13488                         return 1;
13489                 }
13490         }
13491 #endif
13492
13493 #if DB_VERSION_MAJOR > 2
13494         db_env_create( NULL, 0 );
13495 #elif DB_VERSION_MAJOR > 1
13496         db_appexit( NULL );
13497 #else
13498         (void) dbopen( NULL, 0, 0, 0, NULL);
13499 #endif
13500
13501 ; return 0; }
13502 EOF
13503 if { (eval echo configure:13504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13504   rm -rf conftest*
13505   ol_cv_db_db1=yes
13506 else
13507   echo "configure: failed program was:" >&5
13508   cat conftest.$ac_ext >&5
13509   rm -rf conftest*
13510   ol_cv_db_db1=no
13511 fi
13512 rm -f conftest*
13513
13514         LIBS="$ol_LIBS"
13515
13516 fi
13517
13518 echo "$ac_t""$ol_cv_db_db1" 1>&6
13519
13520         if test $ol_cv_db_db1 = yes ; then
13521                 ol_cv_lib_db=-ldb1
13522         fi
13523 fi
13524
13525
13526                 if test "$ol_cv_lib_db" != no ; then
13527                         ol_cv_berkeley_db=yes
13528                 fi
13529         fi
13530 fi
13531
13532         else
13533                 ol_cv_berkeley_db=no
13534 for ac_hdr in db.h
13535 do
13536 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13537 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13538 echo "configure:13539: checking for $ac_hdr" >&5
13539 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13540   echo $ac_n "(cached) $ac_c" 1>&6
13541 else
13542   cat > conftest.$ac_ext <<EOF
13543 #line 13544 "configure"
13544 #include "confdefs.h"
13545 #include <$ac_hdr>
13546 EOF
13547 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13548 { (eval echo configure:13549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13549 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13550 if test -z "$ac_err"; then
13551   rm -rf conftest*
13552   eval "ac_cv_header_$ac_safe=yes"
13553 else
13554   echo "$ac_err" >&5
13555   echo "configure: failed program was:" >&5
13556   cat conftest.$ac_ext >&5
13557   rm -rf conftest*
13558   eval "ac_cv_header_$ac_safe=no"
13559 fi
13560 rm -f conftest*
13561 fi
13562 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13563   echo "$ac_t""yes" 1>&6
13564     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13565   cat >> confdefs.h <<EOF
13566 #define $ac_tr_hdr 1
13567 EOF
13568  
13569 else
13570   echo "$ac_t""no" 1>&6
13571 fi
13572 done
13573
13574 if test $ac_cv_header_db_h = yes; then
13575         ol_cv_lib_db=no
13576 if test $ol_cv_lib_db = no ; then
13577         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13578 echo "configure:13579: checking for Berkeley DB link (default)" >&5
13579 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13580   echo $ac_n "(cached) $ac_c" 1>&6
13581 else
13582   
13583         ol_DB_LIB=
13584         ol_LIBS=$LIBS
13585         LIBS="$ol_DB_LIB $LIBS"
13586
13587         cat > conftest.$ac_ext <<EOF
13588 #line 13589 "configure"
13589 #include "confdefs.h"
13590
13591 #ifdef HAVE_DB_185_H
13592 # include <db_185.h>
13593 #else
13594 # include <db.h>
13595 #endif
13596
13597 #ifndef DB_VERSION_MAJOR
13598 # define DB_VERSION_MAJOR 1
13599 #endif
13600
13601 #ifndef NULL
13602 #define NULL ((void*)0)
13603 #endif
13604
13605 int main() {
13606
13607 #if DB_VERSION_MAJOR > 1
13608         {
13609                 char *version;
13610                 int major, minor, patch;
13611
13612                 version = db_version( &major, &minor, &patch );
13613
13614                 if( major != DB_VERSION_MAJOR ||
13615                         minor < DB_VERSION_MINOR )
13616                 {
13617                         printf("Berkeley DB version mismatch\n"
13618                                 "\texpected: %s\n\tgot: %s\n",
13619                                 DB_VERSION_STRING, version);
13620                         return 1;
13621                 }
13622         }
13623 #endif
13624
13625 #if DB_VERSION_MAJOR > 2
13626         db_env_create( NULL, 0 );
13627 #elif DB_VERSION_MAJOR > 1
13628         db_appexit( NULL );
13629 #else
13630         (void) dbopen( NULL, 0, 0, 0, NULL);
13631 #endif
13632
13633 ; return 0; }
13634 EOF
13635 if { (eval echo configure:13636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13636   rm -rf conftest*
13637   ol_cv_db_none=yes
13638 else
13639   echo "configure: failed program was:" >&5
13640   cat conftest.$ac_ext >&5
13641   rm -rf conftest*
13642   ol_cv_db_none=no
13643 fi
13644 rm -f conftest*
13645
13646         LIBS="$ol_LIBS"
13647
13648 fi
13649
13650 echo "$ac_t""$ol_cv_db_none" 1>&6
13651
13652         if test $ol_cv_db_none = yes ; then
13653                 ol_cv_lib_db=yes
13654         fi
13655 fi
13656
13657 if test $ol_cv_lib_db = no ; then
13658         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13659 echo "configure:13660: checking for Berkeley DB link (-ldb)" >&5
13660 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13661   echo $ac_n "(cached) $ac_c" 1>&6
13662 else
13663   
13664         ol_DB_LIB=-ldb
13665         ol_LIBS=$LIBS
13666         LIBS="$ol_DB_LIB $LIBS"
13667
13668         cat > conftest.$ac_ext <<EOF
13669 #line 13670 "configure"
13670 #include "confdefs.h"
13671
13672 #ifdef HAVE_DB_185_H
13673 # include <db_185.h>
13674 #else
13675 # include <db.h>
13676 #endif
13677
13678 #ifndef DB_VERSION_MAJOR
13679 # define DB_VERSION_MAJOR 1
13680 #endif
13681
13682 #ifndef NULL
13683 #define NULL ((void*)0)
13684 #endif
13685
13686 int main() {
13687
13688 #if DB_VERSION_MAJOR > 1
13689         {
13690                 char *version;
13691                 int major, minor, patch;
13692
13693                 version = db_version( &major, &minor, &patch );
13694
13695                 if( major != DB_VERSION_MAJOR ||
13696                         minor < DB_VERSION_MINOR )
13697                 {
13698                         printf("Berkeley DB version mismatch\n"
13699                                 "\texpected: %s\n\tgot: %s\n",
13700                                 DB_VERSION_STRING, version);
13701                         return 1;
13702                 }
13703         }
13704 #endif
13705
13706 #if DB_VERSION_MAJOR > 2
13707         db_env_create( NULL, 0 );
13708 #elif DB_VERSION_MAJOR > 1
13709         db_appexit( NULL );
13710 #else
13711         (void) dbopen( NULL, 0, 0, 0, NULL);
13712 #endif
13713
13714 ; return 0; }
13715 EOF
13716 if { (eval echo configure:13717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13717   rm -rf conftest*
13718   ol_cv_db_db=yes
13719 else
13720   echo "configure: failed program was:" >&5
13721   cat conftest.$ac_ext >&5
13722   rm -rf conftest*
13723   ol_cv_db_db=no
13724 fi
13725 rm -f conftest*
13726
13727         LIBS="$ol_LIBS"
13728
13729 fi
13730
13731 echo "$ac_t""$ol_cv_db_db" 1>&6
13732
13733         if test $ol_cv_db_db = yes ; then
13734                 ol_cv_lib_db=-ldb
13735         fi
13736 fi
13737
13738 if test $ol_cv_lib_db = no ; then
13739         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
13740 echo "configure:13741: checking for Berkeley DB link (-ldb4)" >&5
13741 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
13742   echo $ac_n "(cached) $ac_c" 1>&6
13743 else
13744   
13745         ol_DB_LIB=-ldb4
13746         ol_LIBS=$LIBS
13747         LIBS="$ol_DB_LIB $LIBS"
13748
13749         cat > conftest.$ac_ext <<EOF
13750 #line 13751 "configure"
13751 #include "confdefs.h"
13752
13753 #ifdef HAVE_DB_185_H
13754 # include <db_185.h>
13755 #else
13756 # include <db.h>
13757 #endif
13758
13759 #ifndef DB_VERSION_MAJOR
13760 # define DB_VERSION_MAJOR 1
13761 #endif
13762
13763 #ifndef NULL
13764 #define NULL ((void*)0)
13765 #endif
13766
13767 int main() {
13768
13769 #if DB_VERSION_MAJOR > 1
13770         {
13771                 char *version;
13772                 int major, minor, patch;
13773
13774                 version = db_version( &major, &minor, &patch );
13775
13776                 if( major != DB_VERSION_MAJOR ||
13777                         minor < DB_VERSION_MINOR )
13778                 {
13779                         printf("Berkeley DB version mismatch\n"
13780                                 "\texpected: %s\n\tgot: %s\n",
13781                                 DB_VERSION_STRING, version);
13782                         return 1;
13783                 }
13784         }
13785 #endif
13786
13787 #if DB_VERSION_MAJOR > 2
13788         db_env_create( NULL, 0 );
13789 #elif DB_VERSION_MAJOR > 1
13790         db_appexit( NULL );
13791 #else
13792         (void) dbopen( NULL, 0, 0, 0, NULL);
13793 #endif
13794
13795 ; return 0; }
13796 EOF
13797 if { (eval echo configure:13798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13798   rm -rf conftest*
13799   ol_cv_db_db4=yes
13800 else
13801   echo "configure: failed program was:" >&5
13802   cat conftest.$ac_ext >&5
13803   rm -rf conftest*
13804   ol_cv_db_db4=no
13805 fi
13806 rm -f conftest*
13807
13808         LIBS="$ol_LIBS"
13809
13810 fi
13811
13812 echo "$ac_t""$ol_cv_db_db4" 1>&6
13813
13814         if test $ol_cv_db_db4 = yes ; then
13815                 ol_cv_lib_db=-ldb4
13816         fi
13817 fi
13818
13819 if test $ol_cv_lib_db = no ; then
13820         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13821 echo "configure:13822: checking for Berkeley DB link (-ldb3)" >&5
13822 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13823   echo $ac_n "(cached) $ac_c" 1>&6
13824 else
13825   
13826         ol_DB_LIB=-ldb3
13827         ol_LIBS=$LIBS
13828         LIBS="$ol_DB_LIB $LIBS"
13829
13830         cat > conftest.$ac_ext <<EOF
13831 #line 13832 "configure"
13832 #include "confdefs.h"
13833
13834 #ifdef HAVE_DB_185_H
13835 # include <db_185.h>
13836 #else
13837 # include <db.h>
13838 #endif
13839
13840 #ifndef DB_VERSION_MAJOR
13841 # define DB_VERSION_MAJOR 1
13842 #endif
13843
13844 #ifndef NULL
13845 #define NULL ((void*)0)
13846 #endif
13847
13848 int main() {
13849
13850 #if DB_VERSION_MAJOR > 1
13851         {
13852                 char *version;
13853                 int major, minor, patch;
13854
13855                 version = db_version( &major, &minor, &patch );
13856
13857                 if( major != DB_VERSION_MAJOR ||
13858                         minor < DB_VERSION_MINOR )
13859                 {
13860                         printf("Berkeley DB version mismatch\n"
13861                                 "\texpected: %s\n\tgot: %s\n",
13862                                 DB_VERSION_STRING, version);
13863                         return 1;
13864                 }
13865         }
13866 #endif
13867
13868 #if DB_VERSION_MAJOR > 2
13869         db_env_create( NULL, 0 );
13870 #elif DB_VERSION_MAJOR > 1
13871         db_appexit( NULL );
13872 #else
13873         (void) dbopen( NULL, 0, 0, 0, NULL);
13874 #endif
13875
13876 ; return 0; }
13877 EOF
13878 if { (eval echo configure:13879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13879   rm -rf conftest*
13880   ol_cv_db_db3=yes
13881 else
13882   echo "configure: failed program was:" >&5
13883   cat conftest.$ac_ext >&5
13884   rm -rf conftest*
13885   ol_cv_db_db3=no
13886 fi
13887 rm -f conftest*
13888
13889         LIBS="$ol_LIBS"
13890
13891 fi
13892
13893 echo "$ac_t""$ol_cv_db_db3" 1>&6
13894
13895         if test $ol_cv_db_db3 = yes ; then
13896                 ol_cv_lib_db=-ldb3
13897         fi
13898 fi
13899
13900 if test $ol_cv_lib_db = no ; then
13901         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13902 echo "configure:13903: checking for Berkeley DB link (-ldb2)" >&5
13903 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13904   echo $ac_n "(cached) $ac_c" 1>&6
13905 else
13906   
13907         ol_DB_LIB=-ldb2
13908         ol_LIBS=$LIBS
13909         LIBS="$ol_DB_LIB $LIBS"
13910
13911         cat > conftest.$ac_ext <<EOF
13912 #line 13913 "configure"
13913 #include "confdefs.h"
13914
13915 #ifdef HAVE_DB_185_H
13916 # include <db_185.h>
13917 #else
13918 # include <db.h>
13919 #endif
13920
13921 #ifndef DB_VERSION_MAJOR
13922 # define DB_VERSION_MAJOR 1
13923 #endif
13924
13925 #ifndef NULL
13926 #define NULL ((void*)0)
13927 #endif
13928
13929 int main() {
13930
13931 #if DB_VERSION_MAJOR > 1
13932         {
13933                 char *version;
13934                 int major, minor, patch;
13935
13936                 version = db_version( &major, &minor, &patch );
13937
13938                 if( major != DB_VERSION_MAJOR ||
13939                         minor < DB_VERSION_MINOR )
13940                 {
13941                         printf("Berkeley DB version mismatch\n"
13942                                 "\texpected: %s\n\tgot: %s\n",
13943                                 DB_VERSION_STRING, version);
13944                         return 1;
13945                 }
13946         }
13947 #endif
13948
13949 #if DB_VERSION_MAJOR > 2
13950         db_env_create( NULL, 0 );
13951 #elif DB_VERSION_MAJOR > 1
13952         db_appexit( NULL );
13953 #else
13954         (void) dbopen( NULL, 0, 0, 0, NULL);
13955 #endif
13956
13957 ; return 0; }
13958 EOF
13959 if { (eval echo configure:13960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13960   rm -rf conftest*
13961   ol_cv_db_db2=yes
13962 else
13963   echo "configure: failed program was:" >&5
13964   cat conftest.$ac_ext >&5
13965   rm -rf conftest*
13966   ol_cv_db_db2=no
13967 fi
13968 rm -f conftest*
13969
13970         LIBS="$ol_LIBS"
13971
13972 fi
13973
13974 echo "$ac_t""$ol_cv_db_db2" 1>&6
13975
13976         if test $ol_cv_db_db2 = yes ; then
13977                 ol_cv_lib_db=-ldb2
13978         fi
13979 fi
13980
13981 if test $ol_cv_lib_db = no ; then
13982         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13983 echo "configure:13984: checking for Berkeley DB link (-ldb1)" >&5
13984 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13985   echo $ac_n "(cached) $ac_c" 1>&6
13986 else
13987   
13988         ol_DB_LIB=-ldb1
13989         ol_LIBS=$LIBS
13990         LIBS="$ol_DB_LIB $LIBS"
13991
13992         cat > conftest.$ac_ext <<EOF
13993 #line 13994 "configure"
13994 #include "confdefs.h"
13995
13996 #ifdef HAVE_DB_185_H
13997 # include <db_185.h>
13998 #else
13999 # include <db.h>
14000 #endif
14001
14002 #ifndef DB_VERSION_MAJOR
14003 # define DB_VERSION_MAJOR 1
14004 #endif
14005
14006 #ifndef NULL
14007 #define NULL ((void*)0)
14008 #endif
14009
14010 int main() {
14011
14012 #if DB_VERSION_MAJOR > 1
14013         {
14014                 char *version;
14015                 int major, minor, patch;
14016
14017                 version = db_version( &major, &minor, &patch );
14018
14019                 if( major != DB_VERSION_MAJOR ||
14020                         minor < DB_VERSION_MINOR )
14021                 {
14022                         printf("Berkeley DB version mismatch\n"
14023                                 "\texpected: %s\n\tgot: %s\n",
14024                                 DB_VERSION_STRING, version);
14025                         return 1;
14026                 }
14027         }
14028 #endif
14029
14030 #if DB_VERSION_MAJOR > 2
14031         db_env_create( NULL, 0 );
14032 #elif DB_VERSION_MAJOR > 1
14033         db_appexit( NULL );
14034 #else
14035         (void) dbopen( NULL, 0, 0, 0, NULL);
14036 #endif
14037
14038 ; return 0; }
14039 EOF
14040 if { (eval echo configure:14041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14041   rm -rf conftest*
14042   ol_cv_db_db1=yes
14043 else
14044   echo "configure: failed program was:" >&5
14045   cat conftest.$ac_ext >&5
14046   rm -rf conftest*
14047   ol_cv_db_db1=no
14048 fi
14049 rm -f conftest*
14050
14051         LIBS="$ol_LIBS"
14052
14053 fi
14054
14055 echo "$ac_t""$ol_cv_db_db1" 1>&6
14056
14057         if test $ol_cv_db_db1 = yes ; then
14058                 ol_cv_lib_db=-ldb1
14059         fi
14060 fi
14061
14062
14063         if test "$ol_cv_lib_db" != no ; then
14064                 ol_cv_berkeley_db=yes
14065                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
14066 echo "configure:14067: checking for Berkeley DB thread support" >&5
14067 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
14068   echo $ac_n "(cached) $ac_c" 1>&6
14069 else
14070   
14071         ol_LIBS="$LIBS"
14072         if test $ol_cv_lib_db != yes ; then
14073                 LIBS="$ol_cv_lib_db"
14074         fi
14075
14076         if test "$cross_compiling" = yes; then
14077   ol_cv_berkeley_db_thread=cross
14078 else
14079   cat > conftest.$ac_ext <<EOF
14080 #line 14081 "configure"
14081 #include "confdefs.h"
14082
14083 #ifdef HAVE_DB_185_H
14084         choke me;
14085 #else
14086 #include <db.h>
14087 #endif
14088 #ifndef NULL
14089 #define NULL ((void *)0)
14090 #endif
14091 main()
14092 {
14093         int rc;
14094         u_int32_t flags = DB_CREATE |
14095 #ifdef DB_PRIVATE
14096                 DB_PRIVATE |
14097 #endif
14098                 DB_THREAD;
14099
14100 #if DB_VERSION_MAJOR > 2
14101         DB_ENV *env = NULL;
14102
14103         rc = db_env_create( &env, 0 );
14104
14105         flags |= DB_INIT_MPOOL;
14106 #ifdef DB_MPOOL_PRIVATE
14107         flags |= DB_MPOOL_PRIVATE;
14108 #endif
14109
14110         if( rc ) {
14111                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14112                 return rc;
14113         }
14114
14115 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
14116         rc = env->open( env, NULL, flags, 0 );
14117 #else
14118         rc = env->open( env, NULL, NULL, flags, 0 );
14119 #endif
14120
14121         if ( rc == 0 ) {
14122                 rc = env->close( env, 0 );
14123         }
14124
14125         if( rc ) {
14126                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14127                 return rc;
14128         }
14129
14130 #else
14131         DB_ENV env;
14132         memset( &env, '\0', sizeof(env) );
14133
14134         rc = db_appinit( NULL, NULL, &env, flags );
14135
14136         if( rc == 0 ) {
14137                 db_appexit( &env );
14138         }
14139
14140         unlink("__db_mpool.share");
14141         unlink("__db_lock.share");
14142 #endif
14143
14144         return rc;
14145 }
14146 EOF
14147 if { (eval echo configure:14148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14148 then
14149   ol_cv_berkeley_db_thread=yes
14150 else
14151   echo "configure: failed program was:" >&5
14152   cat conftest.$ac_ext >&5
14153   rm -fr conftest*
14154   ol_cv_berkeley_db_thread=no
14155 fi
14156 rm -fr conftest*
14157 fi
14158
14159
14160         LIBS="$ol_LIBS"
14161
14162         if test $ol_cv_berkeley_db_thread != no ; then
14163                 cat >> confdefs.h <<\EOF
14164 #define HAVE_BERKELEY_DB_THREAD 1
14165 EOF
14166
14167         fi
14168
14169 fi
14170
14171 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
14172         fi
14173 fi
14174
14175         fi
14176
14177         if test $ol_cv_berkeley_db != no ; then
14178                 cat >> confdefs.h <<\EOF
14179 #define HAVE_BERKELEY_DB 1
14180 EOF
14181
14182
14183                 ol_link_ldbm=berkeley
14184                 ol_with_ldbm_api=berkeley
14185
14186                 if test $ol_with_ldbm_type = hash ; then
14187                         cat >> confdefs.h <<\EOF
14188 #define LDBM_USE_DBHASH 1
14189 EOF
14190
14191                 else
14192                         cat >> confdefs.h <<\EOF
14193 #define LDBM_USE_DBBTREE 1
14194 EOF
14195
14196                 fi
14197
14198                                                 if test $ol_cv_lib_db != yes ; then
14199                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
14200                 fi
14201         fi
14202 fi
14203
14204 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
14205         { echo "configure: error: BerkeleyDB not available" 1>&2; exit 1; }
14206 elif test $ol_enable_bdb != no -a $ol_link_ldbm != berkeley ; then
14207         ol_enable_bdb=yes
14208 fi
14209
14210 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
14211         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
14212         ol_with_ldbm_api=none
14213 fi
14214
14215 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
14216         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
14217 echo "configure:14218: checking for MDBM library" >&5
14218 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
14219   echo $ac_n "(cached) $ac_c" 1>&6
14220 else
14221         ol_LIBS="$LIBS"
14222         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
14223 echo "configure:14224: checking for mdbm_set_chain" >&5
14224 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
14225   echo $ac_n "(cached) $ac_c" 1>&6
14226 else
14227   cat > conftest.$ac_ext <<EOF
14228 #line 14229 "configure"
14229 #include "confdefs.h"
14230 /* System header to define __stub macros and hopefully few prototypes,
14231     which can conflict with char mdbm_set_chain(); below.  */
14232 #include <assert.h>
14233 /* Override any gcc2 internal prototype to avoid an error.  */
14234 /* We use char because int might match the return type of a gcc2
14235     builtin and then its argument prototype would still apply.  */
14236 char mdbm_set_chain();
14237 char (*f)();
14238
14239 int main() {
14240
14241 /* The GNU C library defines this for functions which it implements
14242     to always fail with ENOSYS.  Some functions are actually named
14243     something starting with __ and the normal name is an alias.  */
14244 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
14245 choke me
14246 #else
14247 f = mdbm_set_chain;
14248 #endif
14249
14250 ; return 0; }
14251 EOF
14252 if { (eval echo configure:14253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14253   rm -rf conftest*
14254   eval "ac_cv_func_mdbm_set_chain=yes"
14255 else
14256   echo "configure: failed program was:" >&5
14257   cat conftest.$ac_ext >&5
14258   rm -rf conftest*
14259   eval "ac_cv_func_mdbm_set_chain=no"
14260 fi
14261 rm -f conftest*
14262 fi
14263
14264 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
14265   echo "$ac_t""yes" 1>&6
14266   ol_cv_lib_mdbm=yes
14267 else
14268   echo "$ac_t""no" 1>&6
14269
14270                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
14271 echo "configure:14272: checking for mdbm_set_chain in -lmdbm" >&5
14272 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
14273 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14274   echo $ac_n "(cached) $ac_c" 1>&6
14275 else
14276   ac_save_LIBS="$LIBS"
14277 LIBS="-lmdbm  $LIBS"
14278 cat > conftest.$ac_ext <<EOF
14279 #line 14280 "configure"
14280 #include "confdefs.h"
14281 /* Override any gcc2 internal prototype to avoid an error.  */
14282 /* We use char because int might match the return type of a gcc2
14283     builtin and then its argument prototype would still apply.  */
14284 char mdbm_set_chain();
14285
14286 int main() {
14287 mdbm_set_chain()
14288 ; return 0; }
14289 EOF
14290 if { (eval echo configure:14291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14291   rm -rf conftest*
14292   eval "ac_cv_lib_$ac_lib_var=yes"
14293 else
14294   echo "configure: failed program was:" >&5
14295   cat conftest.$ac_ext >&5
14296   rm -rf conftest*
14297   eval "ac_cv_lib_$ac_lib_var=no"
14298 fi
14299 rm -f conftest*
14300 LIBS="$ac_save_LIBS"
14301
14302 fi
14303 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14304   echo "$ac_t""yes" 1>&6
14305   ol_cv_lib_mdbm=-lmdbm
14306 else
14307   echo "$ac_t""no" 1>&6
14308 ol_cv_lib_mdbm=no
14309 fi
14310
14311         
14312 fi
14313
14314         LIBS="$ol_LIBS"
14315
14316 fi
14317
14318 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14319
14320
14321  for ac_hdr in mdbm.h
14322 do
14323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14325 echo "configure:14326: checking for $ac_hdr" >&5
14326 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14327   echo $ac_n "(cached) $ac_c" 1>&6
14328 else
14329   cat > conftest.$ac_ext <<EOF
14330 #line 14331 "configure"
14331 #include "confdefs.h"
14332 #include <$ac_hdr>
14333 EOF
14334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14335 { (eval echo configure:14336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14337 if test -z "$ac_err"; then
14338   rm -rf conftest*
14339   eval "ac_cv_header_$ac_safe=yes"
14340 else
14341   echo "$ac_err" >&5
14342   echo "configure: failed program was:" >&5
14343   cat conftest.$ac_ext >&5
14344   rm -rf conftest*
14345   eval "ac_cv_header_$ac_safe=no"
14346 fi
14347 rm -f conftest*
14348 fi
14349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14350   echo "$ac_t""yes" 1>&6
14351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14352   cat >> confdefs.h <<EOF
14353 #define $ac_tr_hdr 1
14354 EOF
14355  
14356 else
14357   echo "$ac_t""no" 1>&6
14358 fi
14359 done
14360
14361  echo $ac_n "checking for db""... $ac_c" 1>&6
14362 echo "configure:14363: checking for db" >&5
14363 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14364   echo $ac_n "(cached) $ac_c" 1>&6
14365 else
14366   
14367         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14368                 ol_cv_mdbm=no
14369         else
14370                 ol_cv_mdbm=yes
14371         fi
14372
14373 fi
14374
14375 echo "$ac_t""$ol_cv_mdbm" 1>&6
14376  if test $ol_cv_mdbm = yes ; then
14377         cat >> confdefs.h <<\EOF
14378 #define HAVE_MDBM 1
14379 EOF
14380
14381  fi
14382
14383
14384         if test $ol_cv_mdbm = yes ; then
14385                 ol_link_ldbm=mdbm
14386                 ol_with_ldbm_api=mdbm
14387                 if test $ol_cv_lib_mdbm != yes ; then
14388                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14389                 fi
14390         fi
14391 fi
14392
14393 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14394         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14395 echo "configure:14396: checking for GDBM library" >&5
14396 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14397   echo $ac_n "(cached) $ac_c" 1>&6
14398 else
14399         ol_LIBS="$LIBS"
14400         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14401 echo "configure:14402: checking for gdbm_open" >&5
14402 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14403   echo $ac_n "(cached) $ac_c" 1>&6
14404 else
14405   cat > conftest.$ac_ext <<EOF
14406 #line 14407 "configure"
14407 #include "confdefs.h"
14408 /* System header to define __stub macros and hopefully few prototypes,
14409     which can conflict with char gdbm_open(); below.  */
14410 #include <assert.h>
14411 /* Override any gcc2 internal prototype to avoid an error.  */
14412 /* We use char because int might match the return type of a gcc2
14413     builtin and then its argument prototype would still apply.  */
14414 char gdbm_open();
14415 char (*f)();
14416
14417 int main() {
14418
14419 /* The GNU C library defines this for functions which it implements
14420     to always fail with ENOSYS.  Some functions are actually named
14421     something starting with __ and the normal name is an alias.  */
14422 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14423 choke me
14424 #else
14425 f = gdbm_open;
14426 #endif
14427
14428 ; return 0; }
14429 EOF
14430 if { (eval echo configure:14431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14431   rm -rf conftest*
14432   eval "ac_cv_func_gdbm_open=yes"
14433 else
14434   echo "configure: failed program was:" >&5
14435   cat conftest.$ac_ext >&5
14436   rm -rf conftest*
14437   eval "ac_cv_func_gdbm_open=no"
14438 fi
14439 rm -f conftest*
14440 fi
14441
14442 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14443   echo "$ac_t""yes" 1>&6
14444   ol_cv_lib_gdbm=yes
14445 else
14446   echo "$ac_t""no" 1>&6
14447
14448                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14449 echo "configure:14450: checking for gdbm_open in -lgdbm" >&5
14450 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14451 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14452   echo $ac_n "(cached) $ac_c" 1>&6
14453 else
14454   ac_save_LIBS="$LIBS"
14455 LIBS="-lgdbm  $LIBS"
14456 cat > conftest.$ac_ext <<EOF
14457 #line 14458 "configure"
14458 #include "confdefs.h"
14459 /* Override any gcc2 internal prototype to avoid an error.  */
14460 /* We use char because int might match the return type of a gcc2
14461     builtin and then its argument prototype would still apply.  */
14462 char gdbm_open();
14463
14464 int main() {
14465 gdbm_open()
14466 ; return 0; }
14467 EOF
14468 if { (eval echo configure:14469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14469   rm -rf conftest*
14470   eval "ac_cv_lib_$ac_lib_var=yes"
14471 else
14472   echo "configure: failed program was:" >&5
14473   cat conftest.$ac_ext >&5
14474   rm -rf conftest*
14475   eval "ac_cv_lib_$ac_lib_var=no"
14476 fi
14477 rm -f conftest*
14478 LIBS="$ac_save_LIBS"
14479
14480 fi
14481 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14482   echo "$ac_t""yes" 1>&6
14483   ol_cv_lib_gdbm=-lgdbm
14484 else
14485   echo "$ac_t""no" 1>&6
14486 ol_cv_lib_gdbm=no
14487 fi
14488
14489         
14490 fi
14491
14492         LIBS="$ol_LIBS"
14493
14494 fi
14495
14496 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14497
14498
14499  for ac_hdr in gdbm.h
14500 do
14501 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14502 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14503 echo "configure:14504: checking for $ac_hdr" >&5
14504 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14505   echo $ac_n "(cached) $ac_c" 1>&6
14506 else
14507   cat > conftest.$ac_ext <<EOF
14508 #line 14509 "configure"
14509 #include "confdefs.h"
14510 #include <$ac_hdr>
14511 EOF
14512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14513 { (eval echo configure:14514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14514 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14515 if test -z "$ac_err"; then
14516   rm -rf conftest*
14517   eval "ac_cv_header_$ac_safe=yes"
14518 else
14519   echo "$ac_err" >&5
14520   echo "configure: failed program was:" >&5
14521   cat conftest.$ac_ext >&5
14522   rm -rf conftest*
14523   eval "ac_cv_header_$ac_safe=no"
14524 fi
14525 rm -f conftest*
14526 fi
14527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14528   echo "$ac_t""yes" 1>&6
14529     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14530   cat >> confdefs.h <<EOF
14531 #define $ac_tr_hdr 1
14532 EOF
14533  
14534 else
14535   echo "$ac_t""no" 1>&6
14536 fi
14537 done
14538
14539  echo $ac_n "checking for db""... $ac_c" 1>&6
14540 echo "configure:14541: checking for db" >&5
14541 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14542   echo $ac_n "(cached) $ac_c" 1>&6
14543 else
14544   
14545         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14546                 ol_cv_gdbm=no
14547         else
14548                 ol_cv_gdbm=yes
14549         fi
14550
14551 fi
14552
14553 echo "$ac_t""$ol_cv_gdbm" 1>&6
14554  if test $ol_cv_gdbm = yes ; then
14555         cat >> confdefs.h <<\EOF
14556 #define HAVE_GDBM 1
14557 EOF
14558
14559  fi
14560
14561
14562         if test $ol_cv_gdbm = yes ; then
14563                 ol_link_ldbm=gdbm
14564                 ol_with_ldbm_api=gdbm
14565
14566                 if test $ol_cv_lib_gdbm != yes ; then
14567                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14568                 fi
14569         fi
14570 fi
14571
14572 if test $ol_with_ldbm_api = ndbm ; then
14573         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14574 echo "configure:14575: checking for NDBM library" >&5
14575 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14576   echo $ac_n "(cached) $ac_c" 1>&6
14577 else
14578         ol_LIBS="$LIBS"
14579         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14580 echo "configure:14581: checking for dbm_open" >&5
14581 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14582   echo $ac_n "(cached) $ac_c" 1>&6
14583 else
14584   cat > conftest.$ac_ext <<EOF
14585 #line 14586 "configure"
14586 #include "confdefs.h"
14587 /* System header to define __stub macros and hopefully few prototypes,
14588     which can conflict with char dbm_open(); below.  */
14589 #include <assert.h>
14590 /* Override any gcc2 internal prototype to avoid an error.  */
14591 /* We use char because int might match the return type of a gcc2
14592     builtin and then its argument prototype would still apply.  */
14593 char dbm_open();
14594 char (*f)();
14595
14596 int main() {
14597
14598 /* The GNU C library defines this for functions which it implements
14599     to always fail with ENOSYS.  Some functions are actually named
14600     something starting with __ and the normal name is an alias.  */
14601 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14602 choke me
14603 #else
14604 f = dbm_open;
14605 #endif
14606
14607 ; return 0; }
14608 EOF
14609 if { (eval echo configure:14610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14610   rm -rf conftest*
14611   eval "ac_cv_func_dbm_open=yes"
14612 else
14613   echo "configure: failed program was:" >&5
14614   cat conftest.$ac_ext >&5
14615   rm -rf conftest*
14616   eval "ac_cv_func_dbm_open=no"
14617 fi
14618 rm -f conftest*
14619 fi
14620
14621 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14622   echo "$ac_t""yes" 1>&6
14623   ol_cv_lib_ndbm=yes
14624 else
14625   echo "$ac_t""no" 1>&6
14626
14627                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14628 echo "configure:14629: checking for dbm_open in -lndbm" >&5
14629 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14630 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14631   echo $ac_n "(cached) $ac_c" 1>&6
14632 else
14633   ac_save_LIBS="$LIBS"
14634 LIBS="-lndbm  $LIBS"
14635 cat > conftest.$ac_ext <<EOF
14636 #line 14637 "configure"
14637 #include "confdefs.h"
14638 /* Override any gcc2 internal prototype to avoid an error.  */
14639 /* We use char because int might match the return type of a gcc2
14640     builtin and then its argument prototype would still apply.  */
14641 char dbm_open();
14642
14643 int main() {
14644 dbm_open()
14645 ; return 0; }
14646 EOF
14647 if { (eval echo configure:14648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14648   rm -rf conftest*
14649   eval "ac_cv_lib_$ac_lib_var=yes"
14650 else
14651   echo "configure: failed program was:" >&5
14652   cat conftest.$ac_ext >&5
14653   rm -rf conftest*
14654   eval "ac_cv_lib_$ac_lib_var=no"
14655 fi
14656 rm -f conftest*
14657 LIBS="$ac_save_LIBS"
14658
14659 fi
14660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14661   echo "$ac_t""yes" 1>&6
14662   ol_cv_lib_ndbm=-lndbm
14663 else
14664   echo "$ac_t""no" 1>&6
14665
14666                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14667 echo "configure:14668: checking for dbm_open in -ldbm" >&5
14668 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14669 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14670   echo $ac_n "(cached) $ac_c" 1>&6
14671 else
14672   ac_save_LIBS="$LIBS"
14673 LIBS="-ldbm  $LIBS"
14674 cat > conftest.$ac_ext <<EOF
14675 #line 14676 "configure"
14676 #include "confdefs.h"
14677 /* Override any gcc2 internal prototype to avoid an error.  */
14678 /* We use char because int might match the return type of a gcc2
14679     builtin and then its argument prototype would still apply.  */
14680 char dbm_open();
14681
14682 int main() {
14683 dbm_open()
14684 ; return 0; }
14685 EOF
14686 if { (eval echo configure:14687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14687   rm -rf conftest*
14688   eval "ac_cv_lib_$ac_lib_var=yes"
14689 else
14690   echo "configure: failed program was:" >&5
14691   cat conftest.$ac_ext >&5
14692   rm -rf conftest*
14693   eval "ac_cv_lib_$ac_lib_var=no"
14694 fi
14695 rm -f conftest*
14696 LIBS="$ac_save_LIBS"
14697
14698 fi
14699 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14700   echo "$ac_t""yes" 1>&6
14701   ol_cv_lib_ndbm=-ldbm
14702 else
14703   echo "$ac_t""no" 1>&6
14704 ol_cv_lib_ndbm=no
14705 fi
14706                 
14707 fi
14708
14709         
14710 fi
14711
14712         LIBS="$ol_LIBS"
14713
14714 fi
14715
14716 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14717
14718
14719  for ac_hdr in ndbm.h
14720 do
14721 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14722 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14723 echo "configure:14724: checking for $ac_hdr" >&5
14724 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14725   echo $ac_n "(cached) $ac_c" 1>&6
14726 else
14727   cat > conftest.$ac_ext <<EOF
14728 #line 14729 "configure"
14729 #include "confdefs.h"
14730 #include <$ac_hdr>
14731 EOF
14732 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14733 { (eval echo configure:14734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14734 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14735 if test -z "$ac_err"; then
14736   rm -rf conftest*
14737   eval "ac_cv_header_$ac_safe=yes"
14738 else
14739   echo "$ac_err" >&5
14740   echo "configure: failed program was:" >&5
14741   cat conftest.$ac_ext >&5
14742   rm -rf conftest*
14743   eval "ac_cv_header_$ac_safe=no"
14744 fi
14745 rm -f conftest*
14746 fi
14747 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14748   echo "$ac_t""yes" 1>&6
14749     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14750   cat >> confdefs.h <<EOF
14751 #define $ac_tr_hdr 1
14752 EOF
14753  
14754 else
14755   echo "$ac_t""no" 1>&6
14756 fi
14757 done
14758
14759  echo $ac_n "checking for db""... $ac_c" 1>&6
14760 echo "configure:14761: checking for db" >&5
14761 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14762   echo $ac_n "(cached) $ac_c" 1>&6
14763 else
14764   
14765         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14766                 ol_cv_ndbm=no
14767         else
14768                 ol_cv_ndbm=yes
14769         fi
14770
14771 fi
14772
14773 echo "$ac_t""$ol_cv_ndbm" 1>&6
14774  if test $ol_cv_ndbm = yes ; then
14775         cat >> confdefs.h <<\EOF
14776 #define HAVE_NDBM 1
14777 EOF
14778
14779  fi
14780
14781
14782         if test $ol_cv_ndbm = yes ; then
14783                 ol_link_ldbm=ndbm
14784                 ol_with_ldbm_api=ndbm
14785
14786                 if test $ol_cv_lib_ndbm != yes ; then
14787                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14788                 fi
14789         fi
14790 fi
14791
14792 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14793         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14794         if test $ol_enable_ldbm = yes ; then
14795                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14796         fi
14797
14798         echo "configure: warning: disabling LDBM" 1>&2
14799         ol_enable_ldbm=no
14800 fi
14801
14802 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14803         BUILD_LIBS_DYNAMIC=shared
14804         cat >> confdefs.h <<\EOF
14805 #define LDAP_LIBS_DYNAMIC 1
14806 EOF
14807
14808 else
14809         BUILD_LIBS_DYNAMIC=static
14810 fi
14811
14812 if test $ol_enable_wrappers != no ; then
14813         for ac_hdr in tcpd.h
14814 do
14815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14817 echo "configure:14818: checking for $ac_hdr" >&5
14818 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14819   echo $ac_n "(cached) $ac_c" 1>&6
14820 else
14821   cat > conftest.$ac_ext <<EOF
14822 #line 14823 "configure"
14823 #include "confdefs.h"
14824 #include <$ac_hdr>
14825 EOF
14826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14827 { (eval echo configure:14828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14828 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14829 if test -z "$ac_err"; then
14830   rm -rf conftest*
14831   eval "ac_cv_header_$ac_safe=yes"
14832 else
14833   echo "$ac_err" >&5
14834   echo "configure: failed program was:" >&5
14835   cat conftest.$ac_ext >&5
14836   rm -rf conftest*
14837   eval "ac_cv_header_$ac_safe=no"
14838 fi
14839 rm -f conftest*
14840 fi
14841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14842   echo "$ac_t""yes" 1>&6
14843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14844   cat >> confdefs.h <<EOF
14845 #define $ac_tr_hdr 1
14846 EOF
14847  
14848 else
14849   echo "$ac_t""no" 1>&6
14850 fi
14851 done
14852
14853
14854         if test $ac_cv_header_tcpd_h != yes ; then
14855                 have_wrappers=no
14856         else
14857                 cat > conftest.$ac_ext <<EOF
14858 #line 14859 "configure"
14859 #include "confdefs.h"
14860
14861 int allow_severity = 0;
14862 int deny_severity  = 0;
14863                 
14864 int main() {
14865 hosts_access()
14866 ; return 0; }
14867 EOF
14868 if { (eval echo configure:14869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14869   rm -rf conftest*
14870   have_wrappers=yes
14871 else
14872   echo "configure: failed program was:" >&5
14873   cat conftest.$ac_ext >&5
14874   rm -rf conftest*
14875   have_wrappers=no
14876 fi
14877 rm -f conftest*
14878         fi
14879
14880         if test $have_wrappers = yes ; then
14881                 cat >> confdefs.h <<\EOF
14882 #define HAVE_TCPD 1
14883 EOF
14884
14885                 WRAP_LIBS="-lwrap"
14886
14887                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14888 echo "configure:14889: checking for main in -lnsl" >&5
14889 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14890 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14891   echo $ac_n "(cached) $ac_c" 1>&6
14892 else
14893   ac_save_LIBS="$LIBS"
14894 LIBS="-lnsl  $LIBS"
14895 cat > conftest.$ac_ext <<EOF
14896 #line 14897 "configure"
14897 #include "confdefs.h"
14898
14899 int main() {
14900 main()
14901 ; return 0; }
14902 EOF
14903 if { (eval echo configure:14904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14904   rm -rf conftest*
14905   eval "ac_cv_lib_$ac_lib_var=yes"
14906 else
14907   echo "configure: failed program was:" >&5
14908   cat conftest.$ac_ext >&5
14909   rm -rf conftest*
14910   eval "ac_cv_lib_$ac_lib_var=no"
14911 fi
14912 rm -f conftest*
14913 LIBS="$ac_save_LIBS"
14914
14915 fi
14916 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14917   echo "$ac_t""yes" 1>&6
14918     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14919     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14920   cat >> confdefs.h <<EOF
14921 #define $ac_tr_lib 1
14922 EOF
14923
14924   LIBS="-lnsl $LIBS"
14925
14926 else
14927   echo "$ac_t""no" 1>&6
14928 fi
14929
14930         else
14931                 echo "configure: warning: could not find -lwrap" 1>&2
14932                 if test $ol_enable_wrappers = yes ; then
14933                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14934                 fi
14935
14936                 echo "configure: warning: disabling wrappers support" 1>&2
14937                 ol_enable_wrappers=no
14938                 WRAP_LIBS=""
14939         fi
14940 fi
14941
14942 if test $ol_enable_syslog != no ; then
14943         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14944 echo "configure:14945: checking for openlog" >&5
14945 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14946   echo $ac_n "(cached) $ac_c" 1>&6
14947 else
14948   cat > conftest.$ac_ext <<EOF
14949 #line 14950 "configure"
14950 #include "confdefs.h"
14951 /* System header to define __stub macros and hopefully few prototypes,
14952     which can conflict with char openlog(); below.  */
14953 #include <assert.h>
14954 /* Override any gcc2 internal prototype to avoid an error.  */
14955 /* We use char because int might match the return type of a gcc2
14956     builtin and then its argument prototype would still apply.  */
14957 char openlog();
14958 char (*f)();
14959
14960 int main() {
14961
14962 /* The GNU C library defines this for functions which it implements
14963     to always fail with ENOSYS.  Some functions are actually named
14964     something starting with __ and the normal name is an alias.  */
14965 #if defined (__stub_openlog) || defined (__stub___openlog)
14966 choke me
14967 #else
14968 f = openlog;
14969 #endif
14970
14971 ; return 0; }
14972 EOF
14973 if { (eval echo configure:14974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14974   rm -rf conftest*
14975   eval "ac_cv_func_openlog=yes"
14976 else
14977   echo "configure: failed program was:" >&5
14978   cat conftest.$ac_ext >&5
14979   rm -rf conftest*
14980   eval "ac_cv_func_openlog=no"
14981 fi
14982 rm -f conftest*
14983 fi
14984
14985 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14986   echo "$ac_t""yes" 1>&6
14987   :
14988 else
14989   echo "$ac_t""no" 1>&6
14990 fi
14991
14992         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14993                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14994         fi
14995         ol_enable_syslog=$ac_cv_func_openlog
14996 fi
14997
14998
14999 ol_link_sql=no
15000 if test $ol_enable_sql != no ; then
15001         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
15002 echo "configure:15003: checking for SQLDriverConnect in -liodbc" >&5
15003 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
15004 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15005   echo $ac_n "(cached) $ac_c" 1>&6
15006 else
15007   ac_save_LIBS="$LIBS"
15008 LIBS="-liodbc  $LIBS"
15009 cat > conftest.$ac_ext <<EOF
15010 #line 15011 "configure"
15011 #include "confdefs.h"
15012 /* Override any gcc2 internal prototype to avoid an error.  */
15013 /* We use char because int might match the return type of a gcc2
15014     builtin and then its argument prototype would still apply.  */
15015 char SQLDriverConnect();
15016
15017 int main() {
15018 SQLDriverConnect()
15019 ; return 0; }
15020 EOF
15021 if { (eval echo configure:15022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15022   rm -rf conftest*
15023   eval "ac_cv_lib_$ac_lib_var=yes"
15024 else
15025   echo "configure: failed program was:" >&5
15026   cat conftest.$ac_ext >&5
15027   rm -rf conftest*
15028   eval "ac_cv_lib_$ac_lib_var=no"
15029 fi
15030 rm -f conftest*
15031 LIBS="$ac_save_LIBS"
15032
15033 fi
15034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15035   echo "$ac_t""yes" 1>&6
15036   have_iodbc=yes
15037 else
15038   echo "$ac_t""no" 1>&6
15039 have_iodbc=no
15040 fi
15041
15042         if test $have_iodbc = yes ; then
15043                 ol_link_sql="-liodbc"
15044         else
15045                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
15046 echo "configure:15047: checking for SQLDriverConnect in -lodbc" >&5
15047 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
15048 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15049   echo $ac_n "(cached) $ac_c" 1>&6
15050 else
15051   ac_save_LIBS="$LIBS"
15052 LIBS="-lodbc  $LIBS"
15053 cat > conftest.$ac_ext <<EOF
15054 #line 15055 "configure"
15055 #include "confdefs.h"
15056 /* Override any gcc2 internal prototype to avoid an error.  */
15057 /* We use char because int might match the return type of a gcc2
15058     builtin and then its argument prototype would still apply.  */
15059 char SQLDriverConnect();
15060
15061 int main() {
15062 SQLDriverConnect()
15063 ; return 0; }
15064 EOF
15065 if { (eval echo configure:15066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15066   rm -rf conftest*
15067   eval "ac_cv_lib_$ac_lib_var=yes"
15068 else
15069   echo "configure: failed program was:" >&5
15070   cat conftest.$ac_ext >&5
15071   rm -rf conftest*
15072   eval "ac_cv_lib_$ac_lib_var=no"
15073 fi
15074 rm -f conftest*
15075 LIBS="$ac_save_LIBS"
15076
15077 fi
15078 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15079   echo "$ac_t""yes" 1>&6
15080   have_odbc=yes
15081 else
15082   echo "$ac_t""no" 1>&6
15083 have_odbc=no
15084 fi
15085
15086                 if test $have_odbc = yes ; then
15087                         ol_link_sql="-lodbc"
15088                 fi
15089         fi
15090
15091         if test $ol_link_sql != no ; then
15092                 SLAPD_SQL_LIBS="$ol_link_sql"
15093
15094         elif test $ol_enable_sql != auto ; then
15095                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
15096         fi
15097 fi
15098
15099 if test $ol_enable_tcl != no ; then
15100         for ac_hdr in tcl.h
15101 do
15102 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15103 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15104 echo "configure:15105: checking for $ac_hdr" >&5
15105 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15106   echo $ac_n "(cached) $ac_c" 1>&6
15107 else
15108   cat > conftest.$ac_ext <<EOF
15109 #line 15110 "configure"
15110 #include "confdefs.h"
15111 #include <$ac_hdr>
15112 EOF
15113 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15114 { (eval echo configure:15115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15115 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15116 if test -z "$ac_err"; then
15117   rm -rf conftest*
15118   eval "ac_cv_header_$ac_safe=yes"
15119 else
15120   echo "$ac_err" >&5
15121   echo "configure: failed program was:" >&5
15122   cat conftest.$ac_ext >&5
15123   rm -rf conftest*
15124   eval "ac_cv_header_$ac_safe=no"
15125 fi
15126 rm -f conftest*
15127 fi
15128 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15129   echo "$ac_t""yes" 1>&6
15130     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15131   cat >> confdefs.h <<EOF
15132 #define $ac_tr_hdr 1
15133 EOF
15134  
15135 else
15136   echo "$ac_t""no" 1>&6
15137 fi
15138 done
15139
15140
15141         if test $ac_cv_header_tcl_h != yes ; then
15142                 have_tcl=no
15143         else
15144                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
15145                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
15146 echo "configure:15147: checking for main in -l$lib" >&5
15147 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
15148 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15149   echo $ac_n "(cached) $ac_c" 1>&6
15150 else
15151   ac_save_LIBS="$LIBS"
15152 LIBS="-l$lib  $LIBS"
15153 cat > conftest.$ac_ext <<EOF
15154 #line 15155 "configure"
15155 #include "confdefs.h"
15156
15157 int main() {
15158 main()
15159 ; return 0; }
15160 EOF
15161 if { (eval echo configure:15162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15162   rm -rf conftest*
15163   eval "ac_cv_lib_$ac_lib_var=yes"
15164 else
15165   echo "configure: failed program was:" >&5
15166   cat conftest.$ac_ext >&5
15167   rm -rf conftest*
15168   eval "ac_cv_lib_$ac_lib_var=no"
15169 fi
15170 rm -f conftest*
15171 LIBS="$ac_save_LIBS"
15172
15173 fi
15174 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15175   echo "$ac_t""yes" 1>&6
15176   have_tcl=yes
15177                            if test x"$ol_with_tcl_module" = "xstatic" ; then
15178                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
15179                            else
15180                                         MOD_TCL_LIB="-l${lib}"
15181                            fi;break
15182 else
15183   echo "$ac_t""no" 1>&6
15184 have_tcl=no
15185 fi
15186
15187                 done
15188         fi
15189
15190         if test $have_tcl != yes ; then
15191                 echo "configure: warning: could not find -ltcl" 1>&2
15192                 if test $ol_enable_tcl = yes ; then
15193                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
15194                 fi
15195
15196                 ol_enable_tcl=no
15197         fi
15198 fi
15199
15200 ol_link_termcap=no
15201 for ac_hdr in termcap.h ncurses.h
15202 do
15203 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15204 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15205 echo "configure:15206: checking for $ac_hdr" >&5
15206 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15207   echo $ac_n "(cached) $ac_c" 1>&6
15208 else
15209   cat > conftest.$ac_ext <<EOF
15210 #line 15211 "configure"
15211 #include "confdefs.h"
15212 #include <$ac_hdr>
15213 EOF
15214 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15215 { (eval echo configure:15216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15216 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15217 if test -z "$ac_err"; then
15218   rm -rf conftest*
15219   eval "ac_cv_header_$ac_safe=yes"
15220 else
15221   echo "$ac_err" >&5
15222   echo "configure: failed program was:" >&5
15223   cat conftest.$ac_ext >&5
15224   rm -rf conftest*
15225   eval "ac_cv_header_$ac_safe=no"
15226 fi
15227 rm -f conftest*
15228 fi
15229 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15230   echo "$ac_t""yes" 1>&6
15231     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15232   cat >> confdefs.h <<EOF
15233 #define $ac_tr_hdr 1
15234 EOF
15235  
15236 else
15237   echo "$ac_t""no" 1>&6
15238 fi
15239 done
15240
15241
15242 if test $ol_link_termcap = no ; then
15243         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
15244 echo "configure:15245: checking for tputs in -ltermcap" >&5
15245 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
15246 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15247   echo $ac_n "(cached) $ac_c" 1>&6
15248 else
15249   ac_save_LIBS="$LIBS"
15250 LIBS="-ltermcap  $LIBS"
15251 cat > conftest.$ac_ext <<EOF
15252 #line 15253 "configure"
15253 #include "confdefs.h"
15254 /* Override any gcc2 internal prototype to avoid an error.  */
15255 /* We use char because int might match the return type of a gcc2
15256     builtin and then its argument prototype would still apply.  */
15257 char tputs();
15258
15259 int main() {
15260 tputs()
15261 ; return 0; }
15262 EOF
15263 if { (eval echo configure:15264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15264   rm -rf conftest*
15265   eval "ac_cv_lib_$ac_lib_var=yes"
15266 else
15267   echo "configure: failed program was:" >&5
15268   cat conftest.$ac_ext >&5
15269   rm -rf conftest*
15270   eval "ac_cv_lib_$ac_lib_var=no"
15271 fi
15272 rm -f conftest*
15273 LIBS="$ac_save_LIBS"
15274
15275 fi
15276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15277   echo "$ac_t""yes" 1>&6
15278   have_termcap=yes
15279 else
15280   echo "$ac_t""no" 1>&6
15281 have_termcap=no
15282 fi
15283
15284         if test $have_termcap = yes ; then
15285                 cat >> confdefs.h <<\EOF
15286 #define HAVE_TERMCAP 1
15287 EOF
15288
15289                 ol_link_termcap=yes
15290                 TERMCAP_LIBS=-ltermcap
15291         fi
15292 fi
15293
15294 if test $ol_link_termcap = no ; then
15295         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
15296 echo "configure:15297: checking for initscr in -lncurses" >&5
15297 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
15298 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15299   echo $ac_n "(cached) $ac_c" 1>&6
15300 else
15301   ac_save_LIBS="$LIBS"
15302 LIBS="-lncurses  $LIBS"
15303 cat > conftest.$ac_ext <<EOF
15304 #line 15305 "configure"
15305 #include "confdefs.h"
15306 /* Override any gcc2 internal prototype to avoid an error.  */
15307 /* We use char because int might match the return type of a gcc2
15308     builtin and then its argument prototype would still apply.  */
15309 char initscr();
15310
15311 int main() {
15312 initscr()
15313 ; return 0; }
15314 EOF
15315 if { (eval echo configure:15316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15316   rm -rf conftest*
15317   eval "ac_cv_lib_$ac_lib_var=yes"
15318 else
15319   echo "configure: failed program was:" >&5
15320   cat conftest.$ac_ext >&5
15321   rm -rf conftest*
15322   eval "ac_cv_lib_$ac_lib_var=no"
15323 fi
15324 rm -f conftest*
15325 LIBS="$ac_save_LIBS"
15326
15327 fi
15328 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15329   echo "$ac_t""yes" 1>&6
15330   have_ncurses=yes
15331 else
15332   echo "$ac_t""no" 1>&6
15333 have_ncurses=no
15334 fi
15335
15336         if test $have_ncurses = yes ; then
15337                 cat >> confdefs.h <<\EOF
15338 #define HAVE_NCURSES 1
15339 EOF
15340
15341                 ol_link_termcap=yes
15342                 TERMCAP_LIBS=-lncurses
15343         fi
15344 fi
15345
15346 if test $ol_link_termcap = no ; then
15347         cat >> confdefs.h <<\EOF
15348 #define NO_TERMCAP 1
15349 EOF
15350
15351         TERMCAP_LIBS=
15352 fi
15353
15354 ol_link_sasl=no
15355 ol_link_spasswd=no
15356 if test $ol_with_cyrus_sasl != no ; then
15357         for ac_hdr in sasl.h
15358 do
15359 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15360 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15361 echo "configure:15362: checking for $ac_hdr" >&5
15362 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15363   echo $ac_n "(cached) $ac_c" 1>&6
15364 else
15365   cat > conftest.$ac_ext <<EOF
15366 #line 15367 "configure"
15367 #include "confdefs.h"
15368 #include <$ac_hdr>
15369 EOF
15370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15371 { (eval echo configure:15372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15373 if test -z "$ac_err"; then
15374   rm -rf conftest*
15375   eval "ac_cv_header_$ac_safe=yes"
15376 else
15377   echo "$ac_err" >&5
15378   echo "configure: failed program was:" >&5
15379   cat conftest.$ac_ext >&5
15380   rm -rf conftest*
15381   eval "ac_cv_header_$ac_safe=no"
15382 fi
15383 rm -f conftest*
15384 fi
15385 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15386   echo "$ac_t""yes" 1>&6
15387     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15388   cat >> confdefs.h <<EOF
15389 #define $ac_tr_hdr 1
15390 EOF
15391  
15392 else
15393   echo "$ac_t""no" 1>&6
15394 fi
15395 done
15396
15397
15398         if test $ac_cv_header_sasl_h = yes ; then
15399                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15400 echo "configure:15401: checking for sasl_client_init in -lsasl" >&5
15401 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15402 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15403   echo $ac_n "(cached) $ac_c" 1>&6
15404 else
15405   ac_save_LIBS="$LIBS"
15406 LIBS="-lsasl  $LIBS"
15407 cat > conftest.$ac_ext <<EOF
15408 #line 15409 "configure"
15409 #include "confdefs.h"
15410 /* Override any gcc2 internal prototype to avoid an error.  */
15411 /* We use char because int might match the return type of a gcc2
15412     builtin and then its argument prototype would still apply.  */
15413 char sasl_client_init();
15414
15415 int main() {
15416 sasl_client_init()
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_lib_$ac_lib_var=yes"
15422 else
15423   echo "configure: failed program was:" >&5
15424   cat conftest.$ac_ext >&5
15425   rm -rf conftest*
15426   eval "ac_cv_lib_$ac_lib_var=no"
15427 fi
15428 rm -f conftest*
15429 LIBS="$ac_save_LIBS"
15430
15431 fi
15432 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15433   echo "$ac_t""yes" 1>&6
15434   have_cyrus_sasl=yes
15435 else
15436   echo "$ac_t""no" 1>&6
15437 have_cyrus_sasl=no
15438 fi
15439
15440
15441                 if test $have_cyrus_sasl != no ; then
15442                         SASL_LIBS="-lsasl"
15443                         cat >> confdefs.h <<\EOF
15444 #define HAVE_CYRUS_SASL 1
15445 EOF
15446
15447                         ol_link_sasl=yes
15448                 fi
15449         fi
15450
15451         if test $ol_link_sasl = no ; then
15452                 if test $ol_with_cyrus_sasl != auto ; then
15453                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15454                 else
15455                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15456                         echo "configure: warning: SASL authentication not supported!" 1>&2
15457                         if test $ol_link_tls = no ; then
15458                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15459                         fi
15460                 fi
15461
15462         elif test $ol_enable_spasswd != no ; then
15463                 ol_link_spasswd=yes
15464         fi
15465
15466 else
15467         echo "configure: warning: SASL authentication not supported!" 1>&2
15468         if test $ol_link_tls = no ; then
15469                 echo "configure: warning: Strong authentication not supported!" 1>&2
15470         fi
15471 fi
15472
15473 if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
15474         dev=no
15475         if test -r /dev/urandom ; then
15476                 dev="/dev/urandom";
15477         elif test -r /idev/urandom ; then
15478                 dev="/idev/urandom";
15479         elif test -r /dev/srandom ; then
15480                 dev="/dev/srandom";
15481         elif test -r /dev/random ; then
15482                 dev="/dev/random";
15483         elif test -r /idev/random ; then
15484                 dev="/idev/random";
15485         fi
15486
15487         if test $dev != no ; then
15488                 cat >> confdefs.h <<EOF
15489 #define URANDOM_DEVICE "$dev"
15490 EOF
15491
15492         fi
15493 fi
15494
15495 ol_link_fetch=no
15496 if test $ol_with_fetch != no ; then
15497         ol_LIBS=$LIBS
15498 LIBS="-lfetch -lcom_err $LIBS"
15499 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15500 echo "configure:15501: checking fetch(3) library" >&5
15501 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15502   echo $ac_n "(cached) $ac_c" 1>&6
15503 else
15504   
15505         cat > conftest.$ac_ext <<EOF
15506 #line 15507 "configure"
15507 #include "confdefs.h"
15508
15509 #include <sys/param.h>
15510 #include <stdio.h>
15511 #include <fetch.h>
15512 int main() {
15513 struct url *u = fetchParseURL("file:///"); 
15514 ; return 0; }
15515 EOF
15516 if { (eval echo configure:15517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15517   rm -rf conftest*
15518   ol_cv_lib_fetch=yes
15519 else
15520   echo "configure: failed program was:" >&5
15521   cat conftest.$ac_ext >&5
15522   rm -rf conftest*
15523   ol_cv_lib_fetch=no
15524 fi
15525 rm -f conftest*
15526 fi
15527
15528 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15529 LIBS=$ol_LIBS
15530 if test $ol_cv_lib_fetch != no ; then
15531         ol_link_fetch="-lfetch -lcom_err"
15532         cat >> confdefs.h <<\EOF
15533 #define HAVE_FETCH 1
15534 EOF
15535
15536 fi
15537
15538
15539         if test $ol_cv_lib_fetch != no ; then
15540                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15541                 ol_link_fetch=freebsd
15542
15543         elif test $ol_with_fetch != auto ; then
15544                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15545         fi 
15546 fi
15547
15548 ol_link_readline=no
15549 if test $ol_with_readline != no ; then
15550         for ac_hdr in readline/readline.h readline/history.h
15551 do
15552 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15553 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15554 echo "configure:15555: checking for $ac_hdr" >&5
15555 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15556   echo $ac_n "(cached) $ac_c" 1>&6
15557 else
15558   cat > conftest.$ac_ext <<EOF
15559 #line 15560 "configure"
15560 #include "confdefs.h"
15561 #include <$ac_hdr>
15562 EOF
15563 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15564 { (eval echo configure:15565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15565 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15566 if test -z "$ac_err"; then
15567   rm -rf conftest*
15568   eval "ac_cv_header_$ac_safe=yes"
15569 else
15570   echo "$ac_err" >&5
15571   echo "configure: failed program was:" >&5
15572   cat conftest.$ac_ext >&5
15573   rm -rf conftest*
15574   eval "ac_cv_header_$ac_safe=no"
15575 fi
15576 rm -f conftest*
15577 fi
15578 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15579   echo "$ac_t""yes" 1>&6
15580     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15581   cat >> confdefs.h <<EOF
15582 #define $ac_tr_hdr 1
15583 EOF
15584  
15585 else
15586   echo "$ac_t""no" 1>&6
15587 fi
15588 done
15589
15590
15591         if test $ac_cv_header_readline_readline_h = yes ; then
15592                 save_LIBS="$LIBS"
15593                 LIBS="$TERMCAP_LIBS $LIBS"
15594                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15595 echo "configure:15596: checking for readline in -lreadline" >&5
15596 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15597 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15598   echo $ac_n "(cached) $ac_c" 1>&6
15599 else
15600   ac_save_LIBS="$LIBS"
15601 LIBS="-lreadline  $LIBS"
15602 cat > conftest.$ac_ext <<EOF
15603 #line 15604 "configure"
15604 #include "confdefs.h"
15605 /* Override any gcc2 internal prototype to avoid an error.  */
15606 /* We use char because int might match the return type of a gcc2
15607     builtin and then its argument prototype would still apply.  */
15608 char readline();
15609
15610 int main() {
15611 readline()
15612 ; return 0; }
15613 EOF
15614 if { (eval echo configure:15615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15615   rm -rf conftest*
15616   eval "ac_cv_lib_$ac_lib_var=yes"
15617 else
15618   echo "configure: failed program was:" >&5
15619   cat conftest.$ac_ext >&5
15620   rm -rf conftest*
15621   eval "ac_cv_lib_$ac_lib_var=no"
15622 fi
15623 rm -f conftest*
15624 LIBS="$ac_save_LIBS"
15625
15626 fi
15627 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15628   echo "$ac_t""yes" 1>&6
15629   have_readline=yes
15630 else
15631   echo "$ac_t""no" 1>&6
15632 have_readline=no
15633 fi
15634
15635                 LIBS="$save_LIBS"
15636                         
15637                 if test $have_readline = yes ; then
15638                         ol_with_readline=found
15639                         ol_link_readline=yes
15640
15641                         READLINE_LIBS="-lreadline"
15642                 fi
15643         fi
15644 fi
15645
15646 if test $ol_link_readline = yes ; then
15647         cat >> confdefs.h <<\EOF
15648 #define HAVE_READLINE 1
15649 EOF
15650
15651 fi
15652
15653
15654 if test $ol_enable_crypt != no ; then
15655         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15656 echo "configure:15657: checking for crypt" >&5
15657 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15658   echo $ac_n "(cached) $ac_c" 1>&6
15659 else
15660   cat > conftest.$ac_ext <<EOF
15661 #line 15662 "configure"
15662 #include "confdefs.h"
15663 /* System header to define __stub macros and hopefully few prototypes,
15664     which can conflict with char crypt(); below.  */
15665 #include <assert.h>
15666 /* Override any gcc2 internal prototype to avoid an error.  */
15667 /* We use char because int might match the return type of a gcc2
15668     builtin and then its argument prototype would still apply.  */
15669 char crypt();
15670 char (*f)();
15671
15672 int main() {
15673
15674 /* The GNU C library defines this for functions which it implements
15675     to always fail with ENOSYS.  Some functions are actually named
15676     something starting with __ and the normal name is an alias.  */
15677 #if defined (__stub_crypt) || defined (__stub___crypt)
15678 choke me
15679 #else
15680 f = crypt;
15681 #endif
15682
15683 ; return 0; }
15684 EOF
15685 if { (eval echo configure:15686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15686   rm -rf conftest*
15687   eval "ac_cv_func_crypt=yes"
15688 else
15689   echo "configure: failed program was:" >&5
15690   cat conftest.$ac_ext >&5
15691   rm -rf conftest*
15692   eval "ac_cv_func_crypt=no"
15693 fi
15694 rm -f conftest*
15695 fi
15696
15697 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15698   echo "$ac_t""yes" 1>&6
15699   have_crypt=yes
15700 else
15701   echo "$ac_t""no" 1>&6
15702
15703                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15704 echo "configure:15705: checking for crypt in -lcrypt" >&5
15705 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15706 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15707   echo $ac_n "(cached) $ac_c" 1>&6
15708 else
15709   ac_save_LIBS="$LIBS"
15710 LIBS="-lcrypt  $LIBS"
15711 cat > conftest.$ac_ext <<EOF
15712 #line 15713 "configure"
15713 #include "confdefs.h"
15714 /* Override any gcc2 internal prototype to avoid an error.  */
15715 /* We use char because int might match the return type of a gcc2
15716     builtin and then its argument prototype would still apply.  */
15717 char crypt();
15718
15719 int main() {
15720 crypt()
15721 ; return 0; }
15722 EOF
15723 if { (eval echo configure:15724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15724   rm -rf conftest*
15725   eval "ac_cv_lib_$ac_lib_var=yes"
15726 else
15727   echo "configure: failed program was:" >&5
15728   cat conftest.$ac_ext >&5
15729   rm -rf conftest*
15730   eval "ac_cv_lib_$ac_lib_var=no"
15731 fi
15732 rm -f conftest*
15733 LIBS="$ac_save_LIBS"
15734
15735 fi
15736 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15737   echo "$ac_t""yes" 1>&6
15738   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15739                         have_crypt=yes
15740 else
15741   echo "$ac_t""no" 1>&6
15742 have_crypt=no
15743 fi
15744
15745 fi
15746
15747
15748         if test $have_crypt = yes ; then
15749                 cat >> confdefs.h <<\EOF
15750 #define HAVE_CRYPT 1
15751 EOF
15752
15753         else
15754                 echo "configure: warning: could not find crypt" 1>&2
15755                 if test $ol_enable_crypt = yes ; then
15756                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15757                 fi
15758
15759                 echo "configure: warning: disabling crypt support" 1>&2
15760                 ol_enable_crypt=no
15761         fi
15762 fi
15763
15764 if test $ol_enable_proctitle != no ; then
15765         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15766 echo "configure:15767: checking for setproctitle" >&5
15767 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15768   echo $ac_n "(cached) $ac_c" 1>&6
15769 else
15770   cat > conftest.$ac_ext <<EOF
15771 #line 15772 "configure"
15772 #include "confdefs.h"
15773 /* System header to define __stub macros and hopefully few prototypes,
15774     which can conflict with char setproctitle(); below.  */
15775 #include <assert.h>
15776 /* Override any gcc2 internal prototype to avoid an error.  */
15777 /* We use char because int might match the return type of a gcc2
15778     builtin and then its argument prototype would still apply.  */
15779 char setproctitle();
15780 char (*f)();
15781
15782 int main() {
15783
15784 /* The GNU C library defines this for functions which it implements
15785     to always fail with ENOSYS.  Some functions are actually named
15786     something starting with __ and the normal name is an alias.  */
15787 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15788 choke me
15789 #else
15790 f = setproctitle;
15791 #endif
15792
15793 ; return 0; }
15794 EOF
15795 if { (eval echo configure:15796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15796   rm -rf conftest*
15797   eval "ac_cv_func_setproctitle=yes"
15798 else
15799   echo "configure: failed program was:" >&5
15800   cat conftest.$ac_ext >&5
15801   rm -rf conftest*
15802   eval "ac_cv_func_setproctitle=no"
15803 fi
15804 rm -f conftest*
15805 fi
15806
15807 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15808   echo "$ac_t""yes" 1>&6
15809   have_setproctitle=yes
15810 else
15811   echo "$ac_t""no" 1>&6
15812
15813                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15814 echo "configure:15815: checking for setproctitle in -lutil" >&5
15815 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15816 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15817   echo $ac_n "(cached) $ac_c" 1>&6
15818 else
15819   ac_save_LIBS="$LIBS"
15820 LIBS="-lutil  $LIBS"
15821 cat > conftest.$ac_ext <<EOF
15822 #line 15823 "configure"
15823 #include "confdefs.h"
15824 /* Override any gcc2 internal prototype to avoid an error.  */
15825 /* We use char because int might match the return type of a gcc2
15826     builtin and then its argument prototype would still apply.  */
15827 char setproctitle();
15828
15829 int main() {
15830 setproctitle()
15831 ; return 0; }
15832 EOF
15833 if { (eval echo configure:15834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15834   rm -rf conftest*
15835   eval "ac_cv_lib_$ac_lib_var=yes"
15836 else
15837   echo "configure: failed program was:" >&5
15838   cat conftest.$ac_ext >&5
15839   rm -rf conftest*
15840   eval "ac_cv_lib_$ac_lib_var=no"
15841 fi
15842 rm -f conftest*
15843 LIBS="$ac_save_LIBS"
15844
15845 fi
15846 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15847   echo "$ac_t""yes" 1>&6
15848   have_setproctitle=yes
15849                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15850 else
15851   echo "$ac_t""no" 1>&6
15852 have_setproctitle=no
15853                         LIBOBJS="$LIBOBJS setproctitle.o"
15854                         LIBSRCS="$LIBSRCS setproctitle.c"
15855 fi
15856
15857 fi
15858
15859
15860         if test $have_setproctitle = yes ; then
15861                 cat >> confdefs.h <<\EOF
15862 #define HAVE_SETPROCTITLE 1
15863 EOF
15864
15865         fi
15866 fi
15867
15868 if test $ol_enable_slp != no ; then
15869         for ac_hdr in slp.h 
15870 do
15871 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15872 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15873 echo "configure:15874: checking for $ac_hdr" >&5
15874 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15875   echo $ac_n "(cached) $ac_c" 1>&6
15876 else
15877   cat > conftest.$ac_ext <<EOF
15878 #line 15879 "configure"
15879 #include "confdefs.h"
15880 #include <$ac_hdr>
15881 EOF
15882 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15883 { (eval echo configure:15884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15884 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15885 if test -z "$ac_err"; then
15886   rm -rf conftest*
15887   eval "ac_cv_header_$ac_safe=yes"
15888 else
15889   echo "$ac_err" >&5
15890   echo "configure: failed program was:" >&5
15891   cat conftest.$ac_ext >&5
15892   rm -rf conftest*
15893   eval "ac_cv_header_$ac_safe=no"
15894 fi
15895 rm -f conftest*
15896 fi
15897 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15898   echo "$ac_t""yes" 1>&6
15899     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15900   cat >> confdefs.h <<EOF
15901 #define $ac_tr_hdr 1
15902 EOF
15903  
15904 else
15905   echo "$ac_t""no" 1>&6
15906 fi
15907 done
15908
15909
15910         if test $ac_cv_header_slp_h = yes ; then
15911                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15912 echo "configure:15913: checking for SLPOpen in -lslp" >&5
15913 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15914 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15915   echo $ac_n "(cached) $ac_c" 1>&6
15916 else
15917   ac_save_LIBS="$LIBS"
15918 LIBS="-lslp  $LIBS"
15919 cat > conftest.$ac_ext <<EOF
15920 #line 15921 "configure"
15921 #include "confdefs.h"
15922 /* Override any gcc2 internal prototype to avoid an error.  */
15923 /* We use char because int might match the return type of a gcc2
15924     builtin and then its argument prototype would still apply.  */
15925 char SLPOpen();
15926
15927 int main() {
15928 SLPOpen()
15929 ; return 0; }
15930 EOF
15931 if { (eval echo configure:15932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15932   rm -rf conftest*
15933   eval "ac_cv_lib_$ac_lib_var=yes"
15934 else
15935   echo "configure: failed program was:" >&5
15936   cat conftest.$ac_ext >&5
15937   rm -rf conftest*
15938   eval "ac_cv_lib_$ac_lib_var=no"
15939 fi
15940 rm -f conftest*
15941 LIBS="$ac_save_LIBS"
15942
15943 fi
15944 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15945   echo "$ac_t""yes" 1>&6
15946   have_slp=yes
15947 else
15948   echo "$ac_t""no" 1>&6
15949 have_slp=no
15950 fi
15951
15952                 if test $have_slp = yes ; then
15953                         cat >> confdefs.h <<\EOF
15954 #define HAVE_SLP 1
15955 EOF
15956
15957                         SLAPD_SLP_LIBS=-lslp
15958                 fi
15959
15960         elif test $ol_enable_slp = yes ; then
15961                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15962         fi
15963 fi
15964
15965 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15966 echo "configure:15967: checking for ANSI C header files" >&5
15967 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15968   echo $ac_n "(cached) $ac_c" 1>&6
15969 else
15970   cat > conftest.$ac_ext <<EOF
15971 #line 15972 "configure"
15972 #include "confdefs.h"
15973 #include <stdlib.h>
15974 #include <stdarg.h>
15975 #include <string.h>
15976 #include <float.h>
15977 EOF
15978 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15979 { (eval echo configure:15980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15980 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15981 if test -z "$ac_err"; then
15982   rm -rf conftest*
15983   ac_cv_header_stdc=yes
15984 else
15985   echo "$ac_err" >&5
15986   echo "configure: failed program was:" >&5
15987   cat conftest.$ac_ext >&5
15988   rm -rf conftest*
15989   ac_cv_header_stdc=no
15990 fi
15991 rm -f conftest*
15992
15993 if test $ac_cv_header_stdc = yes; then
15994   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15995 cat > conftest.$ac_ext <<EOF
15996 #line 15997 "configure"
15997 #include "confdefs.h"
15998 #include <string.h>
15999 EOF
16000 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16001   egrep "memchr" >/dev/null 2>&1; then
16002   :
16003 else
16004   rm -rf conftest*
16005   ac_cv_header_stdc=no
16006 fi
16007 rm -f conftest*
16008
16009 fi
16010
16011 if test $ac_cv_header_stdc = yes; then
16012   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16013 cat > conftest.$ac_ext <<EOF
16014 #line 16015 "configure"
16015 #include "confdefs.h"
16016 #include <stdlib.h>
16017 EOF
16018 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16019   egrep "free" >/dev/null 2>&1; then
16020   :
16021 else
16022   rm -rf conftest*
16023   ac_cv_header_stdc=no
16024 fi
16025 rm -f conftest*
16026
16027 fi
16028
16029 if test $ac_cv_header_stdc = yes; then
16030   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16031 if test "$cross_compiling" = yes; then
16032   :
16033 else
16034   cat > conftest.$ac_ext <<EOF
16035 #line 16036 "configure"
16036 #include "confdefs.h"
16037 #include <ctype.h>
16038 #if ((' ' & 0x0FF) == 0x020)
16039 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16040 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16041 #else
16042 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16043  || ('j' <= (c) && (c) <= 'r') \
16044  || ('s' <= (c) && (c) <= 'z'))
16045 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16046 #endif
16047 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16048 int main () { int i; for (i = 0; i < 256; i++)
16049 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
16050 exit (0); }
16051
16052 EOF
16053 if { (eval echo configure:16054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16054 then
16055   :
16056 else
16057   echo "configure: failed program was:" >&5
16058   cat conftest.$ac_ext >&5
16059   rm -fr conftest*
16060   ac_cv_header_stdc=no
16061 fi
16062 rm -fr conftest*
16063 fi
16064
16065 fi
16066 fi
16067
16068 echo "$ac_t""$ac_cv_header_stdc" 1>&6
16069 if test $ac_cv_header_stdc = yes; then
16070   cat >> confdefs.h <<\EOF
16071 #define STDC_HEADERS 1
16072 EOF
16073
16074 fi
16075
16076 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
16077 echo "configure:16078: checking for mode_t" >&5
16078 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
16079   echo $ac_n "(cached) $ac_c" 1>&6
16080 else
16081   cat > conftest.$ac_ext <<EOF
16082 #line 16083 "configure"
16083 #include "confdefs.h"
16084 #include <sys/types.h>
16085 #if STDC_HEADERS
16086 #include <stdlib.h>
16087 #include <stddef.h>
16088 #endif
16089
16090 EOF
16091 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16092   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16093   rm -rf conftest*
16094   eval "ac_cv_type_mode_t=yes"
16095 else
16096   rm -rf conftest*
16097   eval "ac_cv_type_mode_t=no"
16098 fi
16099 rm -f conftest*
16100
16101 fi
16102 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
16103   echo "$ac_t""yes" 1>&6
16104 else
16105   echo "$ac_t""no" 1>&6
16106   cat >> confdefs.h <<EOF
16107 #define mode_t int
16108 EOF
16109
16110 fi
16111
16112 echo $ac_n "checking for off_t""... $ac_c" 1>&6
16113 echo "configure:16114: checking for off_t" >&5
16114 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
16115   echo $ac_n "(cached) $ac_c" 1>&6
16116 else
16117   cat > conftest.$ac_ext <<EOF
16118 #line 16119 "configure"
16119 #include "confdefs.h"
16120 #include <sys/types.h>
16121 #if STDC_HEADERS
16122 #include <stdlib.h>
16123 #include <stddef.h>
16124 #endif
16125
16126 EOF
16127 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16128   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16129   rm -rf conftest*
16130   eval "ac_cv_type_off_t=yes"
16131 else
16132   rm -rf conftest*
16133   eval "ac_cv_type_off_t=no"
16134 fi
16135 rm -f conftest*
16136
16137 fi
16138 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
16139   echo "$ac_t""yes" 1>&6
16140 else
16141   echo "$ac_t""no" 1>&6
16142   cat >> confdefs.h <<EOF
16143 #define off_t long
16144 EOF
16145
16146 fi
16147
16148 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
16149 echo "configure:16150: checking for pid_t" >&5
16150 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
16151   echo $ac_n "(cached) $ac_c" 1>&6
16152 else
16153   cat > conftest.$ac_ext <<EOF
16154 #line 16155 "configure"
16155 #include "confdefs.h"
16156 #include <sys/types.h>
16157 #if STDC_HEADERS
16158 #include <stdlib.h>
16159 #include <stddef.h>
16160 #endif
16161
16162 EOF
16163 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16164   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16165   rm -rf conftest*
16166   eval "ac_cv_type_pid_t=yes"
16167 else
16168   rm -rf conftest*
16169   eval "ac_cv_type_pid_t=no"
16170 fi
16171 rm -f conftest*
16172
16173 fi
16174 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
16175   echo "$ac_t""yes" 1>&6
16176 else
16177   echo "$ac_t""no" 1>&6
16178   cat >> confdefs.h <<EOF
16179 #define pid_t int
16180 EOF
16181
16182 fi
16183
16184 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
16185 echo "configure:16186: checking for ptrdiff_t" >&5
16186 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
16187   echo $ac_n "(cached) $ac_c" 1>&6
16188 else
16189   cat > conftest.$ac_ext <<EOF
16190 #line 16191 "configure"
16191 #include "confdefs.h"
16192 #include <stddef.h>
16193 int main() {
16194 ptrdiff_t p
16195 ; return 0; }
16196 EOF
16197 if { (eval echo configure:16198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16198   rm -rf conftest*
16199   am_cv_type_ptrdiff_t=yes
16200 else
16201   echo "configure: failed program was:" >&5
16202   cat conftest.$ac_ext >&5
16203   rm -rf conftest*
16204   am_cv_type_ptrdiff_t=no
16205 fi
16206 rm -f conftest*
16207 fi
16208
16209 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
16210    if test $am_cv_type_ptrdiff_t = yes; then
16211      cat >> confdefs.h <<\EOF
16212 #define HAVE_PTRDIFF_T 1
16213 EOF
16214
16215    fi
16216
16217 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
16218 echo "configure:16219: checking return type of signal handlers" >&5
16219 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
16220   echo $ac_n "(cached) $ac_c" 1>&6
16221 else
16222   cat > conftest.$ac_ext <<EOF
16223 #line 16224 "configure"
16224 #include "confdefs.h"
16225 #include <sys/types.h>
16226 #include <signal.h>
16227 #ifdef signal
16228 #undef signal
16229 #endif
16230 #ifdef __cplusplus
16231 extern "C" void (*signal (int, void (*)(int)))(int);
16232 #else
16233 void (*signal ()) ();
16234 #endif
16235
16236 int main() {
16237 int i;
16238 ; return 0; }
16239 EOF
16240 if { (eval echo configure:16241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16241   rm -rf conftest*
16242   ac_cv_type_signal=void
16243 else
16244   echo "configure: failed program was:" >&5
16245   cat conftest.$ac_ext >&5
16246   rm -rf conftest*
16247   ac_cv_type_signal=int
16248 fi
16249 rm -f conftest*
16250 fi
16251
16252 echo "$ac_t""$ac_cv_type_signal" 1>&6
16253 cat >> confdefs.h <<EOF
16254 #define RETSIGTYPE $ac_cv_type_signal
16255 EOF
16256
16257
16258 echo $ac_n "checking for size_t""... $ac_c" 1>&6
16259 echo "configure:16260: checking for size_t" >&5
16260 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
16261   echo $ac_n "(cached) $ac_c" 1>&6
16262 else
16263   cat > conftest.$ac_ext <<EOF
16264 #line 16265 "configure"
16265 #include "confdefs.h"
16266 #include <sys/types.h>
16267 #if STDC_HEADERS
16268 #include <stdlib.h>
16269 #include <stddef.h>
16270 #endif
16271
16272 EOF
16273 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16274   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16275   rm -rf conftest*
16276   eval "ac_cv_type_size_t=yes"
16277 else
16278   rm -rf conftest*
16279   eval "ac_cv_type_size_t=no"
16280 fi
16281 rm -f conftest*
16282
16283 fi
16284 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
16285   echo "$ac_t""yes" 1>&6
16286 else
16287   echo "$ac_t""no" 1>&6
16288   cat >> confdefs.h <<EOF
16289 #define size_t unsigned
16290 EOF
16291
16292 fi
16293
16294
16295 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
16296 echo "configure:16297: checking for ssize_t" >&5
16297 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
16298   echo $ac_n "(cached) $ac_c" 1>&6
16299 else
16300   cat > conftest.$ac_ext <<EOF
16301 #line 16302 "configure"
16302 #include "confdefs.h"
16303 #include <sys/types.h>
16304 #if STDC_HEADERS
16305 #include <stdlib.h>
16306 #include <stddef.h>
16307 #endif
16308
16309 EOF
16310 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16311   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16312   rm -rf conftest*
16313   eval "ac_cv_type_ssize_t=yes"
16314 else
16315   rm -rf conftest*
16316   eval "ac_cv_type_ssize_t=no"
16317 fi
16318 rm -f conftest*
16319
16320 fi
16321 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
16322   echo "$ac_t""yes" 1>&6
16323 else
16324   echo "$ac_t""no" 1>&6
16325   cat >> confdefs.h <<EOF
16326 #define ssize_t signed int
16327 EOF
16328
16329 fi
16330
16331 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16332 echo "configure:16333: checking for caddr_t" >&5
16333 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16334   echo $ac_n "(cached) $ac_c" 1>&6
16335 else
16336   cat > conftest.$ac_ext <<EOF
16337 #line 16338 "configure"
16338 #include "confdefs.h"
16339 #include <sys/types.h>
16340 #if STDC_HEADERS
16341 #include <stdlib.h>
16342 #include <stddef.h>
16343 #endif
16344
16345 EOF
16346 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16347   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16348   rm -rf conftest*
16349   eval "ac_cv_type_caddr_t=yes"
16350 else
16351   rm -rf conftest*
16352   eval "ac_cv_type_caddr_t=no"
16353 fi
16354 rm -f conftest*
16355
16356 fi
16357 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16358   echo "$ac_t""yes" 1>&6
16359 else
16360   echo "$ac_t""no" 1>&6
16361   cat >> confdefs.h <<EOF
16362 #define caddr_t char *
16363 EOF
16364
16365 fi
16366
16367
16368 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16369 echo "configure:16370: checking for socklen_t" >&5
16370 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16371   echo $ac_n "(cached) $ac_c" 1>&6
16372 else
16373   cat > conftest.$ac_ext <<EOF
16374 #line 16375 "configure"
16375 #include "confdefs.h"
16376
16377 #ifdef HAVE_SYS_TYPES_H
16378 #include <sys/types.h>
16379 #endif
16380 #ifdef HAVE_SYS_SOCKET_H
16381 #include <sys/socket.h>
16382 #endif
16383
16384 int main() {
16385 socklen_t len;
16386 ; return 0; }
16387 EOF
16388 if { (eval echo configure:16389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16389   rm -rf conftest*
16390   ol_cv_type_socklen_t=yes
16391 else
16392   echo "configure: failed program was:" >&5
16393   cat conftest.$ac_ext >&5
16394   rm -rf conftest*
16395   ol_cv_type_socklen_t=no
16396 fi
16397 rm -f conftest*
16398 fi
16399
16400 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16401   if test $ol_cv_type_socklen_t = no; then
16402     cat >> confdefs.h <<\EOF
16403 #define socklen_t int
16404 EOF
16405
16406   fi
16407  
16408 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16409 echo "configure:16410: checking for member st_blksize in aggregate type struct stat" >&5
16410 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16411   echo $ac_n "(cached) $ac_c" 1>&6
16412 else
16413   cat > conftest.$ac_ext <<EOF
16414 #line 16415 "configure"
16415 #include "confdefs.h"
16416 #include <sys/types.h>
16417 #include <sys/stat.h>
16418 int main() {
16419 struct stat foo; foo.st_blksize;
16420 ; return 0; }
16421 EOF
16422 if { (eval echo configure:16423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16423   rm -rf conftest*
16424   ac_cv_c_struct_member_st_blksize=yes
16425 else
16426   echo "configure: failed program was:" >&5
16427   cat conftest.$ac_ext >&5
16428   rm -rf conftest*
16429   ac_cv_c_struct_member_st_blksize=no
16430 fi
16431 rm -f conftest*
16432 fi
16433
16434 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16435 st_blksize="$ac_cv_c_struct_member_st_blksize"
16436 if test $ac_cv_c_struct_member_st_blksize = yes; then
16437   cat >> confdefs.h <<\EOF
16438 #define HAVE_ST_BLKSIZE 1
16439 EOF
16440
16441 fi
16442
16443 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16444 echo "configure:16445: checking whether time.h and sys/time.h may both be included" >&5
16445 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16446   echo $ac_n "(cached) $ac_c" 1>&6
16447 else
16448   cat > conftest.$ac_ext <<EOF
16449 #line 16450 "configure"
16450 #include "confdefs.h"
16451 #include <sys/types.h>
16452 #include <sys/time.h>
16453 #include <time.h>
16454 int main() {
16455 struct tm *tp;
16456 ; return 0; }
16457 EOF
16458 if { (eval echo configure:16459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16459   rm -rf conftest*
16460   ac_cv_header_time=yes
16461 else
16462   echo "configure: failed program was:" >&5
16463   cat conftest.$ac_ext >&5
16464   rm -rf conftest*
16465   ac_cv_header_time=no
16466 fi
16467 rm -f conftest*
16468 fi
16469
16470 echo "$ac_t""$ac_cv_header_time" 1>&6
16471 if test $ac_cv_header_time = yes; then
16472   cat >> confdefs.h <<\EOF
16473 #define TIME_WITH_SYS_TIME 1
16474 EOF
16475
16476 fi
16477
16478 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16479 echo "configure:16480: checking whether struct tm is in sys/time.h or time.h" >&5
16480 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16481   echo $ac_n "(cached) $ac_c" 1>&6
16482 else
16483   cat > conftest.$ac_ext <<EOF
16484 #line 16485 "configure"
16485 #include "confdefs.h"
16486 #include <sys/types.h>
16487 #include <time.h>
16488 int main() {
16489 struct tm *tp; tp->tm_sec;
16490 ; return 0; }
16491 EOF
16492 if { (eval echo configure:16493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16493   rm -rf conftest*
16494   ac_cv_struct_tm=time.h
16495 else
16496   echo "configure: failed program was:" >&5
16497   cat conftest.$ac_ext >&5
16498   rm -rf conftest*
16499   ac_cv_struct_tm=sys/time.h
16500 fi
16501 rm -f conftest*
16502 fi
16503
16504 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16505 if test $ac_cv_struct_tm = sys/time.h; then
16506   cat >> confdefs.h <<\EOF
16507 #define TM_IN_SYS_TIME 1
16508 EOF
16509
16510 fi
16511
16512 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16513 echo "configure:16514: checking for uid_t in sys/types.h" >&5
16514 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16515   echo $ac_n "(cached) $ac_c" 1>&6
16516 else
16517   cat > conftest.$ac_ext <<EOF
16518 #line 16519 "configure"
16519 #include "confdefs.h"
16520 #include <sys/types.h>
16521 EOF
16522 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16523   egrep "uid_t" >/dev/null 2>&1; then
16524   rm -rf conftest*
16525   ac_cv_type_uid_t=yes
16526 else
16527   rm -rf conftest*
16528   ac_cv_type_uid_t=no
16529 fi
16530 rm -f conftest*
16531
16532 fi
16533
16534 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16535 if test $ac_cv_type_uid_t = no; then
16536   cat >> confdefs.h <<\EOF
16537 #define uid_t int
16538 EOF
16539
16540   cat >> confdefs.h <<\EOF
16541 #define gid_t int
16542 EOF
16543
16544 fi
16545
16546 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16547 echo "configure:16548: checking for sig_atomic_t" >&5
16548 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16549   echo $ac_n "(cached) $ac_c" 1>&6
16550 else
16551   cat > conftest.$ac_ext <<EOF
16552 #line 16553 "configure"
16553 #include "confdefs.h"
16554 #include <signal.h>
16555 int main() {
16556 sig_atomic_t atomic;
16557 ; return 0; }
16558 EOF
16559 if { (eval echo configure:16560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16560   rm -rf conftest*
16561   ol_cv_type_sig_atomic_t=yes
16562 else
16563   echo "configure: failed program was:" >&5
16564   cat conftest.$ac_ext >&5
16565   rm -rf conftest*
16566   ol_cv_type_sig_atomic_t=no
16567 fi
16568 rm -f conftest*
16569 fi
16570
16571 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16572   if test $ol_cv_type_sig_atomic_t = no; then
16573     cat >> confdefs.h <<\EOF
16574 #define sig_atomic_t int
16575 EOF
16576
16577   fi
16578  
16579
16580
16581 # test for pw_gecos in struct passwd
16582 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16583 echo "configure:16584: checking struct passwd for pw_gecos" >&5
16584 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16585   echo $ac_n "(cached) $ac_c" 1>&6
16586 else
16587   
16588         cat > conftest.$ac_ext <<EOF
16589 #line 16590 "configure"
16590 #include "confdefs.h"
16591 #include <pwd.h>
16592 int main() {
16593
16594         struct passwd pwd;
16595         pwd.pw_gecos = pwd.pw_name;
16596
16597 ; return 0; }
16598 EOF
16599 if { (eval echo configure:16600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16600   rm -rf conftest*
16601   ol_cv_struct_passwd_pw_gecos=yes
16602 else
16603   echo "configure: failed program was:" >&5
16604   cat conftest.$ac_ext >&5
16605   rm -rf conftest*
16606   ol_cv_struct_passwd_pw_gecos=no
16607 fi
16608 rm -f conftest*
16609 fi
16610
16611 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16612 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16613         cat >> confdefs.h <<\EOF
16614 #define HAVE_PW_GECOS 1
16615 EOF
16616
16617 fi
16618
16619 # test for pw_passwd in struct passwd
16620 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16621 echo "configure:16622: checking struct passwd for pw_passwd" >&5
16622 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16623   echo $ac_n "(cached) $ac_c" 1>&6
16624 else
16625   
16626         cat > conftest.$ac_ext <<EOF
16627 #line 16628 "configure"
16628 #include "confdefs.h"
16629 #include <pwd.h>
16630 int main() {
16631
16632         struct passwd pwd;
16633         pwd.pw_passwd = pwd.pw_name;
16634
16635 ; return 0; }
16636 EOF
16637 if { (eval echo configure:16638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16638   rm -rf conftest*
16639   ol_cv_struct_passwd_pw_passwd=yes
16640 else
16641   echo "configure: failed program was:" >&5
16642   cat conftest.$ac_ext >&5
16643   rm -rf conftest*
16644   ol_cv_struct_passwd_pw_passwd=no
16645 fi
16646 rm -f conftest*
16647 fi
16648
16649 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16650 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16651         cat >> confdefs.h <<\EOF
16652 #define HAVE_PW_PASSWD 1
16653 EOF
16654
16655 fi
16656
16657
16658 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16659 echo "configure:16660: checking if toupper() requires islower()" >&5
16660 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16661   echo $ac_n "(cached) $ac_c" 1>&6
16662 else
16663   
16664         if test "$cross_compiling" = yes; then
16665   ol_cv_c_upper_lower=safe
16666 else
16667   cat > conftest.$ac_ext <<EOF
16668 #line 16669 "configure"
16669 #include "confdefs.h"
16670
16671 #include <ctype.h>
16672 main()
16673 {
16674         if ('C' == toupper('C'))
16675                 exit(0);
16676         else
16677                 exit(1);
16678 }
16679 EOF
16680 if { (eval echo configure:16681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16681 then
16682   ol_cv_c_upper_lower=no
16683 else
16684   echo "configure: failed program was:" >&5
16685   cat conftest.$ac_ext >&5
16686   rm -fr conftest*
16687   ol_cv_c_upper_lower=yes
16688 fi
16689 rm -fr conftest*
16690 fi
16691
16692 fi
16693
16694 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16695 if test $ol_cv_c_upper_lower != no ; then
16696         cat >> confdefs.h <<\EOF
16697 #define C_UPPER_LOWER 1
16698 EOF
16699
16700 fi
16701
16702 echo $ac_n "checking for working const""... $ac_c" 1>&6
16703 echo "configure:16704: checking for working const" >&5
16704 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16705   echo $ac_n "(cached) $ac_c" 1>&6
16706 else
16707   cat > conftest.$ac_ext <<EOF
16708 #line 16709 "configure"
16709 #include "confdefs.h"
16710
16711 int main() {
16712
16713 /* Ultrix mips cc rejects this.  */
16714 typedef int charset[2]; const charset x;
16715 /* SunOS 4.1.1 cc rejects this.  */
16716 char const *const *ccp;
16717 char **p;
16718 /* NEC SVR4.0.2 mips cc rejects this.  */
16719 struct point {int x, y;};
16720 static struct point const zero = {0,0};
16721 /* AIX XL C 1.02.0.0 rejects this.
16722    It does not let you subtract one const X* pointer from another in an arm
16723    of an if-expression whose if-part is not a constant expression */
16724 const char *g = "string";
16725 ccp = &g + (g ? g-g : 0);
16726 /* HPUX 7.0 cc rejects these. */
16727 ++ccp;
16728 p = (char**) ccp;
16729 ccp = (char const *const *) p;
16730 { /* SCO 3.2v4 cc rejects this.  */
16731   char *t;
16732   char const *s = 0 ? (char *) 0 : (char const *) 0;
16733
16734   *t++ = 0;
16735 }
16736 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16737   int x[] = {25, 17};
16738   const int *foo = &x[0];
16739   ++foo;
16740 }
16741 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16742   typedef const int *iptr;
16743   iptr p = 0;
16744   ++p;
16745 }
16746 { /* AIX XL C 1.02.0.0 rejects this saying
16747      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16748   struct s { int j; const int *ap[3]; };
16749   struct s *b; b->j = 5;
16750 }
16751 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16752   const int foo = 10;
16753 }
16754
16755 ; return 0; }
16756 EOF
16757 if { (eval echo configure:16758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16758   rm -rf conftest*
16759   ac_cv_c_const=yes
16760 else
16761   echo "configure: failed program was:" >&5
16762   cat conftest.$ac_ext >&5
16763   rm -rf conftest*
16764   ac_cv_c_const=no
16765 fi
16766 rm -f conftest*
16767 fi
16768
16769 echo "$ac_t""$ac_cv_c_const" 1>&6
16770 if test $ac_cv_c_const = no; then
16771   cat >> confdefs.h <<\EOF
16772 #define const 
16773 EOF
16774
16775 fi
16776
16777 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16778 echo "configure:16779: checking if compiler understands volatile" >&5
16779 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16780   echo $ac_n "(cached) $ac_c" 1>&6
16781 else
16782   cat > conftest.$ac_ext <<EOF
16783 #line 16784 "configure"
16784 #include "confdefs.h"
16785 int x, y, z;
16786 int main() {
16787 volatile int a; int * volatile b = x ? &y : &z;
16788       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16789       *b = 0;
16790 ; return 0; }
16791 EOF
16792 if { (eval echo configure:16793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16793   rm -rf conftest*
16794   ol_cv_c_volatile=yes
16795 else
16796   echo "configure: failed program was:" >&5
16797   cat conftest.$ac_ext >&5
16798   rm -rf conftest*
16799   ol_cv_c_volatile=no
16800 fi
16801 rm -f conftest*
16802 fi
16803
16804 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16805   if test $ol_cv_c_volatile = yes; then
16806     : 
16807   else
16808     cat >> confdefs.h <<\EOF
16809 #define volatile 
16810 EOF
16811
16812   fi
16813  
16814
16815 if test $cross_compiling = yes ; then
16816         cat >> confdefs.h <<\EOF
16817 #define CROSS_COMPILING 1
16818 EOF
16819
16820 else
16821         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16822 echo "configure:16823: checking whether byte ordering is bigendian" >&5
16823 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16824   echo $ac_n "(cached) $ac_c" 1>&6
16825 else
16826   ac_cv_c_bigendian=unknown
16827 # See if sys/param.h defines the BYTE_ORDER macro.
16828 cat > conftest.$ac_ext <<EOF
16829 #line 16830 "configure"
16830 #include "confdefs.h"
16831 #include <sys/types.h>
16832 #include <sys/param.h>
16833 int main() {
16834
16835 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16836  bogus endian macros
16837 #endif
16838 ; return 0; }
16839 EOF
16840 if { (eval echo configure:16841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16841   rm -rf conftest*
16842   # It does; now see whether it defined to BIG_ENDIAN or not.
16843 cat > conftest.$ac_ext <<EOF
16844 #line 16845 "configure"
16845 #include "confdefs.h"
16846 #include <sys/types.h>
16847 #include <sys/param.h>
16848 int main() {
16849
16850 #if BYTE_ORDER != BIG_ENDIAN
16851  not big endian
16852 #endif
16853 ; return 0; }
16854 EOF
16855 if { (eval echo configure:16856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16856   rm -rf conftest*
16857   ac_cv_c_bigendian=yes
16858 else
16859   echo "configure: failed program was:" >&5
16860   cat conftest.$ac_ext >&5
16861   rm -rf conftest*
16862   ac_cv_c_bigendian=no
16863 fi
16864 rm -f conftest*
16865 else
16866   echo "configure: failed program was:" >&5
16867   cat conftest.$ac_ext >&5
16868 fi
16869 rm -f conftest*
16870 if test $ac_cv_c_bigendian = unknown; then
16871 if test "$cross_compiling" = yes; then
16872     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16873 else
16874   cat > conftest.$ac_ext <<EOF
16875 #line 16876 "configure"
16876 #include "confdefs.h"
16877 main () {
16878   /* Are we little or big endian?  From Harbison&Steele.  */
16879   union
16880   {
16881     long l;
16882     char c[sizeof (long)];
16883   } u;
16884   u.l = 1;
16885   exit (u.c[sizeof (long) - 1] == 1);
16886 }
16887 EOF
16888 if { (eval echo configure:16889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16889 then
16890   ac_cv_c_bigendian=no
16891 else
16892   echo "configure: failed program was:" >&5
16893   cat conftest.$ac_ext >&5
16894   rm -fr conftest*
16895   ac_cv_c_bigendian=yes
16896 fi
16897 rm -fr conftest*
16898 fi
16899
16900 fi
16901 fi
16902
16903 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16904 if test $ac_cv_c_bigendian = yes; then
16905   cat >> confdefs.h <<\EOF
16906 #define WORDS_BIGENDIAN 1
16907 EOF
16908
16909 fi
16910
16911 fi
16912
16913 echo $ac_n "checking size of short""... $ac_c" 1>&6
16914 echo "configure:16915: checking size of short" >&5 
16915 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16916   echo $ac_n "(cached) $ac_c" 1>&6
16917 else
16918   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16919   cat > conftest.$ac_ext <<EOF
16920 #line 16921 "configure"
16921 #include "confdefs.h"
16922 #include "confdefs.h" 
16923 #include <sys/types.h> 
16924  
16925
16926 int main() {
16927 switch (0) case 0: case (sizeof (short) == $ac_size):;
16928 ; return 0; }
16929 EOF
16930 if { (eval echo configure:16931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16931   rm -rf conftest*
16932   ac_cv_sizeof_short=$ac_size
16933 else
16934   echo "configure: failed program was:" >&5
16935   cat conftest.$ac_ext >&5
16936 fi
16937 rm -f conftest* 
16938   if test x$ac_cv_sizeof_short != x ; then break; fi 
16939 done 
16940
16941 fi
16942  
16943 if test x$ac_cv_sizeof_short = x ; then 
16944   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16945 fi 
16946 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16947 cat >> confdefs.h <<EOF
16948 #define SIZEOF_SHORT $ac_cv_sizeof_short
16949 EOF
16950  
16951  
16952 echo $ac_n "checking size of int""... $ac_c" 1>&6
16953 echo "configure:16954: checking size of int" >&5 
16954 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16955   echo $ac_n "(cached) $ac_c" 1>&6
16956 else
16957   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16958   cat > conftest.$ac_ext <<EOF
16959 #line 16960 "configure"
16960 #include "confdefs.h"
16961 #include "confdefs.h" 
16962 #include <sys/types.h> 
16963  
16964
16965 int main() {
16966 switch (0) case 0: case (sizeof (int) == $ac_size):;
16967 ; return 0; }
16968 EOF
16969 if { (eval echo configure:16970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16970   rm -rf conftest*
16971   ac_cv_sizeof_int=$ac_size
16972 else
16973   echo "configure: failed program was:" >&5
16974   cat conftest.$ac_ext >&5
16975 fi
16976 rm -f conftest* 
16977   if test x$ac_cv_sizeof_int != x ; then break; fi 
16978 done 
16979
16980 fi
16981  
16982 if test x$ac_cv_sizeof_int = x ; then 
16983   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16984 fi 
16985 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16986 cat >> confdefs.h <<EOF
16987 #define SIZEOF_INT $ac_cv_sizeof_int
16988 EOF
16989  
16990  
16991 echo $ac_n "checking size of long""... $ac_c" 1>&6
16992 echo "configure:16993: checking size of long" >&5 
16993 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16994   echo $ac_n "(cached) $ac_c" 1>&6
16995 else
16996   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16997   cat > conftest.$ac_ext <<EOF
16998 #line 16999 "configure"
16999 #include "confdefs.h"
17000 #include "confdefs.h" 
17001 #include <sys/types.h> 
17002  
17003
17004 int main() {
17005 switch (0) case 0: case (sizeof (long) == $ac_size):;
17006 ; return 0; }
17007 EOF
17008 if { (eval echo configure:17009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17009   rm -rf conftest*
17010   ac_cv_sizeof_long=$ac_size
17011 else
17012   echo "configure: failed program was:" >&5
17013   cat conftest.$ac_ext >&5
17014 fi
17015 rm -f conftest* 
17016   if test x$ac_cv_sizeof_long != x ; then break; fi 
17017 done 
17018
17019 fi
17020  
17021 if test x$ac_cv_sizeof_long = x ; then 
17022   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
17023 fi 
17024 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
17025 cat >> confdefs.h <<EOF
17026 #define SIZEOF_LONG $ac_cv_sizeof_long
17027 EOF
17028  
17029
17030
17031 if test "$ac_cv_sizeof_int" -lt 4 ; then
17032         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
17033
17034         cat >> confdefs.h <<\EOF
17035 #define LBER_INT_T long
17036 EOF
17037
17038 else
17039         cat >> confdefs.h <<\EOF
17040 #define LBER_INT_T int
17041 EOF
17042
17043 fi
17044
17045 cat >> confdefs.h <<\EOF
17046 #define LBER_LEN_T long
17047 EOF
17048
17049 cat >> confdefs.h <<\EOF
17050 #define LBER_SOCKET_T int
17051 EOF
17052
17053 cat >> confdefs.h <<\EOF
17054 #define LBER_TAG_T long
17055 EOF
17056
17057
17058 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
17059 echo "configure:17060: checking for 8-bit clean memcmp" >&5
17060 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
17061   echo $ac_n "(cached) $ac_c" 1>&6
17062 else
17063   if test "$cross_compiling" = yes; then
17064   ac_cv_func_memcmp_clean=no
17065 else
17066   cat > conftest.$ac_ext <<EOF
17067 #line 17068 "configure"
17068 #include "confdefs.h"
17069
17070 main()
17071 {
17072   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
17073   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
17074 }
17075
17076 EOF
17077 if { (eval echo configure:17078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
17078 then
17079   ac_cv_func_memcmp_clean=yes
17080 else
17081   echo "configure: failed program was:" >&5
17082   cat conftest.$ac_ext >&5
17083   rm -fr conftest*
17084   ac_cv_func_memcmp_clean=no
17085 fi
17086 rm -fr conftest*
17087 fi
17088
17089 fi
17090
17091 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
17092 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
17093
17094 echo $ac_n "checking for strftime""... $ac_c" 1>&6
17095 echo "configure:17096: checking for strftime" >&5
17096 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
17097   echo $ac_n "(cached) $ac_c" 1>&6
17098 else
17099   cat > conftest.$ac_ext <<EOF
17100 #line 17101 "configure"
17101 #include "confdefs.h"
17102 /* System header to define __stub macros and hopefully few prototypes,
17103     which can conflict with char strftime(); below.  */
17104 #include <assert.h>
17105 /* Override any gcc2 internal prototype to avoid an error.  */
17106 /* We use char because int might match the return type of a gcc2
17107     builtin and then its argument prototype would still apply.  */
17108 char strftime();
17109 char (*f)();
17110
17111 int main() {
17112
17113 /* The GNU C library defines this for functions which it implements
17114     to always fail with ENOSYS.  Some functions are actually named
17115     something starting with __ and the normal name is an alias.  */
17116 #if defined (__stub_strftime) || defined (__stub___strftime)
17117 choke me
17118 #else
17119 f = strftime;
17120 #endif
17121
17122 ; return 0; }
17123 EOF
17124 if { (eval echo configure:17125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17125   rm -rf conftest*
17126   eval "ac_cv_func_strftime=yes"
17127 else
17128   echo "configure: failed program was:" >&5
17129   cat conftest.$ac_ext >&5
17130   rm -rf conftest*
17131   eval "ac_cv_func_strftime=no"
17132 fi
17133 rm -f conftest*
17134 fi
17135
17136 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
17137   echo "$ac_t""yes" 1>&6
17138   cat >> confdefs.h <<\EOF
17139 #define HAVE_STRFTIME 1
17140 EOF
17141
17142 else
17143   echo "$ac_t""no" 1>&6
17144 # strftime is in -lintl on SCO UNIX.
17145 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
17146 echo "configure:17147: checking for strftime in -lintl" >&5
17147 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
17148 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
17149   echo $ac_n "(cached) $ac_c" 1>&6
17150 else
17151   ac_save_LIBS="$LIBS"
17152 LIBS="-lintl  $LIBS"
17153 cat > conftest.$ac_ext <<EOF
17154 #line 17155 "configure"
17155 #include "confdefs.h"
17156 /* Override any gcc2 internal prototype to avoid an error.  */
17157 /* We use char because int might match the return type of a gcc2
17158     builtin and then its argument prototype would still apply.  */
17159 char strftime();
17160
17161 int main() {
17162 strftime()
17163 ; return 0; }
17164 EOF
17165 if { (eval echo configure:17166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17166   rm -rf conftest*
17167   eval "ac_cv_lib_$ac_lib_var=yes"
17168 else
17169   echo "configure: failed program was:" >&5
17170   cat conftest.$ac_ext >&5
17171   rm -rf conftest*
17172   eval "ac_cv_lib_$ac_lib_var=no"
17173 fi
17174 rm -f conftest*
17175 LIBS="$ac_save_LIBS"
17176
17177 fi
17178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
17179   echo "$ac_t""yes" 1>&6
17180   cat >> confdefs.h <<\EOF
17181 #define HAVE_STRFTIME 1
17182 EOF
17183
17184 LIBS="-lintl $LIBS"
17185 else
17186   echo "$ac_t""no" 1>&6
17187 fi
17188
17189 fi
17190
17191
17192 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
17193 echo "configure:17194: checking for inet_aton()" >&5
17194 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
17195   echo $ac_n "(cached) $ac_c" 1>&6
17196 else
17197   cat > conftest.$ac_ext <<EOF
17198 #line 17199 "configure"
17199 #include "confdefs.h"
17200
17201 #ifdef HAVE_SYS_TYPES_H
17202 #       include <sys/types.h>
17203 #endif
17204 #ifdef HAVE_SYS_SOCKET_H
17205 #       include <sys/socket.h>
17206 #       ifdef HAVE_SYS_SELECT_H
17207 #               include <sys/select.h>
17208 #       endif
17209 #       include <netinet/in.h>
17210 #       ifdef HAVE_ARPA_INET_H
17211 #               include <arpa/inet.h>
17212 #       endif
17213 #endif
17214
17215 int main() {
17216 struct in_addr in;
17217 int rc = inet_aton( "255.255.255.255", &in );
17218 ; return 0; }
17219 EOF
17220 if { (eval echo configure:17221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17221   rm -rf conftest*
17222   ol_cv_func_inet_aton=yes
17223 else
17224   echo "configure: failed program was:" >&5
17225   cat conftest.$ac_ext >&5
17226   rm -rf conftest*
17227   ol_cv_func_inet_aton=no
17228 fi
17229 rm -f conftest*
17230 fi
17231
17232 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
17233   if test $ol_cv_func_inet_aton != no; then
17234     cat >> confdefs.h <<\EOF
17235 #define HAVE_INET_ATON 1
17236 EOF
17237
17238   fi
17239  
17240
17241 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
17242 echo "configure:17243: checking for _spawnlp" >&5
17243 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
17244   echo $ac_n "(cached) $ac_c" 1>&6
17245 else
17246   cat > conftest.$ac_ext <<EOF
17247 #line 17248 "configure"
17248 #include "confdefs.h"
17249 /* System header to define __stub macros and hopefully few prototypes,
17250     which can conflict with char _spawnlp(); below.  */
17251 #include <assert.h>
17252 /* Override any gcc2 internal prototype to avoid an error.  */
17253 /* We use char because int might match the return type of a gcc2
17254     builtin and then its argument prototype would still apply.  */
17255 char _spawnlp();
17256 char (*f)();
17257
17258 int main() {
17259
17260 /* The GNU C library defines this for functions which it implements
17261     to always fail with ENOSYS.  Some functions are actually named
17262     something starting with __ and the normal name is an alias.  */
17263 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
17264 choke me
17265 #else
17266 f = _spawnlp;
17267 #endif
17268
17269 ; return 0; }
17270 EOF
17271 if { (eval echo configure:17272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17272   rm -rf conftest*
17273   eval "ac_cv_func__spawnlp=yes"
17274 else
17275   echo "configure: failed program was:" >&5
17276   cat conftest.$ac_ext >&5
17277   rm -rf conftest*
17278   eval "ac_cv_func__spawnlp=no"
17279 fi
17280 rm -f conftest*
17281 fi
17282
17283 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
17284   echo "$ac_t""yes" 1>&6
17285   cat >> confdefs.h <<\EOF
17286 #define HAVE_SPAWNLP 1
17287 EOF
17288
17289 else
17290   echo "$ac_t""no" 1>&6
17291 fi
17292
17293
17294 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
17295 echo "configure:17296: checking for _snprintf" >&5
17296 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
17297   echo $ac_n "(cached) $ac_c" 1>&6
17298 else
17299   cat > conftest.$ac_ext <<EOF
17300 #line 17301 "configure"
17301 #include "confdefs.h"
17302 /* System header to define __stub macros and hopefully few prototypes,
17303     which can conflict with char _snprintf(); below.  */
17304 #include <assert.h>
17305 /* Override any gcc2 internal prototype to avoid an error.  */
17306 /* We use char because int might match the return type of a gcc2
17307     builtin and then its argument prototype would still apply.  */
17308 char _snprintf();
17309 char (*f)();
17310
17311 int main() {
17312
17313 /* The GNU C library defines this for functions which it implements
17314     to always fail with ENOSYS.  Some functions are actually named
17315     something starting with __ and the normal name is an alias.  */
17316 #if defined (__stub__snprintf) || defined (__stub____snprintf)
17317 choke me
17318 #else
17319 f = _snprintf;
17320 #endif
17321
17322 ; return 0; }
17323 EOF
17324 if { (eval echo configure:17325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17325   rm -rf conftest*
17326   eval "ac_cv_func__snprintf=yes"
17327 else
17328   echo "configure: failed program was:" >&5
17329   cat conftest.$ac_ext >&5
17330   rm -rf conftest*
17331   eval "ac_cv_func__snprintf=no"
17332 fi
17333 rm -f conftest*
17334 fi
17335
17336 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17337   echo "$ac_t""yes" 1>&6
17338   ac_cv_func_snprintf=yes
17339         cat >> confdefs.h <<\EOF
17340 #define snprintf _snprintf
17341 EOF
17342
17343
17344 else
17345   echo "$ac_t""no" 1>&6
17346 fi
17347
17348
17349 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17350 echo "configure:17351: checking for _vsnprintf" >&5
17351 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17352   echo $ac_n "(cached) $ac_c" 1>&6
17353 else
17354   cat > conftest.$ac_ext <<EOF
17355 #line 17356 "configure"
17356 #include "confdefs.h"
17357 /* System header to define __stub macros and hopefully few prototypes,
17358     which can conflict with char _vsnprintf(); below.  */
17359 #include <assert.h>
17360 /* Override any gcc2 internal prototype to avoid an error.  */
17361 /* We use char because int might match the return type of a gcc2
17362     builtin and then its argument prototype would still apply.  */
17363 char _vsnprintf();
17364 char (*f)();
17365
17366 int main() {
17367
17368 /* The GNU C library defines this for functions which it implements
17369     to always fail with ENOSYS.  Some functions are actually named
17370     something starting with __ and the normal name is an alias.  */
17371 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17372 choke me
17373 #else
17374 f = _vsnprintf;
17375 #endif
17376
17377 ; return 0; }
17378 EOF
17379 if { (eval echo configure:17380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17380   rm -rf conftest*
17381   eval "ac_cv_func__vsnprintf=yes"
17382 else
17383   echo "configure: failed program was:" >&5
17384   cat conftest.$ac_ext >&5
17385   rm -rf conftest*
17386   eval "ac_cv_func__vsnprintf=no"
17387 fi
17388 rm -f conftest*
17389 fi
17390
17391 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17392   echo "$ac_t""yes" 1>&6
17393   ac_cv_func_vsnprintf=yes
17394         cat >> confdefs.h <<\EOF
17395 #define vsnprintf _vsnprintf
17396 EOF
17397
17398
17399 else
17400   echo "$ac_t""no" 1>&6
17401 fi
17402
17403
17404 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17405 echo "configure:17406: checking for vprintf" >&5
17406 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17407   echo $ac_n "(cached) $ac_c" 1>&6
17408 else
17409   cat > conftest.$ac_ext <<EOF
17410 #line 17411 "configure"
17411 #include "confdefs.h"
17412 /* System header to define __stub macros and hopefully few prototypes,
17413     which can conflict with char vprintf(); below.  */
17414 #include <assert.h>
17415 /* Override any gcc2 internal prototype to avoid an error.  */
17416 /* We use char because int might match the return type of a gcc2
17417     builtin and then its argument prototype would still apply.  */
17418 char vprintf();
17419 char (*f)();
17420
17421 int main() {
17422
17423 /* The GNU C library defines this for functions which it implements
17424     to always fail with ENOSYS.  Some functions are actually named
17425     something starting with __ and the normal name is an alias.  */
17426 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17427 choke me
17428 #else
17429 f = vprintf;
17430 #endif
17431
17432 ; return 0; }
17433 EOF
17434 if { (eval echo configure:17435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17435   rm -rf conftest*
17436   eval "ac_cv_func_vprintf=yes"
17437 else
17438   echo "configure: failed program was:" >&5
17439   cat conftest.$ac_ext >&5
17440   rm -rf conftest*
17441   eval "ac_cv_func_vprintf=no"
17442 fi
17443 rm -f conftest*
17444 fi
17445
17446 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17447   echo "$ac_t""yes" 1>&6
17448   cat >> confdefs.h <<\EOF
17449 #define HAVE_VPRINTF 1
17450 EOF
17451
17452 else
17453   echo "$ac_t""no" 1>&6
17454 fi
17455
17456 if test "$ac_cv_func_vprintf" != yes; then
17457 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17458 echo "configure:17459: checking for _doprnt" >&5
17459 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17460   echo $ac_n "(cached) $ac_c" 1>&6
17461 else
17462   cat > conftest.$ac_ext <<EOF
17463 #line 17464 "configure"
17464 #include "confdefs.h"
17465 /* System header to define __stub macros and hopefully few prototypes,
17466     which can conflict with char _doprnt(); below.  */
17467 #include <assert.h>
17468 /* Override any gcc2 internal prototype to avoid an error.  */
17469 /* We use char because int might match the return type of a gcc2
17470     builtin and then its argument prototype would still apply.  */
17471 char _doprnt();
17472 char (*f)();
17473
17474 int main() {
17475
17476 /* The GNU C library defines this for functions which it implements
17477     to always fail with ENOSYS.  Some functions are actually named
17478     something starting with __ and the normal name is an alias.  */
17479 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17480 choke me
17481 #else
17482 f = _doprnt;
17483 #endif
17484
17485 ; return 0; }
17486 EOF
17487 if { (eval echo configure:17488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17488   rm -rf conftest*
17489   eval "ac_cv_func__doprnt=yes"
17490 else
17491   echo "configure: failed program was:" >&5
17492   cat conftest.$ac_ext >&5
17493   rm -rf conftest*
17494   eval "ac_cv_func__doprnt=no"
17495 fi
17496 rm -f conftest*
17497 fi
17498
17499 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17500   echo "$ac_t""yes" 1>&6
17501   cat >> confdefs.h <<\EOF
17502 #define HAVE_DOPRNT 1
17503 EOF
17504
17505 else
17506   echo "$ac_t""no" 1>&6
17507 fi
17508
17509 fi
17510
17511
17512 if test $ac_cv_func_vprintf = yes ; then
17513                 for ac_func in vsnprintf vsprintf
17514 do
17515 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17516 echo "configure:17517: checking for $ac_func" >&5
17517 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17518   echo $ac_n "(cached) $ac_c" 1>&6
17519 else
17520   cat > conftest.$ac_ext <<EOF
17521 #line 17522 "configure"
17522 #include "confdefs.h"
17523 /* System header to define __stub macros and hopefully few prototypes,
17524     which can conflict with char $ac_func(); below.  */
17525 #include <assert.h>
17526 /* Override any gcc2 internal prototype to avoid an error.  */
17527 /* We use char because int might match the return type of a gcc2
17528     builtin and then its argument prototype would still apply.  */
17529 char $ac_func();
17530 char (*f)();
17531
17532 int main() {
17533
17534 /* The GNU C library defines this for functions which it implements
17535     to always fail with ENOSYS.  Some functions are actually named
17536     something starting with __ and the normal name is an alias.  */
17537 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17538 choke me
17539 #else
17540 f = $ac_func;
17541 #endif
17542
17543 ; return 0; }
17544 EOF
17545 if { (eval echo configure:17546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17546   rm -rf conftest*
17547   eval "ac_cv_func_$ac_func=yes"
17548 else
17549   echo "configure: failed program was:" >&5
17550   cat conftest.$ac_ext >&5
17551   rm -rf conftest*
17552   eval "ac_cv_func_$ac_func=no"
17553 fi
17554 rm -f conftest*
17555 fi
17556
17557 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17558   echo "$ac_t""yes" 1>&6
17559     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17560   cat >> confdefs.h <<EOF
17561 #define $ac_tr_func 1
17562 EOF
17563  
17564 else
17565   echo "$ac_t""no" 1>&6
17566 fi
17567 done
17568
17569 fi
17570
17571 for ac_func in \
17572         bcopy                   \
17573         closesocket             \
17574         chroot                  \
17575         endgrent                \
17576         endpwent                \
17577         fcntl                   \
17578         flock                   \
17579         getdtablesize   \
17580         getgrgid                \
17581         gethostname             \
17582         getpass                 \
17583         getpassphrase   \
17584         getpwuid                \
17585         getpwnam                \
17586         getspnam                \
17587         gettimeofday    \
17588         initgroups              \
17589         lockf                   \
17590         memcpy                  \
17591         memmove                 \
17592         mkstemp                 \
17593         mktemp                  \
17594         pipe                    \
17595         read                    \
17596         recv                    \
17597         recvfrom                \
17598         setpwfile               \
17599         setgid                  \
17600         setegid                 \
17601         setsid                  \
17602         setuid                  \
17603         seteuid                 \
17604         sigaction               \
17605         signal                  \
17606         sigset                  \
17607         strdup                  \
17608         strerror                \
17609         strpbrk                 \
17610         strrchr                 \
17611         strsep                  \
17612         strstr                  \
17613         strtol                  \
17614         strtoul                 \
17615         strspn                  \
17616         sysconf                 \
17617         usleep                  \
17618         waitpid                 \
17619         wait4                   \
17620         write                   \
17621         send                    \
17622         sendto                  \
17623
17624 do
17625 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17626 echo "configure:17627: checking for $ac_func" >&5
17627 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17628   echo $ac_n "(cached) $ac_c" 1>&6
17629 else
17630   cat > conftest.$ac_ext <<EOF
17631 #line 17632 "configure"
17632 #include "confdefs.h"
17633 /* System header to define __stub macros and hopefully few prototypes,
17634     which can conflict with char $ac_func(); below.  */
17635 #include <assert.h>
17636 /* Override any gcc2 internal prototype to avoid an error.  */
17637 /* We use char because int might match the return type of a gcc2
17638     builtin and then its argument prototype would still apply.  */
17639 char $ac_func();
17640 char (*f)();
17641
17642 int main() {
17643
17644 /* The GNU C library defines this for functions which it implements
17645     to always fail with ENOSYS.  Some functions are actually named
17646     something starting with __ and the normal name is an alias.  */
17647 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17648 choke me
17649 #else
17650 f = $ac_func;
17651 #endif
17652
17653 ; return 0; }
17654 EOF
17655 if { (eval echo configure:17656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17656   rm -rf conftest*
17657   eval "ac_cv_func_$ac_func=yes"
17658 else
17659   echo "configure: failed program was:" >&5
17660   cat conftest.$ac_ext >&5
17661   rm -rf conftest*
17662   eval "ac_cv_func_$ac_func=no"
17663 fi
17664 rm -f conftest*
17665 fi
17666
17667 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17668   echo "$ac_t""yes" 1>&6
17669     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17670   cat >> confdefs.h <<EOF
17671 #define $ac_tr_func 1
17672 EOF
17673  
17674 else
17675   echo "$ac_t""no" 1>&6
17676 fi
17677 done
17678
17679
17680 for ac_func in getopt
17681 do
17682 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17683 echo "configure:17684: checking for $ac_func" >&5
17684 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17685   echo $ac_n "(cached) $ac_c" 1>&6
17686 else
17687   cat > conftest.$ac_ext <<EOF
17688 #line 17689 "configure"
17689 #include "confdefs.h"
17690 /* System header to define __stub macros and hopefully few prototypes,
17691     which can conflict with char $ac_func(); below.  */
17692 #include <assert.h>
17693 /* Override any gcc2 internal prototype to avoid an error.  */
17694 /* We use char because int might match the return type of a gcc2
17695     builtin and then its argument prototype would still apply.  */
17696 char $ac_func();
17697 char (*f)();
17698
17699 int main() {
17700
17701 /* The GNU C library defines this for functions which it implements
17702     to always fail with ENOSYS.  Some functions are actually named
17703     something starting with __ and the normal name is an alias.  */
17704 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17705 choke me
17706 #else
17707 f = $ac_func;
17708 #endif
17709
17710 ; return 0; }
17711 EOF
17712 if { (eval echo configure:17713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17713   rm -rf conftest*
17714   eval "ac_cv_func_$ac_func=yes"
17715 else
17716   echo "configure: failed program was:" >&5
17717   cat conftest.$ac_ext >&5
17718   rm -rf conftest*
17719   eval "ac_cv_func_$ac_func=no"
17720 fi
17721 rm -f conftest*
17722 fi
17723
17724 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17725   echo "$ac_t""yes" 1>&6
17726     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17727   cat >> confdefs.h <<EOF
17728 #define $ac_tr_func 1
17729 EOF
17730  
17731 else
17732   echo "$ac_t""no" 1>&6
17733 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17734 fi
17735 done
17736
17737
17738
17739 if test "$ac_cv_func_getopt" != yes; then
17740         LIBSRCS="$LIBSRCS getopt.c"
17741 fi
17742
17743 # Check Configuration
17744 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17745 echo "configure:17746: checking declaration of sys_errlist" >&5
17746 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17747   echo $ac_n "(cached) $ac_c" 1>&6
17748 else
17749   
17750         cat > conftest.$ac_ext <<EOF
17751 #line 17752 "configure"
17752 #include "confdefs.h"
17753
17754 #include <stdio.h>
17755 #include <sys/types.h>
17756 #include <errno.h>
17757 #ifdef WINNT
17758 #include <stdlib.h>
17759 #endif 
17760 int main() {
17761 char *c = (char *) *sys_errlist
17762 ; return 0; }
17763 EOF
17764 if { (eval echo configure:17765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17765   rm -rf conftest*
17766   ol_cv_dcl_sys_errlist=yes
17767         ol_cv_have_sys_errlist=yes
17768 else
17769   echo "configure: failed program was:" >&5
17770   cat conftest.$ac_ext >&5
17771   rm -rf conftest*
17772   ol_cv_dcl_sys_errlist=no
17773 fi
17774 rm -f conftest*
17775 fi
17776
17777 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17778 #
17779 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17780 if test $ol_cv_dcl_sys_errlist = no ; then
17781         cat >> confdefs.h <<\EOF
17782 #define DECL_SYS_ERRLIST 1
17783 EOF
17784
17785
17786         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17787 echo "configure:17788: checking existence of sys_errlist" >&5
17788 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17789   echo $ac_n "(cached) $ac_c" 1>&6
17790 else
17791   
17792                 cat > conftest.$ac_ext <<EOF
17793 #line 17794 "configure"
17794 #include "confdefs.h"
17795 #include <errno.h>
17796 int main() {
17797 char *c = (char *) *sys_errlist
17798 ; return 0; }
17799 EOF
17800 if { (eval echo configure:17801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17801   rm -rf conftest*
17802   ol_cv_have_sys_errlist=yes
17803 else
17804   echo "configure: failed program was:" >&5
17805   cat conftest.$ac_ext >&5
17806   rm -rf conftest*
17807   ol_cv_have_sys_errlist=no
17808 fi
17809 rm -f conftest*
17810 fi
17811
17812 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17813 fi
17814 if test $ol_cv_have_sys_errlist = yes ; then
17815         cat >> confdefs.h <<\EOF
17816 #define HAVE_SYS_ERRLIST 1
17817 EOF
17818
17819 fi
17820
17821
17822
17823 if test "$ol_enable_debug" != no ; then
17824         cat >> confdefs.h <<\EOF
17825 #define LDAP_DEBUG 1
17826 EOF
17827
17828 fi
17829 if test "$ol_enable_syslog" = yes ; then
17830         cat >> confdefs.h <<\EOF
17831 #define LDAP_SYSLOG 1
17832 EOF
17833
17834 fi
17835 if test "$ol_enable_cache" = no ; then
17836         cat >> confdefs.h <<\EOF
17837 #define LDAP_NOCACHE 1
17838 EOF
17839
17840 fi
17841 if test "$ol_link_kbind" != no ; then
17842         cat >> confdefs.h <<\EOF
17843 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17844 EOF
17845
17846 fi
17847 if test "$ol_enable_proctitle" != no ; then
17848         cat >> confdefs.h <<\EOF
17849 #define LDAP_PROCTITLE 1
17850 EOF
17851
17852 fi
17853 if test "$ol_enable_referrals" != no ; then
17854         cat >> confdefs.h <<\EOF
17855 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17856 EOF
17857
17858 fi
17859 if test "$ol_enable_local" != no; then
17860         cat >> confdefs.h <<\EOF
17861 #define LDAP_PF_LOCAL 1
17862 EOF
17863
17864 fi
17865 if test "$ol_link_ipv6" != no; then
17866         cat >> confdefs.h <<\EOF
17867 #define LDAP_PF_INET6 1
17868 EOF
17869
17870 fi
17871 if test "$ol_enable_cleartext" != no ; then
17872         cat >> confdefs.h <<\EOF
17873 #define SLAPD_CLEARTEXT 1
17874 EOF
17875
17876 fi
17877 if test "$ol_enable_crypt" != no ; then
17878         cat >> confdefs.h <<\EOF
17879 #define SLAPD_CRYPT 1
17880 EOF
17881
17882 fi
17883 if test "$ol_link_kpasswd" != no ; then
17884         cat >> confdefs.h <<\EOF
17885 #define SLAPD_KPASSWD 1
17886 EOF
17887
17888 fi
17889 if test "$ol_link_spasswd" != no ; then
17890         cat >> confdefs.h <<\EOF
17891 #define SLAPD_SPASSWD 1
17892 EOF
17893
17894 fi
17895 if test "$ol_enable_phonetic" != no ; then
17896         cat >> confdefs.h <<\EOF
17897 #define SLAPD_PHONETIC 1
17898 EOF
17899
17900 fi
17901 if test "$ol_enable_rlookups" != no ; then
17902         cat >> confdefs.h <<\EOF
17903 #define SLAPD_RLOOKUPS 1
17904 EOF
17905
17906 fi
17907 if test "$ol_enable_aci" != no ; then
17908         cat >> confdefs.h <<\EOF
17909 #define SLAPD_ACI_ENABLED 1
17910 EOF
17911
17912 fi
17913
17914 if test "$ol_link_modules" != no ; then
17915         cat >> confdefs.h <<\EOF
17916 #define SLAPD_MODULES 1
17917 EOF
17918
17919         BUILD_SLAPD=yes
17920         SLAPD_MODULES_LDFLAGS="-dlopen self"
17921 fi
17922
17923 if test "$ol_enable_bdb" != no ; then
17924         cat >> confdefs.h <<\EOF
17925 #define SLAPD_BDB 1
17926 EOF
17927
17928         BUILD_SLAPD=yes
17929         BUILD_BDB=yes
17930         if test "$ol_with_bdb_module" != static ; then
17931                 cat >> confdefs.h <<\EOF
17932 #define SLAPD_BDB_DYNAMIC 1
17933 EOF
17934
17935                 BUILD_BDB=mod
17936                 BUILD_BDB_DYNAMIC=shared
17937                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17938                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
17939         else
17940                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
17941         fi
17942 fi
17943
17944 if test "$ol_link_dnssrv" != no ; then
17945         cat >> confdefs.h <<\EOF
17946 #define SLAPD_DNSSRV 1
17947 EOF
17948
17949         BUILD_SLAPD=yes
17950         BUILD_DNSSRV=yes
17951         if test "$ol_with_dnssrv_module" != static ; then
17952                 cat >> confdefs.h <<\EOF
17953 #define SLAPD_DNSSRV_DYNAMIC 1
17954 EOF
17955
17956                 BUILD_DNSSRV=mod
17957                 BUILD_DNSSRV_DYNAMIC=shared
17958                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17959                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
17960         else
17961                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
17962         fi
17963 fi
17964
17965 if test "$ol_enable_ldap" != no ; then
17966         cat >> confdefs.h <<\EOF
17967 #define SLAPD_LDAP 1
17968 EOF
17969
17970         BUILD_SLAPD=yes
17971         BUILD_LDAP=yes
17972         if test "$ol_with_ldap_module" != static ; then
17973                 cat >> confdefs.h <<\EOF
17974 #define SLAPD_LDAP_DYNAMIC 1
17975 EOF
17976
17977                 BUILD_LDAP=mod
17978                 BUILD_LDAP_DYNAMIC=shared
17979                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17980                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
17981         else
17982                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
17983         fi
17984 fi
17985
17986 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17987         cat >> confdefs.h <<\EOF
17988 #define SLAPD_LDBM 1
17989 EOF
17990
17991         BUILD_SLAPD=yes
17992         BUILD_LDBM=yes
17993         LDBM_LIB="-lldbm"
17994         if test "$ol_with_ldbm_module" != static ; then
17995                 cat >> confdefs.h <<\EOF
17996 #define SLAPD_LDBM_DYNAMIC 1
17997 EOF
17998
17999                 BUILD_LDBM=mod
18000                 BUILD_LDBM_DYNAMIC=shared
18001                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
18002                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
18003         else
18004                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
18005         fi
18006 fi
18007
18008 if test "$ol_enable_meta" != no ; then
18009         if test "$ol_enable_ldap" = no ; then
18010                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
18011         fi
18012         if test "$ol_enable_rewrite" = no ; then
18013                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
18014         fi
18015         cat >> confdefs.h <<\EOF
18016 #define SLAPD_META 1
18017 EOF
18018
18019         BUILD_SLAPD=yes
18020         BUILD_META=yes
18021         if test "$ol_with_meta_module" != static ; then
18022                 cat >> confdefs.h <<\EOF
18023 #define SLAPD_META_DYNAMIC 1
18024 EOF
18025
18026                 BUILD_META=mod
18027                 BUILD_META_DYNAMIC=shared
18028                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
18029                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
18030         else
18031                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
18032         fi
18033 fi
18034
18035 if test "$ol_enable_monitor" != no ; then
18036         cat >> confdefs.h <<\EOF
18037 #define SLAPD_MONITOR 1
18038 EOF
18039
18040         BUILD_SLAPD=yes
18041         BUILD_MONITOR=yes
18042         if test "$ol_with_monitor_module" != static ; then
18043                 cat >> confdefs.h <<\EOF
18044 #define SLAPD_MONITOR_DYNAMIC 1
18045 EOF
18046
18047                 BUILD_MONITOR=mod
18048                 BUILD_MONITOR_DYNAMIC=shared
18049                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
18050                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
18051         else
18052                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
18053         fi
18054 fi
18055
18056 if test "$ol_enable_passwd" != no ; then
18057         cat >> confdefs.h <<\EOF
18058 #define SLAPD_PASSWD 1
18059 EOF
18060
18061         BUILD_SLAPD=yes
18062         BUILD_PASSWD=yes
18063         if test "$ol_with_passwd_module" != static ; then
18064                 cat >> confdefs.h <<\EOF
18065 #define SLAPD_PASSWD_DYNAMIC 1
18066 EOF
18067
18068                 BUILD_PASSWD=mod
18069                 BUILD_PASSWD_DYNAMIC=shared
18070                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
18071                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
18072         else
18073                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
18074         fi
18075 fi
18076
18077 if test "$ol_link_perl" != no ; then
18078         cat >> confdefs.h <<\EOF
18079 #define SLAPD_PERL 1
18080 EOF
18081
18082         BUILD_SLAPD=yes
18083         BUILD_PERL=yes
18084         if test "$ol_with_perl_module" != static ; then
18085                 cat >> confdefs.h <<\EOF
18086 #define SLAPD_PERL_DYNAMIC 1
18087 EOF
18088
18089                 BUILD_PERL=mod
18090                 BUILD_PERL_DYNAMIC=shared
18091                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
18092                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
18093         else
18094                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
18095         fi
18096 fi
18097
18098 if test "$ol_enable_shell" != no ; then
18099         cat >> confdefs.h <<\EOF
18100 #define SLAPD_SHELL 1
18101 EOF
18102
18103         BUILD_SLAPD=yes
18104         BUILD_SHELL=yes
18105         if test "$ol_with_shell_module" != static ; then
18106                 cat >> confdefs.h <<\EOF
18107 #define SLAPD_SHELL_DYNAMIC 1
18108 EOF
18109
18110                 BUILD_SHELL=mod
18111                 BUILD_SHELL_DYNAMIC=shared
18112                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
18113                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
18114         else
18115                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
18116         fi
18117 fi
18118
18119 if test "$ol_enable_tcl" != no ; then
18120         cat >> confdefs.h <<\EOF
18121 #define SLAPD_TCL 1
18122 EOF
18123
18124         BUILD_SLAPD=yes
18125         BUILD_TCL=yes
18126         if test "$ol_with_tcl_module" != static; then
18127                 cat >> confdefs.h <<\EOF
18128 #define SLAPD_TCL_DYNAMIC 1
18129 EOF
18130
18131                 BUILD_TCL=mod
18132                 BUILD_TCL_DYNAMIC=shared
18133                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
18134                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
18135         else
18136                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
18137         fi
18138 fi
18139
18140 if test "$ol_link_sql" != no ; then
18141         cat >> confdefs.h <<\EOF
18142 #define SLAPD_SQL 1
18143 EOF
18144
18145         BUILD_SLAPD=yes
18146         BUILD_SQL=yes
18147         if test "$ol_with_sql_module" != static; then
18148                 cat >> confdefs.h <<\EOF
18149 #define SLAPD_SQL_DYNAMIC 1
18150 EOF
18151
18152                 BUILD_SQL=mod
18153                 BUILD_SQL_DYNAMIC=shared
18154                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
18155                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
18156         else
18157                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
18158         fi
18159 fi
18160
18161 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
18162         $BUILD_SLAPD = yes ; then
18163         BUILD_SLURPD=yes
18164 fi
18165
18166 if test "$ol_enable_rewrite" != no ; then
18167         cat >> confdefs.h <<\EOF
18168 #define ENABLE_REWRITE 1
18169 EOF
18170
18171         BUILD_REWRITE=yes
18172         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
18173 fi
18174
18175
18176
18177 if test "$ac_cv_mingw32" = yes ; then
18178         PLAT=NT
18179         SLAPD_MODULES_LDFLAGS=
18180         SLAPD_MODULES_LIST=
18181 else
18182         PLAT=UNIX
18183 fi
18184
18185
18186
18187
18188
18189
18190   
18191   
18192   
18193   
18194   
18195   
18196   
18197   
18198   
18199   
18200   
18201   
18202   
18203   
18204   
18205   
18206   
18207   
18208   
18209   
18210   
18211   
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253 trap '' 1 2 15
18254
18255 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
18256
18257 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18258 # Let make expand exec_prefix.
18259 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18260
18261 # Any assignment to VPATH causes Sun make to only execute
18262 # the first set of double-colon rules, so remove it if not needed.
18263 # If there is a colon in the path, we need to keep it.
18264 if test "x$srcdir" = x.; then
18265   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
18266 fi
18267
18268 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
18269
18270 DEFS=-DHAVE_CONFIG_H
18271
18272 # Without the "./", some shells look in PATH for config.status.
18273 : ${CONFIG_STATUS=./config.status}
18274
18275 echo creating $CONFIG_STATUS
18276 rm -f $CONFIG_STATUS
18277 cat > $CONFIG_STATUS <<EOF
18278 #! /bin/sh
18279 # Generated automatically by configure.
18280 # Run this file to recreate the current configuration.
18281 # This directory was configured as follows,
18282 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18283 #
18284 # $0 $ac_configure_args
18285 #
18286 # Compiler output produced by configure, useful for debugging
18287 # configure, is in ./config.log if it exists.
18288
18289 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
18290 for ac_option
18291 do
18292   case "\$ac_option" in
18293   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18294     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
18295     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
18296   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
18297     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
18298     exit 0 ;;
18299   -help | --help | --hel | --he | --h)
18300     echo "\$ac_cs_usage"; exit 0 ;;
18301   *) echo "\$ac_cs_usage"; exit 1 ;;
18302   esac
18303 done
18304
18305 ac_given_srcdir=$srcdir
18306 ac_given_INSTALL="$INSTALL"
18307
18308 trap 'rm -fr `echo "\
18309 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18310 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18311 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18312 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18313 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18314 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18315 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18316 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18317 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18318 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18319 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18320 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18321 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18322 include/Makefile:build/top.mk:include/Makefile.in \
18323 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18324 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18325 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18326 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18327 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18328 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18329 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18330 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18331 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18332 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18333 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18334 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18335 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18336 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18337 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18338 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18339 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18340 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18341 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18342 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18343 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18344 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18345 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18346 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18347 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18348 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18349 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18350 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18351  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18352 EOF
18353 cat >> $CONFIG_STATUS <<EOF
18354
18355 # Protect against being on the right side of a sed subst in config.status.
18356 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18357  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18358 $ac_vpsub
18359 $extrasub
18360 s%@SHELL@%$SHELL%g
18361 s%@CFLAGS@%$CFLAGS%g
18362 s%@CPPFLAGS@%$CPPFLAGS%g
18363 s%@CXXFLAGS@%$CXXFLAGS%g
18364 s%@FFLAGS@%$FFLAGS%g
18365 s%@DEFS@%$DEFS%g
18366 s%@LDFLAGS@%$LDFLAGS%g
18367 s%@LIBS@%$LIBS%g
18368 s%@exec_prefix@%$exec_prefix%g
18369 s%@prefix@%$prefix%g
18370 s%@program_transform_name@%$program_transform_name%g
18371 s%@bindir@%$bindir%g
18372 s%@sbindir@%$sbindir%g
18373 s%@libexecdir@%$libexecdir%g
18374 s%@datadir@%$datadir%g
18375 s%@sysconfdir@%$sysconfdir%g
18376 s%@sharedstatedir@%$sharedstatedir%g
18377 s%@localstatedir@%$localstatedir%g
18378 s%@libdir@%$libdir%g
18379 s%@includedir@%$includedir%g
18380 s%@oldincludedir@%$oldincludedir%g
18381 s%@infodir@%$infodir%g
18382 s%@mandir@%$mandir%g
18383 s%@host@%$host%g
18384 s%@host_alias@%$host_alias%g
18385 s%@host_cpu@%$host_cpu%g
18386 s%@host_vendor@%$host_vendor%g
18387 s%@host_os@%$host_os%g
18388 s%@target@%$target%g
18389 s%@target_alias@%$target_alias%g
18390 s%@target_cpu@%$target_cpu%g
18391 s%@target_vendor@%$target_vendor%g
18392 s%@target_os@%$target_os%g
18393 s%@build@%$build%g
18394 s%@build_alias@%$build_alias%g
18395 s%@build_cpu@%$build_cpu%g
18396 s%@build_vendor@%$build_vendor%g
18397 s%@build_os@%$build_os%g
18398 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18399 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18400 s%@INSTALL_DATA@%$INSTALL_DATA%g
18401 s%@PACKAGE@%$PACKAGE%g
18402 s%@VERSION@%$VERSION%g
18403 s%@ACLOCAL@%$ACLOCAL%g
18404 s%@AUTOCONF@%$AUTOCONF%g
18405 s%@AUTOMAKE@%$AUTOMAKE%g
18406 s%@AUTOHEADER@%$AUTOHEADER%g
18407 s%@MAKEINFO@%$MAKEINFO%g
18408 s%@install_sh@%$install_sh%g
18409 s%@AMTAR@%$AMTAR%g
18410 s%@AWK@%$AWK%g
18411 s%@AMTARFLAGS@%$AMTARFLAGS%g
18412 s%@SET_MAKE@%$SET_MAKE%g
18413 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18414 s%@top_builddir@%$top_builddir%g
18415 s%@ldap_subdir@%$ldap_subdir%g
18416 s%@CC@%$CC%g
18417 s%@AR@%$AR%g
18418 s%@RANLIB@%$RANLIB%g
18419 s%@LN_S@%$LN_S%g
18420 s%@DLLTOOL@%$DLLTOOL%g
18421 s%@AS@%$AS%g
18422 s%@OBJDUMP@%$OBJDUMP%g
18423 s%@LIBTOOL@%$LIBTOOL%g
18424 s%@LN_H@%$LN_H%g
18425 s%@SENDMAIL@%$SENDMAIL%g
18426 s%@EDITOR@%$EDITOR%g
18427 s%@FINGER@%$FINGER%g
18428 s%@PERLBIN@%$PERLBIN%g
18429 s%@CPP@%$CPP%g
18430 s%@EXEEXT@%$EXEEXT%g
18431 s%@OBJEXT@%$OBJEXT%g
18432 s%@OL_MKDEP@%$OL_MKDEP%g
18433 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18434 s%@LIBOBJS@%$LIBOBJS%g
18435 s%@LIBSRCS@%$LIBSRCS%g
18436 s%@PLAT@%$PLAT%g
18437 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
18438 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18439 s%@BUILD_BDB@%$BUILD_BDB%g
18440 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18441 s%@BUILD_LDAP@%$BUILD_LDAP%g
18442 s%@BUILD_LDBM@%$BUILD_LDBM%g
18443 s%@BUILD_META@%$BUILD_META%g
18444 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18445 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18446 s%@BUILD_PERL@%$BUILD_PERL%g
18447 s%@BUILD_SHELL@%$BUILD_SHELL%g
18448 s%@BUILD_SQL@%$BUILD_SQL%g
18449 s%@BUILD_TCL@%$BUILD_TCL%g
18450 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18451 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18452 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18453 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18454 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18455 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18456 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18457 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18458 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18459 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18460 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18461 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18462 s%@LDBM_LIB@%$LDBM_LIB%g
18463 s%@LDAP_LIBS@%$LDAP_LIBS%g
18464 s%@LDIF_LIBS@%$LDIF_LIBS%g
18465 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18466 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18467 s%@LDBM_LIBS@%$LDBM_LIBS%g
18468 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18469 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18470 s%@WRAP_LIBS@%$WRAP_LIBS%g
18471 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18472 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18473 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18474 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18475 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
18476 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
18477 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18478 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18479 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18480 s%@KRB4_LIBS@%$KRB4_LIBS%g
18481 s%@KRB5_LIBS@%$KRB5_LIBS%g
18482 s%@READLINE_LIBS@%$READLINE_LIBS%g
18483 s%@SASL_LIBS@%$SASL_LIBS%g
18484 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18485 s%@TLS_LIBS@%$TLS_LIBS%g
18486 s%@MODULES_LIBS@%$MODULES_LIBS%g
18487 s%@AUTH_LIBS@%$AUTH_LIBS%g
18488 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18489 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18490 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18491 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18492
18493 CEOF
18494 EOF
18495
18496 cat >> $CONFIG_STATUS <<\EOF
18497
18498 # Split the substitutions into bite-sized pieces for seds with
18499 # small command number limits, like on Digital OSF/1 and HP-UX.
18500 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18501 ac_file=1 # Number of current file.
18502 ac_beg=1 # First line for current file.
18503 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18504 ac_more_lines=:
18505 ac_sed_cmds=""
18506 while $ac_more_lines; do
18507   if test $ac_beg -gt 1; then
18508     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18509   else
18510     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18511   fi
18512   if test ! -s conftest.s$ac_file; then
18513     ac_more_lines=false
18514     rm -f conftest.s$ac_file
18515   else
18516     if test -z "$ac_sed_cmds"; then
18517       ac_sed_cmds="sed -f conftest.s$ac_file"
18518     else
18519       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18520     fi
18521     ac_file=`expr $ac_file + 1`
18522     ac_beg=$ac_end
18523     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18524   fi
18525 done
18526 if test -z "$ac_sed_cmds"; then
18527   ac_sed_cmds=cat
18528 fi
18529 EOF
18530
18531 cat >> $CONFIG_STATUS <<EOF
18532
18533 CONFIG_FILES=\${CONFIG_FILES-"\
18534 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18535 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18536 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18537 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18538 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18539 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18540 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18541 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18542 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18543 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18544 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18545 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18546 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18547 include/Makefile:build/top.mk:include/Makefile.in \
18548 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18549 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18550 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18551 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18552 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18553 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18554 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18555 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18556 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18557 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18558 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18559 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18560 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18561 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18562 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18563 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18564 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18565 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18566 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18567 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18568 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18569 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18570 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18571 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18572 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18573 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18574 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18575 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18576 "}
18577 EOF
18578 cat >> $CONFIG_STATUS <<\EOF
18579 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18580   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18581   case "$ac_file" in
18582   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18583        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18584   *) ac_file_in="${ac_file}.in" ;;
18585   esac
18586
18587   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18588
18589   # Remove last slash and all that follows it.  Not all systems have dirname.
18590   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18591   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18592     # The file is in a subdirectory.
18593     test ! -d "$ac_dir" && mkdir "$ac_dir"
18594     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18595     # A "../" for each directory in $ac_dir_suffix.
18596     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18597   else
18598     ac_dir_suffix= ac_dots=
18599   fi
18600
18601   case "$ac_given_srcdir" in
18602   .)  srcdir=.
18603       if test -z "$ac_dots"; then top_srcdir=.
18604       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18605   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18606   *) # Relative path.
18607     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18608     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18609   esac
18610
18611   case "$ac_given_INSTALL" in
18612   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18613   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18614   esac
18615
18616   echo creating "$ac_file"
18617   rm -f "$ac_file"
18618   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18619   case "$ac_file" in
18620   *[Mm]akefile*) ac_comsub="1i\\
18621 # $configure_input" ;;
18622   *) ac_comsub= ;;
18623   esac
18624
18625   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18626   sed -e "$ac_comsub
18627 s%@configure_input@%$configure_input%g
18628 s%@srcdir@%$srcdir%g
18629 s%@top_srcdir@%$top_srcdir%g
18630 s%@INSTALL@%$INSTALL%g
18631 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18632 fi; done
18633 rm -f conftest.s*
18634
18635 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18636 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18637 #
18638 # ac_d sets the value in "#define NAME VALUE" lines.
18639 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18640 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18641 ac_dC='\3'
18642 ac_dD='%g'
18643 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18644 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18645 ac_uB='\([      ]\)%\1#\2define\3'
18646 ac_uC=' '
18647 ac_uD='\4%g'
18648 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18649 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18650 ac_eB='$%\1#\2define\3'
18651 ac_eC=' '
18652 ac_eD='%g'
18653
18654 if test "${CONFIG_HEADERS+set}" != set; then
18655 EOF
18656 cat >> $CONFIG_STATUS <<EOF
18657   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18658 EOF
18659 cat >> $CONFIG_STATUS <<\EOF
18660 fi
18661 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18662   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18663   case "$ac_file" in
18664   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18665        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18666   *) ac_file_in="${ac_file}.in" ;;
18667   esac
18668
18669   echo creating $ac_file
18670
18671   rm -f conftest.frag conftest.in conftest.out
18672   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18673   cat $ac_file_inputs > conftest.in
18674
18675 EOF
18676
18677 # Transform confdefs.h into a sed script conftest.vals that substitutes
18678 # the proper values into config.h.in to produce config.h.  And first:
18679 # Protect against being on the right side of a sed subst in config.status.
18680 # Protect against being in an unquoted here document in config.status.
18681 rm -f conftest.vals
18682 cat > conftest.hdr <<\EOF
18683 s/[\\&%]/\\&/g
18684 s%[\\$`]%\\&%g
18685 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18686 s%ac_d%ac_u%gp
18687 s%ac_u%ac_e%gp
18688 EOF
18689 sed -n -f conftest.hdr confdefs.h > conftest.vals
18690 rm -f conftest.hdr
18691
18692 # This sed command replaces #undef with comments.  This is necessary, for
18693 # example, in the case of _POSIX_SOURCE, which is predefined and required
18694 # on some systems where configure will not decide to define it.
18695 cat >> conftest.vals <<\EOF
18696 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18697 EOF
18698
18699 # Break up conftest.vals because some shells have a limit on
18700 # the size of here documents, and old seds have small limits too.
18701
18702 rm -f conftest.tail
18703 while :
18704 do
18705   ac_lines=`grep -c . conftest.vals`
18706   # grep -c gives empty output for an empty file on some AIX systems.
18707   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18708   # Write a limited-size here document to conftest.frag.
18709   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18710   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18711   echo 'CEOF
18712   sed -f conftest.frag conftest.in > conftest.out
18713   rm -f conftest.in
18714   mv conftest.out conftest.in
18715 ' >> $CONFIG_STATUS
18716   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18717   rm -f conftest.vals
18718   mv conftest.tail conftest.vals
18719 done
18720 rm -f conftest.vals
18721
18722 cat >> $CONFIG_STATUS <<\EOF
18723   rm -f conftest.frag conftest.h
18724   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18725   cat conftest.in >> conftest.h
18726   rm -f conftest.in
18727   if cmp -s $ac_file conftest.h 2>/dev/null; then
18728     echo "$ac_file is unchanged"
18729     rm -f conftest.h
18730   else
18731     # Remove last slash and all that follows it.  Not all systems have dirname.
18732       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18733       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18734       # The file is in a subdirectory.
18735       test ! -d "$ac_dir" && mkdir "$ac_dir"
18736     fi
18737     rm -f $ac_file
18738     mv conftest.h $ac_file
18739   fi
18740 fi; done
18741
18742 EOF
18743 cat >> $CONFIG_STATUS <<EOF
18744
18745 EOF
18746 cat >> $CONFIG_STATUS <<\EOF
18747
18748 date > stamp-h
18749 echo Please \"make depend\" to build dependencies
18750
18751 exit 0
18752 EOF
18753 chmod +x $CONFIG_STATUS
18754 rm -fr confdefs* $ac_clean_files
18755 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18756