]> git.sur5r.net Git - openldap/blob - configure
Update kerberos flags
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.362 2001/07/07 03:28:31 kurt Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13 
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 V2 Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable V2 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 support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65 SLAPD (Standalone LDAP Daemon) Options:"
66 ac_help="$ac_help
67   --enable-slapd          enable building slapd [yes]"
68 ac_help="$ac_help
69     --enable-aci          enable per-object ACIs (experimental) [no]"
70 ac_help="$ac_help
71     --enable-cleartext    enable cleartext passwords [yes]"
72 ac_help="$ac_help
73     --enable-crypt        enable crypt(3) passwords [no]"
74 ac_help="$ac_help
75     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
76 ac_help="$ac_help
77     --enable-kpasswd      enable Kerberos password verification [no]"
78 ac_help="$ac_help
79     --enable-lmpasswd     enable LAN Manager passwords [no]"
80 ac_help="$ac_help
81     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
82 ac_help="$ac_help
83     --enable-modules      enable dynamic module support [no]"
84 ac_help="$ac_help
85     --enable-phonetic     enable phonetic/soundex [no]"
86 ac_help="$ac_help
87     --enable-rlookups     enable reverse lookups [no]"
88 ac_help="$ac_help
89     --enable-slp          enable SLPv2 support [no]"
90 ac_help="$ac_help
91     --enable-wrappers     enable tcp wrapper support [no]"
92 ac_help="$ac_help
93     --enable-bdb          enable Berkeley DB backend [no]"
94 ac_help="$ac_help
95     --with-bdb-module     module type [static]"
96 ac_help="$ac_help
97     --enable-dnssrv       enable dnssrv backend [no]"
98 ac_help="$ac_help
99     --with-dnssrv-module  module type [static]"
100 ac_help="$ac_help
101     --enable-ldap         enable ldap backend [no]"
102 ac_help="$ac_help
103     --with-ldap-module    module type [static]"
104 ac_help="$ac_help
105     --enable-ldbm         enable ldbm backend [yes]"
106 ac_help="$ac_help
107     --with-ldbm-api       with LDBM API [auto]"
108 ac_help="$ac_help
109     --with-ldbm-module    module type [static]"
110 ac_help="$ac_help
111     --with-ldbm-type      use LDBM type [auto]"
112 ac_help="$ac_help
113     --enable-meta         enable metadirectory backend [no]"
114 ac_help="$ac_help
115     --with-meta-module    module type [static]"
116 ac_help="$ac_help
117     --enable-monitor      enable monitor backend [no]"
118 ac_help="$ac_help
119     --with-monitor-module         module type [static]"
120 ac_help="$ac_help
121     --enable-passwd       enable passwd backend [no]"
122 ac_help="$ac_help
123     --with-passwd-module  module type [static]"
124 ac_help="$ac_help
125     --enable-perl         enable perl backend [no]"
126 ac_help="$ac_help
127     --with-perl-module    module type [static]"
128 ac_help="$ac_help
129     --enable-shell        enable shell backend [no]"
130 ac_help="$ac_help
131     --with-shell-module   module type [static]"
132 ac_help="$ac_help
133     --enable-sql          enable sql backend [no]"
134 ac_help="$ac_help
135     --with-sql-module     module type [static]"
136 ac_help="$ac_help
137     --enable-tcl          enable tcl backend [no]"
138 ac_help="$ac_help
139     --with-tcl-module     module type [static]"
140 ac_help="$ac_help
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145 Library Generation & Linking Options"
146 ac_help="$ac_help
147   --enable-static[=PKGS]  build static libraries [default=yes]"
148 ac_help="$ac_help
149   --enable-shared[=PKGS]  build shared libraries [default=yes]"
150 ac_help="$ac_help
151   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
152 ac_help="$ac_help
153   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
154 ac_help="$ac_help
155   --disable-libtool-lock  avoid locking (might break parallel builds)"
156
157 # Initialize some variables set by options.
158 # The variables have the same names as the options, with
159 # dashes changed to underlines.
160 build=NONE
161 cache_file=./config.cache
162 exec_prefix=NONE
163 host=NONE
164 no_create=
165 nonopt=NONE
166 no_recursion=
167 prefix=NONE
168 program_prefix=NONE
169 program_suffix=NONE
170 program_transform_name=s,x,x,
171 silent=
172 site=
173 srcdir=
174 target=NONE
175 verbose=
176 x_includes=NONE
177 x_libraries=NONE
178 bindir='${exec_prefix}/bin'
179 sbindir='${exec_prefix}/sbin'
180 libexecdir='${exec_prefix}/libexec'
181 datadir='${prefix}/share'
182 sysconfdir='${prefix}/etc'
183 sharedstatedir='${prefix}/com'
184 localstatedir='${prefix}/var'
185 libdir='${exec_prefix}/lib'
186 includedir='${prefix}/include'
187 oldincludedir='/usr/include'
188 infodir='${prefix}/info'
189 mandir='${prefix}/man'
190
191 # Initialize some other variables.
192 subdirs=
193 MFLAGS= MAKEFLAGS=
194 SHELL=${CONFIG_SHELL-/bin/sh}
195 # Maximum number of lines to put in a shell here document.
196 ac_max_here_lines=12
197
198 ac_prev=
199 for ac_option
200 do
201
202   # If the previous option needs an argument, assign it.
203   if test -n "$ac_prev"; then
204     eval "$ac_prev=\$ac_option"
205     ac_prev=
206     continue
207   fi
208
209   case "$ac_option" in
210   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
211   *) ac_optarg= ;;
212   esac
213
214   # Accept the important Cygnus configure options, so we can diagnose typos.
215
216   case "$ac_option" in
217
218   -bindir | --bindir | --bindi | --bind | --bin | --bi)
219     ac_prev=bindir ;;
220   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
221     bindir="$ac_optarg" ;;
222
223   -build | --build | --buil | --bui | --bu)
224     ac_prev=build ;;
225   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
226     build="$ac_optarg" ;;
227
228   -cache-file | --cache-file | --cache-fil | --cache-fi \
229   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
230     ac_prev=cache_file ;;
231   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
232   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
233     cache_file="$ac_optarg" ;;
234
235   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
236     ac_prev=datadir ;;
237   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
238   | --da=*)
239     datadir="$ac_optarg" ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
243     # Reject names that are not valid shell variable names.
244     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
245       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
246     fi
247     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
248     eval "enable_${ac_feature}=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
252     # Reject names that are not valid shell variable names.
253     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
254       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
255     fi
256     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
257     case "$ac_option" in
258       *=*) ;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_${ac_feature}='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix="$ac_optarg" ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he)
277     # Omit some internal or obsolete options to make the list less imposing.
278     # This message is too long to be a string in the A/UX 3.1 sh.
279     cat << EOF
280 Usage: configure [options] [host]
281 Options: [defaults in brackets after descriptions]
282 Configuration:
283   --cache-file=FILE       cache test results in FILE
284   --help                  print this message
285   --no-create             do not create output files
286   --quiet, --silent       do not print \`checking...' messages
287   --version               print the version of autoconf that created configure
288 Directory and file names:
289   --prefix=PREFIX         install architecture-independent files in PREFIX
290                           [$ac_default_prefix]
291   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
292                           [same as prefix]
293   --bindir=DIR            user executables in DIR [EPREFIX/bin]
294   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
295   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
296   --datadir=DIR           read-only architecture-independent data in DIR
297                           [PREFIX/share]
298   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
299   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
300                           [PREFIX/com]
301   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
302   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
303   --includedir=DIR        C header files in DIR [PREFIX/include]
304   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
305   --infodir=DIR           info documentation in DIR [PREFIX/info]
306   --mandir=DIR            man documentation in DIR [PREFIX/man]
307   --srcdir=DIR            find the sources in DIR [configure dir or ..]
308   --program-prefix=PREFIX prepend PREFIX to installed program names
309   --program-suffix=SUFFIX append SUFFIX to installed program names
310   --program-transform-name=PROGRAM
311                           run sed PROGRAM on installed program names
312 EOF
313     cat << EOF
314 Host type:
315   --build=BUILD           configure for building on BUILD [BUILD=HOST]
316   --host=HOST             configure for HOST [guessed]
317   --target=TARGET         configure for TARGET [TARGET=HOST]
318 Features and packages:
319   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
320   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
321   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
322   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
323   --x-includes=DIR        X include files are in DIR
324   --x-libraries=DIR       X library files are in DIR
325 EOF
326     if test -n "$ac_help"; then
327       echo "--enable and --with options recognized:$ac_help"
328     fi
329     exit 0 ;;
330
331   -host | --host | --hos | --ho)
332     ac_prev=host ;;
333   -host=* | --host=* | --hos=* | --ho=*)
334     host="$ac_optarg" ;;
335
336   -includedir | --includedir | --includedi | --included | --include \
337   | --includ | --inclu | --incl | --inc)
338     ac_prev=includedir ;;
339   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
340   | --includ=* | --inclu=* | --incl=* | --inc=*)
341     includedir="$ac_optarg" ;;
342
343   -infodir | --infodir | --infodi | --infod | --info | --inf)
344     ac_prev=infodir ;;
345   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
346     infodir="$ac_optarg" ;;
347
348   -libdir | --libdir | --libdi | --libd)
349     ac_prev=libdir ;;
350   -libdir=* | --libdir=* | --libdi=* | --libd=*)
351     libdir="$ac_optarg" ;;
352
353   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
354   | --libexe | --libex | --libe)
355     ac_prev=libexecdir ;;
356   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
357   | --libexe=* | --libex=* | --libe=*)
358     libexecdir="$ac_optarg" ;;
359
360   -localstatedir | --localstatedir | --localstatedi | --localstated \
361   | --localstate | --localstat | --localsta | --localst \
362   | --locals | --local | --loca | --loc | --lo)
363     ac_prev=localstatedir ;;
364   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
365   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
366   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
367     localstatedir="$ac_optarg" ;;
368
369   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
370     ac_prev=mandir ;;
371   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
372     mandir="$ac_optarg" ;;
373
374   -nfp | --nfp | --nf)
375     # Obsolete; use --without-fp.
376     with_fp=no ;;
377
378   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
379   | --no-cr | --no-c)
380     no_create=yes ;;
381
382   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
383   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
384     no_recursion=yes ;;
385
386   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
387   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
388   | --oldin | --oldi | --old | --ol | --o)
389     ac_prev=oldincludedir ;;
390   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
391   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
392   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
393     oldincludedir="$ac_optarg" ;;
394
395   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
396     ac_prev=prefix ;;
397   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
398     prefix="$ac_optarg" ;;
399
400   -program-prefix | --program-prefix | --program-prefi | --program-pref \
401   | --program-pre | --program-pr | --program-p)
402     ac_prev=program_prefix ;;
403   -program-prefix=* | --program-prefix=* | --program-prefi=* \
404   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
405     program_prefix="$ac_optarg" ;;
406
407   -program-suffix | --program-suffix | --program-suffi | --program-suff \
408   | --program-suf | --program-su | --program-s)
409     ac_prev=program_suffix ;;
410   -program-suffix=* | --program-suffix=* | --program-suffi=* \
411   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
412     program_suffix="$ac_optarg" ;;
413
414   -program-transform-name | --program-transform-name \
415   | --program-transform-nam | --program-transform-na \
416   | --program-transform-n | --program-transform- \
417   | --program-transform | --program-transfor \
418   | --program-transfo | --program-transf \
419   | --program-trans | --program-tran \
420   | --progr-tra | --program-tr | --program-t)
421     ac_prev=program_transform_name ;;
422   -program-transform-name=* | --program-transform-name=* \
423   | --program-transform-nam=* | --program-transform-na=* \
424   | --program-transform-n=* | --program-transform-=* \
425   | --program-transform=* | --program-transfor=* \
426   | --program-transfo=* | --program-transf=* \
427   | --program-trans=* | --program-tran=* \
428   | --progr-tra=* | --program-tr=* | --program-t=*)
429     program_transform_name="$ac_optarg" ;;
430
431   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
432   | -silent | --silent | --silen | --sile | --sil)
433     silent=yes ;;
434
435   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
436     ac_prev=sbindir ;;
437   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
438   | --sbi=* | --sb=*)
439     sbindir="$ac_optarg" ;;
440
441   -sharedstatedir | --sharedstatedir | --sharedstatedi \
442   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
443   | --sharedst | --shareds | --shared | --share | --shar \
444   | --sha | --sh)
445     ac_prev=sharedstatedir ;;
446   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
447   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
448   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
449   | --sha=* | --sh=*)
450     sharedstatedir="$ac_optarg" ;;
451
452   -site | --site | --sit)
453     ac_prev=site ;;
454   -site=* | --site=* | --sit=*)
455     site="$ac_optarg" ;;
456
457   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
458     ac_prev=srcdir ;;
459   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
460     srcdir="$ac_optarg" ;;
461
462   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
463   | --syscon | --sysco | --sysc | --sys | --sy)
464     ac_prev=sysconfdir ;;
465   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
466   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
467     sysconfdir="$ac_optarg" ;;
468
469   -target | --target | --targe | --targ | --tar | --ta | --t)
470     ac_prev=target ;;
471   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
472     target="$ac_optarg" ;;
473
474   -v | -verbose | --verbose | --verbos | --verbo | --verb)
475     verbose=yes ;;
476
477   -version | --version | --versio | --versi | --vers)
478     echo "configure generated by autoconf version 2.13"
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   fi
679 done
680 if test -z "$ac_aux_dir"; then
681   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
682 fi
683 ac_config_guess=$ac_aux_dir/config.guess
684 ac_config_sub=$ac_aux_dir/config.sub
685 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
686
687 eval `$ac_aux_dir/version.sh`
688 if test -z "$OL_STRING"; then
689         { echo "configure: error: could not determine version" 1>&2; exit 1; }
690 fi
691
692 echo "Configuring $OL_STRING ..."
693
694
695 # Do some error checking and defaulting for the host and target type.
696 # The inputs are:
697 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
698 #
699 # The rules are:
700 # 1. You are not allowed to specify --host, --target, and nonopt at the
701 #    same time.
702 # 2. Host defaults to nonopt.
703 # 3. If nonopt is not specified, then host defaults to the current host,
704 #    as determined by config.guess.
705 # 4. Target and build default to nonopt.
706 # 5. If nonopt is not specified, then target and build default to host.
707
708 # The aliases save the names the user supplied, while $host etc.
709 # will get canonicalized.
710 case $host---$target---$nonopt in
711 NONE---*---* | *---NONE---* | *---*---NONE) ;;
712 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
713 esac
714
715
716 # Make sure we can run config.sub.
717 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
718 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
719 fi
720
721 echo $ac_n "checking host system type""... $ac_c" 1>&6
722 echo "configure:723: checking host system type" >&5
723
724 host_alias=$host
725 case "$host_alias" in
726 NONE)
727   case $nonopt in
728   NONE)
729     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
730     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
731     fi ;;
732   *) host_alias=$nonopt ;;
733   esac ;;
734 esac
735
736 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
737 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
738 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
739 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
740 echo "$ac_t""$host" 1>&6
741
742 echo $ac_n "checking target system type""... $ac_c" 1>&6
743 echo "configure:744: checking target system type" >&5
744
745 target_alias=$target
746 case "$target_alias" in
747 NONE)
748   case $nonopt in
749   NONE) target_alias=$host_alias ;;
750   *) target_alias=$nonopt ;;
751   esac ;;
752 esac
753
754 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
755 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
756 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
757 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
758 echo "$ac_t""$target" 1>&6
759
760 echo $ac_n "checking build system type""... $ac_c" 1>&6
761 echo "configure:762: checking build system type" >&5
762
763 build_alias=$build
764 case "$build_alias" in
765 NONE)
766   case $nonopt in
767   NONE) build_alias=$host_alias ;;
768   *) build_alias=$nonopt ;;
769   esac ;;
770 esac
771
772 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
773 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
774 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
775 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
776 echo "$ac_t""$build" 1>&6
777
778 test "$host_alias" != "$target_alias" &&
779   test "$program_prefix$program_suffix$program_transform_name" = \
780     NONENONEs,x,x, &&
781   program_prefix=${target_alias}-
782
783
784 # Find a good install program.  We prefer a C program (faster),
785 # so one script is as good as another.  But avoid the broken or
786 # incompatible versions:
787 # SysV /etc/install, /usr/sbin/install
788 # SunOS /usr/etc/install
789 # IRIX /sbin/install
790 # AIX /bin/install
791 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
792 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
793 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
794 # ./install, which can be erroneously created by make from ./install.sh.
795 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
796 echo "configure:797: checking for a BSD compatible install" >&5
797 if test -z "$INSTALL"; then
798 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
799   echo $ac_n "(cached) $ac_c" 1>&6
800 else
801     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
802   for ac_dir in $PATH; do
803     # Account for people who put trailing slashes in PATH elements.
804     case "$ac_dir/" in
805     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
806     *)
807       # OSF1 and SCO ODT 3.0 have their own names for install.
808       # Don't use installbsd from OSF since it installs stuff as root
809       # by default.
810       for ac_prog in ginstall scoinst install; do
811         if test -f $ac_dir/$ac_prog; then
812           if test $ac_prog = install &&
813             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
814             # AIX install.  It has an incompatible calling convention.
815             :
816           else
817             ac_cv_path_install="$ac_dir/$ac_prog -c"
818             break 2
819           fi
820         fi
821       done
822       ;;
823     esac
824   done
825   IFS="$ac_save_IFS"
826
827 fi
828   if test "${ac_cv_path_install+set}" = set; then
829     INSTALL="$ac_cv_path_install"
830   else
831     # As a last resort, use the slow shell script.  We don't cache a
832     # path for INSTALL within a source directory, because that will
833     # break other packages using the cache if that directory is
834     # removed, or if the path is relative.
835     INSTALL="$ac_install_sh"
836   fi
837 fi
838 echo "$ac_t""$INSTALL" 1>&6
839
840 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
841 # It thinks the first close brace ends the variable substitution.
842 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
843
844 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
845
846 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
847
848 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
849 echo "configure:850: checking whether build environment is sane" >&5
850 # Just in case
851 sleep 1
852 echo timestamp > conftestfile
853 # Do `set' in a subshell so we don't clobber the current shell's
854 # arguments.  Must try -L first in case configure is actually a
855 # symlink; some systems play weird games with the mod time of symlinks
856 # (eg FreeBSD returns the mod time of the symlink's containing
857 # directory).
858 if (
859    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
860    if test "$*" = "X"; then
861       # -L didn't work.
862       set X `ls -t $srcdir/configure conftestfile`
863    fi
864    if test "$*" != "X $srcdir/configure conftestfile" \
865       && test "$*" != "X conftestfile $srcdir/configure"; then
866
867       # If neither matched, then we have a broken ls.  This can happen
868       # if, for instance, CONFIG_SHELL is bash and it inherits a
869       # broken ls alias from the environment.  This has actually
870       # happened.  Such a system could not be considered "sane".
871       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
872 alias in your environment" 1>&2; exit 1; }
873    fi
874
875    test "$2" = conftestfile
876    )
877 then
878    # Ok.
879    :
880 else
881    { echo "configure: error: newly created file is older than distributed files!
882 Check your system clock" 1>&2; exit 1; }
883 fi
884 rm -f conftest*
885 echo "$ac_t""yes" 1>&6
886 if test "$program_transform_name" = s,x,x,; then
887   program_transform_name=
888 else
889   # Double any \ or $.  echo might interpret backslashes.
890   cat <<\EOF_SED > conftestsed
891 s,\\,\\\\,g; s,\$,$$,g
892 EOF_SED
893   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
894   rm -f conftestsed
895 fi
896 test "$program_prefix" != NONE &&
897   program_transform_name="s,^,${program_prefix},; $program_transform_name"
898 # Use a double $ so make ignores it.
899 test "$program_suffix" != NONE &&
900   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
901
902 # sed with no file args requires a program.
903 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
904
905 for ac_prog in gawk mawk nawk awk
906 do
907 # Extract the first word of "$ac_prog", so it can be a program name with args.
908 set dummy $ac_prog; ac_word=$2
909 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
910 echo "configure:911: checking for $ac_word" >&5
911 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
912   echo $ac_n "(cached) $ac_c" 1>&6
913 else
914   if test -n "$AWK"; then
915   ac_cv_prog_AWK="$AWK" # Let the user override the test.
916 else
917   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
918   ac_dummy="$PATH"
919   for ac_dir in $ac_dummy; do
920     test -z "$ac_dir" && ac_dir=.
921     if test -f $ac_dir/$ac_word; then
922       ac_cv_prog_AWK="$ac_prog"
923       break
924     fi
925   done
926   IFS="$ac_save_ifs"
927 fi
928 fi
929 AWK="$ac_cv_prog_AWK"
930 if test -n "$AWK"; then
931   echo "$ac_t""$AWK" 1>&6
932 else
933   echo "$ac_t""no" 1>&6
934 fi
935
936 test -n "$AWK" && break
937 done
938
939 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
940 echo "configure:941: checking whether ${MAKE-make} sets \${MAKE}" >&5
941 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
942 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
943   echo $ac_n "(cached) $ac_c" 1>&6
944 else
945   cat > conftestmake <<\EOF
946 all:
947         @echo 'ac_maketemp="${MAKE}"'
948 EOF
949 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
950 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
951 if test -n "$ac_maketemp"; then
952   eval ac_cv_prog_make_${ac_make}_set=yes
953 else
954   eval ac_cv_prog_make_${ac_make}_set=no
955 fi
956 rm -f conftestmake
957 fi
958 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
959   echo "$ac_t""yes" 1>&6
960   SET_MAKE=
961 else
962   echo "$ac_t""no" 1>&6
963   SET_MAKE="MAKE=${MAKE-make}"
964 fi
965
966
967
968 PACKAGE=$OL_PACKAGE
969
970 VERSION=$OL_VERSION
971
972 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
973   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
974 fi
975
976
977
978 missing_dir=`cd $ac_aux_dir && pwd`
979 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
980 echo "configure:981: checking for working aclocal" >&5
981 # Run test in a subshell; some versions of sh will print an error if
982 # an executable is not found, even if stderr is redirected.
983 # Redirect stdin to placate older versions of autoconf.  Sigh.
984 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
985    ACLOCAL=aclocal
986    echo "$ac_t""found" 1>&6
987 else
988    ACLOCAL="$missing_dir/missing aclocal"
989    echo "$ac_t""missing" 1>&6
990 fi
991
992 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
993 echo "configure:994: checking for working autoconf" >&5
994 # Run test in a subshell; some versions of sh will print an error if
995 # an executable is not found, even if stderr is redirected.
996 # Redirect stdin to placate older versions of autoconf.  Sigh.
997 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
998    AUTOCONF=autoconf
999    echo "$ac_t""found" 1>&6
1000 else
1001    AUTOCONF="$missing_dir/missing autoconf"
1002    echo "$ac_t""missing" 1>&6
1003 fi
1004
1005 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1006 echo "configure:1007: checking for working automake" >&5
1007 # Run test in a subshell; some versions of sh will print an error if
1008 # an executable is not found, even if stderr is redirected.
1009 # Redirect stdin to placate older versions of autoconf.  Sigh.
1010 if (automake --version) < /dev/null > /dev/null 2>&1; then
1011    AUTOMAKE=automake
1012    echo "$ac_t""found" 1>&6
1013 else
1014    AUTOMAKE="$missing_dir/missing automake"
1015    echo "$ac_t""missing" 1>&6
1016 fi
1017
1018 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1019 echo "configure:1020: checking for working autoheader" >&5
1020 # Run test in a subshell; some versions of sh will print an error if
1021 # an executable is not found, even if stderr is redirected.
1022 # Redirect stdin to placate older versions of autoconf.  Sigh.
1023 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1024    AUTOHEADER=autoheader
1025    echo "$ac_t""found" 1>&6
1026 else
1027    AUTOHEADER="$missing_dir/missing autoheader"
1028    echo "$ac_t""missing" 1>&6
1029 fi
1030
1031 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1032 echo "configure:1033: checking for working makeinfo" >&5
1033 # Run test in a subshell; some versions of sh will print an error if
1034 # an executable is not found, even if stderr is redirected.
1035 # Redirect stdin to placate older versions of autoconf.  Sigh.
1036 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1037    MAKEINFO=makeinfo
1038    echo "$ac_t""found" 1>&6
1039 else
1040    MAKEINFO="$missing_dir/missing makeinfo"
1041    echo "$ac_t""missing" 1>&6
1042 fi
1043
1044 install_sh="$missing_dir/install-sh"
1045 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1046
1047 for ac_prog in gnutar gtar tar
1048 do
1049 # Extract the first word of "$ac_prog", so it can be a program name with args.
1050 set dummy $ac_prog; ac_word=$2
1051 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1052 echo "configure:1053: checking for $ac_word" >&5
1053 if eval "test \"`echo '$''{'ac_cv_prog_AMTAR'+set}'`\" = set"; then
1054   echo $ac_n "(cached) $ac_c" 1>&6
1055 else
1056   if test -n "$AMTAR"; then
1057   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1058 else
1059   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1060   ac_dummy="$PATH"
1061   for ac_dir in $ac_dummy; do
1062     test -z "$ac_dir" && ac_dir=.
1063     if test -f $ac_dir/$ac_word; then
1064       ac_cv_prog_AMTAR="$ac_prog"
1065       break
1066     fi
1067   done
1068   IFS="$ac_save_ifs"
1069 fi
1070 fi
1071 AMTAR="$ac_cv_prog_AMTAR"
1072 if test -n "$AMTAR"; then
1073   echo "$ac_t""$AMTAR" 1>&6
1074 else
1075   echo "$ac_t""no" 1>&6
1076 fi
1077
1078 test -n "$AMTAR" && break
1079 done
1080
1081
1082 AMTARFLAGS=
1083 if test -n "$AMTAR"; then
1084   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1085         AMTARFLAGS=o
1086   fi
1087 fi
1088
1089 cat >> confdefs.h <<EOF
1090 #define OPENLDAP_PACKAGE "$PACKAGE"
1091 EOF
1092
1093 cat >> confdefs.h <<EOF
1094 #define OPENLDAP_VERSION "$VERSION"
1095 EOF
1096
1097
1098 cat >> confdefs.h <<EOF
1099 #define LDAP_VENDOR_VERSION $OL_API_INC
1100 EOF
1101
1102 cat >> confdefs.h <<EOF
1103 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1104 EOF
1105
1106 cat >> confdefs.h <<EOF
1107 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1108 EOF
1109
1110 cat >> confdefs.h <<EOF
1111 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1112 EOF
1113
1114
1115 OPENLDAP_LIBVERSION=$OL_API_LIB
1116
1117
1118
1119 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1120 echo "configure:1121: checking configure arguments" >&5
1121
1122
1123 top_builddir=`pwd`
1124
1125 ldap_subdir="/openldap"
1126
1127 # Check whether --with-subdir or --without-subdir was given.
1128 if test "${with_subdir+set}" = set; then
1129   withval="$with_subdir"
1130   case "$withval" in
1131         no) ldap_subdir=""
1132                 ;;
1133         yes)
1134                 ;;
1135         /*|\\*)
1136                 ldap_subdir="$withval"
1137                 ;;
1138         *)
1139                 ldap_subdir="/$withval"
1140                 ;;
1141 esac
1142
1143 fi
1144
1145
1146 # OpenLDAP --enable-debug
1147         # Check whether --enable-debug or --disable-debug was given.
1148 if test "${enable_debug+set}" = set; then
1149   enableval="$enable_debug"
1150   
1151         ol_arg=invalid
1152         for ol_val in auto yes no ; do
1153                 if test "$enableval" = "$ol_val" ; then
1154                         ol_arg="$ol_val"
1155                 fi
1156         done
1157         if test "$ol_arg" = "invalid" ; then
1158                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1159         fi
1160         ol_enable_debug="$ol_arg"
1161
1162 else
1163         ol_enable_debug="yes"
1164 fi
1165 # end --enable-debug
1166 # OpenLDAP --enable-syslog
1167         # Check whether --enable-syslog or --disable-syslog was given.
1168 if test "${enable_syslog+set}" = set; then
1169   enableval="$enable_syslog"
1170   
1171         ol_arg=invalid
1172         for ol_val in auto yes no ; do
1173                 if test "$enableval" = "$ol_val" ; then
1174                         ol_arg="$ol_val"
1175                 fi
1176         done
1177         if test "$ol_arg" = "invalid" ; then
1178                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1179         fi
1180         ol_enable_syslog="$ol_arg"
1181
1182 else
1183         ol_enable_syslog="auto"
1184 fi
1185 # end --enable-syslog
1186 # OpenLDAP --enable-proctitle
1187         # Check whether --enable-proctitle or --disable-proctitle was given.
1188 if test "${enable_proctitle+set}" = set; then
1189   enableval="$enable_proctitle"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1199         fi
1200         ol_enable_proctitle="$ol_arg"
1201
1202 else
1203         ol_enable_proctitle="yes"
1204 fi
1205 # end --enable-proctitle
1206 # OpenLDAP --enable-cache
1207         # Check whether --enable-cache or --disable-cache was given.
1208 if test "${enable_cache+set}" = set; then
1209   enableval="$enable_cache"
1210   
1211         ol_arg=invalid
1212         for ol_val in auto yes no ; do
1213                 if test "$enableval" = "$ol_val" ; then
1214                         ol_arg="$ol_val"
1215                 fi
1216         done
1217         if test "$ol_arg" = "invalid" ; then
1218                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1219         fi
1220         ol_enable_cache="$ol_arg"
1221
1222 else
1223         ol_enable_cache="no"
1224 fi
1225 # end --enable-cache
1226 # OpenLDAP --enable-referrals
1227         # Check whether --enable-referrals or --disable-referrals was given.
1228 if test "${enable_referrals+set}" = set; then
1229   enableval="$enable_referrals"
1230   
1231         ol_arg=invalid
1232         for ol_val in auto yes no ; do
1233                 if test "$enableval" = "$ol_val" ; then
1234                         ol_arg="$ol_val"
1235                 fi
1236         done
1237         if test "$ol_arg" = "invalid" ; then
1238                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1239         fi
1240         ol_enable_referrals="$ol_arg"
1241
1242 else
1243         ol_enable_referrals="no"
1244 fi
1245 # end --enable-referrals
1246 # OpenLDAP --enable-kbind
1247         # Check whether --enable-kbind or --disable-kbind was given.
1248 if test "${enable_kbind+set}" = set; then
1249   enableval="$enable_kbind"
1250   
1251         ol_arg=invalid
1252         for ol_val in auto yes no ; do
1253                 if test "$enableval" = "$ol_val" ; then
1254                         ol_arg="$ol_val"
1255                 fi
1256         done
1257         if test "$ol_arg" = "invalid" ; then
1258                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1259         fi
1260         ol_enable_kbind="$ol_arg"
1261
1262 else
1263         ol_enable_kbind="no"
1264 fi
1265 # end --enable-kbind
1266 # OpenLDAP --enable-ipv6
1267         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1268 if test "${enable_ipv6+set}" = set; then
1269   enableval="$enable_ipv6"
1270   
1271         ol_arg=invalid
1272         for ol_val in auto yes no ; do
1273                 if test "$enableval" = "$ol_val" ; then
1274                         ol_arg="$ol_val"
1275                 fi
1276         done
1277         if test "$ol_arg" = "invalid" ; then
1278                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1279         fi
1280         ol_enable_ipv6="$ol_arg"
1281
1282 else
1283         ol_enable_ipv6="auto"
1284 fi
1285 # end --enable-ipv6
1286 # OpenLDAP --enable-local
1287         # Check whether --enable-local or --disable-local was given.
1288 if test "${enable_local+set}" = set; then
1289   enableval="$enable_local"
1290   
1291         ol_arg=invalid
1292         for ol_val in auto yes no ; do
1293                 if test "$enableval" = "$ol_val" ; then
1294                         ol_arg="$ol_val"
1295                 fi
1296         done
1297         if test "$ol_arg" = "invalid" ; then
1298                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1299         fi
1300         ol_enable_local="$ol_arg"
1301
1302 else
1303         ol_enable_local="auto"
1304 fi
1305 # end --enable-local
1306 # OpenLDAP --enable-rewrite
1307         # Check whether --enable-rewrite or --disable-rewrite was given.
1308 if test "${enable_rewrite+set}" = set; then
1309   enableval="$enable_rewrite"
1310   
1311         ol_arg=invalid
1312         for ol_val in auto yes no ; do
1313                 if test "$enableval" = "$ol_val" ; then
1314                         ol_arg="$ol_val"
1315                 fi
1316         done
1317         if test "$ol_arg" = "invalid" ; then
1318                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1319         fi
1320         ol_enable_rewrite="$ol_arg"
1321
1322 else
1323         ol_enable_rewrite="no"
1324 fi
1325 # end --enable-rewrite
1326 # OpenLDAP --enable-x_compile
1327         # Check whether --enable-x_compile or --disable-x_compile was given.
1328 if test "${enable_x_compile+set}" = set; then
1329   enableval="$enable_x_compile"
1330   
1331         ol_arg=invalid
1332         for ol_val in yes no ; do
1333                 if test "$enableval" = "$ol_val" ; then
1334                         ol_arg="$ol_val"
1335                 fi
1336         done
1337         if test "$ol_arg" = "invalid" ; then
1338                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1339         fi
1340         ol_enable_x_compile="$ol_arg"
1341
1342 else
1343         ol_enable_x_compile="no"
1344 fi
1345 # end --enable-x_compile
1346
1347
1348 # OpenLDAP --with-cyrus_sasl
1349         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1350 if test "${with_cyrus_sasl+set}" = set; then
1351   withval="$with_cyrus_sasl"
1352   
1353         ol_arg=invalid
1354         for ol_val in auto yes no  ; do
1355                 if test "$withval" = "$ol_val" ; then
1356                         ol_arg="$ol_val"
1357                 fi
1358         done
1359         if test "$ol_arg" = "invalid" ; then
1360                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1361         fi
1362         ol_with_cyrus_sasl="$ol_arg"
1363
1364 else
1365         ol_with_cyrus_sasl="auto"
1366 fi
1367 # end --with-cyrus_sasl
1368
1369 # OpenLDAP --with-fetch
1370         # Check whether --with-fetch or --without-fetch was given.
1371 if test "${with_fetch+set}" = set; then
1372   withval="$with_fetch"
1373   
1374         ol_arg=invalid
1375         for ol_val in auto yes no  ; do
1376                 if test "$withval" = "$ol_val" ; then
1377                         ol_arg="$ol_val"
1378                 fi
1379         done
1380         if test "$ol_arg" = "invalid" ; then
1381                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1382         fi
1383         ol_with_fetch="$ol_arg"
1384
1385 else
1386         ol_with_fetch="auto"
1387 fi
1388 # end --with-fetch
1389
1390 # OpenLDAP --with-kerberos
1391         # Check whether --with-kerberos or --without-kerberos was given.
1392 if test "${with_kerberos+set}" = set; then
1393   withval="$with_kerberos"
1394   
1395         ol_arg=invalid
1396         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1397                 if test "$withval" = "$ol_val" ; then
1398                         ol_arg="$ol_val"
1399                 fi
1400         done
1401         if test "$ol_arg" = "invalid" ; then
1402                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1403         fi
1404         ol_with_kerberos="$ol_arg"
1405
1406 else
1407         ol_with_kerberos="auto"
1408 fi
1409 # end --with-kerberos
1410
1411 # OpenLDAP --with-readline
1412         # Check whether --with-readline or --without-readline was given.
1413 if test "${with_readline+set}" = set; then
1414   withval="$with_readline"
1415   
1416         ol_arg=invalid
1417         for ol_val in auto yes no  ; do
1418                 if test "$withval" = "$ol_val" ; then
1419                         ol_arg="$ol_val"
1420                 fi
1421         done
1422         if test "$ol_arg" = "invalid" ; then
1423                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1424         fi
1425         ol_with_readline="$ol_arg"
1426
1427 else
1428         ol_with_readline="auto"
1429 fi
1430 # end --with-readline
1431
1432 # OpenLDAP --with-threads
1433         # Check whether --with-threads or --without-threads was given.
1434 if test "${with_threads+set}" = set; then
1435   withval="$with_threads"
1436   
1437         ol_arg=invalid
1438         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1439                 if test "$withval" = "$ol_val" ; then
1440                         ol_arg="$ol_val"
1441                 fi
1442         done
1443         if test "$ol_arg" = "invalid" ; then
1444                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1445         fi
1446         ol_with_threads="$ol_arg"
1447
1448 else
1449         ol_with_threads="auto"
1450 fi
1451 # end --with-threads
1452
1453 # OpenLDAP --with-tls
1454         # Check whether --with-tls or --without-tls was given.
1455 if test "${with_tls+set}" = set; then
1456   withval="$with_tls"
1457   
1458         ol_arg=invalid
1459         for ol_val in auto ssleay openssl yes no  ; do
1460                 if test "$withval" = "$ol_val" ; then
1461                         ol_arg="$ol_val"
1462                 fi
1463         done
1464         if test "$ol_arg" = "invalid" ; then
1465                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1466         fi
1467         ol_with_tls="$ol_arg"
1468
1469 else
1470         ol_with_tls="auto"
1471 fi
1472 # end --with-tls
1473
1474 # OpenLDAP --with-yielding_select
1475         # Check whether --with-yielding_select or --without-yielding_select was given.
1476 if test "${with_yielding_select+set}" = set; then
1477   withval="$with_yielding_select"
1478   
1479         ol_arg=invalid
1480         for ol_val in auto yes no manual  ; do
1481                 if test "$withval" = "$ol_val" ; then
1482                         ol_arg="$ol_val"
1483                 fi
1484         done
1485         if test "$ol_arg" = "invalid" ; then
1486                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1487         fi
1488         ol_with_yielding_select="$ol_arg"
1489
1490 else
1491         ol_with_yielding_select="auto"
1492 fi
1493 # end --with-yielding_select
1494
1495
1496
1497 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1498 if test "${with_xxslapdoptions+set}" = set; then
1499   withval="$with_xxslapdoptions"
1500   :
1501 fi
1502
1503 # OpenLDAP --enable-slapd
1504         # Check whether --enable-slapd or --disable-slapd was given.
1505 if test "${enable_slapd+set}" = set; then
1506   enableval="$enable_slapd"
1507   
1508         ol_arg=invalid
1509         for ol_val in auto yes no ; do
1510                 if test "$enableval" = "$ol_val" ; then
1511                         ol_arg="$ol_val"
1512                 fi
1513         done
1514         if test "$ol_arg" = "invalid" ; then
1515                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1516         fi
1517         ol_enable_slapd="$ol_arg"
1518
1519 else
1520         ol_enable_slapd="yes"
1521 fi
1522 # end --enable-slapd
1523 # OpenLDAP --enable-aci
1524         # Check whether --enable-aci or --disable-aci was given.
1525 if test "${enable_aci+set}" = set; then
1526   enableval="$enable_aci"
1527   
1528         ol_arg=invalid
1529         for ol_val in auto yes no ; do
1530                 if test "$enableval" = "$ol_val" ; then
1531                         ol_arg="$ol_val"
1532                 fi
1533         done
1534         if test "$ol_arg" = "invalid" ; then
1535                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1536         fi
1537         ol_enable_aci="$ol_arg"
1538
1539 else
1540         ol_enable_aci="no"
1541 fi
1542 # end --enable-aci
1543 # OpenLDAP --enable-cleartext
1544         # Check whether --enable-cleartext or --disable-cleartext was given.
1545 if test "${enable_cleartext+set}" = set; then
1546   enableval="$enable_cleartext"
1547   
1548         ol_arg=invalid
1549         for ol_val in auto yes no ; do
1550                 if test "$enableval" = "$ol_val" ; then
1551                         ol_arg="$ol_val"
1552                 fi
1553         done
1554         if test "$ol_arg" = "invalid" ; then
1555                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1556         fi
1557         ol_enable_cleartext="$ol_arg"
1558
1559 else
1560         ol_enable_cleartext="yes"
1561 fi
1562 # end --enable-cleartext
1563 # OpenLDAP --enable-crypt
1564         # Check whether --enable-crypt or --disable-crypt was given.
1565 if test "${enable_crypt+set}" = set; then
1566   enableval="$enable_crypt"
1567   
1568         ol_arg=invalid
1569         for ol_val in auto yes no ; do
1570                 if test "$enableval" = "$ol_val" ; then
1571                         ol_arg="$ol_val"
1572                 fi
1573         done
1574         if test "$ol_arg" = "invalid" ; then
1575                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1576         fi
1577         ol_enable_crypt="$ol_arg"
1578
1579 else
1580         ol_enable_crypt="no"
1581 fi
1582 # end --enable-crypt
1583 # OpenLDAP --enable-dynamic
1584         # Check whether --enable-dynamic or --disable-dynamic was given.
1585 if test "${enable_dynamic+set}" = set; then
1586   enableval="$enable_dynamic"
1587   
1588         ol_arg=invalid
1589         for ol_val in auto yes no ; do
1590                 if test "$enableval" = "$ol_val" ; then
1591                         ol_arg="$ol_val"
1592                 fi
1593         done
1594         if test "$ol_arg" = "invalid" ; then
1595                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1596         fi
1597         ol_enable_dynamic="$ol_arg"
1598
1599 else
1600         ol_enable_dynamic="no"
1601 fi
1602 # end --enable-dynamic
1603 # OpenLDAP --enable-kpasswd
1604         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1605 if test "${enable_kpasswd+set}" = set; then
1606   enableval="$enable_kpasswd"
1607   
1608         ol_arg=invalid
1609         for ol_val in auto yes no ; do
1610                 if test "$enableval" = "$ol_val" ; then
1611                         ol_arg="$ol_val"
1612                 fi
1613         done
1614         if test "$ol_arg" = "invalid" ; then
1615                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1616         fi
1617         ol_enable_kpasswd="$ol_arg"
1618
1619 else
1620         ol_enable_kpasswd="no"
1621 fi
1622 # end --enable-kpasswd
1623 # OpenLDAP --enable-lmpasswd
1624         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1625 if test "${enable_lmpasswd+set}" = set; then
1626   enableval="$enable_lmpasswd"
1627   
1628         ol_arg=invalid
1629         for ol_val in auto yes no ; do
1630                 if test "$enableval" = "$ol_val" ; then
1631                         ol_arg="$ol_val"
1632                 fi
1633         done
1634         if test "$ol_arg" = "invalid" ; then
1635                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1636         fi
1637         ol_enable_lmpasswd="$ol_arg"
1638
1639 else
1640         ol_enable_lmpasswd="no"
1641 fi
1642 # end --enable-lmpasswd
1643 # OpenLDAP --enable-spasswd
1644         # Check whether --enable-spasswd or --disable-spasswd was given.
1645 if test "${enable_spasswd+set}" = set; then
1646   enableval="$enable_spasswd"
1647   
1648         ol_arg=invalid
1649         for ol_val in auto yes no ; do
1650                 if test "$enableval" = "$ol_val" ; then
1651                         ol_arg="$ol_val"
1652                 fi
1653         done
1654         if test "$ol_arg" = "invalid" ; then
1655                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1656         fi
1657         ol_enable_spasswd="$ol_arg"
1658
1659 else
1660         ol_enable_spasswd="no"
1661 fi
1662 # end --enable-spasswd
1663 # OpenLDAP --enable-modules
1664         # Check whether --enable-modules or --disable-modules was given.
1665 if test "${enable_modules+set}" = set; then
1666   enableval="$enable_modules"
1667   
1668         ol_arg=invalid
1669         for ol_val in auto yes no ; do
1670                 if test "$enableval" = "$ol_val" ; then
1671                         ol_arg="$ol_val"
1672                 fi
1673         done
1674         if test "$ol_arg" = "invalid" ; then
1675                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1676         fi
1677         ol_enable_modules="$ol_arg"
1678
1679 else
1680         ol_enable_modules="no"
1681 fi
1682 # end --enable-modules
1683 # OpenLDAP --enable-phonetic
1684         # Check whether --enable-phonetic or --disable-phonetic was given.
1685 if test "${enable_phonetic+set}" = set; then
1686   enableval="$enable_phonetic"
1687   
1688         ol_arg=invalid
1689         for ol_val in auto yes no ; do
1690                 if test "$enableval" = "$ol_val" ; then
1691                         ol_arg="$ol_val"
1692                 fi
1693         done
1694         if test "$ol_arg" = "invalid" ; then
1695                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1696         fi
1697         ol_enable_phonetic="$ol_arg"
1698
1699 else
1700         ol_enable_phonetic="no"
1701 fi
1702 # end --enable-phonetic
1703 # OpenLDAP --enable-rlookups
1704         # Check whether --enable-rlookups or --disable-rlookups was given.
1705 if test "${enable_rlookups+set}" = set; then
1706   enableval="$enable_rlookups"
1707   
1708         ol_arg=invalid
1709         for ol_val in auto yes no ; do
1710                 if test "$enableval" = "$ol_val" ; then
1711                         ol_arg="$ol_val"
1712                 fi
1713         done
1714         if test "$ol_arg" = "invalid" ; then
1715                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1716         fi
1717         ol_enable_rlookups="$ol_arg"
1718
1719 else
1720         ol_enable_rlookups="no"
1721 fi
1722 # end --enable-rlookups
1723 # OpenLDAP --enable-slp
1724         # Check whether --enable-slp or --disable-slp was given.
1725 if test "${enable_slp+set}" = set; then
1726   enableval="$enable_slp"
1727   
1728         ol_arg=invalid
1729         for ol_val in auto yes no ; do
1730                 if test "$enableval" = "$ol_val" ; then
1731                         ol_arg="$ol_val"
1732                 fi
1733         done
1734         if test "$ol_arg" = "invalid" ; then
1735                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1736         fi
1737         ol_enable_slp="$ol_arg"
1738
1739 else
1740         ol_enable_slp="no"
1741 fi
1742 # end --enable-slp
1743 # OpenLDAP --enable-wrappers
1744         # Check whether --enable-wrappers or --disable-wrappers was given.
1745 if test "${enable_wrappers+set}" = set; then
1746   enableval="$enable_wrappers"
1747   
1748         ol_arg=invalid
1749         for ol_val in auto yes no ; do
1750                 if test "$enableval" = "$ol_val" ; then
1751                         ol_arg="$ol_val"
1752                 fi
1753         done
1754         if test "$ol_arg" = "invalid" ; then
1755                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1756         fi
1757         ol_enable_wrappers="$ol_arg"
1758
1759 else
1760         ol_enable_wrappers="no"
1761 fi
1762 # end --enable-wrappers
1763
1764 # OpenLDAP --enable-bdb
1765         # Check whether --enable-bdb or --disable-bdb was given.
1766 if test "${enable_bdb+set}" = set; then
1767   enableval="$enable_bdb"
1768   
1769         ol_arg=invalid
1770         for ol_val in auto yes no ; do
1771                 if test "$enableval" = "$ol_val" ; then
1772                         ol_arg="$ol_val"
1773                 fi
1774         done
1775         if test "$ol_arg" = "invalid" ; then
1776                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1777         fi
1778         ol_enable_bdb="$ol_arg"
1779
1780 else
1781         ol_enable_bdb="no"
1782 fi
1783 # end --enable-bdb
1784 # OpenLDAP --with-bdb_module
1785         # Check whether --with-bdb_module or --without-bdb_module was given.
1786 if test "${with_bdb_module+set}" = set; then
1787   withval="$with_bdb_module"
1788   
1789         ol_arg=invalid
1790         for ol_val in static dynamic ; do
1791                 if test "$withval" = "$ol_val" ; then
1792                         ol_arg="$ol_val"
1793                 fi
1794         done
1795         if test "$ol_arg" = "invalid" ; then
1796                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1797         fi
1798         ol_with_bdb_module="$ol_arg"
1799
1800 else
1801         ol_with_bdb_module="static"
1802 fi
1803 # end --with-bdb_module
1804
1805 # OpenLDAP --enable-dnssrv
1806         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1807 if test "${enable_dnssrv+set}" = set; then
1808   enableval="$enable_dnssrv"
1809   
1810         ol_arg=invalid
1811         for ol_val in auto yes no ; do
1812                 if test "$enableval" = "$ol_val" ; then
1813                         ol_arg="$ol_val"
1814                 fi
1815         done
1816         if test "$ol_arg" = "invalid" ; then
1817                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1818         fi
1819         ol_enable_dnssrv="$ol_arg"
1820
1821 else
1822         ol_enable_dnssrv="no"
1823 fi
1824 # end --enable-dnssrv
1825 # OpenLDAP --with-dnssrv_module
1826         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1827 if test "${with_dnssrv_module+set}" = set; then
1828   withval="$with_dnssrv_module"
1829   
1830         ol_arg=invalid
1831         for ol_val in static dynamic ; do
1832                 if test "$withval" = "$ol_val" ; then
1833                         ol_arg="$ol_val"
1834                 fi
1835         done
1836         if test "$ol_arg" = "invalid" ; then
1837                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1838         fi
1839         ol_with_dnssrv_module="$ol_arg"
1840
1841 else
1842         ol_with_dnssrv_module="static"
1843 fi
1844 # end --with-dnssrv_module
1845
1846 # OpenLDAP --enable-ldap
1847         # Check whether --enable-ldap or --disable-ldap was given.
1848 if test "${enable_ldap+set}" = set; then
1849   enableval="$enable_ldap"
1850   
1851         ol_arg=invalid
1852         for ol_val in auto yes no ; do
1853                 if test "$enableval" = "$ol_val" ; then
1854                         ol_arg="$ol_val"
1855                 fi
1856         done
1857         if test "$ol_arg" = "invalid" ; then
1858                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1859         fi
1860         ol_enable_ldap="$ol_arg"
1861
1862 else
1863         ol_enable_ldap="no"
1864 fi
1865 # end --enable-ldap
1866 # OpenLDAP --with-ldap_module
1867         # Check whether --with-ldap_module or --without-ldap_module was given.
1868 if test "${with_ldap_module+set}" = set; then
1869   withval="$with_ldap_module"
1870   
1871         ol_arg=invalid
1872         for ol_val in static dynamic ; do
1873                 if test "$withval" = "$ol_val" ; then
1874                         ol_arg="$ol_val"
1875                 fi
1876         done
1877         if test "$ol_arg" = "invalid" ; then
1878                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1879         fi
1880         ol_with_ldap_module="$ol_arg"
1881
1882 else
1883         ol_with_ldap_module="static"
1884 fi
1885 # end --with-ldap_module
1886
1887 # OpenLDAP --enable-ldbm
1888         # Check whether --enable-ldbm or --disable-ldbm was given.
1889 if test "${enable_ldbm+set}" = set; then
1890   enableval="$enable_ldbm"
1891   
1892         ol_arg=invalid
1893         for ol_val in auto yes no ; do
1894                 if test "$enableval" = "$ol_val" ; then
1895                         ol_arg="$ol_val"
1896                 fi
1897         done
1898         if test "$ol_arg" = "invalid" ; then
1899                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1900         fi
1901         ol_enable_ldbm="$ol_arg"
1902
1903 else
1904         ol_enable_ldbm="yes"
1905 fi
1906 # end --enable-ldbm
1907 # OpenLDAP --with-ldbm_api
1908         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1909 if test "${with_ldbm_api+set}" = set; then
1910   withval="$with_ldbm_api"
1911   
1912         ol_arg=invalid
1913         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1914                 if test "$withval" = "$ol_val" ; then
1915                         ol_arg="$ol_val"
1916                 fi
1917         done
1918         if test "$ol_arg" = "invalid" ; then
1919                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1920         fi
1921         ol_with_ldbm_api="$ol_arg"
1922
1923 else
1924         ol_with_ldbm_api="auto"
1925 fi
1926 # end --with-ldbm_api
1927
1928 # OpenLDAP --with-ldbm_module
1929         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1930 if test "${with_ldbm_module+set}" = set; then
1931   withval="$with_ldbm_module"
1932   
1933         ol_arg=invalid
1934         for ol_val in static dynamic ; do
1935                 if test "$withval" = "$ol_val" ; then
1936                         ol_arg="$ol_val"
1937                 fi
1938         done
1939         if test "$ol_arg" = "invalid" ; then
1940                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1941         fi
1942         ol_with_ldbm_module="$ol_arg"
1943
1944 else
1945         ol_with_ldbm_module="static"
1946 fi
1947 # end --with-ldbm_module
1948
1949 # OpenLDAP --with-ldbm_type
1950         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1951 if test "${with_ldbm_type+set}" = set; then
1952   withval="$with_ldbm_type"
1953   
1954         ol_arg=invalid
1955         for ol_val in auto btree hash ; do
1956                 if test "$withval" = "$ol_val" ; then
1957                         ol_arg="$ol_val"
1958                 fi
1959         done
1960         if test "$ol_arg" = "invalid" ; then
1961                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1962         fi
1963         ol_with_ldbm_type="$ol_arg"
1964
1965 else
1966         ol_with_ldbm_type="auto"
1967 fi
1968 # end --with-ldbm_type
1969
1970 # OpenLDAP --enable-meta
1971         # Check whether --enable-meta or --disable-meta was given.
1972 if test "${enable_meta+set}" = set; then
1973   enableval="$enable_meta"
1974   
1975         ol_arg=invalid
1976         for ol_val in auto yes no ; do
1977                 if test "$enableval" = "$ol_val" ; then
1978                         ol_arg="$ol_val"
1979                 fi
1980         done
1981         if test "$ol_arg" = "invalid" ; then
1982                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
1983         fi
1984         ol_enable_meta="$ol_arg"
1985
1986 else
1987         ol_enable_meta="no"
1988 fi
1989 # end --enable-meta
1990 # OpenLDAP --with-meta_module
1991         # Check whether --with-meta_module or --without-meta_module was given.
1992 if test "${with_meta_module+set}" = set; then
1993   withval="$with_meta_module"
1994   
1995         ol_arg=invalid
1996         for ol_val in static dynamic ; do
1997                 if test "$withval" = "$ol_val" ; then
1998                         ol_arg="$ol_val"
1999                 fi
2000         done
2001         if test "$ol_arg" = "invalid" ; then
2002                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2003         fi
2004         ol_with_meta_module="$ol_arg"
2005
2006 else
2007         ol_with_meta_module="static"
2008 fi
2009 # end --with-meta_module
2010
2011 # OpenLDAP --enable-monitor
2012         # Check whether --enable-monitor or --disable-monitor was given.
2013 if test "${enable_monitor+set}" = set; then
2014   enableval="$enable_monitor"
2015   
2016         ol_arg=invalid
2017         for ol_val in auto yes no ; do
2018                 if test "$enableval" = "$ol_val" ; then
2019                         ol_arg="$ol_val"
2020                 fi
2021         done
2022         if test "$ol_arg" = "invalid" ; then
2023                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2024         fi
2025         ol_enable_monitor="$ol_arg"
2026
2027 else
2028         ol_enable_monitor="no"
2029 fi
2030 # end --enable-monitor
2031 # OpenLDAP --with-monitor_module
2032         # Check whether --with-monitor_module or --without-monitor_module was given.
2033 if test "${with_monitor_module+set}" = set; then
2034   withval="$with_monitor_module"
2035   
2036         ol_arg=invalid
2037         for ol_val in static dynamic ; do
2038                 if test "$withval" = "$ol_val" ; then
2039                         ol_arg="$ol_val"
2040                 fi
2041         done
2042         if test "$ol_arg" = "invalid" ; then
2043                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2044         fi
2045         ol_with_monitor_module="$ol_arg"
2046
2047 else
2048         ol_with_monitor_module="static"
2049 fi
2050 # end --with-monitor_module
2051
2052 # OpenLDAP --enable-passwd
2053         # Check whether --enable-passwd or --disable-passwd was given.
2054 if test "${enable_passwd+set}" = set; then
2055   enableval="$enable_passwd"
2056   
2057         ol_arg=invalid
2058         for ol_val in auto yes no ; do
2059                 if test "$enableval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2065         fi
2066         ol_enable_passwd="$ol_arg"
2067
2068 else
2069         ol_enable_passwd="no"
2070 fi
2071 # end --enable-passwd
2072 # OpenLDAP --with-passwd_module
2073         # Check whether --with-passwd_module or --without-passwd_module was given.
2074 if test "${with_passwd_module+set}" = set; then
2075   withval="$with_passwd_module"
2076   
2077         ol_arg=invalid
2078         for ol_val in static dynamic ; do
2079                 if test "$withval" = "$ol_val" ; then
2080                         ol_arg="$ol_val"
2081                 fi
2082         done
2083         if test "$ol_arg" = "invalid" ; then
2084                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2085         fi
2086         ol_with_passwd_module="$ol_arg"
2087
2088 else
2089         ol_with_passwd_module="static"
2090 fi
2091 # end --with-passwd_module
2092
2093 # OpenLDAP --enable-perl
2094         # Check whether --enable-perl or --disable-perl was given.
2095 if test "${enable_perl+set}" = set; then
2096   enableval="$enable_perl"
2097   
2098         ol_arg=invalid
2099         for ol_val in auto yes no ; do
2100                 if test "$enableval" = "$ol_val" ; then
2101                         ol_arg="$ol_val"
2102                 fi
2103         done
2104         if test "$ol_arg" = "invalid" ; then
2105                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2106         fi
2107         ol_enable_perl="$ol_arg"
2108
2109 else
2110         ol_enable_perl="no"
2111 fi
2112 # end --enable-perl
2113 # OpenLDAP --with-perl_module
2114         # Check whether --with-perl_module or --without-perl_module was given.
2115 if test "${with_perl_module+set}" = set; then
2116   withval="$with_perl_module"
2117   
2118         ol_arg=invalid
2119         for ol_val in static dynamic ; do
2120                 if test "$withval" = "$ol_val" ; then
2121                         ol_arg="$ol_val"
2122                 fi
2123         done
2124         if test "$ol_arg" = "invalid" ; then
2125                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2126         fi
2127         ol_with_perl_module="$ol_arg"
2128
2129 else
2130         ol_with_perl_module="static"
2131 fi
2132 # end --with-perl_module
2133
2134 # OpenLDAP --enable-shell
2135         # Check whether --enable-shell or --disable-shell was given.
2136 if test "${enable_shell+set}" = set; then
2137   enableval="$enable_shell"
2138   
2139         ol_arg=invalid
2140         for ol_val in auto yes no ; do
2141                 if test "$enableval" = "$ol_val" ; then
2142                         ol_arg="$ol_val"
2143                 fi
2144         done
2145         if test "$ol_arg" = "invalid" ; then
2146                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2147         fi
2148         ol_enable_shell="$ol_arg"
2149
2150 else
2151         ol_enable_shell="no"
2152 fi
2153 # end --enable-shell
2154 # OpenLDAP --with-shell_module
2155         # Check whether --with-shell_module or --without-shell_module was given.
2156 if test "${with_shell_module+set}" = set; then
2157   withval="$with_shell_module"
2158   
2159         ol_arg=invalid
2160         for ol_val in static dynamic ; do
2161                 if test "$withval" = "$ol_val" ; then
2162                         ol_arg="$ol_val"
2163                 fi
2164         done
2165         if test "$ol_arg" = "invalid" ; then
2166                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2167         fi
2168         ol_with_shell_module="$ol_arg"
2169
2170 else
2171         ol_with_shell_module="static"
2172 fi
2173 # end --with-shell_module
2174
2175 # OpenLDAP --enable-sql
2176         # Check whether --enable-sql or --disable-sql was given.
2177 if test "${enable_sql+set}" = set; then
2178   enableval="$enable_sql"
2179   
2180         ol_arg=invalid
2181         for ol_val in auto yes no ; do
2182                 if test "$enableval" = "$ol_val" ; then
2183                         ol_arg="$ol_val"
2184                 fi
2185         done
2186         if test "$ol_arg" = "invalid" ; then
2187                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2188         fi
2189         ol_enable_sql="$ol_arg"
2190
2191 else
2192         ol_enable_sql="no"
2193 fi
2194 # end --enable-sql
2195 # OpenLDAP --with-sql_module
2196         # Check whether --with-sql_module or --without-sql_module was given.
2197 if test "${with_sql_module+set}" = set; then
2198   withval="$with_sql_module"
2199   
2200         ol_arg=invalid
2201         for ol_val in static dynamic ; do
2202                 if test "$withval" = "$ol_val" ; then
2203                         ol_arg="$ol_val"
2204                 fi
2205         done
2206         if test "$ol_arg" = "invalid" ; then
2207                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2208         fi
2209         ol_with_sql_module="$ol_arg"
2210
2211 else
2212         ol_with_sql_module="static"
2213 fi
2214 # end --with-sql_module
2215
2216 # OpenLDAP --enable-tcl
2217         # Check whether --enable-tcl or --disable-tcl was given.
2218 if test "${enable_tcl+set}" = set; then
2219   enableval="$enable_tcl"
2220   
2221         ol_arg=invalid
2222         for ol_val in auto yes no ; do
2223                 if test "$enableval" = "$ol_val" ; then
2224                         ol_arg="$ol_val"
2225                 fi
2226         done
2227         if test "$ol_arg" = "invalid" ; then
2228                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2229         fi
2230         ol_enable_tcl="$ol_arg"
2231
2232 else
2233         ol_enable_tcl="no"
2234 fi
2235 # end --enable-tcl
2236 # OpenLDAP --with-tcl_module
2237         # Check whether --with-tcl_module or --without-tcl_module was given.
2238 if test "${with_tcl_module+set}" = set; then
2239   withval="$with_tcl_module"
2240   
2241         ol_arg=invalid
2242         for ol_val in static dynamic ; do
2243                 if test "$withval" = "$ol_val" ; then
2244                         ol_arg="$ol_val"
2245                 fi
2246         done
2247         if test "$ol_arg" = "invalid" ; then
2248                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2249         fi
2250         ol_with_tcl_module="$ol_arg"
2251
2252 else
2253         ol_with_tcl_module="static"
2254 fi
2255 # end --with-tcl_module
2256
2257
2258 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2259 if test "${with_xxslurpdoptions+set}" = set; then
2260   withval="$with_xxslurpdoptions"
2261   :
2262 fi
2263
2264 # OpenLDAP --enable-slurpd
2265         # Check whether --enable-slurpd or --disable-slurpd was given.
2266 if test "${enable_slurpd+set}" = set; then
2267   enableval="$enable_slurpd"
2268   
2269         ol_arg=invalid
2270         for ol_val in auto yes no ; do
2271                 if test "$enableval" = "$ol_val" ; then
2272                         ol_arg="$ol_val"
2273                 fi
2274         done
2275         if test "$ol_arg" = "invalid" ; then
2276                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2277         fi
2278         ol_enable_slurpd="$ol_arg"
2279
2280 else
2281         ol_enable_slurpd="auto"
2282 fi
2283 # end --enable-slurpd
2284
2285 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2286 if test "${with_xxliboptions+set}" = set; then
2287   withval="$with_xxliboptions"
2288   :
2289 fi
2290
2291 # Check whether --enable-static or --disable-static was given.
2292 if test "${enable_static+set}" = set; then
2293   enableval="$enable_static"
2294   p=${PACKAGE-default}
2295 case "$enableval" in
2296 yes) enable_static=yes ;;
2297 no) enable_static=no ;;
2298 *)
2299   enable_static=no
2300   # Look at the argument we got.  We use all the common list separators.
2301   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2302   for pkg in $enableval; do
2303     if test "X$pkg" = "X$p"; then
2304       enable_static=yes
2305     fi
2306   done
2307   IFS="$ac_save_ifs"
2308   ;;
2309 esac
2310 else
2311   enable_static=yes
2312 fi
2313
2314 # Check whether --enable-shared or --disable-shared was given.
2315 if test "${enable_shared+set}" = set; then
2316   enableval="$enable_shared"
2317   p=${PACKAGE-default}
2318 case "$enableval" in
2319 yes) enable_shared=yes ;;
2320 no) enable_shared=no ;;
2321 *)
2322   enable_shared=no
2323   # Look at the argument we got.  We use all the common list separators.
2324   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2325   for pkg in $enableval; do
2326     if test "X$pkg" = "X$p"; then
2327       enable_shared=yes
2328     fi
2329   done
2330   IFS="$ac_save_ifs"
2331   ;;
2332 esac
2333 else
2334   enable_shared=yes
2335 fi
2336
2337
2338
2339 # validate options
2340 if test $ol_enable_slapd = no ; then
2341                 if test $ol_enable_bdb = yes ; then
2342                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2343         fi
2344         if test $ol_enable_dnssrv = yes ; then
2345                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2346         fi
2347         if test $ol_enable_ldap = yes ; then
2348                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2349         fi
2350         if test $ol_enable_ldbm = yes ; then
2351                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2352         fi
2353         if test $ol_enable_meta = yes ; then
2354                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2355         fi
2356         if test $ol_enable_module = yes ; then
2357                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2358         fi
2359         if test $ol_enable_passwd = yes ; then
2360                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2361         fi
2362         if test $ol_enable_perl = yes ; then
2363                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2364         fi
2365         if test $ol_enable_shell = yes ; then
2366                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2367         fi
2368         if test $ol_enable_tcl = yes ; then
2369                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2370         fi
2371         if test $ol_enable_sql = yes ; then
2372                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2373         fi
2374         if test $ol_enable_modules = yes ; then
2375                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2376         fi
2377         if test $ol_enable_wrappers = yes ; then
2378                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2379         fi
2380         if test $ol_enable_phonetic = yes ; then
2381                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2382         fi
2383         if test $ol_enable_rlookups = yes ; then
2384                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2385         fi
2386         if test $ol_enable_aci = yes ; then
2387                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2388         fi
2389         if test $ol_with_ldbm_api != auto ; then
2390                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2391         fi
2392         if test $ol_with_ldbm_type != auto ; then
2393                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2394         fi
2395         if test $ol_with_bdb_module != static ; then
2396                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2397         fi
2398         if test $ol_with_dnssrv_module != static ; then
2399                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2400         fi
2401         if test $ol_with_ldap_module != static ; then
2402                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2403         fi
2404         if test $ol_with_ldbm_module != static ; then
2405                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2406         fi
2407         if test $ol_with_meta_module != static ; then
2408                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2409         fi
2410         if test $ol_with_monitor_module != static ; then
2411                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2412         fi
2413         if test $ol_with_passwd_module != static ; then
2414                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2415         fi
2416         if test $ol_with_perl_module != static ; then
2417                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2418         fi
2419         if test $ol_with_shell_module != static ; then
2420                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2421         fi
2422         if test $ol_with_tcl_module != static ; then
2423                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2424         fi
2425         if test $ol_with_sql_module != static ; then
2426                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2427         fi
2428         if test $ol_enable_slurpd = yes ; then
2429                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2430         fi
2431         if test $ol_enable_rewrite = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2433         fi
2434
2435         # force settings to no
2436         ol_enable_bdb=no
2437         ol_enable_dnssrv=no
2438         ol_enable_ldap=no
2439         ol_enable_ldbm=no
2440         ol_enable_meta=no
2441         ol_enable_monitor=no
2442         ol_enable_passwd=no
2443         ol_enable_perl=no
2444         ol_enable_shell=no
2445         ol_enable_tcl=no
2446         ol_enable_sql=no
2447
2448         ol_enable_modules=no
2449         ol_enable_phonetic=no
2450         ol_enable_rlookups=no
2451         ol_enable_aci=no
2452         ol_enable_wrappers=no
2453         ol_enable_dynamic=no
2454
2455         ol_with_ldbm_api=no
2456         ol_with_ldbm_type=no
2457
2458         ol_with_bdb_module=static
2459         ol_with_dnssrv_module=static
2460         ol_with_ldap_module=static
2461         ol_with_ldbm_module=static
2462         ol_with_meta_module=static
2463         ol_with_monitor_module=static
2464         ol_with_passwd_module=static
2465         ol_with_perl_module=static
2466         ol_with_shell_module=static
2467         ol_with_tcl_module=static
2468         ol_with_sql_module=static
2469
2470         ol_enable_slurpd=no
2471
2472         ol_enable_rewrite=no
2473
2474 elif test $ol_enable_ldbm = no ; then
2475         
2476         if test $ol_with_ldbm_api != auto ; then
2477                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2478         fi
2479
2480         if test $ol_with_ldbm_type != auto ; then
2481                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2482         fi
2483
2484         if test $ol_with_ldbm_module != static ; then
2485                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2486         fi
2487
2488         if test $ol_enable_modules != yes -a \
2489                 $ol_enable_bdb = no -a \
2490                 $ol_enable_dnssrv = no -a \
2491                 $ol_enable_ldap = no -a \
2492                 $ol_enable_meta = no -a \
2493                 $ol_enable_monitor = no -a \
2494                 $ol_enable_passwd = no -a \
2495                 $ol_enable_perl = no -a \
2496                 $ol_enable_shell = no -a \
2497                 $ol_enable_sql = no -a \
2498                 $ol_enable_tcl = no ; then
2499                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2500         fi
2501
2502         ol_with_ldbm_api=no
2503         ol_with_ldbm_type=no
2504         ol_with_ldbm_module=static
2505
2506 else
2507                 if test $ol_with_ldbm_api = gdbm -a \
2508                 $ol_with_ldbm_type = btree ; then
2509                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2510         fi
2511         if test $ol_with_ldbm_api = mdbm -a \
2512                 $ol_with_ldbm_type = btree ; then
2513                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2514         fi
2515         if test $ol_with_ldbm_api = ndbm -a \
2516                 $ol_with_ldbm_type = btree ; then
2517                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2518         fi
2519 fi
2520
2521 if test $ol_enable_slurpd = yes ; then
2522                 if test $ol_with_threads = no ; then
2523                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2524         fi
2525 fi
2526
2527 if test $ol_enable_lmpasswd = yes ; then
2528         if test $ol_with_tls = no ; then
2529                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2530         fi
2531 fi
2532
2533 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2534         if test $ol_with_kerberos = no ; then
2535                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2536         fi
2537         ol_with_kerberos=yes
2538 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2539         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2540                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2541         fi
2542         ol_with_kerberos=no
2543 fi
2544
2545 if test $ol_enable_spasswd = yes ; then
2546         if test $ol_with_cyrus_sasl = no ; then
2547                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2548         fi
2549         ol_with_cyrus_sasl=yes
2550 fi
2551
2552 echo "$ac_t""done" 1>&6
2553
2554 LDAP_LIBS=
2555 LDIF_LIBS=
2556 LDBM_LIBS=
2557 LTHREAD_LIBS=
2558 LUTIL_LIBS=
2559
2560 SLAPD_LIBS=
2561 SLURPD_LIBS=
2562
2563 BUILD_SLAPD=no
2564 BUILD_SLURPD=no
2565
2566 BUILD_THREAD=no
2567
2568 BUILD_BDB=no
2569 BUILD_DNSSRV=no
2570 BUILD_LDAP=no
2571 BUILD_LDBM=no
2572 BUILD_META=no
2573 BUILD_MONITOR=no
2574 BUILD_PASSWD=no
2575 BUILD_PERL=no
2576 BUILD_SHELL=no
2577 BUILD_SQL=no
2578 BUILD_TCL=no
2579
2580 BUILD_BDB_DYNAMIC=static
2581 BUILD_DNSSRV_DYNAMIC=static
2582 BUILD_LDAP_DYNAMIC=static
2583 BUILD_LDBM_DYNAMIC=static
2584 BUILD_META_DYNAMIC=static
2585 BUILD_MONITOR_DYNAMIC=static
2586 BUILD_PASSWD_DYNAMIC=static
2587 BUILD_PERL_DYNAMIC=static
2588 BUILD_SHELL_DYNAMIC=static
2589 BUILD_TCL_DYNAMIC=static
2590 BUILD_SQL_DYNAMIC=static
2591
2592 SLAPD_MODULES_LDFLAGS=
2593 SLAPD_MODULES_CPPFLAGS=
2594 SLAPD_MODULES_LIST=
2595
2596 SLAPD_PERL_LDFLAGS=
2597 MOD_PERL_LDFLAGS=
2598 PERL_CPPFLAGS=
2599
2600 SLAPD_SQL_LDFLAGS=
2601 SLAPD_SQL_LIBS=
2602 SLAPD_SQL_INCLUDES=
2603
2604 MOD_TCL_LIB=
2605 KRB4_LIBS=
2606 KRB5_LIBS=
2607 READLINE_LIBS=
2608 SASL_LIBS=
2609 TERMCAP_LIBS=
2610 TLS_LIBS=
2611 MODULES_LIBS=
2612 AUTH_LIBS=
2613
2614 SLAPD_SLP_LIBS=
2615
2616
2617
2618 cat >> confdefs.h <<\EOF
2619 #define HAVE_MKVERSION 1
2620 EOF
2621
2622
2623
2624
2625 ol_aix_threads=no
2626 case "$target" in
2627 *-*-aix*)       if test -z "$CC" ; then
2628                 case "$ol_with_threads" in
2629                 auto | yes |  posix) ol_aix_threads=yes ;;
2630                 esac
2631         fi
2632 ;;
2633 esac
2634
2635 if test $ol_aix_threads = yes ; then
2636         if test -z "${CC}" ; then
2637                 for ac_prog in cc_r xlc_r cc
2638 do
2639 # Extract the first word of "$ac_prog", so it can be a program name with args.
2640 set dummy $ac_prog; ac_word=$2
2641 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2642 echo "configure:2643: checking for $ac_word" >&5
2643 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2644   echo $ac_n "(cached) $ac_c" 1>&6
2645 else
2646   if test -n "$CC"; then
2647   ac_cv_prog_CC="$CC" # Let the user override the test.
2648 else
2649   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2650   ac_dummy="$PATH"
2651   for ac_dir in $ac_dummy; do
2652     test -z "$ac_dir" && ac_dir=.
2653     if test -f $ac_dir/$ac_word; then
2654       ac_cv_prog_CC="$ac_prog"
2655       break
2656     fi
2657   done
2658   IFS="$ac_save_ifs"
2659 fi
2660 fi
2661 CC="$ac_cv_prog_CC"
2662 if test -n "$CC"; then
2663   echo "$ac_t""$CC" 1>&6
2664 else
2665   echo "$ac_t""no" 1>&6
2666 fi
2667
2668 test -n "$CC" && break
2669 done
2670
2671
2672                 if test "$CC" = cc ; then
2673                                                 if test $ol_with_threads != auto ; then
2674                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2675                         else
2676                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2677                         fi
2678                         ol_with_threads=no
2679                 fi
2680         fi
2681
2682         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2683                 ol_with_threads=posix
2684                 ol_cv_pthread_create=yes
2685         fi
2686 fi
2687
2688 if test -z "${CC}"; then
2689         for ac_prog in cc
2690 do
2691 # Extract the first word of "$ac_prog", so it can be a program name with args.
2692 set dummy $ac_prog; ac_word=$2
2693 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2694 echo "configure:2695: checking for $ac_word" >&5
2695 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2696   echo $ac_n "(cached) $ac_c" 1>&6
2697 else
2698   if test -n "$CC"; then
2699   ac_cv_prog_CC="$CC" # Let the user override the test.
2700 else
2701   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2702   ac_dummy="$PATH"
2703   for ac_dir in $ac_dummy; do
2704     test -z "$ac_dir" && ac_dir=.
2705     if test -f $ac_dir/$ac_word; then
2706       ac_cv_prog_CC="$ac_prog"
2707       break
2708     fi
2709   done
2710   IFS="$ac_save_ifs"
2711 fi
2712 fi
2713 CC="$ac_cv_prog_CC"
2714 if test -n "$CC"; then
2715   echo "$ac_t""$CC" 1>&6
2716 else
2717   echo "$ac_t""no" 1>&6
2718 fi
2719
2720 test -n "$CC" && break
2721 done
2722
2723 fi
2724
2725
2726
2727
2728 # Check whether --enable-fast-install or --disable-fast-install was given.
2729 if test "${enable_fast_install+set}" = set; then
2730   enableval="$enable_fast_install"
2731   p=${PACKAGE-default}
2732 case "$enableval" in
2733 yes) enable_fast_install=yes ;;
2734 no) enable_fast_install=no ;;
2735 *)
2736   enable_fast_install=no
2737   # Look at the argument we got.  We use all the common list separators.
2738   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2739   for pkg in $enableval; do
2740     if test "X$pkg" = "X$p"; then
2741       enable_fast_install=yes
2742     fi
2743   done
2744   IFS="$ac_save_ifs"
2745   ;;
2746 esac
2747 else
2748   enable_fast_install=yes
2749 fi
2750
2751 # Extract the first word of "ranlib", so it can be a program name with args.
2752 set dummy ranlib; ac_word=$2
2753 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2754 echo "configure:2755: checking for $ac_word" >&5
2755 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2756   echo $ac_n "(cached) $ac_c" 1>&6
2757 else
2758   if test -n "$RANLIB"; then
2759   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2760 else
2761   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2762   ac_dummy="$PATH"
2763   for ac_dir in $ac_dummy; do
2764     test -z "$ac_dir" && ac_dir=.
2765     if test -f $ac_dir/$ac_word; then
2766       ac_cv_prog_RANLIB="ranlib"
2767       break
2768     fi
2769   done
2770   IFS="$ac_save_ifs"
2771   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2772 fi
2773 fi
2774 RANLIB="$ac_cv_prog_RANLIB"
2775 if test -n "$RANLIB"; then
2776   echo "$ac_t""$RANLIB" 1>&6
2777 else
2778   echo "$ac_t""no" 1>&6
2779 fi
2780
2781 # Extract the first word of "gcc", so it can be a program name with args.
2782 set dummy gcc; ac_word=$2
2783 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2784 echo "configure:2785: checking for $ac_word" >&5
2785 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2786   echo $ac_n "(cached) $ac_c" 1>&6
2787 else
2788   if test -n "$CC"; then
2789   ac_cv_prog_CC="$CC" # Let the user override the test.
2790 else
2791   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2792   ac_dummy="$PATH"
2793   for ac_dir in $ac_dummy; do
2794     test -z "$ac_dir" && ac_dir=.
2795     if test -f $ac_dir/$ac_word; then
2796       ac_cv_prog_CC="gcc"
2797       break
2798     fi
2799   done
2800   IFS="$ac_save_ifs"
2801 fi
2802 fi
2803 CC="$ac_cv_prog_CC"
2804 if test -n "$CC"; then
2805   echo "$ac_t""$CC" 1>&6
2806 else
2807   echo "$ac_t""no" 1>&6
2808 fi
2809
2810 if test -z "$CC"; then
2811   # Extract the first word of "cc", so it can be a program name with args.
2812 set dummy cc; ac_word=$2
2813 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2814 echo "configure:2815: checking for $ac_word" >&5
2815 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2816   echo $ac_n "(cached) $ac_c" 1>&6
2817 else
2818   if test -n "$CC"; then
2819   ac_cv_prog_CC="$CC" # Let the user override the test.
2820 else
2821   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2822   ac_prog_rejected=no
2823   ac_dummy="$PATH"
2824   for ac_dir in $ac_dummy; do
2825     test -z "$ac_dir" && ac_dir=.
2826     if test -f $ac_dir/$ac_word; then
2827       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2828         ac_prog_rejected=yes
2829         continue
2830       fi
2831       ac_cv_prog_CC="cc"
2832       break
2833     fi
2834   done
2835   IFS="$ac_save_ifs"
2836 if test $ac_prog_rejected = yes; then
2837   # We found a bogon in the path, so make sure we never use it.
2838   set dummy $ac_cv_prog_CC
2839   shift
2840   if test $# -gt 0; then
2841     # We chose a different compiler from the bogus one.
2842     # However, it has the same basename, so the bogon will be chosen
2843     # first if we set CC to just the basename; use the full file name.
2844     shift
2845     set dummy "$ac_dir/$ac_word" "$@"
2846     shift
2847     ac_cv_prog_CC="$@"
2848   fi
2849 fi
2850 fi
2851 fi
2852 CC="$ac_cv_prog_CC"
2853 if test -n "$CC"; then
2854   echo "$ac_t""$CC" 1>&6
2855 else
2856   echo "$ac_t""no" 1>&6
2857 fi
2858
2859   if test -z "$CC"; then
2860     case "`uname -s`" in
2861     *win32* | *WIN32*)
2862       # Extract the first word of "cl", so it can be a program name with args.
2863 set dummy cl; ac_word=$2
2864 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2865 echo "configure:2866: checking for $ac_word" >&5
2866 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2867   echo $ac_n "(cached) $ac_c" 1>&6
2868 else
2869   if test -n "$CC"; then
2870   ac_cv_prog_CC="$CC" # Let the user override the test.
2871 else
2872   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2873   ac_dummy="$PATH"
2874   for ac_dir in $ac_dummy; do
2875     test -z "$ac_dir" && ac_dir=.
2876     if test -f $ac_dir/$ac_word; then
2877       ac_cv_prog_CC="cl"
2878       break
2879     fi
2880   done
2881   IFS="$ac_save_ifs"
2882 fi
2883 fi
2884 CC="$ac_cv_prog_CC"
2885 if test -n "$CC"; then
2886   echo "$ac_t""$CC" 1>&6
2887 else
2888   echo "$ac_t""no" 1>&6
2889 fi
2890  ;;
2891     esac
2892   fi
2893   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2894 fi
2895
2896 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2897 echo "configure:2898: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2898
2899 ac_ext=c
2900 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2901 ac_cpp='$CPP $CPPFLAGS'
2902 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2903 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2904 cross_compiling=$ac_cv_prog_cc_cross
2905
2906 cat > conftest.$ac_ext << EOF
2907
2908 #line 2909 "configure"
2909 #include "confdefs.h"
2910
2911 main(){return(0);}
2912 EOF
2913 if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2914   ac_cv_prog_cc_works=yes
2915   # If we can't run a trivial program, we are probably using a cross compiler.
2916   if (./conftest; exit) 2>/dev/null; then
2917     ac_cv_prog_cc_cross=no
2918   else
2919     ac_cv_prog_cc_cross=yes
2920   fi
2921 else
2922   echo "configure: failed program was:" >&5
2923   cat conftest.$ac_ext >&5
2924   ac_cv_prog_cc_works=no
2925 fi
2926 rm -fr conftest*
2927 ac_ext=c
2928 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2929 ac_cpp='$CPP $CPPFLAGS'
2930 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2931 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2932 cross_compiling=$ac_cv_prog_cc_cross
2933
2934 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2935 if test $ac_cv_prog_cc_works = no; then
2936   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2937 fi
2938 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2939 echo "configure:2940: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2940 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2941 cross_compiling=$ac_cv_prog_cc_cross
2942
2943 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2944 echo "configure:2945: checking whether we are using GNU C" >&5
2945 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2946   echo $ac_n "(cached) $ac_c" 1>&6
2947 else
2948   cat > conftest.c <<EOF
2949 #ifdef __GNUC__
2950   yes;
2951 #endif
2952 EOF
2953 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2954   ac_cv_prog_gcc=yes
2955 else
2956   ac_cv_prog_gcc=no
2957 fi
2958 fi
2959
2960 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2961
2962 if test $ac_cv_prog_gcc = yes; then
2963   GCC=yes
2964 else
2965   GCC=
2966 fi
2967
2968 ac_test_CFLAGS="${CFLAGS+set}"
2969 ac_save_CFLAGS="$CFLAGS"
2970 CFLAGS=
2971 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2972 echo "configure:2973: checking whether ${CC-cc} accepts -g" >&5
2973 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2974   echo $ac_n "(cached) $ac_c" 1>&6
2975 else
2976   echo 'void f(){}' > conftest.c
2977 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2978   ac_cv_prog_cc_g=yes
2979 else
2980   ac_cv_prog_cc_g=no
2981 fi
2982 rm -f conftest*
2983
2984 fi
2985
2986 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2987 if test "$ac_test_CFLAGS" = set; then
2988   CFLAGS="$ac_save_CFLAGS"
2989 elif test $ac_cv_prog_cc_g = yes; then
2990   if test "$GCC" = yes; then
2991     CFLAGS="-g -O2"
2992   else
2993     CFLAGS="-g"
2994   fi
2995 else
2996   if test "$GCC" = yes; then
2997     CFLAGS="-O2"
2998   else
2999     CFLAGS=
3000   fi
3001 fi
3002
3003 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3004 if test "${with_gnu_ld+set}" = set; then
3005   withval="$with_gnu_ld"
3006   test "$withval" = no || with_gnu_ld=yes
3007 else
3008   with_gnu_ld=no
3009 fi
3010
3011 ac_prog=ld
3012 if test "$ac_cv_prog_gcc" = yes; then
3013   # Check if gcc -print-prog-name=ld gives a path.
3014   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3015 echo "configure:3016: checking for ld used by GCC" >&5
3016   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3017   case "$ac_prog" in
3018     # Accept absolute paths.
3019     [\\/]* | [A-Za-z]:[\\/]*)
3020       re_direlt='/[^/][^/]*/\.\./'
3021       # Canonicalize the path of ld
3022       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3023       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3024         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3025       done
3026       test -z "$LD" && LD="$ac_prog"
3027       ;;
3028   "")
3029     # If it fails, then pretend we aren't using GCC.
3030     ac_prog=ld
3031     ;;
3032   *)
3033     # If it is relative, then search for the first ld in PATH.
3034     with_gnu_ld=unknown
3035     ;;
3036   esac
3037 elif test "$with_gnu_ld" = yes; then
3038   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3039 echo "configure:3040: checking for GNU ld" >&5
3040 else
3041   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3042 echo "configure:3043: checking for non-GNU ld" >&5
3043 fi
3044 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
3045   echo $ac_n "(cached) $ac_c" 1>&6
3046 else
3047   if test -z "$LD"; then
3048   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3049   for ac_dir in $PATH; do
3050     test -z "$ac_dir" && ac_dir=.
3051     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3052       ac_cv_path_LD="$ac_dir/$ac_prog"
3053       # Check to see if the program is GNU ld.  I'd rather use --version,
3054       # but apparently some GNU ld's only accept -v.
3055       # Break only if it was the GNU/non-GNU ld that we prefer.
3056       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3057         test "$with_gnu_ld" != no && break
3058       else
3059         test "$with_gnu_ld" != yes && break
3060       fi
3061     fi
3062   done
3063   IFS="$ac_save_ifs"
3064 else
3065   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3066 fi
3067 fi
3068
3069 LD="$ac_cv_path_LD"
3070 if test -n "$LD"; then
3071   echo "$ac_t""$LD" 1>&6
3072 else
3073   echo "$ac_t""no" 1>&6
3074 fi
3075 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3076 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3077 echo "configure:3078: checking if the linker ($LD) is GNU ld" >&5
3078 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
3079   echo $ac_n "(cached) $ac_c" 1>&6
3080 else
3081   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3082 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3083   ac_cv_prog_gnu_ld=yes
3084 else
3085   ac_cv_prog_gnu_ld=no
3086 fi
3087 fi
3088
3089 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3090
3091
3092 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3093 echo "configure:3094: checking for BSD-compatible nm" >&5
3094 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
3095   echo $ac_n "(cached) $ac_c" 1>&6
3096 else
3097   if test -n "$NM"; then
3098   # Let the user override the test.
3099   ac_cv_path_NM="$NM"
3100 else
3101   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3102   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3103     test -z "$ac_dir" && ac_dir=.
3104     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3105       # Check to see if the nm accepts a BSD-compat flag.
3106       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3107       #   nm: unknown option "B" ignored
3108       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3109         ac_cv_path_NM="$ac_dir/nm -B"
3110         break
3111       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3112         ac_cv_path_NM="$ac_dir/nm -p"
3113         break
3114       else
3115         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3116         continue # so that we can try to find one that supports BSD flags
3117       fi
3118     fi
3119   done
3120   IFS="$ac_save_ifs"
3121   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3122 fi
3123 fi
3124
3125 NM="$ac_cv_path_NM"
3126 echo "$ac_t""$NM" 1>&6
3127
3128 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3129 echo "configure:3130: checking whether ln -s works" >&5
3130 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
3131   echo $ac_n "(cached) $ac_c" 1>&6
3132 else
3133   rm -f conftestdata
3134 if ln -s X conftestdata 2>/dev/null
3135 then
3136   rm -f conftestdata
3137   ac_cv_prog_LN_S="ln -s"
3138 else
3139   ac_cv_prog_LN_S=ln
3140 fi
3141 fi
3142 LN_S="$ac_cv_prog_LN_S"
3143 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3144   echo "$ac_t""yes" 1>&6
3145 else
3146   echo "$ac_t""no" 1>&6
3147 fi
3148
3149 if test $host != $build; then
3150   ac_tool_prefix=${host_alias}-
3151 else
3152   ac_tool_prefix=
3153 fi
3154
3155
3156 case "$target" in
3157 NONE) lt_target="$host" ;;
3158 *) lt_target="$target" ;;
3159 esac
3160
3161 # Check for any special flags to pass to ltconfig.
3162 libtool_flags="--cache-file=$cache_file"
3163 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3164 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3165 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3166 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3167 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3168 libtool_flags="$libtool_flags --enable-dlopen"
3169 libtool_flags="$libtool_flags --enable-win32-dll"
3170 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3171 if test "${enable_libtool_lock+set}" = set; then
3172   enableval="$enable_libtool_lock"
3173   :
3174 fi
3175
3176 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3177 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3178
3179 # Some flags need to be propagated to the compiler or linker for good
3180 # libtool support.
3181 case "$lt_target" in
3182 *-*-irix6*)
3183   # Find out which ABI we are using.
3184   echo '#line 3185 "configure"' > conftest.$ac_ext
3185   if { (eval echo configure:3186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3186     case "`/usr/bin/file conftest.o`" in
3187     *32-bit*)
3188       LD="${LD-ld} -32"
3189       ;;
3190     *N32*)
3191       LD="${LD-ld} -n32"
3192       ;;
3193     *64-bit*)
3194       LD="${LD-ld} -64"
3195       ;;
3196     esac
3197   fi
3198   rm -rf conftest*
3199   ;;
3200
3201 *-*-sco3.2v5*)
3202   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3203   SAVE_CFLAGS="$CFLAGS"
3204   CFLAGS="$CFLAGS -belf"
3205   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3206 echo "configure:3207: checking whether the C compiler needs -belf" >&5
3207 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
3208   echo $ac_n "(cached) $ac_c" 1>&6
3209 else
3210   cat > conftest.$ac_ext <<EOF
3211 #line 3212 "configure"
3212 #include "confdefs.h"
3213
3214 int main() {
3215
3216 ; return 0; }
3217 EOF
3218 if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3219   rm -rf conftest*
3220   lt_cv_cc_needs_belf=yes
3221 else
3222   echo "configure: failed program was:" >&5
3223   cat conftest.$ac_ext >&5
3224   rm -rf conftest*
3225   lt_cv_cc_needs_belf=no
3226 fi
3227 rm -f conftest*
3228 fi
3229
3230 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3231   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3232     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3233     CFLAGS="$SAVE_CFLAGS"
3234   fi
3235   ;;
3236
3237 *-*-cygwin* | *-*-mingw*)
3238   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3239 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3240 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3241 echo "configure:3242: checking for $ac_word" >&5
3242 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
3243   echo $ac_n "(cached) $ac_c" 1>&6
3244 else
3245   if test -n "$DLLTOOL"; then
3246   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3247 else
3248   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3249   ac_dummy="$PATH"
3250   for ac_dir in $ac_dummy; do
3251     test -z "$ac_dir" && ac_dir=.
3252     if test -f $ac_dir/$ac_word; then
3253       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3254       break
3255     fi
3256   done
3257   IFS="$ac_save_ifs"
3258 fi
3259 fi
3260 DLLTOOL="$ac_cv_prog_DLLTOOL"
3261 if test -n "$DLLTOOL"; then
3262   echo "$ac_t""$DLLTOOL" 1>&6
3263 else
3264   echo "$ac_t""no" 1>&6
3265 fi
3266
3267
3268 if test -z "$ac_cv_prog_DLLTOOL"; then
3269 if test -n "$ac_tool_prefix"; then
3270   # Extract the first word of "dlltool", so it can be a program name with args.
3271 set dummy dlltool; ac_word=$2
3272 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3273 echo "configure:3274: checking for $ac_word" >&5
3274 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
3275   echo $ac_n "(cached) $ac_c" 1>&6
3276 else
3277   if test -n "$DLLTOOL"; then
3278   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3279 else
3280   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3281   ac_dummy="$PATH"
3282   for ac_dir in $ac_dummy; do
3283     test -z "$ac_dir" && ac_dir=.
3284     if test -f $ac_dir/$ac_word; then
3285       ac_cv_prog_DLLTOOL="dlltool"
3286       break
3287     fi
3288   done
3289   IFS="$ac_save_ifs"
3290   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3291 fi
3292 fi
3293 DLLTOOL="$ac_cv_prog_DLLTOOL"
3294 if test -n "$DLLTOOL"; then
3295   echo "$ac_t""$DLLTOOL" 1>&6
3296 else
3297   echo "$ac_t""no" 1>&6
3298 fi
3299
3300 else
3301   DLLTOOL="false"
3302 fi
3303 fi
3304
3305   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3306 set dummy ${ac_tool_prefix}as; ac_word=$2
3307 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3308 echo "configure:3309: checking for $ac_word" >&5
3309 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
3310   echo $ac_n "(cached) $ac_c" 1>&6
3311 else
3312   if test -n "$AS"; then
3313   ac_cv_prog_AS="$AS" # Let the user override the test.
3314 else
3315   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3316   ac_dummy="$PATH"
3317   for ac_dir in $ac_dummy; do
3318     test -z "$ac_dir" && ac_dir=.
3319     if test -f $ac_dir/$ac_word; then
3320       ac_cv_prog_AS="${ac_tool_prefix}as"
3321       break
3322     fi
3323   done
3324   IFS="$ac_save_ifs"
3325 fi
3326 fi
3327 AS="$ac_cv_prog_AS"
3328 if test -n "$AS"; then
3329   echo "$ac_t""$AS" 1>&6
3330 else
3331   echo "$ac_t""no" 1>&6
3332 fi
3333
3334
3335 if test -z "$ac_cv_prog_AS"; then
3336 if test -n "$ac_tool_prefix"; then
3337   # Extract the first word of "as", so it can be a program name with args.
3338 set dummy as; ac_word=$2
3339 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3340 echo "configure:3341: checking for $ac_word" >&5
3341 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
3342   echo $ac_n "(cached) $ac_c" 1>&6
3343 else
3344   if test -n "$AS"; then
3345   ac_cv_prog_AS="$AS" # Let the user override the test.
3346 else
3347   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3348   ac_dummy="$PATH"
3349   for ac_dir in $ac_dummy; do
3350     test -z "$ac_dir" && ac_dir=.
3351     if test -f $ac_dir/$ac_word; then
3352       ac_cv_prog_AS="as"
3353       break
3354     fi
3355   done
3356   IFS="$ac_save_ifs"
3357   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3358 fi
3359 fi
3360 AS="$ac_cv_prog_AS"
3361 if test -n "$AS"; then
3362   echo "$ac_t""$AS" 1>&6
3363 else
3364   echo "$ac_t""no" 1>&6
3365 fi
3366
3367 else
3368   AS="false"
3369 fi
3370 fi
3371
3372   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3373 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3374 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3375 echo "configure:3376: checking for $ac_word" >&5
3376 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
3377   echo $ac_n "(cached) $ac_c" 1>&6
3378 else
3379   if test -n "$OBJDUMP"; then
3380   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3381 else
3382   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3383   ac_dummy="$PATH"
3384   for ac_dir in $ac_dummy; do
3385     test -z "$ac_dir" && ac_dir=.
3386     if test -f $ac_dir/$ac_word; then
3387       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3388       break
3389     fi
3390   done
3391   IFS="$ac_save_ifs"
3392 fi
3393 fi
3394 OBJDUMP="$ac_cv_prog_OBJDUMP"
3395 if test -n "$OBJDUMP"; then
3396   echo "$ac_t""$OBJDUMP" 1>&6
3397 else
3398   echo "$ac_t""no" 1>&6
3399 fi
3400
3401
3402 if test -z "$ac_cv_prog_OBJDUMP"; then
3403 if test -n "$ac_tool_prefix"; then
3404   # Extract the first word of "objdump", so it can be a program name with args.
3405 set dummy objdump; ac_word=$2
3406 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3407 echo "configure:3408: checking for $ac_word" >&5
3408 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
3409   echo $ac_n "(cached) $ac_c" 1>&6
3410 else
3411   if test -n "$OBJDUMP"; then
3412   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3413 else
3414   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3415   ac_dummy="$PATH"
3416   for ac_dir in $ac_dummy; do
3417     test -z "$ac_dir" && ac_dir=.
3418     if test -f $ac_dir/$ac_word; then
3419       ac_cv_prog_OBJDUMP="objdump"
3420       break
3421     fi
3422   done
3423   IFS="$ac_save_ifs"
3424   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3425 fi
3426 fi
3427 OBJDUMP="$ac_cv_prog_OBJDUMP"
3428 if test -n "$OBJDUMP"; then
3429   echo "$ac_t""$OBJDUMP" 1>&6
3430 else
3431   echo "$ac_t""no" 1>&6
3432 fi
3433
3434 else
3435   OBJDUMP="false"
3436 fi
3437 fi
3438
3439   ;;
3440
3441 esac
3442
3443
3444 # Save cache, so that ltconfig can load it
3445
3446
3447 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3448 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3449 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3450 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3451 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3452 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3453 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3454 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3455
3456 # Reload cache, that may have been modified by ltconfig
3457
3458
3459 # This can be used to rebuild libtool when needed
3460 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3461
3462 # Always use our own libtool.
3463 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3464
3465 # Redirect the config.log output again, so that the ltconfig log is not
3466 # clobbered by the next message.
3467 exec 5>>./config.log
3468
3469
3470 for ac_prog in gawk mawk nawk awk
3471 do
3472 # Extract the first word of "$ac_prog", so it can be a program name with args.
3473 set dummy $ac_prog; 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 \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
3477   echo $ac_n "(cached) $ac_c" 1>&6
3478 else
3479   if test -n "$AWK"; then
3480   ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
3488       break
3489     fi
3490   done
3491   IFS="$ac_save_ifs"
3492 fi
3493 fi
3494 AWK="$ac_cv_prog_AWK"
3495 if test -n "$AWK"; then
3496   echo "$ac_t""$AWK" 1>&6
3497 else
3498   echo "$ac_t""no" 1>&6
3499 fi
3500
3501 test -n "$AWK" && break
3502 done
3503
3504 # test for ln hardlink support
3505 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3506 echo "configure:3507: checking whether ln works" >&5
3507 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
3508   echo $ac_n "(cached) $ac_c" 1>&6
3509 else
3510   rm -f conftest.src conftest.dst
3511 echo "conftest" > conftest.src
3512 if ln conftest.src conftest.dst 2>/dev/null
3513 then
3514   ol_cv_prog_LN_H="ln"
3515 else
3516   ol_cv_prog_LN_H="cp"
3517 fi
3518 rm -f conftest.src conftest.dst
3519
3520 fi
3521 LN_H="$ol_cv_prog_LN_H"
3522 if test "$ol_cv_prog_LN_H" = "ln"; then
3523         echo "$ac_t""yes" 1>&6
3524 else
3525         echo "$ac_t""no" 1>&6
3526 fi
3527
3528 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3529 echo "configure:3530: checking whether ln -s works" >&5
3530 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
3531   echo $ac_n "(cached) $ac_c" 1>&6
3532 else
3533   rm -f conftestdata
3534 if ln -s X conftestdata 2>/dev/null
3535 then
3536   rm -f conftestdata
3537   ac_cv_prog_LN_S="ln -s"
3538 else
3539   ac_cv_prog_LN_S=ln
3540 fi
3541 fi
3542 LN_S="$ac_cv_prog_LN_S"
3543 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3544   echo "$ac_t""yes" 1>&6
3545 else
3546   echo "$ac_t""no" 1>&6
3547 fi
3548
3549
3550 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3551         LN_S="$LN_H"
3552 fi
3553
3554 # Extract the first word of "sendmail", so it can be a program name with args.
3555 set dummy sendmail; ac_word=$2
3556 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3557 echo "configure:3558: checking for $ac_word" >&5
3558 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
3559   echo $ac_n "(cached) $ac_c" 1>&6
3560 else
3561   case "$SENDMAIL" in
3562   /*)
3563   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3564   ;;
3565   ?:/*)                  
3566   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3567   ;;
3568   *)
3569   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3570   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3571   for ac_dir in $ac_dummy; do 
3572     test -z "$ac_dir" && ac_dir=.
3573     if test -f $ac_dir/$ac_word; then
3574       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3575       break
3576     fi
3577   done
3578   IFS="$ac_save_ifs"
3579   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3580   ;;
3581 esac
3582 fi
3583 SENDMAIL="$ac_cv_path_SENDMAIL"
3584 if test -n "$SENDMAIL"; then
3585   echo "$ac_t""$SENDMAIL" 1>&6
3586 else
3587   echo "$ac_t""no" 1>&6
3588 fi
3589
3590 # Extract the first word of "vi", so it can be a program name with args.
3591 set dummy vi; ac_word=$2
3592 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3593 echo "configure:3594: checking for $ac_word" >&5
3594 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
3595   echo $ac_n "(cached) $ac_c" 1>&6
3596 else
3597   case "$EDITOR" in
3598   /*)
3599   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3600   ;;
3601   ?:/*)                  
3602   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3603   ;;
3604   *)
3605   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3606   ac_dummy="$PATH:/usr/ucb"
3607   for ac_dir in $ac_dummy; do 
3608     test -z "$ac_dir" && ac_dir=.
3609     if test -f $ac_dir/$ac_word; then
3610       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3611       break
3612     fi
3613   done
3614   IFS="$ac_save_ifs"
3615   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3616   ;;
3617 esac
3618 fi
3619 EDITOR="$ac_cv_path_EDITOR"
3620 if test -n "$EDITOR"; then
3621   echo "$ac_t""$EDITOR" 1>&6
3622 else
3623   echo "$ac_t""no" 1>&6
3624 fi
3625
3626 # Extract the first word of "finger", so it can be a program name with args.
3627 set dummy finger; ac_word=$2
3628 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3629 echo "configure:3630: checking for $ac_word" >&5
3630 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
3631   echo $ac_n "(cached) $ac_c" 1>&6
3632 else
3633   case "$FINGER" in
3634   /*)
3635   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3636   ;;
3637   ?:/*)                  
3638   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3639   ;;
3640   *)
3641   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3642   ac_dummy="$PATH:/usr/ucb"
3643   for ac_dir in $ac_dummy; do 
3644     test -z "$ac_dir" && ac_dir=.
3645     if test -f $ac_dir/$ac_word; then
3646       ac_cv_path_FINGER="$ac_dir/$ac_word"
3647       break
3648     fi
3649   done
3650   IFS="$ac_save_ifs"
3651   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3652   ;;
3653 esac
3654 fi
3655 FINGER="$ac_cv_path_FINGER"
3656 if test -n "$FINGER"; then
3657   echo "$ac_t""$FINGER" 1>&6
3658 else
3659   echo "$ac_t""no" 1>&6
3660 fi
3661
3662
3663 ol_link_perl=no
3664 if test $ol_enable_perl != no ; then
3665         # Extract the first word of "perl", so it can be a program name with args.
3666 set dummy perl; ac_word=$2
3667 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3668 echo "configure:3669: checking for $ac_word" >&5
3669 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
3670   echo $ac_n "(cached) $ac_c" 1>&6
3671 else
3672   case "$PERLBIN" in
3673   /*)
3674   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3675   ;;
3676   ?:/*)                  
3677   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3678   ;;
3679   *)
3680   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3681   ac_dummy="$PATH"
3682   for ac_dir in $ac_dummy; do 
3683     test -z "$ac_dir" && ac_dir=.
3684     if test -f $ac_dir/$ac_word; then
3685       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3686       break
3687     fi
3688   done
3689   IFS="$ac_save_ifs"
3690   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3691   ;;
3692 esac
3693 fi
3694 PERLBIN="$ac_cv_path_PERLBIN"
3695 if test -n "$PERLBIN"; then
3696   echo "$ac_t""$PERLBIN" 1>&6
3697 else
3698   echo "$ac_t""no" 1>&6
3699 fi
3700
3701
3702         if test "no$PERLBIN" = "no" ; then
3703                 if test $ol_enable_perl = yes ; then
3704                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3705                 fi
3706
3707         else
3708                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3709                 if test x"$ol_with_perl_module" = "xstatic" ; then
3710                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3711                 else
3712                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3713                 fi
3714                                 ol_link_perl=yes
3715         fi
3716 fi
3717
3718 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3719 echo "configure:3720: checking how to run the C preprocessor" >&5
3720 # On Suns, sometimes $CPP names a directory.
3721 if test -n "$CPP" && test -d "$CPP"; then
3722   CPP=
3723 fi
3724 if test -z "$CPP"; then
3725 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
3726   echo $ac_n "(cached) $ac_c" 1>&6
3727 else
3728     # This must be in double quotes, not single quotes, because CPP may get
3729   # substituted into the Makefile and "${CC-cc}" will confuse make.
3730   CPP="${CC-cc} -E"
3731   # On the NeXT, cc -E runs the code through the compiler's parser,
3732   # not just through cpp.
3733   cat > conftest.$ac_ext <<EOF
3734 #line 3735 "configure"
3735 #include "confdefs.h"
3736 #include <assert.h>
3737 Syntax Error
3738 EOF
3739 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3740 { (eval echo configure:3741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3741 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3742 if test -z "$ac_err"; then
3743   :
3744 else
3745   echo "$ac_err" >&5
3746   echo "configure: failed program was:" >&5
3747   cat conftest.$ac_ext >&5
3748   rm -rf conftest*
3749   CPP="${CC-cc} -E -traditional-cpp"
3750   cat > conftest.$ac_ext <<EOF
3751 #line 3752 "configure"
3752 #include "confdefs.h"
3753 #include <assert.h>
3754 Syntax Error
3755 EOF
3756 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3757 { (eval echo configure:3758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3758 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3759 if test -z "$ac_err"; then
3760   :
3761 else
3762   echo "$ac_err" >&5
3763   echo "configure: failed program was:" >&5
3764   cat conftest.$ac_ext >&5
3765   rm -rf conftest*
3766   CPP="${CC-cc} -nologo -E"
3767   cat > conftest.$ac_ext <<EOF
3768 #line 3769 "configure"
3769 #include "confdefs.h"
3770 #include <assert.h>
3771 Syntax Error
3772 EOF
3773 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3774 { (eval echo configure:3775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3775 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3776 if test -z "$ac_err"; then
3777   :
3778 else
3779   echo "$ac_err" >&5
3780   echo "configure: failed program was:" >&5
3781   cat conftest.$ac_ext >&5
3782   rm -rf conftest*
3783   CPP=/lib/cpp
3784 fi
3785 rm -f conftest*
3786 fi
3787 rm -f conftest*
3788 fi
3789 rm -f conftest*
3790   ac_cv_prog_CPP="$CPP"
3791 fi
3792   CPP="$ac_cv_prog_CPP"
3793 else
3794   ac_cv_prog_CPP="$CPP"
3795 fi
3796 echo "$ac_t""$CPP" 1>&6
3797
3798
3799 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3800         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3801
3802 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3803         echo "configure: warning: programs compiled here do run here..." 1>&2
3804         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3805
3806 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3807         echo "configure: warning: programs compiled here do not run here..." 1>&2
3808         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3809 fi
3810
3811 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3812 echo "configure:3813: checking for AIX" >&5
3813 cat > conftest.$ac_ext <<EOF
3814 #line 3815 "configure"
3815 #include "confdefs.h"
3816 #ifdef _AIX
3817   yes
3818 #endif
3819
3820 EOF
3821 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3822   egrep "yes" >/dev/null 2>&1; then
3823   rm -rf conftest*
3824   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3825 #define _ALL_SOURCE 1
3826 EOF
3827
3828 else
3829   rm -rf conftest*
3830   echo "$ac_t""no" 1>&6
3831 fi
3832 rm -f conftest*
3833
3834
3835 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3836 echo "configure:3837: checking for POSIXized ISC" >&5
3837 if test -d /etc/conf/kconfig.d &&
3838   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3839 then
3840   echo "$ac_t""yes" 1>&6
3841   ISC=yes # If later tests want to check for ISC.
3842   cat >> confdefs.h <<\EOF
3843 #define _POSIX_SOURCE 1
3844 EOF
3845
3846   if test "$GCC" = yes; then
3847     CC="$CC -posix"
3848   else
3849     CC="$CC -Xp"
3850   fi
3851 else
3852   echo "$ac_t""no" 1>&6
3853   ISC=
3854 fi
3855
3856 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3857 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3858 echo "configure:3859: checking for minix/config.h" >&5
3859 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3860   echo $ac_n "(cached) $ac_c" 1>&6
3861 else
3862   cat > conftest.$ac_ext <<EOF
3863 #line 3864 "configure"
3864 #include "confdefs.h"
3865 #include <minix/config.h>
3866 EOF
3867 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3868 { (eval echo configure:3869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3869 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3870 if test -z "$ac_err"; then
3871   rm -rf conftest*
3872   eval "ac_cv_header_$ac_safe=yes"
3873 else
3874   echo "$ac_err" >&5
3875   echo "configure: failed program was:" >&5
3876   cat conftest.$ac_ext >&5
3877   rm -rf conftest*
3878   eval "ac_cv_header_$ac_safe=no"
3879 fi
3880 rm -f conftest*
3881 fi
3882 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3883   echo "$ac_t""yes" 1>&6
3884   MINIX=yes
3885 else
3886   echo "$ac_t""no" 1>&6
3887 MINIX=
3888 fi
3889
3890 if test "$MINIX" = yes; then
3891   cat >> confdefs.h <<\EOF
3892 #define _POSIX_SOURCE 1
3893 EOF
3894
3895   cat >> confdefs.h <<\EOF
3896 #define _POSIX_1_SOURCE 2
3897 EOF
3898
3899   cat >> confdefs.h <<\EOF
3900 #define _MINIX 1
3901 EOF
3902
3903 fi
3904
3905
3906 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3907 echo "configure:3908: checking for Cygwin environment" >&5
3908 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
3909   echo $ac_n "(cached) $ac_c" 1>&6
3910 else
3911   cat > conftest.$ac_ext <<EOF
3912 #line 3913 "configure"
3913 #include "confdefs.h"
3914
3915 int main() {
3916
3917 #ifndef __CYGWIN__
3918 #define __CYGWIN__ __CYGWIN32__
3919 #endif
3920 return __CYGWIN__;
3921 ; return 0; }
3922 EOF
3923 if { (eval echo configure:3924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3924   rm -rf conftest*
3925   ac_cv_cygwin=yes
3926 else
3927   echo "configure: failed program was:" >&5
3928   cat conftest.$ac_ext >&5
3929   rm -rf conftest*
3930   ac_cv_cygwin=no
3931 fi
3932 rm -f conftest*
3933 rm -f conftest*
3934 fi
3935
3936 echo "$ac_t""$ac_cv_cygwin" 1>&6
3937 CYGWIN=
3938 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3939 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3940 echo "configure:3941: checking for mingw32 environment" >&5
3941 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
3942   echo $ac_n "(cached) $ac_c" 1>&6
3943 else
3944   cat > conftest.$ac_ext <<EOF
3945 #line 3946 "configure"
3946 #include "confdefs.h"
3947
3948 int main() {
3949 return __MINGW32__;
3950 ; return 0; }
3951 EOF
3952 if { (eval echo configure:3953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3953   rm -rf conftest*
3954   ac_cv_mingw32=yes
3955 else
3956   echo "configure: failed program was:" >&5
3957   cat conftest.$ac_ext >&5
3958   rm -rf conftest*
3959   ac_cv_mingw32=no
3960 fi
3961 rm -f conftest*
3962 rm -f conftest*
3963 fi
3964
3965 echo "$ac_t""$ac_cv_mingw32" 1>&6
3966 MINGW32=
3967 test "$ac_cv_mingw32" = yes && MINGW32=yes
3968
3969
3970 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3971 echo "configure:3972: checking for executable suffix" >&5
3972 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
3973   echo $ac_n "(cached) $ac_c" 1>&6
3974 else
3975   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
3976   ac_cv_exeext=.exe
3977 else
3978   rm -f conftest*
3979   echo 'int main () { return 0; }' > conftest.$ac_ext
3980   ac_cv_exeext=
3981   if { (eval echo configure:3982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3982     for file in conftest.*; do
3983       case $file in
3984       *.c | *.o | *.obj) ;;
3985       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3986       esac
3987     done
3988   else
3989     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3990   fi
3991   rm -f conftest*
3992   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3993 fi
3994 fi
3995
3996 EXEEXT=""
3997 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3998 echo "$ac_t""${ac_cv_exeext}" 1>&6
3999 ac_exeext=$EXEEXT
4000
4001 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4002 echo "configure:4003: checking for object suffix" >&5
4003 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
4004   echo $ac_n "(cached) $ac_c" 1>&6
4005 else
4006   rm -f conftest*
4007 echo 'int i = 1;' > conftest.$ac_ext
4008 if { (eval echo configure:4009: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4009   for ac_file in conftest.*; do
4010     case $ac_file in
4011     *.c) ;;
4012     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4013     esac
4014   done
4015 else
4016   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4017 fi
4018 rm -f conftest*
4019 fi
4020
4021 echo "$ac_t""$ac_cv_objext" 1>&6
4022 OBJEXT=$ac_cv_objext
4023 ac_objext=$ac_cv_objext
4024
4025
4026 cat >> confdefs.h <<EOF
4027 #define EXEEXT "${EXEEXT}"
4028 EOF
4029
4030
4031 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4032 echo "configure:4033: checking for be_app in -lbe" >&5
4033 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
4034 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4035   echo $ac_n "(cached) $ac_c" 1>&6
4036 else
4037   ac_save_LIBS="$LIBS"
4038 LIBS="-lbe -lroot -lnet $LIBS"
4039 cat > conftest.$ac_ext <<EOF
4040 #line 4041 "configure"
4041 #include "confdefs.h"
4042 /* Override any gcc2 internal prototype to avoid an error.  */
4043 /* We use char because int might match the return type of a gcc2
4044     builtin and then its argument prototype would still apply.  */
4045 char be_app();
4046
4047 int main() {
4048 be_app()
4049 ; return 0; }
4050 EOF
4051 if { (eval echo configure:4052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4052   rm -rf conftest*
4053   eval "ac_cv_lib_$ac_lib_var=yes"
4054 else
4055   echo "configure: failed program was:" >&5
4056   cat conftest.$ac_ext >&5
4057   rm -rf conftest*
4058   eval "ac_cv_lib_$ac_lib_var=no"
4059 fi
4060 rm -f conftest*
4061 LIBS="$ac_save_LIBS"
4062
4063 fi
4064 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4065   echo "$ac_t""yes" 1>&6
4066   LIBS="$LIBS -lbe -lroot -lnet"
4067 else
4068   echo "$ac_t""no" 1>&6
4069 :
4070 fi
4071
4072
4073
4074
4075
4076 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4077 echo "configure:4078: checking for ${CC-cc} option to accept ANSI C" >&5
4078 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
4079   echo $ac_n "(cached) $ac_c" 1>&6
4080 else
4081   am_cv_prog_cc_stdc=no
4082 ac_save_CC="$CC"
4083 # Don't try gcc -ansi; that turns off useful extensions and
4084 # breaks some systems' header files.
4085 # AIX                   -qlanglvl=ansi
4086 # Ultrix and OSF/1      -std1
4087 # HP-UX 10.20 and later -Ae
4088 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4089 # SVR4                  -Xc -D__EXTENSIONS__
4090 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4091 do
4092   CC="$ac_save_CC $ac_arg"
4093   cat > conftest.$ac_ext <<EOF
4094 #line 4095 "configure"
4095 #include "confdefs.h"
4096 #include <stdarg.h>
4097 #include <stdio.h>
4098 #include <sys/types.h>
4099 #include <sys/stat.h>
4100 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4101 struct buf { int x; };
4102 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4103 static char *e (p, i)
4104      char **p;
4105      int i;
4106 {
4107   return p[i];
4108 }
4109 static char *f (char * (*g) (char **, int), char **p, ...)
4110 {
4111   char *s;
4112   va_list v;
4113   va_start (v,p);
4114   s = g (p, va_arg (v,int));
4115   va_end (v);
4116   return s;
4117 }
4118 int test (int i, double x);
4119 struct s1 {int (*f) (int a);};
4120 struct s2 {int (*f) (double a);};
4121 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4122 int argc;
4123 char **argv;
4124
4125 int main() {
4126
4127 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4128
4129 ; return 0; }
4130 EOF
4131 if { (eval echo configure:4132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4132   rm -rf conftest*
4133   am_cv_prog_cc_stdc="$ac_arg"; break
4134 else
4135   echo "configure: failed program was:" >&5
4136   cat conftest.$ac_ext >&5
4137 fi
4138 rm -f conftest*
4139 done
4140 CC="$ac_save_CC"
4141
4142 fi
4143
4144 if test -z "$am_cv_prog_cc_stdc"; then
4145   echo "$ac_t""none needed" 1>&6
4146 else
4147   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4148 fi
4149 case "x$am_cv_prog_cc_stdc" in
4150   x|xno) ;;
4151   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4152 esac
4153
4154 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4155         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4156 fi
4157
4158 # test for make depend flag
4159 OL_MKDEP=
4160 OL_MKDEP_FLAGS=
4161 if test -z "${MKDEP}"; then
4162         OL_MKDEP="${CC-cc}"
4163         if test -z "${MKDEP_FLAGS}"; then
4164                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4165 echo "configure:4166: checking for ${OL_MKDEP} depend flag" >&5
4166 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
4167   echo $ac_n "(cached) $ac_c" 1>&6
4168 else
4169   
4170                         ol_cv_mkdep=no
4171                         for flag in "-M" "-xM"; do
4172                                 cat > conftest.c <<EOF
4173  noCode;
4174 EOF
4175                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4176                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4177                                 then
4178                                         if test ! -f conftest."${ac_object}" ; then
4179                                                 ol_cv_mkdep=$flag
4180                                                 OL_MKDEP_FLAGS="$flag"
4181                                                 break
4182                                         fi
4183                                 fi
4184                         done
4185                         rm -f conftest*
4186                 
4187 fi
4188
4189 echo "$ac_t""$ol_cv_mkdep" 1>&6
4190         else
4191                 cc_cv_mkdep=yes
4192                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4193         fi
4194 else
4195         cc_cv_mkdep=yes
4196         OL_MKDEP="${MKDEP}"
4197         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4198 fi
4199
4200
4201
4202 if test "${ol_cv_mkdep}" = no ; then
4203         # this will soon become an error
4204         echo "configure: warning: do not know how to generate dependencies" 1>&2
4205 fi
4206
4207 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4208 echo "configure:4209: checking for afopen in -ls" >&5
4209 ac_lib_var=`echo s'_'afopen | sed 'y%./+-%__p_%'`
4210 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4211   echo $ac_n "(cached) $ac_c" 1>&6
4212 else
4213   ac_save_LIBS="$LIBS"
4214 LIBS="-ls  $LIBS"
4215 cat > conftest.$ac_ext <<EOF
4216 #line 4217 "configure"
4217 #include "confdefs.h"
4218 /* Override any gcc2 internal prototype to avoid an error.  */
4219 /* We use char because int might match the return type of a gcc2
4220     builtin and then its argument prototype would still apply.  */
4221 char afopen();
4222
4223 int main() {
4224 afopen()
4225 ; return 0; }
4226 EOF
4227 if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4228   rm -rf conftest*
4229   eval "ac_cv_lib_$ac_lib_var=yes"
4230 else
4231   echo "configure: failed program was:" >&5
4232   cat conftest.$ac_ext >&5
4233   rm -rf conftest*
4234   eval "ac_cv_lib_$ac_lib_var=no"
4235 fi
4236 rm -f conftest*
4237 LIBS="$ac_save_LIBS"
4238
4239 fi
4240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4241   echo "$ac_t""yes" 1>&6
4242   
4243         AUTH_LIBS=-ls
4244         cat >> confdefs.h <<\EOF
4245 #define HAVE_AIX_SECURITY 1
4246 EOF
4247
4248
4249 else
4250   echo "$ac_t""no" 1>&6
4251 fi
4252
4253
4254
4255 ol_link_modules=no
4256 if test $ol_enable_modules != no ; then
4257         for ac_hdr in ltdl.h
4258 do
4259 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4260 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4261 echo "configure:4262: checking for $ac_hdr" >&5
4262 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4263   echo $ac_n "(cached) $ac_c" 1>&6
4264 else
4265   cat > conftest.$ac_ext <<EOF
4266 #line 4267 "configure"
4267 #include "confdefs.h"
4268 #include <$ac_hdr>
4269 EOF
4270 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4271 { (eval echo configure:4272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4272 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4273 if test -z "$ac_err"; then
4274   rm -rf conftest*
4275   eval "ac_cv_header_$ac_safe=yes"
4276 else
4277   echo "$ac_err" >&5
4278   echo "configure: failed program was:" >&5
4279   cat conftest.$ac_ext >&5
4280   rm -rf conftest*
4281   eval "ac_cv_header_$ac_safe=no"
4282 fi
4283 rm -f conftest*
4284 fi
4285 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4286   echo "$ac_t""yes" 1>&6
4287     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4288   cat >> confdefs.h <<EOF
4289 #define $ac_tr_hdr 1
4290 EOF
4291  
4292 else
4293   echo "$ac_t""no" 1>&6
4294 fi
4295 done
4296
4297
4298         if test $ac_cv_header_ltdl_h = no ; then
4299                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4300         fi
4301
4302         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4303 echo "configure:4304: checking for lt_dlinit in -lltdl" >&5
4304 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-%__p_%'`
4305 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4306   echo $ac_n "(cached) $ac_c" 1>&6
4307 else
4308   ac_save_LIBS="$LIBS"
4309 LIBS="-lltdl  $LIBS"
4310 cat > conftest.$ac_ext <<EOF
4311 #line 4312 "configure"
4312 #include "confdefs.h"
4313 /* Override any gcc2 internal prototype to avoid an error.  */
4314 /* We use char because int might match the return type of a gcc2
4315     builtin and then its argument prototype would still apply.  */
4316 char lt_dlinit();
4317
4318 int main() {
4319 lt_dlinit()
4320 ; return 0; }
4321 EOF
4322 if { (eval echo configure:4323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4323   rm -rf conftest*
4324   eval "ac_cv_lib_$ac_lib_var=yes"
4325 else
4326   echo "configure: failed program was:" >&5
4327   cat conftest.$ac_ext >&5
4328   rm -rf conftest*
4329   eval "ac_cv_lib_$ac_lib_var=no"
4330 fi
4331 rm -f conftest*
4332 LIBS="$ac_save_LIBS"
4333
4334 fi
4335 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4336   echo "$ac_t""yes" 1>&6
4337   
4338             MODULES_LIBS=-lltdl
4339             cat >> confdefs.h <<\EOF
4340 #define HAVE_LIBLTDL 1
4341 EOF
4342
4343         
4344 else
4345   echo "$ac_t""no" 1>&6
4346 fi
4347
4348
4349         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4350                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4351         fi
4352         ol_link_modules=yes
4353 else
4354         ol_with_bdb_module=static
4355         ol_with_dnssrv_module=static
4356         ol_with_ldap_module=static
4357         ol_with_ldbm_module=static
4358         ol_with_meta_module=static
4359         ol_with_monitor_module=static
4360         ol_with_passwd_module=static
4361         ol_with_perl_module=static
4362         ol_with_shell_module=static
4363         ol_with_tcl_module=static
4364         ol_with_sql_module=static
4365 fi
4366
4367 # test for EBCDIC
4368 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4369 echo "configure:4370: checking for EBCDIC" >&5
4370 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
4371   echo $ac_n "(cached) $ac_c" 1>&6
4372 else
4373   
4374         cat > conftest.$ac_ext <<EOF
4375 #line 4376 "configure"
4376 #include "confdefs.h"
4377
4378 #if !('M' == 0xd4)
4379 #include <__ASCII__/generate_error.h>
4380 #endif
4381
4382 EOF
4383 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4384 { (eval echo configure:4385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4385 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4386 if test -z "$ac_err"; then
4387   rm -rf conftest*
4388   ol_cv_cpp_ebcdic=yes
4389 else
4390   echo "$ac_err" >&5
4391   echo "configure: failed program was:" >&5
4392   cat conftest.$ac_ext >&5
4393   rm -rf conftest*
4394   ol_cv_cpp_ebcdic=no
4395 fi
4396 rm -f conftest*
4397 fi
4398
4399 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4400 if test $ol_cv_cpp_ebcdic = yes ; then
4401         cat >> confdefs.h <<\EOF
4402 #define HAVE_EBCDIC 1
4403 EOF
4404
4405 fi
4406
4407 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4408 echo "configure:4409: checking for ANSI C header files" >&5
4409 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
4410   echo $ac_n "(cached) $ac_c" 1>&6
4411 else
4412   cat > conftest.$ac_ext <<EOF
4413 #line 4414 "configure"
4414 #include "confdefs.h"
4415 #include <stdlib.h>
4416 #include <stdarg.h>
4417 #include <string.h>
4418 #include <float.h>
4419 EOF
4420 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4421 { (eval echo configure:4422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4422 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4423 if test -z "$ac_err"; then
4424   rm -rf conftest*
4425   ol_cv_header_stdc=yes
4426 else
4427   echo "$ac_err" >&5
4428   echo "configure: failed program was:" >&5
4429   cat conftest.$ac_ext >&5
4430   rm -rf conftest*
4431   ol_cv_header_stdc=no
4432 fi
4433 rm -f conftest*
4434
4435 if test $ol_cv_header_stdc = yes; then
4436   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4437 cat > conftest.$ac_ext <<EOF
4438 #line 4439 "configure"
4439 #include "confdefs.h"
4440 #include <string.h>
4441 EOF
4442 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4443   egrep "memchr" >/dev/null 2>&1; then
4444   :
4445 else
4446   rm -rf conftest*
4447   ol_cv_header_stdc=no
4448 fi
4449 rm -f conftest*
4450
4451 fi
4452
4453 if test $ol_cv_header_stdc = yes; then
4454   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4455 cat > conftest.$ac_ext <<EOF
4456 #line 4457 "configure"
4457 #include "confdefs.h"
4458 #include <stdlib.h>
4459 EOF
4460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4461   egrep "free" >/dev/null 2>&1; then
4462   :
4463 else
4464   rm -rf conftest*
4465   ol_cv_header_stdc=no
4466 fi
4467 rm -f conftest*
4468
4469 fi
4470
4471 if test $ol_cv_header_stdc = yes; then
4472   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4473 if test "$cross_compiling" = yes; then
4474   :
4475 else
4476   cat > conftest.$ac_ext <<EOF
4477 #line 4478 "configure"
4478 #include "confdefs.h"
4479 #include <ctype.h>
4480 #ifndef HAVE_EBCDIC
4481 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4482 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4483 #else
4484 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4485                 || ('j' <= (c) && (c) <= 'r') \
4486                 || ('s' <= (c) && (c) <= 'z'))
4487 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4488 #endif
4489 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4490 int main () { int i; for (i = 0; i < 256; i++)
4491 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4492 exit (0); }
4493
4494 EOF
4495 if { (eval echo configure:4496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4496 then
4497   :
4498 else
4499   echo "configure: failed program was:" >&5
4500   cat conftest.$ac_ext >&5
4501   rm -fr conftest*
4502   ol_cv_header_stdc=no
4503 fi
4504 rm -fr conftest*
4505 fi
4506
4507 fi
4508 fi
4509
4510 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4511 if test $ol_cv_header_stdc = yes; then
4512   cat >> confdefs.h <<\EOF
4513 #define STDC_HEADERS 1
4514 EOF
4515
4516 fi
4517 ac_cv_header_stdc=disable
4518
4519
4520 if test $ol_cv_header_stdc != yes; then
4521         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4522 fi
4523
4524 ac_header_dirent=no
4525 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4526 do
4527 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4528 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4529 echo "configure:4530: checking for $ac_hdr that defines DIR" >&5
4530 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
4531   echo $ac_n "(cached) $ac_c" 1>&6
4532 else
4533   cat > conftest.$ac_ext <<EOF
4534 #line 4535 "configure"
4535 #include "confdefs.h"
4536 #include <sys/types.h>
4537 #include <$ac_hdr>
4538 int main() {
4539 DIR *dirp = 0;
4540 ; return 0; }
4541 EOF
4542 if { (eval echo configure:4543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4543   rm -rf conftest*
4544   eval "ac_cv_header_dirent_$ac_safe=yes"
4545 else
4546   echo "configure: failed program was:" >&5
4547   cat conftest.$ac_ext >&5
4548   rm -rf conftest*
4549   eval "ac_cv_header_dirent_$ac_safe=no"
4550 fi
4551 rm -f conftest*
4552 fi
4553 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4554   echo "$ac_t""yes" 1>&6
4555     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4556   cat >> confdefs.h <<EOF
4557 #define $ac_tr_hdr 1
4558 EOF
4559  ac_header_dirent=$ac_hdr; break
4560 else
4561   echo "$ac_t""no" 1>&6
4562 fi
4563 done
4564 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4565 if test $ac_header_dirent = dirent.h; then
4566 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4567 echo "configure:4568: checking for opendir in -ldir" >&5
4568 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
4569 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4570   echo $ac_n "(cached) $ac_c" 1>&6
4571 else
4572   ac_save_LIBS="$LIBS"
4573 LIBS="-ldir  $LIBS"
4574 cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 /* Override any gcc2 internal prototype to avoid an error.  */
4578 /* We use char because int might match the return type of a gcc2
4579     builtin and then its argument prototype would still apply.  */
4580 char opendir();
4581
4582 int main() {
4583 opendir()
4584 ; return 0; }
4585 EOF
4586 if { (eval echo configure:4587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4587   rm -rf conftest*
4588   eval "ac_cv_lib_$ac_lib_var=yes"
4589 else
4590   echo "configure: failed program was:" >&5
4591   cat conftest.$ac_ext >&5
4592   rm -rf conftest*
4593   eval "ac_cv_lib_$ac_lib_var=no"
4594 fi
4595 rm -f conftest*
4596 LIBS="$ac_save_LIBS"
4597
4598 fi
4599 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4600   echo "$ac_t""yes" 1>&6
4601   LIBS="$LIBS -ldir"
4602 else
4603   echo "$ac_t""no" 1>&6
4604 fi
4605
4606 else
4607 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4608 echo "configure:4609: checking for opendir in -lx" >&5
4609 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
4610 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4611   echo $ac_n "(cached) $ac_c" 1>&6
4612 else
4613   ac_save_LIBS="$LIBS"
4614 LIBS="-lx  $LIBS"
4615 cat > conftest.$ac_ext <<EOF
4616 #line 4617 "configure"
4617 #include "confdefs.h"
4618 /* Override any gcc2 internal prototype to avoid an error.  */
4619 /* We use char because int might match the return type of a gcc2
4620     builtin and then its argument prototype would still apply.  */
4621 char opendir();
4622
4623 int main() {
4624 opendir()
4625 ; return 0; }
4626 EOF
4627 if { (eval echo configure:4628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4628   rm -rf conftest*
4629   eval "ac_cv_lib_$ac_lib_var=yes"
4630 else
4631   echo "configure: failed program was:" >&5
4632   cat conftest.$ac_ext >&5
4633   rm -rf conftest*
4634   eval "ac_cv_lib_$ac_lib_var=no"
4635 fi
4636 rm -f conftest*
4637 LIBS="$ac_save_LIBS"
4638
4639 fi
4640 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4641   echo "$ac_t""yes" 1>&6
4642   LIBS="$LIBS -lx"
4643 else
4644   echo "$ac_t""no" 1>&6
4645 fi
4646
4647 fi
4648
4649 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4650 echo "configure:4651: checking for sys/wait.h that is POSIX.1 compatible" >&5
4651 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
4652   echo $ac_n "(cached) $ac_c" 1>&6
4653 else
4654   cat > conftest.$ac_ext <<EOF
4655 #line 4656 "configure"
4656 #include "confdefs.h"
4657 #include <sys/types.h>
4658 #include <sys/wait.h>
4659 #ifndef WEXITSTATUS
4660 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4661 #endif
4662 #ifndef WIFEXITED
4663 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4664 #endif
4665 int main() {
4666 int s;
4667 wait (&s);
4668 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4669 ; return 0; }
4670 EOF
4671 if { (eval echo configure:4672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4672   rm -rf conftest*
4673   ac_cv_header_sys_wait_h=yes
4674 else
4675   echo "configure: failed program was:" >&5
4676   cat conftest.$ac_ext >&5
4677   rm -rf conftest*
4678   ac_cv_header_sys_wait_h=no
4679 fi
4680 rm -f conftest*
4681 fi
4682
4683 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4684 if test $ac_cv_header_sys_wait_h = yes; then
4685   cat >> confdefs.h <<\EOF
4686 #define HAVE_SYS_WAIT_H 1
4687 EOF
4688
4689 fi
4690
4691 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4692 echo "configure:4693: checking POSIX termios" >&5
4693 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
4694   echo $ac_n "(cached) $ac_c" 1>&6
4695 else
4696   cat > conftest.$ac_ext <<EOF
4697 #line 4698 "configure"
4698 #include "confdefs.h"
4699 #include <sys/types.h>
4700 #include <unistd.h>
4701 #include <termios.h>
4702 int main() {
4703 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4704    tcgetattr(0, 0);
4705 ; return 0; }
4706 EOF
4707 if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4708   rm -rf conftest*
4709   am_cv_sys_posix_termios=yes
4710 else
4711   echo "configure: failed program was:" >&5
4712   cat conftest.$ac_ext >&5
4713   rm -rf conftest*
4714   am_cv_sys_posix_termios=no
4715 fi
4716 rm -f conftest*
4717 fi
4718
4719 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4720
4721
4722  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4723 echo "configure:4724: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4724 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
4725   echo $ac_n "(cached) $ac_c" 1>&6
4726 else
4727   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4728
4729   gwinsz_in_termios_h=no
4730   if test $am_cv_sys_posix_termios = yes; then
4731     cat > conftest.$ac_ext <<EOF
4732 #line 4733 "configure"
4733 #include "confdefs.h"
4734 #include <sys/types.h>
4735 #     include <termios.h>
4736 #     ifdef TIOCGWINSZ
4737         yes
4738 #     endif
4739     
4740 EOF
4741 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4742   egrep "yes" >/dev/null 2>&1; then
4743   rm -rf conftest*
4744   gwinsz_in_termios_h=yes
4745 fi
4746 rm -f conftest*
4747
4748   fi
4749
4750   if test $gwinsz_in_termios_h = no; then
4751     cat > conftest.$ac_ext <<EOF
4752 #line 4753 "configure"
4753 #include "confdefs.h"
4754 #include <sys/types.h>
4755 #     include <sys/ioctl.h>
4756 #     ifdef TIOCGWINSZ
4757         yes
4758 #     endif
4759     
4760 EOF
4761 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4762   egrep "yes" >/dev/null 2>&1; then
4763   rm -rf conftest*
4764   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4765 fi
4766 rm -f conftest*
4767
4768   fi
4769   
4770 fi
4771
4772 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4773   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4774     cat >> confdefs.h <<\EOF
4775 #define GWINSZ_IN_SYS_IOCTL 1
4776 EOF
4777
4778   fi
4779
4780 if test $am_cv_sys_posix_termios = yes ; then
4781         cat >> confdefs.h <<\EOF
4782 #define HAVE_POSIX_TERMIOS 1
4783 EOF
4784
4785 fi
4786
4787 for ac_hdr in \
4788         arpa/inet.h             \
4789         arpa/nameser.h  \
4790         assert.h                \
4791         conio.h                 \
4792         crypt.h                 \
4793         direct.h                \
4794         errno.h                 \
4795         fcntl.h                 \
4796         filio.h                 \
4797         getopt.h                \
4798         grp.h                   \
4799         io.h                    \
4800         libutil.h               \
4801         limits.h                \
4802         locale.h                \
4803         netinet/tcp.h   \
4804         malloc.h                \
4805         memory.h                \
4806         psap.h                  \
4807         pwd.h                   \
4808         process.h               \
4809         resolv.h                \
4810         sgtty.h                 \
4811         shadow.h                \
4812         stddef.h                \
4813         string.h                \
4814         strings.h               \
4815         sysexits.h              \
4816         sys/file.h              \
4817         sys/filio.h             \
4818         sys/errno.h             \
4819         sys/ioctl.h             \
4820         sys/param.h             \
4821         sys/resource.h  \
4822         sys/select.h    \
4823         sys/socket.h    \
4824         sys/syslog.h    \
4825         sys/time.h              \
4826         sys/types.h             \
4827         syslog.h                \
4828         termios.h               \
4829         unistd.h                \
4830         winsock.h               \
4831
4832 do
4833 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4834 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4835 echo "configure:4836: checking for $ac_hdr" >&5
4836 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4837   echo $ac_n "(cached) $ac_c" 1>&6
4838 else
4839   cat > conftest.$ac_ext <<EOF
4840 #line 4841 "configure"
4841 #include "confdefs.h"
4842 #include <$ac_hdr>
4843 EOF
4844 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4845 { (eval echo configure:4846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4846 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4847 if test -z "$ac_err"; then
4848   rm -rf conftest*
4849   eval "ac_cv_header_$ac_safe=yes"
4850 else
4851   echo "$ac_err" >&5
4852   echo "configure: failed program was:" >&5
4853   cat conftest.$ac_ext >&5
4854   rm -rf conftest*
4855   eval "ac_cv_header_$ac_safe=no"
4856 fi
4857 rm -f conftest*
4858 fi
4859 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4860   echo "$ac_t""yes" 1>&6
4861     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4862   cat >> confdefs.h <<EOF
4863 #define $ac_tr_hdr 1
4864 EOF
4865  
4866 else
4867   echo "$ac_t""no" 1>&6
4868 fi
4869 done
4870
4871
4872
4873
4874 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4875 echo "configure:4876: checking for dlopen" >&5
4876 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
4877   echo $ac_n "(cached) $ac_c" 1>&6
4878 else
4879   cat > conftest.$ac_ext <<EOF
4880 #line 4881 "configure"
4881 #include "confdefs.h"
4882 /* System header to define __stub macros and hopefully few prototypes,
4883     which can conflict with char dlopen(); below.  */
4884 #include <assert.h>
4885 /* Override any gcc2 internal prototype to avoid an error.  */
4886 /* We use char because int might match the return type of a gcc2
4887     builtin and then its argument prototype would still apply.  */
4888 char dlopen();
4889
4890 int main() {
4891
4892 /* The GNU C library defines this for functions which it implements
4893     to always fail with ENOSYS.  Some functions are actually named
4894     something starting with __ and the normal name is an alias.  */
4895 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4896 choke me
4897 #else
4898 dlopen();
4899 #endif
4900
4901 ; return 0; }
4902 EOF
4903 if { (eval echo configure:4904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4904   rm -rf conftest*
4905   eval "ac_cv_func_dlopen=yes"
4906 else
4907   echo "configure: failed program was:" >&5
4908   cat conftest.$ac_ext >&5
4909   rm -rf conftest*
4910   eval "ac_cv_func_dlopen=no"
4911 fi
4912 rm -f conftest*
4913 fi
4914
4915 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4916   echo "$ac_t""yes" 1>&6
4917   :
4918 else
4919   echo "$ac_t""no" 1>&6
4920 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4921 echo "configure:4922: checking for dlopen in -ldl" >&5
4922 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
4923 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4924   echo $ac_n "(cached) $ac_c" 1>&6
4925 else
4926   ac_save_LIBS="$LIBS"
4927 LIBS="-ldl  $LIBS"
4928 cat > conftest.$ac_ext <<EOF
4929 #line 4930 "configure"
4930 #include "confdefs.h"
4931 /* Override any gcc2 internal prototype to avoid an error.  */
4932 /* We use char because int might match the return type of a gcc2
4933     builtin and then its argument prototype would still apply.  */
4934 char dlopen();
4935
4936 int main() {
4937 dlopen()
4938 ; return 0; }
4939 EOF
4940 if { (eval echo configure:4941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4941   rm -rf conftest*
4942   eval "ac_cv_lib_$ac_lib_var=yes"
4943 else
4944   echo "configure: failed program was:" >&5
4945   cat conftest.$ac_ext >&5
4946   rm -rf conftest*
4947   eval "ac_cv_lib_$ac_lib_var=no"
4948 fi
4949 rm -f conftest*
4950 LIBS="$ac_save_LIBS"
4951
4952 fi
4953 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4954   echo "$ac_t""yes" 1>&6
4955     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4956     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4957   cat >> confdefs.h <<EOF
4958 #define $ac_tr_lib 1
4959 EOF
4960
4961   LIBS="-ldl $LIBS"
4962
4963 else
4964   echo "$ac_t""no" 1>&6
4965 fi
4966
4967 fi
4968
4969
4970 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4971 echo "configure:4972: checking for sigset in -lV3" >&5
4972 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
4973 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4974   echo $ac_n "(cached) $ac_c" 1>&6
4975 else
4976   ac_save_LIBS="$LIBS"
4977 LIBS="-lV3  $LIBS"
4978 cat > conftest.$ac_ext <<EOF
4979 #line 4980 "configure"
4980 #include "confdefs.h"
4981 /* Override any gcc2 internal prototype to avoid an error.  */
4982 /* We use char because int might match the return type of a gcc2
4983     builtin and then its argument prototype would still apply.  */
4984 char sigset();
4985
4986 int main() {
4987 sigset()
4988 ; return 0; }
4989 EOF
4990 if { (eval echo configure:4991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4991   rm -rf conftest*
4992   eval "ac_cv_lib_$ac_lib_var=yes"
4993 else
4994   echo "configure: failed program was:" >&5
4995   cat conftest.$ac_ext >&5
4996   rm -rf conftest*
4997   eval "ac_cv_lib_$ac_lib_var=no"
4998 fi
4999 rm -f conftest*
5000 LIBS="$ac_save_LIBS"
5001
5002 fi
5003 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5004   echo "$ac_t""yes" 1>&6
5005     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5006     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5007   cat >> confdefs.h <<EOF
5008 #define $ac_tr_lib 1
5009 EOF
5010
5011   LIBS="-lV3 $LIBS"
5012
5013 else
5014   echo "$ac_t""no" 1>&6
5015 fi
5016
5017
5018 if test $ac_cv_header_winsock_h = yes; then
5019         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5020 echo "configure:5021: checking for winsock" >&5
5021 if eval "test \"`echo '$''{'ol_cv_winsock'+set}'`\" = set"; then
5022   echo $ac_n "(cached) $ac_c" 1>&6
5023 else
5024   cat > conftest.$ac_ext <<EOF
5025 #line 5026 "configure"
5026 #include "confdefs.h"
5027 #include <winsock.h>
5028 int main() {
5029
5030                         socket(0,0,0);
5031                         select(0,NULL,NULL,NULL,NULL);
5032                         closesocket(0);
5033                         gethostname(NULL,0);
5034         
5035 ; return 0; }
5036 EOF
5037 if { (eval echo configure:5038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5038   rm -rf conftest*
5039   ol_cv_winsock=yes
5040 else
5041   echo "configure: failed program was:" >&5
5042   cat conftest.$ac_ext >&5
5043   rm -rf conftest*
5044   ol_cv_winsock=no
5045 fi
5046 rm -f conftest*]
5047 fi
5048
5049 echo "$ac_t""$ol_cv_winsock" 1>&6
5050
5051         if test $ol_cv_winsock = yes ; then
5052                 cat >> confdefs.h <<\EOF
5053 #define HAVE_WINSOCK 1
5054 EOF
5055
5056                 ac_cv_func_socket=yes
5057                 ac_cv_func_select=yes
5058                 ac_cv_func_closesocket=yes
5059                 ac_cv_func_gethostname=yes
5060         fi
5061 fi
5062
5063
5064 echo $ac_n "checking for socket""... $ac_c" 1>&6
5065 echo "configure:5066: checking for socket" >&5
5066 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
5067   echo $ac_n "(cached) $ac_c" 1>&6
5068 else
5069   cat > conftest.$ac_ext <<EOF
5070 #line 5071 "configure"
5071 #include "confdefs.h"
5072 /* System header to define __stub macros and hopefully few prototypes,
5073     which can conflict with char socket(); below.  */
5074 #include <assert.h>
5075 /* Override any gcc2 internal prototype to avoid an error.  */
5076 /* We use char because int might match the return type of a gcc2
5077     builtin and then its argument prototype would still apply.  */
5078 char socket();
5079
5080 int main() {
5081
5082 /* The GNU C library defines this for functions which it implements
5083     to always fail with ENOSYS.  Some functions are actually named
5084     something starting with __ and the normal name is an alias.  */
5085 #if defined (__stub_socket) || defined (__stub___socket)
5086 choke me
5087 #else
5088 socket();
5089 #endif
5090
5091 ; return 0; }
5092 EOF
5093 if { (eval echo configure:5094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5094   rm -rf conftest*
5095   eval "ac_cv_func_socket=yes"
5096 else
5097   echo "configure: failed program was:" >&5
5098   cat conftest.$ac_ext >&5
5099   rm -rf conftest*
5100   eval "ac_cv_func_socket=no"
5101 fi
5102 rm -f conftest*
5103 fi
5104
5105 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5106   echo "$ac_t""yes" 1>&6
5107   :
5108 else
5109   echo "$ac_t""no" 1>&6
5110         
5111         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5112 echo "configure:5113: checking for main in -lsocket" >&5
5113 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
5114 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5115   echo $ac_n "(cached) $ac_c" 1>&6
5116 else
5117   ac_save_LIBS="$LIBS"
5118 LIBS="-lsocket  $LIBS"
5119 cat > conftest.$ac_ext <<EOF
5120 #line 5121 "configure"
5121 #include "confdefs.h"
5122
5123 int main() {
5124 main()
5125 ; return 0; }
5126 EOF
5127 if { (eval echo configure:5128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5128   rm -rf conftest*
5129   eval "ac_cv_lib_$ac_lib_var=yes"
5130 else
5131   echo "configure: failed program was:" >&5
5132   cat conftest.$ac_ext >&5
5133   rm -rf conftest*
5134   eval "ac_cv_lib_$ac_lib_var=no"
5135 fi
5136 rm -f conftest*
5137 LIBS="$ac_save_LIBS"
5138
5139 fi
5140 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5141   echo "$ac_t""yes" 1>&6
5142     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5143     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5144   cat >> confdefs.h <<EOF
5145 #define $ac_tr_lib 1
5146 EOF
5147
5148   LIBS="-lsocket $LIBS"
5149
5150 else
5151   echo "$ac_t""no" 1>&6
5152 fi
5153
5154         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5155 echo "configure:5156: checking for main in -lnet" >&5
5156 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
5157 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5158   echo $ac_n "(cached) $ac_c" 1>&6
5159 else
5160   ac_save_LIBS="$LIBS"
5161 LIBS="-lnet  $LIBS"
5162 cat > conftest.$ac_ext <<EOF
5163 #line 5164 "configure"
5164 #include "confdefs.h"
5165
5166 int main() {
5167 main()
5168 ; return 0; }
5169 EOF
5170 if { (eval echo configure:5171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5171   rm -rf conftest*
5172   eval "ac_cv_lib_$ac_lib_var=yes"
5173 else
5174   echo "configure: failed program was:" >&5
5175   cat conftest.$ac_ext >&5
5176   rm -rf conftest*
5177   eval "ac_cv_lib_$ac_lib_var=no"
5178 fi
5179 rm -f conftest*
5180 LIBS="$ac_save_LIBS"
5181
5182 fi
5183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5184   echo "$ac_t""yes" 1>&6
5185     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5186     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5187   cat >> confdefs.h <<EOF
5188 #define $ac_tr_lib 1
5189 EOF
5190
5191   LIBS="-lnet $LIBS"
5192
5193 else
5194   echo "$ac_t""no" 1>&6
5195 fi
5196
5197         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5198 echo "configure:5199: checking for main in -lnsl_s" >&5
5199 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
5200 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5201   echo $ac_n "(cached) $ac_c" 1>&6
5202 else
5203   ac_save_LIBS="$LIBS"
5204 LIBS="-lnsl_s  $LIBS"
5205 cat > conftest.$ac_ext <<EOF
5206 #line 5207 "configure"
5207 #include "confdefs.h"
5208
5209 int main() {
5210 main()
5211 ; return 0; }
5212 EOF
5213 if { (eval echo configure:5214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5214   rm -rf conftest*
5215   eval "ac_cv_lib_$ac_lib_var=yes"
5216 else
5217   echo "configure: failed program was:" >&5
5218   cat conftest.$ac_ext >&5
5219   rm -rf conftest*
5220   eval "ac_cv_lib_$ac_lib_var=no"
5221 fi
5222 rm -f conftest*
5223 LIBS="$ac_save_LIBS"
5224
5225 fi
5226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5227   echo "$ac_t""yes" 1>&6
5228     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5229     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5230   cat >> confdefs.h <<EOF
5231 #define $ac_tr_lib 1
5232 EOF
5233
5234   LIBS="-lnsl_s $LIBS"
5235
5236 else
5237   echo "$ac_t""no" 1>&6
5238 fi
5239
5240         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5241 echo "configure:5242: checking for main in -lnsl" >&5
5242 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
5243 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5244   echo $ac_n "(cached) $ac_c" 1>&6
5245 else
5246   ac_save_LIBS="$LIBS"
5247 LIBS="-lnsl  $LIBS"
5248 cat > conftest.$ac_ext <<EOF
5249 #line 5250 "configure"
5250 #include "confdefs.h"
5251
5252 int main() {
5253 main()
5254 ; return 0; }
5255 EOF
5256 if { (eval echo configure:5257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5257   rm -rf conftest*
5258   eval "ac_cv_lib_$ac_lib_var=yes"
5259 else
5260   echo "configure: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   rm -rf conftest*
5263   eval "ac_cv_lib_$ac_lib_var=no"
5264 fi
5265 rm -f conftest*
5266 LIBS="$ac_save_LIBS"
5267
5268 fi
5269 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5270   echo "$ac_t""yes" 1>&6
5271     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5272     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5273   cat >> confdefs.h <<EOF
5274 #define $ac_tr_lib 1
5275 EOF
5276
5277   LIBS="-lnsl $LIBS"
5278
5279 else
5280   echo "$ac_t""no" 1>&6
5281 fi
5282
5283         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5284 echo "configure:5285: checking for socket in -linet" >&5
5285 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
5286 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5287   echo $ac_n "(cached) $ac_c" 1>&6
5288 else
5289   ac_save_LIBS="$LIBS"
5290 LIBS="-linet  $LIBS"
5291 cat > conftest.$ac_ext <<EOF
5292 #line 5293 "configure"
5293 #include "confdefs.h"
5294 /* Override any gcc2 internal prototype to avoid an error.  */
5295 /* We use char because int might match the return type of a gcc2
5296     builtin and then its argument prototype would still apply.  */
5297 char socket();
5298
5299 int main() {
5300 socket()
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 inet | 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="-linet $LIBS"
5325
5326 else
5327   echo "$ac_t""no" 1>&6
5328 fi
5329
5330         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5331 echo "configure:5332: checking for main in -lgen" >&5
5332 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
5333 if eval "test \"`echo '$''{'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="-lgen  $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 gen | 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="-lgen $LIBS"
5368
5369 else
5370   echo "$ac_t""no" 1>&6
5371 fi
5372
5373
5374 fi
5375
5376
5377 echo $ac_n "checking for select""... $ac_c" 1>&6
5378 echo "configure:5379: checking for select" >&5
5379 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
5380   echo $ac_n "(cached) $ac_c" 1>&6
5381 else
5382   cat > conftest.$ac_ext <<EOF
5383 #line 5384 "configure"
5384 #include "confdefs.h"
5385 /* System header to define __stub macros and hopefully few prototypes,
5386     which can conflict with char select(); below.  */
5387 #include <assert.h>
5388 /* Override any gcc2 internal prototype to avoid an error.  */
5389 /* We use char because int might match the return type of a gcc2
5390     builtin and then its argument prototype would still apply.  */
5391 char select();
5392
5393 int main() {
5394
5395 /* The GNU C library defines this for functions which it implements
5396     to always fail with ENOSYS.  Some functions are actually named
5397     something starting with __ and the normal name is an alias.  */
5398 #if defined (__stub_select) || defined (__stub___select)
5399 choke me
5400 #else
5401 select();
5402 #endif
5403
5404 ; return 0; }
5405 EOF
5406 if { (eval echo configure:5407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5407   rm -rf conftest*
5408   eval "ac_cv_func_select=yes"
5409 else
5410   echo "configure: failed program was:" >&5
5411   cat conftest.$ac_ext >&5
5412   rm -rf conftest*
5413   eval "ac_cv_func_select=no"
5414 fi
5415 rm -f conftest*
5416 fi
5417
5418 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5419   echo "$ac_t""yes" 1>&6
5420   :
5421 else
5422   echo "$ac_t""no" 1>&6
5423 { echo "configure: error: select() required." 1>&2; exit 1; }
5424 fi
5425
5426
5427 if test "${ac_cv_header_winsock_h}" != yes; then
5428                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5429 echo "configure:5430: checking types of arguments for select()" >&5
5430  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
5431   echo $ac_n "(cached) $ac_c" 1>&6
5432 else
5433    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
5434   echo $ac_n "(cached) $ac_c" 1>&6
5435 else
5436     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
5437   echo $ac_n "(cached) $ac_c" 1>&6
5438 else
5439      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5440      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5441       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5442        cat > conftest.$ac_ext <<EOF
5443 #line 5444 "configure"
5444 #include "confdefs.h"
5445 #ifdef HAVE_SYS_TYPES_H
5446 #include <sys/types.h>
5447 #endif
5448 #ifdef HAVE_SYS_TIME_H
5449 #include <sys/time.h>
5450 #endif
5451 #ifdef HAVE_SYS_SELECT_H
5452 #include <sys/select.h>
5453 #endif
5454 #ifdef HAVE_SYS_SOCKET_H
5455 #include <sys/socket.h>
5456 #endif
5457 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);
5458 int main() {
5459
5460 ; return 0; }
5461 EOF
5462 if { (eval echo configure:5463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5463   rm -rf conftest*
5464           ac_not_found=no ; break 3
5465 else
5466   echo "configure: failed program was:" >&5
5467   cat conftest.$ac_ext >&5
5468   rm -rf conftest*
5469   ac_not_found=yes
5470 fi
5471 rm -f conftest*
5472       done
5473      done
5474     done
5475    
5476 fi
5477   
5478 fi
5479  
5480 fi
5481  if test "$ac_not_found" = yes; then
5482   ac_cv_func_select_arg1=int 
5483   ac_cv_func_select_arg234='int *' 
5484   ac_cv_func_select_arg5='struct timeval *'
5485  fi
5486  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5487  cat >> confdefs.h <<EOF
5488 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5489 EOF
5490
5491  cat >> confdefs.h <<EOF
5492 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5493 EOF
5494
5495  cat >> confdefs.h <<EOF
5496 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5497 EOF
5498
5499
5500 fi
5501
5502
5503 for ac_hdr in regex.h 
5504 do
5505 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5506 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5507 echo "configure:5508: checking for $ac_hdr" >&5
5508 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5509   echo $ac_n "(cached) $ac_c" 1>&6
5510 else
5511   cat > conftest.$ac_ext <<EOF
5512 #line 5513 "configure"
5513 #include "confdefs.h"
5514 #include <$ac_hdr>
5515 EOF
5516 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5517 { (eval echo configure:5518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5518 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5519 if test -z "$ac_err"; then
5520   rm -rf conftest*
5521   eval "ac_cv_header_$ac_safe=yes"
5522 else
5523   echo "$ac_err" >&5
5524   echo "configure: failed program was:" >&5
5525   cat conftest.$ac_ext >&5
5526   rm -rf conftest*
5527   eval "ac_cv_header_$ac_safe=no"
5528 fi
5529 rm -f conftest*
5530 fi
5531 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5532   echo "$ac_t""yes" 1>&6
5533     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5534   cat >> confdefs.h <<EOF
5535 #define $ac_tr_hdr 1
5536 EOF
5537  
5538 else
5539   echo "$ac_t""no" 1>&6
5540 fi
5541 done
5542
5543 if test "$ac_cv_header_regex_h" != yes ; then
5544         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5545 fi
5546 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5547 echo "configure:5548: checking for regfree" >&5
5548 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
5549   echo $ac_n "(cached) $ac_c" 1>&6
5550 else
5551   cat > conftest.$ac_ext <<EOF
5552 #line 5553 "configure"
5553 #include "confdefs.h"
5554 /* System header to define __stub macros and hopefully few prototypes,
5555     which can conflict with char regfree(); below.  */
5556 #include <assert.h>
5557 /* Override any gcc2 internal prototype to avoid an error.  */
5558 /* We use char because int might match the return type of a gcc2
5559     builtin and then its argument prototype would still apply.  */
5560 char regfree();
5561
5562 int main() {
5563
5564 /* The GNU C library defines this for functions which it implements
5565     to always fail with ENOSYS.  Some functions are actually named
5566     something starting with __ and the normal name is an alias.  */
5567 #if defined (__stub_regfree) || defined (__stub___regfree)
5568 choke me
5569 #else
5570 regfree();
5571 #endif
5572
5573 ; return 0; }
5574 EOF
5575 if { (eval echo configure:5576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5576   rm -rf conftest*
5577   eval "ac_cv_func_regfree=yes"
5578 else
5579   echo "configure: failed program was:" >&5
5580   cat conftest.$ac_ext >&5
5581   rm -rf conftest*
5582   eval "ac_cv_func_regfree=no"
5583 fi
5584 rm -f conftest*
5585 fi
5586
5587 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5588   echo "$ac_t""yes" 1>&6
5589   :
5590 else
5591   echo "$ac_t""no" 1>&6
5592 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5593 fi
5594
5595
5596
5597 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5598 echo "configure:5599: checking for compatible POSIX regex" >&5
5599 if eval "test \"`echo '$''{'ol_cv_c_posix_regex'+set}'`\" = set"; then
5600   echo $ac_n "(cached) $ac_c" 1>&6
5601 else
5602   
5603         if test "$cross_compiling" = yes; then
5604   ol_cv_c_posix_regex=cross
5605 else
5606   cat > conftest.$ac_ext <<EOF
5607 #line 5608 "configure"
5608 #include "confdefs.h"
5609
5610 #include <sys/types.h>
5611 #include <regex.h>
5612 static char *pattern, *string;
5613 main()
5614 {
5615         int rc;
5616         regex_t re;
5617
5618         pattern = "^A";
5619
5620         if(regcomp(&re, pattern, 0)) {
5621                 return -1;
5622         }
5623         
5624         string = "ALL MATCH";
5625         
5626         rc = regexec(&re, string, 0, (void*)0, 0);
5627
5628         regfree(&re);
5629
5630         return rc;
5631 }
5632 EOF
5633 if { (eval echo configure:5634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5634 then
5635   ol_cv_c_posix_regex=yes
5636 else
5637   echo "configure: failed program was:" >&5
5638   cat conftest.$ac_ext >&5
5639   rm -fr conftest*
5640   ol_cv_c_posix_regex=no
5641 fi
5642 rm -fr conftest*
5643 fi
5644
5645 fi
5646
5647 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5648
5649 if test "$ol_cv_c_posix_regex" = no ; then
5650         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5651 fi
5652
5653 ol_link_dnssrv=no
5654 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5655 echo "configure:5656: checking for res_query" >&5
5656 if eval "test \"`echo '$''{'ac_cv_func_res_query'+set}'`\" = set"; then
5657   echo $ac_n "(cached) $ac_c" 1>&6
5658 else
5659   cat > conftest.$ac_ext <<EOF
5660 #line 5661 "configure"
5661 #include "confdefs.h"
5662 /* System header to define __stub macros and hopefully few prototypes,
5663     which can conflict with char res_query(); below.  */
5664 #include <assert.h>
5665 /* Override any gcc2 internal prototype to avoid an error.  */
5666 /* We use char because int might match the return type of a gcc2
5667     builtin and then its argument prototype would still apply.  */
5668 char res_query();
5669
5670 int main() {
5671
5672 /* The GNU C library defines this for functions which it implements
5673     to always fail with ENOSYS.  Some functions are actually named
5674     something starting with __ and the normal name is an alias.  */
5675 #if defined (__stub_res_query) || defined (__stub___res_query)
5676 choke me
5677 #else
5678 res_query();
5679 #endif
5680
5681 ; return 0; }
5682 EOF
5683 if { (eval echo configure:5684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5684   rm -rf conftest*
5685   eval "ac_cv_func_res_query=yes"
5686 else
5687   echo "configure: failed program was:" >&5
5688   cat conftest.$ac_ext >&5
5689   rm -rf conftest*
5690   eval "ac_cv_func_res_query=no"
5691 fi
5692 rm -f conftest*
5693 fi
5694
5695 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5696   echo "$ac_t""yes" 1>&6
5697   :
5698 else
5699   echo "$ac_t""no" 1>&6
5700 fi
5701
5702 if test $ac_cv_func_res_query = no ; then 
5703         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5704 echo "configure:5705: checking for res_query in -lbind" >&5
5705 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-%__p_%'`
5706 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5707   echo $ac_n "(cached) $ac_c" 1>&6
5708 else
5709   ac_save_LIBS="$LIBS"
5710 LIBS="-lbind  $LIBS"
5711 cat > conftest.$ac_ext <<EOF
5712 #line 5713 "configure"
5713 #include "confdefs.h"
5714 /* Override any gcc2 internal prototype to avoid an error.  */
5715 /* We use char because int might match the return type of a gcc2
5716     builtin and then its argument prototype would still apply.  */
5717 char res_query();
5718
5719 int main() {
5720 res_query()
5721 ; return 0; }
5722 EOF
5723 if { (eval echo configure:5724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5724   rm -rf conftest*
5725   eval "ac_cv_lib_$ac_lib_var=yes"
5726 else
5727   echo "configure: failed program was:" >&5
5728   cat conftest.$ac_ext >&5
5729   rm -rf conftest*
5730   eval "ac_cv_lib_$ac_lib_var=no"
5731 fi
5732 rm -f conftest*
5733 LIBS="$ac_save_LIBS"
5734
5735 fi
5736 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5737   echo "$ac_t""yes" 1>&6
5738     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5739     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5740   cat >> confdefs.h <<EOF
5741 #define $ac_tr_lib 1
5742 EOF
5743
5744   LIBS="-lbind $LIBS"
5745
5746 else
5747   echo "$ac_t""no" 1>&6
5748 fi
5749
5750         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5751 fi
5752
5753 if test $ac_cv_func_res_query = no ; then 
5754         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5755 echo "configure:5756: checking for __res_query in -lbind" >&5
5756 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-%__p_%'`
5757 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5758   echo $ac_n "(cached) $ac_c" 1>&6
5759 else
5760   ac_save_LIBS="$LIBS"
5761 LIBS="-lbind  $LIBS"
5762 cat > conftest.$ac_ext <<EOF
5763 #line 5764 "configure"
5764 #include "confdefs.h"
5765 /* Override any gcc2 internal prototype to avoid an error.  */
5766 /* We use char because int might match the return type of a gcc2
5767     builtin and then its argument prototype would still apply.  */
5768 char __res_query();
5769
5770 int main() {
5771 __res_query()
5772 ; return 0; }
5773 EOF
5774 if { (eval echo configure:5775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5775   rm -rf conftest*
5776   eval "ac_cv_lib_$ac_lib_var=yes"
5777 else
5778   echo "configure: failed program was:" >&5
5779   cat conftest.$ac_ext >&5
5780   rm -rf conftest*
5781   eval "ac_cv_lib_$ac_lib_var=no"
5782 fi
5783 rm -f conftest*
5784 LIBS="$ac_save_LIBS"
5785
5786 fi
5787 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5788   echo "$ac_t""yes" 1>&6
5789     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5790     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5791   cat >> confdefs.h <<EOF
5792 #define $ac_tr_lib 1
5793 EOF
5794
5795   LIBS="-lbind $LIBS"
5796
5797 else
5798   echo "$ac_t""no" 1>&6
5799 fi
5800
5801         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5802 fi
5803
5804 if test $ac_cv_func_res_query = no ; then 
5805         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5806 echo "configure:5807: checking for res_query in -lresolv" >&5
5807 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-%__p_%'`
5808 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5809   echo $ac_n "(cached) $ac_c" 1>&6
5810 else
5811   ac_save_LIBS="$LIBS"
5812 LIBS="-lresolv  $LIBS"
5813 cat > conftest.$ac_ext <<EOF
5814 #line 5815 "configure"
5815 #include "confdefs.h"
5816 /* Override any gcc2 internal prototype to avoid an error.  */
5817 /* We use char because int might match the return type of a gcc2
5818     builtin and then its argument prototype would still apply.  */
5819 char res_query();
5820
5821 int main() {
5822 res_query()
5823 ; return 0; }
5824 EOF
5825 if { (eval echo configure:5826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5826   rm -rf conftest*
5827   eval "ac_cv_lib_$ac_lib_var=yes"
5828 else
5829   echo "configure: failed program was:" >&5
5830   cat conftest.$ac_ext >&5
5831   rm -rf conftest*
5832   eval "ac_cv_lib_$ac_lib_var=no"
5833 fi
5834 rm -f conftest*
5835 LIBS="$ac_save_LIBS"
5836
5837 fi
5838 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5839   echo "$ac_t""yes" 1>&6
5840     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5841     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5842   cat >> confdefs.h <<EOF
5843 #define $ac_tr_lib 1
5844 EOF
5845
5846   LIBS="-lresolv $LIBS"
5847
5848 else
5849   echo "$ac_t""no" 1>&6
5850 fi
5851
5852         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5853 fi
5854
5855 if test "$ac_cv_func_res_query" = yes ; then
5856         cat >> confdefs.h <<\EOF
5857 #define HAVE_RES_QUERY 1
5858 EOF
5859
5860
5861         if test $ol_enable_dnssrv != no ; then
5862                 ol_link_dnssrv=yes
5863         fi
5864 fi
5865
5866 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5867         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5868 fi
5869
5870 for ac_func in getaddrinfo inet_ntop 
5871 do
5872 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5873 echo "configure:5874: checking for $ac_func" >&5
5874 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5875   echo $ac_n "(cached) $ac_c" 1>&6
5876 else
5877   cat > conftest.$ac_ext <<EOF
5878 #line 5879 "configure"
5879 #include "confdefs.h"
5880 /* System header to define __stub macros and hopefully few prototypes,
5881     which can conflict with char $ac_func(); below.  */
5882 #include <assert.h>
5883 /* Override any gcc2 internal prototype to avoid an error.  */
5884 /* We use char because int might match the return type of a gcc2
5885     builtin and then its argument prototype would still apply.  */
5886 char $ac_func();
5887
5888 int main() {
5889
5890 /* The GNU C library defines this for functions which it implements
5891     to always fail with ENOSYS.  Some functions are actually named
5892     something starting with __ and the normal name is an alias.  */
5893 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5894 choke me
5895 #else
5896 $ac_func();
5897 #endif
5898
5899 ; return 0; }
5900 EOF
5901 if { (eval echo configure:5902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5902   rm -rf conftest*
5903   eval "ac_cv_func_$ac_func=yes"
5904 else
5905   echo "configure: failed program was:" >&5
5906   cat conftest.$ac_ext >&5
5907   rm -rf conftest*
5908   eval "ac_cv_func_$ac_func=no"
5909 fi
5910 rm -f conftest*
5911 fi
5912
5913 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5914   echo "$ac_t""yes" 1>&6
5915     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5916   cat >> confdefs.h <<EOF
5917 #define $ac_tr_func 1
5918 EOF
5919  
5920 else
5921   echo "$ac_t""no" 1>&6
5922 fi
5923 done
5924
5925
5926 ol_link_ipv6=no
5927 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5928         if test $ol_enable_ipv6 = yes ; then
5929                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5930         fi
5931 else
5932         for ac_func in gai_strerror 
5933 do
5934 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5935 echo "configure:5936: checking for $ac_func" >&5
5936 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5937   echo $ac_n "(cached) $ac_c" 1>&6
5938 else
5939   cat > conftest.$ac_ext <<EOF
5940 #line 5941 "configure"
5941 #include "confdefs.h"
5942 /* System header to define __stub macros and hopefully few prototypes,
5943     which can conflict with char $ac_func(); below.  */
5944 #include <assert.h>
5945 /* Override any gcc2 internal prototype to avoid an error.  */
5946 /* We use char because int might match the return type of a gcc2
5947     builtin and then its argument prototype would still apply.  */
5948 char $ac_func();
5949
5950 int main() {
5951
5952 /* The GNU C library defines this for functions which it implements
5953     to always fail with ENOSYS.  Some functions are actually named
5954     something starting with __ and the normal name is an alias.  */
5955 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5956 choke me
5957 #else
5958 $ac_func();
5959 #endif
5960
5961 ; return 0; }
5962 EOF
5963 if { (eval echo configure:5964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5964   rm -rf conftest*
5965   eval "ac_cv_func_$ac_func=yes"
5966 else
5967   echo "configure: failed program was:" >&5
5968   cat conftest.$ac_ext >&5
5969   rm -rf conftest*
5970   eval "ac_cv_func_$ac_func=no"
5971 fi
5972 rm -f conftest*
5973 fi
5974
5975 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5976   echo "$ac_t""yes" 1>&6
5977     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5978   cat >> confdefs.h <<EOF
5979 #define $ac_tr_func 1
5980 EOF
5981  
5982 else
5983   echo "$ac_t""no" 1>&6
5984 fi
5985 done
5986
5987
5988         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5989 echo "configure:5990: checking INET6_ADDRSTRLEN" >&5
5990 if eval "test \"`echo '$''{'ol_cv_inet6_addrstrlen'+set}'`\" = set"; then
5991   echo $ac_n "(cached) $ac_c" 1>&6
5992 else
5993   
5994                 cat > conftest.$ac_ext <<EOF
5995 #line 5996 "configure"
5996 #include "confdefs.h"
5997
5998 #                       include <netinet/in.h>
5999 #                       ifdef INET6_ADDRSTRLEN
6000                                 __has_inet6_addrstrlen__;
6001 #                       endif
6002                 
6003 EOF
6004 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6005   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6006   rm -rf conftest*
6007   ol_cv_inet6_addrstrlen=yes
6008 else
6009   rm -rf conftest*
6010   ol_cv_inet6_addrstrlen=no
6011 fi
6012 rm -f conftest*
6013
6014 fi
6015
6016 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6017
6018         if test $ol_cv_inet6_addrstrlen = yes ; then
6019                 ol_link_ipv6=yes
6020         elif test $ol_enable_ipv6 = yes ; then
6021                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6022         fi
6023 fi
6024
6025 if test $ol_enable_local != no ; then
6026         for ac_hdr in sys/un.h 
6027 do
6028 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6029 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6030 echo "configure:6031: checking for $ac_hdr" >&5
6031 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6032   echo $ac_n "(cached) $ac_c" 1>&6
6033 else
6034   cat > conftest.$ac_ext <<EOF
6035 #line 6036 "configure"
6036 #include "confdefs.h"
6037 #include <$ac_hdr>
6038 EOF
6039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6040 { (eval echo configure:6041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6041 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6042 if test -z "$ac_err"; then
6043   rm -rf conftest*
6044   eval "ac_cv_header_$ac_safe=yes"
6045 else
6046   echo "$ac_err" >&5
6047   echo "configure: failed program was:" >&5
6048   cat conftest.$ac_ext >&5
6049   rm -rf conftest*
6050   eval "ac_cv_header_$ac_safe=no"
6051 fi
6052 rm -f conftest*
6053 fi
6054 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6055   echo "$ac_t""yes" 1>&6
6056     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6057   cat >> confdefs.h <<EOF
6058 #define $ac_tr_hdr 1
6059 EOF
6060  
6061 else
6062   echo "$ac_t""no" 1>&6
6063 fi
6064 done
6065
6066
6067         if test $ol_enable_local = auto ; then
6068                 ol_enable_local=$ac_cv_header_sys_un_h
6069         elif test $ac_cv_header_sys_un_h = no ; then
6070                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6071         fi
6072 fi
6073
6074 ol_link_kbind=no
6075 ol_link_kpasswd=no
6076 ol_link_krb5=no
6077 ol_link_krb4=no
6078
6079 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6080         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6081         -o $ol_with_kerberos = k425 ; then
6082
6083         for ac_hdr in krb5.h
6084 do
6085 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6086 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6087 echo "configure:6088: checking for $ac_hdr" >&5
6088 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6089   echo $ac_n "(cached) $ac_c" 1>&6
6090 else
6091   cat > conftest.$ac_ext <<EOF
6092 #line 6093 "configure"
6093 #include "confdefs.h"
6094 #include <$ac_hdr>
6095 EOF
6096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6097 { (eval echo configure:6098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6098 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6099 if test -z "$ac_err"; then
6100   rm -rf conftest*
6101   eval "ac_cv_header_$ac_safe=yes"
6102 else
6103   echo "$ac_err" >&5
6104   echo "configure: failed program was:" >&5
6105   cat conftest.$ac_ext >&5
6106   rm -rf conftest*
6107   eval "ac_cv_header_$ac_safe=no"
6108 fi
6109 rm -f conftest*
6110 fi
6111 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6112   echo "$ac_t""yes" 1>&6
6113     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6114   cat >> confdefs.h <<EOF
6115 #define $ac_tr_hdr 1
6116 EOF
6117  
6118 else
6119   echo "$ac_t""no" 1>&6
6120 fi
6121 done
6122
6123
6124         if test $ac_cv_header_krb5_h = yes ; then
6125                                 for ac_hdr in heim_err.h
6126 do
6127 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6128 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6129 echo "configure:6130: checking for $ac_hdr" >&5
6130 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6131   echo $ac_n "(cached) $ac_c" 1>&6
6132 else
6133   cat > conftest.$ac_ext <<EOF
6134 #line 6135 "configure"
6135 #include "confdefs.h"
6136 #include <$ac_hdr>
6137 EOF
6138 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6139 { (eval echo configure:6140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6140 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6141 if test -z "$ac_err"; then
6142   rm -rf conftest*
6143   eval "ac_cv_header_$ac_safe=yes"
6144 else
6145   echo "$ac_err" >&5
6146   echo "configure: failed program was:" >&5
6147   cat conftest.$ac_ext >&5
6148   rm -rf conftest*
6149   eval "ac_cv_header_$ac_safe=no"
6150 fi
6151 rm -f conftest*
6152 fi
6153 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6154   echo "$ac_t""yes" 1>&6
6155     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6156   cat >> confdefs.h <<EOF
6157 #define $ac_tr_hdr 1
6158 EOF
6159  
6160 else
6161   echo "$ac_t""no" 1>&6
6162 fi
6163 done
6164
6165                 if test $ac_cv_header_heim_err_h = yes ; then
6166                         krb5_impl=heimdal
6167                 else
6168                         krb5_impl=mit
6169                 fi
6170
6171                 if test $krb5_impl = mit; then
6172                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6173 echo "configure:6174: checking for main in -lkrb5" >&5
6174 ac_lib_var=`echo krb5'_'main | sed 'y%./+-%__p_%'`
6175 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6176   echo $ac_n "(cached) $ac_c" 1>&6
6177 else
6178   ac_save_LIBS="$LIBS"
6179 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
6180 cat > conftest.$ac_ext <<EOF
6181 #line 6182 "configure"
6182 #include "confdefs.h"
6183
6184 int main() {
6185 main()
6186 ; return 0; }
6187 EOF
6188 if { (eval echo configure:6189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6189   rm -rf conftest*
6190   eval "ac_cv_lib_$ac_lib_var=yes"
6191 else
6192   echo "configure: failed program was:" >&5
6193   cat conftest.$ac_ext >&5
6194   rm -rf conftest*
6195   eval "ac_cv_lib_$ac_lib_var=no"
6196 fi
6197 rm -f conftest*
6198 LIBS="$ac_save_LIBS"
6199
6200 fi
6201 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6202   echo "$ac_t""yes" 1>&6
6203   have_krb5=yes
6204                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
6205 else
6206   echo "$ac_t""no" 1>&6
6207 have_krb5=no
6208 fi
6209
6210
6211                 elif test $krb5_impl = heimdal; then
6212                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6213 echo "configure:6214: checking for main in -lkrb5" >&5
6214 ac_lib_var=`echo krb5'_'main | sed 'y%./+-%__p_%'`
6215 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6216   echo $ac_n "(cached) $ac_c" 1>&6
6217 else
6218   ac_save_LIBS="$LIBS"
6219 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6220 cat > conftest.$ac_ext <<EOF
6221 #line 6222 "configure"
6222 #include "confdefs.h"
6223
6224 int main() {
6225 main()
6226 ; return 0; }
6227 EOF
6228 if { (eval echo configure:6229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6229   rm -rf conftest*
6230   eval "ac_cv_lib_$ac_lib_var=yes"
6231 else
6232   echo "configure: failed program was:" >&5
6233   cat conftest.$ac_ext >&5
6234   rm -rf conftest*
6235   eval "ac_cv_lib_$ac_lib_var=no"
6236 fi
6237 rm -f conftest*
6238 LIBS="$ac_save_LIBS"
6239
6240 fi
6241 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6242   echo "$ac_t""yes" 1>&6
6243   have_krb5=yes
6244                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6245 else
6246   echo "$ac_t""no" 1>&6
6247 have_krb5=no
6248 fi
6249
6250
6251                         cat >> confdefs.h <<\EOF
6252 #define HAVE_HEIMDAL_KERBEROS 1
6253 EOF
6254
6255                 else
6256                         have_krb5=no
6257                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6258                 fi
6259
6260                 if test $have_krb5 = yes ; then
6261                         ol_link_krb5=yes
6262
6263                         cat >> confdefs.h <<\EOF
6264 #define HAVE_KRB5 1
6265 EOF
6266
6267
6268                         if test $ol_enable_kpasswd != no ; then
6269                                 ol_link_kpasswd=yes;
6270                         fi
6271
6272                         if test $ol_with_kerberos = k5only ; then
6273                                 ol_with_kerberos=found
6274                         fi
6275
6276                 elif test $ol_with_kerberos != auto ; then
6277                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6278                 fi
6279
6280         fi
6281 fi
6282
6283 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6284         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6285
6286         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6287 do
6288 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6289 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6290 echo "configure:6291: checking for $ac_hdr" >&5
6291 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6292   echo $ac_n "(cached) $ac_c" 1>&6
6293 else
6294   cat > conftest.$ac_ext <<EOF
6295 #line 6296 "configure"
6296 #include "confdefs.h"
6297 #include <$ac_hdr>
6298 EOF
6299 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6300 { (eval echo configure:6301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6301 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6302 if test -z "$ac_err"; then
6303   rm -rf conftest*
6304   eval "ac_cv_header_$ac_safe=yes"
6305 else
6306   echo "$ac_err" >&5
6307   echo "configure: failed program was:" >&5
6308   cat conftest.$ac_ext >&5
6309   rm -rf conftest*
6310   eval "ac_cv_header_$ac_safe=no"
6311 fi
6312 rm -f conftest*
6313 fi
6314 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6315   echo "$ac_t""yes" 1>&6
6316     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6317   cat >> confdefs.h <<EOF
6318 #define $ac_tr_hdr 1
6319 EOF
6320  
6321 else
6322   echo "$ac_t""no" 1>&6
6323 fi
6324 done
6325
6326
6327         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6328                 if test $krb5_impl = mit; then
6329                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6330 echo "configure:6331: checking for main in -lkrb4" >&5
6331 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
6332 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6333   echo $ac_n "(cached) $ac_c" 1>&6
6334 else
6335   ac_save_LIBS="$LIBS"
6336 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
6337 cat > conftest.$ac_ext <<EOF
6338 #line 6339 "configure"
6339 #include "confdefs.h"
6340
6341 int main() {
6342 main()
6343 ; return 0; }
6344 EOF
6345 if { (eval echo configure:6346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6346   rm -rf conftest*
6347   eval "ac_cv_lib_$ac_lib_var=yes"
6348 else
6349   echo "configure: failed program was:" >&5
6350   cat conftest.$ac_ext >&5
6351   rm -rf conftest*
6352   eval "ac_cv_lib_$ac_lib_var=no"
6353 fi
6354 rm -f conftest*
6355 LIBS="$ac_save_LIBS"
6356
6357 fi
6358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6359   echo "$ac_t""yes" 1>&6
6360   have_k425=yes
6361                                 KRB4_LIBS="-lkrb4 -ldes425"
6362 else
6363   echo "$ac_t""no" 1>&6
6364 have_k425=no
6365 fi
6366
6367
6368                 elif test $krb5_impl = heimdal; then
6369                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6370 echo "configure:6371: checking for main in -lkrb4" >&5
6371 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
6372 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6373   echo $ac_n "(cached) $ac_c" 1>&6
6374 else
6375   ac_save_LIBS="$LIBS"
6376 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6377 cat > conftest.$ac_ext <<EOF
6378 #line 6379 "configure"
6379 #include "confdefs.h"
6380
6381 int main() {
6382 main()
6383 ; return 0; }
6384 EOF
6385 if { (eval echo configure:6386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6386   rm -rf conftest*
6387   eval "ac_cv_lib_$ac_lib_var=yes"
6388 else
6389   echo "configure: failed program was:" >&5
6390   cat conftest.$ac_ext >&5
6391   rm -rf conftest*
6392   eval "ac_cv_lib_$ac_lib_var=no"
6393 fi
6394 rm -f conftest*
6395 LIBS="$ac_save_LIBS"
6396
6397 fi
6398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6399   echo "$ac_t""yes" 1>&6
6400   have_k425=yes
6401                                 KRB4_LIBS="-lkrb4"
6402 else
6403   echo "$ac_t""no" 1>&6
6404 have_k425=no
6405 fi
6406
6407
6408                 else
6409                         have_425=no
6410                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6411                 fi
6412
6413                 if test $have_k425 = yes ; then
6414                         ol_with_kerberos=found
6415                         ol_link_krb4=yes
6416
6417                         cat >> confdefs.h <<\EOF
6418 #define HAVE_KRB425 1
6419 EOF
6420
6421                         cat >> confdefs.h <<\EOF
6422 #define HAVE_KRB4 1
6423 EOF
6424
6425
6426                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6427 echo "configure:6428: checking for des_debug in Kerberos libraries" >&5
6428 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
6429   echo $ac_n "(cached) $ac_c" 1>&6
6430 else
6431   
6432                                                                 save_LIBS="$LIBS"
6433                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6434                                 cat > conftest.$ac_ext <<EOF
6435 #line 6436 "configure"
6436 #include "confdefs.h"
6437
6438 #include <kerberosIV/krb.h>
6439 #include <kerberosIV/des.h>
6440 extern int des_debug;
6441
6442 int main() {
6443
6444 des_debug = 1;
6445
6446 ; return 0; }
6447 EOF
6448 if { (eval echo configure:6449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6449   rm -rf conftest*
6450   ol_cv_var_des_debug=yes
6451 else
6452   echo "configure: failed program was:" >&5
6453   cat conftest.$ac_ext >&5
6454   rm -rf conftest*
6455   ol_cv_var_des_debug=no
6456 fi
6457 rm -f conftest*
6458                                                                 LIBS="$save_LIBS"
6459                         
6460 fi
6461
6462 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6463
6464                         if test $ol_cv_var_des_debug = yes ; then
6465                                 cat >> confdefs.h <<\EOF
6466 #define HAVE_DES_DEBUG 1
6467 EOF
6468
6469                         fi
6470
6471                         LIBS="$save_LIBS"
6472                 fi
6473         fi
6474 fi
6475
6476 if test $ol_link_krb5 = yes ; then
6477         ol_with_kerberos=found
6478 fi
6479
6480 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6481         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6482
6483         for ac_hdr in krb.h des.h krb-archaeology.h 
6484 do
6485 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6486 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6487 echo "configure:6488: checking for $ac_hdr" >&5
6488 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6489   echo $ac_n "(cached) $ac_c" 1>&6
6490 else
6491   cat > conftest.$ac_ext <<EOF
6492 #line 6493 "configure"
6493 #include "confdefs.h"
6494 #include <$ac_hdr>
6495 EOF
6496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6497 { (eval echo configure:6498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6499 if test -z "$ac_err"; then
6500   rm -rf conftest*
6501   eval "ac_cv_header_$ac_safe=yes"
6502 else
6503   echo "$ac_err" >&5
6504   echo "configure: failed program was:" >&5
6505   cat conftest.$ac_ext >&5
6506   rm -rf conftest*
6507   eval "ac_cv_header_$ac_safe=no"
6508 fi
6509 rm -f conftest*
6510 fi
6511 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6512   echo "$ac_t""yes" 1>&6
6513     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6514   cat >> confdefs.h <<EOF
6515 #define $ac_tr_hdr 1
6516 EOF
6517  
6518 else
6519   echo "$ac_t""no" 1>&6
6520 fi
6521 done
6522
6523
6524         if test $ac_cv_header_krb_h = yes ; then
6525                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6526 echo "configure:6527: checking for main in -lkrb" >&5
6527 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
6528 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6529   echo $ac_n "(cached) $ac_c" 1>&6
6530 else
6531   ac_save_LIBS="$LIBS"
6532 LIBS="-lkrb -ldes $LIBS"
6533 cat > conftest.$ac_ext <<EOF
6534 #line 6535 "configure"
6535 #include "confdefs.h"
6536
6537 int main() {
6538 main()
6539 ; return 0; }
6540 EOF
6541 if { (eval echo configure:6542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6542   rm -rf conftest*
6543   eval "ac_cv_lib_$ac_lib_var=yes"
6544 else
6545   echo "configure: failed program was:" >&5
6546   cat conftest.$ac_ext >&5
6547   rm -rf conftest*
6548   eval "ac_cv_lib_$ac_lib_var=no"
6549 fi
6550 rm -f conftest*
6551 LIBS="$ac_save_LIBS"
6552
6553 fi
6554 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6555   echo "$ac_t""yes" 1>&6
6556   have_k4=yes
6557 else
6558   echo "$ac_t""no" 1>&6
6559 have_k4=no
6560 fi
6561
6562
6563                 if test $have_k4 = yes ; then
6564                         ol_with_kerberos=found
6565                         ol_link_krb4=yes
6566
6567                         cat >> confdefs.h <<\EOF
6568 #define HAVE_KRB4 1
6569 EOF
6570
6571
6572                         KRB4_LIBS="-lkrb -ldes"
6573
6574                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6575                                 cat >> confdefs.h <<\EOF
6576 #define HAVE_KTH_KERBEROS 1
6577 EOF
6578
6579                         fi
6580                 fi
6581         fi
6582 fi
6583
6584 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6585         ol_link_kpasswd=yes
6586 fi
6587
6588 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6589         ol_link_kbind=yes
6590
6591 elif test $ol_enable_kbind = yes ; then
6592         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6593 fi
6594
6595 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6596         cat >> confdefs.h <<\EOF
6597 #define HAVE_KERBEROS 1
6598 EOF
6599
6600
6601 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6602         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6603 fi
6604
6605 ol_link_tls=no
6606 if test $ol_with_tls != no ; then
6607         for ac_hdr in openssl/ssl.h ssl.h
6608 do
6609 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6610 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6611 echo "configure:6612: checking for $ac_hdr" >&5
6612 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6613   echo $ac_n "(cached) $ac_c" 1>&6
6614 else
6615   cat > conftest.$ac_ext <<EOF
6616 #line 6617 "configure"
6617 #include "confdefs.h"
6618 #include <$ac_hdr>
6619 EOF
6620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6621 { (eval echo configure:6622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6622 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6623 if test -z "$ac_err"; then
6624   rm -rf conftest*
6625   eval "ac_cv_header_$ac_safe=yes"
6626 else
6627   echo "$ac_err" >&5
6628   echo "configure: failed program was:" >&5
6629   cat conftest.$ac_ext >&5
6630   rm -rf conftest*
6631   eval "ac_cv_header_$ac_safe=no"
6632 fi
6633 rm -f conftest*
6634 fi
6635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6636   echo "$ac_t""yes" 1>&6
6637     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6638   cat >> confdefs.h <<EOF
6639 #define $ac_tr_hdr 1
6640 EOF
6641  
6642 else
6643   echo "$ac_t""no" 1>&6
6644 fi
6645 done
6646
6647         
6648         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6649                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6650 echo "configure:6651: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6651 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
6652 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6653   echo $ac_n "(cached) $ac_c" 1>&6
6654 else
6655   ac_save_LIBS="$LIBS"
6656 LIBS="-lssl -lcrypto $LIBS"
6657 cat > conftest.$ac_ext <<EOF
6658 #line 6659 "configure"
6659 #include "confdefs.h"
6660 /* Override any gcc2 internal prototype to avoid an error.  */
6661 /* We use char because int might match the return type of a gcc2
6662     builtin and then its argument prototype would still apply.  */
6663 char SSLeay_add_ssl_algorithms();
6664
6665 int main() {
6666 SSLeay_add_ssl_algorithms()
6667 ; return 0; }
6668 EOF
6669 if { (eval echo configure:6670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6670   rm -rf conftest*
6671   eval "ac_cv_lib_$ac_lib_var=yes"
6672 else
6673   echo "configure: failed program was:" >&5
6674   cat conftest.$ac_ext >&5
6675   rm -rf conftest*
6676   eval "ac_cv_lib_$ac_lib_var=no"
6677 fi
6678 rm -f conftest*
6679 LIBS="$ac_save_LIBS"
6680
6681 fi
6682 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6683   echo "$ac_t""yes" 1>&6
6684   have_ssleay=yes
6685                         need_rsaref=no
6686 else
6687   echo "$ac_t""no" 1>&6
6688 have_ssleay=no
6689 fi
6690
6691                         
6692                 if test $have_ssleay = no ; then
6693                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6694 echo "configure:6695: checking for SSL_library_init in -lssl" >&5
6695 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-%__p_%'`
6696 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6697   echo $ac_n "(cached) $ac_c" 1>&6
6698 else
6699   ac_save_LIBS="$LIBS"
6700 LIBS="-lssl -lcrypto $LIBS"
6701 cat > conftest.$ac_ext <<EOF
6702 #line 6703 "configure"
6703 #include "confdefs.h"
6704 /* Override any gcc2 internal prototype to avoid an error.  */
6705 /* We use char because int might match the return type of a gcc2
6706     builtin and then its argument prototype would still apply.  */
6707 char SSL_library_init();
6708
6709 int main() {
6710 SSL_library_init()
6711 ; return 0; }
6712 EOF
6713 if { (eval echo configure:6714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6714   rm -rf conftest*
6715   eval "ac_cv_lib_$ac_lib_var=yes"
6716 else
6717   echo "configure: failed program was:" >&5
6718   cat conftest.$ac_ext >&5
6719   rm -rf conftest*
6720   eval "ac_cv_lib_$ac_lib_var=no"
6721 fi
6722 rm -f conftest*
6723 LIBS="$ac_save_LIBS"
6724
6725 fi
6726 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6727   echo "$ac_t""yes" 1>&6
6728   have_ssleay=yes
6729                                 need_rsaref=no
6730 else
6731   echo "$ac_t""no" 1>&6
6732 have_ssleay=no
6733 fi
6734
6735                 fi
6736
6737                 if test $have_ssleay = no ; then
6738                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6739 echo "configure:6740: checking for ssl3_accept in -lssl" >&5
6740 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
6741 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6742   echo $ac_n "(cached) $ac_c" 1>&6
6743 else
6744   ac_save_LIBS="$LIBS"
6745 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6746 cat > conftest.$ac_ext <<EOF
6747 #line 6748 "configure"
6748 #include "confdefs.h"
6749 /* Override any gcc2 internal prototype to avoid an error.  */
6750 /* We use char because int might match the return type of a gcc2
6751     builtin and then its argument prototype would still apply.  */
6752 char ssl3_accept();
6753
6754 int main() {
6755 ssl3_accept()
6756 ; return 0; }
6757 EOF
6758 if { (eval echo configure:6759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6759   rm -rf conftest*
6760   eval "ac_cv_lib_$ac_lib_var=yes"
6761 else
6762   echo "configure: failed program was:" >&5
6763   cat conftest.$ac_ext >&5
6764   rm -rf conftest*
6765   eval "ac_cv_lib_$ac_lib_var=no"
6766 fi
6767 rm -f conftest*
6768 LIBS="$ac_save_LIBS"
6769
6770 fi
6771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6772   echo "$ac_t""yes" 1>&6
6773   have_ssleay=yes
6774                                 need_rsaref=yes
6775 else
6776   echo "$ac_t""no" 1>&6
6777 have_ssleay=no
6778 fi
6779
6780                 fi
6781
6782                 if test $have_ssleay = yes ; then
6783                         ol_with_tls=found
6784                         ol_link_tls=yes
6785
6786                         cat >> confdefs.h <<\EOF
6787 #define HAVE_SSLEAY 1
6788 EOF
6789
6790
6791                         if test $need_rsaref = yes; then
6792                                 cat >> confdefs.h <<\EOF
6793 #define HAVE_RSAREF 1
6794 EOF
6795
6796
6797                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6798                         else
6799                                 TLS_LIBS="-lssl -lcrypto"
6800                         fi
6801                 fi
6802         fi
6803
6804 else
6805         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6806 fi
6807
6808 if test $ol_link_tls = yes ; then
6809         cat >> confdefs.h <<\EOF
6810 #define HAVE_TLS 1
6811 EOF
6812
6813
6814 elif test $ol_with_tls = auto ; then
6815         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6816         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6817
6818 elif test $ol_with_tls != no ; then
6819         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6820 fi
6821
6822 if test $ol_enable_lmpasswd != no; then
6823         if test $ol_link_tls != yes ; then
6824                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
6825         fi
6826
6827         cat >> confdefs.h <<\EOF
6828 #define SLAPD_LMHASH 1
6829 EOF
6830
6831 fi
6832
6833 for ac_func in \
6834         ctime_r                 \
6835         gethostbyname_r gethostbyaddr_r \
6836
6837 do
6838 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6839 echo "configure:6840: checking for $ac_func" >&5
6840 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6841   echo $ac_n "(cached) $ac_c" 1>&6
6842 else
6843   cat > conftest.$ac_ext <<EOF
6844 #line 6845 "configure"
6845 #include "confdefs.h"
6846 /* System header to define __stub macros and hopefully few prototypes,
6847     which can conflict with char $ac_func(); below.  */
6848 #include <assert.h>
6849 /* Override any gcc2 internal prototype to avoid an error.  */
6850 /* We use char because int might match the return type of a gcc2
6851     builtin and then its argument prototype would still apply.  */
6852 char $ac_func();
6853
6854 int main() {
6855
6856 /* The GNU C library defines this for functions which it implements
6857     to always fail with ENOSYS.  Some functions are actually named
6858     something starting with __ and the normal name is an alias.  */
6859 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6860 choke me
6861 #else
6862 $ac_func();
6863 #endif
6864
6865 ; return 0; }
6866 EOF
6867 if { (eval echo configure:6868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6868   rm -rf conftest*
6869   eval "ac_cv_func_$ac_func=yes"
6870 else
6871   echo "configure: failed program was:" >&5
6872   cat conftest.$ac_ext >&5
6873   rm -rf conftest*
6874   eval "ac_cv_func_$ac_func=no"
6875 fi
6876 rm -f conftest*
6877 fi
6878
6879 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6880   echo "$ac_t""yes" 1>&6
6881     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6882   cat >> confdefs.h <<EOF
6883 #define $ac_tr_func 1
6884 EOF
6885  
6886 else
6887   echo "$ac_t""no" 1>&6
6888 fi
6889 done
6890
6891
6892 if test "$ac_cv_func_ctime_r" = no ; then
6893         ol_cv_func_ctime_r_nargs=0
6894 else
6895         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6896 echo "configure:6897: checking number of arguments of ctime_r" >&5
6897 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
6898   echo $ac_n "(cached) $ac_c" 1>&6
6899 else
6900   cat > conftest.$ac_ext <<EOF
6901 #line 6902 "configure"
6902 #include "confdefs.h"
6903 #include <time.h>
6904 int main() {
6905 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6906 ; return 0; }
6907 EOF
6908 if { (eval echo configure:6909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6909   rm -rf conftest*
6910   ol_cv_func_ctime_r_nargs3=yes
6911 else
6912   echo "configure: failed program was:" >&5
6913   cat conftest.$ac_ext >&5
6914   rm -rf conftest*
6915   ol_cv_func_ctime_r_nargs3=no
6916 fi
6917 rm -f conftest*
6918
6919         cat > conftest.$ac_ext <<EOF
6920 #line 6921 "configure"
6921 #include "confdefs.h"
6922 #include <time.h>
6923 int main() {
6924 time_t ti; char *buffer; ctime_r(&ti,buffer);
6925 ; return 0; }
6926 EOF
6927 if { (eval echo configure:6928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6928   rm -rf conftest*
6929   ol_cv_func_ctime_r_nargs2=yes
6930 else
6931   echo "configure: failed program was:" >&5
6932   cat conftest.$ac_ext >&5
6933   rm -rf conftest*
6934   ol_cv_func_ctime_r_nargs2=no
6935 fi
6936 rm -f conftest*
6937
6938         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6939                 $ol_cv_func_ctime_r_nargs2 = no ; then
6940
6941                 ol_cv_func_ctime_r_nargs=3
6942
6943         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6944                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6945
6946                 ol_cv_func_ctime_r_nargs=2
6947
6948         else
6949                 ol_cv_func_ctime_r_nargs=0
6950         fi
6951   
6952 fi
6953
6954 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6955
6956   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6957         cat >> confdefs.h <<EOF
6958 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6959 EOF
6960
6961   fi
6962
6963 fi
6964
6965 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6966         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6967 echo "configure:6968: checking number of arguments of gethostbyname_r" >&5
6968 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
6969   echo $ac_n "(cached) $ac_c" 1>&6
6970 else
6971   cat > conftest.$ac_ext <<EOF
6972 #line 6973 "configure"
6973 #include "confdefs.h"
6974 #include <sys/types.h>
6975 #include <sys/socket.h>
6976 #include <netinet/in.h>
6977 #include <netdb.h>
6978 #define BUFSIZE (sizeof(struct hostent)+10)
6979 int main() {
6980 struct hostent hent; char buffer[BUFSIZE];
6981                 int bufsize=BUFSIZE;int h_errno;
6982                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6983                         buffer, bufsize, &h_errno);
6984 ; return 0; }
6985 EOF
6986 if { (eval echo configure:6987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6987   rm -rf conftest*
6988   ol_cv_func_gethostbyname_r_nargs5=yes
6989 else
6990   echo "configure: failed program was:" >&5
6991   cat conftest.$ac_ext >&5
6992   rm -rf conftest*
6993   ol_cv_func_gethostbyname_r_nargs5=no
6994 fi
6995 rm -f conftest*
6996
6997         cat > conftest.$ac_ext <<EOF
6998 #line 6999 "configure"
6999 #include "confdefs.h"
7000 #include <sys/types.h>
7001 #include <sys/socket.h>
7002 #include <netinet/in.h>
7003 #include <netdb.h>
7004 #define BUFSIZE (sizeof(struct hostent)+10)
7005 int main() {
7006 struct hostent hent;struct hostent *rhent;
7007                 char buffer[BUFSIZE];
7008                 int bufsize=BUFSIZE;int h_errno;
7009                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7010                         &rhent, &h_errno);
7011 ; return 0; }
7012 EOF
7013 if { (eval echo configure:7014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7014   rm -rf conftest*
7015   ol_cv_func_gethostbyname_r_nargs6=yes
7016 else
7017   echo "configure: failed program was:" >&5
7018   cat conftest.$ac_ext >&5
7019   rm -rf conftest*
7020   ol_cv_func_gethostbyname_r_nargs6=no
7021 fi
7022 rm -f conftest*
7023
7024         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7025                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7026
7027                 ol_cv_func_gethostbyname_r_nargs=5
7028
7029         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7030                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7031
7032                 ol_cv_func_gethostbyname_r_nargs=6
7033
7034         else
7035                 ol_cv_func_gethostbyname_r_nargs=0
7036         fi
7037   
7038 fi
7039
7040 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7041   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7042         cat >> confdefs.h <<EOF
7043 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7044 EOF
7045
7046   fi
7047
7048 else
7049         ol_cv_func_gethostbyname_r_nargs=0
7050 fi
7051  
7052 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7053         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7054 echo "configure:7055: checking number of arguments of gethostbyaddr_r" >&5
7055 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
7056   echo $ac_n "(cached) $ac_c" 1>&6
7057 else
7058   cat > conftest.$ac_ext <<EOF
7059 #line 7060 "configure"
7060 #include "confdefs.h"
7061 #include <sys/types.h>
7062 #include <sys/socket.h>
7063 #include <netinet/in.h>
7064 #include <netdb.h>
7065 #define BUFSIZE (sizeof(struct hostent)+10)
7066 int main() {
7067 struct hostent hent; char buffer[BUFSIZE]; 
7068             struct in_addr add;
7069             size_t alen=sizeof(struct in_addr);
7070             int bufsize=BUFSIZE;int h_errno;
7071                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7072                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7073 ; return 0; }
7074 EOF
7075 if { (eval echo configure:7076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7076   rm -rf conftest*
7077   ol_cv_func_gethostbyaddr_r_nargs7=yes
7078 else
7079   echo "configure: failed program was:" >&5
7080   cat conftest.$ac_ext >&5
7081   rm -rf conftest*
7082   ol_cv_func_gethostbyaddr_r_nargs7=no
7083 fi
7084 rm -f conftest*
7085
7086         cat > conftest.$ac_ext <<EOF
7087 #line 7088 "configure"
7088 #include "confdefs.h"
7089 #include <sys/types.h>
7090 #include <sys/socket.h>
7091 #include <netinet/in.h>
7092 #include <netdb.h>
7093 #define BUFSIZE (sizeof(struct hostent)+10)
7094 int main() {
7095 struct hostent hent;
7096                 struct hostent *rhent; char buffer[BUFSIZE]; 
7097                 struct in_addr add;
7098                 size_t alen=sizeof(struct in_addr);
7099                 int bufsize=BUFSIZE;int h_errno;
7100                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7101                         alen, AF_INET, &hent, buffer, bufsize, 
7102                         &rhent, &h_errno);
7103 ; return 0; }
7104 EOF
7105 if { (eval echo configure:7106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7106   rm -rf conftest*
7107   ol_cv_func_gethostbyaddr_r_nargs8=yes
7108 else
7109   echo "configure: failed program was:" >&5
7110   cat conftest.$ac_ext >&5
7111   rm -rf conftest*
7112   ol_cv_func_gethostbyaddr_r_nargs8=no
7113 fi
7114 rm -f conftest*
7115
7116         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7117                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7118
7119                 ol_cv_func_gethostbyaddr_r_nargs=7
7120
7121         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7122                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7123
7124                 ol_cv_func_gethostbyaddr_r_nargs=8
7125
7126         else
7127                 ol_cv_func_gethostbyaddr_r_nargs=0
7128         fi
7129   
7130 fi
7131
7132 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7133   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7134     cat >> confdefs.h <<EOF
7135 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7136 EOF
7137
7138   fi
7139
7140 else
7141         ol_cv_func_gethostbyaddr_r_nargs=0
7142 fi
7143
7144 if test "$ac_cv_func_ctime_r" = yes \
7145         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7146         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7147         -a "$ac_cv_func_gethostbyname_r" = yes \
7148         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7149         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7150         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7151         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7152         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7153         ; then
7154  
7155         cat >> confdefs.h <<\EOF
7156 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7157 EOF
7158
7159 fi
7160
7161 ol_link_threads=no
7162
7163 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7164         -o $ol_with_threads = nt ; then
7165
7166         
7167         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7168 echo "configure:7169: checking for _beginthread" >&5
7169 if eval "test \"`echo '$''{'ac_cv_func__beginthread'+set}'`\" = set"; then
7170   echo $ac_n "(cached) $ac_c" 1>&6
7171 else
7172   cat > conftest.$ac_ext <<EOF
7173 #line 7174 "configure"
7174 #include "confdefs.h"
7175 /* System header to define __stub macros and hopefully few prototypes,
7176     which can conflict with char _beginthread(); below.  */
7177 #include <assert.h>
7178 /* Override any gcc2 internal prototype to avoid an error.  */
7179 /* We use char because int might match the return type of a gcc2
7180     builtin and then its argument prototype would still apply.  */
7181 char _beginthread();
7182
7183 int main() {
7184
7185 /* The GNU C library defines this for functions which it implements
7186     to always fail with ENOSYS.  Some functions are actually named
7187     something starting with __ and the normal name is an alias.  */
7188 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7189 choke me
7190 #else
7191 _beginthread();
7192 #endif
7193
7194 ; return 0; }
7195 EOF
7196 if { (eval echo configure:7197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7197   rm -rf conftest*
7198   eval "ac_cv_func__beginthread=yes"
7199 else
7200   echo "configure: failed program was:" >&5
7201   cat conftest.$ac_ext >&5
7202   rm -rf conftest*
7203   eval "ac_cv_func__beginthread=no"
7204 fi
7205 rm -f conftest*
7206 fi
7207
7208 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7209   echo "$ac_t""yes" 1>&6
7210   :
7211 else
7212   echo "$ac_t""no" 1>&6
7213 fi
7214
7215
7216         if test $ac_cv_func__beginthread = yes ; then
7217                 cat >> confdefs.h <<\EOF
7218 #define HAVE_NT_THREADS 1
7219 EOF
7220
7221         fi
7222
7223
7224         if test "$ol_cv_nt_threads" = yes ; then
7225         ol_link_threads=nt
7226         ol_with_threads=found
7227         ol_with_yielding_select=yes
7228
7229                 cat >> confdefs.h <<\EOF
7230 #define HAVE_NT_SERVICE_MANAGER 1
7231 EOF
7232
7233                 cat >> confdefs.h <<\EOF
7234 #define HAVE_NT_EVENT_LOG 1
7235 EOF
7236
7237         fi
7238
7239         if test $ol_with_threads = nt ; then
7240                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7241         fi
7242 fi
7243
7244 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7245         -o $ol_with_threads = posix ; then
7246
7247         for ac_hdr in pthread.h
7248 do
7249 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7250 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7251 echo "configure:7252: checking for $ac_hdr" >&5
7252 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7253   echo $ac_n "(cached) $ac_c" 1>&6
7254 else
7255   cat > conftest.$ac_ext <<EOF
7256 #line 7257 "configure"
7257 #include "confdefs.h"
7258 #include <$ac_hdr>
7259 EOF
7260 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7261 { (eval echo configure:7262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7262 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7263 if test -z "$ac_err"; then
7264   rm -rf conftest*
7265   eval "ac_cv_header_$ac_safe=yes"
7266 else
7267   echo "$ac_err" >&5
7268   echo "configure: failed program was:" >&5
7269   cat conftest.$ac_ext >&5
7270   rm -rf conftest*
7271   eval "ac_cv_header_$ac_safe=no"
7272 fi
7273 rm -f conftest*
7274 fi
7275 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7276   echo "$ac_t""yes" 1>&6
7277     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7278   cat >> confdefs.h <<EOF
7279 #define $ac_tr_hdr 1
7280 EOF
7281  
7282 else
7283   echo "$ac_t""no" 1>&6
7284 fi
7285 done
7286
7287
7288         if test $ac_cv_header_pthread_h = yes ; then
7289                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7290 echo "configure:7291: checking POSIX thread version" >&5
7291 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
7292   echo $ac_n "(cached) $ac_c" 1>&6
7293 else
7294   
7295         cat > conftest.$ac_ext <<EOF
7296 #line 7297 "configure"
7297 #include "confdefs.h"
7298
7299 #               include <pthread.h>
7300                 /* this check could be improved */
7301 #               ifdef PTHREAD_ONCE_INIT
7302                         pthread_version_final;
7303 #               endif
7304         
7305 EOF
7306 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7307   egrep "pthread_version_final" >/dev/null 2>&1; then
7308   rm -rf conftest*
7309   ol_pthread_final=yes
7310 else
7311   rm -rf conftest*
7312   ol_pthread_final=no
7313 fi
7314 rm -f conftest*
7315
7316
7317         cat > conftest.$ac_ext <<EOF
7318 #line 7319 "configure"
7319 #include "confdefs.h"
7320
7321 #               include <pthread.h>
7322                 /* this check could be improved */
7323 #               ifdef pthread_once_init
7324                         pthread_version_draft4;
7325 #               endif
7326         
7327 EOF
7328 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7329   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7330   rm -rf conftest*
7331   ol_pthread_draft4=yes
7332 else
7333   rm -rf conftest*
7334   ol_pthread_draft4=no
7335 fi
7336 rm -f conftest*
7337
7338
7339         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7340                 ol_cv_pthread_version=final
7341         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7342                 ol_cv_pthread_version=draft4
7343         else
7344                 ol_cv_pthread_version=unknown
7345         fi
7346
7347 fi
7348
7349 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7350
7351
7352                 if test $ol_cv_pthread_version = final ; then
7353                         cat >> confdefs.h <<\EOF
7354 #define HAVE_PTHREADS_FINAL 1
7355 EOF
7356
7357                 elif test $ol_cv_pthread_version = draft4 ; then
7358                         cat >> confdefs.h <<\EOF
7359 #define HAVE_PTHREADS_D4 1
7360 EOF
7361
7362                 else
7363                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7364                 fi
7365
7366                 # consider threads found
7367                 ol_with_threads=found
7368
7369                 
7370         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7371 echo "configure:7372: checking for LinuxThreads pthread.h" >&5
7372 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7373   echo $ac_n "(cached) $ac_c" 1>&6
7374 else
7375   cat > conftest.$ac_ext <<EOF
7376 #line 7377 "configure"
7377 #include "confdefs.h"
7378 #include <pthread.h>
7379 EOF
7380 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7381   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7382   rm -rf conftest*
7383   ol_cv_header_linux_threads=yes
7384 else
7385   rm -rf conftest*
7386   ol_cv_header_linux_threads=no
7387 fi
7388 rm -f conftest*
7389
7390                 
7391 fi
7392
7393 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7394         if test $ol_cv_header_linux_threads = yes; then
7395                 cat >> confdefs.h <<\EOF
7396 #define HAVE_LINUX_THREADS 1
7397 EOF
7398
7399         fi
7400
7401                 
7402         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7403 echo "configure:7404: checking for GNU Pth pthread.h" >&5
7404 if eval "test \"`echo '$''{'ol_cv_header_gnu_pth_pthread_h'+set}'`\" = set"; then
7405   echo $ac_n "(cached) $ac_c" 1>&6
7406 else
7407   cat > conftest.$ac_ext <<EOF
7408 #line 7409 "configure"
7409 #include "confdefs.h"
7410 #include <pthread.h>
7411 #ifdef _POSIX_THREAD_IS_GNU_PTH
7412         __gnu_pth__;
7413 #endif
7414
7415 EOF
7416 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7417   egrep "__gnu_pth__" >/dev/null 2>&1; then
7418   rm -rf conftest*
7419   ol_cv_header_gnu_pth_pthread_h=yes
7420 else
7421   rm -rf conftest*
7422   ol_cv_header_gnu_pth_pthread_h=no
7423 fi
7424 rm -f conftest*
7425
7426                 
7427 fi
7428
7429 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7430
7431
7432                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7433                         for ac_hdr in sched.h
7434 do
7435 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7436 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7437 echo "configure:7438: checking for $ac_hdr" >&5
7438 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7439   echo $ac_n "(cached) $ac_c" 1>&6
7440 else
7441   cat > conftest.$ac_ext <<EOF
7442 #line 7443 "configure"
7443 #include "confdefs.h"
7444 #include <$ac_hdr>
7445 EOF
7446 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7447 { (eval echo configure:7448: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7448 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7449 if test -z "$ac_err"; then
7450   rm -rf conftest*
7451   eval "ac_cv_header_$ac_safe=yes"
7452 else
7453   echo "$ac_err" >&5
7454   echo "configure: failed program was:" >&5
7455   cat conftest.$ac_ext >&5
7456   rm -rf conftest*
7457   eval "ac_cv_header_$ac_safe=no"
7458 fi
7459 rm -f conftest*
7460 fi
7461 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7462   echo "$ac_t""yes" 1>&6
7463     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7464   cat >> confdefs.h <<EOF
7465 #define $ac_tr_hdr 1
7466 EOF
7467  
7468 else
7469   echo "$ac_t""no" 1>&6
7470 fi
7471 done
7472
7473                 fi
7474
7475                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7476                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7477 echo "configure:7478: checking for pthread_create in default libraries" >&5
7478 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
7479   echo $ac_n "(cached) $ac_c" 1>&6
7480 else
7481   
7482                 if test "$cross_compiling" = yes; then
7483   cat > conftest.$ac_ext <<EOF
7484 #line 7485 "configure"
7485 #include "confdefs.h"
7486 /* pthread test headers */
7487 #include <pthread.h>
7488 #ifndef NULL
7489 #define NULL (void*)0
7490 #endif
7491
7492 static void *task(p)
7493         void *p;
7494 {
7495         return (void *) (p == NULL);
7496 }
7497
7498 int main() {
7499
7500         /* pthread test function */
7501         pthread_t t;
7502         int status;
7503         int detach = 1;
7504
7505 #ifdef HAVE_PTHREADS_FINAL
7506         /* Final pthreads */
7507         pthread_attr_t attr;
7508
7509         status = pthread_attr_init(&attr);
7510         if( status ) return status;
7511
7512 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7513         if( !detach ) {
7514 #if defined( PTHREAD_CREATE_JOINABLE )
7515                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7516 #else
7517                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7518 #endif
7519
7520 #ifdef PTHREAD_CREATE_DETACHED
7521         } else {
7522                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7523 #endif
7524         }
7525         if( status ) return status;
7526 #endif
7527
7528         status = pthread_create( &t, &attr, task, NULL );
7529         if( status ) return status;
7530
7531 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7532         if( detach ) {
7533                 /* give thread a chance to complete */
7534                 /* it should remain joinable and hence detachable */
7535                 sleep( 1 );
7536
7537                 status = pthread_detach( t );
7538                 if( status ) return status;
7539         }
7540 #endif
7541
7542 #else
7543         /* Draft 4 pthreads */
7544         status = pthread_create( &t, pthread_attr_default, task, NULL );
7545         if( status ) return status;
7546
7547         if( detach ) {
7548                 /* give thread a chance to complete */
7549                 /* it should remain joinable and hence detachable */
7550                 sleep( 1 );
7551
7552                 status = pthread_detach( &t );
7553                 if( status ) return status;
7554         }
7555 #endif
7556
7557 #ifdef HAVE_LINUX_THREADS
7558         pthread_kill_other_threads_np();
7559 #endif
7560
7561         return 0;
7562
7563 ; return 0; }
7564 EOF
7565 if { (eval echo configure:7566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7566   rm -rf conftest*
7567   ol_cv_pthread_create=yes
7568 else
7569   echo "configure: failed program was:" >&5
7570   cat conftest.$ac_ext >&5
7571   rm -rf conftest*
7572   ol_cv_pthread_create=no
7573 fi
7574 rm -f conftest*
7575 else
7576   cat > conftest.$ac_ext <<EOF
7577 #line 7578 "configure"
7578 #include "confdefs.h"
7579 /* pthread test headers */
7580 #include <pthread.h>
7581 #ifndef NULL
7582 #define NULL (void*)0
7583 #endif
7584
7585 static void *task(p)
7586         void *p;
7587 {
7588         return (void *) (p == NULL);
7589 }
7590
7591
7592 int main(argc, argv)
7593         int argc;
7594         char **argv;
7595 {
7596
7597         /* pthread test function */
7598         pthread_t t;
7599         int status;
7600         int detach = 1;
7601
7602 #ifdef HAVE_PTHREADS_FINAL
7603         /* Final pthreads */
7604         pthread_attr_t attr;
7605
7606         status = pthread_attr_init(&attr);
7607         if( status ) return status;
7608
7609 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7610         if( !detach ) {
7611 #if defined( PTHREAD_CREATE_JOINABLE )
7612                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7613 #else
7614                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7615 #endif
7616
7617 #ifdef PTHREAD_CREATE_DETACHED
7618         } else {
7619                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7620 #endif
7621         }
7622         if( status ) return status;
7623 #endif
7624
7625         status = pthread_create( &t, &attr, task, NULL );
7626         if( status ) return status;
7627
7628 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7629         if( detach ) {
7630                 /* give thread a chance to complete */
7631                 /* it should remain joinable and hence detachable */
7632                 sleep( 1 );
7633
7634                 status = pthread_detach( t );
7635                 if( status ) return status;
7636         }
7637 #endif
7638
7639 #else
7640         /* Draft 4 pthreads */
7641         status = pthread_create( &t, pthread_attr_default, task, NULL );
7642         if( status ) return status;
7643
7644         if( detach ) {
7645                 /* give thread a chance to complete */
7646                 /* it should remain joinable and hence detachable */
7647                 sleep( 1 );
7648
7649                 status = pthread_detach( &t );
7650                 if( status ) return status;
7651         }
7652 #endif
7653
7654 #ifdef HAVE_LINUX_THREADS
7655         pthread_kill_other_threads_np();
7656 #endif
7657
7658         return 0;
7659
7660 }
7661
7662 EOF
7663 if { (eval echo configure:7664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7664 then
7665   ol_cv_pthread_create=yes
7666 else
7667   echo "configure: failed program was:" >&5
7668   cat conftest.$ac_ext >&5
7669   rm -fr conftest*
7670   ol_cv_pthread_create=no
7671 fi
7672 rm -fr conftest*
7673 fi
7674
7675 fi
7676
7677 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7678
7679                 if test $ol_cv_pthread_create != no ; then
7680                         ol_link_threads=posix
7681                         ol_link_pthreads=""
7682                 fi
7683                 
7684                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7685 if test "$ol_link_threads" = no ; then
7686         # try -kthread
7687         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7688 echo "configure:7689: checking for pthread link with -kthread" >&5
7689 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
7690   echo $ac_n "(cached) $ac_c" 1>&6
7691 else
7692   
7693                 # save the flags
7694                 ol_LIBS="$LIBS"
7695                 LIBS="-kthread $LIBS"
7696
7697                 if test "$cross_compiling" = yes; then
7698   cat > conftest.$ac_ext <<EOF
7699 #line 7700 "configure"
7700 #include "confdefs.h"
7701 /* pthread test headers */
7702 #include <pthread.h>
7703 #ifndef NULL
7704 #define NULL (void*)0
7705 #endif
7706
7707 static void *task(p)
7708         void *p;
7709 {
7710         return (void *) (p == NULL);
7711 }
7712
7713 int main() {
7714
7715         /* pthread test function */
7716         pthread_t t;
7717         int status;
7718         int detach = 1;
7719
7720 #ifdef HAVE_PTHREADS_FINAL
7721         /* Final pthreads */
7722         pthread_attr_t attr;
7723
7724         status = pthread_attr_init(&attr);
7725         if( status ) return status;
7726
7727 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7728         if( !detach ) {
7729 #if defined( PTHREAD_CREATE_JOINABLE )
7730                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7731 #else
7732                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7733 #endif
7734
7735 #ifdef PTHREAD_CREATE_DETACHED
7736         } else {
7737                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7738 #endif
7739         }
7740         if( status ) return status;
7741 #endif
7742
7743         status = pthread_create( &t, &attr, task, NULL );
7744         if( status ) return status;
7745
7746 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7747         if( detach ) {
7748                 /* give thread a chance to complete */
7749                 /* it should remain joinable and hence detachable */
7750                 sleep( 1 );
7751
7752                 status = pthread_detach( t );
7753                 if( status ) return status;
7754         }
7755 #endif
7756
7757 #else
7758         /* Draft 4 pthreads */
7759         status = pthread_create( &t, pthread_attr_default, task, NULL );
7760         if( status ) return status;
7761
7762         if( detach ) {
7763                 /* give thread a chance to complete */
7764                 /* it should remain joinable and hence detachable */
7765                 sleep( 1 );
7766
7767                 status = pthread_detach( &t );
7768                 if( status ) return status;
7769         }
7770 #endif
7771
7772 #ifdef HAVE_LINUX_THREADS
7773         pthread_kill_other_threads_np();
7774 #endif
7775
7776         return 0;
7777
7778 ; return 0; }
7779 EOF
7780 if { (eval echo configure:7781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7781   rm -rf conftest*
7782   ol_cv_pthread_kthread=yes
7783 else
7784   echo "configure: failed program was:" >&5
7785   cat conftest.$ac_ext >&5
7786   rm -rf conftest*
7787   ol_cv_pthread_kthread=no
7788 fi
7789 rm -f conftest*
7790 else
7791   cat > conftest.$ac_ext <<EOF
7792 #line 7793 "configure"
7793 #include "confdefs.h"
7794 /* pthread test headers */
7795 #include <pthread.h>
7796 #ifndef NULL
7797 #define NULL (void*)0
7798 #endif
7799
7800 static void *task(p)
7801         void *p;
7802 {
7803         return (void *) (p == NULL);
7804 }
7805
7806
7807 int main(argc, argv)
7808         int argc;
7809         char **argv;
7810 {
7811
7812         /* pthread test function */
7813         pthread_t t;
7814         int status;
7815         int detach = 1;
7816
7817 #ifdef HAVE_PTHREADS_FINAL
7818         /* Final pthreads */
7819         pthread_attr_t attr;
7820
7821         status = pthread_attr_init(&attr);
7822         if( status ) return status;
7823
7824 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7825         if( !detach ) {
7826 #if defined( PTHREAD_CREATE_JOINABLE )
7827                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7828 #else
7829                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7830 #endif
7831
7832 #ifdef PTHREAD_CREATE_DETACHED
7833         } else {
7834                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7835 #endif
7836         }
7837         if( status ) return status;
7838 #endif
7839
7840         status = pthread_create( &t, &attr, task, NULL );
7841         if( status ) return status;
7842
7843 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7844         if( detach ) {
7845                 /* give thread a chance to complete */
7846                 /* it should remain joinable and hence detachable */
7847                 sleep( 1 );
7848
7849                 status = pthread_detach( t );
7850                 if( status ) return status;
7851         }
7852 #endif
7853
7854 #else
7855         /* Draft 4 pthreads */
7856         status = pthread_create( &t, pthread_attr_default, task, NULL );
7857         if( status ) return status;
7858
7859         if( detach ) {
7860                 /* give thread a chance to complete */
7861                 /* it should remain joinable and hence detachable */
7862                 sleep( 1 );
7863
7864                 status = pthread_detach( &t );
7865                 if( status ) return status;
7866         }
7867 #endif
7868
7869 #ifdef HAVE_LINUX_THREADS
7870         pthread_kill_other_threads_np();
7871 #endif
7872
7873         return 0;
7874
7875 }
7876
7877 EOF
7878 if { (eval echo configure:7879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7879 then
7880   ol_cv_pthread_kthread=yes
7881 else
7882   echo "configure: failed program was:" >&5
7883   cat conftest.$ac_ext >&5
7884   rm -fr conftest*
7885   ol_cv_pthread_kthread=no
7886 fi
7887 rm -fr conftest*
7888 fi
7889
7890
7891                 # restore the LIBS
7892                 LIBS="$ol_LIBS"
7893         
7894 fi
7895
7896 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7897
7898         if test $ol_cv_pthread_kthread = yes ; then
7899                 ol_link_pthreads="-kthread"
7900                 ol_link_threads=posix
7901         fi
7902 fi
7903
7904                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7905 if test "$ol_link_threads" = no ; then
7906         # try -pthread
7907         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7908 echo "configure:7909: checking for pthread link with -pthread" >&5
7909 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
7910   echo $ac_n "(cached) $ac_c" 1>&6
7911 else
7912   
7913                 # save the flags
7914                 ol_LIBS="$LIBS"
7915                 LIBS="-pthread $LIBS"
7916
7917                 if test "$cross_compiling" = yes; then
7918   cat > conftest.$ac_ext <<EOF
7919 #line 7920 "configure"
7920 #include "confdefs.h"
7921 /* pthread test headers */
7922 #include <pthread.h>
7923 #ifndef NULL
7924 #define NULL (void*)0
7925 #endif
7926
7927 static void *task(p)
7928         void *p;
7929 {
7930         return (void *) (p == NULL);
7931 }
7932
7933 int main() {
7934
7935         /* pthread test function */
7936         pthread_t t;
7937         int status;
7938         int detach = 1;
7939
7940 #ifdef HAVE_PTHREADS_FINAL
7941         /* Final pthreads */
7942         pthread_attr_t attr;
7943
7944         status = pthread_attr_init(&attr);
7945         if( status ) return status;
7946
7947 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7948         if( !detach ) {
7949 #if defined( PTHREAD_CREATE_JOINABLE )
7950                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7951 #else
7952                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7953 #endif
7954
7955 #ifdef PTHREAD_CREATE_DETACHED
7956         } else {
7957                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7958 #endif
7959         }
7960         if( status ) return status;
7961 #endif
7962
7963         status = pthread_create( &t, &attr, task, NULL );
7964         if( status ) return status;
7965
7966 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7967         if( detach ) {
7968                 /* give thread a chance to complete */
7969                 /* it should remain joinable and hence detachable */
7970                 sleep( 1 );
7971
7972                 status = pthread_detach( t );
7973                 if( status ) return status;
7974         }
7975 #endif
7976
7977 #else
7978         /* Draft 4 pthreads */
7979         status = pthread_create( &t, pthread_attr_default, task, NULL );
7980         if( status ) return status;
7981
7982         if( detach ) {
7983                 /* give thread a chance to complete */
7984                 /* it should remain joinable and hence detachable */
7985                 sleep( 1 );
7986
7987                 status = pthread_detach( &t );
7988                 if( status ) return status;
7989         }
7990 #endif
7991
7992 #ifdef HAVE_LINUX_THREADS
7993         pthread_kill_other_threads_np();
7994 #endif
7995
7996         return 0;
7997
7998 ; return 0; }
7999 EOF
8000 if { (eval echo configure:8001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8001   rm -rf conftest*
8002   ol_cv_pthread_pthread=yes
8003 else
8004   echo "configure: failed program was:" >&5
8005   cat conftest.$ac_ext >&5
8006   rm -rf conftest*
8007   ol_cv_pthread_pthread=no
8008 fi
8009 rm -f conftest*
8010 else
8011   cat > conftest.$ac_ext <<EOF
8012 #line 8013 "configure"
8013 #include "confdefs.h"
8014 /* pthread test headers */
8015 #include <pthread.h>
8016 #ifndef NULL
8017 #define NULL (void*)0
8018 #endif
8019
8020 static void *task(p)
8021         void *p;
8022 {
8023         return (void *) (p == NULL);
8024 }
8025
8026
8027 int main(argc, argv)
8028         int argc;
8029         char **argv;
8030 {
8031
8032         /* pthread test function */
8033         pthread_t t;
8034         int status;
8035         int detach = 1;
8036
8037 #ifdef HAVE_PTHREADS_FINAL
8038         /* Final pthreads */
8039         pthread_attr_t attr;
8040
8041         status = pthread_attr_init(&attr);
8042         if( status ) return status;
8043
8044 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8045         if( !detach ) {
8046 #if defined( PTHREAD_CREATE_JOINABLE )
8047                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8048 #else
8049                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8050 #endif
8051
8052 #ifdef PTHREAD_CREATE_DETACHED
8053         } else {
8054                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8055 #endif
8056         }
8057         if( status ) return status;
8058 #endif
8059
8060         status = pthread_create( &t, &attr, task, NULL );
8061         if( status ) return status;
8062
8063 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8064         if( detach ) {
8065                 /* give thread a chance to complete */
8066                 /* it should remain joinable and hence detachable */
8067                 sleep( 1 );
8068
8069                 status = pthread_detach( t );
8070                 if( status ) return status;
8071         }
8072 #endif
8073
8074 #else
8075         /* Draft 4 pthreads */
8076         status = pthread_create( &t, pthread_attr_default, task, NULL );
8077         if( status ) return status;
8078
8079         if( detach ) {
8080                 /* give thread a chance to complete */
8081                 /* it should remain joinable and hence detachable */
8082                 sleep( 1 );
8083
8084                 status = pthread_detach( &t );
8085                 if( status ) return status;
8086         }
8087 #endif
8088
8089 #ifdef HAVE_LINUX_THREADS
8090         pthread_kill_other_threads_np();
8091 #endif
8092
8093         return 0;
8094
8095 }
8096
8097 EOF
8098 if { (eval echo configure:8099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8099 then
8100   ol_cv_pthread_pthread=yes
8101 else
8102   echo "configure: failed program was:" >&5
8103   cat conftest.$ac_ext >&5
8104   rm -fr conftest*
8105   ol_cv_pthread_pthread=no
8106 fi
8107 rm -fr conftest*
8108 fi
8109
8110
8111                 # restore the LIBS
8112                 LIBS="$ol_LIBS"
8113         
8114 fi
8115
8116 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8117
8118         if test $ol_cv_pthread_pthread = yes ; then
8119                 ol_link_pthreads="-pthread"
8120                 ol_link_threads=posix
8121         fi
8122 fi
8123
8124                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8125 if test "$ol_link_threads" = no ; then
8126         # try -pthreads
8127         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8128 echo "configure:8129: checking for pthread link with -pthreads" >&5
8129 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
8130   echo $ac_n "(cached) $ac_c" 1>&6
8131 else
8132   
8133                 # save the flags
8134                 ol_LIBS="$LIBS"
8135                 LIBS="-pthreads $LIBS"
8136
8137                 if test "$cross_compiling" = yes; then
8138   cat > conftest.$ac_ext <<EOF
8139 #line 8140 "configure"
8140 #include "confdefs.h"
8141 /* pthread test headers */
8142 #include <pthread.h>
8143 #ifndef NULL
8144 #define NULL (void*)0
8145 #endif
8146
8147 static void *task(p)
8148         void *p;
8149 {
8150         return (void *) (p == NULL);
8151 }
8152
8153 int main() {
8154
8155         /* pthread test function */
8156         pthread_t t;
8157         int status;
8158         int detach = 1;
8159
8160 #ifdef HAVE_PTHREADS_FINAL
8161         /* Final pthreads */
8162         pthread_attr_t attr;
8163
8164         status = pthread_attr_init(&attr);
8165         if( status ) return status;
8166
8167 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8168         if( !detach ) {
8169 #if defined( PTHREAD_CREATE_JOINABLE )
8170                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8171 #else
8172                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8173 #endif
8174
8175 #ifdef PTHREAD_CREATE_DETACHED
8176         } else {
8177                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8178 #endif
8179         }
8180         if( status ) return status;
8181 #endif
8182
8183         status = pthread_create( &t, &attr, task, NULL );
8184         if( status ) return status;
8185
8186 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8187         if( detach ) {
8188                 /* give thread a chance to complete */
8189                 /* it should remain joinable and hence detachable */
8190                 sleep( 1 );
8191
8192                 status = pthread_detach( t );
8193                 if( status ) return status;
8194         }
8195 #endif
8196
8197 #else
8198         /* Draft 4 pthreads */
8199         status = pthread_create( &t, pthread_attr_default, task, NULL );
8200         if( status ) return status;
8201
8202         if( detach ) {
8203                 /* give thread a chance to complete */
8204                 /* it should remain joinable and hence detachable */
8205                 sleep( 1 );
8206
8207                 status = pthread_detach( &t );
8208                 if( status ) return status;
8209         }
8210 #endif
8211
8212 #ifdef HAVE_LINUX_THREADS
8213         pthread_kill_other_threads_np();
8214 #endif
8215
8216         return 0;
8217
8218 ; return 0; }
8219 EOF
8220 if { (eval echo configure:8221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8221   rm -rf conftest*
8222   ol_cv_pthread_pthreads=yes
8223 else
8224   echo "configure: failed program was:" >&5
8225   cat conftest.$ac_ext >&5
8226   rm -rf conftest*
8227   ol_cv_pthread_pthreads=no
8228 fi
8229 rm -f conftest*
8230 else
8231   cat > conftest.$ac_ext <<EOF
8232 #line 8233 "configure"
8233 #include "confdefs.h"
8234 /* pthread test headers */
8235 #include <pthread.h>
8236 #ifndef NULL
8237 #define NULL (void*)0
8238 #endif
8239
8240 static void *task(p)
8241         void *p;
8242 {
8243         return (void *) (p == NULL);
8244 }
8245
8246
8247 int main(argc, argv)
8248         int argc;
8249         char **argv;
8250 {
8251
8252         /* pthread test function */
8253         pthread_t t;
8254         int status;
8255         int detach = 1;
8256
8257 #ifdef HAVE_PTHREADS_FINAL
8258         /* Final pthreads */
8259         pthread_attr_t attr;
8260
8261         status = pthread_attr_init(&attr);
8262         if( status ) return status;
8263
8264 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8265         if( !detach ) {
8266 #if defined( PTHREAD_CREATE_JOINABLE )
8267                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8268 #else
8269                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8270 #endif
8271
8272 #ifdef PTHREAD_CREATE_DETACHED
8273         } else {
8274                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8275 #endif
8276         }
8277         if( status ) return status;
8278 #endif
8279
8280         status = pthread_create( &t, &attr, task, NULL );
8281         if( status ) return status;
8282
8283 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8284         if( detach ) {
8285                 /* give thread a chance to complete */
8286                 /* it should remain joinable and hence detachable */
8287                 sleep( 1 );
8288
8289                 status = pthread_detach( t );
8290                 if( status ) return status;
8291         }
8292 #endif
8293
8294 #else
8295         /* Draft 4 pthreads */
8296         status = pthread_create( &t, pthread_attr_default, task, NULL );
8297         if( status ) return status;
8298
8299         if( detach ) {
8300                 /* give thread a chance to complete */
8301                 /* it should remain joinable and hence detachable */
8302                 sleep( 1 );
8303
8304                 status = pthread_detach( &t );
8305                 if( status ) return status;
8306         }
8307 #endif
8308
8309 #ifdef HAVE_LINUX_THREADS
8310         pthread_kill_other_threads_np();
8311 #endif
8312
8313         return 0;
8314
8315 }
8316
8317 EOF
8318 if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8319 then
8320   ol_cv_pthread_pthreads=yes
8321 else
8322   echo "configure: failed program was:" >&5
8323   cat conftest.$ac_ext >&5
8324   rm -fr conftest*
8325   ol_cv_pthread_pthreads=no
8326 fi
8327 rm -fr conftest*
8328 fi
8329
8330
8331                 # restore the LIBS
8332                 LIBS="$ol_LIBS"
8333         
8334 fi
8335
8336 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8337
8338         if test $ol_cv_pthread_pthreads = yes ; then
8339                 ol_link_pthreads="-pthreads"
8340                 ol_link_threads=posix
8341         fi
8342 fi
8343
8344                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8345 if test "$ol_link_threads" = no ; then
8346         # try -mthreads
8347         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8348 echo "configure:8349: checking for pthread link with -mthreads" >&5
8349 if eval "test \"`echo '$''{'ol_cv_pthread_mthreads'+set}'`\" = set"; then
8350   echo $ac_n "(cached) $ac_c" 1>&6
8351 else
8352   
8353                 # save the flags
8354                 ol_LIBS="$LIBS"
8355                 LIBS="-mthreads $LIBS"
8356
8357                 if test "$cross_compiling" = yes; then
8358   cat > conftest.$ac_ext <<EOF
8359 #line 8360 "configure"
8360 #include "confdefs.h"
8361 /* pthread test headers */
8362 #include <pthread.h>
8363 #ifndef NULL
8364 #define NULL (void*)0
8365 #endif
8366
8367 static void *task(p)
8368         void *p;
8369 {
8370         return (void *) (p == NULL);
8371 }
8372
8373 int main() {
8374
8375         /* pthread test function */
8376         pthread_t t;
8377         int status;
8378         int detach = 1;
8379
8380 #ifdef HAVE_PTHREADS_FINAL
8381         /* Final pthreads */
8382         pthread_attr_t attr;
8383
8384         status = pthread_attr_init(&attr);
8385         if( status ) return status;
8386
8387 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8388         if( !detach ) {
8389 #if defined( PTHREAD_CREATE_JOINABLE )
8390                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8391 #else
8392                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8393 #endif
8394
8395 #ifdef PTHREAD_CREATE_DETACHED
8396         } else {
8397                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8398 #endif
8399         }
8400         if( status ) return status;
8401 #endif
8402
8403         status = pthread_create( &t, &attr, task, NULL );
8404         if( status ) return status;
8405
8406 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8407         if( detach ) {
8408                 /* give thread a chance to complete */
8409                 /* it should remain joinable and hence detachable */
8410                 sleep( 1 );
8411
8412                 status = pthread_detach( t );
8413                 if( status ) return status;
8414         }
8415 #endif
8416
8417 #else
8418         /* Draft 4 pthreads */
8419         status = pthread_create( &t, pthread_attr_default, task, NULL );
8420         if( status ) return status;
8421
8422         if( detach ) {
8423                 /* give thread a chance to complete */
8424                 /* it should remain joinable and hence detachable */
8425                 sleep( 1 );
8426
8427                 status = pthread_detach( &t );
8428                 if( status ) return status;
8429         }
8430 #endif
8431
8432 #ifdef HAVE_LINUX_THREADS
8433         pthread_kill_other_threads_np();
8434 #endif
8435
8436         return 0;
8437
8438 ; return 0; }
8439 EOF
8440 if { (eval echo configure:8441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8441   rm -rf conftest*
8442   ol_cv_pthread_mthreads=yes
8443 else
8444   echo "configure: failed program was:" >&5
8445   cat conftest.$ac_ext >&5
8446   rm -rf conftest*
8447   ol_cv_pthread_mthreads=no
8448 fi
8449 rm -f conftest*
8450 else
8451   cat > conftest.$ac_ext <<EOF
8452 #line 8453 "configure"
8453 #include "confdefs.h"
8454 /* pthread test headers */
8455 #include <pthread.h>
8456 #ifndef NULL
8457 #define NULL (void*)0
8458 #endif
8459
8460 static void *task(p)
8461         void *p;
8462 {
8463         return (void *) (p == NULL);
8464 }
8465
8466
8467 int main(argc, argv)
8468         int argc;
8469         char **argv;
8470 {
8471
8472         /* pthread test function */
8473         pthread_t t;
8474         int status;
8475         int detach = 1;
8476
8477 #ifdef HAVE_PTHREADS_FINAL
8478         /* Final pthreads */
8479         pthread_attr_t attr;
8480
8481         status = pthread_attr_init(&attr);
8482         if( status ) return status;
8483
8484 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8485         if( !detach ) {
8486 #if defined( PTHREAD_CREATE_JOINABLE )
8487                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8488 #else
8489                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8490 #endif
8491
8492 #ifdef PTHREAD_CREATE_DETACHED
8493         } else {
8494                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8495 #endif
8496         }
8497         if( status ) return status;
8498 #endif
8499
8500         status = pthread_create( &t, &attr, task, NULL );
8501         if( status ) return status;
8502
8503 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8504         if( detach ) {
8505                 /* give thread a chance to complete */
8506                 /* it should remain joinable and hence detachable */
8507                 sleep( 1 );
8508
8509                 status = pthread_detach( t );
8510                 if( status ) return status;
8511         }
8512 #endif
8513
8514 #else
8515         /* Draft 4 pthreads */
8516         status = pthread_create( &t, pthread_attr_default, task, NULL );
8517         if( status ) return status;
8518
8519         if( detach ) {
8520                 /* give thread a chance to complete */
8521                 /* it should remain joinable and hence detachable */
8522                 sleep( 1 );
8523
8524                 status = pthread_detach( &t );
8525                 if( status ) return status;
8526         }
8527 #endif
8528
8529 #ifdef HAVE_LINUX_THREADS
8530         pthread_kill_other_threads_np();
8531 #endif
8532
8533         return 0;
8534
8535 }
8536
8537 EOF
8538 if { (eval echo configure:8539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8539 then
8540   ol_cv_pthread_mthreads=yes
8541 else
8542   echo "configure: failed program was:" >&5
8543   cat conftest.$ac_ext >&5
8544   rm -fr conftest*
8545   ol_cv_pthread_mthreads=no
8546 fi
8547 rm -fr conftest*
8548 fi
8549
8550
8551                 # restore the LIBS
8552                 LIBS="$ol_LIBS"
8553         
8554 fi
8555
8556 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8557
8558         if test $ol_cv_pthread_mthreads = yes ; then
8559                 ol_link_pthreads="-mthreads"
8560                 ol_link_threads=posix
8561         fi
8562 fi
8563
8564                 # Pthread try link: -thread (ol_cv_pthread_thread)
8565 if test "$ol_link_threads" = no ; then
8566         # try -thread
8567         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8568 echo "configure:8569: checking for pthread link with -thread" >&5
8569 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
8570   echo $ac_n "(cached) $ac_c" 1>&6
8571 else
8572   
8573                 # save the flags
8574                 ol_LIBS="$LIBS"
8575                 LIBS="-thread $LIBS"
8576
8577                 if test "$cross_compiling" = yes; then
8578   cat > conftest.$ac_ext <<EOF
8579 #line 8580 "configure"
8580 #include "confdefs.h"
8581 /* pthread test headers */
8582 #include <pthread.h>
8583 #ifndef NULL
8584 #define NULL (void*)0
8585 #endif
8586
8587 static void *task(p)
8588         void *p;
8589 {
8590         return (void *) (p == NULL);
8591 }
8592
8593 int main() {
8594
8595         /* pthread test function */
8596         pthread_t t;
8597         int status;
8598         int detach = 1;
8599
8600 #ifdef HAVE_PTHREADS_FINAL
8601         /* Final pthreads */
8602         pthread_attr_t attr;
8603
8604         status = pthread_attr_init(&attr);
8605         if( status ) return status;
8606
8607 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8608         if( !detach ) {
8609 #if defined( PTHREAD_CREATE_JOINABLE )
8610                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8611 #else
8612                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8613 #endif
8614
8615 #ifdef PTHREAD_CREATE_DETACHED
8616         } else {
8617                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8618 #endif
8619         }
8620         if( status ) return status;
8621 #endif
8622
8623         status = pthread_create( &t, &attr, task, NULL );
8624         if( status ) return status;
8625
8626 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8627         if( detach ) {
8628                 /* give thread a chance to complete */
8629                 /* it should remain joinable and hence detachable */
8630                 sleep( 1 );
8631
8632                 status = pthread_detach( t );
8633                 if( status ) return status;
8634         }
8635 #endif
8636
8637 #else
8638         /* Draft 4 pthreads */
8639         status = pthread_create( &t, pthread_attr_default, task, NULL );
8640         if( status ) return status;
8641
8642         if( detach ) {
8643                 /* give thread a chance to complete */
8644                 /* it should remain joinable and hence detachable */
8645                 sleep( 1 );
8646
8647                 status = pthread_detach( &t );
8648                 if( status ) return status;
8649         }
8650 #endif
8651
8652 #ifdef HAVE_LINUX_THREADS
8653         pthread_kill_other_threads_np();
8654 #endif
8655
8656         return 0;
8657
8658 ; return 0; }
8659 EOF
8660 if { (eval echo configure:8661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8661   rm -rf conftest*
8662   ol_cv_pthread_thread=yes
8663 else
8664   echo "configure: failed program was:" >&5
8665   cat conftest.$ac_ext >&5
8666   rm -rf conftest*
8667   ol_cv_pthread_thread=no
8668 fi
8669 rm -f conftest*
8670 else
8671   cat > conftest.$ac_ext <<EOF
8672 #line 8673 "configure"
8673 #include "confdefs.h"
8674 /* pthread test headers */
8675 #include <pthread.h>
8676 #ifndef NULL
8677 #define NULL (void*)0
8678 #endif
8679
8680 static void *task(p)
8681         void *p;
8682 {
8683         return (void *) (p == NULL);
8684 }
8685
8686
8687 int main(argc, argv)
8688         int argc;
8689         char **argv;
8690 {
8691
8692         /* pthread test function */
8693         pthread_t t;
8694         int status;
8695         int detach = 1;
8696
8697 #ifdef HAVE_PTHREADS_FINAL
8698         /* Final pthreads */
8699         pthread_attr_t attr;
8700
8701         status = pthread_attr_init(&attr);
8702         if( status ) return status;
8703
8704 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8705         if( !detach ) {
8706 #if defined( PTHREAD_CREATE_JOINABLE )
8707                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8708 #else
8709                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8710 #endif
8711
8712 #ifdef PTHREAD_CREATE_DETACHED
8713         } else {
8714                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8715 #endif
8716         }
8717         if( status ) return status;
8718 #endif
8719
8720         status = pthread_create( &t, &attr, task, NULL );
8721         if( status ) return status;
8722
8723 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8724         if( detach ) {
8725                 /* give thread a chance to complete */
8726                 /* it should remain joinable and hence detachable */
8727                 sleep( 1 );
8728
8729                 status = pthread_detach( t );
8730                 if( status ) return status;
8731         }
8732 #endif
8733
8734 #else
8735         /* Draft 4 pthreads */
8736         status = pthread_create( &t, pthread_attr_default, task, NULL );
8737         if( status ) return status;
8738
8739         if( detach ) {
8740                 /* give thread a chance to complete */
8741                 /* it should remain joinable and hence detachable */
8742                 sleep( 1 );
8743
8744                 status = pthread_detach( &t );
8745                 if( status ) return status;
8746         }
8747 #endif
8748
8749 #ifdef HAVE_LINUX_THREADS
8750         pthread_kill_other_threads_np();
8751 #endif
8752
8753         return 0;
8754
8755 }
8756
8757 EOF
8758 if { (eval echo configure:8759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8759 then
8760   ol_cv_pthread_thread=yes
8761 else
8762   echo "configure: failed program was:" >&5
8763   cat conftest.$ac_ext >&5
8764   rm -fr conftest*
8765   ol_cv_pthread_thread=no
8766 fi
8767 rm -fr conftest*
8768 fi
8769
8770
8771                 # restore the LIBS
8772                 LIBS="$ol_LIBS"
8773         
8774 fi
8775
8776 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8777
8778         if test $ol_cv_pthread_thread = yes ; then
8779                 ol_link_pthreads="-thread"
8780                 ol_link_threads=posix
8781         fi
8782 fi
8783
8784
8785                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8786 if test "$ol_link_threads" = no ; then
8787         # try -lpthread -lmach -lexc -lc_r
8788         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8789 echo "configure:8790: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8790 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
8791   echo $ac_n "(cached) $ac_c" 1>&6
8792 else
8793   
8794                 # save the flags
8795                 ol_LIBS="$LIBS"
8796                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8797
8798                 if test "$cross_compiling" = yes; then
8799   cat > conftest.$ac_ext <<EOF
8800 #line 8801 "configure"
8801 #include "confdefs.h"
8802 /* pthread test headers */
8803 #include <pthread.h>
8804 #ifndef NULL
8805 #define NULL (void*)0
8806 #endif
8807
8808 static void *task(p)
8809         void *p;
8810 {
8811         return (void *) (p == NULL);
8812 }
8813
8814 int main() {
8815
8816         /* pthread test function */
8817         pthread_t t;
8818         int status;
8819         int detach = 1;
8820
8821 #ifdef HAVE_PTHREADS_FINAL
8822         /* Final pthreads */
8823         pthread_attr_t attr;
8824
8825         status = pthread_attr_init(&attr);
8826         if( status ) return status;
8827
8828 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8829         if( !detach ) {
8830 #if defined( PTHREAD_CREATE_JOINABLE )
8831                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8832 #else
8833                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8834 #endif
8835
8836 #ifdef PTHREAD_CREATE_DETACHED
8837         } else {
8838                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8839 #endif
8840         }
8841         if( status ) return status;
8842 #endif
8843
8844         status = pthread_create( &t, &attr, task, NULL );
8845         if( status ) return status;
8846
8847 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8848         if( detach ) {
8849                 /* give thread a chance to complete */
8850                 /* it should remain joinable and hence detachable */
8851                 sleep( 1 );
8852
8853                 status = pthread_detach( t );
8854                 if( status ) return status;
8855         }
8856 #endif
8857
8858 #else
8859         /* Draft 4 pthreads */
8860         status = pthread_create( &t, pthread_attr_default, task, NULL );
8861         if( status ) return status;
8862
8863         if( detach ) {
8864                 /* give thread a chance to complete */
8865                 /* it should remain joinable and hence detachable */
8866                 sleep( 1 );
8867
8868                 status = pthread_detach( &t );
8869                 if( status ) return status;
8870         }
8871 #endif
8872
8873 #ifdef HAVE_LINUX_THREADS
8874         pthread_kill_other_threads_np();
8875 #endif
8876
8877         return 0;
8878
8879 ; return 0; }
8880 EOF
8881 if { (eval echo configure:8882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8882   rm -rf conftest*
8883   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8884 else
8885   echo "configure: failed program was:" >&5
8886   cat conftest.$ac_ext >&5
8887   rm -rf conftest*
8888   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8889 fi
8890 rm -f conftest*
8891 else
8892   cat > conftest.$ac_ext <<EOF
8893 #line 8894 "configure"
8894 #include "confdefs.h"
8895 /* pthread test headers */
8896 #include <pthread.h>
8897 #ifndef NULL
8898 #define NULL (void*)0
8899 #endif
8900
8901 static void *task(p)
8902         void *p;
8903 {
8904         return (void *) (p == NULL);
8905 }
8906
8907
8908 int main(argc, argv)
8909         int argc;
8910         char **argv;
8911 {
8912
8913         /* pthread test function */
8914         pthread_t t;
8915         int status;
8916         int detach = 1;
8917
8918 #ifdef HAVE_PTHREADS_FINAL
8919         /* Final pthreads */
8920         pthread_attr_t attr;
8921
8922         status = pthread_attr_init(&attr);
8923         if( status ) return status;
8924
8925 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8926         if( !detach ) {
8927 #if defined( PTHREAD_CREATE_JOINABLE )
8928                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8929 #else
8930                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8931 #endif
8932
8933 #ifdef PTHREAD_CREATE_DETACHED
8934         } else {
8935                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8936 #endif
8937         }
8938         if( status ) return status;
8939 #endif
8940
8941         status = pthread_create( &t, &attr, task, NULL );
8942         if( status ) return status;
8943
8944 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8945         if( detach ) {
8946                 /* give thread a chance to complete */
8947                 /* it should remain joinable and hence detachable */
8948                 sleep( 1 );
8949
8950                 status = pthread_detach( t );
8951                 if( status ) return status;
8952         }
8953 #endif
8954
8955 #else
8956         /* Draft 4 pthreads */
8957         status = pthread_create( &t, pthread_attr_default, task, NULL );
8958         if( status ) return status;
8959
8960         if( detach ) {
8961                 /* give thread a chance to complete */
8962                 /* it should remain joinable and hence detachable */
8963                 sleep( 1 );
8964
8965                 status = pthread_detach( &t );
8966                 if( status ) return status;
8967         }
8968 #endif
8969
8970 #ifdef HAVE_LINUX_THREADS
8971         pthread_kill_other_threads_np();
8972 #endif
8973
8974         return 0;
8975
8976 }
8977
8978 EOF
8979 if { (eval echo configure:8980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8980 then
8981   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8982 else
8983   echo "configure: failed program was:" >&5
8984   cat conftest.$ac_ext >&5
8985   rm -fr conftest*
8986   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8987 fi
8988 rm -fr conftest*
8989 fi
8990
8991
8992                 # restore the LIBS
8993                 LIBS="$ol_LIBS"
8994         
8995 fi
8996
8997 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8998
8999         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9000                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9001                 ol_link_threads=posix
9002         fi
9003 fi
9004
9005                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9006 if test "$ol_link_threads" = no ; then
9007         # try -lpthread -lmach -lexc
9008         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9009 echo "configure:9010: checking for pthread link with -lpthread -lmach -lexc" >&5
9010 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
9011   echo $ac_n "(cached) $ac_c" 1>&6
9012 else
9013   
9014                 # save the flags
9015                 ol_LIBS="$LIBS"
9016                 LIBS="-lpthread -lmach -lexc $LIBS"
9017
9018                 if test "$cross_compiling" = yes; then
9019   cat > conftest.$ac_ext <<EOF
9020 #line 9021 "configure"
9021 #include "confdefs.h"
9022 /* pthread test headers */
9023 #include <pthread.h>
9024 #ifndef NULL
9025 #define NULL (void*)0
9026 #endif
9027
9028 static void *task(p)
9029         void *p;
9030 {
9031         return (void *) (p == NULL);
9032 }
9033
9034 int main() {
9035
9036         /* pthread test function */
9037         pthread_t t;
9038         int status;
9039         int detach = 1;
9040
9041 #ifdef HAVE_PTHREADS_FINAL
9042         /* Final pthreads */
9043         pthread_attr_t attr;
9044
9045         status = pthread_attr_init(&attr);
9046         if( status ) return status;
9047
9048 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9049         if( !detach ) {
9050 #if defined( PTHREAD_CREATE_JOINABLE )
9051                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9052 #else
9053                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9054 #endif
9055
9056 #ifdef PTHREAD_CREATE_DETACHED
9057         } else {
9058                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9059 #endif
9060         }
9061         if( status ) return status;
9062 #endif
9063
9064         status = pthread_create( &t, &attr, task, NULL );
9065         if( status ) return status;
9066
9067 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9068         if( detach ) {
9069                 /* give thread a chance to complete */
9070                 /* it should remain joinable and hence detachable */
9071                 sleep( 1 );
9072
9073                 status = pthread_detach( t );
9074                 if( status ) return status;
9075         }
9076 #endif
9077
9078 #else
9079         /* Draft 4 pthreads */
9080         status = pthread_create( &t, pthread_attr_default, task, NULL );
9081         if( status ) return status;
9082
9083         if( detach ) {
9084                 /* give thread a chance to complete */
9085                 /* it should remain joinable and hence detachable */
9086                 sleep( 1 );
9087
9088                 status = pthread_detach( &t );
9089                 if( status ) return status;
9090         }
9091 #endif
9092
9093 #ifdef HAVE_LINUX_THREADS
9094         pthread_kill_other_threads_np();
9095 #endif
9096
9097         return 0;
9098
9099 ; return 0; }
9100 EOF
9101 if { (eval echo configure:9102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9102   rm -rf conftest*
9103   ol_cv_pthread_lpthread_lmach_lexc=yes
9104 else
9105   echo "configure: failed program was:" >&5
9106   cat conftest.$ac_ext >&5
9107   rm -rf conftest*
9108   ol_cv_pthread_lpthread_lmach_lexc=no
9109 fi
9110 rm -f conftest*
9111 else
9112   cat > conftest.$ac_ext <<EOF
9113 #line 9114 "configure"
9114 #include "confdefs.h"
9115 /* pthread test headers */
9116 #include <pthread.h>
9117 #ifndef NULL
9118 #define NULL (void*)0
9119 #endif
9120
9121 static void *task(p)
9122         void *p;
9123 {
9124         return (void *) (p == NULL);
9125 }
9126
9127
9128 int main(argc, argv)
9129         int argc;
9130         char **argv;
9131 {
9132
9133         /* pthread test function */
9134         pthread_t t;
9135         int status;
9136         int detach = 1;
9137
9138 #ifdef HAVE_PTHREADS_FINAL
9139         /* Final pthreads */
9140         pthread_attr_t attr;
9141
9142         status = pthread_attr_init(&attr);
9143         if( status ) return status;
9144
9145 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9146         if( !detach ) {
9147 #if defined( PTHREAD_CREATE_JOINABLE )
9148                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9149 #else
9150                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9151 #endif
9152
9153 #ifdef PTHREAD_CREATE_DETACHED
9154         } else {
9155                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9156 #endif
9157         }
9158         if( status ) return status;
9159 #endif
9160
9161         status = pthread_create( &t, &attr, task, NULL );
9162         if( status ) return status;
9163
9164 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9165         if( detach ) {
9166                 /* give thread a chance to complete */
9167                 /* it should remain joinable and hence detachable */
9168                 sleep( 1 );
9169
9170                 status = pthread_detach( t );
9171                 if( status ) return status;
9172         }
9173 #endif
9174
9175 #else
9176         /* Draft 4 pthreads */
9177         status = pthread_create( &t, pthread_attr_default, task, NULL );
9178         if( status ) return status;
9179
9180         if( detach ) {
9181                 /* give thread a chance to complete */
9182                 /* it should remain joinable and hence detachable */
9183                 sleep( 1 );
9184
9185                 status = pthread_detach( &t );
9186                 if( status ) return status;
9187         }
9188 #endif
9189
9190 #ifdef HAVE_LINUX_THREADS
9191         pthread_kill_other_threads_np();
9192 #endif
9193
9194         return 0;
9195
9196 }
9197
9198 EOF
9199 if { (eval echo configure:9200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9200 then
9201   ol_cv_pthread_lpthread_lmach_lexc=yes
9202 else
9203   echo "configure: failed program was:" >&5
9204   cat conftest.$ac_ext >&5
9205   rm -fr conftest*
9206   ol_cv_pthread_lpthread_lmach_lexc=no
9207 fi
9208 rm -fr conftest*
9209 fi
9210
9211
9212                 # restore the LIBS
9213                 LIBS="$ol_LIBS"
9214         
9215 fi
9216
9217 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9218
9219         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9220                 ol_link_pthreads="-lpthread -lmach -lexc"
9221                 ol_link_threads=posix
9222         fi
9223 fi
9224
9225
9226                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9227 if test "$ol_link_threads" = no ; then
9228         # try -lpthread -Wl,-woff,85
9229         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9230 echo "configure:9231: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9231 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
9232   echo $ac_n "(cached) $ac_c" 1>&6
9233 else
9234   
9235                 # save the flags
9236                 ol_LIBS="$LIBS"
9237                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9238
9239                 if test "$cross_compiling" = yes; then
9240   cat > conftest.$ac_ext <<EOF
9241 #line 9242 "configure"
9242 #include "confdefs.h"
9243 /* pthread test headers */
9244 #include <pthread.h>
9245 #ifndef NULL
9246 #define NULL (void*)0
9247 #endif
9248
9249 static void *task(p)
9250         void *p;
9251 {
9252         return (void *) (p == NULL);
9253 }
9254
9255 int main() {
9256
9257         /* pthread test function */
9258         pthread_t t;
9259         int status;
9260         int detach = 1;
9261
9262 #ifdef HAVE_PTHREADS_FINAL
9263         /* Final pthreads */
9264         pthread_attr_t attr;
9265
9266         status = pthread_attr_init(&attr);
9267         if( status ) return status;
9268
9269 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9270         if( !detach ) {
9271 #if defined( PTHREAD_CREATE_JOINABLE )
9272                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9273 #else
9274                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9275 #endif
9276
9277 #ifdef PTHREAD_CREATE_DETACHED
9278         } else {
9279                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9280 #endif
9281         }
9282         if( status ) return status;
9283 #endif
9284
9285         status = pthread_create( &t, &attr, task, NULL );
9286         if( status ) return status;
9287
9288 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9289         if( detach ) {
9290                 /* give thread a chance to complete */
9291                 /* it should remain joinable and hence detachable */
9292                 sleep( 1 );
9293
9294                 status = pthread_detach( t );
9295                 if( status ) return status;
9296         }
9297 #endif
9298
9299 #else
9300         /* Draft 4 pthreads */
9301         status = pthread_create( &t, pthread_attr_default, task, NULL );
9302         if( status ) return status;
9303
9304         if( detach ) {
9305                 /* give thread a chance to complete */
9306                 /* it should remain joinable and hence detachable */
9307                 sleep( 1 );
9308
9309                 status = pthread_detach( &t );
9310                 if( status ) return status;
9311         }
9312 #endif
9313
9314 #ifdef HAVE_LINUX_THREADS
9315         pthread_kill_other_threads_np();
9316 #endif
9317
9318         return 0;
9319
9320 ; return 0; }
9321 EOF
9322 if { (eval echo configure:9323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9323   rm -rf conftest*
9324   ol_cv_pthread_lib_lpthread_woff=yes
9325 else
9326   echo "configure: failed program was:" >&5
9327   cat conftest.$ac_ext >&5
9328   rm -rf conftest*
9329   ol_cv_pthread_lib_lpthread_woff=no
9330 fi
9331 rm -f conftest*
9332 else
9333   cat > conftest.$ac_ext <<EOF
9334 #line 9335 "configure"
9335 #include "confdefs.h"
9336 /* pthread test headers */
9337 #include <pthread.h>
9338 #ifndef NULL
9339 #define NULL (void*)0
9340 #endif
9341
9342 static void *task(p)
9343         void *p;
9344 {
9345         return (void *) (p == NULL);
9346 }
9347
9348
9349 int main(argc, argv)
9350         int argc;
9351         char **argv;
9352 {
9353
9354         /* pthread test function */
9355         pthread_t t;
9356         int status;
9357         int detach = 1;
9358
9359 #ifdef HAVE_PTHREADS_FINAL
9360         /* Final pthreads */
9361         pthread_attr_t attr;
9362
9363         status = pthread_attr_init(&attr);
9364         if( status ) return status;
9365
9366 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9367         if( !detach ) {
9368 #if defined( PTHREAD_CREATE_JOINABLE )
9369                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9370 #else
9371                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9372 #endif
9373
9374 #ifdef PTHREAD_CREATE_DETACHED
9375         } else {
9376                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9377 #endif
9378         }
9379         if( status ) return status;
9380 #endif
9381
9382         status = pthread_create( &t, &attr, task, NULL );
9383         if( status ) return status;
9384
9385 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9386         if( detach ) {
9387                 /* give thread a chance to complete */
9388                 /* it should remain joinable and hence detachable */
9389                 sleep( 1 );
9390
9391                 status = pthread_detach( t );
9392                 if( status ) return status;
9393         }
9394 #endif
9395
9396 #else
9397         /* Draft 4 pthreads */
9398         status = pthread_create( &t, pthread_attr_default, task, NULL );
9399         if( status ) return status;
9400
9401         if( detach ) {
9402                 /* give thread a chance to complete */
9403                 /* it should remain joinable and hence detachable */
9404                 sleep( 1 );
9405
9406                 status = pthread_detach( &t );
9407                 if( status ) return status;
9408         }
9409 #endif
9410
9411 #ifdef HAVE_LINUX_THREADS
9412         pthread_kill_other_threads_np();
9413 #endif
9414
9415         return 0;
9416
9417 }
9418
9419 EOF
9420 if { (eval echo configure:9421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9421 then
9422   ol_cv_pthread_lib_lpthread_woff=yes
9423 else
9424   echo "configure: failed program was:" >&5
9425   cat conftest.$ac_ext >&5
9426   rm -fr conftest*
9427   ol_cv_pthread_lib_lpthread_woff=no
9428 fi
9429 rm -fr conftest*
9430 fi
9431
9432
9433                 # restore the LIBS
9434                 LIBS="$ol_LIBS"
9435         
9436 fi
9437
9438 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9439
9440         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9441                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9442                 ol_link_threads=posix
9443         fi
9444 fi
9445
9446
9447                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9448 if test "$ol_link_threads" = no ; then
9449         # try -lpthread
9450         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9451 echo "configure:9452: checking for pthread link with -lpthread" >&5
9452 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
9453   echo $ac_n "(cached) $ac_c" 1>&6
9454 else
9455   
9456                 # save the flags
9457                 ol_LIBS="$LIBS"
9458                 LIBS="-lpthread $LIBS"
9459
9460                 if test "$cross_compiling" = yes; then
9461   cat > conftest.$ac_ext <<EOF
9462 #line 9463 "configure"
9463 #include "confdefs.h"
9464 /* pthread test headers */
9465 #include <pthread.h>
9466 #ifndef NULL
9467 #define NULL (void*)0
9468 #endif
9469
9470 static void *task(p)
9471         void *p;
9472 {
9473         return (void *) (p == NULL);
9474 }
9475
9476 int main() {
9477
9478         /* pthread test function */
9479         pthread_t t;
9480         int status;
9481         int detach = 1;
9482
9483 #ifdef HAVE_PTHREADS_FINAL
9484         /* Final pthreads */
9485         pthread_attr_t attr;
9486
9487         status = pthread_attr_init(&attr);
9488         if( status ) return status;
9489
9490 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9491         if( !detach ) {
9492 #if defined( PTHREAD_CREATE_JOINABLE )
9493                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9494 #else
9495                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9496 #endif
9497
9498 #ifdef PTHREAD_CREATE_DETACHED
9499         } else {
9500                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9501 #endif
9502         }
9503         if( status ) return status;
9504 #endif
9505
9506         status = pthread_create( &t, &attr, task, NULL );
9507         if( status ) return status;
9508
9509 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9510         if( detach ) {
9511                 /* give thread a chance to complete */
9512                 /* it should remain joinable and hence detachable */
9513                 sleep( 1 );
9514
9515                 status = pthread_detach( t );
9516                 if( status ) return status;
9517         }
9518 #endif
9519
9520 #else
9521         /* Draft 4 pthreads */
9522         status = pthread_create( &t, pthread_attr_default, task, NULL );
9523         if( status ) return status;
9524
9525         if( detach ) {
9526                 /* give thread a chance to complete */
9527                 /* it should remain joinable and hence detachable */
9528                 sleep( 1 );
9529
9530                 status = pthread_detach( &t );
9531                 if( status ) return status;
9532         }
9533 #endif
9534
9535 #ifdef HAVE_LINUX_THREADS
9536         pthread_kill_other_threads_np();
9537 #endif
9538
9539         return 0;
9540
9541 ; return 0; }
9542 EOF
9543 if { (eval echo configure:9544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9544   rm -rf conftest*
9545   ol_cv_pthread_lpthread=yes
9546 else
9547   echo "configure: failed program was:" >&5
9548   cat conftest.$ac_ext >&5
9549   rm -rf conftest*
9550   ol_cv_pthread_lpthread=no
9551 fi
9552 rm -f conftest*
9553 else
9554   cat > conftest.$ac_ext <<EOF
9555 #line 9556 "configure"
9556 #include "confdefs.h"
9557 /* pthread test headers */
9558 #include <pthread.h>
9559 #ifndef NULL
9560 #define NULL (void*)0
9561 #endif
9562
9563 static void *task(p)
9564         void *p;
9565 {
9566         return (void *) (p == NULL);
9567 }
9568
9569
9570 int main(argc, argv)
9571         int argc;
9572         char **argv;
9573 {
9574
9575         /* pthread test function */
9576         pthread_t t;
9577         int status;
9578         int detach = 1;
9579
9580 #ifdef HAVE_PTHREADS_FINAL
9581         /* Final pthreads */
9582         pthread_attr_t attr;
9583
9584         status = pthread_attr_init(&attr);
9585         if( status ) return status;
9586
9587 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9588         if( !detach ) {
9589 #if defined( PTHREAD_CREATE_JOINABLE )
9590                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9591 #else
9592                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9593 #endif
9594
9595 #ifdef PTHREAD_CREATE_DETACHED
9596         } else {
9597                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9598 #endif
9599         }
9600         if( status ) return status;
9601 #endif
9602
9603         status = pthread_create( &t, &attr, task, NULL );
9604         if( status ) return status;
9605
9606 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9607         if( detach ) {
9608                 /* give thread a chance to complete */
9609                 /* it should remain joinable and hence detachable */
9610                 sleep( 1 );
9611
9612                 status = pthread_detach( t );
9613                 if( status ) return status;
9614         }
9615 #endif
9616
9617 #else
9618         /* Draft 4 pthreads */
9619         status = pthread_create( &t, pthread_attr_default, task, NULL );
9620         if( status ) return status;
9621
9622         if( detach ) {
9623                 /* give thread a chance to complete */
9624                 /* it should remain joinable and hence detachable */
9625                 sleep( 1 );
9626
9627                 status = pthread_detach( &t );
9628                 if( status ) return status;
9629         }
9630 #endif
9631
9632 #ifdef HAVE_LINUX_THREADS
9633         pthread_kill_other_threads_np();
9634 #endif
9635
9636         return 0;
9637
9638 }
9639
9640 EOF
9641 if { (eval echo configure:9642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9642 then
9643   ol_cv_pthread_lpthread=yes
9644 else
9645   echo "configure: failed program was:" >&5
9646   cat conftest.$ac_ext >&5
9647   rm -fr conftest*
9648   ol_cv_pthread_lpthread=no
9649 fi
9650 rm -fr conftest*
9651 fi
9652
9653
9654                 # restore the LIBS
9655                 LIBS="$ol_LIBS"
9656         
9657 fi
9658
9659 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9660
9661         if test $ol_cv_pthread_lpthread = yes ; then
9662                 ol_link_pthreads="-lpthread"
9663                 ol_link_threads=posix
9664         fi
9665 fi
9666
9667                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9668 if test "$ol_link_threads" = no ; then
9669         # try -lc_r
9670         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9671 echo "configure:9672: checking for pthread link with -lc_r" >&5
9672 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
9673   echo $ac_n "(cached) $ac_c" 1>&6
9674 else
9675   
9676                 # save the flags
9677                 ol_LIBS="$LIBS"
9678                 LIBS="-lc_r $LIBS"
9679
9680                 if test "$cross_compiling" = yes; then
9681   cat > conftest.$ac_ext <<EOF
9682 #line 9683 "configure"
9683 #include "confdefs.h"
9684 /* pthread test headers */
9685 #include <pthread.h>
9686 #ifndef NULL
9687 #define NULL (void*)0
9688 #endif
9689
9690 static void *task(p)
9691         void *p;
9692 {
9693         return (void *) (p == NULL);
9694 }
9695
9696 int main() {
9697
9698         /* pthread test function */
9699         pthread_t t;
9700         int status;
9701         int detach = 1;
9702
9703 #ifdef HAVE_PTHREADS_FINAL
9704         /* Final pthreads */
9705         pthread_attr_t attr;
9706
9707         status = pthread_attr_init(&attr);
9708         if( status ) return status;
9709
9710 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9711         if( !detach ) {
9712 #if defined( PTHREAD_CREATE_JOINABLE )
9713                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9714 #else
9715                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9716 #endif
9717
9718 #ifdef PTHREAD_CREATE_DETACHED
9719         } else {
9720                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9721 #endif
9722         }
9723         if( status ) return status;
9724 #endif
9725
9726         status = pthread_create( &t, &attr, task, NULL );
9727         if( status ) return status;
9728
9729 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9730         if( detach ) {
9731                 /* give thread a chance to complete */
9732                 /* it should remain joinable and hence detachable */
9733                 sleep( 1 );
9734
9735                 status = pthread_detach( t );
9736                 if( status ) return status;
9737         }
9738 #endif
9739
9740 #else
9741         /* Draft 4 pthreads */
9742         status = pthread_create( &t, pthread_attr_default, task, NULL );
9743         if( status ) return status;
9744
9745         if( detach ) {
9746                 /* give thread a chance to complete */
9747                 /* it should remain joinable and hence detachable */
9748                 sleep( 1 );
9749
9750                 status = pthread_detach( &t );
9751                 if( status ) return status;
9752         }
9753 #endif
9754
9755 #ifdef HAVE_LINUX_THREADS
9756         pthread_kill_other_threads_np();
9757 #endif
9758
9759         return 0;
9760
9761 ; return 0; }
9762 EOF
9763 if { (eval echo configure:9764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9764   rm -rf conftest*
9765   ol_cv_pthread_lc_r=yes
9766 else
9767   echo "configure: failed program was:" >&5
9768   cat conftest.$ac_ext >&5
9769   rm -rf conftest*
9770   ol_cv_pthread_lc_r=no
9771 fi
9772 rm -f conftest*
9773 else
9774   cat > conftest.$ac_ext <<EOF
9775 #line 9776 "configure"
9776 #include "confdefs.h"
9777 /* pthread test headers */
9778 #include <pthread.h>
9779 #ifndef NULL
9780 #define NULL (void*)0
9781 #endif
9782
9783 static void *task(p)
9784         void *p;
9785 {
9786         return (void *) (p == NULL);
9787 }
9788
9789
9790 int main(argc, argv)
9791         int argc;
9792         char **argv;
9793 {
9794
9795         /* pthread test function */
9796         pthread_t t;
9797         int status;
9798         int detach = 1;
9799
9800 #ifdef HAVE_PTHREADS_FINAL
9801         /* Final pthreads */
9802         pthread_attr_t attr;
9803
9804         status = pthread_attr_init(&attr);
9805         if( status ) return status;
9806
9807 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9808         if( !detach ) {
9809 #if defined( PTHREAD_CREATE_JOINABLE )
9810                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9811 #else
9812                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9813 #endif
9814
9815 #ifdef PTHREAD_CREATE_DETACHED
9816         } else {
9817                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9818 #endif
9819         }
9820         if( status ) return status;
9821 #endif
9822
9823         status = pthread_create( &t, &attr, task, NULL );
9824         if( status ) return status;
9825
9826 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9827         if( detach ) {
9828                 /* give thread a chance to complete */
9829                 /* it should remain joinable and hence detachable */
9830                 sleep( 1 );
9831
9832                 status = pthread_detach( t );
9833                 if( status ) return status;
9834         }
9835 #endif
9836
9837 #else
9838         /* Draft 4 pthreads */
9839         status = pthread_create( &t, pthread_attr_default, task, NULL );
9840         if( status ) return status;
9841
9842         if( detach ) {
9843                 /* give thread a chance to complete */
9844                 /* it should remain joinable and hence detachable */
9845                 sleep( 1 );
9846
9847                 status = pthread_detach( &t );
9848                 if( status ) return status;
9849         }
9850 #endif
9851
9852 #ifdef HAVE_LINUX_THREADS
9853         pthread_kill_other_threads_np();
9854 #endif
9855
9856         return 0;
9857
9858 }
9859
9860 EOF
9861 if { (eval echo configure:9862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9862 then
9863   ol_cv_pthread_lc_r=yes
9864 else
9865   echo "configure: failed program was:" >&5
9866   cat conftest.$ac_ext >&5
9867   rm -fr conftest*
9868   ol_cv_pthread_lc_r=no
9869 fi
9870 rm -fr conftest*
9871 fi
9872
9873
9874                 # restore the LIBS
9875                 LIBS="$ol_LIBS"
9876         
9877 fi
9878
9879 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9880
9881         if test $ol_cv_pthread_lc_r = yes ; then
9882                 ol_link_pthreads="-lc_r"
9883                 ol_link_threads=posix
9884         fi
9885 fi
9886
9887
9888                 # Pthread try link: -threads (ol_cv_pthread_threads)
9889 if test "$ol_link_threads" = no ; then
9890         # try -threads
9891         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9892 echo "configure:9893: checking for pthread link with -threads" >&5
9893 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
9894   echo $ac_n "(cached) $ac_c" 1>&6
9895 else
9896   
9897                 # save the flags
9898                 ol_LIBS="$LIBS"
9899                 LIBS="-threads $LIBS"
9900
9901                 if test "$cross_compiling" = yes; then
9902   cat > conftest.$ac_ext <<EOF
9903 #line 9904 "configure"
9904 #include "confdefs.h"
9905 /* pthread test headers */
9906 #include <pthread.h>
9907 #ifndef NULL
9908 #define NULL (void*)0
9909 #endif
9910
9911 static void *task(p)
9912         void *p;
9913 {
9914         return (void *) (p == NULL);
9915 }
9916
9917 int main() {
9918
9919         /* pthread test function */
9920         pthread_t t;
9921         int status;
9922         int detach = 1;
9923
9924 #ifdef HAVE_PTHREADS_FINAL
9925         /* Final pthreads */
9926         pthread_attr_t attr;
9927
9928         status = pthread_attr_init(&attr);
9929         if( status ) return status;
9930
9931 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9932         if( !detach ) {
9933 #if defined( PTHREAD_CREATE_JOINABLE )
9934                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9935 #else
9936                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9937 #endif
9938
9939 #ifdef PTHREAD_CREATE_DETACHED
9940         } else {
9941                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9942 #endif
9943         }
9944         if( status ) return status;
9945 #endif
9946
9947         status = pthread_create( &t, &attr, task, NULL );
9948         if( status ) return status;
9949
9950 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9951         if( detach ) {
9952                 /* give thread a chance to complete */
9953                 /* it should remain joinable and hence detachable */
9954                 sleep( 1 );
9955
9956                 status = pthread_detach( t );
9957                 if( status ) return status;
9958         }
9959 #endif
9960
9961 #else
9962         /* Draft 4 pthreads */
9963         status = pthread_create( &t, pthread_attr_default, task, NULL );
9964         if( status ) return status;
9965
9966         if( detach ) {
9967                 /* give thread a chance to complete */
9968                 /* it should remain joinable and hence detachable */
9969                 sleep( 1 );
9970
9971                 status = pthread_detach( &t );
9972                 if( status ) return status;
9973         }
9974 #endif
9975
9976 #ifdef HAVE_LINUX_THREADS
9977         pthread_kill_other_threads_np();
9978 #endif
9979
9980         return 0;
9981
9982 ; return 0; }
9983 EOF
9984 if { (eval echo configure:9985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9985   rm -rf conftest*
9986   ol_cv_pthread_threads=yes
9987 else
9988   echo "configure: failed program was:" >&5
9989   cat conftest.$ac_ext >&5
9990   rm -rf conftest*
9991   ol_cv_pthread_threads=no
9992 fi
9993 rm -f conftest*
9994 else
9995   cat > conftest.$ac_ext <<EOF
9996 #line 9997 "configure"
9997 #include "confdefs.h"
9998 /* pthread test headers */
9999 #include <pthread.h>
10000 #ifndef NULL
10001 #define NULL (void*)0
10002 #endif
10003
10004 static void *task(p)
10005         void *p;
10006 {
10007         return (void *) (p == NULL);
10008 }
10009
10010
10011 int main(argc, argv)
10012         int argc;
10013         char **argv;
10014 {
10015
10016         /* pthread test function */
10017         pthread_t t;
10018         int status;
10019         int detach = 1;
10020
10021 #ifdef HAVE_PTHREADS_FINAL
10022         /* Final pthreads */
10023         pthread_attr_t attr;
10024
10025         status = pthread_attr_init(&attr);
10026         if( status ) return status;
10027
10028 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10029         if( !detach ) {
10030 #if defined( PTHREAD_CREATE_JOINABLE )
10031                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10032 #else
10033                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10034 #endif
10035
10036 #ifdef PTHREAD_CREATE_DETACHED
10037         } else {
10038                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10039 #endif
10040         }
10041         if( status ) return status;
10042 #endif
10043
10044         status = pthread_create( &t, &attr, task, NULL );
10045         if( status ) return status;
10046
10047 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10048         if( detach ) {
10049                 /* give thread a chance to complete */
10050                 /* it should remain joinable and hence detachable */
10051                 sleep( 1 );
10052
10053                 status = pthread_detach( t );
10054                 if( status ) return status;
10055         }
10056 #endif
10057
10058 #else
10059         /* Draft 4 pthreads */
10060         status = pthread_create( &t, pthread_attr_default, task, NULL );
10061         if( status ) return status;
10062
10063         if( detach ) {
10064                 /* give thread a chance to complete */
10065                 /* it should remain joinable and hence detachable */
10066                 sleep( 1 );
10067
10068                 status = pthread_detach( &t );
10069                 if( status ) return status;
10070         }
10071 #endif
10072
10073 #ifdef HAVE_LINUX_THREADS
10074         pthread_kill_other_threads_np();
10075 #endif
10076
10077         return 0;
10078
10079 }
10080
10081 EOF
10082 if { (eval echo configure:10083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10083 then
10084   ol_cv_pthread_threads=yes
10085 else
10086   echo "configure: failed program was:" >&5
10087   cat conftest.$ac_ext >&5
10088   rm -fr conftest*
10089   ol_cv_pthread_threads=no
10090 fi
10091 rm -fr conftest*
10092 fi
10093
10094
10095                 # restore the LIBS
10096                 LIBS="$ol_LIBS"
10097         
10098 fi
10099
10100 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10101
10102         if test $ol_cv_pthread_threads = yes ; then
10103                 ol_link_pthreads="-threads"
10104                 ol_link_threads=posix
10105         fi
10106 fi
10107
10108
10109                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10110 if test "$ol_link_threads" = no ; then
10111         # try -lpthreads -lmach -lexc -lc_r
10112         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10113 echo "configure:10114: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10114 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
10115   echo $ac_n "(cached) $ac_c" 1>&6
10116 else
10117   
10118                 # save the flags
10119                 ol_LIBS="$LIBS"
10120                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10121
10122                 if test "$cross_compiling" = yes; then
10123   cat > conftest.$ac_ext <<EOF
10124 #line 10125 "configure"
10125 #include "confdefs.h"
10126 /* pthread test headers */
10127 #include <pthread.h>
10128 #ifndef NULL
10129 #define NULL (void*)0
10130 #endif
10131
10132 static void *task(p)
10133         void *p;
10134 {
10135         return (void *) (p == NULL);
10136 }
10137
10138 int main() {
10139
10140         /* pthread test function */
10141         pthread_t t;
10142         int status;
10143         int detach = 1;
10144
10145 #ifdef HAVE_PTHREADS_FINAL
10146         /* Final pthreads */
10147         pthread_attr_t attr;
10148
10149         status = pthread_attr_init(&attr);
10150         if( status ) return status;
10151
10152 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10153         if( !detach ) {
10154 #if defined( PTHREAD_CREATE_JOINABLE )
10155                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10156 #else
10157                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10158 #endif
10159
10160 #ifdef PTHREAD_CREATE_DETACHED
10161         } else {
10162                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10163 #endif
10164         }
10165         if( status ) return status;
10166 #endif
10167
10168         status = pthread_create( &t, &attr, task, NULL );
10169         if( status ) return status;
10170
10171 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10172         if( detach ) {
10173                 /* give thread a chance to complete */
10174                 /* it should remain joinable and hence detachable */
10175                 sleep( 1 );
10176
10177                 status = pthread_detach( t );
10178                 if( status ) return status;
10179         }
10180 #endif
10181
10182 #else
10183         /* Draft 4 pthreads */
10184         status = pthread_create( &t, pthread_attr_default, task, NULL );
10185         if( status ) return status;
10186
10187         if( detach ) {
10188                 /* give thread a chance to complete */
10189                 /* it should remain joinable and hence detachable */
10190                 sleep( 1 );
10191
10192                 status = pthread_detach( &t );
10193                 if( status ) return status;
10194         }
10195 #endif
10196
10197 #ifdef HAVE_LINUX_THREADS
10198         pthread_kill_other_threads_np();
10199 #endif
10200
10201         return 0;
10202
10203 ; return 0; }
10204 EOF
10205 if { (eval echo configure:10206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10206   rm -rf conftest*
10207   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10208 else
10209   echo "configure: failed program was:" >&5
10210   cat conftest.$ac_ext >&5
10211   rm -rf conftest*
10212   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10213 fi
10214 rm -f conftest*
10215 else
10216   cat > conftest.$ac_ext <<EOF
10217 #line 10218 "configure"
10218 #include "confdefs.h"
10219 /* pthread test headers */
10220 #include <pthread.h>
10221 #ifndef NULL
10222 #define NULL (void*)0
10223 #endif
10224
10225 static void *task(p)
10226         void *p;
10227 {
10228         return (void *) (p == NULL);
10229 }
10230
10231
10232 int main(argc, argv)
10233         int argc;
10234         char **argv;
10235 {
10236
10237         /* pthread test function */
10238         pthread_t t;
10239         int status;
10240         int detach = 1;
10241
10242 #ifdef HAVE_PTHREADS_FINAL
10243         /* Final pthreads */
10244         pthread_attr_t attr;
10245
10246         status = pthread_attr_init(&attr);
10247         if( status ) return status;
10248
10249 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10250         if( !detach ) {
10251 #if defined( PTHREAD_CREATE_JOINABLE )
10252                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10253 #else
10254                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10255 #endif
10256
10257 #ifdef PTHREAD_CREATE_DETACHED
10258         } else {
10259                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10260 #endif
10261         }
10262         if( status ) return status;
10263 #endif
10264
10265         status = pthread_create( &t, &attr, task, NULL );
10266         if( status ) return status;
10267
10268 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10269         if( detach ) {
10270                 /* give thread a chance to complete */
10271                 /* it should remain joinable and hence detachable */
10272                 sleep( 1 );
10273
10274                 status = pthread_detach( t );
10275                 if( status ) return status;
10276         }
10277 #endif
10278
10279 #else
10280         /* Draft 4 pthreads */
10281         status = pthread_create( &t, pthread_attr_default, task, NULL );
10282         if( status ) return status;
10283
10284         if( detach ) {
10285                 /* give thread a chance to complete */
10286                 /* it should remain joinable and hence detachable */
10287                 sleep( 1 );
10288
10289                 status = pthread_detach( &t );
10290                 if( status ) return status;
10291         }
10292 #endif
10293
10294 #ifdef HAVE_LINUX_THREADS
10295         pthread_kill_other_threads_np();
10296 #endif
10297
10298         return 0;
10299
10300 }
10301
10302 EOF
10303 if { (eval echo configure:10304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10304 then
10305   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10306 else
10307   echo "configure: failed program was:" >&5
10308   cat conftest.$ac_ext >&5
10309   rm -fr conftest*
10310   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10311 fi
10312 rm -fr conftest*
10313 fi
10314
10315
10316                 # restore the LIBS
10317                 LIBS="$ol_LIBS"
10318         
10319 fi
10320
10321 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10322
10323         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10324                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10325                 ol_link_threads=posix
10326         fi
10327 fi
10328
10329                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10330 if test "$ol_link_threads" = no ; then
10331         # try -lpthreads -lmach -lexc
10332         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10333 echo "configure:10334: checking for pthread link with -lpthreads -lmach -lexc" >&5
10334 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
10335   echo $ac_n "(cached) $ac_c" 1>&6
10336 else
10337   
10338                 # save the flags
10339                 ol_LIBS="$LIBS"
10340                 LIBS="-lpthreads -lmach -lexc $LIBS"
10341
10342                 if test "$cross_compiling" = yes; then
10343   cat > conftest.$ac_ext <<EOF
10344 #line 10345 "configure"
10345 #include "confdefs.h"
10346 /* pthread test headers */
10347 #include <pthread.h>
10348 #ifndef NULL
10349 #define NULL (void*)0
10350 #endif
10351
10352 static void *task(p)
10353         void *p;
10354 {
10355         return (void *) (p == NULL);
10356 }
10357
10358 int main() {
10359
10360         /* pthread test function */
10361         pthread_t t;
10362         int status;
10363         int detach = 1;
10364
10365 #ifdef HAVE_PTHREADS_FINAL
10366         /* Final pthreads */
10367         pthread_attr_t attr;
10368
10369         status = pthread_attr_init(&attr);
10370         if( status ) return status;
10371
10372 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10373         if( !detach ) {
10374 #if defined( PTHREAD_CREATE_JOINABLE )
10375                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10376 #else
10377                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10378 #endif
10379
10380 #ifdef PTHREAD_CREATE_DETACHED
10381         } else {
10382                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10383 #endif
10384         }
10385         if( status ) return status;
10386 #endif
10387
10388         status = pthread_create( &t, &attr, task, NULL );
10389         if( status ) return status;
10390
10391 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10392         if( detach ) {
10393                 /* give thread a chance to complete */
10394                 /* it should remain joinable and hence detachable */
10395                 sleep( 1 );
10396
10397                 status = pthread_detach( t );
10398                 if( status ) return status;
10399         }
10400 #endif
10401
10402 #else
10403         /* Draft 4 pthreads */
10404         status = pthread_create( &t, pthread_attr_default, task, NULL );
10405         if( status ) return status;
10406
10407         if( detach ) {
10408                 /* give thread a chance to complete */
10409                 /* it should remain joinable and hence detachable */
10410                 sleep( 1 );
10411
10412                 status = pthread_detach( &t );
10413                 if( status ) return status;
10414         }
10415 #endif
10416
10417 #ifdef HAVE_LINUX_THREADS
10418         pthread_kill_other_threads_np();
10419 #endif
10420
10421         return 0;
10422
10423 ; return 0; }
10424 EOF
10425 if { (eval echo configure:10426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10426   rm -rf conftest*
10427   ol_cv_pthread_lpthreads_lmach_lexc=yes
10428 else
10429   echo "configure: failed program was:" >&5
10430   cat conftest.$ac_ext >&5
10431   rm -rf conftest*
10432   ol_cv_pthread_lpthreads_lmach_lexc=no
10433 fi
10434 rm -f conftest*
10435 else
10436   cat > conftest.$ac_ext <<EOF
10437 #line 10438 "configure"
10438 #include "confdefs.h"
10439 /* pthread test headers */
10440 #include <pthread.h>
10441 #ifndef NULL
10442 #define NULL (void*)0
10443 #endif
10444
10445 static void *task(p)
10446         void *p;
10447 {
10448         return (void *) (p == NULL);
10449 }
10450
10451
10452 int main(argc, argv)
10453         int argc;
10454         char **argv;
10455 {
10456
10457         /* pthread test function */
10458         pthread_t t;
10459         int status;
10460         int detach = 1;
10461
10462 #ifdef HAVE_PTHREADS_FINAL
10463         /* Final pthreads */
10464         pthread_attr_t attr;
10465
10466         status = pthread_attr_init(&attr);
10467         if( status ) return status;
10468
10469 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10470         if( !detach ) {
10471 #if defined( PTHREAD_CREATE_JOINABLE )
10472                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10473 #else
10474                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10475 #endif
10476
10477 #ifdef PTHREAD_CREATE_DETACHED
10478         } else {
10479                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10480 #endif
10481         }
10482         if( status ) return status;
10483 #endif
10484
10485         status = pthread_create( &t, &attr, task, NULL );
10486         if( status ) return status;
10487
10488 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10489         if( detach ) {
10490                 /* give thread a chance to complete */
10491                 /* it should remain joinable and hence detachable */
10492                 sleep( 1 );
10493
10494                 status = pthread_detach( t );
10495                 if( status ) return status;
10496         }
10497 #endif
10498
10499 #else
10500         /* Draft 4 pthreads */
10501         status = pthread_create( &t, pthread_attr_default, task, NULL );
10502         if( status ) return status;
10503
10504         if( detach ) {
10505                 /* give thread a chance to complete */
10506                 /* it should remain joinable and hence detachable */
10507                 sleep( 1 );
10508
10509                 status = pthread_detach( &t );
10510                 if( status ) return status;
10511         }
10512 #endif
10513
10514 #ifdef HAVE_LINUX_THREADS
10515         pthread_kill_other_threads_np();
10516 #endif
10517
10518         return 0;
10519
10520 }
10521
10522 EOF
10523 if { (eval echo configure:10524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10524 then
10525   ol_cv_pthread_lpthreads_lmach_lexc=yes
10526 else
10527   echo "configure: failed program was:" >&5
10528   cat conftest.$ac_ext >&5
10529   rm -fr conftest*
10530   ol_cv_pthread_lpthreads_lmach_lexc=no
10531 fi
10532 rm -fr conftest*
10533 fi
10534
10535
10536                 # restore the LIBS
10537                 LIBS="$ol_LIBS"
10538         
10539 fi
10540
10541 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10542
10543         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10544                 ol_link_pthreads="-lpthreads -lmach -lexc"
10545                 ol_link_threads=posix
10546         fi
10547 fi
10548
10549                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10550 if test "$ol_link_threads" = no ; then
10551         # try -lpthreads -lexc
10552         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10553 echo "configure:10554: checking for pthread link with -lpthreads -lexc" >&5
10554 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
10555   echo $ac_n "(cached) $ac_c" 1>&6
10556 else
10557   
10558                 # save the flags
10559                 ol_LIBS="$LIBS"
10560                 LIBS="-lpthreads -lexc $LIBS"
10561
10562                 if test "$cross_compiling" = yes; then
10563   cat > conftest.$ac_ext <<EOF
10564 #line 10565 "configure"
10565 #include "confdefs.h"
10566 /* pthread test headers */
10567 #include <pthread.h>
10568 #ifndef NULL
10569 #define NULL (void*)0
10570 #endif
10571
10572 static void *task(p)
10573         void *p;
10574 {
10575         return (void *) (p == NULL);
10576 }
10577
10578 int main() {
10579
10580         /* pthread test function */
10581         pthread_t t;
10582         int status;
10583         int detach = 1;
10584
10585 #ifdef HAVE_PTHREADS_FINAL
10586         /* Final pthreads */
10587         pthread_attr_t attr;
10588
10589         status = pthread_attr_init(&attr);
10590         if( status ) return status;
10591
10592 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10593         if( !detach ) {
10594 #if defined( PTHREAD_CREATE_JOINABLE )
10595                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10596 #else
10597                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10598 #endif
10599
10600 #ifdef PTHREAD_CREATE_DETACHED
10601         } else {
10602                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10603 #endif
10604         }
10605         if( status ) return status;
10606 #endif
10607
10608         status = pthread_create( &t, &attr, task, NULL );
10609         if( status ) return status;
10610
10611 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10612         if( detach ) {
10613                 /* give thread a chance to complete */
10614                 /* it should remain joinable and hence detachable */
10615                 sleep( 1 );
10616
10617                 status = pthread_detach( t );
10618                 if( status ) return status;
10619         }
10620 #endif
10621
10622 #else
10623         /* Draft 4 pthreads */
10624         status = pthread_create( &t, pthread_attr_default, task, NULL );
10625         if( status ) return status;
10626
10627         if( detach ) {
10628                 /* give thread a chance to complete */
10629                 /* it should remain joinable and hence detachable */
10630                 sleep( 1 );
10631
10632                 status = pthread_detach( &t );
10633                 if( status ) return status;
10634         }
10635 #endif
10636
10637 #ifdef HAVE_LINUX_THREADS
10638         pthread_kill_other_threads_np();
10639 #endif
10640
10641         return 0;
10642
10643 ; return 0; }
10644 EOF
10645 if { (eval echo configure:10646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10646   rm -rf conftest*
10647   ol_cv_pthread_lpthreads_lexc=yes
10648 else
10649   echo "configure: failed program was:" >&5
10650   cat conftest.$ac_ext >&5
10651   rm -rf conftest*
10652   ol_cv_pthread_lpthreads_lexc=no
10653 fi
10654 rm -f conftest*
10655 else
10656   cat > conftest.$ac_ext <<EOF
10657 #line 10658 "configure"
10658 #include "confdefs.h"
10659 /* pthread test headers */
10660 #include <pthread.h>
10661 #ifndef NULL
10662 #define NULL (void*)0
10663 #endif
10664
10665 static void *task(p)
10666         void *p;
10667 {
10668         return (void *) (p == NULL);
10669 }
10670
10671
10672 int main(argc, argv)
10673         int argc;
10674         char **argv;
10675 {
10676
10677         /* pthread test function */
10678         pthread_t t;
10679         int status;
10680         int detach = 1;
10681
10682 #ifdef HAVE_PTHREADS_FINAL
10683         /* Final pthreads */
10684         pthread_attr_t attr;
10685
10686         status = pthread_attr_init(&attr);
10687         if( status ) return status;
10688
10689 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10690         if( !detach ) {
10691 #if defined( PTHREAD_CREATE_JOINABLE )
10692                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10693 #else
10694                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10695 #endif
10696
10697 #ifdef PTHREAD_CREATE_DETACHED
10698         } else {
10699                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10700 #endif
10701         }
10702         if( status ) return status;
10703 #endif
10704
10705         status = pthread_create( &t, &attr, task, NULL );
10706         if( status ) return status;
10707
10708 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10709         if( detach ) {
10710                 /* give thread a chance to complete */
10711                 /* it should remain joinable and hence detachable */
10712                 sleep( 1 );
10713
10714                 status = pthread_detach( t );
10715                 if( status ) return status;
10716         }
10717 #endif
10718
10719 #else
10720         /* Draft 4 pthreads */
10721         status = pthread_create( &t, pthread_attr_default, task, NULL );
10722         if( status ) return status;
10723
10724         if( detach ) {
10725                 /* give thread a chance to complete */
10726                 /* it should remain joinable and hence detachable */
10727                 sleep( 1 );
10728
10729                 status = pthread_detach( &t );
10730                 if( status ) return status;
10731         }
10732 #endif
10733
10734 #ifdef HAVE_LINUX_THREADS
10735         pthread_kill_other_threads_np();
10736 #endif
10737
10738         return 0;
10739
10740 }
10741
10742 EOF
10743 if { (eval echo configure:10744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10744 then
10745   ol_cv_pthread_lpthreads_lexc=yes
10746 else
10747   echo "configure: failed program was:" >&5
10748   cat conftest.$ac_ext >&5
10749   rm -fr conftest*
10750   ol_cv_pthread_lpthreads_lexc=no
10751 fi
10752 rm -fr conftest*
10753 fi
10754
10755
10756                 # restore the LIBS
10757                 LIBS="$ol_LIBS"
10758         
10759 fi
10760
10761 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10762
10763         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10764                 ol_link_pthreads="-lpthreads -lexc"
10765                 ol_link_threads=posix
10766         fi
10767 fi
10768
10769
10770                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10771 if test "$ol_link_threads" = no ; then
10772         # try -lpthreads
10773         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10774 echo "configure:10775: checking for pthread link with -lpthreads" >&5
10775 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
10776   echo $ac_n "(cached) $ac_c" 1>&6
10777 else
10778   
10779                 # save the flags
10780                 ol_LIBS="$LIBS"
10781                 LIBS="-lpthreads $LIBS"
10782
10783                 if test "$cross_compiling" = yes; then
10784   cat > conftest.$ac_ext <<EOF
10785 #line 10786 "configure"
10786 #include "confdefs.h"
10787 /* pthread test headers */
10788 #include <pthread.h>
10789 #ifndef NULL
10790 #define NULL (void*)0
10791 #endif
10792
10793 static void *task(p)
10794         void *p;
10795 {
10796         return (void *) (p == NULL);
10797 }
10798
10799 int main() {
10800
10801         /* pthread test function */
10802         pthread_t t;
10803         int status;
10804         int detach = 1;
10805
10806 #ifdef HAVE_PTHREADS_FINAL
10807         /* Final pthreads */
10808         pthread_attr_t attr;
10809
10810         status = pthread_attr_init(&attr);
10811         if( status ) return status;
10812
10813 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10814         if( !detach ) {
10815 #if defined( PTHREAD_CREATE_JOINABLE )
10816                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10817 #else
10818                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10819 #endif
10820
10821 #ifdef PTHREAD_CREATE_DETACHED
10822         } else {
10823                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10824 #endif
10825         }
10826         if( status ) return status;
10827 #endif
10828
10829         status = pthread_create( &t, &attr, task, NULL );
10830         if( status ) return status;
10831
10832 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10833         if( detach ) {
10834                 /* give thread a chance to complete */
10835                 /* it should remain joinable and hence detachable */
10836                 sleep( 1 );
10837
10838                 status = pthread_detach( t );
10839                 if( status ) return status;
10840         }
10841 #endif
10842
10843 #else
10844         /* Draft 4 pthreads */
10845         status = pthread_create( &t, pthread_attr_default, task, NULL );
10846         if( status ) return status;
10847
10848         if( detach ) {
10849                 /* give thread a chance to complete */
10850                 /* it should remain joinable and hence detachable */
10851                 sleep( 1 );
10852
10853                 status = pthread_detach( &t );
10854                 if( status ) return status;
10855         }
10856 #endif
10857
10858 #ifdef HAVE_LINUX_THREADS
10859         pthread_kill_other_threads_np();
10860 #endif
10861
10862         return 0;
10863
10864 ; return 0; }
10865 EOF
10866 if { (eval echo configure:10867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10867   rm -rf conftest*
10868   ol_cv_pthread_lib_lpthreads=yes
10869 else
10870   echo "configure: failed program was:" >&5
10871   cat conftest.$ac_ext >&5
10872   rm -rf conftest*
10873   ol_cv_pthread_lib_lpthreads=no
10874 fi
10875 rm -f conftest*
10876 else
10877   cat > conftest.$ac_ext <<EOF
10878 #line 10879 "configure"
10879 #include "confdefs.h"
10880 /* pthread test headers */
10881 #include <pthread.h>
10882 #ifndef NULL
10883 #define NULL (void*)0
10884 #endif
10885
10886 static void *task(p)
10887         void *p;
10888 {
10889         return (void *) (p == NULL);
10890 }
10891
10892
10893 int main(argc, argv)
10894         int argc;
10895         char **argv;
10896 {
10897
10898         /* pthread test function */
10899         pthread_t t;
10900         int status;
10901         int detach = 1;
10902
10903 #ifdef HAVE_PTHREADS_FINAL
10904         /* Final pthreads */
10905         pthread_attr_t attr;
10906
10907         status = pthread_attr_init(&attr);
10908         if( status ) return status;
10909
10910 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10911         if( !detach ) {
10912 #if defined( PTHREAD_CREATE_JOINABLE )
10913                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10914 #else
10915                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10916 #endif
10917
10918 #ifdef PTHREAD_CREATE_DETACHED
10919         } else {
10920                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10921 #endif
10922         }
10923         if( status ) return status;
10924 #endif
10925
10926         status = pthread_create( &t, &attr, task, NULL );
10927         if( status ) return status;
10928
10929 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10930         if( detach ) {
10931                 /* give thread a chance to complete */
10932                 /* it should remain joinable and hence detachable */
10933                 sleep( 1 );
10934
10935                 status = pthread_detach( t );
10936                 if( status ) return status;
10937         }
10938 #endif
10939
10940 #else
10941         /* Draft 4 pthreads */
10942         status = pthread_create( &t, pthread_attr_default, task, NULL );
10943         if( status ) return status;
10944
10945         if( detach ) {
10946                 /* give thread a chance to complete */
10947                 /* it should remain joinable and hence detachable */
10948                 sleep( 1 );
10949
10950                 status = pthread_detach( &t );
10951                 if( status ) return status;
10952         }
10953 #endif
10954
10955 #ifdef HAVE_LINUX_THREADS
10956         pthread_kill_other_threads_np();
10957 #endif
10958
10959         return 0;
10960
10961 }
10962
10963 EOF
10964 if { (eval echo configure:10965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10965 then
10966   ol_cv_pthread_lib_lpthreads=yes
10967 else
10968   echo "configure: failed program was:" >&5
10969   cat conftest.$ac_ext >&5
10970   rm -fr conftest*
10971   ol_cv_pthread_lib_lpthreads=no
10972 fi
10973 rm -fr conftest*
10974 fi
10975
10976
10977                 # restore the LIBS
10978                 LIBS="$ol_LIBS"
10979         
10980 fi
10981
10982 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10983
10984         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10985                 ol_link_pthreads="-lpthreads"
10986                 ol_link_threads=posix
10987         fi
10988 fi
10989
10990
10991                 if test $ol_link_threads != no ; then
10992                         cat >> confdefs.h <<\EOF
10993 #define HAVE_PTHREADS 1
10994 EOF
10995
10996
10997                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10998
10999                                                 save_CPPFLAGS="$CPPFLAGS"
11000                         save_LIBS="$LIBS"
11001                         LIBS="$LTHREAD_LIBS $LIBS"
11002
11003                                                                                                 for ac_func in sched_yield pthread_yield
11004 do
11005 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11006 echo "configure:11007: checking for $ac_func" >&5
11007 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11008   echo $ac_n "(cached) $ac_c" 1>&6
11009 else
11010   cat > conftest.$ac_ext <<EOF
11011 #line 11012 "configure"
11012 #include "confdefs.h"
11013 /* System header to define __stub macros and hopefully few prototypes,
11014     which can conflict with char $ac_func(); below.  */
11015 #include <assert.h>
11016 /* Override any gcc2 internal prototype to avoid an error.  */
11017 /* We use char because int might match the return type of a gcc2
11018     builtin and then its argument prototype would still apply.  */
11019 char $ac_func();
11020
11021 int main() {
11022
11023 /* The GNU C library defines this for functions which it implements
11024     to always fail with ENOSYS.  Some functions are actually named
11025     something starting with __ and the normal name is an alias.  */
11026 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11027 choke me
11028 #else
11029 $ac_func();
11030 #endif
11031
11032 ; return 0; }
11033 EOF
11034 if { (eval echo configure:11035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11035   rm -rf conftest*
11036   eval "ac_cv_func_$ac_func=yes"
11037 else
11038   echo "configure: failed program was:" >&5
11039   cat conftest.$ac_ext >&5
11040   rm -rf conftest*
11041   eval "ac_cv_func_$ac_func=no"
11042 fi
11043 rm -f conftest*
11044 fi
11045
11046 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11047   echo "$ac_t""yes" 1>&6
11048     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11049   cat >> confdefs.h <<EOF
11050 #define $ac_tr_func 1
11051 EOF
11052  
11053 else
11054   echo "$ac_t""no" 1>&6
11055 fi
11056 done
11057
11058
11059                         if test $ac_cv_func_sched_yield = no -a \
11060                                 $ac_cv_func_pthread_yield = no ; then
11061                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11062 echo "configure:11063: checking for sched_yield in -lrt" >&5
11063 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
11064 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11065   echo $ac_n "(cached) $ac_c" 1>&6
11066 else
11067   ac_save_LIBS="$LIBS"
11068 LIBS="-lrt  $LIBS"
11069 cat > conftest.$ac_ext <<EOF
11070 #line 11071 "configure"
11071 #include "confdefs.h"
11072 /* Override any gcc2 internal prototype to avoid an error.  */
11073 /* We use char because int might match the return type of a gcc2
11074     builtin and then its argument prototype would still apply.  */
11075 char sched_yield();
11076
11077 int main() {
11078 sched_yield()
11079 ; return 0; }
11080 EOF
11081 if { (eval echo configure:11082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11082   rm -rf conftest*
11083   eval "ac_cv_lib_$ac_lib_var=yes"
11084 else
11085   echo "configure: failed program was:" >&5
11086   cat conftest.$ac_ext >&5
11087   rm -rf conftest*
11088   eval "ac_cv_lib_$ac_lib_var=no"
11089 fi
11090 rm -f conftest*
11091 LIBS="$ac_save_LIBS"
11092
11093 fi
11094 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11095   echo "$ac_t""yes" 1>&6
11096   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11097                                         cat >> confdefs.h <<\EOF
11098 #define HAVE_SCHED_YIELD 1
11099 EOF
11100
11101                                         ac_cv_func_sched_yield=yes
11102 else
11103   echo "$ac_t""no" 1>&6
11104 ac_cv_func_sched_yield=no
11105 fi
11106
11107                         fi
11108                         if test $ac_cv_func_sched_yield = no -a \
11109                                 $ac_cv_func_pthread_yield = no ; then
11110                                                                                                 for ac_func in thr_yield
11111 do
11112 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11113 echo "configure:11114: checking for $ac_func" >&5
11114 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11115   echo $ac_n "(cached) $ac_c" 1>&6
11116 else
11117   cat > conftest.$ac_ext <<EOF
11118 #line 11119 "configure"
11119 #include "confdefs.h"
11120 /* System header to define __stub macros and hopefully few prototypes,
11121     which can conflict with char $ac_func(); below.  */
11122 #include <assert.h>
11123 /* Override any gcc2 internal prototype to avoid an error.  */
11124 /* We use char because int might match the return type of a gcc2
11125     builtin and then its argument prototype would still apply.  */
11126 char $ac_func();
11127
11128 int main() {
11129
11130 /* The GNU C library defines this for functions which it implements
11131     to always fail with ENOSYS.  Some functions are actually named
11132     something starting with __ and the normal name is an alias.  */
11133 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11134 choke me
11135 #else
11136 $ac_func();
11137 #endif
11138
11139 ; return 0; }
11140 EOF
11141 if { (eval echo configure:11142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11142   rm -rf conftest*
11143   eval "ac_cv_func_$ac_func=yes"
11144 else
11145   echo "configure: failed program was:" >&5
11146   cat conftest.$ac_ext >&5
11147   rm -rf conftest*
11148   eval "ac_cv_func_$ac_func=no"
11149 fi
11150 rm -f conftest*
11151 fi
11152
11153 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11154   echo "$ac_t""yes" 1>&6
11155     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11156   cat >> confdefs.h <<EOF
11157 #define $ac_tr_func 1
11158 EOF
11159  
11160 else
11161   echo "$ac_t""no" 1>&6
11162 fi
11163 done
11164
11165                         fi
11166                         if test $ac_cv_func_sched_yield = no -a \
11167                                 $ac_cv_func_pthread_yield = no -a \
11168                                 "$ac_cv_func_thr_yield" = no ; then
11169                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11170                         fi
11171
11172                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11173 do
11174 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11175 echo "configure:11176: checking for $ac_func" >&5
11176 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11177   echo $ac_n "(cached) $ac_c" 1>&6
11178 else
11179   cat > conftest.$ac_ext <<EOF
11180 #line 11181 "configure"
11181 #include "confdefs.h"
11182 /* System header to define __stub macros and hopefully few prototypes,
11183     which can conflict with char $ac_func(); below.  */
11184 #include <assert.h>
11185 /* Override any gcc2 internal prototype to avoid an error.  */
11186 /* We use char because int might match the return type of a gcc2
11187     builtin and then its argument prototype would still apply.  */
11188 char $ac_func();
11189
11190 int main() {
11191
11192 /* The GNU C library defines this for functions which it implements
11193     to always fail with ENOSYS.  Some functions are actually named
11194     something starting with __ and the normal name is an alias.  */
11195 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11196 choke me
11197 #else
11198 $ac_func();
11199 #endif
11200
11201 ; return 0; }
11202 EOF
11203 if { (eval echo configure:11204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11204   rm -rf conftest*
11205   eval "ac_cv_func_$ac_func=yes"
11206 else
11207   echo "configure: failed program was:" >&5
11208   cat conftest.$ac_ext >&5
11209   rm -rf conftest*
11210   eval "ac_cv_func_$ac_func=no"
11211 fi
11212 rm -f conftest*
11213 fi
11214
11215 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11216   echo "$ac_t""yes" 1>&6
11217     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11218   cat >> confdefs.h <<EOF
11219 #define $ac_tr_func 1
11220 EOF
11221  
11222 else
11223   echo "$ac_t""no" 1>&6
11224 fi
11225 done
11226
11227
11228                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11229 echo "configure:11230: checking for pthread_detach with <pthread.h>" >&5
11230 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
11231   echo $ac_n "(cached) $ac_c" 1>&6
11232 else
11233   
11234                                                                 cat > conftest.$ac_ext <<EOF
11235 #line 11236 "configure"
11236 #include "confdefs.h"
11237
11238 #include <pthread.h>
11239 #ifndef NULL
11240 #define NULL (void*)0
11241 #endif
11242
11243 int main() {
11244 pthread_detach(NULL);
11245 ; return 0; }
11246 EOF
11247 if { (eval echo configure:11248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11248   rm -rf conftest*
11249   ol_cv_func_pthread_detach=yes
11250 else
11251   echo "configure: failed program was:" >&5
11252   cat conftest.$ac_ext >&5
11253   rm -rf conftest*
11254   ol_cv_func_pthread_detach=no
11255 fi
11256 rm -f conftest*
11257                         
11258 fi
11259
11260 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11261
11262                         if test $ol_cv_func_pthread_detach = no ; then
11263                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11264                         fi
11265
11266                         cat >> confdefs.h <<\EOF
11267 #define HAVE_PTHREAD_DETACH 1
11268 EOF
11269
11270
11271                                                 for ac_func in \
11272                                 pthread_setconcurrency \
11273                                 pthread_getconcurrency \
11274                                 thr_setconcurrency \
11275                                 thr_getconcurrency \
11276                         
11277 do
11278 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11279 echo "configure:11280: checking for $ac_func" >&5
11280 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11281   echo $ac_n "(cached) $ac_c" 1>&6
11282 else
11283   cat > conftest.$ac_ext <<EOF
11284 #line 11285 "configure"
11285 #include "confdefs.h"
11286 /* System header to define __stub macros and hopefully few prototypes,
11287     which can conflict with char $ac_func(); below.  */
11288 #include <assert.h>
11289 /* Override any gcc2 internal prototype to avoid an error.  */
11290 /* We use char because int might match the return type of a gcc2
11291     builtin and then its argument prototype would still apply.  */
11292 char $ac_func();
11293
11294 int main() {
11295
11296 /* The GNU C library defines this for functions which it implements
11297     to always fail with ENOSYS.  Some functions are actually named
11298     something starting with __ and the normal name is an alias.  */
11299 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11300 choke me
11301 #else
11302 $ac_func();
11303 #endif
11304
11305 ; return 0; }
11306 EOF
11307 if { (eval echo configure:11308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11308   rm -rf conftest*
11309   eval "ac_cv_func_$ac_func=yes"
11310 else
11311   echo "configure: failed program was:" >&5
11312   cat conftest.$ac_ext >&5
11313   rm -rf conftest*
11314   eval "ac_cv_func_$ac_func=no"
11315 fi
11316 rm -f conftest*
11317 fi
11318
11319 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11320   echo "$ac_t""yes" 1>&6
11321     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11322   cat >> confdefs.h <<EOF
11323 #define $ac_tr_func 1
11324 EOF
11325  
11326 else
11327   echo "$ac_t""no" 1>&6
11328 fi
11329 done
11330
11331
11332                         
11333         for ac_func in pthread_kill_other_threads_np
11334 do
11335 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11336 echo "configure:11337: checking for $ac_func" >&5
11337 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11338   echo $ac_n "(cached) $ac_c" 1>&6
11339 else
11340   cat > conftest.$ac_ext <<EOF
11341 #line 11342 "configure"
11342 #include "confdefs.h"
11343 /* System header to define __stub macros and hopefully few prototypes,
11344     which can conflict with char $ac_func(); below.  */
11345 #include <assert.h>
11346 /* Override any gcc2 internal prototype to avoid an error.  */
11347 /* We use char because int might match the return type of a gcc2
11348     builtin and then its argument prototype would still apply.  */
11349 char $ac_func();
11350
11351 int main() {
11352
11353 /* The GNU C library defines this for functions which it implements
11354     to always fail with ENOSYS.  Some functions are actually named
11355     something starting with __ and the normal name is an alias.  */
11356 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11357 choke me
11358 #else
11359 $ac_func();
11360 #endif
11361
11362 ; return 0; }
11363 EOF
11364 if { (eval echo configure:11365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11365   rm -rf conftest*
11366   eval "ac_cv_func_$ac_func=yes"
11367 else
11368   echo "configure: failed program was:" >&5
11369   cat conftest.$ac_ext >&5
11370   rm -rf conftest*
11371   eval "ac_cv_func_$ac_func=no"
11372 fi
11373 rm -f conftest*
11374 fi
11375
11376 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11377   echo "$ac_t""yes" 1>&6
11378     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11379   cat >> confdefs.h <<EOF
11380 #define $ac_tr_func 1
11381 EOF
11382  
11383 else
11384   echo "$ac_t""no" 1>&6
11385 fi
11386 done
11387
11388         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11389 echo "configure:11390: checking for LinuxThreads implementation" >&5
11390 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
11391   echo $ac_n "(cached) $ac_c" 1>&6
11392 else
11393   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11394 fi
11395
11396 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11397
11398                         
11399         
11400         
11401         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11402 echo "configure:11403: checking for LinuxThreads consistency" >&5
11403 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
11404   echo $ac_n "(cached) $ac_c" 1>&6
11405 else
11406   
11407                 if test $ol_cv_header_linux_threads = yes -a \
11408                         $ol_cv_sys_linux_threads = yes; then
11409                         ol_cv_linux_threads=yes
11410                 elif test $ol_cv_header_linux_threads = no -a \
11411                         $ol_cv_sys_linux_threads = no; then
11412                         ol_cv_linux_threads=no
11413                 else
11414                         ol_cv_linux_threads=error
11415                 fi
11416         
11417 fi
11418
11419 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11420
11421
11422                         if test $ol_cv_linux_threads = error; then
11423                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11424                         fi
11425
11426                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11427 echo "configure:11428: checking if pthread_create() works" >&5
11428 if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
11429   echo $ac_n "(cached) $ac_c" 1>&6
11430 else
11431   
11432                         if test "$cross_compiling" = yes; then
11433                                 ol_cv_pthread_create_works=yes
11434 else
11435   cat > conftest.$ac_ext <<EOF
11436 #line 11437 "configure"
11437 #include "confdefs.h"
11438 /* pthread test headers */
11439 #include <pthread.h>
11440 #ifndef NULL
11441 #define NULL (void*)0
11442 #endif
11443
11444 static void *task(p)
11445         void *p;
11446 {
11447         return (void *) (p == NULL);
11448 }
11449
11450
11451 int main(argc, argv)
11452         int argc;
11453         char **argv;
11454 {
11455
11456         /* pthread test function */
11457         pthread_t t;
11458         int status;
11459         int detach = 1;
11460
11461 #ifdef HAVE_PTHREADS_FINAL
11462         /* Final pthreads */
11463         pthread_attr_t attr;
11464
11465         status = pthread_attr_init(&attr);
11466         if( status ) return status;
11467
11468 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11469         if( !detach ) {
11470 #if defined( PTHREAD_CREATE_JOINABLE )
11471                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11472 #else
11473                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11474 #endif
11475
11476 #ifdef PTHREAD_CREATE_DETACHED
11477         } else {
11478                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11479 #endif
11480         }
11481         if( status ) return status;
11482 #endif
11483
11484         status = pthread_create( &t, &attr, task, NULL );
11485         if( status ) return status;
11486
11487 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11488         if( detach ) {
11489                 /* give thread a chance to complete */
11490                 /* it should remain joinable and hence detachable */
11491                 sleep( 1 );
11492
11493                 status = pthread_detach( t );
11494                 if( status ) return status;
11495         }
11496 #endif
11497
11498 #else
11499         /* Draft 4 pthreads */
11500         status = pthread_create( &t, pthread_attr_default, task, NULL );
11501         if( status ) return status;
11502
11503         if( detach ) {
11504                 /* give thread a chance to complete */
11505                 /* it should remain joinable and hence detachable */
11506                 sleep( 1 );
11507
11508                 status = pthread_detach( &t );
11509                 if( status ) return status;
11510         }
11511 #endif
11512
11513 #ifdef HAVE_LINUX_THREADS
11514         pthread_kill_other_threads_np();
11515 #endif
11516
11517         return 0;
11518
11519 }
11520
11521 EOF
11522 if { (eval echo configure:11523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11523 then
11524   ol_cv_pthread_create_works=yes
11525 else
11526   echo "configure: failed program was:" >&5
11527   cat conftest.$ac_ext >&5
11528   rm -fr conftest*
11529   ol_cv_pthread_create_works=no
11530 fi
11531 rm -fr conftest*
11532 fi
11533
11534 fi
11535
11536 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11537
11538                         if test $ol_cv_pthread_create_works = no ; then
11539                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11540                         fi
11541
11542                                                 if test $ol_with_yielding_select = auto ; then
11543                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11544 echo "configure:11545: checking if select yields when using pthreads" >&5
11545 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
11546   echo $ac_n "(cached) $ac_c" 1>&6
11547 else
11548   
11549                                 if test "$cross_compiling" = yes; then
11550   ol_cv_pthread_select_yields=cross
11551 else
11552   cat > conftest.$ac_ext <<EOF
11553 #line 11554 "configure"
11554 #include "confdefs.h"
11555
11556 #include <sys/types.h>
11557 #include <sys/time.h>
11558 #include <unistd.h>
11559 #include <pthread.h>
11560 #ifndef NULL
11561 #define NULL (void*) 0
11562 #endif
11563
11564 static int fildes[2];
11565
11566 static void *task(p)
11567         void *p;
11568 {
11569         int i;
11570         struct timeval tv;
11571
11572         fd_set rfds;
11573
11574         tv.tv_sec=10;
11575         tv.tv_usec=0;
11576
11577         FD_ZERO(&rfds);
11578         FD_SET(fildes[0], &rfds);
11579
11580         /* we're not interested in any fds */
11581         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11582
11583         if(i < 0) {
11584                 perror("select");
11585                 exit(10);
11586         }
11587
11588         exit(0); /* if we exit here, the select blocked the whole process */
11589 }
11590
11591 int main(argc, argv)
11592         int argc;
11593         char **argv;
11594 {
11595         pthread_t t;
11596
11597         /* create a pipe to select */
11598         if(pipe(&fildes[0])) {
11599                 perror("select");
11600                 exit(1);
11601         }
11602
11603 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11604         (void) pthread_setconcurrency(2);
11605 #else
11606 #ifdef HAVE_THR_SETCONCURRENCY
11607         /* Set Solaris LWP concurrency to 2 */
11608         thr_setconcurrency(2);
11609 #endif
11610 #endif
11611
11612 #if HAVE_PTHREADS_D4
11613         pthread_create(&t, pthread_attr_default, task, NULL);
11614 #else
11615         pthread_create(&t, NULL, task, NULL);
11616 #endif
11617
11618 #if HAVE_SCHED_YIELD
11619         sched_yield();  /* make sure task runs first */
11620 #else
11621 #ifdef HAVE_PTHREAD_YIELD
11622         pthread_yield();        /* make sure task runs first */
11623 #endif
11624 #endif
11625
11626         exit(2);
11627 }
11628 EOF
11629 if { (eval echo configure:11630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11630 then
11631   ol_cv_pthread_select_yields=no
11632 else
11633   echo "configure: failed program was:" >&5
11634   cat conftest.$ac_ext >&5
11635   rm -fr conftest*
11636   ol_cv_pthread_select_yields=yes
11637 fi
11638 rm -fr conftest*
11639 fi
11640
11641 fi
11642
11643 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11644
11645                                 if test $ol_cv_pthread_select_yields = cross ; then
11646                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11647                                 fi
11648
11649                                 if test $ol_cv_pthread_select_yields = yes ; then
11650                                         ol_with_yielding_select=yes
11651                                 fi
11652                         fi
11653
11654                                                 CPPFLAGS="$save_CPPFLAGS"
11655                         LIBS="$save_LIBS"
11656                 else
11657                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
11658                 fi
11659         fi
11660
11661         if test $ol_with_threads = posix ; then
11662                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11663         fi
11664 fi
11665
11666 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11667         -o $ol_with_threads = mach ; then
11668
11669                 for ac_hdr in mach/cthreads.h
11670 do
11671 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11672 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11673 echo "configure:11674: checking for $ac_hdr" >&5
11674 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
11675   echo $ac_n "(cached) $ac_c" 1>&6
11676 else
11677   cat > conftest.$ac_ext <<EOF
11678 #line 11679 "configure"
11679 #include "confdefs.h"
11680 #include <$ac_hdr>
11681 EOF
11682 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11683 { (eval echo configure:11684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11684 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11685 if test -z "$ac_err"; then
11686   rm -rf conftest*
11687   eval "ac_cv_header_$ac_safe=yes"
11688 else
11689   echo "$ac_err" >&5
11690   echo "configure: failed program was:" >&5
11691   cat conftest.$ac_ext >&5
11692   rm -rf conftest*
11693   eval "ac_cv_header_$ac_safe=no"
11694 fi
11695 rm -f conftest*
11696 fi
11697 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11698   echo "$ac_t""yes" 1>&6
11699     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11700   cat >> confdefs.h <<EOF
11701 #define $ac_tr_hdr 1
11702 EOF
11703  
11704 else
11705   echo "$ac_t""no" 1>&6
11706 fi
11707 done
11708
11709         if test $ac_cv_header_mach_cthreads_h = yes ; then
11710                 ol_with_threads=found
11711
11712                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11713 echo "configure:11714: checking for cthread_fork" >&5
11714 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
11715   echo $ac_n "(cached) $ac_c" 1>&6
11716 else
11717   cat > conftest.$ac_ext <<EOF
11718 #line 11719 "configure"
11719 #include "confdefs.h"
11720 /* System header to define __stub macros and hopefully few prototypes,
11721     which can conflict with char cthread_fork(); below.  */
11722 #include <assert.h>
11723 /* Override any gcc2 internal prototype to avoid an error.  */
11724 /* We use char because int might match the return type of a gcc2
11725     builtin and then its argument prototype would still apply.  */
11726 char cthread_fork();
11727
11728 int main() {
11729
11730 /* The GNU C library defines this for functions which it implements
11731     to always fail with ENOSYS.  Some functions are actually named
11732     something starting with __ and the normal name is an alias.  */
11733 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11734 choke me
11735 #else
11736 cthread_fork();
11737 #endif
11738
11739 ; return 0; }
11740 EOF
11741 if { (eval echo configure:11742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11742   rm -rf conftest*
11743   eval "ac_cv_func_cthread_fork=yes"
11744 else
11745   echo "configure: failed program was:" >&5
11746   cat conftest.$ac_ext >&5
11747   rm -rf conftest*
11748   eval "ac_cv_func_cthread_fork=no"
11749 fi
11750 rm -f conftest*
11751 fi
11752
11753 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11754   echo "$ac_t""yes" 1>&6
11755   ol_link_threads=yes
11756 else
11757   echo "$ac_t""no" 1>&6
11758 fi
11759
11760
11761                 if test $ol_link_threads = no ; then
11762                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11763 echo "configure:11764: checking for cthread_fork with -all_load" >&5
11764 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
11765   echo $ac_n "(cached) $ac_c" 1>&6
11766 else
11767   
11768                                                                 save_LIBS="$LIBS"
11769                                 LIBS="-all_load $LIBS"
11770                                 cat > conftest.$ac_ext <<EOF
11771 #line 11772 "configure"
11772 #include "confdefs.h"
11773 #include <mach/cthreads.h>
11774 int main() {
11775
11776                                         cthread_fork((void *)0, (void *)0);
11777                                         
11778 ; return 0; }
11779 EOF
11780 if { (eval echo configure:11781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11781   rm -rf conftest*
11782   ol_cv_cthread_all_load=yes
11783 else
11784   echo "configure: failed program was:" >&5
11785   cat conftest.$ac_ext >&5
11786   rm -rf conftest*
11787   ol_cv_cthread_all_load=no
11788 fi
11789 rm -f conftest*
11790                                                                 LIBS="$save_LIBS"
11791                         
11792 fi
11793
11794 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11795
11796                         if test $ol_cv_cthread_all_load = yes ; then
11797                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11798                                 ol_link_threads=mach
11799                         fi
11800                 fi
11801
11802                 if test $ol_link_threads != no ; then
11803                         : check for cthread specific functionality here
11804                         cat >> confdefs.h <<\EOF
11805 #define HAVE_MACH_CTHREADS 1
11806 EOF
11807
11808                 else
11809                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11810                 fi
11811         fi
11812
11813         if test $ol_with_threads = mach ; then
11814                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11815         fi
11816 fi
11817
11818 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11819         -o $ol_with_threads = pth ; then
11820
11821         for ac_hdr in pth.h
11822 do
11823 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11824 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11825 echo "configure:11826: checking for $ac_hdr" >&5
11826 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
11827   echo $ac_n "(cached) $ac_c" 1>&6
11828 else
11829   cat > conftest.$ac_ext <<EOF
11830 #line 11831 "configure"
11831 #include "confdefs.h"
11832 #include <$ac_hdr>
11833 EOF
11834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11835 { (eval echo configure:11836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11837 if test -z "$ac_err"; then
11838   rm -rf conftest*
11839   eval "ac_cv_header_$ac_safe=yes"
11840 else
11841   echo "$ac_err" >&5
11842   echo "configure: failed program was:" >&5
11843   cat conftest.$ac_ext >&5
11844   rm -rf conftest*
11845   eval "ac_cv_header_$ac_safe=no"
11846 fi
11847 rm -f conftest*
11848 fi
11849 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11850   echo "$ac_t""yes" 1>&6
11851     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11852   cat >> confdefs.h <<EOF
11853 #define $ac_tr_hdr 1
11854 EOF
11855  
11856 else
11857   echo "$ac_t""no" 1>&6
11858 fi
11859 done
11860
11861
11862         if test $ac_cv_header_pth_h = yes ; then
11863                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11864 echo "configure:11865: checking for pth_version in -lpth" >&5
11865 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-%__p_%'`
11866 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11867   echo $ac_n "(cached) $ac_c" 1>&6
11868 else
11869   ac_save_LIBS="$LIBS"
11870 LIBS="-lpth  $LIBS"
11871 cat > conftest.$ac_ext <<EOF
11872 #line 11873 "configure"
11873 #include "confdefs.h"
11874 /* Override any gcc2 internal prototype to avoid an error.  */
11875 /* We use char because int might match the return type of a gcc2
11876     builtin and then its argument prototype would still apply.  */
11877 char pth_version();
11878
11879 int main() {
11880 pth_version()
11881 ; return 0; }
11882 EOF
11883 if { (eval echo configure:11884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11884   rm -rf conftest*
11885   eval "ac_cv_lib_$ac_lib_var=yes"
11886 else
11887   echo "configure: failed program was:" >&5
11888   cat conftest.$ac_ext >&5
11889   rm -rf conftest*
11890   eval "ac_cv_lib_$ac_lib_var=no"
11891 fi
11892 rm -f conftest*
11893 LIBS="$ac_save_LIBS"
11894
11895 fi
11896 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11897   echo "$ac_t""yes" 1>&6
11898   have_pth=yes
11899 else
11900   echo "$ac_t""no" 1>&6
11901 have_pth=no
11902 fi
11903
11904
11905                 if test $have_pth = yes ; then
11906                         cat >> confdefs.h <<\EOF
11907 #define HAVE_GNU_PTH 1
11908 EOF
11909
11910                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11911                         ol_link_threads=pth
11912
11913                         if test $ol_with_yielding_select = auto ; then
11914                                 ol_with_yielding_select=yes
11915                         fi
11916                 fi
11917         fi
11918 fi
11919
11920 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11921         -o $ol_with_threads = lwp ; then
11922
11923                 for ac_hdr in thread.h synch.h
11924 do
11925 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11926 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11927 echo "configure:11928: checking for $ac_hdr" >&5
11928 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
11929   echo $ac_n "(cached) $ac_c" 1>&6
11930 else
11931   cat > conftest.$ac_ext <<EOF
11932 #line 11933 "configure"
11933 #include "confdefs.h"
11934 #include <$ac_hdr>
11935 EOF
11936 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11937 { (eval echo configure:11938: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11938 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11939 if test -z "$ac_err"; then
11940   rm -rf conftest*
11941   eval "ac_cv_header_$ac_safe=yes"
11942 else
11943   echo "$ac_err" >&5
11944   echo "configure: failed program was:" >&5
11945   cat conftest.$ac_ext >&5
11946   rm -rf conftest*
11947   eval "ac_cv_header_$ac_safe=no"
11948 fi
11949 rm -f conftest*
11950 fi
11951 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11952   echo "$ac_t""yes" 1>&6
11953     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11954   cat >> confdefs.h <<EOF
11955 #define $ac_tr_hdr 1
11956 EOF
11957  
11958 else
11959   echo "$ac_t""no" 1>&6
11960 fi
11961 done
11962
11963         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11964                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11965 echo "configure:11966: checking for thr_create in -lthread" >&5
11966 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
11967 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11968   echo $ac_n "(cached) $ac_c" 1>&6
11969 else
11970   ac_save_LIBS="$LIBS"
11971 LIBS="-lthread  $LIBS"
11972 cat > conftest.$ac_ext <<EOF
11973 #line 11974 "configure"
11974 #include "confdefs.h"
11975 /* Override any gcc2 internal prototype to avoid an error.  */
11976 /* We use char because int might match the return type of a gcc2
11977     builtin and then its argument prototype would still apply.  */
11978 char thr_create();
11979
11980 int main() {
11981 thr_create()
11982 ; return 0; }
11983 EOF
11984 if { (eval echo configure:11985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11985   rm -rf conftest*
11986   eval "ac_cv_lib_$ac_lib_var=yes"
11987 else
11988   echo "configure: failed program was:" >&5
11989   cat conftest.$ac_ext >&5
11990   rm -rf conftest*
11991   eval "ac_cv_lib_$ac_lib_var=no"
11992 fi
11993 rm -f conftest*
11994 LIBS="$ac_save_LIBS"
11995
11996 fi
11997 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11998   echo "$ac_t""yes" 1>&6
11999   have_thr=yes
12000 else
12001   echo "$ac_t""no" 1>&6
12002 have_thr=no
12003 fi
12004
12005
12006                 if test $have_thr = yes ; then
12007                         cat >> confdefs.h <<\EOF
12008 #define HAVE_THR 1
12009 EOF
12010
12011                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12012                         ol_link_threads=thr
12013
12014                         if test $ol_with_yielding_select = auto ; then
12015                                 ol_with_yielding_select=yes
12016                         fi
12017
12018                                                 for ac_func in \
12019                                 thr_setconcurrency \
12020                                 thr_getconcurrency \
12021                         
12022 do
12023 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12024 echo "configure:12025: checking for $ac_func" >&5
12025 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
12026   echo $ac_n "(cached) $ac_c" 1>&6
12027 else
12028   cat > conftest.$ac_ext <<EOF
12029 #line 12030 "configure"
12030 #include "confdefs.h"
12031 /* System header to define __stub macros and hopefully few prototypes,
12032     which can conflict with char $ac_func(); below.  */
12033 #include <assert.h>
12034 /* Override any gcc2 internal prototype to avoid an error.  */
12035 /* We use char because int might match the return type of a gcc2
12036     builtin and then its argument prototype would still apply.  */
12037 char $ac_func();
12038
12039 int main() {
12040
12041 /* The GNU C library defines this for functions which it implements
12042     to always fail with ENOSYS.  Some functions are actually named
12043     something starting with __ and the normal name is an alias.  */
12044 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12045 choke me
12046 #else
12047 $ac_func();
12048 #endif
12049
12050 ; return 0; }
12051 EOF
12052 if { (eval echo configure:12053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12053   rm -rf conftest*
12054   eval "ac_cv_func_$ac_func=yes"
12055 else
12056   echo "configure: failed program was:" >&5
12057   cat conftest.$ac_ext >&5
12058   rm -rf conftest*
12059   eval "ac_cv_func_$ac_func=no"
12060 fi
12061 rm -f conftest*
12062 fi
12063
12064 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12065   echo "$ac_t""yes" 1>&6
12066     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12067   cat >> confdefs.h <<EOF
12068 #define $ac_tr_func 1
12069 EOF
12070  
12071 else
12072   echo "$ac_t""no" 1>&6
12073 fi
12074 done
12075
12076                 fi
12077         fi
12078
12079                 for ac_hdr in lwp/lwp.h
12080 do
12081 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12082 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12083 echo "configure:12084: checking for $ac_hdr" >&5
12084 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12085   echo $ac_n "(cached) $ac_c" 1>&6
12086 else
12087   cat > conftest.$ac_ext <<EOF
12088 #line 12089 "configure"
12089 #include "confdefs.h"
12090 #include <$ac_hdr>
12091 EOF
12092 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12093 { (eval echo configure:12094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12094 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12095 if test -z "$ac_err"; then
12096   rm -rf conftest*
12097   eval "ac_cv_header_$ac_safe=yes"
12098 else
12099   echo "$ac_err" >&5
12100   echo "configure: failed program was:" >&5
12101   cat conftest.$ac_ext >&5
12102   rm -rf conftest*
12103   eval "ac_cv_header_$ac_safe=no"
12104 fi
12105 rm -f conftest*
12106 fi
12107 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12108   echo "$ac_t""yes" 1>&6
12109     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12110   cat >> confdefs.h <<EOF
12111 #define $ac_tr_hdr 1
12112 EOF
12113  
12114 else
12115   echo "$ac_t""no" 1>&6
12116 fi
12117 done
12118
12119         if test $ac_cv_header_lwp_lwp_h = yes ; then
12120                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12121 echo "configure:12122: checking for lwp_create in -llwp" >&5
12122 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
12123 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
12124   echo $ac_n "(cached) $ac_c" 1>&6
12125 else
12126   ac_save_LIBS="$LIBS"
12127 LIBS="-llwp  $LIBS"
12128 cat > conftest.$ac_ext <<EOF
12129 #line 12130 "configure"
12130 #include "confdefs.h"
12131 /* Override any gcc2 internal prototype to avoid an error.  */
12132 /* We use char because int might match the return type of a gcc2
12133     builtin and then its argument prototype would still apply.  */
12134 char lwp_create();
12135
12136 int main() {
12137 lwp_create()
12138 ; return 0; }
12139 EOF
12140 if { (eval echo configure:12141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12141   rm -rf conftest*
12142   eval "ac_cv_lib_$ac_lib_var=yes"
12143 else
12144   echo "configure: failed program was:" >&5
12145   cat conftest.$ac_ext >&5
12146   rm -rf conftest*
12147   eval "ac_cv_lib_$ac_lib_var=no"
12148 fi
12149 rm -f conftest*
12150 LIBS="$ac_save_LIBS"
12151
12152 fi
12153 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12154   echo "$ac_t""yes" 1>&6
12155   have_lwp=yes
12156 else
12157   echo "$ac_t""no" 1>&6
12158 have_lwp=no
12159 fi
12160
12161
12162                 if test $have_lwp = yes ; then
12163                         cat >> confdefs.h <<\EOF
12164 #define HAVE_LWP 1
12165 EOF
12166
12167                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12168                         ol_link_threads=lwp
12169
12170                         if test $ol_with_yielding_select = auto ; then
12171                                 ol_with_yielding_select=no
12172                         fi
12173                 fi
12174         fi
12175 fi
12176
12177 if test $ol_with_yielding_select = yes ; then
12178         cat >> confdefs.h <<\EOF
12179 #define HAVE_YIELDING_SELECT 1
12180 EOF
12181
12182 fi
12183
12184 if test $ol_with_threads = manual ; then
12185                 ol_link_threads=yes
12186
12187         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12188
12189         for ac_hdr in pthread.h sched.h
12190 do
12191 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12192 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12193 echo "configure:12194: checking for $ac_hdr" >&5
12194 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12195   echo $ac_n "(cached) $ac_c" 1>&6
12196 else
12197   cat > conftest.$ac_ext <<EOF
12198 #line 12199 "configure"
12199 #include "confdefs.h"
12200 #include <$ac_hdr>
12201 EOF
12202 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12203 { (eval echo configure:12204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12204 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12205 if test -z "$ac_err"; then
12206   rm -rf conftest*
12207   eval "ac_cv_header_$ac_safe=yes"
12208 else
12209   echo "$ac_err" >&5
12210   echo "configure: failed program was:" >&5
12211   cat conftest.$ac_ext >&5
12212   rm -rf conftest*
12213   eval "ac_cv_header_$ac_safe=no"
12214 fi
12215 rm -f conftest*
12216 fi
12217 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12218   echo "$ac_t""yes" 1>&6
12219     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12220   cat >> confdefs.h <<EOF
12221 #define $ac_tr_hdr 1
12222 EOF
12223  
12224 else
12225   echo "$ac_t""no" 1>&6
12226 fi
12227 done
12228
12229         for ac_func in sched_yield pthread_yield
12230 do
12231 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12232 echo "configure:12233: checking for $ac_func" >&5
12233 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
12234   echo $ac_n "(cached) $ac_c" 1>&6
12235 else
12236   cat > conftest.$ac_ext <<EOF
12237 #line 12238 "configure"
12238 #include "confdefs.h"
12239 /* System header to define __stub macros and hopefully few prototypes,
12240     which can conflict with char $ac_func(); below.  */
12241 #include <assert.h>
12242 /* Override any gcc2 internal prototype to avoid an error.  */
12243 /* We use char because int might match the return type of a gcc2
12244     builtin and then its argument prototype would still apply.  */
12245 char $ac_func();
12246
12247 int main() {
12248
12249 /* The GNU C library defines this for functions which it implements
12250     to always fail with ENOSYS.  Some functions are actually named
12251     something starting with __ and the normal name is an alias.  */
12252 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12253 choke me
12254 #else
12255 $ac_func();
12256 #endif
12257
12258 ; return 0; }
12259 EOF
12260 if { (eval echo configure:12261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12261   rm -rf conftest*
12262   eval "ac_cv_func_$ac_func=yes"
12263 else
12264   echo "configure: failed program was:" >&5
12265   cat conftest.$ac_ext >&5
12266   rm -rf conftest*
12267   eval "ac_cv_func_$ac_func=no"
12268 fi
12269 rm -f conftest*
12270 fi
12271
12272 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12273   echo "$ac_t""yes" 1>&6
12274     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12275   cat >> confdefs.h <<EOF
12276 #define $ac_tr_func 1
12277 EOF
12278  
12279 else
12280   echo "$ac_t""no" 1>&6
12281 fi
12282 done
12283
12284         
12285         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12286 echo "configure:12287: checking for LinuxThreads pthread.h" >&5
12287 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
12288   echo $ac_n "(cached) $ac_c" 1>&6
12289 else
12290   cat > conftest.$ac_ext <<EOF
12291 #line 12292 "configure"
12292 #include "confdefs.h"
12293 #include <pthread.h>
12294 EOF
12295 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12296   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12297   rm -rf conftest*
12298   ol_cv_header_linux_threads=yes
12299 else
12300   rm -rf conftest*
12301   ol_cv_header_linux_threads=no
12302 fi
12303 rm -f conftest*
12304
12305                 
12306 fi
12307
12308 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12309         if test $ol_cv_header_linux_threads = yes; then
12310                 cat >> confdefs.h <<\EOF
12311 #define HAVE_LINUX_THREADS 1
12312 EOF
12313
12314         fi
12315
12316
12317         for ac_hdr in mach/cthreads.h
12318 do
12319 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12320 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12321 echo "configure:12322: checking for $ac_hdr" >&5
12322 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12323   echo $ac_n "(cached) $ac_c" 1>&6
12324 else
12325   cat > conftest.$ac_ext <<EOF
12326 #line 12327 "configure"
12327 #include "confdefs.h"
12328 #include <$ac_hdr>
12329 EOF
12330 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12331 { (eval echo configure:12332: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12332 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12333 if test -z "$ac_err"; then
12334   rm -rf conftest*
12335   eval "ac_cv_header_$ac_safe=yes"
12336 else
12337   echo "$ac_err" >&5
12338   echo "configure: failed program was:" >&5
12339   cat conftest.$ac_ext >&5
12340   rm -rf conftest*
12341   eval "ac_cv_header_$ac_safe=no"
12342 fi
12343 rm -f conftest*
12344 fi
12345 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12346   echo "$ac_t""yes" 1>&6
12347     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12348   cat >> confdefs.h <<EOF
12349 #define $ac_tr_hdr 1
12350 EOF
12351  
12352 else
12353   echo "$ac_t""no" 1>&6
12354 fi
12355 done
12356
12357         for ac_hdr in lwp/lwp.h
12358 do
12359 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12360 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12361 echo "configure:12362: checking for $ac_hdr" >&5
12362 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12363   echo $ac_n "(cached) $ac_c" 1>&6
12364 else
12365   cat > conftest.$ac_ext <<EOF
12366 #line 12367 "configure"
12367 #include "confdefs.h"
12368 #include <$ac_hdr>
12369 EOF
12370 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12371 { (eval echo configure:12372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12372 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12373 if test -z "$ac_err"; then
12374   rm -rf conftest*
12375   eval "ac_cv_header_$ac_safe=yes"
12376 else
12377   echo "$ac_err" >&5
12378   echo "configure: failed program was:" >&5
12379   cat conftest.$ac_ext >&5
12380   rm -rf conftest*
12381   eval "ac_cv_header_$ac_safe=no"
12382 fi
12383 rm -f conftest*
12384 fi
12385 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12386   echo "$ac_t""yes" 1>&6
12387     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12388   cat >> confdefs.h <<EOF
12389 #define $ac_tr_hdr 1
12390 EOF
12391  
12392 else
12393   echo "$ac_t""no" 1>&6
12394 fi
12395 done
12396
12397         for ac_hdr in thread.h synch.h
12398 do
12399 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12400 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12401 echo "configure:12402: checking for $ac_hdr" >&5
12402 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12403   echo $ac_n "(cached) $ac_c" 1>&6
12404 else
12405   cat > conftest.$ac_ext <<EOF
12406 #line 12407 "configure"
12407 #include "confdefs.h"
12408 #include <$ac_hdr>
12409 EOF
12410 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12411 { (eval echo configure:12412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12412 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12413 if test -z "$ac_err"; then
12414   rm -rf conftest*
12415   eval "ac_cv_header_$ac_safe=yes"
12416 else
12417   echo "$ac_err" >&5
12418   echo "configure: failed program was:" >&5
12419   cat conftest.$ac_ext >&5
12420   rm -rf conftest*
12421   eval "ac_cv_header_$ac_safe=no"
12422 fi
12423 rm -f conftest*
12424 fi
12425 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12426   echo "$ac_t""yes" 1>&6
12427     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12428   cat >> confdefs.h <<EOF
12429 #define $ac_tr_hdr 1
12430 EOF
12431  
12432 else
12433   echo "$ac_t""no" 1>&6
12434 fi
12435 done
12436
12437 fi
12438
12439 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12440                         cat >> confdefs.h <<\EOF
12441 #define REENTRANT 1
12442 EOF
12443
12444         cat >> confdefs.h <<\EOF
12445 #define _REENTRANT 1
12446 EOF
12447
12448         cat >> confdefs.h <<\EOF
12449 #define THREAD_SAFE 1
12450 EOF
12451
12452         cat >> confdefs.h <<\EOF
12453 #define _THREAD_SAFE 1
12454 EOF
12455
12456         cat >> confdefs.h <<\EOF
12457 #define THREADSAFE 1
12458 EOF
12459
12460         cat >> confdefs.h <<\EOF
12461 #define _THREADSAFE 1
12462 EOF
12463
12464         cat >> confdefs.h <<\EOF
12465 #define _SGI_MP_SOURCE 1
12466 EOF
12467
12468
12469                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12470 echo "configure:12471: checking for thread specific errno" >&5
12471 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
12472   echo $ac_n "(cached) $ac_c" 1>&6
12473 else
12474   
12475                 cat > conftest.$ac_ext <<EOF
12476 #line 12477 "configure"
12477 #include "confdefs.h"
12478 #include <errno.h>
12479 int main() {
12480 errno = 0;
12481 ; return 0; }
12482 EOF
12483 if { (eval echo configure:12484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12484   rm -rf conftest*
12485   ol_cv_errno_thread_specific=yes
12486 else
12487   echo "configure: failed program was:" >&5
12488   cat conftest.$ac_ext >&5
12489   rm -rf conftest*
12490   ol_cv_errno_thread_specific=no
12491 fi
12492 rm -f conftest*
12493         
12494 fi
12495
12496 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12497
12498                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12499 echo "configure:12500: checking for thread specific h_errno" >&5
12500 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
12501   echo $ac_n "(cached) $ac_c" 1>&6
12502 else
12503   
12504                 cat > conftest.$ac_ext <<EOF
12505 #line 12506 "configure"
12506 #include "confdefs.h"
12507 #include <netdb.h>
12508 int main() {
12509 h_errno = 0;
12510 ; return 0; }
12511 EOF
12512 if { (eval echo configure:12513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12513   rm -rf conftest*
12514   ol_cv_h_errno_thread_specific=yes
12515 else
12516   echo "configure: failed program was:" >&5
12517   cat conftest.$ac_ext >&5
12518   rm -rf conftest*
12519   ol_cv_h_errno_thread_specific=no
12520 fi
12521 rm -f conftest*
12522         
12523 fi
12524
12525 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12526
12527         if test $ol_cv_errno_thread_specific != yes \
12528                 -o $ol_cv_h_errno_thread_specific != yes ; then
12529                 LIBS="$LTHREAD_LIBS $LIBS"
12530                 LTHREAD_LIBS=""
12531         fi
12532
12533 fi  
12534
12535 if test $ol_link_threads = no ; then
12536         if test $ol_with_threads = yes ; then
12537                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12538         fi
12539
12540         if test $ol_with_threads = auto ; then
12541                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12542                 ol_with_threads=no
12543         fi
12544
12545         cat >> confdefs.h <<\EOF
12546 #define NO_THREADS 1
12547 EOF
12548
12549         LTHREAD_LIBS=""
12550 fi
12551
12552 if test $ol_link_threads != no ; then
12553         cat >> confdefs.h <<\EOF
12554 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12555 EOF
12556
12557 fi
12558
12559 ol_link_ldbm=no 
12560
12561 if test $ol_with_ldbm_api = auto \
12562         -o $ol_with_ldbm_api = berkeley \
12563         -o $ol_with_ldbm_api = bcompat ; then
12564
12565         if test $ol_with_ldbm_api = bcompat; then \
12566                 ol_cv_berkeley_db=no
12567 for ac_hdr in db_185.h db.h
12568 do
12569 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12570 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12571 echo "configure:12572: checking for $ac_hdr" >&5
12572 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
12573   echo $ac_n "(cached) $ac_c" 1>&6
12574 else
12575   cat > conftest.$ac_ext <<EOF
12576 #line 12577 "configure"
12577 #include "confdefs.h"
12578 #include <$ac_hdr>
12579 EOF
12580 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12581 { (eval echo configure:12582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12582 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12583 if test -z "$ac_err"; then
12584   rm -rf conftest*
12585   eval "ac_cv_header_$ac_safe=yes"
12586 else
12587   echo "$ac_err" >&5
12588   echo "configure: failed program was:" >&5
12589   cat conftest.$ac_ext >&5
12590   rm -rf conftest*
12591   eval "ac_cv_header_$ac_safe=no"
12592 fi
12593 rm -f conftest*
12594 fi
12595 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12596   echo "$ac_t""yes" 1>&6
12597     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12598   cat >> confdefs.h <<EOF
12599 #define $ac_tr_hdr 1
12600 EOF
12601  
12602 else
12603   echo "$ac_t""no" 1>&6
12604 fi
12605 done
12606
12607 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12608         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12609 echo "configure:12610: checking if Berkeley DB header compatibility" >&5
12610 if eval "test \"`echo '$''{'ol_cv_header_db1'+set}'`\" = set"; then
12611   echo $ac_n "(cached) $ac_c" 1>&6
12612 else
12613   
12614                 cat > conftest.$ac_ext <<EOF
12615 #line 12616 "configure"
12616 #include "confdefs.h"
12617
12618 #if HAVE_DB_185_H
12619 #       include <db_185.h>
12620 #else
12621 #       include <db.h>
12622 #endif
12623
12624  /* this check could be improved */
12625 #ifndef DB_VERSION_MAJOR
12626 #       define DB_VERSION_MAJOR 1
12627 #endif
12628
12629 #if DB_VERSION_MAJOR == 1 
12630         __db_version_1
12631 #endif
12632
12633 EOF
12634 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12635   egrep "__db_version_1" >/dev/null 2>&1; then
12636   rm -rf conftest*
12637   ol_cv_header_db1=yes
12638 else
12639   rm -rf conftest*
12640   ol_cv_header_db1=no
12641 fi
12642 rm -f conftest*
12643
12644 fi
12645
12646 echo "$ac_t""$ol_cv_header_db1" 1>&6
12647
12648         if test ol_cv_header_db1=yes ; then
12649                 ol_cv_lib_db=no
12650 if test $ol_cv_lib_db = no ; then
12651         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12652 echo "configure:12653: checking for Berkeley DB link (default)" >&5
12653 if eval "test \"`echo '$''{'ol_cv_db_none'+set}'`\" = set"; then
12654   echo $ac_n "(cached) $ac_c" 1>&6
12655 else
12656   
12657         ol_DB_LIB=
12658         ol_LIBS=$LIBS
12659         LIBS="$ol_DB_LIB $LIBS"
12660
12661         cat > conftest.$ac_ext <<EOF
12662 #line 12663 "configure"
12663 #include "confdefs.h"
12664
12665 #ifdef HAVE_DB_185_H
12666 # include <db_185.h>
12667 #else
12668 # include <db.h>
12669 #endif
12670
12671 #ifndef DB_VERSION_MAJOR
12672 # define DB_VERSION_MAJOR 1
12673 #endif
12674
12675 #ifndef NULL
12676 #define NULL ((void*)0)
12677 #endif
12678
12679 int main() {
12680
12681 #if DB_VERSION_MAJOR > 1
12682         {
12683                 char *version;
12684                 int major, minor, patch;
12685
12686                 version = db_version( &major, &minor, &patch );
12687
12688                 if( major != DB_VERSION_MAJOR ||
12689                         minor < DB_VERSION_MINOR )
12690                 {
12691                         printf("Berkeley DB version mismatch\n"
12692                                 "\texpected: %s\n\tgot: %s\n",
12693                                 DB_VERSION_STRING, version);
12694                         return 1;
12695                 }
12696         }
12697 #endif
12698
12699 #if DB_VERSION_MAJOR > 2
12700         db_env_create( NULL, 0 );
12701 #elif DB_VERSION_MAJOR > 1
12702         db_appexit( NULL );
12703 #else
12704         (void) dbopen( NULL, 0, 0, 0, NULL);
12705 #endif
12706
12707 ; return 0; }
12708 EOF
12709 if { (eval echo configure:12710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12710   rm -rf conftest*
12711   ol_cv_db_none=yes
12712 else
12713   echo "configure: failed program was:" >&5
12714   cat conftest.$ac_ext >&5
12715   rm -rf conftest*
12716   ol_cv_db_none=no
12717 fi
12718 rm -f conftest*
12719
12720         LIBS="$ol_LIBS"
12721
12722 fi
12723
12724 echo "$ac_t""$ol_cv_db_none" 1>&6
12725
12726         if test $ol_cv_db_none = yes ; then
12727                 ol_cv_lib_db=yes
12728         fi
12729 fi
12730
12731 if test $ol_cv_lib_db = no ; then
12732         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12733 echo "configure:12734: checking for Berkeley DB link (-ldb)" >&5
12734 if eval "test \"`echo '$''{'ol_cv_db_db'+set}'`\" = set"; then
12735   echo $ac_n "(cached) $ac_c" 1>&6
12736 else
12737   
12738         ol_DB_LIB=-ldb
12739         ol_LIBS=$LIBS
12740         LIBS="$ol_DB_LIB $LIBS"
12741
12742         cat > conftest.$ac_ext <<EOF
12743 #line 12744 "configure"
12744 #include "confdefs.h"
12745
12746 #ifdef HAVE_DB_185_H
12747 # include <db_185.h>
12748 #else
12749 # include <db.h>
12750 #endif
12751
12752 #ifndef DB_VERSION_MAJOR
12753 # define DB_VERSION_MAJOR 1
12754 #endif
12755
12756 #ifndef NULL
12757 #define NULL ((void*)0)
12758 #endif
12759
12760 int main() {
12761
12762 #if DB_VERSION_MAJOR > 1
12763         {
12764                 char *version;
12765                 int major, minor, patch;
12766
12767                 version = db_version( &major, &minor, &patch );
12768
12769                 if( major != DB_VERSION_MAJOR ||
12770                         minor < DB_VERSION_MINOR )
12771                 {
12772                         printf("Berkeley DB version mismatch\n"
12773                                 "\texpected: %s\n\tgot: %s\n",
12774                                 DB_VERSION_STRING, version);
12775                         return 1;
12776                 }
12777         }
12778 #endif
12779
12780 #if DB_VERSION_MAJOR > 2
12781         db_env_create( NULL, 0 );
12782 #elif DB_VERSION_MAJOR > 1
12783         db_appexit( NULL );
12784 #else
12785         (void) dbopen( NULL, 0, 0, 0, NULL);
12786 #endif
12787
12788 ; return 0; }
12789 EOF
12790 if { (eval echo configure:12791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12791   rm -rf conftest*
12792   ol_cv_db_db=yes
12793 else
12794   echo "configure: failed program was:" >&5
12795   cat conftest.$ac_ext >&5
12796   rm -rf conftest*
12797   ol_cv_db_db=no
12798 fi
12799 rm -f conftest*
12800
12801         LIBS="$ol_LIBS"
12802
12803 fi
12804
12805 echo "$ac_t""$ol_cv_db_db" 1>&6
12806
12807         if test $ol_cv_db_db = yes ; then
12808                 ol_cv_lib_db=-ldb
12809         fi
12810 fi
12811
12812 if test $ol_cv_lib_db = no ; then
12813         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12814 echo "configure:12815: checking for Berkeley DB link (-ldb3)" >&5
12815 if eval "test \"`echo '$''{'ol_cv_db_db3'+set}'`\" = set"; then
12816   echo $ac_n "(cached) $ac_c" 1>&6
12817 else
12818   
12819         ol_DB_LIB=-ldb3
12820         ol_LIBS=$LIBS
12821         LIBS="$ol_DB_LIB $LIBS"
12822
12823         cat > conftest.$ac_ext <<EOF
12824 #line 12825 "configure"
12825 #include "confdefs.h"
12826
12827 #ifdef HAVE_DB_185_H
12828 # include <db_185.h>
12829 #else
12830 # include <db.h>
12831 #endif
12832
12833 #ifndef DB_VERSION_MAJOR
12834 # define DB_VERSION_MAJOR 1
12835 #endif
12836
12837 #ifndef NULL
12838 #define NULL ((void*)0)
12839 #endif
12840
12841 int main() {
12842
12843 #if DB_VERSION_MAJOR > 1
12844         {
12845                 char *version;
12846                 int major, minor, patch;
12847
12848                 version = db_version( &major, &minor, &patch );
12849
12850                 if( major != DB_VERSION_MAJOR ||
12851                         minor < DB_VERSION_MINOR )
12852                 {
12853                         printf("Berkeley DB version mismatch\n"
12854                                 "\texpected: %s\n\tgot: %s\n",
12855                                 DB_VERSION_STRING, version);
12856                         return 1;
12857                 }
12858         }
12859 #endif
12860
12861 #if DB_VERSION_MAJOR > 2
12862         db_env_create( NULL, 0 );
12863 #elif DB_VERSION_MAJOR > 1
12864         db_appexit( NULL );
12865 #else
12866         (void) dbopen( NULL, 0, 0, 0, NULL);
12867 #endif
12868
12869 ; return 0; }
12870 EOF
12871 if { (eval echo configure:12872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12872   rm -rf conftest*
12873   ol_cv_db_db3=yes
12874 else
12875   echo "configure: failed program was:" >&5
12876   cat conftest.$ac_ext >&5
12877   rm -rf conftest*
12878   ol_cv_db_db3=no
12879 fi
12880 rm -f conftest*
12881
12882         LIBS="$ol_LIBS"
12883
12884 fi
12885
12886 echo "$ac_t""$ol_cv_db_db3" 1>&6
12887
12888         if test $ol_cv_db_db3 = yes ; then
12889                 ol_cv_lib_db=-ldb3
12890         fi
12891 fi
12892
12893 if test $ol_cv_lib_db = no ; then
12894         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12895 echo "configure:12896: checking for Berkeley DB link (-ldb2)" >&5
12896 if eval "test \"`echo '$''{'ol_cv_db_db2'+set}'`\" = set"; then
12897   echo $ac_n "(cached) $ac_c" 1>&6
12898 else
12899   
12900         ol_DB_LIB=-ldb2
12901         ol_LIBS=$LIBS
12902         LIBS="$ol_DB_LIB $LIBS"
12903
12904         cat > conftest.$ac_ext <<EOF
12905 #line 12906 "configure"
12906 #include "confdefs.h"
12907
12908 #ifdef HAVE_DB_185_H
12909 # include <db_185.h>
12910 #else
12911 # include <db.h>
12912 #endif
12913
12914 #ifndef DB_VERSION_MAJOR
12915 # define DB_VERSION_MAJOR 1
12916 #endif
12917
12918 #ifndef NULL
12919 #define NULL ((void*)0)
12920 #endif
12921
12922 int main() {
12923
12924 #if DB_VERSION_MAJOR > 1
12925         {
12926                 char *version;
12927                 int major, minor, patch;
12928
12929                 version = db_version( &major, &minor, &patch );
12930
12931                 if( major != DB_VERSION_MAJOR ||
12932                         minor < DB_VERSION_MINOR )
12933                 {
12934                         printf("Berkeley DB version mismatch\n"
12935                                 "\texpected: %s\n\tgot: %s\n",
12936                                 DB_VERSION_STRING, version);
12937                         return 1;
12938                 }
12939         }
12940 #endif
12941
12942 #if DB_VERSION_MAJOR > 2
12943         db_env_create( NULL, 0 );
12944 #elif DB_VERSION_MAJOR > 1
12945         db_appexit( NULL );
12946 #else
12947         (void) dbopen( NULL, 0, 0, 0, NULL);
12948 #endif
12949
12950 ; return 0; }
12951 EOF
12952 if { (eval echo configure:12953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12953   rm -rf conftest*
12954   ol_cv_db_db2=yes
12955 else
12956   echo "configure: failed program was:" >&5
12957   cat conftest.$ac_ext >&5
12958   rm -rf conftest*
12959   ol_cv_db_db2=no
12960 fi
12961 rm -f conftest*
12962
12963         LIBS="$ol_LIBS"
12964
12965 fi
12966
12967 echo "$ac_t""$ol_cv_db_db2" 1>&6
12968
12969         if test $ol_cv_db_db2 = yes ; then
12970                 ol_cv_lib_db=-ldb2
12971         fi
12972 fi
12973
12974 if test $ol_cv_lib_db = no ; then
12975         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12976 echo "configure:12977: checking for Berkeley DB link (-ldb1)" >&5
12977 if eval "test \"`echo '$''{'ol_cv_db_db1'+set}'`\" = set"; then
12978   echo $ac_n "(cached) $ac_c" 1>&6
12979 else
12980   
12981         ol_DB_LIB=-ldb1
12982         ol_LIBS=$LIBS
12983         LIBS="$ol_DB_LIB $LIBS"
12984
12985         cat > conftest.$ac_ext <<EOF
12986 #line 12987 "configure"
12987 #include "confdefs.h"
12988
12989 #ifdef HAVE_DB_185_H
12990 # include <db_185.h>
12991 #else
12992 # include <db.h>
12993 #endif
12994
12995 #ifndef DB_VERSION_MAJOR
12996 # define DB_VERSION_MAJOR 1
12997 #endif
12998
12999 #ifndef NULL
13000 #define NULL ((void*)0)
13001 #endif
13002
13003 int main() {
13004
13005 #if DB_VERSION_MAJOR > 1
13006         {
13007                 char *version;
13008                 int major, minor, patch;
13009
13010                 version = db_version( &major, &minor, &patch );
13011
13012                 if( major != DB_VERSION_MAJOR ||
13013                         minor < DB_VERSION_MINOR )
13014                 {
13015                         printf("Berkeley DB version mismatch\n"
13016                                 "\texpected: %s\n\tgot: %s\n",
13017                                 DB_VERSION_STRING, version);
13018                         return 1;
13019                 }
13020         }
13021 #endif
13022
13023 #if DB_VERSION_MAJOR > 2
13024         db_env_create( NULL, 0 );
13025 #elif DB_VERSION_MAJOR > 1
13026         db_appexit( NULL );
13027 #else
13028         (void) dbopen( NULL, 0, 0, 0, NULL);
13029 #endif
13030
13031 ; return 0; }
13032 EOF
13033 if { (eval echo configure:13034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13034   rm -rf conftest*
13035   ol_cv_db_db1=yes
13036 else
13037   echo "configure: failed program was:" >&5
13038   cat conftest.$ac_ext >&5
13039   rm -rf conftest*
13040   ol_cv_db_db1=no
13041 fi
13042 rm -f conftest*
13043
13044         LIBS="$ol_LIBS"
13045
13046 fi
13047
13048 echo "$ac_t""$ol_cv_db_db1" 1>&6
13049
13050         if test $ol_cv_db_db1 = yes ; then
13051                 ol_cv_lib_db=-ldb1
13052         fi
13053 fi
13054
13055
13056                 if test "$ol_cv_lib_db" != no ; then
13057                         ol_cv_berkeley_db=yes
13058                 fi
13059         fi
13060 fi
13061
13062         else
13063                 ol_cv_berkeley_db=no
13064 for ac_hdr in db.h
13065 do
13066 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13067 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13068 echo "configure:13069: checking for $ac_hdr" >&5
13069 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
13070   echo $ac_n "(cached) $ac_c" 1>&6
13071 else
13072   cat > conftest.$ac_ext <<EOF
13073 #line 13074 "configure"
13074 #include "confdefs.h"
13075 #include <$ac_hdr>
13076 EOF
13077 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13078 { (eval echo configure:13079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13079 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13080 if test -z "$ac_err"; then
13081   rm -rf conftest*
13082   eval "ac_cv_header_$ac_safe=yes"
13083 else
13084   echo "$ac_err" >&5
13085   echo "configure: failed program was:" >&5
13086   cat conftest.$ac_ext >&5
13087   rm -rf conftest*
13088   eval "ac_cv_header_$ac_safe=no"
13089 fi
13090 rm -f conftest*
13091 fi
13092 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13093   echo "$ac_t""yes" 1>&6
13094     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13095   cat >> confdefs.h <<EOF
13096 #define $ac_tr_hdr 1
13097 EOF
13098  
13099 else
13100   echo "$ac_t""no" 1>&6
13101 fi
13102 done
13103
13104 if test $ac_cv_header_db_h = yes; then
13105         ol_cv_lib_db=no
13106 if test $ol_cv_lib_db = no ; then
13107         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13108 echo "configure:13109: checking for Berkeley DB link (default)" >&5
13109 if eval "test \"`echo '$''{'ol_cv_db_none'+set}'`\" = set"; then
13110   echo $ac_n "(cached) $ac_c" 1>&6
13111 else
13112   
13113         ol_DB_LIB=
13114         ol_LIBS=$LIBS
13115         LIBS="$ol_DB_LIB $LIBS"
13116
13117         cat > conftest.$ac_ext <<EOF
13118 #line 13119 "configure"
13119 #include "confdefs.h"
13120
13121 #ifdef HAVE_DB_185_H
13122 # include <db_185.h>
13123 #else
13124 # include <db.h>
13125 #endif
13126
13127 #ifndef DB_VERSION_MAJOR
13128 # define DB_VERSION_MAJOR 1
13129 #endif
13130
13131 #ifndef NULL
13132 #define NULL ((void*)0)
13133 #endif
13134
13135 int main() {
13136
13137 #if DB_VERSION_MAJOR > 1
13138         {
13139                 char *version;
13140                 int major, minor, patch;
13141
13142                 version = db_version( &major, &minor, &patch );
13143
13144                 if( major != DB_VERSION_MAJOR ||
13145                         minor < DB_VERSION_MINOR )
13146                 {
13147                         printf("Berkeley DB version mismatch\n"
13148                                 "\texpected: %s\n\tgot: %s\n",
13149                                 DB_VERSION_STRING, version);
13150                         return 1;
13151                 }
13152         }
13153 #endif
13154
13155 #if DB_VERSION_MAJOR > 2
13156         db_env_create( NULL, 0 );
13157 #elif DB_VERSION_MAJOR > 1
13158         db_appexit( NULL );
13159 #else
13160         (void) dbopen( NULL, 0, 0, 0, NULL);
13161 #endif
13162
13163 ; return 0; }
13164 EOF
13165 if { (eval echo configure:13166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13166   rm -rf conftest*
13167   ol_cv_db_none=yes
13168 else
13169   echo "configure: failed program was:" >&5
13170   cat conftest.$ac_ext >&5
13171   rm -rf conftest*
13172   ol_cv_db_none=no
13173 fi
13174 rm -f conftest*
13175
13176         LIBS="$ol_LIBS"
13177
13178 fi
13179
13180 echo "$ac_t""$ol_cv_db_none" 1>&6
13181
13182         if test $ol_cv_db_none = yes ; then
13183                 ol_cv_lib_db=yes
13184         fi
13185 fi
13186
13187 if test $ol_cv_lib_db = no ; then
13188         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13189 echo "configure:13190: checking for Berkeley DB link (-ldb)" >&5
13190 if eval "test \"`echo '$''{'ol_cv_db_db'+set}'`\" = set"; then
13191   echo $ac_n "(cached) $ac_c" 1>&6
13192 else
13193   
13194         ol_DB_LIB=-ldb
13195         ol_LIBS=$LIBS
13196         LIBS="$ol_DB_LIB $LIBS"
13197
13198         cat > conftest.$ac_ext <<EOF
13199 #line 13200 "configure"
13200 #include "confdefs.h"
13201
13202 #ifdef HAVE_DB_185_H
13203 # include <db_185.h>
13204 #else
13205 # include <db.h>
13206 #endif
13207
13208 #ifndef DB_VERSION_MAJOR
13209 # define DB_VERSION_MAJOR 1
13210 #endif
13211
13212 #ifndef NULL
13213 #define NULL ((void*)0)
13214 #endif
13215
13216 int main() {
13217
13218 #if DB_VERSION_MAJOR > 1
13219         {
13220                 char *version;
13221                 int major, minor, patch;
13222
13223                 version = db_version( &major, &minor, &patch );
13224
13225                 if( major != DB_VERSION_MAJOR ||
13226                         minor < DB_VERSION_MINOR )
13227                 {
13228                         printf("Berkeley DB version mismatch\n"
13229                                 "\texpected: %s\n\tgot: %s\n",
13230                                 DB_VERSION_STRING, version);
13231                         return 1;
13232                 }
13233         }
13234 #endif
13235
13236 #if DB_VERSION_MAJOR > 2
13237         db_env_create( NULL, 0 );
13238 #elif DB_VERSION_MAJOR > 1
13239         db_appexit( NULL );
13240 #else
13241         (void) dbopen( NULL, 0, 0, 0, NULL);
13242 #endif
13243
13244 ; return 0; }
13245 EOF
13246 if { (eval echo configure:13247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13247   rm -rf conftest*
13248   ol_cv_db_db=yes
13249 else
13250   echo "configure: failed program was:" >&5
13251   cat conftest.$ac_ext >&5
13252   rm -rf conftest*
13253   ol_cv_db_db=no
13254 fi
13255 rm -f conftest*
13256
13257         LIBS="$ol_LIBS"
13258
13259 fi
13260
13261 echo "$ac_t""$ol_cv_db_db" 1>&6
13262
13263         if test $ol_cv_db_db = yes ; then
13264                 ol_cv_lib_db=-ldb
13265         fi
13266 fi
13267
13268 if test $ol_cv_lib_db = no ; then
13269         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13270 echo "configure:13271: checking for Berkeley DB link (-ldb3)" >&5
13271 if eval "test \"`echo '$''{'ol_cv_db_db3'+set}'`\" = set"; then
13272   echo $ac_n "(cached) $ac_c" 1>&6
13273 else
13274   
13275         ol_DB_LIB=-ldb3
13276         ol_LIBS=$LIBS
13277         LIBS="$ol_DB_LIB $LIBS"
13278
13279         cat > conftest.$ac_ext <<EOF
13280 #line 13281 "configure"
13281 #include "confdefs.h"
13282
13283 #ifdef HAVE_DB_185_H
13284 # include <db_185.h>
13285 #else
13286 # include <db.h>
13287 #endif
13288
13289 #ifndef DB_VERSION_MAJOR
13290 # define DB_VERSION_MAJOR 1
13291 #endif
13292
13293 #ifndef NULL
13294 #define NULL ((void*)0)
13295 #endif
13296
13297 int main() {
13298
13299 #if DB_VERSION_MAJOR > 1
13300         {
13301                 char *version;
13302                 int major, minor, patch;
13303
13304                 version = db_version( &major, &minor, &patch );
13305
13306                 if( major != DB_VERSION_MAJOR ||
13307                         minor < DB_VERSION_MINOR )
13308                 {
13309                         printf("Berkeley DB version mismatch\n"
13310                                 "\texpected: %s\n\tgot: %s\n",
13311                                 DB_VERSION_STRING, version);
13312                         return 1;
13313                 }
13314         }
13315 #endif
13316
13317 #if DB_VERSION_MAJOR > 2
13318         db_env_create( NULL, 0 );
13319 #elif DB_VERSION_MAJOR > 1
13320         db_appexit( NULL );
13321 #else
13322         (void) dbopen( NULL, 0, 0, 0, NULL);
13323 #endif
13324
13325 ; return 0; }
13326 EOF
13327 if { (eval echo configure:13328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13328   rm -rf conftest*
13329   ol_cv_db_db3=yes
13330 else
13331   echo "configure: failed program was:" >&5
13332   cat conftest.$ac_ext >&5
13333   rm -rf conftest*
13334   ol_cv_db_db3=no
13335 fi
13336 rm -f conftest*
13337
13338         LIBS="$ol_LIBS"
13339
13340 fi
13341
13342 echo "$ac_t""$ol_cv_db_db3" 1>&6
13343
13344         if test $ol_cv_db_db3 = yes ; then
13345                 ol_cv_lib_db=-ldb3
13346         fi
13347 fi
13348
13349 if test $ol_cv_lib_db = no ; then
13350         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13351 echo "configure:13352: checking for Berkeley DB link (-ldb2)" >&5
13352 if eval "test \"`echo '$''{'ol_cv_db_db2'+set}'`\" = set"; then
13353   echo $ac_n "(cached) $ac_c" 1>&6
13354 else
13355   
13356         ol_DB_LIB=-ldb2
13357         ol_LIBS=$LIBS
13358         LIBS="$ol_DB_LIB $LIBS"
13359
13360         cat > conftest.$ac_ext <<EOF
13361 #line 13362 "configure"
13362 #include "confdefs.h"
13363
13364 #ifdef HAVE_DB_185_H
13365 # include <db_185.h>
13366 #else
13367 # include <db.h>
13368 #endif
13369
13370 #ifndef DB_VERSION_MAJOR
13371 # define DB_VERSION_MAJOR 1
13372 #endif
13373
13374 #ifndef NULL
13375 #define NULL ((void*)0)
13376 #endif
13377
13378 int main() {
13379
13380 #if DB_VERSION_MAJOR > 1
13381         {
13382                 char *version;
13383                 int major, minor, patch;
13384
13385                 version = db_version( &major, &minor, &patch );
13386
13387                 if( major != DB_VERSION_MAJOR ||
13388                         minor < DB_VERSION_MINOR )
13389                 {
13390                         printf("Berkeley DB version mismatch\n"
13391                                 "\texpected: %s\n\tgot: %s\n",
13392                                 DB_VERSION_STRING, version);
13393                         return 1;
13394                 }
13395         }
13396 #endif
13397
13398 #if DB_VERSION_MAJOR > 2
13399         db_env_create( NULL, 0 );
13400 #elif DB_VERSION_MAJOR > 1
13401         db_appexit( NULL );
13402 #else
13403         (void) dbopen( NULL, 0, 0, 0, NULL);
13404 #endif
13405
13406 ; return 0; }
13407 EOF
13408 if { (eval echo configure:13409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13409   rm -rf conftest*
13410   ol_cv_db_db2=yes
13411 else
13412   echo "configure: failed program was:" >&5
13413   cat conftest.$ac_ext >&5
13414   rm -rf conftest*
13415   ol_cv_db_db2=no
13416 fi
13417 rm -f conftest*
13418
13419         LIBS="$ol_LIBS"
13420
13421 fi
13422
13423 echo "$ac_t""$ol_cv_db_db2" 1>&6
13424
13425         if test $ol_cv_db_db2 = yes ; then
13426                 ol_cv_lib_db=-ldb2
13427         fi
13428 fi
13429
13430 if test $ol_cv_lib_db = no ; then
13431         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13432 echo "configure:13433: checking for Berkeley DB link (-ldb1)" >&5
13433 if eval "test \"`echo '$''{'ol_cv_db_db1'+set}'`\" = set"; then
13434   echo $ac_n "(cached) $ac_c" 1>&6
13435 else
13436   
13437         ol_DB_LIB=-ldb1
13438         ol_LIBS=$LIBS
13439         LIBS="$ol_DB_LIB $LIBS"
13440
13441         cat > conftest.$ac_ext <<EOF
13442 #line 13443 "configure"
13443 #include "confdefs.h"
13444
13445 #ifdef HAVE_DB_185_H
13446 # include <db_185.h>
13447 #else
13448 # include <db.h>
13449 #endif
13450
13451 #ifndef DB_VERSION_MAJOR
13452 # define DB_VERSION_MAJOR 1
13453 #endif
13454
13455 #ifndef NULL
13456 #define NULL ((void*)0)
13457 #endif
13458
13459 int main() {
13460
13461 #if DB_VERSION_MAJOR > 1
13462         {
13463                 char *version;
13464                 int major, minor, patch;
13465
13466                 version = db_version( &major, &minor, &patch );
13467
13468                 if( major != DB_VERSION_MAJOR ||
13469                         minor < DB_VERSION_MINOR )
13470                 {
13471                         printf("Berkeley DB version mismatch\n"
13472                                 "\texpected: %s\n\tgot: %s\n",
13473                                 DB_VERSION_STRING, version);
13474                         return 1;
13475                 }
13476         }
13477 #endif
13478
13479 #if DB_VERSION_MAJOR > 2
13480         db_env_create( NULL, 0 );
13481 #elif DB_VERSION_MAJOR > 1
13482         db_appexit( NULL );
13483 #else
13484         (void) dbopen( NULL, 0, 0, 0, NULL);
13485 #endif
13486
13487 ; return 0; }
13488 EOF
13489 if { (eval echo configure:13490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13490   rm -rf conftest*
13491   ol_cv_db_db1=yes
13492 else
13493   echo "configure: failed program was:" >&5
13494   cat conftest.$ac_ext >&5
13495   rm -rf conftest*
13496   ol_cv_db_db1=no
13497 fi
13498 rm -f conftest*
13499
13500         LIBS="$ol_LIBS"
13501
13502 fi
13503
13504 echo "$ac_t""$ol_cv_db_db1" 1>&6
13505
13506         if test $ol_cv_db_db1 = yes ; then
13507                 ol_cv_lib_db=-ldb1
13508         fi
13509 fi
13510
13511
13512         if test "$ol_cv_lib_db" != no ; then
13513                 ol_cv_berkeley_db=yes
13514                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13515 echo "configure:13516: checking for Berkeley DB thread support" >&5
13516 if eval "test \"`echo '$''{'ol_cv_berkeley_db_thread'+set}'`\" = set"; then
13517   echo $ac_n "(cached) $ac_c" 1>&6
13518 else
13519   
13520         ol_LIBS="$LIBS"
13521         if test $ol_cv_lib_db != yes ; then
13522                 LIBS="$ol_cv_lib_db"
13523         fi
13524
13525         if test "$cross_compiling" = yes; then
13526   ol_cv_berkeley_db_thread=cross
13527 else
13528   cat > conftest.$ac_ext <<EOF
13529 #line 13530 "configure"
13530 #include "confdefs.h"
13531
13532 #ifdef HAVE_DB_185_H
13533         choke me;
13534 #else
13535 #include <db.h>
13536 #endif
13537 #ifndef NULL
13538 #define NULL ((void *)0)
13539 #endif
13540 main()
13541 {
13542         int rc;
13543         u_int32_t flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL |
13544 #ifdef DB_PRIVATE
13545                 DB_PRIVATE |
13546 #endif
13547 #ifdef DB_MPOOL_PRIVATE
13548                 DB_MPOOL_PRIVATE |
13549 #endif
13550                 DB_THREAD;
13551
13552 #if DB_VERSION_MAJOR > 2
13553         DB_ENV *env = NULL;
13554
13555         rc = db_env_create( &env, 0 );
13556
13557         if( rc ) {
13558                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13559                 return rc;
13560         }
13561
13562 #ifdef DB_CDB_ALLDB
13563         rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
13564
13565         if( rc ) {
13566                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13567                 return rc;
13568         }
13569 #endif
13570
13571 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13572         rc = env->open( env, NULL, flags, 0 );
13573 #else
13574         rc = env->open( env, NULL, NULL, flags, 0 );
13575 #endif
13576
13577         if ( rc == 0 ) {
13578                 rc = env->close( env, 0 );
13579         }
13580
13581         if( rc ) {
13582                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13583                 return rc;
13584         }
13585
13586 #else
13587         DB_ENV env;
13588         memset( &env, '\0', sizeof(env) );
13589
13590         rc = db_appinit( NULL, NULL, &env, flags );
13591
13592         if( rc == 0 ) {
13593                 db_appexit( &env );
13594         }
13595
13596         unlink("__db_mpool.share");
13597         unlink("__db_lock.share");
13598 #endif
13599
13600         return rc;
13601 }
13602 EOF
13603 if { (eval echo configure:13604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13604 then
13605   ol_cv_berkeley_db_thread=yes
13606 else
13607   echo "configure: failed program was:" >&5
13608   cat conftest.$ac_ext >&5
13609   rm -fr conftest*
13610   ol_cv_berkeley_db_thread=no
13611 fi
13612 rm -fr conftest*
13613 fi
13614
13615
13616         LIBS="$ol_LIBS"
13617
13618         if test $ol_cv_berkeley_db_thread != no ; then
13619                 cat >> confdefs.h <<\EOF
13620 #define HAVE_BERKELEY_DB_THREAD 1
13621 EOF
13622
13623         fi
13624
13625 fi
13626
13627 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13628         fi
13629 fi
13630
13631         fi
13632
13633         if test $ol_cv_berkeley_db != no ; then
13634                 cat >> confdefs.h <<\EOF
13635 #define HAVE_BERKELEY_DB 1
13636 EOF
13637
13638
13639                 ol_link_ldbm=berkeley
13640                 ol_with_ldbm_api=db
13641
13642                 if test $ol_with_ldbm_type = hash ; then
13643                         cat >> confdefs.h <<\EOF
13644 #define LDBM_USE_DBHASH 1
13645 EOF
13646
13647                 else
13648                         cat >> confdefs.h <<\EOF
13649 #define LDBM_USE_DBBTREE 1
13650 EOF
13651
13652                 fi
13653
13654                                                 if test $ol_cv_lib_db != yes ; then
13655                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13656                 fi
13657         fi
13658 fi
13659
13660 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13661         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13662         ol_with_ldbm_api=none
13663 fi
13664
13665 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13666         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13667 echo "configure:13668: checking for MDBM library" >&5
13668 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
13669   echo $ac_n "(cached) $ac_c" 1>&6
13670 else
13671         ol_LIBS="$LIBS"
13672         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13673 echo "configure:13674: checking for mdbm_set_chain" >&5
13674 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
13675   echo $ac_n "(cached) $ac_c" 1>&6
13676 else
13677   cat > conftest.$ac_ext <<EOF
13678 #line 13679 "configure"
13679 #include "confdefs.h"
13680 /* System header to define __stub macros and hopefully few prototypes,
13681     which can conflict with char mdbm_set_chain(); below.  */
13682 #include <assert.h>
13683 /* Override any gcc2 internal prototype to avoid an error.  */
13684 /* We use char because int might match the return type of a gcc2
13685     builtin and then its argument prototype would still apply.  */
13686 char mdbm_set_chain();
13687
13688 int main() {
13689
13690 /* The GNU C library defines this for functions which it implements
13691     to always fail with ENOSYS.  Some functions are actually named
13692     something starting with __ and the normal name is an alias.  */
13693 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13694 choke me
13695 #else
13696 mdbm_set_chain();
13697 #endif
13698
13699 ; return 0; }
13700 EOF
13701 if { (eval echo configure:13702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13702   rm -rf conftest*
13703   eval "ac_cv_func_mdbm_set_chain=yes"
13704 else
13705   echo "configure: failed program was:" >&5
13706   cat conftest.$ac_ext >&5
13707   rm -rf conftest*
13708   eval "ac_cv_func_mdbm_set_chain=no"
13709 fi
13710 rm -f conftest*
13711 fi
13712
13713 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13714   echo "$ac_t""yes" 1>&6
13715   ol_cv_lib_mdbm=yes
13716 else
13717   echo "$ac_t""no" 1>&6
13718
13719                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13720 echo "configure:13721: checking for mdbm_set_chain in -lmdbm" >&5
13721 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
13722 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
13723   echo $ac_n "(cached) $ac_c" 1>&6
13724 else
13725   ac_save_LIBS="$LIBS"
13726 LIBS="-lmdbm  $LIBS"
13727 cat > conftest.$ac_ext <<EOF
13728 #line 13729 "configure"
13729 #include "confdefs.h"
13730 /* Override any gcc2 internal prototype to avoid an error.  */
13731 /* We use char because int might match the return type of a gcc2
13732     builtin and then its argument prototype would still apply.  */
13733 char mdbm_set_chain();
13734
13735 int main() {
13736 mdbm_set_chain()
13737 ; return 0; }
13738 EOF
13739 if { (eval echo configure:13740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13740   rm -rf conftest*
13741   eval "ac_cv_lib_$ac_lib_var=yes"
13742 else
13743   echo "configure: failed program was:" >&5
13744   cat conftest.$ac_ext >&5
13745   rm -rf conftest*
13746   eval "ac_cv_lib_$ac_lib_var=no"
13747 fi
13748 rm -f conftest*
13749 LIBS="$ac_save_LIBS"
13750
13751 fi
13752 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13753   echo "$ac_t""yes" 1>&6
13754   ol_cv_lib_mdbm=-lmdbm
13755 else
13756   echo "$ac_t""no" 1>&6
13757 ol_cv_lib_mdbm=no
13758 fi
13759
13760         
13761 fi
13762
13763         LIBS="$ol_LIBS"
13764
13765 fi
13766
13767 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13768
13769
13770  for ac_hdr in mdbm.h
13771 do
13772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13774 echo "configure:13775: checking for $ac_hdr" >&5
13775 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
13776   echo $ac_n "(cached) $ac_c" 1>&6
13777 else
13778   cat > conftest.$ac_ext <<EOF
13779 #line 13780 "configure"
13780 #include "confdefs.h"
13781 #include <$ac_hdr>
13782 EOF
13783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13784 { (eval echo configure:13785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13786 if test -z "$ac_err"; then
13787   rm -rf conftest*
13788   eval "ac_cv_header_$ac_safe=yes"
13789 else
13790   echo "$ac_err" >&5
13791   echo "configure: failed program was:" >&5
13792   cat conftest.$ac_ext >&5
13793   rm -rf conftest*
13794   eval "ac_cv_header_$ac_safe=no"
13795 fi
13796 rm -f conftest*
13797 fi
13798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13799   echo "$ac_t""yes" 1>&6
13800     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13801   cat >> confdefs.h <<EOF
13802 #define $ac_tr_hdr 1
13803 EOF
13804  
13805 else
13806   echo "$ac_t""no" 1>&6
13807 fi
13808 done
13809
13810  echo $ac_n "checking for db""... $ac_c" 1>&6
13811 echo "configure:13812: checking for db" >&5
13812 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
13813   echo $ac_n "(cached) $ac_c" 1>&6
13814 else
13815   
13816         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13817                 ol_cv_mdbm=no
13818         else
13819                 ol_cv_mdbm=yes
13820         fi
13821
13822 fi
13823
13824 echo "$ac_t""$ol_cv_mdbm" 1>&6
13825  if test $ol_cv_mdbm = yes ; then
13826         cat >> confdefs.h <<\EOF
13827 #define HAVE_MDBM 1
13828 EOF
13829
13830  fi
13831
13832
13833         if test $ol_cv_mdbm = yes ; then
13834                 ol_link_ldbm=mdbm
13835                 ol_with_ldbm_api=mdbm
13836                 if test $ol_cv_lib_mdbm != yes ; then
13837                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13838                 fi
13839         fi
13840 fi
13841
13842 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13843         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13844 echo "configure:13845: checking for GDBM library" >&5
13845 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
13846   echo $ac_n "(cached) $ac_c" 1>&6
13847 else
13848         ol_LIBS="$LIBS"
13849         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13850 echo "configure:13851: checking for gdbm_open" >&5
13851 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
13852   echo $ac_n "(cached) $ac_c" 1>&6
13853 else
13854   cat > conftest.$ac_ext <<EOF
13855 #line 13856 "configure"
13856 #include "confdefs.h"
13857 /* System header to define __stub macros and hopefully few prototypes,
13858     which can conflict with char gdbm_open(); below.  */
13859 #include <assert.h>
13860 /* Override any gcc2 internal prototype to avoid an error.  */
13861 /* We use char because int might match the return type of a gcc2
13862     builtin and then its argument prototype would still apply.  */
13863 char gdbm_open();
13864
13865 int main() {
13866
13867 /* The GNU C library defines this for functions which it implements
13868     to always fail with ENOSYS.  Some functions are actually named
13869     something starting with __ and the normal name is an alias.  */
13870 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13871 choke me
13872 #else
13873 gdbm_open();
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   eval "ac_cv_func_gdbm_open=yes"
13881 else
13882   echo "configure: failed program was:" >&5
13883   cat conftest.$ac_ext >&5
13884   rm -rf conftest*
13885   eval "ac_cv_func_gdbm_open=no"
13886 fi
13887 rm -f conftest*
13888 fi
13889
13890 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13891   echo "$ac_t""yes" 1>&6
13892   ol_cv_lib_gdbm=yes
13893 else
13894   echo "$ac_t""no" 1>&6
13895
13896                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13897 echo "configure:13898: checking for gdbm_open in -lgdbm" >&5
13898 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
13899 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
13900   echo $ac_n "(cached) $ac_c" 1>&6
13901 else
13902   ac_save_LIBS="$LIBS"
13903 LIBS="-lgdbm  $LIBS"
13904 cat > conftest.$ac_ext <<EOF
13905 #line 13906 "configure"
13906 #include "confdefs.h"
13907 /* Override any gcc2 internal prototype to avoid an error.  */
13908 /* We use char because int might match the return type of a gcc2
13909     builtin and then its argument prototype would still apply.  */
13910 char gdbm_open();
13911
13912 int main() {
13913 gdbm_open()
13914 ; return 0; }
13915 EOF
13916 if { (eval echo configure:13917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13917   rm -rf conftest*
13918   eval "ac_cv_lib_$ac_lib_var=yes"
13919 else
13920   echo "configure: failed program was:" >&5
13921   cat conftest.$ac_ext >&5
13922   rm -rf conftest*
13923   eval "ac_cv_lib_$ac_lib_var=no"
13924 fi
13925 rm -f conftest*
13926 LIBS="$ac_save_LIBS"
13927
13928 fi
13929 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13930   echo "$ac_t""yes" 1>&6
13931   ol_cv_lib_gdbm=-lgdbm
13932 else
13933   echo "$ac_t""no" 1>&6
13934 ol_cv_lib_gdbm=no
13935 fi
13936
13937         
13938 fi
13939
13940         LIBS="$ol_LIBS"
13941
13942 fi
13943
13944 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13945
13946
13947  for ac_hdr in gdbm.h
13948 do
13949 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13950 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13951 echo "configure:13952: checking for $ac_hdr" >&5
13952 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
13953   echo $ac_n "(cached) $ac_c" 1>&6
13954 else
13955   cat > conftest.$ac_ext <<EOF
13956 #line 13957 "configure"
13957 #include "confdefs.h"
13958 #include <$ac_hdr>
13959 EOF
13960 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13961 { (eval echo configure:13962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13962 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13963 if test -z "$ac_err"; then
13964   rm -rf conftest*
13965   eval "ac_cv_header_$ac_safe=yes"
13966 else
13967   echo "$ac_err" >&5
13968   echo "configure: failed program was:" >&5
13969   cat conftest.$ac_ext >&5
13970   rm -rf conftest*
13971   eval "ac_cv_header_$ac_safe=no"
13972 fi
13973 rm -f conftest*
13974 fi
13975 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13976   echo "$ac_t""yes" 1>&6
13977     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13978   cat >> confdefs.h <<EOF
13979 #define $ac_tr_hdr 1
13980 EOF
13981  
13982 else
13983   echo "$ac_t""no" 1>&6
13984 fi
13985 done
13986
13987  echo $ac_n "checking for db""... $ac_c" 1>&6
13988 echo "configure:13989: checking for db" >&5
13989 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
13990   echo $ac_n "(cached) $ac_c" 1>&6
13991 else
13992   
13993         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13994                 ol_cv_gdbm=no
13995         else
13996                 ol_cv_gdbm=yes
13997         fi
13998
13999 fi
14000
14001 echo "$ac_t""$ol_cv_gdbm" 1>&6
14002  if test $ol_cv_gdbm = yes ; then
14003         cat >> confdefs.h <<\EOF
14004 #define HAVE_GDBM 1
14005 EOF
14006
14007  fi
14008
14009
14010         if test $ol_cv_gdbm = yes ; then
14011                 ol_link_ldbm=gdbm
14012                 ol_with_ldbm_api=gdbm
14013
14014                 if test $ol_cv_lib_gdbm != yes ; then
14015                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14016                 fi
14017         fi
14018 fi
14019
14020 if test $ol_with_ldbm_api = ndbm ; then
14021         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14022 echo "configure:14023: checking for NDBM library" >&5
14023 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
14024   echo $ac_n "(cached) $ac_c" 1>&6
14025 else
14026         ol_LIBS="$LIBS"
14027         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14028 echo "configure:14029: checking for dbm_open" >&5
14029 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
14030   echo $ac_n "(cached) $ac_c" 1>&6
14031 else
14032   cat > conftest.$ac_ext <<EOF
14033 #line 14034 "configure"
14034 #include "confdefs.h"
14035 /* System header to define __stub macros and hopefully few prototypes,
14036     which can conflict with char dbm_open(); below.  */
14037 #include <assert.h>
14038 /* Override any gcc2 internal prototype to avoid an error.  */
14039 /* We use char because int might match the return type of a gcc2
14040     builtin and then its argument prototype would still apply.  */
14041 char dbm_open();
14042
14043 int main() {
14044
14045 /* The GNU C library defines this for functions which it implements
14046     to always fail with ENOSYS.  Some functions are actually named
14047     something starting with __ and the normal name is an alias.  */
14048 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14049 choke me
14050 #else
14051 dbm_open();
14052 #endif
14053
14054 ; return 0; }
14055 EOF
14056 if { (eval echo configure:14057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14057   rm -rf conftest*
14058   eval "ac_cv_func_dbm_open=yes"
14059 else
14060   echo "configure: failed program was:" >&5
14061   cat conftest.$ac_ext >&5
14062   rm -rf conftest*
14063   eval "ac_cv_func_dbm_open=no"
14064 fi
14065 rm -f conftest*
14066 fi
14067
14068 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14069   echo "$ac_t""yes" 1>&6
14070   ol_cv_lib_ndbm=yes
14071 else
14072   echo "$ac_t""no" 1>&6
14073
14074                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14075 echo "configure:14076: checking for dbm_open in -lndbm" >&5
14076 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
14077 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14078   echo $ac_n "(cached) $ac_c" 1>&6
14079 else
14080   ac_save_LIBS="$LIBS"
14081 LIBS="-lndbm  $LIBS"
14082 cat > conftest.$ac_ext <<EOF
14083 #line 14084 "configure"
14084 #include "confdefs.h"
14085 /* Override any gcc2 internal prototype to avoid an error.  */
14086 /* We use char because int might match the return type of a gcc2
14087     builtin and then its argument prototype would still apply.  */
14088 char dbm_open();
14089
14090 int main() {
14091 dbm_open()
14092 ; return 0; }
14093 EOF
14094 if { (eval echo configure:14095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14095   rm -rf conftest*
14096   eval "ac_cv_lib_$ac_lib_var=yes"
14097 else
14098   echo "configure: failed program was:" >&5
14099   cat conftest.$ac_ext >&5
14100   rm -rf conftest*
14101   eval "ac_cv_lib_$ac_lib_var=no"
14102 fi
14103 rm -f conftest*
14104 LIBS="$ac_save_LIBS"
14105
14106 fi
14107 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14108   echo "$ac_t""yes" 1>&6
14109   ol_cv_lib_ndbm=-lndbm
14110 else
14111   echo "$ac_t""no" 1>&6
14112
14113                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14114 echo "configure:14115: checking for dbm_open in -ldbm" >&5
14115 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
14116 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14117   echo $ac_n "(cached) $ac_c" 1>&6
14118 else
14119   ac_save_LIBS="$LIBS"
14120 LIBS="-ldbm  $LIBS"
14121 cat > conftest.$ac_ext <<EOF
14122 #line 14123 "configure"
14123 #include "confdefs.h"
14124 /* Override any gcc2 internal prototype to avoid an error.  */
14125 /* We use char because int might match the return type of a gcc2
14126     builtin and then its argument prototype would still apply.  */
14127 char dbm_open();
14128
14129 int main() {
14130 dbm_open()
14131 ; return 0; }
14132 EOF
14133 if { (eval echo configure:14134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14134   rm -rf conftest*
14135   eval "ac_cv_lib_$ac_lib_var=yes"
14136 else
14137   echo "configure: failed program was:" >&5
14138   cat conftest.$ac_ext >&5
14139   rm -rf conftest*
14140   eval "ac_cv_lib_$ac_lib_var=no"
14141 fi
14142 rm -f conftest*
14143 LIBS="$ac_save_LIBS"
14144
14145 fi
14146 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14147   echo "$ac_t""yes" 1>&6
14148   ol_cv_lib_ndbm=-ldbm
14149 else
14150   echo "$ac_t""no" 1>&6
14151 ol_cv_lib_ndbm=no
14152 fi
14153                 
14154 fi
14155
14156         
14157 fi
14158
14159         LIBS="$ol_LIBS"
14160
14161 fi
14162
14163 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14164
14165
14166  for ac_hdr in ndbm.h
14167 do
14168 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14169 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14170 echo "configure:14171: checking for $ac_hdr" >&5
14171 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14172   echo $ac_n "(cached) $ac_c" 1>&6
14173 else
14174   cat > conftest.$ac_ext <<EOF
14175 #line 14176 "configure"
14176 #include "confdefs.h"
14177 #include <$ac_hdr>
14178 EOF
14179 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14180 { (eval echo configure:14181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14181 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14182 if test -z "$ac_err"; then
14183   rm -rf conftest*
14184   eval "ac_cv_header_$ac_safe=yes"
14185 else
14186   echo "$ac_err" >&5
14187   echo "configure: failed program was:" >&5
14188   cat conftest.$ac_ext >&5
14189   rm -rf conftest*
14190   eval "ac_cv_header_$ac_safe=no"
14191 fi
14192 rm -f conftest*
14193 fi
14194 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14195   echo "$ac_t""yes" 1>&6
14196     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14197   cat >> confdefs.h <<EOF
14198 #define $ac_tr_hdr 1
14199 EOF
14200  
14201 else
14202   echo "$ac_t""no" 1>&6
14203 fi
14204 done
14205
14206  echo $ac_n "checking for db""... $ac_c" 1>&6
14207 echo "configure:14208: checking for db" >&5
14208 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
14209   echo $ac_n "(cached) $ac_c" 1>&6
14210 else
14211   
14212         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14213                 ol_cv_ndbm=no
14214         else
14215                 ol_cv_ndbm=yes
14216         fi
14217
14218 fi
14219
14220 echo "$ac_t""$ol_cv_ndbm" 1>&6
14221  if test $ol_cv_ndbm = yes ; then
14222         cat >> confdefs.h <<\EOF
14223 #define HAVE_NDBM 1
14224 EOF
14225
14226  fi
14227
14228
14229         if test $ol_cv_ndbm = yes ; then
14230                 ol_link_ldbm=ndbm
14231                 ol_with_ldbm_api=ndbm
14232
14233                 if test $ol_cv_lib_ndbm != yes ; then
14234                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14235                 fi
14236         fi
14237 fi
14238
14239 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14240         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14241         if test $ol_enable_ldbm = yes ; then
14242                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14243         fi
14244
14245         echo "configure: warning: disabling LDBM" 1>&2
14246         ol_enable_ldbm=no
14247 fi
14248
14249 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14250         LINK_BINS_DYNAMIC="yes"
14251 else
14252         LINK_BINS_DYNAMIC="no"
14253 fi
14254
14255 if test $ol_enable_wrappers != no ; then
14256         for ac_hdr in tcpd.h
14257 do
14258 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14259 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14260 echo "configure:14261: checking for $ac_hdr" >&5
14261 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14262   echo $ac_n "(cached) $ac_c" 1>&6
14263 else
14264   cat > conftest.$ac_ext <<EOF
14265 #line 14266 "configure"
14266 #include "confdefs.h"
14267 #include <$ac_hdr>
14268 EOF
14269 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14270 { (eval echo configure:14271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14271 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14272 if test -z "$ac_err"; then
14273   rm -rf conftest*
14274   eval "ac_cv_header_$ac_safe=yes"
14275 else
14276   echo "$ac_err" >&5
14277   echo "configure: failed program was:" >&5
14278   cat conftest.$ac_ext >&5
14279   rm -rf conftest*
14280   eval "ac_cv_header_$ac_safe=no"
14281 fi
14282 rm -f conftest*
14283 fi
14284 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14285   echo "$ac_t""yes" 1>&6
14286     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14287   cat >> confdefs.h <<EOF
14288 #define $ac_tr_hdr 1
14289 EOF
14290  
14291 else
14292   echo "$ac_t""no" 1>&6
14293 fi
14294 done
14295
14296
14297         if test $ac_cv_header_tcpd_h != yes ; then
14298                 have_wrappers=no
14299         else
14300                 cat > conftest.$ac_ext <<EOF
14301 #line 14302 "configure"
14302 #include "confdefs.h"
14303
14304 int allow_severity = 0;
14305 int deny_severity  = 0;
14306                 
14307 int main() {
14308 hosts_access()
14309 ; return 0; }
14310 EOF
14311 if { (eval echo configure:14312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14312   rm -rf conftest*
14313   have_wrappers=yes
14314 else
14315   echo "configure: failed program was:" >&5
14316   cat conftest.$ac_ext >&5
14317   rm -rf conftest*
14318   have_wrappers=no
14319 fi
14320 rm -f conftest*
14321         fi
14322
14323         if test $have_wrappers = yes ; then
14324                 cat >> confdefs.h <<\EOF
14325 #define HAVE_TCPD 1
14326 EOF
14327
14328                 WRAP_LIBS="-lwrap"
14329
14330                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14331 echo "configure:14332: checking for main in -lnsl" >&5
14332 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
14333 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14334   echo $ac_n "(cached) $ac_c" 1>&6
14335 else
14336   ac_save_LIBS="$LIBS"
14337 LIBS="-lnsl  $LIBS"
14338 cat > conftest.$ac_ext <<EOF
14339 #line 14340 "configure"
14340 #include "confdefs.h"
14341
14342 int main() {
14343 main()
14344 ; return 0; }
14345 EOF
14346 if { (eval echo configure:14347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14347   rm -rf conftest*
14348   eval "ac_cv_lib_$ac_lib_var=yes"
14349 else
14350   echo "configure: failed program was:" >&5
14351   cat conftest.$ac_ext >&5
14352   rm -rf conftest*
14353   eval "ac_cv_lib_$ac_lib_var=no"
14354 fi
14355 rm -f conftest*
14356 LIBS="$ac_save_LIBS"
14357
14358 fi
14359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14360   echo "$ac_t""yes" 1>&6
14361     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14362     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14363   cat >> confdefs.h <<EOF
14364 #define $ac_tr_lib 1
14365 EOF
14366
14367   LIBS="-lnsl $LIBS"
14368
14369 else
14370   echo "$ac_t""no" 1>&6
14371 fi
14372
14373         else
14374                 echo "configure: warning: could not find -lwrap" 1>&2
14375                 if test $ol_enable_wrappers = yes ; then
14376                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14377                 fi
14378
14379                 echo "configure: warning: disabling wrappers support" 1>&2
14380                 ol_enable_wrappers=no
14381                 WRAP_LIBS=""
14382         fi
14383 fi
14384
14385 if test $ol_enable_syslog != no ; then
14386         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14387 echo "configure:14388: checking for openlog" >&5
14388 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
14389   echo $ac_n "(cached) $ac_c" 1>&6
14390 else
14391   cat > conftest.$ac_ext <<EOF
14392 #line 14393 "configure"
14393 #include "confdefs.h"
14394 /* System header to define __stub macros and hopefully few prototypes,
14395     which can conflict with char openlog(); below.  */
14396 #include <assert.h>
14397 /* Override any gcc2 internal prototype to avoid an error.  */
14398 /* We use char because int might match the return type of a gcc2
14399     builtin and then its argument prototype would still apply.  */
14400 char openlog();
14401
14402 int main() {
14403
14404 /* The GNU C library defines this for functions which it implements
14405     to always fail with ENOSYS.  Some functions are actually named
14406     something starting with __ and the normal name is an alias.  */
14407 #if defined (__stub_openlog) || defined (__stub___openlog)
14408 choke me
14409 #else
14410 openlog();
14411 #endif
14412
14413 ; return 0; }
14414 EOF
14415 if { (eval echo configure:14416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14416   rm -rf conftest*
14417   eval "ac_cv_func_openlog=yes"
14418 else
14419   echo "configure: failed program was:" >&5
14420   cat conftest.$ac_ext >&5
14421   rm -rf conftest*
14422   eval "ac_cv_func_openlog=no"
14423 fi
14424 rm -f conftest*
14425 fi
14426
14427 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14428   echo "$ac_t""yes" 1>&6
14429   :
14430 else
14431   echo "$ac_t""no" 1>&6
14432 fi
14433
14434         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14435                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14436         fi
14437         ol_enable_syslog=$ac_cv_func_openlog
14438 fi
14439
14440
14441 ol_link_sql=no
14442 if test $ol_enable_sql != no ; then
14443         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14444 echo "configure:14445: checking for SQLDriverConnect in -liodbc" >&5
14445 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-%__p_%'`
14446 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14447   echo $ac_n "(cached) $ac_c" 1>&6
14448 else
14449   ac_save_LIBS="$LIBS"
14450 LIBS="-liodbc  $LIBS"
14451 cat > conftest.$ac_ext <<EOF
14452 #line 14453 "configure"
14453 #include "confdefs.h"
14454 /* Override any gcc2 internal prototype to avoid an error.  */
14455 /* We use char because int might match the return type of a gcc2
14456     builtin and then its argument prototype would still apply.  */
14457 char SQLDriverConnect();
14458
14459 int main() {
14460 SQLDriverConnect()
14461 ; return 0; }
14462 EOF
14463 if { (eval echo configure:14464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14464   rm -rf conftest*
14465   eval "ac_cv_lib_$ac_lib_var=yes"
14466 else
14467   echo "configure: failed program was:" >&5
14468   cat conftest.$ac_ext >&5
14469   rm -rf conftest*
14470   eval "ac_cv_lib_$ac_lib_var=no"
14471 fi
14472 rm -f conftest*
14473 LIBS="$ac_save_LIBS"
14474
14475 fi
14476 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14477   echo "$ac_t""yes" 1>&6
14478   have_iodbc=yes
14479 else
14480   echo "$ac_t""no" 1>&6
14481 have_iodbc=no
14482 fi
14483
14484         if test $have_iodbc = yes ; then
14485                 ol_link_sql="-liodbc"
14486         else
14487                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14488 echo "configure:14489: checking for SQLDriverConnect in -lodbc" >&5
14489 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-%__p_%'`
14490 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14491   echo $ac_n "(cached) $ac_c" 1>&6
14492 else
14493   ac_save_LIBS="$LIBS"
14494 LIBS="-lodbc  $LIBS"
14495 cat > conftest.$ac_ext <<EOF
14496 #line 14497 "configure"
14497 #include "confdefs.h"
14498 /* Override any gcc2 internal prototype to avoid an error.  */
14499 /* We use char because int might match the return type of a gcc2
14500     builtin and then its argument prototype would still apply.  */
14501 char SQLDriverConnect();
14502
14503 int main() {
14504 SQLDriverConnect()
14505 ; return 0; }
14506 EOF
14507 if { (eval echo configure:14508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14508   rm -rf conftest*
14509   eval "ac_cv_lib_$ac_lib_var=yes"
14510 else
14511   echo "configure: failed program was:" >&5
14512   cat conftest.$ac_ext >&5
14513   rm -rf conftest*
14514   eval "ac_cv_lib_$ac_lib_var=no"
14515 fi
14516 rm -f conftest*
14517 LIBS="$ac_save_LIBS"
14518
14519 fi
14520 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14521   echo "$ac_t""yes" 1>&6
14522   have_odbc=yes
14523 else
14524   echo "$ac_t""no" 1>&6
14525 have_odbc=no
14526 fi
14527
14528                 if test $have_odbc = yes ; then
14529                         ol_link_sql="-lodbc"
14530                 fi
14531         fi
14532
14533         if test $ol_link_sql != no ; then
14534                 SLAPD_SQL_LIBS="$ol_link_sql"
14535
14536         elif test $ol_enable_sql != auto ; then
14537                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14538         fi
14539 fi
14540
14541 if test $ol_enable_tcl != no ; then
14542         for ac_hdr in tcl.h
14543 do
14544 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14545 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14546 echo "configure:14547: checking for $ac_hdr" >&5
14547 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14548   echo $ac_n "(cached) $ac_c" 1>&6
14549 else
14550   cat > conftest.$ac_ext <<EOF
14551 #line 14552 "configure"
14552 #include "confdefs.h"
14553 #include <$ac_hdr>
14554 EOF
14555 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14556 { (eval echo configure:14557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14557 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14558 if test -z "$ac_err"; then
14559   rm -rf conftest*
14560   eval "ac_cv_header_$ac_safe=yes"
14561 else
14562   echo "$ac_err" >&5
14563   echo "configure: failed program was:" >&5
14564   cat conftest.$ac_ext >&5
14565   rm -rf conftest*
14566   eval "ac_cv_header_$ac_safe=no"
14567 fi
14568 rm -f conftest*
14569 fi
14570 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14571   echo "$ac_t""yes" 1>&6
14572     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14573   cat >> confdefs.h <<EOF
14574 #define $ac_tr_hdr 1
14575 EOF
14576  
14577 else
14578   echo "$ac_t""no" 1>&6
14579 fi
14580 done
14581
14582
14583         if test $ac_cv_header_tcl_h != yes ; then
14584                 have_tcl=no
14585         else
14586                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14587                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14588 echo "configure:14589: checking for main in -l$lib" >&5
14589 ac_lib_var=`echo $lib'_'main | sed 'y%./+-%__p_%'`
14590 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14591   echo $ac_n "(cached) $ac_c" 1>&6
14592 else
14593   ac_save_LIBS="$LIBS"
14594 LIBS="-l$lib  $LIBS"
14595 cat > conftest.$ac_ext <<EOF
14596 #line 14597 "configure"
14597 #include "confdefs.h"
14598
14599 int main() {
14600 main()
14601 ; return 0; }
14602 EOF
14603 if { (eval echo configure:14604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14604   rm -rf conftest*
14605   eval "ac_cv_lib_$ac_lib_var=yes"
14606 else
14607   echo "configure: failed program was:" >&5
14608   cat conftest.$ac_ext >&5
14609   rm -rf conftest*
14610   eval "ac_cv_lib_$ac_lib_var=no"
14611 fi
14612 rm -f conftest*
14613 LIBS="$ac_save_LIBS"
14614
14615 fi
14616 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14617   echo "$ac_t""yes" 1>&6
14618   have_tcl=yes
14619                            if test x"$ol_with_tcl_module" = "xstatic" ; then
14620                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
14621                            else
14622                                MOD_TCL_LIB="-l${lib}"
14623                            fi;break
14624 else
14625   echo "$ac_t""no" 1>&6
14626 have_tcl=no
14627 fi
14628
14629                 done
14630         fi
14631
14632         if test $have_tcl != yes ; then
14633                 echo "configure: warning: could not find -ltcl" 1>&2
14634                 if test $ol_enable_tcl = yes ; then
14635                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
14636                 fi
14637
14638                 ol_enable_tcl=no
14639         fi
14640 fi
14641
14642 ol_link_termcap=no
14643 for ac_hdr in termcap.h ncurses.h
14644 do
14645 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14646 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14647 echo "configure:14648: checking for $ac_hdr" >&5
14648 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14649   echo $ac_n "(cached) $ac_c" 1>&6
14650 else
14651   cat > conftest.$ac_ext <<EOF
14652 #line 14653 "configure"
14653 #include "confdefs.h"
14654 #include <$ac_hdr>
14655 EOF
14656 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14657 { (eval echo configure:14658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14658 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14659 if test -z "$ac_err"; then
14660   rm -rf conftest*
14661   eval "ac_cv_header_$ac_safe=yes"
14662 else
14663   echo "$ac_err" >&5
14664   echo "configure: failed program was:" >&5
14665   cat conftest.$ac_ext >&5
14666   rm -rf conftest*
14667   eval "ac_cv_header_$ac_safe=no"
14668 fi
14669 rm -f conftest*
14670 fi
14671 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14672   echo "$ac_t""yes" 1>&6
14673     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14674   cat >> confdefs.h <<EOF
14675 #define $ac_tr_hdr 1
14676 EOF
14677  
14678 else
14679   echo "$ac_t""no" 1>&6
14680 fi
14681 done
14682
14683
14684 if test $ol_link_termcap = no ; then
14685         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14686 echo "configure:14687: checking for tputs in -ltermcap" >&5
14687 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
14688 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14689   echo $ac_n "(cached) $ac_c" 1>&6
14690 else
14691   ac_save_LIBS="$LIBS"
14692 LIBS="-ltermcap  $LIBS"
14693 cat > conftest.$ac_ext <<EOF
14694 #line 14695 "configure"
14695 #include "confdefs.h"
14696 /* Override any gcc2 internal prototype to avoid an error.  */
14697 /* We use char because int might match the return type of a gcc2
14698     builtin and then its argument prototype would still apply.  */
14699 char tputs();
14700
14701 int main() {
14702 tputs()
14703 ; return 0; }
14704 EOF
14705 if { (eval echo configure:14706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14706   rm -rf conftest*
14707   eval "ac_cv_lib_$ac_lib_var=yes"
14708 else
14709   echo "configure: failed program was:" >&5
14710   cat conftest.$ac_ext >&5
14711   rm -rf conftest*
14712   eval "ac_cv_lib_$ac_lib_var=no"
14713 fi
14714 rm -f conftest*
14715 LIBS="$ac_save_LIBS"
14716
14717 fi
14718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14719   echo "$ac_t""yes" 1>&6
14720   have_termcap=yes
14721 else
14722   echo "$ac_t""no" 1>&6
14723 have_termcap=no
14724 fi
14725
14726         if test $have_termcap = yes ; then
14727                 cat >> confdefs.h <<\EOF
14728 #define HAVE_TERMCAP 1
14729 EOF
14730
14731                 ol_link_termcap=yes
14732                 TERMCAP_LIBS=-ltermcap
14733         fi
14734 fi
14735
14736 if test $ol_link_termcap = no ; then
14737         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14738 echo "configure:14739: checking for initscr in -lncurses" >&5
14739 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
14740 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14741   echo $ac_n "(cached) $ac_c" 1>&6
14742 else
14743   ac_save_LIBS="$LIBS"
14744 LIBS="-lncurses  $LIBS"
14745 cat > conftest.$ac_ext <<EOF
14746 #line 14747 "configure"
14747 #include "confdefs.h"
14748 /* Override any gcc2 internal prototype to avoid an error.  */
14749 /* We use char because int might match the return type of a gcc2
14750     builtin and then its argument prototype would still apply.  */
14751 char initscr();
14752
14753 int main() {
14754 initscr()
14755 ; return 0; }
14756 EOF
14757 if { (eval echo configure:14758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14758   rm -rf conftest*
14759   eval "ac_cv_lib_$ac_lib_var=yes"
14760 else
14761   echo "configure: failed program was:" >&5
14762   cat conftest.$ac_ext >&5
14763   rm -rf conftest*
14764   eval "ac_cv_lib_$ac_lib_var=no"
14765 fi
14766 rm -f conftest*
14767 LIBS="$ac_save_LIBS"
14768
14769 fi
14770 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14771   echo "$ac_t""yes" 1>&6
14772   have_ncurses=yes
14773 else
14774   echo "$ac_t""no" 1>&6
14775 have_ncurses=no
14776 fi
14777
14778         if test $have_ncurses = yes ; then
14779                 cat >> confdefs.h <<\EOF
14780 #define HAVE_NCURSES 1
14781 EOF
14782
14783                 ol_link_termcap=yes
14784                 TERMCAP_LIBS=-lncurses
14785         fi
14786 fi
14787
14788 if test $ol_link_termcap = no ; then
14789         cat >> confdefs.h <<\EOF
14790 #define NO_TERMCAP 1
14791 EOF
14792
14793         TERMCAP_LIBS=
14794 fi
14795
14796 ol_link_sasl=no
14797 ol_link_spasswd=no
14798 if test $ol_with_cyrus_sasl != no ; then
14799         for ac_hdr in sasl.h
14800 do
14801 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14802 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14803 echo "configure:14804: checking for $ac_hdr" >&5
14804 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14805   echo $ac_n "(cached) $ac_c" 1>&6
14806 else
14807   cat > conftest.$ac_ext <<EOF
14808 #line 14809 "configure"
14809 #include "confdefs.h"
14810 #include <$ac_hdr>
14811 EOF
14812 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14813 { (eval echo configure:14814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14814 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14815 if test -z "$ac_err"; then
14816   rm -rf conftest*
14817   eval "ac_cv_header_$ac_safe=yes"
14818 else
14819   echo "$ac_err" >&5
14820   echo "configure: failed program was:" >&5
14821   cat conftest.$ac_ext >&5
14822   rm -rf conftest*
14823   eval "ac_cv_header_$ac_safe=no"
14824 fi
14825 rm -f conftest*
14826 fi
14827 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14828   echo "$ac_t""yes" 1>&6
14829     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14830   cat >> confdefs.h <<EOF
14831 #define $ac_tr_hdr 1
14832 EOF
14833  
14834 else
14835   echo "$ac_t""no" 1>&6
14836 fi
14837 done
14838
14839
14840         if test $ac_cv_header_sasl_h = yes ; then
14841                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14842 echo "configure:14843: checking for sasl_client_init in -lsasl" >&5
14843 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-%__p_%'`
14844 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
14845   echo $ac_n "(cached) $ac_c" 1>&6
14846 else
14847   ac_save_LIBS="$LIBS"
14848 LIBS="-lsasl  $LIBS"
14849 cat > conftest.$ac_ext <<EOF
14850 #line 14851 "configure"
14851 #include "confdefs.h"
14852 /* Override any gcc2 internal prototype to avoid an error.  */
14853 /* We use char because int might match the return type of a gcc2
14854     builtin and then its argument prototype would still apply.  */
14855 char sasl_client_init();
14856
14857 int main() {
14858 sasl_client_init()
14859 ; return 0; }
14860 EOF
14861 if { (eval echo configure:14862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14862   rm -rf conftest*
14863   eval "ac_cv_lib_$ac_lib_var=yes"
14864 else
14865   echo "configure: failed program was:" >&5
14866   cat conftest.$ac_ext >&5
14867   rm -rf conftest*
14868   eval "ac_cv_lib_$ac_lib_var=no"
14869 fi
14870 rm -f conftest*
14871 LIBS="$ac_save_LIBS"
14872
14873 fi
14874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14875   echo "$ac_t""yes" 1>&6
14876   have_cyrus_sasl=yes
14877 else
14878   echo "$ac_t""no" 1>&6
14879 have_cyrus_sasl=no
14880 fi
14881
14882
14883                 if test $have_cyrus_sasl != no ; then
14884                         SASL_LIBS="-lsasl"
14885                         cat >> confdefs.h <<\EOF
14886 #define HAVE_CYRUS_SASL 1
14887 EOF
14888
14889                         ol_link_sasl=yes
14890                 fi
14891         fi
14892
14893         if test $ol_link_sasl = no ; then
14894                 if test $ol_with_cyrus_sasl != auto ; then
14895                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14896                 else
14897                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14898                         echo "configure: warning: SASL authentication not supported!" 1>&2
14899                         if test $ol_link_tls = no ; then
14900                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14901                         fi
14902                 fi
14903
14904         elif test $ol_enable_spasswd != no ; then
14905                 ol_link_spasswd=yes
14906         fi
14907
14908 else
14909         echo "configure: warning: SASL authentication not supported!" 1>&2
14910         if test $ol_link_tls = no ; then
14911                 echo "configure: warning: Strong authentication not supported!" 1>&2
14912         fi
14913 fi
14914
14915 if test $cross_compiling != yes ; then
14916         dev=no
14917         if test -r /dev/urandom ; then
14918                 dev="/dev/urandom";
14919         elif test -r /idev/urandom ; then
14920                 dev="/idev/urandom";
14921         elif test -r /dev/srandom ; then
14922                 dev="/dev/srandom";
14923         elif test -r /dev/random ; then
14924                 dev="/dev/random";
14925         elif test -r /idev/random ; then
14926                 dev="/idev/random";
14927         fi
14928
14929         if test $dev != no ; then
14930                 cat >> confdefs.h <<EOF
14931 #define URANDOM_DEVICE "$dev"
14932 EOF
14933
14934         fi
14935 fi
14936
14937 ol_link_fetch=no
14938 if test $ol_with_fetch != no ; then
14939         ol_LIBS=$LIBS
14940 LIBS="-lfetch -lcom_err $LIBS"
14941 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14942 echo "configure:14943: checking fetch(3) library" >&5
14943 if eval "test \"`echo '$''{'ol_cv_lib_fetch'+set}'`\" = set"; then
14944   echo $ac_n "(cached) $ac_c" 1>&6
14945 else
14946   
14947         cat > conftest.$ac_ext <<EOF
14948 #line 14949 "configure"
14949 #include "confdefs.h"
14950
14951 #include <sys/param.h>
14952 #include <stdio.h>
14953 #include <fetch.h>
14954 int main() {
14955 struct url *u = fetchParseURL("file:///"); 
14956 ; return 0; }
14957 EOF
14958 if { (eval echo configure:14959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14959   rm -rf conftest*
14960   ol_cv_lib_fetch=yes
14961 else
14962   echo "configure: failed program was:" >&5
14963   cat conftest.$ac_ext >&5
14964   rm -rf conftest*
14965   ol_cv_lib_fetch=no
14966 fi
14967 rm -f conftest*
14968 fi
14969
14970 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14971 LIBS=$ol_LIBS
14972 if test $ol_cv_lib_fetch != no ; then
14973         ol_link_fetch="-lfetch -lcom_err"
14974         cat >> confdefs.h <<\EOF
14975 #define HAVE_FETCH 1
14976 EOF
14977
14978 fi
14979
14980
14981         if test $ol_cv_lib_fetch != no ; then
14982                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14983                 ol_link_fetch=freebsd
14984
14985         elif test $ol_with_fetch != auto ; then
14986                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14987         fi 
14988 fi
14989
14990 ol_link_readline=no
14991 if test $ol_with_readline != no ; then
14992         for ac_hdr in readline/readline.h readline/history.h
14993 do
14994 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14995 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14996 echo "configure:14997: checking for $ac_hdr" >&5
14997 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
14998   echo $ac_n "(cached) $ac_c" 1>&6
14999 else
15000   cat > conftest.$ac_ext <<EOF
15001 #line 15002 "configure"
15002 #include "confdefs.h"
15003 #include <$ac_hdr>
15004 EOF
15005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15006 { (eval echo configure:15007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15007 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15008 if test -z "$ac_err"; then
15009   rm -rf conftest*
15010   eval "ac_cv_header_$ac_safe=yes"
15011 else
15012   echo "$ac_err" >&5
15013   echo "configure: failed program was:" >&5
15014   cat conftest.$ac_ext >&5
15015   rm -rf conftest*
15016   eval "ac_cv_header_$ac_safe=no"
15017 fi
15018 rm -f conftest*
15019 fi
15020 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15021   echo "$ac_t""yes" 1>&6
15022     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15023   cat >> confdefs.h <<EOF
15024 #define $ac_tr_hdr 1
15025 EOF
15026  
15027 else
15028   echo "$ac_t""no" 1>&6
15029 fi
15030 done
15031
15032
15033         if test $ac_cv_header_readline_readline_h = yes ; then
15034                 save_LIBS="$LIBS"
15035                 LIBS="$TERMCAP_LIBS $LIBS"
15036                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15037 echo "configure:15038: checking for readline in -lreadline" >&5
15038 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
15039 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
15040   echo $ac_n "(cached) $ac_c" 1>&6
15041 else
15042   ac_save_LIBS="$LIBS"
15043 LIBS="-lreadline  $LIBS"
15044 cat > conftest.$ac_ext <<EOF
15045 #line 15046 "configure"
15046 #include "confdefs.h"
15047 /* Override any gcc2 internal prototype to avoid an error.  */
15048 /* We use char because int might match the return type of a gcc2
15049     builtin and then its argument prototype would still apply.  */
15050 char readline();
15051
15052 int main() {
15053 readline()
15054 ; return 0; }
15055 EOF
15056 if { (eval echo configure:15057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15057   rm -rf conftest*
15058   eval "ac_cv_lib_$ac_lib_var=yes"
15059 else
15060   echo "configure: failed program was:" >&5
15061   cat conftest.$ac_ext >&5
15062   rm -rf conftest*
15063   eval "ac_cv_lib_$ac_lib_var=no"
15064 fi
15065 rm -f conftest*
15066 LIBS="$ac_save_LIBS"
15067
15068 fi
15069 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15070   echo "$ac_t""yes" 1>&6
15071   have_readline=yes
15072 else
15073   echo "$ac_t""no" 1>&6
15074 have_readline=no
15075 fi
15076
15077                 LIBS="$save_LIBS"
15078                         
15079                 if test $have_readline = yes ; then
15080                         ol_with_readline=found
15081                         ol_link_readline=yes
15082
15083                         READLINE_LIBS="-lreadline"
15084                 fi
15085         fi
15086 fi
15087
15088 if test $ol_link_readline = yes ; then
15089         cat >> confdefs.h <<\EOF
15090 #define HAVE_READLINE 1
15091 EOF
15092
15093 fi
15094
15095
15096 if test $ol_enable_crypt != no ; then
15097         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15098 echo "configure:15099: checking for crypt" >&5
15099 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
15100   echo $ac_n "(cached) $ac_c" 1>&6
15101 else
15102   cat > conftest.$ac_ext <<EOF
15103 #line 15104 "configure"
15104 #include "confdefs.h"
15105 /* System header to define __stub macros and hopefully few prototypes,
15106     which can conflict with char crypt(); below.  */
15107 #include <assert.h>
15108 /* Override any gcc2 internal prototype to avoid an error.  */
15109 /* We use char because int might match the return type of a gcc2
15110     builtin and then its argument prototype would still apply.  */
15111 char crypt();
15112
15113 int main() {
15114
15115 /* The GNU C library defines this for functions which it implements
15116     to always fail with ENOSYS.  Some functions are actually named
15117     something starting with __ and the normal name is an alias.  */
15118 #if defined (__stub_crypt) || defined (__stub___crypt)
15119 choke me
15120 #else
15121 crypt();
15122 #endif
15123
15124 ; return 0; }
15125 EOF
15126 if { (eval echo configure:15127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15127   rm -rf conftest*
15128   eval "ac_cv_func_crypt=yes"
15129 else
15130   echo "configure: failed program was:" >&5
15131   cat conftest.$ac_ext >&5
15132   rm -rf conftest*
15133   eval "ac_cv_func_crypt=no"
15134 fi
15135 rm -f conftest*
15136 fi
15137
15138 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15139   echo "$ac_t""yes" 1>&6
15140   have_crypt=yes
15141 else
15142   echo "$ac_t""no" 1>&6
15143
15144                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15145 echo "configure:15146: checking for crypt in -lcrypt" >&5
15146 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
15147 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
15148   echo $ac_n "(cached) $ac_c" 1>&6
15149 else
15150   ac_save_LIBS="$LIBS"
15151 LIBS="-lcrypt  $LIBS"
15152 cat > conftest.$ac_ext <<EOF
15153 #line 15154 "configure"
15154 #include "confdefs.h"
15155 /* Override any gcc2 internal prototype to avoid an error.  */
15156 /* We use char because int might match the return type of a gcc2
15157     builtin and then its argument prototype would still apply.  */
15158 char crypt();
15159
15160 int main() {
15161 crypt()
15162 ; return 0; }
15163 EOF
15164 if { (eval echo configure:15165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15165   rm -rf conftest*
15166   eval "ac_cv_lib_$ac_lib_var=yes"
15167 else
15168   echo "configure: failed program was:" >&5
15169   cat conftest.$ac_ext >&5
15170   rm -rf conftest*
15171   eval "ac_cv_lib_$ac_lib_var=no"
15172 fi
15173 rm -f conftest*
15174 LIBS="$ac_save_LIBS"
15175
15176 fi
15177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15178   echo "$ac_t""yes" 1>&6
15179   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15180                         have_crypt=yes
15181 else
15182   echo "$ac_t""no" 1>&6
15183 have_crypt=no
15184 fi
15185
15186 fi
15187
15188
15189         if test $have_crypt = yes ; then
15190                 cat >> confdefs.h <<\EOF
15191 #define HAVE_CRYPT 1
15192 EOF
15193
15194         else
15195                 echo "configure: warning: could not find crypt" 1>&2
15196                 if test $ol_enable_crypt = yes ; then
15197                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15198                 fi
15199
15200                 echo "configure: warning: disabling crypt support" 1>&2
15201                 ol_enable_crypt=no
15202         fi
15203 fi
15204
15205 if test $ol_enable_proctitle != no ; then
15206         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15207 echo "configure:15208: checking for setproctitle" >&5
15208 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
15209   echo $ac_n "(cached) $ac_c" 1>&6
15210 else
15211   cat > conftest.$ac_ext <<EOF
15212 #line 15213 "configure"
15213 #include "confdefs.h"
15214 /* System header to define __stub macros and hopefully few prototypes,
15215     which can conflict with char setproctitle(); below.  */
15216 #include <assert.h>
15217 /* Override any gcc2 internal prototype to avoid an error.  */
15218 /* We use char because int might match the return type of a gcc2
15219     builtin and then its argument prototype would still apply.  */
15220 char setproctitle();
15221
15222 int main() {
15223
15224 /* The GNU C library defines this for functions which it implements
15225     to always fail with ENOSYS.  Some functions are actually named
15226     something starting with __ and the normal name is an alias.  */
15227 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15228 choke me
15229 #else
15230 setproctitle();
15231 #endif
15232
15233 ; return 0; }
15234 EOF
15235 if { (eval echo configure:15236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15236   rm -rf conftest*
15237   eval "ac_cv_func_setproctitle=yes"
15238 else
15239   echo "configure: failed program was:" >&5
15240   cat conftest.$ac_ext >&5
15241   rm -rf conftest*
15242   eval "ac_cv_func_setproctitle=no"
15243 fi
15244 rm -f conftest*
15245 fi
15246
15247 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15248   echo "$ac_t""yes" 1>&6
15249   have_setproctitle=yes
15250 else
15251   echo "$ac_t""no" 1>&6
15252
15253                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15254 echo "configure:15255: checking for setproctitle in -lutil" >&5
15255 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
15256 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
15257   echo $ac_n "(cached) $ac_c" 1>&6
15258 else
15259   ac_save_LIBS="$LIBS"
15260 LIBS="-lutil  $LIBS"
15261 cat > conftest.$ac_ext <<EOF
15262 #line 15263 "configure"
15263 #include "confdefs.h"
15264 /* Override any gcc2 internal prototype to avoid an error.  */
15265 /* We use char because int might match the return type of a gcc2
15266     builtin and then its argument prototype would still apply.  */
15267 char setproctitle();
15268
15269 int main() {
15270 setproctitle()
15271 ; return 0; }
15272 EOF
15273 if { (eval echo configure:15274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15274   rm -rf conftest*
15275   eval "ac_cv_lib_$ac_lib_var=yes"
15276 else
15277   echo "configure: failed program was:" >&5
15278   cat conftest.$ac_ext >&5
15279   rm -rf conftest*
15280   eval "ac_cv_lib_$ac_lib_var=no"
15281 fi
15282 rm -f conftest*
15283 LIBS="$ac_save_LIBS"
15284
15285 fi
15286 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15287   echo "$ac_t""yes" 1>&6
15288   have_setproctitle=yes
15289                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15290 else
15291   echo "$ac_t""no" 1>&6
15292 have_setproctitle=no
15293                         LIBOBJS="$LIBOBJS setproctitle.o"
15294                         LIBSRCS="$LIBSRCS setproctitle.c"
15295 fi
15296
15297 fi
15298
15299
15300         if test $have_setproctitle = yes ; then
15301                 cat >> confdefs.h <<\EOF
15302 #define HAVE_SETPROCTITLE 1
15303 EOF
15304
15305         fi
15306 fi
15307
15308 if test $ol_enable_slp != no ; then
15309         for ac_hdr in slp.h 
15310 do
15311 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15312 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15313 echo "configure:15314: checking for $ac_hdr" >&5
15314 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
15315   echo $ac_n "(cached) $ac_c" 1>&6
15316 else
15317   cat > conftest.$ac_ext <<EOF
15318 #line 15319 "configure"
15319 #include "confdefs.h"
15320 #include <$ac_hdr>
15321 EOF
15322 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15323 { (eval echo configure:15324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15324 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15325 if test -z "$ac_err"; then
15326   rm -rf conftest*
15327   eval "ac_cv_header_$ac_safe=yes"
15328 else
15329   echo "$ac_err" >&5
15330   echo "configure: failed program was:" >&5
15331   cat conftest.$ac_ext >&5
15332   rm -rf conftest*
15333   eval "ac_cv_header_$ac_safe=no"
15334 fi
15335 rm -f conftest*
15336 fi
15337 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15338   echo "$ac_t""yes" 1>&6
15339     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15340   cat >> confdefs.h <<EOF
15341 #define $ac_tr_hdr 1
15342 EOF
15343  
15344 else
15345   echo "$ac_t""no" 1>&6
15346 fi
15347 done
15348
15349
15350         if test $ac_cv_header_slp_h = yes ; then
15351                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15352 echo "configure:15353: checking for SLPOpen in -lslp" >&5
15353 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-%__p_%'`
15354 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
15355   echo $ac_n "(cached) $ac_c" 1>&6
15356 else
15357   ac_save_LIBS="$LIBS"
15358 LIBS="-lslp  $LIBS"
15359 cat > conftest.$ac_ext <<EOF
15360 #line 15361 "configure"
15361 #include "confdefs.h"
15362 /* Override any gcc2 internal prototype to avoid an error.  */
15363 /* We use char because int might match the return type of a gcc2
15364     builtin and then its argument prototype would still apply.  */
15365 char SLPOpen();
15366
15367 int main() {
15368 SLPOpen()
15369 ; return 0; }
15370 EOF
15371 if { (eval echo configure:15372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15372   rm -rf conftest*
15373   eval "ac_cv_lib_$ac_lib_var=yes"
15374 else
15375   echo "configure: failed program was:" >&5
15376   cat conftest.$ac_ext >&5
15377   rm -rf conftest*
15378   eval "ac_cv_lib_$ac_lib_var=no"
15379 fi
15380 rm -f conftest*
15381 LIBS="$ac_save_LIBS"
15382
15383 fi
15384 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15385   echo "$ac_t""yes" 1>&6
15386   have_slp=yes
15387 else
15388   echo "$ac_t""no" 1>&6
15389 have_slp=no
15390 fi
15391
15392                 if test $have_slp = yes ; then
15393                         cat >> confdefs.h <<\EOF
15394 #define HAVE_SLP 1
15395 EOF
15396
15397                         SLAPD_SLP_LIBS=-lslp
15398                 fi
15399
15400         elif test $ol_enable_slp = yes ; then
15401                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15402         fi
15403 fi
15404
15405 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15406 echo "configure:15407: checking for ANSI C header files" >&5
15407 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
15408   echo $ac_n "(cached) $ac_c" 1>&6
15409 else
15410   cat > conftest.$ac_ext <<EOF
15411 #line 15412 "configure"
15412 #include "confdefs.h"
15413 #include <stdlib.h>
15414 #include <stdarg.h>
15415 #include <string.h>
15416 #include <float.h>
15417 EOF
15418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15419 { (eval echo configure:15420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15420 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15421 if test -z "$ac_err"; then
15422   rm -rf conftest*
15423   ac_cv_header_stdc=yes
15424 else
15425   echo "$ac_err" >&5
15426   echo "configure: failed program was:" >&5
15427   cat conftest.$ac_ext >&5
15428   rm -rf conftest*
15429   ac_cv_header_stdc=no
15430 fi
15431 rm -f conftest*
15432
15433 if test $ac_cv_header_stdc = yes; then
15434   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15435 cat > conftest.$ac_ext <<EOF
15436 #line 15437 "configure"
15437 #include "confdefs.h"
15438 #include <string.h>
15439 EOF
15440 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15441   egrep "memchr" >/dev/null 2>&1; then
15442   :
15443 else
15444   rm -rf conftest*
15445   ac_cv_header_stdc=no
15446 fi
15447 rm -f conftest*
15448
15449 fi
15450
15451 if test $ac_cv_header_stdc = yes; then
15452   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15453 cat > conftest.$ac_ext <<EOF
15454 #line 15455 "configure"
15455 #include "confdefs.h"
15456 #include <stdlib.h>
15457 EOF
15458 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15459   egrep "free" >/dev/null 2>&1; then
15460   :
15461 else
15462   rm -rf conftest*
15463   ac_cv_header_stdc=no
15464 fi
15465 rm -f conftest*
15466
15467 fi
15468
15469 if test $ac_cv_header_stdc = yes; then
15470   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15471 if test "$cross_compiling" = yes; then
15472   :
15473 else
15474   cat > conftest.$ac_ext <<EOF
15475 #line 15476 "configure"
15476 #include "confdefs.h"
15477 #include <ctype.h>
15478 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15479 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15480 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15481 int main () { int i; for (i = 0; i < 256; i++)
15482 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15483 exit (0); }
15484
15485 EOF
15486 if { (eval echo configure:15487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15487 then
15488   :
15489 else
15490   echo "configure: failed program was:" >&5
15491   cat conftest.$ac_ext >&5
15492   rm -fr conftest*
15493   ac_cv_header_stdc=no
15494 fi
15495 rm -fr conftest*
15496 fi
15497
15498 fi
15499 fi
15500
15501 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15502 if test $ac_cv_header_stdc = yes; then
15503   cat >> confdefs.h <<\EOF
15504 #define STDC_HEADERS 1
15505 EOF
15506
15507 fi
15508
15509 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15510 echo "configure:15511: checking for mode_t" >&5
15511 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
15512   echo $ac_n "(cached) $ac_c" 1>&6
15513 else
15514   cat > conftest.$ac_ext <<EOF
15515 #line 15516 "configure"
15516 #include "confdefs.h"
15517 #include <sys/types.h>
15518 #if STDC_HEADERS
15519 #include <stdlib.h>
15520 #include <stddef.h>
15521 #endif
15522 EOF
15523 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15524   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15525   rm -rf conftest*
15526   ac_cv_type_mode_t=yes
15527 else
15528   rm -rf conftest*
15529   ac_cv_type_mode_t=no
15530 fi
15531 rm -f conftest*
15532
15533 fi
15534 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
15535 if test $ac_cv_type_mode_t = no; then
15536   cat >> confdefs.h <<\EOF
15537 #define mode_t int
15538 EOF
15539
15540 fi
15541
15542 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15543 echo "configure:15544: checking for off_t" >&5
15544 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
15545   echo $ac_n "(cached) $ac_c" 1>&6
15546 else
15547   cat > conftest.$ac_ext <<EOF
15548 #line 15549 "configure"
15549 #include "confdefs.h"
15550 #include <sys/types.h>
15551 #if STDC_HEADERS
15552 #include <stdlib.h>
15553 #include <stddef.h>
15554 #endif
15555 EOF
15556 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15557   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15558   rm -rf conftest*
15559   ac_cv_type_off_t=yes
15560 else
15561   rm -rf conftest*
15562   ac_cv_type_off_t=no
15563 fi
15564 rm -f conftest*
15565
15566 fi
15567 echo "$ac_t""$ac_cv_type_off_t" 1>&6
15568 if test $ac_cv_type_off_t = no; then
15569   cat >> confdefs.h <<\EOF
15570 #define off_t long
15571 EOF
15572
15573 fi
15574
15575 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15576 echo "configure:15577: checking for pid_t" >&5
15577 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
15578   echo $ac_n "(cached) $ac_c" 1>&6
15579 else
15580   cat > conftest.$ac_ext <<EOF
15581 #line 15582 "configure"
15582 #include "confdefs.h"
15583 #include <sys/types.h>
15584 #if STDC_HEADERS
15585 #include <stdlib.h>
15586 #include <stddef.h>
15587 #endif
15588 EOF
15589 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15590   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15591   rm -rf conftest*
15592   ac_cv_type_pid_t=yes
15593 else
15594   rm -rf conftest*
15595   ac_cv_type_pid_t=no
15596 fi
15597 rm -f conftest*
15598
15599 fi
15600 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
15601 if test $ac_cv_type_pid_t = no; then
15602   cat >> confdefs.h <<\EOF
15603 #define pid_t int
15604 EOF
15605
15606 fi
15607
15608 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15609 echo "configure:15610: checking for ptrdiff_t" >&5
15610 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
15611   echo $ac_n "(cached) $ac_c" 1>&6
15612 else
15613   cat > conftest.$ac_ext <<EOF
15614 #line 15615 "configure"
15615 #include "confdefs.h"
15616 #include <stddef.h>
15617 int main() {
15618 ptrdiff_t p
15619 ; return 0; }
15620 EOF
15621 if { (eval echo configure:15622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15622   rm -rf conftest*
15623   am_cv_type_ptrdiff_t=yes
15624 else
15625   echo "configure: failed program was:" >&5
15626   cat conftest.$ac_ext >&5
15627   rm -rf conftest*
15628   am_cv_type_ptrdiff_t=no
15629 fi
15630 rm -f conftest*
15631 fi
15632
15633 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15634    if test $am_cv_type_ptrdiff_t = yes; then
15635      cat >> confdefs.h <<\EOF
15636 #define HAVE_PTRDIFF_T 1
15637 EOF
15638
15639    fi
15640
15641 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15642 echo "configure:15643: checking return type of signal handlers" >&5
15643 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
15644   echo $ac_n "(cached) $ac_c" 1>&6
15645 else
15646   cat > conftest.$ac_ext <<EOF
15647 #line 15648 "configure"
15648 #include "confdefs.h"
15649 #include <sys/types.h>
15650 #include <signal.h>
15651 #ifdef signal
15652 #undef signal
15653 #endif
15654 #ifdef __cplusplus
15655 extern "C" void (*signal (int, void (*)(int)))(int);
15656 #else
15657 void (*signal ()) ();
15658 #endif
15659
15660 int main() {
15661 int i;
15662 ; return 0; }
15663 EOF
15664 if { (eval echo configure:15665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15665   rm -rf conftest*
15666   ac_cv_type_signal=void
15667 else
15668   echo "configure: failed program was:" >&5
15669   cat conftest.$ac_ext >&5
15670   rm -rf conftest*
15671   ac_cv_type_signal=int
15672 fi
15673 rm -f conftest*
15674 fi
15675
15676 echo "$ac_t""$ac_cv_type_signal" 1>&6
15677 cat >> confdefs.h <<EOF
15678 #define RETSIGTYPE $ac_cv_type_signal
15679 EOF
15680
15681
15682 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15683 echo "configure:15684: checking for size_t" >&5
15684 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
15685   echo $ac_n "(cached) $ac_c" 1>&6
15686 else
15687   cat > conftest.$ac_ext <<EOF
15688 #line 15689 "configure"
15689 #include "confdefs.h"
15690 #include <sys/types.h>
15691 #if STDC_HEADERS
15692 #include <stdlib.h>
15693 #include <stddef.h>
15694 #endif
15695 EOF
15696 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15697   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15698   rm -rf conftest*
15699   ac_cv_type_size_t=yes
15700 else
15701   rm -rf conftest*
15702   ac_cv_type_size_t=no
15703 fi
15704 rm -f conftest*
15705
15706 fi
15707 echo "$ac_t""$ac_cv_type_size_t" 1>&6
15708 if test $ac_cv_type_size_t = no; then
15709   cat >> confdefs.h <<\EOF
15710 #define size_t unsigned
15711 EOF
15712
15713 fi
15714
15715
15716 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15717 echo "configure:15718: checking for ssize_t" >&5
15718 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
15719   echo $ac_n "(cached) $ac_c" 1>&6
15720 else
15721   cat > conftest.$ac_ext <<EOF
15722 #line 15723 "configure"
15723 #include "confdefs.h"
15724 #include <sys/types.h>
15725 #if STDC_HEADERS
15726 #include <stdlib.h>
15727 #include <stddef.h>
15728 #endif
15729 EOF
15730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15731   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15732   rm -rf conftest*
15733   ac_cv_type_ssize_t=yes
15734 else
15735   rm -rf conftest*
15736   ac_cv_type_ssize_t=no
15737 fi
15738 rm -f conftest*
15739
15740 fi
15741 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
15742 if test $ac_cv_type_ssize_t = no; then
15743   cat >> confdefs.h <<\EOF
15744 #define ssize_t signed int
15745 EOF
15746
15747 fi
15748
15749 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15750 echo "configure:15751: checking for caddr_t" >&5
15751 if eval "test \"`echo '$''{'ac_cv_type_caddr_t'+set}'`\" = set"; then
15752   echo $ac_n "(cached) $ac_c" 1>&6
15753 else
15754   cat > conftest.$ac_ext <<EOF
15755 #line 15756 "configure"
15756 #include "confdefs.h"
15757 #include <sys/types.h>
15758 #if STDC_HEADERS
15759 #include <stdlib.h>
15760 #include <stddef.h>
15761 #endif
15762 EOF
15763 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15764   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15765   rm -rf conftest*
15766   ac_cv_type_caddr_t=yes
15767 else
15768   rm -rf conftest*
15769   ac_cv_type_caddr_t=no
15770 fi
15771 rm -f conftest*
15772
15773 fi
15774 echo "$ac_t""$ac_cv_type_caddr_t" 1>&6
15775 if test $ac_cv_type_caddr_t = no; then
15776   cat >> confdefs.h <<\EOF
15777 #define caddr_t char *
15778 EOF
15779
15780 fi
15781
15782
15783 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15784 echo "configure:15785: checking for socklen_t" >&5
15785 if eval "test \"`echo '$''{'ol_cv_type_socklen_t'+set}'`\" = set"; then
15786   echo $ac_n "(cached) $ac_c" 1>&6
15787 else
15788   cat > conftest.$ac_ext <<EOF
15789 #line 15790 "configure"
15790 #include "confdefs.h"
15791
15792 #ifdef HAVE_SYS_TYPES_H
15793 #include <sys/types.h>
15794 #endif
15795 #ifdef HAVE_SYS_SOCKET_H
15796 #include <sys/socket.h>
15797 #endif
15798
15799 int main() {
15800 socklen_t len;
15801 ; return 0; }
15802 EOF
15803 if { (eval echo configure:15804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15804   rm -rf conftest*
15805   ol_cv_type_socklen_t=yes
15806 else
15807   echo "configure: failed program was:" >&5
15808   cat conftest.$ac_ext >&5
15809   rm -rf conftest*
15810   ol_cv_type_socklen_t=no
15811 fi
15812 rm -f conftest*
15813 fi
15814
15815 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15816   if test $ol_cv_type_socklen_t = no; then
15817     cat >> confdefs.h <<\EOF
15818 #define socklen_t int
15819 EOF
15820
15821   fi
15822  
15823 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
15824 echo "configure:15825: checking for st_blksize in struct stat" >&5
15825 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
15826   echo $ac_n "(cached) $ac_c" 1>&6
15827 else
15828   cat > conftest.$ac_ext <<EOF
15829 #line 15830 "configure"
15830 #include "confdefs.h"
15831 #include <sys/types.h>
15832 #include <sys/stat.h>
15833 int main() {
15834 struct stat s; s.st_blksize;
15835 ; return 0; }
15836 EOF
15837 if { (eval echo configure:15838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15838   rm -rf conftest*
15839   ac_cv_struct_st_blksize=yes
15840 else
15841   echo "configure: failed program was:" >&5
15842   cat conftest.$ac_ext >&5
15843   rm -rf conftest*
15844   ac_cv_struct_st_blksize=no
15845 fi
15846 rm -f conftest*
15847 fi
15848
15849 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
15850 if test $ac_cv_struct_st_blksize = yes; then
15851   cat >> confdefs.h <<\EOF
15852 #define HAVE_ST_BLKSIZE 1
15853 EOF
15854
15855 fi
15856
15857 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15858 echo "configure:15859: checking whether time.h and sys/time.h may both be included" >&5
15859 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
15860   echo $ac_n "(cached) $ac_c" 1>&6
15861 else
15862   cat > conftest.$ac_ext <<EOF
15863 #line 15864 "configure"
15864 #include "confdefs.h"
15865 #include <sys/types.h>
15866 #include <sys/time.h>
15867 #include <time.h>
15868 int main() {
15869 struct tm *tp;
15870 ; return 0; }
15871 EOF
15872 if { (eval echo configure:15873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15873   rm -rf conftest*
15874   ac_cv_header_time=yes
15875 else
15876   echo "configure: failed program was:" >&5
15877   cat conftest.$ac_ext >&5
15878   rm -rf conftest*
15879   ac_cv_header_time=no
15880 fi
15881 rm -f conftest*
15882 fi
15883
15884 echo "$ac_t""$ac_cv_header_time" 1>&6
15885 if test $ac_cv_header_time = yes; then
15886   cat >> confdefs.h <<\EOF
15887 #define TIME_WITH_SYS_TIME 1
15888 EOF
15889
15890 fi
15891
15892 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15893 echo "configure:15894: checking whether struct tm is in sys/time.h or time.h" >&5
15894 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
15895   echo $ac_n "(cached) $ac_c" 1>&6
15896 else
15897   cat > conftest.$ac_ext <<EOF
15898 #line 15899 "configure"
15899 #include "confdefs.h"
15900 #include <sys/types.h>
15901 #include <time.h>
15902 int main() {
15903 struct tm *tp; tp->tm_sec;
15904 ; return 0; }
15905 EOF
15906 if { (eval echo configure:15907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15907   rm -rf conftest*
15908   ac_cv_struct_tm=time.h
15909 else
15910   echo "configure: failed program was:" >&5
15911   cat conftest.$ac_ext >&5
15912   rm -rf conftest*
15913   ac_cv_struct_tm=sys/time.h
15914 fi
15915 rm -f conftest*
15916 fi
15917
15918 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15919 if test $ac_cv_struct_tm = sys/time.h; then
15920   cat >> confdefs.h <<\EOF
15921 #define TM_IN_SYS_TIME 1
15922 EOF
15923
15924 fi
15925
15926 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15927 echo "configure:15928: checking for uid_t in sys/types.h" >&5
15928 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
15929   echo $ac_n "(cached) $ac_c" 1>&6
15930 else
15931   cat > conftest.$ac_ext <<EOF
15932 #line 15933 "configure"
15933 #include "confdefs.h"
15934 #include <sys/types.h>
15935 EOF
15936 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15937   egrep "uid_t" >/dev/null 2>&1; then
15938   rm -rf conftest*
15939   ac_cv_type_uid_t=yes
15940 else
15941   rm -rf conftest*
15942   ac_cv_type_uid_t=no
15943 fi
15944 rm -f conftest*
15945
15946 fi
15947
15948 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15949 if test $ac_cv_type_uid_t = no; then
15950   cat >> confdefs.h <<\EOF
15951 #define uid_t int
15952 EOF
15953
15954   cat >> confdefs.h <<\EOF
15955 #define gid_t int
15956 EOF
15957
15958 fi
15959
15960 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15961 echo "configure:15962: checking for sig_atomic_t" >&5
15962 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
15963   echo $ac_n "(cached) $ac_c" 1>&6
15964 else
15965   cat > conftest.$ac_ext <<EOF
15966 #line 15967 "configure"
15967 #include "confdefs.h"
15968 #include <signal.h>
15969 int main() {
15970 sig_atomic_t atomic;
15971 ; return 0; }
15972 EOF
15973 if { (eval echo configure:15974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15974   rm -rf conftest*
15975   ol_cv_type_sig_atomic_t=yes
15976 else
15977   echo "configure: failed program was:" >&5
15978   cat conftest.$ac_ext >&5
15979   rm -rf conftest*
15980   ol_cv_type_sig_atomic_t=no
15981 fi
15982 rm -f conftest*
15983 fi
15984
15985 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15986   if test $ol_cv_type_sig_atomic_t = no; then
15987     cat >> confdefs.h <<\EOF
15988 #define sig_atomic_t int
15989 EOF
15990
15991   fi
15992  
15993
15994
15995 # test for pw_gecos in struct passwd
15996 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15997 echo "configure:15998: checking struct passwd for pw_gecos" >&5
15998 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
15999   echo $ac_n "(cached) $ac_c" 1>&6
16000 else
16001   
16002         cat > conftest.$ac_ext <<EOF
16003 #line 16004 "configure"
16004 #include "confdefs.h"
16005 #include <pwd.h>
16006 int main() {
16007
16008         struct passwd pwd;
16009         pwd.pw_gecos = pwd.pw_name;
16010
16011 ; return 0; }
16012 EOF
16013 if { (eval echo configure:16014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16014   rm -rf conftest*
16015   ol_cv_struct_passwd_pw_gecos=yes
16016 else
16017   echo "configure: failed program was:" >&5
16018   cat conftest.$ac_ext >&5
16019   rm -rf conftest*
16020   ol_cv_struct_passwd_pw_gecos=no
16021 fi
16022 rm -f conftest*
16023 fi
16024
16025 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16026 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16027         cat >> confdefs.h <<\EOF
16028 #define HAVE_PW_GECOS 1
16029 EOF
16030
16031 fi
16032
16033 # test for pw_passwd in struct passwd
16034 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16035 echo "configure:16036: checking struct passwd for pw_passwd" >&5
16036 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_passwd'+set}'`\" = set"; then
16037   echo $ac_n "(cached) $ac_c" 1>&6
16038 else
16039   
16040         cat > conftest.$ac_ext <<EOF
16041 #line 16042 "configure"
16042 #include "confdefs.h"
16043 #include <pwd.h>
16044 int main() {
16045
16046         struct passwd pwd;
16047         pwd.pw_passwd = pwd.pw_name;
16048
16049 ; return 0; }
16050 EOF
16051 if { (eval echo configure:16052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16052   rm -rf conftest*
16053   ol_cv_struct_passwd_pw_passwd=yes
16054 else
16055   echo "configure: failed program was:" >&5
16056   cat conftest.$ac_ext >&5
16057   rm -rf conftest*
16058   ol_cv_struct_passwd_pw_passwd=no
16059 fi
16060 rm -f conftest*
16061 fi
16062
16063 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16064 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16065         cat >> confdefs.h <<\EOF
16066 #define HAVE_PW_PASSWD 1
16067 EOF
16068
16069 fi
16070
16071
16072 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16073 echo "configure:16074: checking if toupper() requires islower()" >&5
16074 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
16075   echo $ac_n "(cached) $ac_c" 1>&6
16076 else
16077   
16078         if test "$cross_compiling" = yes; then
16079   ol_cv_c_upper_lower=safe
16080 else
16081   cat > conftest.$ac_ext <<EOF
16082 #line 16083 "configure"
16083 #include "confdefs.h"
16084
16085 #include <ctype.h>
16086 main()
16087 {
16088         if ('C' == toupper('C'))
16089                 exit(0);
16090         else
16091                 exit(1);
16092 }
16093 EOF
16094 if { (eval echo configure:16095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16095 then
16096   ol_cv_c_upper_lower=no
16097 else
16098   echo "configure: failed program was:" >&5
16099   cat conftest.$ac_ext >&5
16100   rm -fr conftest*
16101   ol_cv_c_upper_lower=yes
16102 fi
16103 rm -fr conftest*
16104 fi
16105
16106 fi
16107
16108 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16109 if test $ol_cv_c_upper_lower != no ; then
16110         cat >> confdefs.h <<\EOF
16111 #define C_UPPER_LOWER 1
16112 EOF
16113
16114 fi
16115
16116 echo $ac_n "checking for working const""... $ac_c" 1>&6
16117 echo "configure:16118: checking for working const" >&5
16118 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
16119   echo $ac_n "(cached) $ac_c" 1>&6
16120 else
16121   cat > conftest.$ac_ext <<EOF
16122 #line 16123 "configure"
16123 #include "confdefs.h"
16124
16125 int main() {
16126
16127 /* Ultrix mips cc rejects this.  */
16128 typedef int charset[2]; const charset x;
16129 /* SunOS 4.1.1 cc rejects this.  */
16130 char const *const *ccp;
16131 char **p;
16132 /* NEC SVR4.0.2 mips cc rejects this.  */
16133 struct point {int x, y;};
16134 static struct point const zero = {0,0};
16135 /* AIX XL C 1.02.0.0 rejects this.
16136    It does not let you subtract one const X* pointer from another in an arm
16137    of an if-expression whose if-part is not a constant expression */
16138 const char *g = "string";
16139 ccp = &g + (g ? g-g : 0);
16140 /* HPUX 7.0 cc rejects these. */
16141 ++ccp;
16142 p = (char**) ccp;
16143 ccp = (char const *const *) p;
16144 { /* SCO 3.2v4 cc rejects this.  */
16145   char *t;
16146   char const *s = 0 ? (char *) 0 : (char const *) 0;
16147
16148   *t++ = 0;
16149 }
16150 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16151   int x[] = {25, 17};
16152   const int *foo = &x[0];
16153   ++foo;
16154 }
16155 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16156   typedef const int *iptr;
16157   iptr p = 0;
16158   ++p;
16159 }
16160 { /* AIX XL C 1.02.0.0 rejects this saying
16161      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16162   struct s { int j; const int *ap[3]; };
16163   struct s *b; b->j = 5;
16164 }
16165 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16166   const int foo = 10;
16167 }
16168
16169 ; return 0; }
16170 EOF
16171 if { (eval echo configure:16172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16172   rm -rf conftest*
16173   ac_cv_c_const=yes
16174 else
16175   echo "configure: failed program was:" >&5
16176   cat conftest.$ac_ext >&5
16177   rm -rf conftest*
16178   ac_cv_c_const=no
16179 fi
16180 rm -f conftest*
16181 fi
16182
16183 echo "$ac_t""$ac_cv_c_const" 1>&6
16184 if test $ac_cv_c_const = no; then
16185   cat >> confdefs.h <<\EOF
16186 #define const 
16187 EOF
16188
16189 fi
16190
16191 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16192 echo "configure:16193: checking if compiler understands volatile" >&5
16193 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
16194   echo $ac_n "(cached) $ac_c" 1>&6
16195 else
16196   cat > conftest.$ac_ext <<EOF
16197 #line 16198 "configure"
16198 #include "confdefs.h"
16199 int x, y, z;
16200 int main() {
16201 volatile int a; int * volatile b = x ? &y : &z;
16202       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16203       *b = 0;
16204 ; return 0; }
16205 EOF
16206 if { (eval echo configure:16207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16207   rm -rf conftest*
16208   ol_cv_c_volatile=yes
16209 else
16210   echo "configure: failed program was:" >&5
16211   cat conftest.$ac_ext >&5
16212   rm -rf conftest*
16213   ol_cv_c_volatile=no
16214 fi
16215 rm -f conftest*
16216 fi
16217
16218 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16219   if test $ol_cv_c_volatile = yes; then
16220     : 
16221   else
16222     cat >> confdefs.h <<\EOF
16223 #define volatile 
16224 EOF
16225
16226   fi
16227  
16228
16229 if test $cross_compiling = yes ; then
16230         cat >> confdefs.h <<\EOF
16231 #define CROSS_COMPILING 1
16232 EOF
16233
16234 else
16235         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16236 echo "configure:16237: checking whether byte ordering is bigendian" >&5
16237 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
16238   echo $ac_n "(cached) $ac_c" 1>&6
16239 else
16240   ac_cv_c_bigendian=unknown
16241 # See if sys/param.h defines the BYTE_ORDER macro.
16242 cat > conftest.$ac_ext <<EOF
16243 #line 16244 "configure"
16244 #include "confdefs.h"
16245 #include <sys/types.h>
16246 #include <sys/param.h>
16247 int main() {
16248
16249 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16250  bogus endian macros
16251 #endif
16252 ; return 0; }
16253 EOF
16254 if { (eval echo configure:16255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16255   rm -rf conftest*
16256   # It does; now see whether it defined to BIG_ENDIAN or not.
16257 cat > conftest.$ac_ext <<EOF
16258 #line 16259 "configure"
16259 #include "confdefs.h"
16260 #include <sys/types.h>
16261 #include <sys/param.h>
16262 int main() {
16263
16264 #if BYTE_ORDER != BIG_ENDIAN
16265  not big endian
16266 #endif
16267 ; return 0; }
16268 EOF
16269 if { (eval echo configure:16270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16270   rm -rf conftest*
16271   ac_cv_c_bigendian=yes
16272 else
16273   echo "configure: failed program was:" >&5
16274   cat conftest.$ac_ext >&5
16275   rm -rf conftest*
16276   ac_cv_c_bigendian=no
16277 fi
16278 rm -f conftest*
16279 else
16280   echo "configure: failed program was:" >&5
16281   cat conftest.$ac_ext >&5
16282 fi
16283 rm -f conftest*
16284 if test $ac_cv_c_bigendian = unknown; then
16285 if test "$cross_compiling" = yes; then
16286     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16287 else
16288   cat > conftest.$ac_ext <<EOF
16289 #line 16290 "configure"
16290 #include "confdefs.h"
16291 main () {
16292   /* Are we little or big endian?  From Harbison&Steele.  */
16293   union
16294   {
16295     long l;
16296     char c[sizeof (long)];
16297   } u;
16298   u.l = 1;
16299   exit (u.c[sizeof (long) - 1] == 1);
16300 }
16301 EOF
16302 if { (eval echo configure:16303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16303 then
16304   ac_cv_c_bigendian=no
16305 else
16306   echo "configure: failed program was:" >&5
16307   cat conftest.$ac_ext >&5
16308   rm -fr conftest*
16309   ac_cv_c_bigendian=yes
16310 fi
16311 rm -fr conftest*
16312 fi
16313
16314 fi
16315 fi
16316
16317 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16318 if test $ac_cv_c_bigendian = yes; then
16319   cat >> confdefs.h <<\EOF
16320 #define WORDS_BIGENDIAN 1
16321 EOF
16322
16323 fi
16324
16325 fi
16326
16327 echo $ac_n "checking size of short""... $ac_c" 1>&6
16328 echo "configure:16329: checking size of short" >&5 
16329 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
16330   echo $ac_n "(cached) $ac_c" 1>&6
16331 else
16332   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16333   cat > conftest.$ac_ext <<EOF
16334 #line 16335 "configure"
16335 #include "confdefs.h"
16336 #include "confdefs.h" 
16337 #include <sys/types.h> 
16338  
16339
16340 int main() {
16341 switch (0) case 0: case (sizeof (short) == $ac_size):;
16342 ; return 0; }
16343 EOF
16344 if { (eval echo configure:16345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16345   rm -rf conftest*
16346   ac_cv_sizeof_short=$ac_size
16347 else
16348   echo "configure: failed program was:" >&5
16349   cat conftest.$ac_ext >&5
16350 fi
16351 rm -f conftest* 
16352   if test x$ac_cv_sizeof_short != x ; then break; fi 
16353 done 
16354
16355 fi
16356  
16357 if test x$ac_cv_sizeof_short = x ; then 
16358   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16359 fi 
16360 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16361 cat >> confdefs.h <<EOF
16362 #define SIZEOF_SHORT $ac_cv_sizeof_short
16363 EOF
16364  
16365  
16366 echo $ac_n "checking size of int""... $ac_c" 1>&6
16367 echo "configure:16368: checking size of int" >&5 
16368 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
16369   echo $ac_n "(cached) $ac_c" 1>&6
16370 else
16371   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16372   cat > conftest.$ac_ext <<EOF
16373 #line 16374 "configure"
16374 #include "confdefs.h"
16375 #include "confdefs.h" 
16376 #include <sys/types.h> 
16377  
16378
16379 int main() {
16380 switch (0) case 0: case (sizeof (int) == $ac_size):;
16381 ; return 0; }
16382 EOF
16383 if { (eval echo configure:16384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16384   rm -rf conftest*
16385   ac_cv_sizeof_int=$ac_size
16386 else
16387   echo "configure: failed program was:" >&5
16388   cat conftest.$ac_ext >&5
16389 fi
16390 rm -f conftest* 
16391   if test x$ac_cv_sizeof_int != x ; then break; fi 
16392 done 
16393
16394 fi
16395  
16396 if test x$ac_cv_sizeof_int = x ; then 
16397   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16398 fi 
16399 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16400 cat >> confdefs.h <<EOF
16401 #define SIZEOF_INT $ac_cv_sizeof_int
16402 EOF
16403  
16404  
16405 echo $ac_n "checking size of long""... $ac_c" 1>&6
16406 echo "configure:16407: checking size of long" >&5 
16407 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
16408   echo $ac_n "(cached) $ac_c" 1>&6
16409 else
16410   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16411   cat > conftest.$ac_ext <<EOF
16412 #line 16413 "configure"
16413 #include "confdefs.h"
16414 #include "confdefs.h" 
16415 #include <sys/types.h> 
16416  
16417
16418 int main() {
16419 switch (0) case 0: case (sizeof (long) == $ac_size):;
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_sizeof_long=$ac_size
16425 else
16426   echo "configure: failed program was:" >&5
16427   cat conftest.$ac_ext >&5
16428 fi
16429 rm -f conftest* 
16430   if test x$ac_cv_sizeof_long != x ; then break; fi 
16431 done 
16432
16433 fi
16434  
16435 if test x$ac_cv_sizeof_long = x ; then 
16436   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16437 fi 
16438 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16439 cat >> confdefs.h <<EOF
16440 #define SIZEOF_LONG $ac_cv_sizeof_long
16441 EOF
16442  
16443
16444
16445 if test "$ac_cv_sizeof_int" -lt 4 ; then
16446         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16447
16448         cat >> confdefs.h <<\EOF
16449 #define LBER_INT_T long
16450 EOF
16451
16452 else
16453         cat >> confdefs.h <<\EOF
16454 #define LBER_INT_T int
16455 EOF
16456
16457 fi
16458
16459 cat >> confdefs.h <<\EOF
16460 #define LBER_LEN_T long
16461 EOF
16462
16463 cat >> confdefs.h <<\EOF
16464 #define LBER_SOCKET_T int
16465 EOF
16466
16467 cat >> confdefs.h <<\EOF
16468 #define LBER_TAG_T long
16469 EOF
16470
16471
16472 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16473 echo "configure:16474: checking for 8-bit clean memcmp" >&5
16474 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
16475   echo $ac_n "(cached) $ac_c" 1>&6
16476 else
16477   if test "$cross_compiling" = yes; then
16478   ac_cv_func_memcmp_clean=no
16479 else
16480   cat > conftest.$ac_ext <<EOF
16481 #line 16482 "configure"
16482 #include "confdefs.h"
16483
16484 main()
16485 {
16486   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16487   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16488 }
16489
16490 EOF
16491 if { (eval echo configure:16492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16492 then
16493   ac_cv_func_memcmp_clean=yes
16494 else
16495   echo "configure: failed program was:" >&5
16496   cat conftest.$ac_ext >&5
16497   rm -fr conftest*
16498   ac_cv_func_memcmp_clean=no
16499 fi
16500 rm -fr conftest*
16501 fi
16502
16503 fi
16504
16505 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16506 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16507
16508 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16509 echo "configure:16510: checking for strftime" >&5
16510 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
16511   echo $ac_n "(cached) $ac_c" 1>&6
16512 else
16513   cat > conftest.$ac_ext <<EOF
16514 #line 16515 "configure"
16515 #include "confdefs.h"
16516 /* System header to define __stub macros and hopefully few prototypes,
16517     which can conflict with char strftime(); below.  */
16518 #include <assert.h>
16519 /* Override any gcc2 internal prototype to avoid an error.  */
16520 /* We use char because int might match the return type of a gcc2
16521     builtin and then its argument prototype would still apply.  */
16522 char strftime();
16523
16524 int main() {
16525
16526 /* The GNU C library defines this for functions which it implements
16527     to always fail with ENOSYS.  Some functions are actually named
16528     something starting with __ and the normal name is an alias.  */
16529 #if defined (__stub_strftime) || defined (__stub___strftime)
16530 choke me
16531 #else
16532 strftime();
16533 #endif
16534
16535 ; return 0; }
16536 EOF
16537 if { (eval echo configure:16538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16538   rm -rf conftest*
16539   eval "ac_cv_func_strftime=yes"
16540 else
16541   echo "configure: failed program was:" >&5
16542   cat conftest.$ac_ext >&5
16543   rm -rf conftest*
16544   eval "ac_cv_func_strftime=no"
16545 fi
16546 rm -f conftest*
16547 fi
16548
16549 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16550   echo "$ac_t""yes" 1>&6
16551   cat >> confdefs.h <<\EOF
16552 #define HAVE_STRFTIME 1
16553 EOF
16554
16555 else
16556   echo "$ac_t""no" 1>&6
16557 # strftime is in -lintl on SCO UNIX.
16558 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16559 echo "configure:16560: checking for strftime in -lintl" >&5
16560 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
16561 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
16562   echo $ac_n "(cached) $ac_c" 1>&6
16563 else
16564   ac_save_LIBS="$LIBS"
16565 LIBS="-lintl  $LIBS"
16566 cat > conftest.$ac_ext <<EOF
16567 #line 16568 "configure"
16568 #include "confdefs.h"
16569 /* Override any gcc2 internal prototype to avoid an error.  */
16570 /* We use char because int might match the return type of a gcc2
16571     builtin and then its argument prototype would still apply.  */
16572 char strftime();
16573
16574 int main() {
16575 strftime()
16576 ; return 0; }
16577 EOF
16578 if { (eval echo configure:16579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16579   rm -rf conftest*
16580   eval "ac_cv_lib_$ac_lib_var=yes"
16581 else
16582   echo "configure: failed program was:" >&5
16583   cat conftest.$ac_ext >&5
16584   rm -rf conftest*
16585   eval "ac_cv_lib_$ac_lib_var=no"
16586 fi
16587 rm -f conftest*
16588 LIBS="$ac_save_LIBS"
16589
16590 fi
16591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16592   echo "$ac_t""yes" 1>&6
16593   cat >> confdefs.h <<\EOF
16594 #define HAVE_STRFTIME 1
16595 EOF
16596
16597 LIBS="-lintl $LIBS"
16598 else
16599   echo "$ac_t""no" 1>&6
16600 fi
16601
16602 fi
16603
16604
16605 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16606 echo "configure:16607: checking for inet_aton()" >&5
16607 if eval "test \"`echo '$''{'ol_cv_func_inet_aton'+set}'`\" = set"; then
16608   echo $ac_n "(cached) $ac_c" 1>&6
16609 else
16610   cat > conftest.$ac_ext <<EOF
16611 #line 16612 "configure"
16612 #include "confdefs.h"
16613
16614 #ifdef HAVE_SYS_TYPES_H
16615 #       include <sys/types.h>
16616 #endif
16617 #ifdef HAVE_SYS_SOCKET_H
16618 #       include <sys/socket.h>
16619 #       ifdef HAVE_SYS_SELECT_H
16620 #               include <sys/select.h>
16621 #       endif
16622 #       include <netinet/in.h>
16623 #       ifdef HAVE_ARPA_INET_H
16624 #               include <arpa/inet.h>
16625 #       endif
16626 #endif
16627
16628 int main() {
16629 struct in_addr in;
16630 int rc = inet_aton( "255.255.255.255", &in );
16631 ; return 0; }
16632 EOF
16633 if { (eval echo configure:16634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16634   rm -rf conftest*
16635   ol_cv_func_inet_aton=yes
16636 else
16637   echo "configure: failed program was:" >&5
16638   cat conftest.$ac_ext >&5
16639   rm -rf conftest*
16640   ol_cv_func_inet_aton=no
16641 fi
16642 rm -f conftest*
16643 fi
16644
16645 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16646   if test $ol_cv_func_inet_aton != no; then
16647     cat >> confdefs.h <<\EOF
16648 #define HAVE_INET_ATON 1
16649 EOF
16650
16651   fi
16652  
16653
16654 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16655 echo "configure:16656: checking for _spawnlp" >&5
16656 if eval "test \"`echo '$''{'ac_cv_func__spawnlp'+set}'`\" = set"; then
16657   echo $ac_n "(cached) $ac_c" 1>&6
16658 else
16659   cat > conftest.$ac_ext <<EOF
16660 #line 16661 "configure"
16661 #include "confdefs.h"
16662 /* System header to define __stub macros and hopefully few prototypes,
16663     which can conflict with char _spawnlp(); below.  */
16664 #include <assert.h>
16665 /* Override any gcc2 internal prototype to avoid an error.  */
16666 /* We use char because int might match the return type of a gcc2
16667     builtin and then its argument prototype would still apply.  */
16668 char _spawnlp();
16669
16670 int main() {
16671
16672 /* The GNU C library defines this for functions which it implements
16673     to always fail with ENOSYS.  Some functions are actually named
16674     something starting with __ and the normal name is an alias.  */
16675 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16676 choke me
16677 #else
16678 _spawnlp();
16679 #endif
16680
16681 ; return 0; }
16682 EOF
16683 if { (eval echo configure:16684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16684   rm -rf conftest*
16685   eval "ac_cv_func__spawnlp=yes"
16686 else
16687   echo "configure: failed program was:" >&5
16688   cat conftest.$ac_ext >&5
16689   rm -rf conftest*
16690   eval "ac_cv_func__spawnlp=no"
16691 fi
16692 rm -f conftest*
16693 fi
16694
16695 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16696   echo "$ac_t""yes" 1>&6
16697   cat >> confdefs.h <<\EOF
16698 #define HAVE_SPAWNLP 1
16699 EOF
16700
16701 else
16702   echo "$ac_t""no" 1>&6
16703 fi
16704
16705
16706 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16707 echo "configure:16708: checking for _snprintf" >&5
16708 if eval "test \"`echo '$''{'ac_cv_func__snprintf'+set}'`\" = set"; then
16709   echo $ac_n "(cached) $ac_c" 1>&6
16710 else
16711   cat > conftest.$ac_ext <<EOF
16712 #line 16713 "configure"
16713 #include "confdefs.h"
16714 /* System header to define __stub macros and hopefully few prototypes,
16715     which can conflict with char _snprintf(); below.  */
16716 #include <assert.h>
16717 /* Override any gcc2 internal prototype to avoid an error.  */
16718 /* We use char because int might match the return type of a gcc2
16719     builtin and then its argument prototype would still apply.  */
16720 char _snprintf();
16721
16722 int main() {
16723
16724 /* The GNU C library defines this for functions which it implements
16725     to always fail with ENOSYS.  Some functions are actually named
16726     something starting with __ and the normal name is an alias.  */
16727 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16728 choke me
16729 #else
16730 _snprintf();
16731 #endif
16732
16733 ; return 0; }
16734 EOF
16735 if { (eval echo configure:16736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16736   rm -rf conftest*
16737   eval "ac_cv_func__snprintf=yes"
16738 else
16739   echo "configure: failed program was:" >&5
16740   cat conftest.$ac_ext >&5
16741   rm -rf conftest*
16742   eval "ac_cv_func__snprintf=no"
16743 fi
16744 rm -f conftest*
16745 fi
16746
16747 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16748   echo "$ac_t""yes" 1>&6
16749   ac_cv_func_snprintf=yes
16750         cat >> confdefs.h <<\EOF
16751 #define snprintf _snprintf
16752 EOF
16753
16754
16755 else
16756   echo "$ac_t""no" 1>&6
16757 fi
16758
16759
16760 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16761 echo "configure:16762: checking for _vsnprintf" >&5
16762 if eval "test \"`echo '$''{'ac_cv_func__vsnprintf'+set}'`\" = set"; then
16763   echo $ac_n "(cached) $ac_c" 1>&6
16764 else
16765   cat > conftest.$ac_ext <<EOF
16766 #line 16767 "configure"
16767 #include "confdefs.h"
16768 /* System header to define __stub macros and hopefully few prototypes,
16769     which can conflict with char _vsnprintf(); below.  */
16770 #include <assert.h>
16771 /* Override any gcc2 internal prototype to avoid an error.  */
16772 /* We use char because int might match the return type of a gcc2
16773     builtin and then its argument prototype would still apply.  */
16774 char _vsnprintf();
16775
16776 int main() {
16777
16778 /* The GNU C library defines this for functions which it implements
16779     to always fail with ENOSYS.  Some functions are actually named
16780     something starting with __ and the normal name is an alias.  */
16781 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16782 choke me
16783 #else
16784 _vsnprintf();
16785 #endif
16786
16787 ; return 0; }
16788 EOF
16789 if { (eval echo configure:16790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16790   rm -rf conftest*
16791   eval "ac_cv_func__vsnprintf=yes"
16792 else
16793   echo "configure: failed program was:" >&5
16794   cat conftest.$ac_ext >&5
16795   rm -rf conftest*
16796   eval "ac_cv_func__vsnprintf=no"
16797 fi
16798 rm -f conftest*
16799 fi
16800
16801 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16802   echo "$ac_t""yes" 1>&6
16803   ac_cv_func_vsnprintf=yes
16804         cat >> confdefs.h <<\EOF
16805 #define vsnprintf _vsnprintf
16806 EOF
16807
16808
16809 else
16810   echo "$ac_t""no" 1>&6
16811 fi
16812
16813
16814 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16815 echo "configure:16816: checking for vprintf" >&5
16816 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
16817   echo $ac_n "(cached) $ac_c" 1>&6
16818 else
16819   cat > conftest.$ac_ext <<EOF
16820 #line 16821 "configure"
16821 #include "confdefs.h"
16822 /* System header to define __stub macros and hopefully few prototypes,
16823     which can conflict with char vprintf(); below.  */
16824 #include <assert.h>
16825 /* Override any gcc2 internal prototype to avoid an error.  */
16826 /* We use char because int might match the return type of a gcc2
16827     builtin and then its argument prototype would still apply.  */
16828 char vprintf();
16829
16830 int main() {
16831
16832 /* The GNU C library defines this for functions which it implements
16833     to always fail with ENOSYS.  Some functions are actually named
16834     something starting with __ and the normal name is an alias.  */
16835 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16836 choke me
16837 #else
16838 vprintf();
16839 #endif
16840
16841 ; return 0; }
16842 EOF
16843 if { (eval echo configure:16844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16844   rm -rf conftest*
16845   eval "ac_cv_func_vprintf=yes"
16846 else
16847   echo "configure: failed program was:" >&5
16848   cat conftest.$ac_ext >&5
16849   rm -rf conftest*
16850   eval "ac_cv_func_vprintf=no"
16851 fi
16852 rm -f conftest*
16853 fi
16854
16855 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16856   echo "$ac_t""yes" 1>&6
16857   cat >> confdefs.h <<\EOF
16858 #define HAVE_VPRINTF 1
16859 EOF
16860
16861 else
16862   echo "$ac_t""no" 1>&6
16863 fi
16864
16865 if test "$ac_cv_func_vprintf" != yes; then
16866 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16867 echo "configure:16868: checking for _doprnt" >&5
16868 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
16869   echo $ac_n "(cached) $ac_c" 1>&6
16870 else
16871   cat > conftest.$ac_ext <<EOF
16872 #line 16873 "configure"
16873 #include "confdefs.h"
16874 /* System header to define __stub macros and hopefully few prototypes,
16875     which can conflict with char _doprnt(); below.  */
16876 #include <assert.h>
16877 /* Override any gcc2 internal prototype to avoid an error.  */
16878 /* We use char because int might match the return type of a gcc2
16879     builtin and then its argument prototype would still apply.  */
16880 char _doprnt();
16881
16882 int main() {
16883
16884 /* The GNU C library defines this for functions which it implements
16885     to always fail with ENOSYS.  Some functions are actually named
16886     something starting with __ and the normal name is an alias.  */
16887 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16888 choke me
16889 #else
16890 _doprnt();
16891 #endif
16892
16893 ; return 0; }
16894 EOF
16895 if { (eval echo configure:16896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16896   rm -rf conftest*
16897   eval "ac_cv_func__doprnt=yes"
16898 else
16899   echo "configure: failed program was:" >&5
16900   cat conftest.$ac_ext >&5
16901   rm -rf conftest*
16902   eval "ac_cv_func__doprnt=no"
16903 fi
16904 rm -f conftest*
16905 fi
16906
16907 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16908   echo "$ac_t""yes" 1>&6
16909   cat >> confdefs.h <<\EOF
16910 #define HAVE_DOPRNT 1
16911 EOF
16912
16913 else
16914   echo "$ac_t""no" 1>&6
16915 fi
16916
16917 fi
16918
16919
16920 if test $ac_cv_func_vprintf = yes ; then
16921                 for ac_func in vsnprintf vsprintf
16922 do
16923 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16924 echo "configure:16925: checking for $ac_func" >&5
16925 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
16926   echo $ac_n "(cached) $ac_c" 1>&6
16927 else
16928   cat > conftest.$ac_ext <<EOF
16929 #line 16930 "configure"
16930 #include "confdefs.h"
16931 /* System header to define __stub macros and hopefully few prototypes,
16932     which can conflict with char $ac_func(); below.  */
16933 #include <assert.h>
16934 /* Override any gcc2 internal prototype to avoid an error.  */
16935 /* We use char because int might match the return type of a gcc2
16936     builtin and then its argument prototype would still apply.  */
16937 char $ac_func();
16938
16939 int main() {
16940
16941 /* The GNU C library defines this for functions which it implements
16942     to always fail with ENOSYS.  Some functions are actually named
16943     something starting with __ and the normal name is an alias.  */
16944 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16945 choke me
16946 #else
16947 $ac_func();
16948 #endif
16949
16950 ; return 0; }
16951 EOF
16952 if { (eval echo configure:16953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16953   rm -rf conftest*
16954   eval "ac_cv_func_$ac_func=yes"
16955 else
16956   echo "configure: failed program was:" >&5
16957   cat conftest.$ac_ext >&5
16958   rm -rf conftest*
16959   eval "ac_cv_func_$ac_func=no"
16960 fi
16961 rm -f conftest*
16962 fi
16963
16964 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16965   echo "$ac_t""yes" 1>&6
16966     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16967   cat >> confdefs.h <<EOF
16968 #define $ac_tr_func 1
16969 EOF
16970  
16971 else
16972   echo "$ac_t""no" 1>&6
16973 fi
16974 done
16975
16976 fi
16977
16978 for ac_func in \
16979         bcopy                   \
16980         closesocket             \
16981         chroot                  \
16982         endgrent                \
16983         endpwent                \
16984         fcntl                   \
16985         flock                   \
16986         getdtablesize   \
16987         getgrgid                \
16988         gethostname             \
16989         getpass                 \
16990         getpassphrase   \
16991         getpwuid                \
16992         getpwnam                \
16993         getspnam                \
16994         gettimeofday    \
16995         initgroups              \
16996         lockf                   \
16997         memcpy                  \
16998         memmove                 \
16999         pipe                    \
17000         read                    \
17001         recv                    \
17002         recvfrom                \
17003         setpwfile               \
17004         setgid                  \
17005         setegid                 \
17006         setsid                  \
17007         setuid                  \
17008         seteuid                 \
17009         sigaction               \
17010         signal                  \
17011         sigset                  \
17012         strdup                  \
17013         strerror                \
17014         strpbrk                 \
17015         strrchr                 \
17016         strsep                  \
17017         strstr                  \
17018         strtol                  \
17019         strtoul                 \
17020         strspn                  \
17021         sysconf                 \
17022         waitpid                 \
17023         wait4                   \
17024         write                   \
17025         send                    \
17026         sendto                  \
17027
17028 do
17029 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17030 echo "configure:17031: checking for $ac_func" >&5
17031 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
17032   echo $ac_n "(cached) $ac_c" 1>&6
17033 else
17034   cat > conftest.$ac_ext <<EOF
17035 #line 17036 "configure"
17036 #include "confdefs.h"
17037 /* System header to define __stub macros and hopefully few prototypes,
17038     which can conflict with char $ac_func(); below.  */
17039 #include <assert.h>
17040 /* Override any gcc2 internal prototype to avoid an error.  */
17041 /* We use char because int might match the return type of a gcc2
17042     builtin and then its argument prototype would still apply.  */
17043 char $ac_func();
17044
17045 int main() {
17046
17047 /* The GNU C library defines this for functions which it implements
17048     to always fail with ENOSYS.  Some functions are actually named
17049     something starting with __ and the normal name is an alias.  */
17050 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17051 choke me
17052 #else
17053 $ac_func();
17054 #endif
17055
17056 ; return 0; }
17057 EOF
17058 if { (eval echo configure:17059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17059   rm -rf conftest*
17060   eval "ac_cv_func_$ac_func=yes"
17061 else
17062   echo "configure: failed program was:" >&5
17063   cat conftest.$ac_ext >&5
17064   rm -rf conftest*
17065   eval "ac_cv_func_$ac_func=no"
17066 fi
17067 rm -f conftest*
17068 fi
17069
17070 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17071   echo "$ac_t""yes" 1>&6
17072     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17073   cat >> confdefs.h <<EOF
17074 #define $ac_tr_func 1
17075 EOF
17076  
17077 else
17078   echo "$ac_t""no" 1>&6
17079 fi
17080 done
17081
17082
17083 for ac_func in getopt
17084 do
17085 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17086 echo "configure:17087: checking for $ac_func" >&5
17087 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
17088   echo $ac_n "(cached) $ac_c" 1>&6
17089 else
17090   cat > conftest.$ac_ext <<EOF
17091 #line 17092 "configure"
17092 #include "confdefs.h"
17093 /* System header to define __stub macros and hopefully few prototypes,
17094     which can conflict with char $ac_func(); below.  */
17095 #include <assert.h>
17096 /* Override any gcc2 internal prototype to avoid an error.  */
17097 /* We use char because int might match the return type of a gcc2
17098     builtin and then its argument prototype would still apply.  */
17099 char $ac_func();
17100
17101 int main() {
17102
17103 /* The GNU C library defines this for functions which it implements
17104     to always fail with ENOSYS.  Some functions are actually named
17105     something starting with __ and the normal name is an alias.  */
17106 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17107 choke me
17108 #else
17109 $ac_func();
17110 #endif
17111
17112 ; return 0; }
17113 EOF
17114 if { (eval echo configure:17115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17115   rm -rf conftest*
17116   eval "ac_cv_func_$ac_func=yes"
17117 else
17118   echo "configure: failed program was:" >&5
17119   cat conftest.$ac_ext >&5
17120   rm -rf conftest*
17121   eval "ac_cv_func_$ac_func=no"
17122 fi
17123 rm -f conftest*
17124 fi
17125
17126 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17127   echo "$ac_t""yes" 1>&6
17128     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17129   cat >> confdefs.h <<EOF
17130 #define $ac_tr_func 1
17131 EOF
17132  
17133 else
17134   echo "$ac_t""no" 1>&6
17135 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17136 fi
17137 done
17138
17139
17140
17141 if test "$ac_cv_func_getopt" != yes; then
17142     LIBSRCS="$LIBSRCS getopt.c"
17143 fi
17144
17145 # Check Configuration
17146 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17147 echo "configure:17148: checking declaration of sys_errlist" >&5
17148 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
17149   echo $ac_n "(cached) $ac_c" 1>&6
17150 else
17151   
17152         cat > conftest.$ac_ext <<EOF
17153 #line 17154 "configure"
17154 #include "confdefs.h"
17155
17156 #include <stdio.h>
17157 #include <sys/types.h>
17158 #include <errno.h>
17159 #ifdef WINNT
17160 #include <stdlib.h>
17161 #endif 
17162 int main() {
17163 char *c = (char *) *sys_errlist
17164 ; return 0; }
17165 EOF
17166 if { (eval echo configure:17167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17167   rm -rf conftest*
17168   ol_cv_dcl_sys_errlist=yes
17169         ol_cv_have_sys_errlist=yes
17170 else
17171   echo "configure: failed program was:" >&5
17172   cat conftest.$ac_ext >&5
17173   rm -rf conftest*
17174   ol_cv_dcl_sys_errlist=no
17175 fi
17176 rm -f conftest*
17177 fi
17178
17179 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17180 #
17181 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17182 if test $ol_cv_dcl_sys_errlist = no ; then
17183         cat >> confdefs.h <<\EOF
17184 #define DECL_SYS_ERRLIST 1
17185 EOF
17186
17187
17188         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17189 echo "configure:17190: checking existence of sys_errlist" >&5
17190 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
17191   echo $ac_n "(cached) $ac_c" 1>&6
17192 else
17193   
17194                 cat > conftest.$ac_ext <<EOF
17195 #line 17196 "configure"
17196 #include "confdefs.h"
17197 #include <errno.h>
17198 int main() {
17199 char *c = (char *) *sys_errlist
17200 ; return 0; }
17201 EOF
17202 if { (eval echo configure:17203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17203   rm -rf conftest*
17204   ol_cv_have_sys_errlist=yes
17205 else
17206   echo "configure: failed program was:" >&5
17207   cat conftest.$ac_ext >&5
17208   rm -rf conftest*
17209   ol_cv_have_sys_errlist=no
17210 fi
17211 rm -f conftest*
17212 fi
17213
17214 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17215 fi
17216 if test $ol_cv_have_sys_errlist = yes ; then
17217         cat >> confdefs.h <<\EOF
17218 #define HAVE_SYS_ERRLIST 1
17219 EOF
17220
17221 fi
17222
17223
17224
17225 if test "$ol_enable_debug" != no ; then
17226         cat >> confdefs.h <<\EOF
17227 #define LDAP_DEBUG 1
17228 EOF
17229
17230 fi
17231 if test "$ol_enable_syslog" = yes ; then
17232         cat >> confdefs.h <<\EOF
17233 #define LDAP_SYSLOG 1
17234 EOF
17235
17236 fi
17237 if test "$ol_enable_cache" = no ; then
17238         cat >> confdefs.h <<\EOF
17239 #define LDAP_NOCACHE 1
17240 EOF
17241
17242 fi
17243 if test "$ol_link_kbind" != no ; then
17244         cat >> confdefs.h <<\EOF
17245 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17246 EOF
17247
17248 fi
17249 if test "$ol_enable_proctitle" != no ; then
17250         cat >> confdefs.h <<\EOF
17251 #define LDAP_PROCTITLE 1
17252 EOF
17253
17254 fi
17255 if test "$ol_enable_referrals" != no ; then
17256         cat >> confdefs.h <<\EOF
17257 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17258 EOF
17259
17260 fi
17261 if test "$ol_enable_local" != no; then
17262         cat >> confdefs.h <<\EOF
17263 #define LDAP_PF_LOCAL 1
17264 EOF
17265
17266 fi
17267 if test "$ol_link_ipv6" != no; then
17268         cat >> confdefs.h <<\EOF
17269 #define LDAP_PF_INET6 1
17270 EOF
17271
17272 fi
17273 if test "$ol_enable_cleartext" != no ; then
17274         cat >> confdefs.h <<\EOF
17275 #define SLAPD_CLEARTEXT 1
17276 EOF
17277
17278 fi
17279 if test "$ol_enable_crypt" != no ; then
17280         cat >> confdefs.h <<\EOF
17281 #define SLAPD_CRYPT 1
17282 EOF
17283
17284 fi
17285 if test "$ol_link_kpasswd" != no ; then
17286         cat >> confdefs.h <<\EOF
17287 #define SLAPD_KPASSWD 1
17288 EOF
17289
17290 fi
17291 if test "$ol_link_spasswd" != no ; then
17292         cat >> confdefs.h <<\EOF
17293 #define SLAPD_SPASSWD 1
17294 EOF
17295
17296 fi
17297 if test "$ol_enable_phonetic" != no ; then
17298         cat >> confdefs.h <<\EOF
17299 #define SLAPD_PHONETIC 1
17300 EOF
17301
17302 fi
17303 if test "$ol_enable_rlookups" != no ; then
17304         cat >> confdefs.h <<\EOF
17305 #define SLAPD_RLOOKUPS 1
17306 EOF
17307
17308 fi
17309 if test "$ol_enable_aci" != no ; then
17310         cat >> confdefs.h <<\EOF
17311 #define SLAPD_ACI_ENABLED 1
17312 EOF
17313
17314 fi
17315
17316 if test "$ol_link_modules" != no ; then
17317         cat >> confdefs.h <<\EOF
17318 #define SLAPD_MODULES 1
17319 EOF
17320
17321         BUILD_SLAPD=yes
17322         SLAPD_MODULES_LDFLAGS="-dlopen self"
17323 fi
17324
17325 if test "$ol_enable_bdb" != no ; then
17326         cat >> confdefs.h <<\EOF
17327 #define SLAPD_BDB 1
17328 EOF
17329
17330         BUILD_SLAPD=yes
17331         BUILD_BDB=yes
17332         if test "$ol_with_bdb_module" != static ; then
17333                 cat >> confdefs.h <<\EOF
17334 #define SLAPD_BDB_DYNAMIC 1
17335 EOF
17336
17337                 BUILD_BDB=mod
17338                 BUILD_BDB_DYNAMIC=shared
17339                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17340         fi
17341 fi
17342
17343 if test "$ol_link_dnssrv" != no ; then
17344         cat >> confdefs.h <<\EOF
17345 #define SLAPD_DNSSRV 1
17346 EOF
17347
17348         BUILD_SLAPD=yes
17349         BUILD_DNSSRV=yes
17350         if test "$ol_with_dnssrv_module" != static ; then
17351                 cat >> confdefs.h <<\EOF
17352 #define SLAPD_DNSSRV_DYNAMIC 1
17353 EOF
17354
17355                 BUILD_DNSSRV=mod
17356                 BUILD_DNSSRV_DYNAMIC=shared
17357                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17358         fi
17359 fi
17360
17361 if test "$ol_enable_ldap" != no ; then
17362         cat >> confdefs.h <<\EOF
17363 #define SLAPD_LDAP 1
17364 EOF
17365
17366         BUILD_SLAPD=yes
17367         BUILD_LDAP=yes
17368         if test "$ol_with_ldap_module" != static ; then
17369                 cat >> confdefs.h <<\EOF
17370 #define SLAPD_LDAP_DYNAMIC 1
17371 EOF
17372
17373                 BUILD_LDAP=mod
17374                 BUILD_LDAP_DYNAMIC=shared
17375                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17376         fi
17377 fi
17378
17379 if test "$ol_link_ldbm" != no ; then
17380         cat >> confdefs.h <<\EOF
17381 #define SLAPD_LDBM 1
17382 EOF
17383
17384         BUILD_SLAPD=yes
17385         BUILD_LDBM=yes
17386         if test "$ol_with_ldbm_module" != static ; then
17387                 cat >> confdefs.h <<\EOF
17388 #define SLAPD_LDBM_DYNAMIC 1
17389 EOF
17390
17391                 BUILD_LDBM=mod
17392                 BUILD_LDBM_DYNAMIC=shared
17393                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17394         fi
17395 fi
17396
17397 if test "$ol_enable_meta" != no ; then
17398         if test "$ol_enable_ldap" = no ; then
17399                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17400         fi
17401         if test "$ol_enable_rewrite" = no ; then
17402                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17403         fi
17404         cat >> confdefs.h <<\EOF
17405 #define SLAPD_META 1
17406 EOF
17407
17408         BUILD_SLAPD=yes
17409         BUILD_META=yes
17410         if test "$ol_with_meta_module" != static ; then
17411                 cat >> confdefs.h <<\EOF
17412 #define SLAPD_META_DYNAMIC 1
17413 EOF
17414
17415                 BUILD_META=mod
17416                 BUILD_META_DYNAMIC=shared
17417                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17418         fi
17419 fi
17420
17421 if test "$ol_enable_monitor" != no ; then
17422         cat >> confdefs.h <<\EOF
17423 #define SLAPD_MONITOR 1
17424 EOF
17425
17426         BUILD_SLAPD=yes
17427         BUILD_MONITOR=yes
17428         if test "$ol_with_monitor_module" != static ; then
17429                 cat >> confdefs.h <<\EOF
17430 #define SLAPD_MONITOR_DYNAMIC 1
17431 EOF
17432
17433                 BUILD_MONITOR=mod
17434                 BUILD_MONITOR_DYNAMIC=shared
17435                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17436         fi
17437 fi
17438
17439 if test "$ol_enable_passwd" != no ; then
17440         cat >> confdefs.h <<\EOF
17441 #define SLAPD_PASSWD 1
17442 EOF
17443
17444         BUILD_SLAPD=yes
17445         BUILD_PASSWD=yes
17446         if test "$ol_with_passwd_module" != static ; then
17447                 cat >> confdefs.h <<\EOF
17448 #define SLAPD_PASSWD_DYNAMIC 1
17449 EOF
17450
17451                 BUILD_PASSWD=mod
17452                 BUILD_PASSWD_DYNAMIC=shared
17453                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17454         fi
17455 fi
17456
17457 if test "$ol_link_perl" != no ; then
17458         cat >> confdefs.h <<\EOF
17459 #define SLAPD_PERL 1
17460 EOF
17461
17462         BUILD_SLAPD=yes
17463         BUILD_PERL=yes
17464         if test "$ol_with_perl_module" != static ; then
17465                 cat >> confdefs.h <<\EOF
17466 #define SLAPD_PERL_DYNAMIC 1
17467 EOF
17468
17469                 BUILD_PERL=mod
17470                 BUILD_PERL_DYNAMIC=shared
17471                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17472         fi
17473 fi
17474
17475 if test "$ol_enable_shell" != no ; then
17476         cat >> confdefs.h <<\EOF
17477 #define SLAPD_SHELL 1
17478 EOF
17479
17480         BUILD_SLAPD=yes
17481         BUILD_SHELL=yes
17482         if test "$ol_with_shell_module" != static ; then
17483                 cat >> confdefs.h <<\EOF
17484 #define SLAPD_SHELL_DYNAMIC 1
17485 EOF
17486
17487                 BUILD_SHELL=mod
17488                 BUILD_SHELL_DYNAMIC=shared
17489                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17490         fi
17491 fi
17492
17493 if test "$ol_enable_tcl" != no ; then
17494         cat >> confdefs.h <<\EOF
17495 #define SLAPD_TCL 1
17496 EOF
17497
17498         BUILD_SLAPD=yes
17499         BUILD_TCL=yes
17500         if test "$ol_with_tcl_module" != static; then
17501                 cat >> confdefs.h <<\EOF
17502 #define SLAPD_TCL_DYNAMIC 1
17503 EOF
17504
17505                 BUILD_TCL=mod
17506                 BUILD_TCL_DYNAMIC=shared
17507                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17508         fi
17509 fi
17510
17511 if test "$ol_link_sql" != no ; then
17512         cat >> confdefs.h <<\EOF
17513 #define SLAPD_SQL 1
17514 EOF
17515
17516         BUILD_SLAPD=yes
17517         BUILD_SQL=yes
17518         if test "$ol_with_sql_module" != static; then
17519                 cat >> confdefs.h <<\EOF
17520 #define SLAPD_SQL_DYNAMIC 1
17521 EOF
17522
17523                 BUILD_SQL=mod
17524                 BUILD_SQL_DYNAMIC=shared
17525                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17526         fi
17527 fi
17528
17529 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17530         $BUILD_SLAPD = yes ; then
17531         BUILD_SLURPD=yes
17532 fi
17533
17534 if test "$ol_enable_rewrite" != no ; then
17535         cat >> confdefs.h <<\EOF
17536 #define ENABLE_REWRITE 1
17537 EOF
17538
17539         BUILD_REWRITE=yes
17540         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17541 fi
17542
17543
17544 if test "$LINK_BINS_DYNAMIC" = yes; then
17545     LIB_LINKAGE=DYN
17546     LT_LIB_LINKAGE=shared
17547 else
17548     LIB_LINKAGE=STAT
17549     LT_LIB_LINKAGE=static
17550 fi
17551
17552 if test "$ac_cv_mingw32" = yes ; then
17553     PLAT=NT
17554     DYN_EXT=dll
17555 else
17556     PLAT=UNIX
17557     DYN_EXT=so
17558 fi
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568   
17569   
17570   
17571   
17572   
17573   
17574   
17575   
17576   
17577   
17578   
17579   
17580   
17581   
17582   
17583   
17584   
17585   
17586   
17587   
17588   
17589   
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627 trap '' 1 2 15
17628
17629 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17630
17631 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17632 # Let make expand exec_prefix.
17633 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17634
17635 # Any assignment to VPATH causes Sun make to only execute
17636 # the first set of double-colon rules, so remove it if not needed.
17637 # If there is a colon in the path, we need to keep it.
17638 if test "x$srcdir" = x.; then
17639   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17640 fi
17641
17642 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17643
17644 DEFS=-DHAVE_CONFIG_H
17645
17646 # Without the "./", some shells look in PATH for config.status.
17647 : ${CONFIG_STATUS=./config.status}
17648
17649 echo creating $CONFIG_STATUS
17650 rm -f $CONFIG_STATUS
17651 cat > $CONFIG_STATUS <<EOF
17652 #! /bin/sh
17653 # Generated automatically by configure.
17654 # Run this file to recreate the current configuration.
17655 # This directory was configured as follows,
17656 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17657 #
17658 # $0 $ac_configure_args
17659 #
17660 # Compiler output produced by configure, useful for debugging
17661 # configure, is in ./config.log if it exists.
17662
17663 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17664 for ac_option
17665 do
17666   case "\$ac_option" in
17667   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17668     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17669     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17670   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17671     echo "$CONFIG_STATUS generated by autoconf version 2.13"
17672     exit 0 ;;
17673   -help | --help | --hel | --he | --h)
17674     echo "\$ac_cs_usage"; exit 0 ;;
17675   *) echo "\$ac_cs_usage"; exit 1 ;;
17676   esac
17677 done
17678
17679 ac_given_srcdir=$srcdir
17680 ac_given_INSTALL="$INSTALL"
17681
17682 trap 'rm -fr `echo "\
17683 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17684 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17685 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17686 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17687 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17688 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17689 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17690 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17691 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17692 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17693 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17694 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17695 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17696 include/Makefile:build/top.mk:include/Makefile.in \
17697 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17698 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17699 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17700 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17701 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17702 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17703 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17704 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17705 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17706 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17707 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17708 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17709 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17710 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17711 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17712 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17713 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17714 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
17715 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17716 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17717 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17718 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17719 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17720 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17721 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17722 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17723 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17724 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17725 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17726 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17727  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17728 EOF
17729 cat >> $CONFIG_STATUS <<EOF
17730
17731 # Protect against being on the right side of a sed subst in config.status.
17732 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17733  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17734 $ac_vpsub
17735 $extrasub
17736 s%@SHELL@%$SHELL%g
17737 s%@CFLAGS@%$CFLAGS%g
17738 s%@CPPFLAGS@%$CPPFLAGS%g
17739 s%@CXXFLAGS@%$CXXFLAGS%g
17740 s%@FFLAGS@%$FFLAGS%g
17741 s%@DEFS@%$DEFS%g
17742 s%@LDFLAGS@%$LDFLAGS%g
17743 s%@LIBS@%$LIBS%g
17744 s%@exec_prefix@%$exec_prefix%g
17745 s%@prefix@%$prefix%g
17746 s%@program_transform_name@%$program_transform_name%g
17747 s%@bindir@%$bindir%g
17748 s%@sbindir@%$sbindir%g
17749 s%@libexecdir@%$libexecdir%g
17750 s%@datadir@%$datadir%g
17751 s%@sysconfdir@%$sysconfdir%g
17752 s%@sharedstatedir@%$sharedstatedir%g
17753 s%@localstatedir@%$localstatedir%g
17754 s%@libdir@%$libdir%g
17755 s%@includedir@%$includedir%g
17756 s%@oldincludedir@%$oldincludedir%g
17757 s%@infodir@%$infodir%g
17758 s%@mandir@%$mandir%g
17759 s%@host@%$host%g
17760 s%@host_alias@%$host_alias%g
17761 s%@host_cpu@%$host_cpu%g
17762 s%@host_vendor@%$host_vendor%g
17763 s%@host_os@%$host_os%g
17764 s%@target@%$target%g
17765 s%@target_alias@%$target_alias%g
17766 s%@target_cpu@%$target_cpu%g
17767 s%@target_vendor@%$target_vendor%g
17768 s%@target_os@%$target_os%g
17769 s%@build@%$build%g
17770 s%@build_alias@%$build_alias%g
17771 s%@build_cpu@%$build_cpu%g
17772 s%@build_vendor@%$build_vendor%g
17773 s%@build_os@%$build_os%g
17774 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17775 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17776 s%@INSTALL_DATA@%$INSTALL_DATA%g
17777 s%@PACKAGE@%$PACKAGE%g
17778 s%@VERSION@%$VERSION%g
17779 s%@ACLOCAL@%$ACLOCAL%g
17780 s%@AUTOCONF@%$AUTOCONF%g
17781 s%@AUTOMAKE@%$AUTOMAKE%g
17782 s%@AUTOHEADER@%$AUTOHEADER%g
17783 s%@MAKEINFO@%$MAKEINFO%g
17784 s%@install_sh@%$install_sh%g
17785 s%@AMTAR@%$AMTAR%g
17786 s%@AWK@%$AWK%g
17787 s%@AMTARFLAGS@%$AMTARFLAGS%g
17788 s%@SET_MAKE@%$SET_MAKE%g
17789 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
17790 s%@top_builddir@%$top_builddir%g
17791 s%@ldap_subdir@%$ldap_subdir%g
17792 s%@CC@%$CC%g
17793 s%@RANLIB@%$RANLIB%g
17794 s%@LN_S@%$LN_S%g
17795 s%@DLLTOOL@%$DLLTOOL%g
17796 s%@AS@%$AS%g
17797 s%@OBJDUMP@%$OBJDUMP%g
17798 s%@LIBTOOL@%$LIBTOOL%g
17799 s%@LN_H@%$LN_H%g
17800 s%@SENDMAIL@%$SENDMAIL%g
17801 s%@EDITOR@%$EDITOR%g
17802 s%@FINGER@%$FINGER%g
17803 s%@PERLBIN@%$PERLBIN%g
17804 s%@CPP@%$CPP%g
17805 s%@EXEEXT@%$EXEEXT%g
17806 s%@OBJEXT@%$OBJEXT%g
17807 s%@OL_MKDEP@%$OL_MKDEP%g
17808 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17809 s%@LIBOBJS@%$LIBOBJS%g
17810 s%@LIBSRCS@%$LIBSRCS%g
17811 s%@PLAT@%$PLAT%g
17812 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17813 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17814 s%@DYN_EXT@%$DYN_EXT%g
17815 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17816 s%@BUILD_BDB@%$BUILD_BDB%g
17817 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17818 s%@BUILD_LDAP@%$BUILD_LDAP%g
17819 s%@BUILD_LDBM@%$BUILD_LDBM%g
17820 s%@BUILD_META@%$BUILD_META%g
17821 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
17822 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17823 s%@BUILD_PERL@%$BUILD_PERL%g
17824 s%@BUILD_SHELL@%$BUILD_SHELL%g
17825 s%@BUILD_SQL@%$BUILD_SQL%g
17826 s%@BUILD_TCL@%$BUILD_TCL%g
17827 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
17828 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17829 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17830 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17831 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
17832 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
17833 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17834 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
17835 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17836 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17837 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
17838 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17839 s%@LDAP_LIBS@%$LDAP_LIBS%g
17840 s%@LDIF_LIBS@%$LDIF_LIBS%g
17841 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17842 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17843 s%@LDBM_LIBS@%$LDBM_LIBS%g
17844 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17845 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17846 s%@WRAP_LIBS@%$WRAP_LIBS%g
17847 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
17848 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17849 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17850 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17851 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17852 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
17853 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
17854 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
17855 s%@KRB4_LIBS@%$KRB4_LIBS%g
17856 s%@KRB5_LIBS@%$KRB5_LIBS%g
17857 s%@READLINE_LIBS@%$READLINE_LIBS%g
17858 s%@SASL_LIBS@%$SASL_LIBS%g
17859 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17860 s%@TLS_LIBS@%$TLS_LIBS%g
17861 s%@MODULES_LIBS@%$MODULES_LIBS%g
17862 s%@AUTH_LIBS@%$AUTH_LIBS%g
17863 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
17864 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17865 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17866 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17867
17868 CEOF
17869 EOF
17870
17871 cat >> $CONFIG_STATUS <<\EOF
17872
17873 # Split the substitutions into bite-sized pieces for seds with
17874 # small command number limits, like on Digital OSF/1 and HP-UX.
17875 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17876 ac_file=1 # Number of current file.
17877 ac_beg=1 # First line for current file.
17878 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17879 ac_more_lines=:
17880 ac_sed_cmds=""
17881 while $ac_more_lines; do
17882   if test $ac_beg -gt 1; then
17883     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17884   else
17885     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17886   fi
17887   if test ! -s conftest.s$ac_file; then
17888     ac_more_lines=false
17889     rm -f conftest.s$ac_file
17890   else
17891     if test -z "$ac_sed_cmds"; then
17892       ac_sed_cmds="sed -f conftest.s$ac_file"
17893     else
17894       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17895     fi
17896     ac_file=`expr $ac_file + 1`
17897     ac_beg=$ac_end
17898     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17899   fi
17900 done
17901 if test -z "$ac_sed_cmds"; then
17902   ac_sed_cmds=cat
17903 fi
17904 EOF
17905
17906 cat >> $CONFIG_STATUS <<EOF
17907
17908 CONFIG_FILES=\${CONFIG_FILES-"\
17909 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17910 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17911 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17912 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17913 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17914 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17915 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17916 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17917 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17918 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17919 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17920 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17921 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17922 include/Makefile:build/top.mk:include/Makefile.in \
17923 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17924 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17925 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17926 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17927 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17928 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17929 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17930 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17931 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17932 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17933 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17934 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17935 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17936 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17937 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17938 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17939 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17940 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
17941 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17942 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17943 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17944 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17945 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17946 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17947 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17948 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17949 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17950 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17951 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17952 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17953 "}
17954 EOF
17955 cat >> $CONFIG_STATUS <<\EOF
17956 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17957   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17958   case "$ac_file" in
17959   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17960        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17961   *) ac_file_in="${ac_file}.in" ;;
17962   esac
17963
17964   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17965
17966   # Remove last slash and all that follows it.  Not all systems have dirname.
17967   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17968   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17969     # The file is in a subdirectory.
17970     test ! -d "$ac_dir" && mkdir "$ac_dir"
17971     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17972     # A "../" for each directory in $ac_dir_suffix.
17973     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17974   else
17975     ac_dir_suffix= ac_dots=
17976   fi
17977
17978   case "$ac_given_srcdir" in
17979   .)  srcdir=.
17980       if test -z "$ac_dots"; then top_srcdir=.
17981       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17982   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17983   *) # Relative path.
17984     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17985     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17986   esac
17987
17988   case "$ac_given_INSTALL" in
17989   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17990   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17991   esac
17992
17993   echo creating "$ac_file"
17994   rm -f "$ac_file"
17995   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17996   case "$ac_file" in
17997   *Makefile*) ac_comsub="1i\\
17998 # $configure_input" ;;
17999   *) ac_comsub= ;;
18000   esac
18001
18002   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18003   sed -e "$ac_comsub
18004 s%@configure_input@%$configure_input%g
18005 s%@srcdir@%$srcdir%g
18006 s%@top_srcdir@%$top_srcdir%g
18007 s%@INSTALL@%$INSTALL%g
18008 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18009 fi; done
18010 rm -f conftest.s*
18011
18012 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18013 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18014 #
18015 # ac_d sets the value in "#define NAME VALUE" lines.
18016 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18017 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18018 ac_dC='\3'
18019 ac_dD='%g'
18020 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18021 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18022 ac_uB='\([      ]\)%\1#\2define\3'
18023 ac_uC=' '
18024 ac_uD='\4%g'
18025 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18026 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18027 ac_eB='$%\1#\2define\3'
18028 ac_eC=' '
18029 ac_eD='%g'
18030
18031 if test "${CONFIG_HEADERS+set}" != set; then
18032 EOF
18033 cat >> $CONFIG_STATUS <<EOF
18034   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18035 EOF
18036 cat >> $CONFIG_STATUS <<\EOF
18037 fi
18038 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18039   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18040   case "$ac_file" in
18041   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18042        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18043   *) ac_file_in="${ac_file}.in" ;;
18044   esac
18045
18046   echo creating $ac_file
18047
18048   rm -f conftest.frag conftest.in conftest.out
18049   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18050   cat $ac_file_inputs > conftest.in
18051
18052 EOF
18053
18054 # Transform confdefs.h into a sed script conftest.vals that substitutes
18055 # the proper values into config.h.in to produce config.h.  And first:
18056 # Protect against being on the right side of a sed subst in config.status.
18057 # Protect against being in an unquoted here document in config.status.
18058 rm -f conftest.vals
18059 cat > conftest.hdr <<\EOF
18060 s/[\\&%]/\\&/g
18061 s%[\\$`]%\\&%g
18062 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18063 s%ac_d%ac_u%gp
18064 s%ac_u%ac_e%gp
18065 EOF
18066 sed -n -f conftest.hdr confdefs.h > conftest.vals
18067 rm -f conftest.hdr
18068
18069 # This sed command replaces #undef with comments.  This is necessary, for
18070 # example, in the case of _POSIX_SOURCE, which is predefined and required
18071 # on some systems where configure will not decide to define it.
18072 cat >> conftest.vals <<\EOF
18073 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18074 EOF
18075
18076 # Break up conftest.vals because some shells have a limit on
18077 # the size of here documents, and old seds have small limits too.
18078
18079 rm -f conftest.tail
18080 while :
18081 do
18082   ac_lines=`grep -c . conftest.vals`
18083   # grep -c gives empty output for an empty file on some AIX systems.
18084   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18085   # Write a limited-size here document to conftest.frag.
18086   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18087   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18088   echo 'CEOF
18089   sed -f conftest.frag conftest.in > conftest.out
18090   rm -f conftest.in
18091   mv conftest.out conftest.in
18092 ' >> $CONFIG_STATUS
18093   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18094   rm -f conftest.vals
18095   mv conftest.tail conftest.vals
18096 done
18097 rm -f conftest.vals
18098
18099 cat >> $CONFIG_STATUS <<\EOF
18100   rm -f conftest.frag conftest.h
18101   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18102   cat conftest.in >> conftest.h
18103   rm -f conftest.in
18104   if cmp -s $ac_file conftest.h 2>/dev/null; then
18105     echo "$ac_file is unchanged"
18106     rm -f conftest.h
18107   else
18108     # Remove last slash and all that follows it.  Not all systems have dirname.
18109       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18110       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18111       # The file is in a subdirectory.
18112       test ! -d "$ac_dir" && mkdir "$ac_dir"
18113     fi
18114     rm -f $ac_file
18115     mv conftest.h $ac_file
18116   fi
18117 fi; done
18118
18119 EOF
18120 cat >> $CONFIG_STATUS <<EOF
18121
18122 EOF
18123 cat >> $CONFIG_STATUS <<\EOF
18124
18125 date > stamp-h
18126 echo Please \"make depend\" to build dependencies
18127
18128 exit 0
18129 EOF
18130 chmod +x $CONFIG_STATUS
18131 rm -fr confdefs* $ac_clean_files
18132 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
18133