]> git.sur5r.net Git - openldap/blob - configure
temporary variable erroneously inside #ifdef (ITS#1503)
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.385 2001/12/18 01:54:49 hyc Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-rewrite        enable rewrite [no]"
48 ac_help="$ac_help
49   --enable-x-compile      enable cross compiling [no]"
50 ac_help="$ac_help
51   --with-cyrus-sasl       with Cyrus SASL support [auto]"
52 ac_help="$ac_help
53   --with-fetch            with fetch URL support [auto]"
54 ac_help="$ac_help
55   --with-kerberos         with Kerberos support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65 SLAPD (Standalone LDAP Daemon) Options:"
66 ac_help="$ac_help
67   --enable-slapd          enable building slapd [yes]"
68 ac_help="$ac_help
69     --enable-aci          enable per-object ACIs (experimental) [no]"
70 ac_help="$ac_help
71     --enable-cleartext    enable cleartext passwords [yes]"
72 ac_help="$ac_help
73     --enable-crypt        enable crypt(3) passwords [no]"
74 ac_help="$ac_help
75     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
76 ac_help="$ac_help
77     --enable-kpasswd      enable Kerberos password verification [no]"
78 ac_help="$ac_help
79     --enable-lmpasswd     enable LAN Manager passwords [no]"
80 ac_help="$ac_help
81     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
82 ac_help="$ac_help
83     --enable-modules      enable dynamic module support [no]"
84 ac_help="$ac_help
85     --enable-phonetic     enable phonetic/soundex [no]"
86 ac_help="$ac_help
87     --enable-rlookups     enable reverse lookups [no]"
88 ac_help="$ac_help
89     --enable-slp          enable SLPv2 support [no]"
90 ac_help="$ac_help
91     --enable-wrappers     enable tcp wrapper support [no]"
92 ac_help="$ac_help
93     --enable-bdb          enable Berkeley DB backend [no]"
94 ac_help="$ac_help
95     --with-bdb-module     module type [static]"
96 ac_help="$ac_help
97     --enable-dnssrv       enable dnssrv backend [no]"
98 ac_help="$ac_help
99     --with-dnssrv-module  module type [static]"
100 ac_help="$ac_help
101     --enable-ldap         enable ldap backend [no]"
102 ac_help="$ac_help
103     --with-ldap-module    module type [static]"
104 ac_help="$ac_help
105     --enable-ldbm         enable ldbm backend [yes]"
106 ac_help="$ac_help
107     --with-ldbm-api       with LDBM API [auto]"
108 ac_help="$ac_help
109     --with-ldbm-module    module type [static]"
110 ac_help="$ac_help
111     --with-ldbm-type      use LDBM type [auto]"
112 ac_help="$ac_help
113     --enable-meta         enable metadirectory backend [no]"
114 ac_help="$ac_help
115     --with-meta-module    module type [static]"
116 ac_help="$ac_help
117     --enable-monitor      enable monitor backend [no]"
118 ac_help="$ac_help
119     --with-monitor-module module type [static]"
120 ac_help="$ac_help
121     --enable-passwd       enable passwd backend [no]"
122 ac_help="$ac_help
123     --with-passwd-module  module type [static]"
124 ac_help="$ac_help
125     --enable-perl         enable perl backend [no]"
126 ac_help="$ac_help
127     --with-perl-module    module type [static]"
128 ac_help="$ac_help
129     --enable-shell        enable shell backend [no]"
130 ac_help="$ac_help
131     --with-shell-module   module type [static]"
132 ac_help="$ac_help
133     --enable-sql          enable sql backend [no]"
134 ac_help="$ac_help
135     --with-sql-module     module type [static]"
136 ac_help="$ac_help
137     --enable-tcl          enable tcl backend [no]"
138 ac_help="$ac_help
139     --with-tcl-module     module type [static]"
140 ac_help="$ac_help
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145 Library Generation & Linking Options"
146 ac_help="$ac_help
147   --enable-static[=PKGS]  build static libraries [default=yes]"
148 ac_help="$ac_help
149   --enable-shared[=PKGS]  build shared libraries [default=yes]"
150 ac_help="$ac_help
151   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
152 ac_help="$ac_help
153   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
154 ac_help="$ac_help
155   --disable-libtool-lock  avoid locking (might break parallel builds)"
156
157 # Initialize some variables set by options.
158 # The variables have the same names as the options, with
159 # dashes changed to underlines.
160 build=NONE
161 cache_file=./config.cache
162 exec_prefix=NONE
163 host=NONE
164 no_create=
165 nonopt=NONE
166 no_recursion=
167 prefix=NONE
168 program_prefix=NONE
169 program_suffix=NONE
170 program_transform_name=s,x,x,
171 silent=
172 site=
173 srcdir=
174 target=NONE
175 verbose=
176 x_includes=NONE
177 x_libraries=NONE
178 bindir='${exec_prefix}/bin'
179 sbindir='${exec_prefix}/sbin'
180 libexecdir='${exec_prefix}/libexec'
181 datadir='${prefix}/share'
182 sysconfdir='${prefix}/etc'
183 sharedstatedir='${prefix}/com'
184 localstatedir='${prefix}/var'
185 libdir='${exec_prefix}/lib'
186 includedir='${prefix}/include'
187 oldincludedir='/usr/include'
188 infodir='${prefix}/info'
189 mandir='${prefix}/man'
190
191 # Initialize some other variables.
192 subdirs=
193 MFLAGS= MAKEFLAGS=
194 SHELL=${CONFIG_SHELL-/bin/sh}
195 # Maximum number of lines to put in a shell here document.
196 ac_max_here_lines=12
197
198 ac_prev=
199 for ac_option
200 do
201
202   # If the previous option needs an argument, assign it.
203   if test -n "$ac_prev"; then
204     eval "$ac_prev=\$ac_option"
205     ac_prev=
206     continue
207   fi
208
209   case "$ac_option" in
210   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
211   *) ac_optarg= ;;
212   esac
213
214   # Accept the important Cygnus configure options, so we can diagnose typos.
215
216   case "$ac_option" in
217
218   -bindir | --bindir | --bindi | --bind | --bin | --bi)
219     ac_prev=bindir ;;
220   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
221     bindir="$ac_optarg" ;;
222
223   -build | --build | --buil | --bui | --bu)
224     ac_prev=build ;;
225   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
226     build="$ac_optarg" ;;
227
228   -cache-file | --cache-file | --cache-fil | --cache-fi \
229   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
230     ac_prev=cache_file ;;
231   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
232   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
233     cache_file="$ac_optarg" ;;
234
235   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
236     ac_prev=datadir ;;
237   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
238   | --da=*)
239     datadir="$ac_optarg" ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
243     # Reject names that are not valid shell variable names.
244     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
245       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
246     fi
247     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
248     eval "enable_${ac_feature}=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
252     # Reject names that are not valid shell variable names.
253     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
254       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
255     fi
256     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
257     case "$ac_option" in
258       *=*) ;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_${ac_feature}='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix="$ac_optarg" ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he)
277     # Omit some internal or obsolete options to make the list less imposing.
278     # This message is too long to be a string in the A/UX 3.1 sh.
279     cat << EOF
280 Usage: configure [options] [host]
281 Options: [defaults in brackets after descriptions]
282 Configuration:
283   --cache-file=FILE       cache test results in FILE
284   --help                  print this message
285   --no-create             do not create output files
286   --quiet, --silent       do not print \`checking...' messages
287   --version               print the version of autoconf that created configure
288 Directory and file names:
289   --prefix=PREFIX         install architecture-independent files in PREFIX
290                           [$ac_default_prefix]
291   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
292                           [same as prefix]
293   --bindir=DIR            user executables in DIR [EPREFIX/bin]
294   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
295   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
296   --datadir=DIR           read-only architecture-independent data in DIR
297                           [PREFIX/share]
298   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
299   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
300                           [PREFIX/com]
301   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
302   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
303   --includedir=DIR        C header files in DIR [PREFIX/include]
304   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
305   --infodir=DIR           info documentation in DIR [PREFIX/info]
306   --mandir=DIR            man documentation in DIR [PREFIX/man]
307   --srcdir=DIR            find the sources in DIR [configure dir or ..]
308   --program-prefix=PREFIX prepend PREFIX to installed program names
309   --program-suffix=SUFFIX append SUFFIX to installed program names
310   --program-transform-name=PROGRAM
311                           run sed PROGRAM on installed program names
312 EOF
313     cat << EOF
314 Host type:
315   --build=BUILD           configure for building on BUILD [BUILD=HOST]
316   --host=HOST             configure for HOST [guessed]
317   --target=TARGET         configure for TARGET [TARGET=HOST]
318 Features and packages:
319   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
320   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
321   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
322   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
323   --x-includes=DIR        X include files are in DIR
324   --x-libraries=DIR       X library files are in DIR
325 EOF
326     if test -n "$ac_help"; then
327       echo "--enable and --with options recognized:$ac_help"
328     fi
329     exit 0 ;;
330
331   -host | --host | --hos | --ho)
332     ac_prev=host ;;
333   -host=* | --host=* | --hos=* | --ho=*)
334     host="$ac_optarg" ;;
335
336   -includedir | --includedir | --includedi | --included | --include \
337   | --includ | --inclu | --incl | --inc)
338     ac_prev=includedir ;;
339   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
340   | --includ=* | --inclu=* | --incl=* | --inc=*)
341     includedir="$ac_optarg" ;;
342
343   -infodir | --infodir | --infodi | --infod | --info | --inf)
344     ac_prev=infodir ;;
345   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
346     infodir="$ac_optarg" ;;
347
348   -libdir | --libdir | --libdi | --libd)
349     ac_prev=libdir ;;
350   -libdir=* | --libdir=* | --libdi=* | --libd=*)
351     libdir="$ac_optarg" ;;
352
353   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
354   | --libexe | --libex | --libe)
355     ac_prev=libexecdir ;;
356   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
357   | --libexe=* | --libex=* | --libe=*)
358     libexecdir="$ac_optarg" ;;
359
360   -localstatedir | --localstatedir | --localstatedi | --localstated \
361   | --localstate | --localstat | --localsta | --localst \
362   | --locals | --local | --loca | --loc | --lo)
363     ac_prev=localstatedir ;;
364   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
365   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
366   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
367     localstatedir="$ac_optarg" ;;
368
369   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
370     ac_prev=mandir ;;
371   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
372     mandir="$ac_optarg" ;;
373
374   -nfp | --nfp | --nf)
375     # Obsolete; use --without-fp.
376     with_fp=no ;;
377
378   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
379   | --no-cr | --no-c)
380     no_create=yes ;;
381
382   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
383   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
384     no_recursion=yes ;;
385
386   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
387   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
388   | --oldin | --oldi | --old | --ol | --o)
389     ac_prev=oldincludedir ;;
390   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
391   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
392   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
393     oldincludedir="$ac_optarg" ;;
394
395   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
396     ac_prev=prefix ;;
397   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
398     prefix="$ac_optarg" ;;
399
400   -program-prefix | --program-prefix | --program-prefi | --program-pref \
401   | --program-pre | --program-pr | --program-p)
402     ac_prev=program_prefix ;;
403   -program-prefix=* | --program-prefix=* | --program-prefi=* \
404   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
405     program_prefix="$ac_optarg" ;;
406
407   -program-suffix | --program-suffix | --program-suffi | --program-suff \
408   | --program-suf | --program-su | --program-s)
409     ac_prev=program_suffix ;;
410   -program-suffix=* | --program-suffix=* | --program-suffi=* \
411   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
412     program_suffix="$ac_optarg" ;;
413
414   -program-transform-name | --program-transform-name \
415   | --program-transform-nam | --program-transform-na \
416   | --program-transform-n | --program-transform- \
417   | --program-transform | --program-transfor \
418   | --program-transfo | --program-transf \
419   | --program-trans | --program-tran \
420   | --progr-tra | --program-tr | --program-t)
421     ac_prev=program_transform_name ;;
422   -program-transform-name=* | --program-transform-name=* \
423   | --program-transform-nam=* | --program-transform-na=* \
424   | --program-transform-n=* | --program-transform-=* \
425   | --program-transform=* | --program-transfor=* \
426   | --program-transfo=* | --program-transf=* \
427   | --program-trans=* | --program-tran=* \
428   | --progr-tra=* | --program-tr=* | --program-t=*)
429     program_transform_name="$ac_optarg" ;;
430
431   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
432   | -silent | --silent | --silen | --sile | --sil)
433     silent=yes ;;
434
435   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
436     ac_prev=sbindir ;;
437   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
438   | --sbi=* | --sb=*)
439     sbindir="$ac_optarg" ;;
440
441   -sharedstatedir | --sharedstatedir | --sharedstatedi \
442   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
443   | --sharedst | --shareds | --shared | --share | --shar \
444   | --sha | --sh)
445     ac_prev=sharedstatedir ;;
446   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
447   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
448   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
449   | --sha=* | --sh=*)
450     sharedstatedir="$ac_optarg" ;;
451
452   -site | --site | --sit)
453     ac_prev=site ;;
454   -site=* | --site=* | --sit=*)
455     site="$ac_optarg" ;;
456
457   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
458     ac_prev=srcdir ;;
459   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
460     srcdir="$ac_optarg" ;;
461
462   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
463   | --syscon | --sysco | --sysc | --sys | --sy)
464     ac_prev=sysconfdir ;;
465   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
466   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
467     sysconfdir="$ac_optarg" ;;
468
469   -target | --target | --targe | --targ | --tar | --ta | --t)
470     ac_prev=target ;;
471   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
472     target="$ac_optarg" ;;
473
474   -v | -verbose | --verbose | --verbos | --verbo | --verb)
475     verbose=yes ;;
476
477   -version | --version | --versio | --versi | --vers)
478     echo "configure generated by autoconf version 2.13.1"
479     exit 0 ;;
480
481   -with-* | --with-*)
482     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
483     # Reject names that are not valid shell variable names.
484     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
485       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
486     fi
487     ac_package=`echo $ac_package| sed 's/-/_/g'`
488     case "$ac_option" in
489       *=*) ;;
490       *) ac_optarg=yes ;;
491     esac
492     eval "with_${ac_package}='$ac_optarg'" ;;
493
494   -without-* | --without-*)
495     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
496     # Reject names that are not valid shell variable names.
497     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
498       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
499     fi
500     ac_package=`echo $ac_package| sed 's/-/_/g'`
501     eval "with_${ac_package}=no" ;;
502
503   --x)
504     # Obsolete; use --with-x.
505     with_x=yes ;;
506
507   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
508   | --x-incl | --x-inc | --x-in | --x-i)
509     ac_prev=x_includes ;;
510   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
511   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
512     x_includes="$ac_optarg" ;;
513
514   -x-libraries | --x-libraries | --x-librarie | --x-librari \
515   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
516     ac_prev=x_libraries ;;
517   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
518   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
519     x_libraries="$ac_optarg" ;;
520
521   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
522     ;;
523
524   *)
525     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
526       echo "configure: warning: $ac_option: invalid host type" 1>&2
527     fi
528     if test "x$nonopt" != xNONE; then
529       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
530     fi
531     nonopt="$ac_option"
532     ;;
533
534   esac
535 done
536
537 if test -n "$ac_prev"; then
538   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
539 fi
540
541 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
542
543 # File descriptor usage:
544 # 0 standard input
545 # 1 file creation
546 # 2 errors and warnings
547 # 3 some systems may open it to /dev/tty
548 # 4 used on the Kubota Titan
549 # 6 checking for... messages and results
550 # 5 compiler messages saved in config.log
551 if test "$silent" = yes; then
552   exec 6>/dev/null
553 else
554   exec 6>&1
555 fi
556 exec 5>./config.log
557
558 echo "\
559 This file contains any messages produced by compilers while
560 running configure, to aid debugging if configure makes a mistake.
561 " 1>&5
562
563 # Strip out --no-create and --no-recursion so they do not pile up.
564 # Also quote any args containing shell metacharacters.
565 ac_configure_args=
566 for ac_arg
567 do
568   case "$ac_arg" in
569   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
570   | --no-cr | --no-c) ;;
571   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
572   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
573   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
574   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
575   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
576   esac
577 done
578
579 # NLS nuisances.
580 # Only set these to C if already set.  These must not be set unconditionally
581 # because not all systems understand e.g. LANG=C (notably SCO).
582 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
583 # Non-C LC_CTYPE values break the ctype check.
584 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
585 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
586 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
587 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
588
589 # confdefs.h avoids OS command line length limits that DEFS can exceed.
590 rm -rf conftest* confdefs.h
591 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
592 echo > confdefs.h
593
594 # A filename unique to this package, relative to the directory that
595 # configure is in, which we can look for to find out if srcdir is correct.
596 ac_unique_file=build/version.sh
597
598 # Find the source files, if location was not specified.
599 if test -z "$srcdir"; then
600   ac_srcdir_defaulted=yes
601   # Try the directory containing this script, then its parent.
602   ac_prog=$0
603   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
604   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
605   srcdir=$ac_confdir
606   if test ! -r $srcdir/$ac_unique_file; then
607     srcdir=..
608   fi
609 else
610   ac_srcdir_defaulted=no
611 fi
612 if test ! -r $srcdir/$ac_unique_file; then
613   if test "$ac_srcdir_defaulted" = yes; then
614     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
615   else
616     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
617   fi
618 fi
619 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
620
621 # Prefer explicitly selected file to automatically selected ones.
622 if test -z "$CONFIG_SITE"; then
623   if test "x$prefix" != xNONE; then
624     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
625   else
626     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
627   fi
628 fi
629 for ac_site_file in $CONFIG_SITE; do
630   if test -r "$ac_site_file"; then
631     echo "loading site script $ac_site_file"
632     . "$ac_site_file"
633   fi
634 done
635
636
637 ac_ext=c
638 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
639 ac_cpp='$CPP $CPPFLAGS'
640 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
641 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
642 cross_compiling=$ac_cv_prog_cc_cross
643
644 ac_exeext=
645 ac_objext=o
646 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
647   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
648   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
649     ac_n= ac_c='
650 ' ac_t='        '
651   else
652     ac_n=-n ac_c= ac_t=
653   fi
654 else
655   ac_n= ac_c='\c' ac_t=
656 fi
657
658
659 # set unset (borrowed from autoconf 2.49c)
660 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
661   ol_unset=unset
662 else
663   ol_unset=false
664 fi
665 # unset CDPATH
666 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
667
668 ac_aux_dir=
669 for ac_dir in build $srcdir/build; do
670   if test -f $ac_dir/install-sh; then
671     ac_aux_dir=$ac_dir
672     ac_install_sh="$ac_aux_dir/install-sh -c"
673     break
674   elif test -f $ac_dir/install.sh; then
675     ac_aux_dir=$ac_dir
676     ac_install_sh="$ac_aux_dir/install.sh -c"
677     break
678   elif test -f $ac_dir/shtool; then
679     ac_aux_dir=$ac_dir
680     ac_install_sh="$ac_aux_dir/shtool install -c"
681     break
682   fi
683 done
684 if test -z "$ac_aux_dir"; then
685   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
686 fi
687 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
688 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
689 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
690
691 eval `$ac_aux_dir/version.sh`
692 if test -z "$OL_STRING"; then
693         { echo "configure: error: could not determine version" 1>&2; exit 1; }
694 fi
695
696 echo "Configuring $OL_STRING ..."
697
698
699 echo $ac_n "checking host system type""... $ac_c" 1>&6
700 echo "configure:701: checking host system type" >&5
701 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
702
703 # Make sure we can run config.sub.
704   if $ac_config_sub sun4 >/dev/null 2>&1; then :
705     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
706   fi
707
708   ac_cv_host_alias=$host
709   case "$ac_cv_host_alias" in
710   NONE)
711     case $nonopt in
712     NONE)
713       if ac_cv_host_alias=`$ac_config_guess`; then :
714       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
715       fi ;;
716     *) ac_cv_host_alias=$nonopt ;;
717     esac ;;
718   esac
719
720   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
721   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
722   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
723   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
724 else
725   echo $ac_n "(cached) $ac_c" 1>&6
726 fi
727
728 echo "$ac_t""$ac_cv_host" 1>&6
729
730 host=$ac_cv_host
731 host_alias=$ac_cv_host_alias
732 host_cpu=$ac_cv_host_cpu
733 host_vendor=$ac_cv_host_vendor
734 host_os=$ac_cv_host_os
735
736
737
738
739
740 echo $ac_n "checking target system type""... $ac_c" 1>&6
741 echo "configure:742: checking target system type" >&5
742 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
743
744 # Make sure we can run config.sub.
745   if $ac_config_sub sun4 >/dev/null 2>&1; then :
746     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
747   fi
748
749   ac_cv_target_alias=$target
750   case "$ac_cv_target_alias" in
751   NONE)
752     case $nonopt in
753     NONE)
754       ac_cv_target_alias=$host_alias ;;
755
756     *) ac_cv_target_alias=$nonopt ;;
757     esac ;;
758   esac
759
760   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
761   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
762   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
763   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
764 else
765   echo $ac_n "(cached) $ac_c" 1>&6
766 fi
767
768 echo "$ac_t""$ac_cv_target" 1>&6
769
770 target=$ac_cv_target
771 target_alias=$ac_cv_target_alias
772 target_cpu=$ac_cv_target_cpu
773 target_vendor=$ac_cv_target_vendor
774 target_os=$ac_cv_target_os
775
776
777
778
779
780 echo $ac_n "checking build system type""... $ac_c" 1>&6
781 echo "configure:782: checking build system type" >&5
782 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
783
784 # Make sure we can run config.sub.
785   if $ac_config_sub sun4 >/dev/null 2>&1; then :
786     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
787   fi
788
789   ac_cv_build_alias=$build
790   case "$ac_cv_build_alias" in
791   NONE)
792     case $nonopt in
793     NONE)
794       ac_cv_build_alias=$host_alias ;;
795
796     *) ac_cv_build_alias=$nonopt ;;
797     esac ;;
798   esac
799
800   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
801   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
802   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
803   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
804 else
805   echo $ac_n "(cached) $ac_c" 1>&6
806 fi
807
808 echo "$ac_t""$ac_cv_build" 1>&6
809
810 build=$ac_cv_build
811 build_alias=$ac_cv_build_alias
812 build_cpu=$ac_cv_build_cpu
813 build_vendor=$ac_cv_build_vendor
814 build_os=$ac_cv_build_os
815
816
817
818
819
820 # Do some error checking and defaulting for the host and target type.
821 # The inputs are:
822 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
823 #
824 # The rules are:
825 # 1. You are not allowed to specify --host, --target, and nonopt at the
826 #    same time.
827 # 2. Host defaults to nonopt.
828 # 3. If nonopt is not specified, then host defaults to the current host,
829 #    as determined by config.guess.
830 # 4. Target and build default to nonopt.
831 # 5. If nonopt is not specified, then target and build default to host.
832
833 # The aliases save the names the user supplied, while $host etc.
834 # will get canonicalized.
835 case $host---$target---$nonopt in
836 NONE---*---* | *---NONE---* | *---*---NONE) ;;
837 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
838 esac
839
840 test "$host_alias" != "$target_alias" &&
841   test "$program_prefix$program_suffix$program_transform_name" = \
842     NONENONEs,x,x, &&
843   program_prefix=${target_alias}-
844
845
846 # Find a good install program.  We prefer a C program (faster),
847 # so one script is as good as another.  But avoid the broken or
848 # incompatible versions:
849 # SysV /etc/install, /usr/sbin/install
850 # SunOS /usr/etc/install
851 # IRIX /sbin/install
852 # AIX /bin/install
853 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
854 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
855 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
856 # ./install, which can be erroneously created by make from ./install.sh.
857 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
858 echo "configure:859: checking for a BSD compatible install" >&5
859 if test -z "$INSTALL"; then
860 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
861   echo $ac_n "(cached) $ac_c" 1>&6
862 else
863     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
864   for ac_dir in $PATH; do
865     # Account for people who put trailing slashes in PATH elements.
866     case "$ac_dir/" in
867     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
868     *)
869       # OSF1 and SCO ODT 3.0 have their own names for install.
870       # Don't use installbsd from OSF since it installs stuff as root
871       # by default.
872       for ac_prog in ginstall scoinst install; do
873         if test -f $ac_dir/$ac_prog; then
874           if test $ac_prog = install &&
875             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
876             # AIX install.  It has an incompatible calling convention.
877             :
878           elif test $ac_prog = install &&
879             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
880             # program-specific install script used by HP pwplus--don't use.
881             :
882           else
883             ac_cv_path_install="$ac_dir/$ac_prog -c"
884             break 2
885           fi
886         fi
887       done
888       ;;
889     esac
890   done
891   IFS="$ac_save_IFS"
892
893 fi
894   if test "${ac_cv_path_install+set}" = set; then
895     INSTALL="$ac_cv_path_install"
896   else
897     # As a last resort, use the slow shell script.  We don't cache a
898     # path for INSTALL within a source directory, because that will
899     # break other packages using the cache if that directory is
900     # removed, or if the path is relative.
901     INSTALL="$ac_install_sh"
902   fi
903 fi
904 echo "$ac_t""$INSTALL" 1>&6
905
906 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
907 # It thinks the first close brace ends the variable substitution.
908 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
909
910 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
911
912 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
913
914 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
915 echo "configure:916: checking whether build environment is sane" >&5
916 # Just in case
917 sleep 1
918 echo timestamp > conftestfile
919 # Do `set' in a subshell so we don't clobber the current shell's
920 # arguments.  Must try -L first in case configure is actually a
921 # symlink; some systems play weird games with the mod time of symlinks
922 # (eg FreeBSD returns the mod time of the symlink's containing
923 # directory).
924 if (
925    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
926    if test "$*" = "X"; then
927       # -L didn't work.
928       set X `ls -t $srcdir/configure conftestfile`
929    fi
930    if test "$*" != "X $srcdir/configure conftestfile" \
931       && test "$*" != "X conftestfile $srcdir/configure"; then
932
933       # If neither matched, then we have a broken ls.  This can happen
934       # if, for instance, CONFIG_SHELL is bash and it inherits a
935       # broken ls alias from the environment.  This has actually
936       # happened.  Such a system could not be considered "sane".
937       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
938 alias in your environment" 1>&2; exit 1; }
939    fi
940
941    test "$2" = conftestfile
942    )
943 then
944    # Ok.
945    :
946 else
947    { echo "configure: error: newly created file is older than distributed files!
948 Check your system clock" 1>&2; exit 1; }
949 fi
950 rm -f conftest*
951 echo "$ac_t""yes" 1>&6
952 if test "$program_transform_name" = s,x,x,; then
953   program_transform_name=
954 else
955   # Double any \ or $.  echo might interpret backslashes.
956   cat <<\EOF_SED > conftestsed
957 s,\\,\\\\,g; s,\$,$$,g
958 EOF_SED
959   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
960   rm -f conftestsed
961 fi
962 test "$program_prefix" != NONE &&
963   program_transform_name="s,^,${program_prefix},;$program_transform_name"
964 # Use a double $ so make ignores it.
965 test "$program_suffix" != NONE &&
966   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
967
968 # sed with no file args requires a program.
969 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
970
971 for ac_prog in mawk gawk nawk awk
972 do
973 # Extract the first word of "$ac_prog", so it can be a program name with args.
974 set dummy $ac_prog; ac_word=$2
975 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
976 echo "configure:977: checking for $ac_word" >&5
977 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   if test -n "$AWK"; then
981   ac_cv_prog_AWK="$AWK" # Let the user override the test.
982 else
983   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
984   ac_dummy="$PATH"
985   for ac_dir in $ac_dummy; do
986     test -z "$ac_dir" && ac_dir=.
987     if test -f $ac_dir/$ac_word; then
988       ac_cv_prog_AWK="$ac_prog"
989       break
990     fi
991   done
992   IFS="$ac_save_ifs"
993 fi
994 fi
995 AWK="$ac_cv_prog_AWK"
996 if test -n "$AWK"; then
997   echo "$ac_t""$AWK" 1>&6
998 else
999   echo "$ac_t""no" 1>&6
1000 fi
1001
1002 test -n "$AWK" && break
1003 done
1004
1005 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether ${MAKE-make} sets \${MAKE}" >&5
1007 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1008 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1009   echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011   cat > conftestmake <<\EOF
1012 all:
1013         @echo 'ac_maketemp="${MAKE}"'
1014 EOF
1015 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1016 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1017 if test -n "$ac_maketemp"; then
1018   eval ac_cv_prog_make_${ac_make}_set=yes
1019 else
1020   eval ac_cv_prog_make_${ac_make}_set=no
1021 fi
1022 rm -f conftestmake
1023 fi
1024 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1025   echo "$ac_t""yes" 1>&6
1026   SET_MAKE=
1027 else
1028   echo "$ac_t""no" 1>&6
1029   SET_MAKE="MAKE=${MAKE-make}"
1030 fi
1031
1032
1033
1034 PACKAGE=$OL_PACKAGE
1035
1036 VERSION=$OL_VERSION
1037
1038 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1039   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1040 fi
1041
1042
1043
1044 missing_dir=`cd $ac_aux_dir && pwd`
1045 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working aclocal" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1051    ACLOCAL=aclocal
1052    echo "$ac_t""found" 1>&6
1053 else
1054    ACLOCAL="$missing_dir/missing aclocal"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoconf" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOCONF=autoconf
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOCONF="$missing_dir/missing autoconf"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working automake" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (automake --version) < /dev/null > /dev/null 2>&1; then
1077    AUTOMAKE=automake
1078    echo "$ac_t""found" 1>&6
1079 else
1080    AUTOMAKE="$missing_dir/missing automake"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1085 echo "configure:1086: checking for working autoheader" >&5
1086 # Run test in a subshell; some versions of sh will print an error if
1087 # an executable is not found, even if stderr is redirected.
1088 # Redirect stdin to placate older versions of autoconf.  Sigh.
1089 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1090    AUTOHEADER=autoheader
1091    echo "$ac_t""found" 1>&6
1092 else
1093    AUTOHEADER="$missing_dir/missing autoheader"
1094    echo "$ac_t""missing" 1>&6
1095 fi
1096
1097 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1098 echo "configure:1099: checking for working makeinfo" >&5
1099 # Run test in a subshell; some versions of sh will print an error if
1100 # an executable is not found, even if stderr is redirected.
1101 # Redirect stdin to placate older versions of autoconf.  Sigh.
1102 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1103    MAKEINFO=makeinfo
1104    echo "$ac_t""found" 1>&6
1105 else
1106    MAKEINFO="$missing_dir/missing makeinfo"
1107    echo "$ac_t""missing" 1>&6
1108 fi
1109
1110 install_sh="$missing_dir/install-sh"
1111 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1112
1113 for ac_prog in gnutar gtar tar
1114 do
1115 # Extract the first word of "$ac_prog", so it can be a program name with args.
1116 set dummy $ac_prog; ac_word=$2
1117 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1118 echo "configure:1119: checking for $ac_word" >&5
1119 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1120   echo $ac_n "(cached) $ac_c" 1>&6
1121 else
1122   if test -n "$AMTAR"; then
1123   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1124 else
1125   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1126   ac_dummy="$PATH"
1127   for ac_dir in $ac_dummy; do
1128     test -z "$ac_dir" && ac_dir=.
1129     if test -f $ac_dir/$ac_word; then
1130       ac_cv_prog_AMTAR="$ac_prog"
1131       break
1132     fi
1133   done
1134   IFS="$ac_save_ifs"
1135 fi
1136 fi
1137 AMTAR="$ac_cv_prog_AMTAR"
1138 if test -n "$AMTAR"; then
1139   echo "$ac_t""$AMTAR" 1>&6
1140 else
1141   echo "$ac_t""no" 1>&6
1142 fi
1143
1144 test -n "$AMTAR" && break
1145 done
1146
1147
1148 AMTARFLAGS=
1149 if test -n "$AMTAR"; then
1150   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1151         AMTARFLAGS=o
1152   fi
1153 fi
1154
1155 cat >> confdefs.h <<EOF
1156 #define OPENLDAP_PACKAGE "$PACKAGE"
1157 EOF
1158
1159 cat >> confdefs.h <<EOF
1160 #define OPENLDAP_VERSION "$VERSION"
1161 EOF
1162
1163
1164 cat >> confdefs.h <<EOF
1165 #define LDAP_VENDOR_VERSION $OL_API_INC
1166 EOF
1167
1168 cat >> confdefs.h <<EOF
1169 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1170 EOF
1171
1172 cat >> confdefs.h <<EOF
1173 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1174 EOF
1175
1176 cat >> confdefs.h <<EOF
1177 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1178 EOF
1179
1180
1181 OPENLDAP_LIBVERSION=$OL_API_LIB
1182
1183
1184
1185 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1186 echo "configure:1187: checking configure arguments" >&5
1187
1188
1189 top_builddir=`pwd`
1190
1191 ldap_subdir="/openldap"
1192
1193 # Check whether --with-subdir or --without-subdir was given.
1194 if test "${with_subdir+set}" = set; then
1195   withval="$with_subdir"
1196   case "$withval" in
1197         no) ldap_subdir=""
1198                 ;;
1199         yes)
1200                 ;;
1201         /*|\\*)
1202                 ldap_subdir="$withval"
1203                 ;;
1204         *)
1205                 ldap_subdir="/$withval"
1206                 ;;
1207 esac
1208
1209 fi
1210
1211
1212 # OpenLDAP --enable-debug
1213         # Check whether --enable-debug or --disable-debug was given.
1214 if test "${enable_debug+set}" = set; then
1215   enableval="$enable_debug"
1216   
1217         ol_arg=invalid
1218         for ol_val in auto yes no ; do
1219                 if test "$enableval" = "$ol_val" ; then
1220                         ol_arg="$ol_val"
1221                 fi
1222         done
1223         if test "$ol_arg" = "invalid" ; then
1224                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1225         fi
1226         ol_enable_debug="$ol_arg"
1227
1228 else
1229         ol_enable_debug="yes"
1230 fi
1231 # end --enable-debug
1232 # OpenLDAP --enable-syslog
1233         # Check whether --enable-syslog or --disable-syslog was given.
1234 if test "${enable_syslog+set}" = set; then
1235   enableval="$enable_syslog"
1236   
1237         ol_arg=invalid
1238         for ol_val in auto yes no ; do
1239                 if test "$enableval" = "$ol_val" ; then
1240                         ol_arg="$ol_val"
1241                 fi
1242         done
1243         if test "$ol_arg" = "invalid" ; then
1244                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1245         fi
1246         ol_enable_syslog="$ol_arg"
1247
1248 else
1249         ol_enable_syslog="auto"
1250 fi
1251 # end --enable-syslog
1252 # OpenLDAP --enable-proctitle
1253         # Check whether --enable-proctitle or --disable-proctitle was given.
1254 if test "${enable_proctitle+set}" = set; then
1255   enableval="$enable_proctitle"
1256   
1257         ol_arg=invalid
1258         for ol_val in auto yes no ; do
1259                 if test "$enableval" = "$ol_val" ; then
1260                         ol_arg="$ol_val"
1261                 fi
1262         done
1263         if test "$ol_arg" = "invalid" ; then
1264                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1265         fi
1266         ol_enable_proctitle="$ol_arg"
1267
1268 else
1269         ol_enable_proctitle="yes"
1270 fi
1271 # end --enable-proctitle
1272 # OpenLDAP --enable-cache
1273         # Check whether --enable-cache or --disable-cache was given.
1274 if test "${enable_cache+set}" = set; then
1275   enableval="$enable_cache"
1276   
1277         ol_arg=invalid
1278         for ol_val in auto yes no ; do
1279                 if test "$enableval" = "$ol_val" ; then
1280                         ol_arg="$ol_val"
1281                 fi
1282         done
1283         if test "$ol_arg" = "invalid" ; then
1284                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1285         fi
1286         ol_enable_cache="$ol_arg"
1287
1288 else
1289         ol_enable_cache="no"
1290 fi
1291 # end --enable-cache
1292 # OpenLDAP --enable-referrals
1293         # Check whether --enable-referrals or --disable-referrals was given.
1294 if test "${enable_referrals+set}" = set; then
1295   enableval="$enable_referrals"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1305         fi
1306         ol_enable_referrals="$ol_arg"
1307
1308 else
1309         ol_enable_referrals="no"
1310 fi
1311 # end --enable-referrals
1312 # OpenLDAP --enable-kbind
1313         # Check whether --enable-kbind or --disable-kbind was given.
1314 if test "${enable_kbind+set}" = set; then
1315   enableval="$enable_kbind"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1325         fi
1326         ol_enable_kbind="$ol_arg"
1327
1328 else
1329         ol_enable_kbind="no"
1330 fi
1331 # end --enable-kbind
1332 # OpenLDAP --enable-ipv6
1333         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1334 if test "${enable_ipv6+set}" = set; then
1335   enableval="$enable_ipv6"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto yes no ; do
1339                 if test "$enableval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1345         fi
1346         ol_enable_ipv6="$ol_arg"
1347
1348 else
1349         ol_enable_ipv6="auto"
1350 fi
1351 # end --enable-ipv6
1352 # OpenLDAP --enable-local
1353         # Check whether --enable-local or --disable-local was given.
1354 if test "${enable_local+set}" = set; then
1355   enableval="$enable_local"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no ; do
1359                 if test "$enableval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1365         fi
1366         ol_enable_local="$ol_arg"
1367
1368 else
1369         ol_enable_local="auto"
1370 fi
1371 # end --enable-local
1372 # OpenLDAP --enable-rewrite
1373         # Check whether --enable-rewrite or --disable-rewrite was given.
1374 if test "${enable_rewrite+set}" = set; then
1375   enableval="$enable_rewrite"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto yes no ; do
1379                 if test "$enableval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1385         fi
1386         ol_enable_rewrite="$ol_arg"
1387
1388 else
1389         ol_enable_rewrite="no"
1390 fi
1391 # end --enable-rewrite
1392 # OpenLDAP --enable-x_compile
1393         # Check whether --enable-x_compile or --disable-x_compile was given.
1394 if test "${enable_x_compile+set}" = set; then
1395   enableval="$enable_x_compile"
1396   
1397         ol_arg=invalid
1398         for ol_val in yes no ; do
1399                 if test "$enableval" = "$ol_val" ; then
1400                         ol_arg="$ol_val"
1401                 fi
1402         done
1403         if test "$ol_arg" = "invalid" ; then
1404                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1405         fi
1406         ol_enable_x_compile="$ol_arg"
1407
1408 else
1409         ol_enable_x_compile="no"
1410 fi
1411 # end --enable-x_compile
1412
1413
1414 # OpenLDAP --with-cyrus_sasl
1415         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1416 if test "${with_cyrus_sasl+set}" = set; then
1417   withval="$with_cyrus_sasl"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no  ; do
1421                 if test "$withval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1427         fi
1428         ol_with_cyrus_sasl="$ol_arg"
1429
1430 else
1431         ol_with_cyrus_sasl="auto"
1432 fi
1433 # end --with-cyrus_sasl
1434
1435 # OpenLDAP --with-fetch
1436         # Check whether --with-fetch or --without-fetch was given.
1437 if test "${with_fetch+set}" = set; then
1438   withval="$with_fetch"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1448         fi
1449         ol_with_fetch="$ol_arg"
1450
1451 else
1452         ol_with_fetch="auto"
1453 fi
1454 # end --with-fetch
1455
1456 # OpenLDAP --with-kerberos
1457         # Check whether --with-kerberos or --without-kerberos was given.
1458 if test "${with_kerberos+set}" = set; then
1459   withval="$with_kerberos"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1469         fi
1470         ol_with_kerberos="$ol_arg"
1471
1472 else
1473         ol_with_kerberos="auto"
1474 fi
1475 # end --with-kerberos
1476
1477 # OpenLDAP --with-readline
1478         # Check whether --with-readline or --without-readline was given.
1479 if test "${with_readline+set}" = set; then
1480   withval="$with_readline"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no  ; do
1484                 if test "$withval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1490         fi
1491         ol_with_readline="$ol_arg"
1492
1493 else
1494         ol_with_readline="auto"
1495 fi
1496 # end --with-readline
1497
1498 # OpenLDAP --with-threads
1499         # Check whether --with-threads or --without-threads was given.
1500 if test "${with_threads+set}" = set; then
1501   withval="$with_threads"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1505                 if test "$withval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1511         fi
1512         ol_with_threads="$ol_arg"
1513
1514 else
1515         ol_with_threads="auto"
1516 fi
1517 # end --with-threads
1518
1519 # OpenLDAP --with-tls
1520         # Check whether --with-tls or --without-tls was given.
1521 if test "${with_tls+set}" = set; then
1522   withval="$with_tls"
1523   
1524         ol_arg=invalid
1525         for ol_val in auto ssleay openssl yes no  ; do
1526                 if test "$withval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1532         fi
1533         ol_with_tls="$ol_arg"
1534
1535 else
1536         ol_with_tls="auto"
1537 fi
1538 # end --with-tls
1539
1540 # OpenLDAP --with-yielding_select
1541         # Check whether --with-yielding_select or --without-yielding_select was given.
1542 if test "${with_yielding_select+set}" = set; then
1543   withval="$with_yielding_select"
1544   
1545         ol_arg=invalid
1546         for ol_val in auto yes no manual  ; do
1547                 if test "$withval" = "$ol_val" ; then
1548                         ol_arg="$ol_val"
1549                 fi
1550         done
1551         if test "$ol_arg" = "invalid" ; then
1552                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1553         fi
1554         ol_with_yielding_select="$ol_arg"
1555
1556 else
1557         ol_with_yielding_select="auto"
1558 fi
1559 # end --with-yielding_select
1560
1561
1562
1563 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1564 if test "${with_xxslapdoptions+set}" = set; then
1565   withval="$with_xxslapdoptions"
1566   :
1567 fi
1568
1569 # OpenLDAP --enable-slapd
1570         # Check whether --enable-slapd or --disable-slapd was given.
1571 if test "${enable_slapd+set}" = set; then
1572   enableval="$enable_slapd"
1573   
1574         ol_arg=invalid
1575         for ol_val in auto yes no ; do
1576                 if test "$enableval" = "$ol_val" ; then
1577                         ol_arg="$ol_val"
1578                 fi
1579         done
1580         if test "$ol_arg" = "invalid" ; then
1581                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1582         fi
1583         ol_enable_slapd="$ol_arg"
1584
1585 else
1586         ol_enable_slapd="yes"
1587 fi
1588 # end --enable-slapd
1589 # OpenLDAP --enable-aci
1590         # Check whether --enable-aci or --disable-aci was given.
1591 if test "${enable_aci+set}" = set; then
1592   enableval="$enable_aci"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no ; do
1596                 if test "$enableval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1602         fi
1603         ol_enable_aci="$ol_arg"
1604
1605 else
1606         ol_enable_aci="no"
1607 fi
1608 # end --enable-aci
1609 # OpenLDAP --enable-cleartext
1610         # Check whether --enable-cleartext or --disable-cleartext was given.
1611 if test "${enable_cleartext+set}" = set; then
1612   enableval="$enable_cleartext"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto yes no ; do
1616                 if test "$enableval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1622         fi
1623         ol_enable_cleartext="$ol_arg"
1624
1625 else
1626         ol_enable_cleartext="yes"
1627 fi
1628 # end --enable-cleartext
1629 # OpenLDAP --enable-crypt
1630         # Check whether --enable-crypt or --disable-crypt was given.
1631 if test "${enable_crypt+set}" = set; then
1632   enableval="$enable_crypt"
1633   
1634         ol_arg=invalid
1635         for ol_val in auto yes no ; do
1636                 if test "$enableval" = "$ol_val" ; then
1637                         ol_arg="$ol_val"
1638                 fi
1639         done
1640         if test "$ol_arg" = "invalid" ; then
1641                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1642         fi
1643         ol_enable_crypt="$ol_arg"
1644
1645 else
1646         ol_enable_crypt="no"
1647 fi
1648 # end --enable-crypt
1649 # OpenLDAP --enable-dynamic
1650         # Check whether --enable-dynamic or --disable-dynamic was given.
1651 if test "${enable_dynamic+set}" = set; then
1652   enableval="$enable_dynamic"
1653   
1654         ol_arg=invalid
1655         for ol_val in auto yes no ; do
1656                 if test "$enableval" = "$ol_val" ; then
1657                         ol_arg="$ol_val"
1658                 fi
1659         done
1660         if test "$ol_arg" = "invalid" ; then
1661                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1662         fi
1663         ol_enable_dynamic="$ol_arg"
1664
1665 else
1666         ol_enable_dynamic="no"
1667 fi
1668 # end --enable-dynamic
1669 # OpenLDAP --enable-kpasswd
1670         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1671 if test "${enable_kpasswd+set}" = set; then
1672   enableval="$enable_kpasswd"
1673   
1674         ol_arg=invalid
1675         for ol_val in auto yes no ; do
1676                 if test "$enableval" = "$ol_val" ; then
1677                         ol_arg="$ol_val"
1678                 fi
1679         done
1680         if test "$ol_arg" = "invalid" ; then
1681                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1682         fi
1683         ol_enable_kpasswd="$ol_arg"
1684
1685 else
1686         ol_enable_kpasswd="no"
1687 fi
1688 # end --enable-kpasswd
1689 # OpenLDAP --enable-lmpasswd
1690         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1691 if test "${enable_lmpasswd+set}" = set; then
1692   enableval="$enable_lmpasswd"
1693   
1694         ol_arg=invalid
1695         for ol_val in auto yes no ; do
1696                 if test "$enableval" = "$ol_val" ; then
1697                         ol_arg="$ol_val"
1698                 fi
1699         done
1700         if test "$ol_arg" = "invalid" ; then
1701                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1702         fi
1703         ol_enable_lmpasswd="$ol_arg"
1704
1705 else
1706         ol_enable_lmpasswd="no"
1707 fi
1708 # end --enable-lmpasswd
1709 # OpenLDAP --enable-spasswd
1710         # Check whether --enable-spasswd or --disable-spasswd was given.
1711 if test "${enable_spasswd+set}" = set; then
1712   enableval="$enable_spasswd"
1713   
1714         ol_arg=invalid
1715         for ol_val in auto yes no ; do
1716                 if test "$enableval" = "$ol_val" ; then
1717                         ol_arg="$ol_val"
1718                 fi
1719         done
1720         if test "$ol_arg" = "invalid" ; then
1721                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1722         fi
1723         ol_enable_spasswd="$ol_arg"
1724
1725 else
1726         ol_enable_spasswd="no"
1727 fi
1728 # end --enable-spasswd
1729 # OpenLDAP --enable-modules
1730         # Check whether --enable-modules or --disable-modules was given.
1731 if test "${enable_modules+set}" = set; then
1732   enableval="$enable_modules"
1733   
1734         ol_arg=invalid
1735         for ol_val in auto yes no ; do
1736                 if test "$enableval" = "$ol_val" ; then
1737                         ol_arg="$ol_val"
1738                 fi
1739         done
1740         if test "$ol_arg" = "invalid" ; then
1741                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1742         fi
1743         ol_enable_modules="$ol_arg"
1744
1745 else
1746         ol_enable_modules="no"
1747 fi
1748 # end --enable-modules
1749 # OpenLDAP --enable-phonetic
1750         # Check whether --enable-phonetic or --disable-phonetic was given.
1751 if test "${enable_phonetic+set}" = set; then
1752   enableval="$enable_phonetic"
1753   
1754         ol_arg=invalid
1755         for ol_val in auto yes no ; do
1756                 if test "$enableval" = "$ol_val" ; then
1757                         ol_arg="$ol_val"
1758                 fi
1759         done
1760         if test "$ol_arg" = "invalid" ; then
1761                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1762         fi
1763         ol_enable_phonetic="$ol_arg"
1764
1765 else
1766         ol_enable_phonetic="no"
1767 fi
1768 # end --enable-phonetic
1769 # OpenLDAP --enable-rlookups
1770         # Check whether --enable-rlookups or --disable-rlookups was given.
1771 if test "${enable_rlookups+set}" = set; then
1772   enableval="$enable_rlookups"
1773   
1774         ol_arg=invalid
1775         for ol_val in auto yes no ; do
1776                 if test "$enableval" = "$ol_val" ; then
1777                         ol_arg="$ol_val"
1778                 fi
1779         done
1780         if test "$ol_arg" = "invalid" ; then
1781                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1782         fi
1783         ol_enable_rlookups="$ol_arg"
1784
1785 else
1786         ol_enable_rlookups="no"
1787 fi
1788 # end --enable-rlookups
1789 # OpenLDAP --enable-slp
1790         # Check whether --enable-slp or --disable-slp was given.
1791 if test "${enable_slp+set}" = set; then
1792   enableval="$enable_slp"
1793   
1794         ol_arg=invalid
1795         for ol_val in auto yes no ; do
1796                 if test "$enableval" = "$ol_val" ; then
1797                         ol_arg="$ol_val"
1798                 fi
1799         done
1800         if test "$ol_arg" = "invalid" ; then
1801                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1802         fi
1803         ol_enable_slp="$ol_arg"
1804
1805 else
1806         ol_enable_slp="no"
1807 fi
1808 # end --enable-slp
1809 # OpenLDAP --enable-wrappers
1810         # Check whether --enable-wrappers or --disable-wrappers was given.
1811 if test "${enable_wrappers+set}" = set; then
1812   enableval="$enable_wrappers"
1813   
1814         ol_arg=invalid
1815         for ol_val in auto yes no ; do
1816                 if test "$enableval" = "$ol_val" ; then
1817                         ol_arg="$ol_val"
1818                 fi
1819         done
1820         if test "$ol_arg" = "invalid" ; then
1821                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1822         fi
1823         ol_enable_wrappers="$ol_arg"
1824
1825 else
1826         ol_enable_wrappers="no"
1827 fi
1828 # end --enable-wrappers
1829
1830 # OpenLDAP --enable-bdb
1831         # Check whether --enable-bdb or --disable-bdb was given.
1832 if test "${enable_bdb+set}" = set; then
1833   enableval="$enable_bdb"
1834   
1835         ol_arg=invalid
1836         for ol_val in auto yes no ; do
1837                 if test "$enableval" = "$ol_val" ; then
1838                         ol_arg="$ol_val"
1839                 fi
1840         done
1841         if test "$ol_arg" = "invalid" ; then
1842                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1843         fi
1844         ol_enable_bdb="$ol_arg"
1845
1846 else
1847         ol_enable_bdb="no"
1848 fi
1849 # end --enable-bdb
1850 # OpenLDAP --with-bdb_module
1851         # Check whether --with-bdb_module or --without-bdb_module was given.
1852 if test "${with_bdb_module+set}" = set; then
1853   withval="$with_bdb_module"
1854   
1855         ol_arg=invalid
1856         for ol_val in static dynamic ; do
1857                 if test "$withval" = "$ol_val" ; then
1858                         ol_arg="$ol_val"
1859                 fi
1860         done
1861         if test "$ol_arg" = "invalid" ; then
1862                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1863         fi
1864         ol_with_bdb_module="$ol_arg"
1865
1866 else
1867         ol_with_bdb_module="static"
1868 fi
1869 # end --with-bdb_module
1870
1871 # OpenLDAP --enable-dnssrv
1872         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1873 if test "${enable_dnssrv+set}" = set; then
1874   enableval="$enable_dnssrv"
1875   
1876         ol_arg=invalid
1877         for ol_val in auto yes no ; do
1878                 if test "$enableval" = "$ol_val" ; then
1879                         ol_arg="$ol_val"
1880                 fi
1881         done
1882         if test "$ol_arg" = "invalid" ; then
1883                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1884         fi
1885         ol_enable_dnssrv="$ol_arg"
1886
1887 else
1888         ol_enable_dnssrv="no"
1889 fi
1890 # end --enable-dnssrv
1891 # OpenLDAP --with-dnssrv_module
1892         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1893 if test "${with_dnssrv_module+set}" = set; then
1894   withval="$with_dnssrv_module"
1895   
1896         ol_arg=invalid
1897         for ol_val in static dynamic ; do
1898                 if test "$withval" = "$ol_val" ; then
1899                         ol_arg="$ol_val"
1900                 fi
1901         done
1902         if test "$ol_arg" = "invalid" ; then
1903                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1904         fi
1905         ol_with_dnssrv_module="$ol_arg"
1906
1907 else
1908         ol_with_dnssrv_module="static"
1909 fi
1910 # end --with-dnssrv_module
1911
1912 # OpenLDAP --enable-ldap
1913         # Check whether --enable-ldap or --disable-ldap was given.
1914 if test "${enable_ldap+set}" = set; then
1915   enableval="$enable_ldap"
1916   
1917         ol_arg=invalid
1918         for ol_val in auto yes no ; do
1919                 if test "$enableval" = "$ol_val" ; then
1920                         ol_arg="$ol_val"
1921                 fi
1922         done
1923         if test "$ol_arg" = "invalid" ; then
1924                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1925         fi
1926         ol_enable_ldap="$ol_arg"
1927
1928 else
1929         ol_enable_ldap="no"
1930 fi
1931 # end --enable-ldap
1932 # OpenLDAP --with-ldap_module
1933         # Check whether --with-ldap_module or --without-ldap_module was given.
1934 if test "${with_ldap_module+set}" = set; then
1935   withval="$with_ldap_module"
1936   
1937         ol_arg=invalid
1938         for ol_val in static dynamic ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1945         fi
1946         ol_with_ldap_module="$ol_arg"
1947
1948 else
1949         ol_with_ldap_module="static"
1950 fi
1951 # end --with-ldap_module
1952
1953 # OpenLDAP --enable-ldbm
1954         # Check whether --enable-ldbm or --disable-ldbm was given.
1955 if test "${enable_ldbm+set}" = set; then
1956   enableval="$enable_ldbm"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1966         fi
1967         ol_enable_ldbm="$ol_arg"
1968
1969 else
1970         ol_enable_ldbm="yes"
1971 fi
1972 # end --enable-ldbm
1973 # OpenLDAP --with-ldbm_api
1974         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1975 if test "${with_ldbm_api+set}" = set; then
1976   withval="$with_ldbm_api"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1986         fi
1987         ol_with_ldbm_api="$ol_arg"
1988
1989 else
1990         ol_with_ldbm_api="auto"
1991 fi
1992 # end --with-ldbm_api
1993
1994 # OpenLDAP --with-ldbm_module
1995         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1996 if test "${with_ldbm_module+set}" = set; then
1997   withval="$with_ldbm_module"
1998   
1999         ol_arg=invalid
2000         for ol_val in static dynamic ; do
2001                 if test "$withval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2007         fi
2008         ol_with_ldbm_module="$ol_arg"
2009
2010 else
2011         ol_with_ldbm_module="static"
2012 fi
2013 # end --with-ldbm_module
2014
2015 # OpenLDAP --with-ldbm_type
2016         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2017 if test "${with_ldbm_type+set}" = set; then
2018   withval="$with_ldbm_type"
2019   
2020         ol_arg=invalid
2021         for ol_val in auto btree hash ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2028         fi
2029         ol_with_ldbm_type="$ol_arg"
2030
2031 else
2032         ol_with_ldbm_type="auto"
2033 fi
2034 # end --with-ldbm_type
2035
2036 # OpenLDAP --enable-meta
2037         # Check whether --enable-meta or --disable-meta was given.
2038 if test "${enable_meta+set}" = set; then
2039   enableval="$enable_meta"
2040   
2041         ol_arg=invalid
2042         for ol_val in auto yes no ; do
2043                 if test "$enableval" = "$ol_val" ; then
2044                         ol_arg="$ol_val"
2045                 fi
2046         done
2047         if test "$ol_arg" = "invalid" ; then
2048                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2049         fi
2050         ol_enable_meta="$ol_arg"
2051
2052 else
2053         ol_enable_meta="no"
2054 fi
2055 # end --enable-meta
2056 # OpenLDAP --with-meta_module
2057         # Check whether --with-meta_module or --without-meta_module was given.
2058 if test "${with_meta_module+set}" = set; then
2059   withval="$with_meta_module"
2060   
2061         ol_arg=invalid
2062         for ol_val in static dynamic ; do
2063                 if test "$withval" = "$ol_val" ; then
2064                         ol_arg="$ol_val"
2065                 fi
2066         done
2067         if test "$ol_arg" = "invalid" ; then
2068                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2069         fi
2070         ol_with_meta_module="$ol_arg"
2071
2072 else
2073         ol_with_meta_module="static"
2074 fi
2075 # end --with-meta_module
2076
2077 # OpenLDAP --enable-monitor
2078         # Check whether --enable-monitor or --disable-monitor was given.
2079 if test "${enable_monitor+set}" = set; then
2080   enableval="$enable_monitor"
2081   
2082         ol_arg=invalid
2083         for ol_val in auto yes no ; do
2084                 if test "$enableval" = "$ol_val" ; then
2085                         ol_arg="$ol_val"
2086                 fi
2087         done
2088         if test "$ol_arg" = "invalid" ; then
2089                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2090         fi
2091         ol_enable_monitor="$ol_arg"
2092
2093 else
2094         ol_enable_monitor="no"
2095 fi
2096 # end --enable-monitor
2097 # OpenLDAP --with-monitor_module
2098         # Check whether --with-monitor_module or --without-monitor_module was given.
2099 if test "${with_monitor_module+set}" = set; then
2100   withval="$with_monitor_module"
2101   
2102         ol_arg=invalid
2103         for ol_val in static dynamic ; do
2104                 if test "$withval" = "$ol_val" ; then
2105                         ol_arg="$ol_val"
2106                 fi
2107         done
2108         if test "$ol_arg" = "invalid" ; then
2109                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2110         fi
2111         ol_with_monitor_module="$ol_arg"
2112
2113 else
2114         ol_with_monitor_module="static"
2115 fi
2116 # end --with-monitor_module
2117
2118 # OpenLDAP --enable-passwd
2119         # Check whether --enable-passwd or --disable-passwd was given.
2120 if test "${enable_passwd+set}" = set; then
2121   enableval="$enable_passwd"
2122   
2123         ol_arg=invalid
2124         for ol_val in auto yes no ; do
2125                 if test "$enableval" = "$ol_val" ; then
2126                         ol_arg="$ol_val"
2127                 fi
2128         done
2129         if test "$ol_arg" = "invalid" ; then
2130                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2131         fi
2132         ol_enable_passwd="$ol_arg"
2133
2134 else
2135         ol_enable_passwd="no"
2136 fi
2137 # end --enable-passwd
2138 # OpenLDAP --with-passwd_module
2139         # Check whether --with-passwd_module or --without-passwd_module was given.
2140 if test "${with_passwd_module+set}" = set; then
2141   withval="$with_passwd_module"
2142   
2143         ol_arg=invalid
2144         for ol_val in static dynamic ; do
2145                 if test "$withval" = "$ol_val" ; then
2146                         ol_arg="$ol_val"
2147                 fi
2148         done
2149         if test "$ol_arg" = "invalid" ; then
2150                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2151         fi
2152         ol_with_passwd_module="$ol_arg"
2153
2154 else
2155         ol_with_passwd_module="static"
2156 fi
2157 # end --with-passwd_module
2158
2159 # OpenLDAP --enable-perl
2160         # Check whether --enable-perl or --disable-perl was given.
2161 if test "${enable_perl+set}" = set; then
2162   enableval="$enable_perl"
2163   
2164         ol_arg=invalid
2165         for ol_val in auto yes no ; do
2166                 if test "$enableval" = "$ol_val" ; then
2167                         ol_arg="$ol_val"
2168                 fi
2169         done
2170         if test "$ol_arg" = "invalid" ; then
2171                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2172         fi
2173         ol_enable_perl="$ol_arg"
2174
2175 else
2176         ol_enable_perl="no"
2177 fi
2178 # end --enable-perl
2179 # OpenLDAP --with-perl_module
2180         # Check whether --with-perl_module or --without-perl_module was given.
2181 if test "${with_perl_module+set}" = set; then
2182   withval="$with_perl_module"
2183   
2184         ol_arg=invalid
2185         for ol_val in static dynamic ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2192         fi
2193         ol_with_perl_module="$ol_arg"
2194
2195 else
2196         ol_with_perl_module="static"
2197 fi
2198 # end --with-perl_module
2199
2200 # OpenLDAP --enable-shell
2201         # Check whether --enable-shell or --disable-shell was given.
2202 if test "${enable_shell+set}" = set; then
2203   enableval="$enable_shell"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2213         fi
2214         ol_enable_shell="$ol_arg"
2215
2216 else
2217         ol_enable_shell="no"
2218 fi
2219 # end --enable-shell
2220 # OpenLDAP --with-shell_module
2221         # Check whether --with-shell_module or --without-shell_module was given.
2222 if test "${with_shell_module+set}" = set; then
2223   withval="$with_shell_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_shell_module="$ol_arg"
2235
2236 else
2237         ol_with_shell_module="static"
2238 fi
2239 # end --with-shell_module
2240
2241 # OpenLDAP --enable-sql
2242         # Check whether --enable-sql or --disable-sql was given.
2243 if test "${enable_sql+set}" = set; then
2244   enableval="$enable_sql"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2254         fi
2255         ol_enable_sql="$ol_arg"
2256
2257 else
2258         ol_enable_sql="no"
2259 fi
2260 # end --enable-sql
2261 # OpenLDAP --with-sql_module
2262         # Check whether --with-sql_module or --without-sql_module was given.
2263 if test "${with_sql_module+set}" = set; then
2264   withval="$with_sql_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_sql_module="$ol_arg"
2276
2277 else
2278         ol_with_sql_module="static"
2279 fi
2280 # end --with-sql_module
2281
2282 # OpenLDAP --enable-tcl
2283         # Check whether --enable-tcl or --disable-tcl was given.
2284 if test "${enable_tcl+set}" = set; then
2285   enableval="$enable_tcl"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2295         fi
2296         ol_enable_tcl="$ol_arg"
2297
2298 else
2299         ol_enable_tcl="no"
2300 fi
2301 # end --enable-tcl
2302 # OpenLDAP --with-tcl_module
2303         # Check whether --with-tcl_module or --without-tcl_module was given.
2304 if test "${with_tcl_module+set}" = set; then
2305   withval="$with_tcl_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_tcl_module="$ol_arg"
2317
2318 else
2319         ol_with_tcl_module="static"
2320 fi
2321 # end --with-tcl_module
2322
2323
2324 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2325 if test "${with_xxslurpdoptions+set}" = set; then
2326   withval="$with_xxslurpdoptions"
2327   :
2328 fi
2329
2330 # OpenLDAP --enable-slurpd
2331         # Check whether --enable-slurpd or --disable-slurpd was given.
2332 if test "${enable_slurpd+set}" = set; then
2333   enableval="$enable_slurpd"
2334   
2335         ol_arg=invalid
2336         for ol_val in auto yes no ; do
2337                 if test "$enableval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2343         fi
2344         ol_enable_slurpd="$ol_arg"
2345
2346 else
2347         ol_enable_slurpd="auto"
2348 fi
2349 # end --enable-slurpd
2350
2351 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2352 if test "${with_xxliboptions+set}" = set; then
2353   withval="$with_xxliboptions"
2354   :
2355 fi
2356
2357 # Check whether --enable-static or --disable-static was given.
2358 if test "${enable_static+set}" = set; then
2359   enableval="$enable_static"
2360   p=${PACKAGE-default}
2361 case "$enableval" in
2362 yes) enable_static=yes ;;
2363 no) enable_static=no ;;
2364 *)
2365   enable_static=no
2366   # Look at the argument we got.  We use all the common list separators.
2367   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2368   for pkg in $enableval; do
2369     if test "X$pkg" = "X$p"; then
2370       enable_static=yes
2371     fi
2372   done
2373   IFS="$ac_save_ifs"
2374   ;;
2375 esac
2376 else
2377   enable_static=yes
2378 fi
2379
2380 # Check whether --enable-shared or --disable-shared was given.
2381 if test "${enable_shared+set}" = set; then
2382   enableval="$enable_shared"
2383   p=${PACKAGE-default}
2384 case "$enableval" in
2385 yes) enable_shared=yes ;;
2386 no) enable_shared=no ;;
2387 *)
2388   enable_shared=no
2389   # Look at the argument we got.  We use all the common list separators.
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2391   for pkg in $enableval; do
2392     if test "X$pkg" = "X$p"; then
2393       enable_shared=yes
2394     fi
2395   done
2396   IFS="$ac_save_ifs"
2397   ;;
2398 esac
2399 else
2400   enable_shared=yes
2401 fi
2402
2403
2404
2405 # validate options
2406 if test $ol_enable_slapd = no ; then
2407                 if test $ol_enable_bdb = yes ; then
2408                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2409         fi
2410         if test $ol_enable_dnssrv = yes ; then
2411                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2412         fi
2413         if test $ol_enable_ldap = yes ; then
2414                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2415         fi
2416         if test $ol_enable_ldbm = yes ; then
2417                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2418         fi
2419         if test $ol_enable_meta = yes ; then
2420                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2421         fi
2422         if test $ol_enable_monitor = yes ; then
2423                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2424         fi
2425         if test $ol_enable_passwd = yes ; then
2426                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2427         fi
2428         if test $ol_enable_perl = yes ; then
2429                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2430         fi
2431         if test $ol_enable_shell = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2433         fi
2434         if test $ol_enable_tcl = yes ; then
2435                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2436         fi
2437         if test $ol_enable_sql = yes ; then
2438                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2439         fi
2440         if test $ol_enable_modules = yes ; then
2441                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2442         fi
2443         if test $ol_enable_wrappers = yes ; then
2444                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2445         fi
2446         if test $ol_enable_phonetic = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2448         fi
2449         if test $ol_enable_rlookups = yes ; then
2450                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2451         fi
2452         if test $ol_enable_aci = yes ; then
2453                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2454         fi
2455         if test $ol_with_ldbm_api != auto ; then
2456                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2457         fi
2458         if test $ol_with_ldbm_type != auto ; then
2459                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2460         fi
2461         if test $ol_with_bdb_module != static ; then
2462                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2463         fi
2464         if test $ol_with_dnssrv_module != static ; then
2465                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2466         fi
2467         if test $ol_with_ldap_module != static ; then
2468                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2469         fi
2470         if test $ol_with_ldbm_module != static ; then
2471                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2472         fi
2473         if test $ol_with_meta_module != static ; then
2474                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2475         fi
2476         if test $ol_with_monitor_module != static ; then
2477                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2478         fi
2479         if test $ol_with_passwd_module != static ; then
2480                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2481         fi
2482         if test $ol_with_perl_module != static ; then
2483                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2484         fi
2485         if test $ol_with_shell_module != static ; then
2486                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2487         fi
2488         if test $ol_with_tcl_module != static ; then
2489                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2490         fi
2491         if test $ol_with_sql_module != static ; then
2492                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2493         fi
2494         if test $ol_enable_slurpd = yes ; then
2495                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2496         fi
2497         if test $ol_enable_rewrite = yes ; then
2498                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2499         fi
2500
2501         # force settings to no
2502         ol_enable_bdb=no
2503         ol_enable_dnssrv=no
2504         ol_enable_ldap=no
2505         ol_enable_ldbm=no
2506         ol_enable_meta=no
2507         ol_enable_monitor=no
2508         ol_enable_passwd=no
2509         ol_enable_perl=no
2510         ol_enable_shell=no
2511         ol_enable_tcl=no
2512         ol_enable_sql=no
2513
2514         ol_enable_modules=no
2515         ol_enable_phonetic=no
2516         ol_enable_rlookups=no
2517         ol_enable_aci=no
2518         ol_enable_wrappers=no
2519         ol_enable_dynamic=no
2520
2521         ol_with_ldbm_api=no
2522         ol_with_ldbm_type=no
2523
2524         ol_with_bdb_module=static
2525         ol_with_dnssrv_module=static
2526         ol_with_ldap_module=static
2527         ol_with_ldbm_module=static
2528         ol_with_meta_module=static
2529         ol_with_monitor_module=static
2530         ol_with_passwd_module=static
2531         ol_with_perl_module=static
2532         ol_with_shell_module=static
2533         ol_with_tcl_module=static
2534         ol_with_sql_module=static
2535
2536         ol_enable_slurpd=no
2537
2538         ol_enable_rewrite=no
2539
2540 elif test $ol_enable_ldbm = no ; then
2541         
2542         if test $ol_with_ldbm_api != auto ; then
2543                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2544         fi
2545
2546         if test $ol_with_ldbm_type != auto ; then
2547                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2548         fi
2549
2550         if test $ol_with_ldbm_module != static ; then
2551                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2552         fi
2553
2554         if test $ol_enable_modules != yes -a \
2555                 $ol_enable_bdb = no -a \
2556                 $ol_enable_dnssrv = no -a \
2557                 $ol_enable_ldap = no -a \
2558                 $ol_enable_meta = no -a \
2559                 $ol_enable_monitor = no -a \
2560                 $ol_enable_passwd = no -a \
2561                 $ol_enable_perl = no -a \
2562                 $ol_enable_shell = no -a \
2563                 $ol_enable_sql = no -a \
2564                 $ol_enable_tcl = no ; then
2565
2566                 if test $ol_enable_slapd = yes ; then
2567                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2568                 else
2569                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2570                         ol_enable_slapd=no
2571                 fi
2572         fi
2573
2574         ol_with_ldbm_api=no
2575         ol_with_ldbm_type=no
2576         ol_with_ldbm_module=static
2577
2578         if test $ol_enable_bdb != no ; then
2579                 ol_with_ldbm_api=berkeley
2580         fi
2581
2582 else
2583                 if test $ol_with_ldbm_api = gdbm -a \
2584                 $ol_with_ldbm_type = btree ; then
2585                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2586         fi
2587         if test $ol_with_ldbm_api = mdbm -a \
2588                 $ol_with_ldbm_type = btree ; then
2589                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2590         fi
2591         if test $ol_with_ldbm_api = ndbm -a \
2592                 $ol_with_ldbm_type = btree ; then
2593                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2594         fi
2595
2596         if test $ol_enable_bdb = yes ; then
2597                 if test $ol_with_ldbm_api = auto ; then
2598                         ol_with_ldbm_api=berkeley
2599                 elif test $ol_with_ldbm_api != berkeley ; then
2600                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2601                 fi
2602
2603         elif test $ol_enable_bdb = auto ; then
2604                 if test $ol_with_ldbm_api != berkeley \
2605                         -o $ol_with_ldbm_api != auto ; then
2606                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2607                         ol_enable_bdb=no
2608                 fi
2609         fi
2610 fi
2611
2612 if test $ol_enable_slurpd = yes ; then
2613                 if test $ol_with_threads = no ; then
2614                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2615         fi
2616 fi
2617
2618 if test $ol_enable_lmpasswd = yes ; then
2619         if test $ol_with_tls = no ; then
2620                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2621         fi
2622 fi
2623
2624 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2625         if test $ol_with_kerberos = no ; then
2626                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2627         elif test $ol_with_kerberos = auto ; then
2628                 ol_with_kerberos=yes
2629         fi
2630
2631 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2632         if test $ol_with_kerberos = auto ; then
2633                 ol_with_kerberos=no
2634         elif test $ol_with_kerberos != no ; then
2635                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2636                 ol_with_kerberos=no
2637         fi
2638 fi
2639
2640 if test $ol_enable_spasswd = yes ; then
2641         if test $ol_with_cyrus_sasl = no ; then
2642                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2643         fi
2644         ol_with_cyrus_sasl=yes
2645 fi
2646
2647 echo "$ac_t""done" 1>&6
2648
2649 LDAP_LIBS=
2650 LDIF_LIBS=
2651 LDBM_LIB=
2652 LDBM_LIBS=
2653 LTHREAD_LIBS=
2654 LUTIL_LIBS=
2655
2656 SLAPD_LIBS=
2657 SLURPD_LIBS=
2658
2659 BUILD_SLAPD=no
2660 BUILD_SLURPD=no
2661
2662 BUILD_THREAD=no
2663
2664 BUILD_BDB=no
2665 BUILD_DNSSRV=no
2666 BUILD_LDAP=no
2667 BUILD_LDBM=no
2668 BUILD_META=no
2669 BUILD_MONITOR=no
2670 BUILD_PASSWD=no
2671 BUILD_PERL=no
2672 BUILD_SHELL=no
2673 BUILD_SQL=no
2674 BUILD_TCL=no
2675
2676 BUILD_BDB_DYNAMIC=static
2677 BUILD_DNSSRV_DYNAMIC=static
2678 BUILD_LDAP_DYNAMIC=static
2679 BUILD_LDBM_DYNAMIC=static
2680 BUILD_META_DYNAMIC=static
2681 BUILD_MONITOR_DYNAMIC=static
2682 BUILD_PASSWD_DYNAMIC=static
2683 BUILD_PERL_DYNAMIC=static
2684 BUILD_SHELL_DYNAMIC=static
2685 BUILD_TCL_DYNAMIC=static
2686 BUILD_SQL_DYNAMIC=static
2687
2688 SLAPD_MODULES_LDFLAGS=
2689 SLAPD_MODULES_CPPFLAGS=
2690 SLAPD_MODULES_LIST=
2691
2692 SLAPD_STATIC_BACKENDS=
2693 SLAPD_DYNAMIC_BACKENDS=
2694
2695 SLAPD_PERL_LDFLAGS=
2696 MOD_PERL_LDFLAGS=
2697 PERL_CPPFLAGS=
2698
2699 SLAPD_SQL_LDFLAGS=
2700 SLAPD_SQL_LIBS=
2701 SLAPD_SQL_INCLUDES=
2702
2703 MOD_TCL_LIB=
2704 KRB4_LIBS=
2705 KRB5_LIBS=
2706 READLINE_LIBS=
2707 SASL_LIBS=
2708 TERMCAP_LIBS=
2709 TLS_LIBS=
2710 MODULES_LIBS=
2711 AUTH_LIBS=
2712
2713 SLAPD_SLP_LIBS=
2714
2715
2716
2717 cat >> confdefs.h <<\EOF
2718 #define HAVE_MKVERSION 1
2719 EOF
2720
2721
2722
2723
2724 ol_aix_threads=no
2725 case "$target" in
2726 *-*-aix*)       if test -z "$CC" ; then
2727                 case "$ol_with_threads" in
2728                 auto | yes |  posix) ol_aix_threads=yes ;;
2729                 esac
2730         fi
2731 ;;
2732 esac
2733
2734 if test $ol_aix_threads = yes ; then
2735         if test -z "${CC}" ; then
2736                 for ac_prog in cc_r xlc_r cc
2737 do
2738 # Extract the first word of "$ac_prog", so it can be a program name with args.
2739 set dummy $ac_prog; ac_word=$2
2740 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2741 echo "configure:2742: checking for $ac_word" >&5
2742 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2743   echo $ac_n "(cached) $ac_c" 1>&6
2744 else
2745   if test -n "$CC"; then
2746   ac_cv_prog_CC="$CC" # Let the user override the test.
2747 else
2748   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2749   ac_dummy="$PATH"
2750   for ac_dir in $ac_dummy; do
2751     test -z "$ac_dir" && ac_dir=.
2752     if test -f $ac_dir/$ac_word; then
2753       ac_cv_prog_CC="$ac_prog"
2754       break
2755     fi
2756   done
2757   IFS="$ac_save_ifs"
2758 fi
2759 fi
2760 CC="$ac_cv_prog_CC"
2761 if test -n "$CC"; then
2762   echo "$ac_t""$CC" 1>&6
2763 else
2764   echo "$ac_t""no" 1>&6
2765 fi
2766
2767 test -n "$CC" && break
2768 done
2769
2770
2771                 if test "$CC" = cc ; then
2772                                                 if test $ol_with_threads != auto ; then
2773                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2774                         else
2775                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2776                         fi
2777                         ol_with_threads=no
2778                 fi
2779         fi
2780
2781         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2782                 ol_with_threads=posix
2783                 ol_cv_pthread_create=yes
2784         fi
2785 fi
2786
2787 if test -z "${CC}"; then
2788         for ac_prog in cc
2789 do
2790 # Extract the first word of "$ac_prog", so it can be a program name with args.
2791 set dummy $ac_prog; ac_word=$2
2792 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2793 echo "configure:2794: checking for $ac_word" >&5
2794 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   if test -n "$CC"; then
2798   ac_cv_prog_CC="$CC" # Let the user override the test.
2799 else
2800   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2801   ac_dummy="$PATH"
2802   for ac_dir in $ac_dummy; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/$ac_word; then
2805       ac_cv_prog_CC="$ac_prog"
2806       break
2807     fi
2808   done
2809   IFS="$ac_save_ifs"
2810 fi
2811 fi
2812 CC="$ac_cv_prog_CC"
2813 if test -n "$CC"; then
2814   echo "$ac_t""$CC" 1>&6
2815 else
2816   echo "$ac_t""no" 1>&6
2817 fi
2818
2819 test -n "$CC" && break
2820 done
2821
2822 fi
2823
2824
2825 for ac_prog in ar gar
2826 do
2827 # Extract the first word of "$ac_prog", so it can be a program name with args.
2828 set dummy $ac_prog; ac_word=$2
2829 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2830 echo "configure:2831: checking for $ac_word" >&5
2831 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2832   echo $ac_n "(cached) $ac_c" 1>&6
2833 else
2834   if test -n "$AR"; then
2835   ac_cv_prog_AR="$AR" # Let the user override the test.
2836 else
2837   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2838   ac_dummy="$PATH"
2839   for ac_dir in $ac_dummy; do
2840     test -z "$ac_dir" && ac_dir=.
2841     if test -f $ac_dir/$ac_word; then
2842       ac_cv_prog_AR="$ac_prog"
2843       break
2844     fi
2845   done
2846   IFS="$ac_save_ifs"
2847 fi
2848 fi
2849 AR="$ac_cv_prog_AR"
2850 if test -n "$AR"; then
2851   echo "$ac_t""$AR" 1>&6
2852 else
2853   echo "$ac_t""no" 1>&6
2854 fi
2855
2856 test -n "$AR" && break
2857 done
2858 test -n "$AR" || AR="ar"
2859
2860
2861
2862
2863 # Check whether --enable-fast-install or --disable-fast-install was given.
2864 if test "${enable_fast_install+set}" = set; then
2865   enableval="$enable_fast_install"
2866   p=${PACKAGE-default}
2867 case "$enableval" in
2868 yes) enable_fast_install=yes ;;
2869 no) enable_fast_install=no ;;
2870 *)
2871   enable_fast_install=no
2872   # Look at the argument we got.  We use all the common list separators.
2873   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2874   for pkg in $enableval; do
2875     if test "X$pkg" = "X$p"; then
2876       enable_fast_install=yes
2877     fi
2878   done
2879   IFS="$ac_save_ifs"
2880   ;;
2881 esac
2882 else
2883   enable_fast_install=yes
2884 fi
2885
2886 # Extract the first word of "ranlib", so it can be a program name with args.
2887 set dummy ranlib; ac_word=$2
2888 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2889 echo "configure:2890: checking for $ac_word" >&5
2890 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   if test -n "$RANLIB"; then
2894   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2895 else
2896   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2897   ac_dummy="$PATH"
2898   for ac_dir in $ac_dummy; do
2899     test -z "$ac_dir" && ac_dir=.
2900     if test -f $ac_dir/$ac_word; then
2901       ac_cv_prog_RANLIB="ranlib"
2902       break
2903     fi
2904   done
2905   IFS="$ac_save_ifs"
2906   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2907 fi
2908 fi
2909 RANLIB="$ac_cv_prog_RANLIB"
2910 if test -n "$RANLIB"; then
2911   echo "$ac_t""$RANLIB" 1>&6
2912 else
2913   echo "$ac_t""no" 1>&6
2914 fi
2915
2916 # Extract the first word of "gcc", so it can be a program name with args.
2917 set dummy gcc; ac_word=$2
2918 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2919 echo "configure:2920: checking for $ac_word" >&5
2920 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2921   echo $ac_n "(cached) $ac_c" 1>&6
2922 else
2923   if test -n "$CC"; then
2924   ac_cv_prog_CC="$CC" # Let the user override the test.
2925 else
2926   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2927   ac_dummy="$PATH"
2928   for ac_dir in $ac_dummy; do
2929     test -z "$ac_dir" && ac_dir=.
2930     if test -f $ac_dir/$ac_word; then
2931       ac_cv_prog_CC="gcc"
2932       break
2933     fi
2934   done
2935   IFS="$ac_save_ifs"
2936 fi
2937 fi
2938 CC="$ac_cv_prog_CC"
2939 if test -n "$CC"; then
2940   echo "$ac_t""$CC" 1>&6
2941 else
2942   echo "$ac_t""no" 1>&6
2943 fi
2944
2945 if test -z "$CC"; then
2946   # Extract the first word of "cc", so it can be a program name with args.
2947 set dummy cc; ac_word=$2
2948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2949 echo "configure:2950: checking for $ac_word" >&5
2950 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   if test -n "$CC"; then
2954   ac_cv_prog_CC="$CC" # Let the user override the test.
2955 else
2956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2957   ac_prog_rejected=no
2958   ac_dummy="$PATH"
2959   for ac_dir in $ac_dummy; do
2960     test -z "$ac_dir" && ac_dir=.
2961     if test -f $ac_dir/$ac_word; then
2962       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2963         ac_prog_rejected=yes
2964         continue
2965       fi
2966       ac_cv_prog_CC="cc"
2967       break
2968     fi
2969   done
2970   IFS="$ac_save_ifs"
2971 if test $ac_prog_rejected = yes; then
2972   # We found a bogon in the path, so make sure we never use it.
2973   set dummy $ac_cv_prog_CC
2974   shift
2975   if test $# -gt 0; then
2976     # We chose a different compiler from the bogus one.
2977     # However, it has the same basename, so the bogon will be chosen
2978     # first if we set CC to just the basename; use the full file name.
2979     shift
2980     set dummy "$ac_dir/$ac_word" "$@"
2981     shift
2982     ac_cv_prog_CC="$@"
2983   fi
2984 fi
2985 fi
2986 fi
2987 CC="$ac_cv_prog_CC"
2988 if test -n "$CC"; then
2989   echo "$ac_t""$CC" 1>&6
2990 else
2991   echo "$ac_t""no" 1>&6
2992 fi
2993
2994   if test -z "$CC"; then
2995     case "`uname -s`" in
2996     *win32* | *WIN32* | *CYGWIN*)
2997       # Extract the first word of "cl", so it can be a program name with args.
2998 set dummy cl; ac_word=$2
2999 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3000 echo "configure:3001: checking for $ac_word" >&5
3001 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3002   echo $ac_n "(cached) $ac_c" 1>&6
3003 else
3004   if test -n "$CC"; then
3005   ac_cv_prog_CC="$CC" # Let the user override the test.
3006 else
3007   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3008   ac_dummy="$PATH"
3009   for ac_dir in $ac_dummy; do
3010     test -z "$ac_dir" && ac_dir=.
3011     if test -f $ac_dir/$ac_word; then
3012       ac_cv_prog_CC="cl"
3013       break
3014     fi
3015   done
3016   IFS="$ac_save_ifs"
3017 fi
3018 fi
3019 CC="$ac_cv_prog_CC"
3020 if test -n "$CC"; then
3021   echo "$ac_t""$CC" 1>&6
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025  ;;
3026     esac
3027   fi
3028   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3029 fi
3030
3031 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3032 echo "configure:3033: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3033
3034 ac_ext=c
3035 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3036 ac_cpp='$CPP $CPPFLAGS'
3037 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3038 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3039 cross_compiling=$ac_cv_prog_cc_cross
3040
3041 cat > conftest.$ac_ext << EOF
3042
3043 #line 3044 "configure"
3044 #include "confdefs.h"
3045
3046 main(){return(0);}
3047 EOF
3048 if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3049   ac_cv_prog_cc_works=yes
3050   # If we can't run a trivial program, we are probably using a cross compiler.
3051   if (./conftest; exit) 2>/dev/null; then
3052     ac_cv_prog_cc_cross=no
3053   else
3054     ac_cv_prog_cc_cross=yes
3055   fi
3056 else
3057   echo "configure: failed program was:" >&5
3058   cat conftest.$ac_ext >&5
3059   ac_cv_prog_cc_works=no
3060 fi
3061 rm -fr conftest*
3062 ac_ext=c
3063 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3064 ac_cpp='$CPP $CPPFLAGS'
3065 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3066 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3067 cross_compiling=$ac_cv_prog_cc_cross
3068
3069 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3070 if test $ac_cv_prog_cc_works = no; then
3071   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3072 fi
3073 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3074 echo "configure:3075: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3075 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3076 cross_compiling=$ac_cv_prog_cc_cross
3077
3078 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3079 echo "configure:3080: checking whether we are using GNU C" >&5
3080 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3081   echo $ac_n "(cached) $ac_c" 1>&6
3082 else
3083   cat > conftest.c <<EOF
3084 #ifdef __GNUC__
3085   yes;
3086 #endif
3087 EOF
3088 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3089   ac_cv_prog_gcc=yes
3090 else
3091   ac_cv_prog_gcc=no
3092 fi
3093 fi
3094
3095 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3096
3097 if test $ac_cv_prog_gcc = yes; then
3098   GCC=yes
3099 else
3100   GCC=
3101 fi
3102
3103 ac_test_CFLAGS="${CFLAGS+set}"
3104 ac_save_CFLAGS="$CFLAGS"
3105 CFLAGS=
3106 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3107 echo "configure:3108: checking whether ${CC-cc} accepts -g" >&5
3108 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   echo 'void f(){}' > conftest.c
3112 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3113   ac_cv_prog_cc_g=yes
3114 else
3115   ac_cv_prog_cc_g=no
3116 fi
3117 rm -f conftest*
3118
3119 fi
3120
3121 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3122 if test "$ac_test_CFLAGS" = set; then
3123   CFLAGS="$ac_save_CFLAGS"
3124 elif test $ac_cv_prog_cc_g = yes; then
3125   if test "$GCC" = yes; then
3126     CFLAGS="-g -O2"
3127   else
3128     CFLAGS="-g"
3129   fi
3130 else
3131   if test "$GCC" = yes; then
3132     CFLAGS="-O2"
3133   else
3134     CFLAGS=
3135   fi
3136 fi
3137
3138 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3139 if test "${with_gnu_ld+set}" = set; then
3140   withval="$with_gnu_ld"
3141   test "$withval" = no || with_gnu_ld=yes
3142 else
3143   with_gnu_ld=no
3144 fi
3145
3146 ac_prog=ld
3147 if test "$ac_cv_prog_gcc" = yes; then
3148   # Check if gcc -print-prog-name=ld gives a path.
3149   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3150 echo "configure:3151: checking for ld used by GCC" >&5
3151   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3152   case "$ac_prog" in
3153     # Accept absolute paths.
3154     [\\/]* | [A-Za-z]:[\\/]*)
3155       re_direlt='/[^/][^/]*/\.\./'
3156       # Canonicalize the path of ld
3157       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3158       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3159         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3160       done
3161       test -z "$LD" && LD="$ac_prog"
3162       ;;
3163   "")
3164     # If it fails, then pretend we aren't using GCC.
3165     ac_prog=ld
3166     ;;
3167   *)
3168     # If it is relative, then search for the first ld in PATH.
3169     with_gnu_ld=unknown
3170     ;;
3171   esac
3172 elif test "$with_gnu_ld" = yes; then
3173   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3174 echo "configure:3175: checking for GNU ld" >&5
3175 else
3176   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3177 echo "configure:3178: checking for non-GNU ld" >&5
3178 fi
3179 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3180   echo $ac_n "(cached) $ac_c" 1>&6
3181 else
3182   if test -z "$LD"; then
3183   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3184   for ac_dir in $PATH; do
3185     test -z "$ac_dir" && ac_dir=.
3186     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3187       ac_cv_path_LD="$ac_dir/$ac_prog"
3188       # Check to see if the program is GNU ld.  I'd rather use --version,
3189       # but apparently some GNU ld's only accept -v.
3190       # Break only if it was the GNU/non-GNU ld that we prefer.
3191       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3192         test "$with_gnu_ld" != no && break
3193       else
3194         test "$with_gnu_ld" != yes && break
3195       fi
3196     fi
3197   done
3198   IFS="$ac_save_ifs"
3199 else
3200   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3201 fi
3202 fi
3203
3204 LD="$ac_cv_path_LD"
3205 if test -n "$LD"; then
3206   echo "$ac_t""$LD" 1>&6
3207 else
3208   echo "$ac_t""no" 1>&6
3209 fi
3210 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3211 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3212 echo "configure:3213: checking if the linker ($LD) is GNU ld" >&5
3213 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3214   echo $ac_n "(cached) $ac_c" 1>&6
3215 else
3216   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3217 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3218   ac_cv_prog_gnu_ld=yes
3219 else
3220   ac_cv_prog_gnu_ld=no
3221 fi
3222 fi
3223
3224 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3225
3226
3227 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3228 echo "configure:3229: checking for BSD-compatible nm" >&5
3229 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   if test -n "$NM"; then
3233   # Let the user override the test.
3234   ac_cv_path_NM="$NM"
3235 else
3236   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3237   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3238     test -z "$ac_dir" && ac_dir=.
3239     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3240       # Check to see if the nm accepts a BSD-compat flag.
3241       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3242       #   nm: unknown option "B" ignored
3243       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3244         ac_cv_path_NM="$ac_dir/nm -B"
3245         break
3246       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3247         ac_cv_path_NM="$ac_dir/nm -p"
3248         break
3249       else
3250         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3251         continue # so that we can try to find one that supports BSD flags
3252       fi
3253     fi
3254   done
3255   IFS="$ac_save_ifs"
3256   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3257 fi
3258 fi
3259
3260 NM="$ac_cv_path_NM"
3261 echo "$ac_t""$NM" 1>&6
3262
3263 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3264 echo "configure:3265: checking whether ln -s works" >&5
3265 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3266   echo $ac_n "(cached) $ac_c" 1>&6
3267 else
3268   rm -f conftestdata
3269 if ln -s X conftestdata 2>/dev/null
3270 then
3271   rm -f conftestdata
3272   ac_cv_prog_LN_S="ln -s"
3273 else
3274   ac_cv_prog_LN_S=ln
3275 fi
3276 fi
3277 LN_S="$ac_cv_prog_LN_S"
3278 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3279   echo "$ac_t""yes" 1>&6
3280 else
3281   echo "$ac_t""no" 1>&6
3282 fi
3283
3284 if test $host != $build; then
3285   ac_tool_prefix=${host_alias}-
3286 else
3287   ac_tool_prefix=
3288 fi
3289
3290
3291 case "$target" in
3292 NONE) lt_target="$host" ;;
3293 *) lt_target="$target" ;;
3294 esac
3295
3296 # Check for any special flags to pass to ltconfig.
3297 libtool_flags="--cache-file=$cache_file"
3298 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3299 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3300 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3301 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3302 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3303 libtool_flags="$libtool_flags --enable-dlopen"
3304 libtool_flags="$libtool_flags --enable-win32-dll"
3305 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3306 if test "${enable_libtool_lock+set}" = set; then
3307   enableval="$enable_libtool_lock"
3308   :
3309 fi
3310
3311 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3312 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3313
3314 # Some flags need to be propagated to the compiler or linker for good
3315 # libtool support.
3316 case "$lt_target" in
3317 *-*-irix6*)
3318   # Find out which ABI we are using.
3319   echo '#line 3320 "configure"' > conftest.$ac_ext
3320   if { (eval echo configure:3321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3321     case "`/usr/bin/file conftest.o`" in
3322     *32-bit*)
3323       LD="${LD-ld} -32"
3324       ;;
3325     *N32*)
3326       LD="${LD-ld} -n32"
3327       ;;
3328     *64-bit*)
3329       LD="${LD-ld} -64"
3330       ;;
3331     esac
3332   fi
3333   rm -rf conftest*
3334   ;;
3335
3336 *-*-sco3.2v5*)
3337   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3338   SAVE_CFLAGS="$CFLAGS"
3339   CFLAGS="$CFLAGS -belf"
3340   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3341 echo "configure:3342: checking whether the C compiler needs -belf" >&5
3342 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3343   echo $ac_n "(cached) $ac_c" 1>&6
3344 else
3345   cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348
3349 int main() {
3350
3351 ; return 0; }
3352 EOF
3353 if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3354   rm -rf conftest*
3355   lt_cv_cc_needs_belf=yes
3356 else
3357   echo "configure: failed program was:" >&5
3358   cat conftest.$ac_ext >&5
3359   rm -rf conftest*
3360   lt_cv_cc_needs_belf=no
3361 fi
3362 rm -f conftest*
3363 fi
3364
3365 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3366   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3367     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3368     CFLAGS="$SAVE_CFLAGS"
3369   fi
3370   ;;
3371
3372 *-*-cygwin* | *-*-mingw*)
3373   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3374 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3375 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3376 echo "configure:3377: checking for $ac_word" >&5
3377 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3378   echo $ac_n "(cached) $ac_c" 1>&6
3379 else
3380   if test -n "$DLLTOOL"; then
3381   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3382 else
3383   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3384   ac_dummy="$PATH"
3385   for ac_dir in $ac_dummy; do
3386     test -z "$ac_dir" && ac_dir=.
3387     if test -f $ac_dir/$ac_word; then
3388       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3389       break
3390     fi
3391   done
3392   IFS="$ac_save_ifs"
3393 fi
3394 fi
3395 DLLTOOL="$ac_cv_prog_DLLTOOL"
3396 if test -n "$DLLTOOL"; then
3397   echo "$ac_t""$DLLTOOL" 1>&6
3398 else
3399   echo "$ac_t""no" 1>&6
3400 fi
3401
3402
3403 if test -z "$ac_cv_prog_DLLTOOL"; then
3404 if test -n "$ac_tool_prefix"; then
3405   # Extract the first word of "dlltool", so it can be a program name with args.
3406 set dummy dlltool; ac_word=$2
3407 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3408 echo "configure:3409: checking for $ac_word" >&5
3409 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3410   echo $ac_n "(cached) $ac_c" 1>&6
3411 else
3412   if test -n "$DLLTOOL"; then
3413   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3414 else
3415   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3416   ac_dummy="$PATH"
3417   for ac_dir in $ac_dummy; do
3418     test -z "$ac_dir" && ac_dir=.
3419     if test -f $ac_dir/$ac_word; then
3420       ac_cv_prog_DLLTOOL="dlltool"
3421       break
3422     fi
3423   done
3424   IFS="$ac_save_ifs"
3425   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3426 fi
3427 fi
3428 DLLTOOL="$ac_cv_prog_DLLTOOL"
3429 if test -n "$DLLTOOL"; then
3430   echo "$ac_t""$DLLTOOL" 1>&6
3431 else
3432   echo "$ac_t""no" 1>&6
3433 fi
3434
3435 else
3436   DLLTOOL="false"
3437 fi
3438 fi
3439
3440   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3441 set dummy ${ac_tool_prefix}as; ac_word=$2
3442 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3443 echo "configure:3444: checking for $ac_word" >&5
3444 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3445   echo $ac_n "(cached) $ac_c" 1>&6
3446 else
3447   if test -n "$AS"; then
3448   ac_cv_prog_AS="$AS" # Let the user override the test.
3449 else
3450   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3451   ac_dummy="$PATH"
3452   for ac_dir in $ac_dummy; do
3453     test -z "$ac_dir" && ac_dir=.
3454     if test -f $ac_dir/$ac_word; then
3455       ac_cv_prog_AS="${ac_tool_prefix}as"
3456       break
3457     fi
3458   done
3459   IFS="$ac_save_ifs"
3460 fi
3461 fi
3462 AS="$ac_cv_prog_AS"
3463 if test -n "$AS"; then
3464   echo "$ac_t""$AS" 1>&6
3465 else
3466   echo "$ac_t""no" 1>&6
3467 fi
3468
3469
3470 if test -z "$ac_cv_prog_AS"; then
3471 if test -n "$ac_tool_prefix"; then
3472   # Extract the first word of "as", so it can be a program name with args.
3473 set dummy as; ac_word=$2
3474 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3475 echo "configure:3476: checking for $ac_word" >&5
3476 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3477   echo $ac_n "(cached) $ac_c" 1>&6
3478 else
3479   if test -n "$AS"; then
3480   ac_cv_prog_AS="$AS" # Let the user override the test.
3481 else
3482   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3483   ac_dummy="$PATH"
3484   for ac_dir in $ac_dummy; do
3485     test -z "$ac_dir" && ac_dir=.
3486     if test -f $ac_dir/$ac_word; then
3487       ac_cv_prog_AS="as"
3488       break
3489     fi
3490   done
3491   IFS="$ac_save_ifs"
3492   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3493 fi
3494 fi
3495 AS="$ac_cv_prog_AS"
3496 if test -n "$AS"; then
3497   echo "$ac_t""$AS" 1>&6
3498 else
3499   echo "$ac_t""no" 1>&6
3500 fi
3501
3502 else
3503   AS="false"
3504 fi
3505 fi
3506
3507   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3508 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3509 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3510 echo "configure:3511: checking for $ac_word" >&5
3511 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3512   echo $ac_n "(cached) $ac_c" 1>&6
3513 else
3514   if test -n "$OBJDUMP"; then
3515   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3516 else
3517   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3518   ac_dummy="$PATH"
3519   for ac_dir in $ac_dummy; do
3520     test -z "$ac_dir" && ac_dir=.
3521     if test -f $ac_dir/$ac_word; then
3522       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3523       break
3524     fi
3525   done
3526   IFS="$ac_save_ifs"
3527 fi
3528 fi
3529 OBJDUMP="$ac_cv_prog_OBJDUMP"
3530 if test -n "$OBJDUMP"; then
3531   echo "$ac_t""$OBJDUMP" 1>&6
3532 else
3533   echo "$ac_t""no" 1>&6
3534 fi
3535
3536
3537 if test -z "$ac_cv_prog_OBJDUMP"; then
3538 if test -n "$ac_tool_prefix"; then
3539   # Extract the first word of "objdump", so it can be a program name with args.
3540 set dummy objdump; ac_word=$2
3541 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3542 echo "configure:3543: checking for $ac_word" >&5
3543 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3544   echo $ac_n "(cached) $ac_c" 1>&6
3545 else
3546   if test -n "$OBJDUMP"; then
3547   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3548 else
3549   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3550   ac_dummy="$PATH"
3551   for ac_dir in $ac_dummy; do
3552     test -z "$ac_dir" && ac_dir=.
3553     if test -f $ac_dir/$ac_word; then
3554       ac_cv_prog_OBJDUMP="objdump"
3555       break
3556     fi
3557   done
3558   IFS="$ac_save_ifs"
3559   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3560 fi
3561 fi
3562 OBJDUMP="$ac_cv_prog_OBJDUMP"
3563 if test -n "$OBJDUMP"; then
3564   echo "$ac_t""$OBJDUMP" 1>&6
3565 else
3566   echo "$ac_t""no" 1>&6
3567 fi
3568
3569 else
3570   OBJDUMP="false"
3571 fi
3572 fi
3573
3574   ;;
3575
3576 esac
3577
3578
3579 # Save cache, so that ltconfig can load it
3580
3581
3582 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3583 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3584 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3585 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3586 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3587 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3588 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3589 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3590
3591 # Reload cache, that may have been modified by ltconfig
3592
3593
3594 # This can be used to rebuild libtool when needed
3595 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3596
3597 # Always use our own libtool.
3598 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3599
3600 # Redirect the config.log output again, so that the ltconfig log is not
3601 # clobbered by the next message.
3602 exec 5>>./config.log
3603
3604
3605 for ac_prog in mawk gawk nawk awk
3606 do
3607 # Extract the first word of "$ac_prog", so it can be a program name with args.
3608 set dummy $ac_prog; ac_word=$2
3609 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3610 echo "configure:3611: checking for $ac_word" >&5
3611 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3612   echo $ac_n "(cached) $ac_c" 1>&6
3613 else
3614   if test -n "$AWK"; then
3615   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3616 else
3617   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3618   ac_dummy="$PATH"
3619   for ac_dir in $ac_dummy; do
3620     test -z "$ac_dir" && ac_dir=.
3621     if test -f $ac_dir/$ac_word; then
3622       ac_cv_prog_AWK="$ac_prog"
3623       break
3624     fi
3625   done
3626   IFS="$ac_save_ifs"
3627 fi
3628 fi
3629 AWK="$ac_cv_prog_AWK"
3630 if test -n "$AWK"; then
3631   echo "$ac_t""$AWK" 1>&6
3632 else
3633   echo "$ac_t""no" 1>&6
3634 fi
3635
3636 test -n "$AWK" && break
3637 done
3638
3639 # test for ln hardlink support
3640 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3641 echo "configure:3642: checking whether ln works" >&5
3642 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3643   echo $ac_n "(cached) $ac_c" 1>&6
3644 else
3645   rm -f conftest.src conftest.dst
3646 echo "conftest" > conftest.src
3647 if ln conftest.src conftest.dst 2>/dev/null
3648 then
3649   ol_cv_prog_LN_H="ln"
3650 else
3651   ol_cv_prog_LN_H="cp"
3652 fi
3653 rm -f conftest.src conftest.dst
3654
3655 fi
3656 LN_H="$ol_cv_prog_LN_H"
3657 if test "$ol_cv_prog_LN_H" = "ln"; then
3658         echo "$ac_t""yes" 1>&6
3659 else
3660         echo "$ac_t""no" 1>&6
3661 fi
3662
3663 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3664 echo "configure:3665: checking whether ln -s works" >&5
3665 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3666   echo $ac_n "(cached) $ac_c" 1>&6
3667 else
3668   rm -f conftestdata
3669 if ln -s X conftestdata 2>/dev/null
3670 then
3671   rm -f conftestdata
3672   ac_cv_prog_LN_S="ln -s"
3673 else
3674   ac_cv_prog_LN_S=ln
3675 fi
3676 fi
3677 LN_S="$ac_cv_prog_LN_S"
3678 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3679   echo "$ac_t""yes" 1>&6
3680 else
3681   echo "$ac_t""no" 1>&6
3682 fi
3683
3684
3685 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3686         LN_S="$LN_H"
3687 fi
3688
3689 # Extract the first word of "sendmail", so it can be a program name with args.
3690 set dummy sendmail; ac_word=$2
3691 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3692 echo "configure:3693: checking for $ac_word" >&5
3693 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3694   echo $ac_n "(cached) $ac_c" 1>&6
3695 else
3696   case "$SENDMAIL" in
3697   /*)
3698   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3699   ;;
3700   ?:/*)
3701   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3702   ;;
3703   *)
3704   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3705   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3706   for ac_dir in $ac_dummy; do 
3707     test -z "$ac_dir" && ac_dir=.
3708     if test -f $ac_dir/$ac_word; then
3709       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3710       break
3711     fi
3712   done
3713   IFS="$ac_save_ifs"
3714   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3715   ;;
3716 esac
3717 fi
3718 SENDMAIL="$ac_cv_path_SENDMAIL"
3719 if test -n "$SENDMAIL"; then
3720   echo "$ac_t""$SENDMAIL" 1>&6
3721 else
3722   echo "$ac_t""no" 1>&6
3723 fi
3724
3725 # Extract the first word of "vi", so it can be a program name with args.
3726 set dummy vi; ac_word=$2
3727 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3728 echo "configure:3729: checking for $ac_word" >&5
3729 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3730   echo $ac_n "(cached) $ac_c" 1>&6
3731 else
3732   case "$EDITOR" in
3733   /*)
3734   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3735   ;;
3736   ?:/*)
3737   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3738   ;;
3739   *)
3740   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3741   ac_dummy="$PATH:/usr/ucb"
3742   for ac_dir in $ac_dummy; do 
3743     test -z "$ac_dir" && ac_dir=.
3744     if test -f $ac_dir/$ac_word; then
3745       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3746       break
3747     fi
3748   done
3749   IFS="$ac_save_ifs"
3750   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3751   ;;
3752 esac
3753 fi
3754 EDITOR="$ac_cv_path_EDITOR"
3755 if test -n "$EDITOR"; then
3756   echo "$ac_t""$EDITOR" 1>&6
3757 else
3758   echo "$ac_t""no" 1>&6
3759 fi
3760
3761 # Extract the first word of "finger", so it can be a program name with args.
3762 set dummy finger; ac_word=$2
3763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3764 echo "configure:3765: checking for $ac_word" >&5
3765 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3766   echo $ac_n "(cached) $ac_c" 1>&6
3767 else
3768   case "$FINGER" in
3769   /*)
3770   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3771   ;;
3772   ?:/*)
3773   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3774   ;;
3775   *)
3776   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3777   ac_dummy="$PATH:/usr/ucb"
3778   for ac_dir in $ac_dummy; do 
3779     test -z "$ac_dir" && ac_dir=.
3780     if test -f $ac_dir/$ac_word; then
3781       ac_cv_path_FINGER="$ac_dir/$ac_word"
3782       break
3783     fi
3784   done
3785   IFS="$ac_save_ifs"
3786   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3787   ;;
3788 esac
3789 fi
3790 FINGER="$ac_cv_path_FINGER"
3791 if test -n "$FINGER"; then
3792   echo "$ac_t""$FINGER" 1>&6
3793 else
3794   echo "$ac_t""no" 1>&6
3795 fi
3796
3797
3798 ol_link_perl=no
3799 if test $ol_enable_perl != no ; then
3800         # Extract the first word of "perl", so it can be a program name with args.
3801 set dummy perl; ac_word=$2
3802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3803 echo "configure:3804: checking for $ac_word" >&5
3804 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3805   echo $ac_n "(cached) $ac_c" 1>&6
3806 else
3807   case "$PERLBIN" in
3808   /*)
3809   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3810   ;;
3811   ?:/*)
3812   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3813   ;;
3814   *)
3815   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3816   ac_dummy="$PATH"
3817   for ac_dir in $ac_dummy; do 
3818     test -z "$ac_dir" && ac_dir=.
3819     if test -f $ac_dir/$ac_word; then
3820       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3821       break
3822     fi
3823   done
3824   IFS="$ac_save_ifs"
3825   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3826   ;;
3827 esac
3828 fi
3829 PERLBIN="$ac_cv_path_PERLBIN"
3830 if test -n "$PERLBIN"; then
3831   echo "$ac_t""$PERLBIN" 1>&6
3832 else
3833   echo "$ac_t""no" 1>&6
3834 fi
3835
3836
3837         if test "no$PERLBIN" = "no" ; then
3838                 if test $ol_enable_perl = yes ; then
3839                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3840                 fi
3841
3842         else
3843                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3844                 if test x"$ol_with_perl_module" = "xstatic" ; then
3845                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3846                 else
3847                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3848                 fi
3849                                 ol_link_perl=yes
3850         fi
3851 fi
3852
3853 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3854 echo "configure:3855: checking how to run the C preprocessor" >&5
3855 # On Suns, sometimes $CPP names a directory.
3856 if test -n "$CPP" && test -d "$CPP"; then
3857   CPP=
3858 fi
3859 if test -z "$CPP"; then
3860 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863     # This must be in double quotes, not single quotes, because CPP may get
3864   # substituted into the Makefile and "${CC-cc}" will confuse make.
3865   CPP="${CC-cc} -E"
3866   # On the NeXT, cc -E runs the code through the compiler's parser,
3867   # not just through cpp.
3868   cat > conftest.$ac_ext <<EOF
3869 #line 3870 "configure"
3870 #include "confdefs.h"
3871 #include <assert.h>
3872 Syntax Error
3873 EOF
3874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3875 { (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3877 if test -z "$ac_err"; then
3878   :
3879 else
3880   echo "$ac_err" >&5
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   CPP="${CC-cc} -E -traditional-cpp"
3885   cat > conftest.$ac_ext <<EOF
3886 #line 3887 "configure"
3887 #include "confdefs.h"
3888 #include <assert.h>
3889 Syntax Error
3890 EOF
3891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3892 { (eval echo configure:3893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3894 if test -z "$ac_err"; then
3895   :
3896 else
3897   echo "$ac_err" >&5
3898   echo "configure: failed program was:" >&5
3899   cat conftest.$ac_ext >&5
3900   rm -rf conftest*
3901   CPP="${CC-cc} -nologo -E"
3902   cat > conftest.$ac_ext <<EOF
3903 #line 3904 "configure"
3904 #include "confdefs.h"
3905 #include <assert.h>
3906 Syntax Error
3907 EOF
3908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3909 { (eval echo configure:3910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3911 if test -z "$ac_err"; then
3912   :
3913 else
3914   echo "$ac_err" >&5
3915   echo "configure: failed program was:" >&5
3916   cat conftest.$ac_ext >&5
3917   rm -rf conftest*
3918   CPP=/lib/cpp
3919 fi
3920 rm -f conftest*
3921 fi
3922 rm -f conftest*
3923 fi
3924 rm -f conftest*
3925   ac_cv_prog_CPP="$CPP"
3926 fi
3927   CPP="$ac_cv_prog_CPP"
3928 else
3929   ac_cv_prog_CPP="$CPP"
3930 fi
3931 echo "$ac_t""$CPP" 1>&6
3932
3933
3934 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3935         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3936
3937 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3938         echo "configure: warning: programs compiled here do run here..." 1>&2
3939         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3940
3941 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3942         echo "configure: warning: programs compiled here do not run here..." 1>&2
3943         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3944 fi
3945
3946 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3947 echo "configure:3948: checking for AIX" >&5
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #ifdef _AIX
3952   yes
3953 #endif
3954
3955 EOF
3956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3957   egrep "yes" >/dev/null 2>&1; then
3958   rm -rf conftest*
3959   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3960 #define _ALL_SOURCE 1
3961 EOF
3962
3963 else
3964   rm -rf conftest*
3965   echo "$ac_t""no" 1>&6
3966 fi
3967 rm -f conftest*
3968
3969
3970 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3971 echo "configure:3972: checking for POSIXized ISC" >&5
3972 if test -d /etc/conf/kconfig.d &&
3973   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3974 then
3975   echo "$ac_t""yes" 1>&6
3976   ISC=yes # If later tests want to check for ISC.
3977   cat >> confdefs.h <<\EOF
3978 #define _POSIX_SOURCE 1
3979 EOF
3980
3981   if test "$GCC" = yes; then
3982     CC="$CC -posix"
3983   else
3984     CC="$CC -Xp"
3985   fi
3986 else
3987   echo "$ac_t""no" 1>&6
3988   ISC=
3989 fi
3990
3991 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3992 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3993 echo "configure:3994: checking for minix/config.h" >&5
3994 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3995   echo $ac_n "(cached) $ac_c" 1>&6
3996 else
3997   cat > conftest.$ac_ext <<EOF
3998 #line 3999 "configure"
3999 #include "confdefs.h"
4000 #include <minix/config.h>
4001 EOF
4002 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4003 { (eval echo configure:4004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4004 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4005 if test -z "$ac_err"; then
4006   rm -rf conftest*
4007   eval "ac_cv_header_$ac_safe=yes"
4008 else
4009   echo "$ac_err" >&5
4010   echo "configure: failed program was:" >&5
4011   cat conftest.$ac_ext >&5
4012   rm -rf conftest*
4013   eval "ac_cv_header_$ac_safe=no"
4014 fi
4015 rm -f conftest*
4016 fi
4017 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4018   echo "$ac_t""yes" 1>&6
4019   MINIX=yes
4020 else
4021   echo "$ac_t""no" 1>&6
4022 MINIX=
4023 fi
4024
4025 if test "$MINIX" = yes; then
4026   cat >> confdefs.h <<\EOF
4027 #define _POSIX_SOURCE 1
4028 EOF
4029
4030   cat >> confdefs.h <<\EOF
4031 #define _POSIX_1_SOURCE 2
4032 EOF
4033
4034   cat >> confdefs.h <<\EOF
4035 #define _MINIX 1
4036 EOF
4037
4038 fi
4039
4040
4041 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4042 echo "configure:4043: checking for Cygwin environment" >&5
4043 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4044   echo $ac_n "(cached) $ac_c" 1>&6
4045 else
4046   cat > conftest.$ac_ext <<EOF
4047 #line 4048 "configure"
4048 #include "confdefs.h"
4049
4050 int main() {
4051
4052 #ifndef __CYGWIN__
4053 #define __CYGWIN__ __CYGWIN32__
4054 #endif
4055 return __CYGWIN__;
4056 ; return 0; }
4057 EOF
4058 if { (eval echo configure:4059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4059   rm -rf conftest*
4060   ac_cv_cygwin=yes
4061 else
4062   echo "configure: failed program was:" >&5
4063   cat conftest.$ac_ext >&5
4064   rm -rf conftest*
4065   ac_cv_cygwin=no
4066 fi
4067 rm -f conftest*
4068 fi
4069
4070 echo "$ac_t""$ac_cv_cygwin" 1>&6
4071 CYGWIN=
4072 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4073 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4074 echo "configure:4075: checking for mingw32 environment" >&5
4075 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4076   echo $ac_n "(cached) $ac_c" 1>&6
4077 else
4078   cat > conftest.$ac_ext <<EOF
4079 #line 4080 "configure"
4080 #include "confdefs.h"
4081
4082 int main() {
4083 return __MINGW32__;
4084 ; return 0; }
4085 EOF
4086 if { (eval echo configure:4087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4087   rm -rf conftest*
4088   ac_cv_mingw32=yes
4089 else
4090   echo "configure: failed program was:" >&5
4091   cat conftest.$ac_ext >&5
4092   rm -rf conftest*
4093   ac_cv_mingw32=no
4094 fi
4095 rm -f conftest*
4096 fi
4097
4098 echo "$ac_t""$ac_cv_mingw32" 1>&6
4099 MINGW32=
4100 test "$ac_cv_mingw32" = yes && MINGW32=yes
4101 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4102 echo "configure:4103: checking for EMX OS/2 environment" >&5
4103 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4104   echo $ac_n "(cached) $ac_c" 1>&6
4105 else
4106   cat > conftest.$ac_ext <<EOF
4107 #line 4108 "configure"
4108 #include "confdefs.h"
4109
4110 int main() {
4111 return __EMX__;
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4115   rm -rf conftest*
4116   ac_cv_emxos2=yes
4117 else
4118   echo "configure: failed program was:" >&5
4119   cat conftest.$ac_ext >&5
4120   rm -rf conftest*
4121   ac_cv_emxos2=no
4122 fi
4123 rm -f conftest*
4124 fi
4125
4126 echo "$ac_t""$ac_cv_emxos2" 1>&6
4127 EMXOS2=
4128 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4129
4130
4131
4132 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4133 echo "configure:4134: checking for executable suffix" >&5
4134 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4135   echo $ac_n "(cached) $ac_c" 1>&6
4136 else
4137   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4138   ac_cv_exeext=.exe
4139 else
4140   rm -f conftest*
4141   echo 'int main () { return 0; }' > conftest.$ac_ext
4142   ac_cv_exeext=
4143   if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4144     for file in conftest.*; do
4145       case $file in
4146       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4147       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4148       esac
4149     done
4150   else
4151     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4152   fi
4153   rm -f conftest*
4154   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4155 fi
4156 fi
4157
4158 EXEEXT=""
4159 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4160 echo "$ac_t""${ac_cv_exeext}" 1>&6
4161 ac_exeext=$EXEEXT
4162
4163 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4164 echo "configure:4165: checking for object suffix" >&5
4165 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4166   echo $ac_n "(cached) $ac_c" 1>&6
4167 else
4168   rm -f conftest*
4169 echo 'int i = 1;' > conftest.$ac_ext
4170 if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4171   for ac_file in conftest.*; do
4172     case $ac_file in
4173     *.c) ;;
4174     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4175     esac
4176   done
4177 else
4178   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4179 fi
4180 rm -f conftest*
4181 fi
4182
4183 echo "$ac_t""$ac_cv_objext" 1>&6
4184 OBJEXT=$ac_cv_objext
4185 ac_objext=$ac_cv_objext
4186
4187
4188 cat >> confdefs.h <<EOF
4189 #define EXEEXT "${EXEEXT}"
4190 EOF
4191
4192
4193 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4194 echo "configure:4195: checking for be_app in -lbe" >&5
4195 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4196 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4197   echo $ac_n "(cached) $ac_c" 1>&6
4198 else
4199   ac_save_LIBS="$LIBS"
4200 LIBS="-lbe -lroot -lnet $LIBS"
4201 cat > conftest.$ac_ext <<EOF
4202 #line 4203 "configure"
4203 #include "confdefs.h"
4204 /* Override any gcc2 internal prototype to avoid an error.  */
4205 /* We use char because int might match the return type of a gcc2
4206     builtin and then its argument prototype would still apply.  */
4207 char be_app();
4208
4209 int main() {
4210 be_app()
4211 ; return 0; }
4212 EOF
4213 if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4214   rm -rf conftest*
4215   eval "ac_cv_lib_$ac_lib_var=yes"
4216 else
4217   echo "configure: failed program was:" >&5
4218   cat conftest.$ac_ext >&5
4219   rm -rf conftest*
4220   eval "ac_cv_lib_$ac_lib_var=no"
4221 fi
4222 rm -f conftest*
4223 LIBS="$ac_save_LIBS"
4224
4225 fi
4226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4227   echo "$ac_t""yes" 1>&6
4228   LIBS="$LIBS -lbe -lroot -lnet"
4229 else
4230   echo "$ac_t""no" 1>&6
4231 :
4232 fi
4233
4234
4235
4236
4237
4238 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4239 echo "configure:4240: checking for ${CC-cc} option to accept ANSI C" >&5
4240 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4241   echo $ac_n "(cached) $ac_c" 1>&6
4242 else
4243   am_cv_prog_cc_stdc=no
4244 ac_save_CC="$CC"
4245 # Don't try gcc -ansi; that turns off useful extensions and
4246 # breaks some systems' header files.
4247 # AIX                   -qlanglvl=ansi
4248 # Ultrix and OSF/1      -std1
4249 # HP-UX 10.20 and later -Ae
4250 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4251 # SVR4                  -Xc -D__EXTENSIONS__
4252 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4253 do
4254   CC="$ac_save_CC $ac_arg"
4255   cat > conftest.$ac_ext <<EOF
4256 #line 4257 "configure"
4257 #include "confdefs.h"
4258 #include <stdarg.h>
4259 #include <stdio.h>
4260 #include <sys/types.h>
4261 #include <sys/stat.h>
4262 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4263 struct buf { int x; };
4264 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4265 static char *e (p, i)
4266      char **p;
4267      int i;
4268 {
4269   return p[i];
4270 }
4271 static char *f (char * (*g) (char **, int), char **p, ...)
4272 {
4273   char *s;
4274   va_list v;
4275   va_start (v,p);
4276   s = g (p, va_arg (v,int));
4277   va_end (v);
4278   return s;
4279 }
4280 int test (int i, double x);
4281 struct s1 {int (*f) (int a);};
4282 struct s2 {int (*f) (double a);};
4283 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4284 int argc;
4285 char **argv;
4286
4287 int main() {
4288
4289 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4290
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4294   rm -rf conftest*
4295   am_cv_prog_cc_stdc="$ac_arg"; break
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299 fi
4300 rm -f conftest*
4301 done
4302 CC="$ac_save_CC"
4303
4304 fi
4305
4306 if test -z "$am_cv_prog_cc_stdc"; then
4307   echo "$ac_t""none needed" 1>&6
4308 else
4309   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4310 fi
4311 case "x$am_cv_prog_cc_stdc" in
4312   x|xno) ;;
4313   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4314 esac
4315
4316 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4317         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4318 fi
4319
4320 # test for make depend flag
4321 OL_MKDEP=
4322 OL_MKDEP_FLAGS=
4323 if test -z "${MKDEP}"; then
4324         OL_MKDEP="${CC-cc}"
4325         if test -z "${MKDEP_FLAGS}"; then
4326                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4327 echo "configure:4328: checking for ${OL_MKDEP} depend flag" >&5
4328 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4329   echo $ac_n "(cached) $ac_c" 1>&6
4330 else
4331   
4332                         ol_cv_mkdep=no
4333                         for flag in "-M" "-xM"; do
4334                                 cat > conftest.c <<EOF
4335  noCode;
4336 EOF
4337                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4338                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4339                                 then
4340                                         if test ! -f conftest."${ac_object}" ; then
4341                                                 ol_cv_mkdep=$flag
4342                                                 OL_MKDEP_FLAGS="$flag"
4343                                                 break
4344                                         fi
4345                                 fi
4346                         done
4347                         rm -f conftest*
4348                 
4349 fi
4350
4351 echo "$ac_t""$ol_cv_mkdep" 1>&6
4352         else
4353                 cc_cv_mkdep=yes
4354                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4355         fi
4356 else
4357         cc_cv_mkdep=yes
4358         OL_MKDEP="${MKDEP}"
4359         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4360 fi
4361
4362
4363
4364 if test "${ol_cv_mkdep}" = no ; then
4365         # this will soon become an error
4366         echo "configure: warning: do not know how to generate dependencies" 1>&2
4367 fi
4368
4369 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4370 echo "configure:4371: checking for afopen in -ls" >&5
4371 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4373   echo $ac_n "(cached) $ac_c" 1>&6
4374 else
4375   ac_save_LIBS="$LIBS"
4376 LIBS="-ls  $LIBS"
4377 cat > conftest.$ac_ext <<EOF
4378 #line 4379 "configure"
4379 #include "confdefs.h"
4380 /* Override any gcc2 internal prototype to avoid an error.  */
4381 /* We use char because int might match the return type of a gcc2
4382     builtin and then its argument prototype would still apply.  */
4383 char afopen();
4384
4385 int main() {
4386 afopen()
4387 ; return 0; }
4388 EOF
4389 if { (eval echo configure:4390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4390   rm -rf conftest*
4391   eval "ac_cv_lib_$ac_lib_var=yes"
4392 else
4393   echo "configure: failed program was:" >&5
4394   cat conftest.$ac_ext >&5
4395   rm -rf conftest*
4396   eval "ac_cv_lib_$ac_lib_var=no"
4397 fi
4398 rm -f conftest*
4399 LIBS="$ac_save_LIBS"
4400
4401 fi
4402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4403   echo "$ac_t""yes" 1>&6
4404   
4405         AUTH_LIBS=-ls
4406         cat >> confdefs.h <<\EOF
4407 #define HAVE_AIX_SECURITY 1
4408 EOF
4409
4410
4411 else
4412   echo "$ac_t""no" 1>&6
4413 fi
4414
4415
4416
4417 ol_link_modules=no
4418 if test $ol_enable_modules != no ; then
4419         for ac_hdr in ltdl.h
4420 do
4421 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4422 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4423 echo "configure:4424: checking for $ac_hdr" >&5
4424 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4425   echo $ac_n "(cached) $ac_c" 1>&6
4426 else
4427   cat > conftest.$ac_ext <<EOF
4428 #line 4429 "configure"
4429 #include "confdefs.h"
4430 #include <$ac_hdr>
4431 EOF
4432 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4433 { (eval echo configure:4434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4434 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4435 if test -z "$ac_err"; then
4436   rm -rf conftest*
4437   eval "ac_cv_header_$ac_safe=yes"
4438 else
4439   echo "$ac_err" >&5
4440   echo "configure: failed program was:" >&5
4441   cat conftest.$ac_ext >&5
4442   rm -rf conftest*
4443   eval "ac_cv_header_$ac_safe=no"
4444 fi
4445 rm -f conftest*
4446 fi
4447 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4448   echo "$ac_t""yes" 1>&6
4449     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4450   cat >> confdefs.h <<EOF
4451 #define $ac_tr_hdr 1
4452 EOF
4453  
4454 else
4455   echo "$ac_t""no" 1>&6
4456 fi
4457 done
4458
4459
4460         if test $ac_cv_header_ltdl_h = no ; then
4461                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4462         fi
4463
4464         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4465 echo "configure:4466: checking for lt_dlinit in -lltdl" >&5
4466 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4467 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4468   echo $ac_n "(cached) $ac_c" 1>&6
4469 else
4470   ac_save_LIBS="$LIBS"
4471 LIBS="-lltdl  $LIBS"
4472 cat > conftest.$ac_ext <<EOF
4473 #line 4474 "configure"
4474 #include "confdefs.h"
4475 /* Override any gcc2 internal prototype to avoid an error.  */
4476 /* We use char because int might match the return type of a gcc2
4477     builtin and then its argument prototype would still apply.  */
4478 char lt_dlinit();
4479
4480 int main() {
4481 lt_dlinit()
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   eval "ac_cv_lib_$ac_lib_var=yes"
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   eval "ac_cv_lib_$ac_lib_var=no"
4492 fi
4493 rm -f conftest*
4494 LIBS="$ac_save_LIBS"
4495
4496 fi
4497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4498   echo "$ac_t""yes" 1>&6
4499   
4500                 MODULES_LIBS=-lltdl
4501                 cat >> confdefs.h <<\EOF
4502 #define HAVE_LIBLTDL 1
4503 EOF
4504
4505         
4506 else
4507   echo "$ac_t""no" 1>&6
4508 fi
4509
4510
4511         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4512                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4513         fi
4514         ol_link_modules=yes
4515 else
4516         ol_with_bdb_module=static
4517         ol_with_dnssrv_module=static
4518         ol_with_ldap_module=static
4519         ol_with_ldbm_module=static
4520         ol_with_meta_module=static
4521         ol_with_monitor_module=static
4522         ol_with_passwd_module=static
4523         ol_with_perl_module=static
4524         ol_with_shell_module=static
4525         ol_with_tcl_module=static
4526         ol_with_sql_module=static
4527 fi
4528
4529 # test for EBCDIC
4530 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4531 echo "configure:4532: checking for EBCDIC" >&5
4532 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4533   echo $ac_n "(cached) $ac_c" 1>&6
4534 else
4535   
4536         cat > conftest.$ac_ext <<EOF
4537 #line 4538 "configure"
4538 #include "confdefs.h"
4539
4540 #if !('M' == 0xd4)
4541 #include <__ASCII__/generate_error.h>
4542 #endif
4543
4544 EOF
4545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4546 { (eval echo configure:4547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4548 if test -z "$ac_err"; then
4549   rm -rf conftest*
4550   ol_cv_cpp_ebcdic=yes
4551 else
4552   echo "$ac_err" >&5
4553   echo "configure: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   rm -rf conftest*
4556   ol_cv_cpp_ebcdic=no
4557 fi
4558 rm -f conftest*
4559 fi
4560
4561 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4562 if test $ol_cv_cpp_ebcdic = yes ; then
4563         cat >> confdefs.h <<\EOF
4564 #define HAVE_EBCDIC 1
4565 EOF
4566
4567 fi
4568
4569 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4570 echo "configure:4571: checking for ANSI C header files" >&5
4571 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4572   echo $ac_n "(cached) $ac_c" 1>&6
4573 else
4574   cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 #include <stdlib.h>
4578 #include <stdarg.h>
4579 #include <string.h>
4580 #include <float.h>
4581 EOF
4582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4583 { (eval echo configure:4584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4584 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4585 if test -z "$ac_err"; then
4586   rm -rf conftest*
4587   ol_cv_header_stdc=yes
4588 else
4589   echo "$ac_err" >&5
4590   echo "configure: failed program was:" >&5
4591   cat conftest.$ac_ext >&5
4592   rm -rf conftest*
4593   ol_cv_header_stdc=no
4594 fi
4595 rm -f conftest*
4596
4597 if test $ol_cv_header_stdc = yes; then
4598   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4599 cat > conftest.$ac_ext <<EOF
4600 #line 4601 "configure"
4601 #include "confdefs.h"
4602 #include <string.h>
4603 EOF
4604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4605   egrep "memchr" >/dev/null 2>&1; then
4606   :
4607 else
4608   rm -rf conftest*
4609   ol_cv_header_stdc=no
4610 fi
4611 rm -f conftest*
4612
4613 fi
4614
4615 if test $ol_cv_header_stdc = yes; then
4616   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4617 cat > conftest.$ac_ext <<EOF
4618 #line 4619 "configure"
4619 #include "confdefs.h"
4620 #include <stdlib.h>
4621 EOF
4622 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4623   egrep "free" >/dev/null 2>&1; then
4624   :
4625 else
4626   rm -rf conftest*
4627   ol_cv_header_stdc=no
4628 fi
4629 rm -f conftest*
4630
4631 fi
4632
4633 if test $ol_cv_header_stdc = yes; then
4634   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4635 if test "$cross_compiling" = yes; then
4636   :
4637 else
4638   cat > conftest.$ac_ext <<EOF
4639 #line 4640 "configure"
4640 #include "confdefs.h"
4641 #include <ctype.h>
4642 #ifndef HAVE_EBCDIC
4643 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4644 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4645 #else
4646 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4647                 || ('j' <= (c) && (c) <= 'r') \
4648                 || ('s' <= (c) && (c) <= 'z'))
4649 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4650 #endif
4651 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4652 int main () { int i; for (i = 0; i < 256; i++)
4653 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4654 exit (0); }
4655
4656 EOF
4657 if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4658 then
4659   :
4660 else
4661   echo "configure: failed program was:" >&5
4662   cat conftest.$ac_ext >&5
4663   rm -fr conftest*
4664   ol_cv_header_stdc=no
4665 fi
4666 rm -fr conftest*
4667 fi
4668
4669 fi
4670 fi
4671
4672 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4673 if test $ol_cv_header_stdc = yes; then
4674   cat >> confdefs.h <<\EOF
4675 #define STDC_HEADERS 1
4676 EOF
4677
4678 fi
4679 ac_cv_header_stdc=disable
4680
4681
4682 if test $ol_cv_header_stdc != yes; then
4683         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4684 fi
4685
4686 ac_header_dirent=no
4687 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4688 do
4689 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4690 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4691 echo "configure:4692: checking for $ac_hdr that defines DIR" >&5
4692 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4693   echo $ac_n "(cached) $ac_c" 1>&6
4694 else
4695   cat > conftest.$ac_ext <<EOF
4696 #line 4697 "configure"
4697 #include "confdefs.h"
4698 #include <sys/types.h>
4699 #include <$ac_hdr>
4700 int main() {
4701 DIR *dirp = 0;
4702 ; return 0; }
4703 EOF
4704 if { (eval echo configure:4705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4705   rm -rf conftest*
4706   eval "ac_cv_header_dirent_$ac_safe=yes"
4707 else
4708   echo "configure: failed program was:" >&5
4709   cat conftest.$ac_ext >&5
4710   rm -rf conftest*
4711   eval "ac_cv_header_dirent_$ac_safe=no"
4712 fi
4713 rm -f conftest*
4714 fi
4715 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4716   echo "$ac_t""yes" 1>&6
4717     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4718   cat >> confdefs.h <<EOF
4719 #define $ac_tr_hdr 1
4720 EOF
4721  ac_header_dirent=$ac_hdr; break
4722 else
4723   echo "$ac_t""no" 1>&6
4724 fi
4725 done
4726 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4727 if test $ac_header_dirent = dirent.h; then
4728 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4729 echo "configure:4730: checking for opendir in -ldir" >&5
4730 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4731 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4732   echo $ac_n "(cached) $ac_c" 1>&6
4733 else
4734   ac_save_LIBS="$LIBS"
4735 LIBS="-ldir  $LIBS"
4736 cat > conftest.$ac_ext <<EOF
4737 #line 4738 "configure"
4738 #include "confdefs.h"
4739 /* Override any gcc2 internal prototype to avoid an error.  */
4740 /* We use char because int might match the return type of a gcc2
4741     builtin and then its argument prototype would still apply.  */
4742 char opendir();
4743
4744 int main() {
4745 opendir()
4746 ; return 0; }
4747 EOF
4748 if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4749   rm -rf conftest*
4750   eval "ac_cv_lib_$ac_lib_var=yes"
4751 else
4752   echo "configure: failed program was:" >&5
4753   cat conftest.$ac_ext >&5
4754   rm -rf conftest*
4755   eval "ac_cv_lib_$ac_lib_var=no"
4756 fi
4757 rm -f conftest*
4758 LIBS="$ac_save_LIBS"
4759
4760 fi
4761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4762   echo "$ac_t""yes" 1>&6
4763   LIBS="$LIBS -ldir"
4764 else
4765   echo "$ac_t""no" 1>&6
4766 fi
4767
4768 else
4769 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4770 echo "configure:4771: checking for opendir in -lx" >&5
4771 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4772 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4773   echo $ac_n "(cached) $ac_c" 1>&6
4774 else
4775   ac_save_LIBS="$LIBS"
4776 LIBS="-lx  $LIBS"
4777 cat > conftest.$ac_ext <<EOF
4778 #line 4779 "configure"
4779 #include "confdefs.h"
4780 /* Override any gcc2 internal prototype to avoid an error.  */
4781 /* We use char because int might match the return type of a gcc2
4782     builtin and then its argument prototype would still apply.  */
4783 char opendir();
4784
4785 int main() {
4786 opendir()
4787 ; return 0; }
4788 EOF
4789 if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4790   rm -rf conftest*
4791   eval "ac_cv_lib_$ac_lib_var=yes"
4792 else
4793   echo "configure: failed program was:" >&5
4794   cat conftest.$ac_ext >&5
4795   rm -rf conftest*
4796   eval "ac_cv_lib_$ac_lib_var=no"
4797 fi
4798 rm -f conftest*
4799 LIBS="$ac_save_LIBS"
4800
4801 fi
4802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4803   echo "$ac_t""yes" 1>&6
4804   LIBS="$LIBS -lx"
4805 else
4806   echo "$ac_t""no" 1>&6
4807 fi
4808
4809 fi
4810
4811 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4812 echo "configure:4813: checking for sys/wait.h that is POSIX.1 compatible" >&5
4813 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816   cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819 #include <sys/types.h>
4820 #include <sys/wait.h>
4821 #ifndef WEXITSTATUS
4822 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4823 #endif
4824 #ifndef WIFEXITED
4825 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4826 #endif
4827 int main() {
4828 int s;
4829 wait (&s);
4830 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4831 ; return 0; }
4832 EOF
4833 if { (eval echo configure:4834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4834   rm -rf conftest*
4835   ac_cv_header_sys_wait_h=yes
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840   ac_cv_header_sys_wait_h=no
4841 fi
4842 rm -f conftest*
4843 fi
4844
4845 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4846 if test $ac_cv_header_sys_wait_h = yes; then
4847   cat >> confdefs.h <<\EOF
4848 #define HAVE_SYS_WAIT_H 1
4849 EOF
4850
4851 fi
4852
4853 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4854 echo "configure:4855: checking POSIX termios" >&5
4855 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4856   echo $ac_n "(cached) $ac_c" 1>&6
4857 else
4858   cat > conftest.$ac_ext <<EOF
4859 #line 4860 "configure"
4860 #include "confdefs.h"
4861 #include <sys/types.h>
4862 #include <unistd.h>
4863 #include <termios.h>
4864 int main() {
4865 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4866    tcgetattr(0, 0);
4867 ; return 0; }
4868 EOF
4869 if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4870   rm -rf conftest*
4871   am_cv_sys_posix_termios=yes
4872 else
4873   echo "configure: failed program was:" >&5
4874   cat conftest.$ac_ext >&5
4875   rm -rf conftest*
4876   am_cv_sys_posix_termios=no
4877 fi
4878 rm -f conftest*
4879 fi
4880
4881 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4882
4883
4884  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4885 echo "configure:4886: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4886 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4887   echo $ac_n "(cached) $ac_c" 1>&6
4888 else
4889   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4890
4891   gwinsz_in_termios_h=no
4892   if test $am_cv_sys_posix_termios = yes; then
4893     cat > conftest.$ac_ext <<EOF
4894 #line 4895 "configure"
4895 #include "confdefs.h"
4896 #include <sys/types.h>
4897 #     include <termios.h>
4898 #     ifdef TIOCGWINSZ
4899         yes
4900 #     endif
4901     
4902 EOF
4903 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4904   egrep "yes" >/dev/null 2>&1; then
4905   rm -rf conftest*
4906   gwinsz_in_termios_h=yes
4907 fi
4908 rm -f conftest*
4909
4910   fi
4911
4912   if test $gwinsz_in_termios_h = no; then
4913     cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916 #include <sys/types.h>
4917 #     include <sys/ioctl.h>
4918 #     ifdef TIOCGWINSZ
4919         yes
4920 #     endif
4921     
4922 EOF
4923 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4924   egrep "yes" >/dev/null 2>&1; then
4925   rm -rf conftest*
4926   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4927 fi
4928 rm -f conftest*
4929
4930   fi
4931   
4932 fi
4933
4934 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4935   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4936     cat >> confdefs.h <<\EOF
4937 #define GWINSZ_IN_SYS_IOCTL 1
4938 EOF
4939
4940   fi
4941
4942 if test $am_cv_sys_posix_termios = yes ; then
4943         cat >> confdefs.h <<\EOF
4944 #define HAVE_POSIX_TERMIOS 1
4945 EOF
4946
4947 fi
4948
4949 for ac_hdr in \
4950         arpa/inet.h             \
4951         arpa/nameser.h  \
4952         assert.h                \
4953         conio.h                 \
4954         crypt.h                 \
4955         direct.h                \
4956         errno.h                 \
4957         fcntl.h                 \
4958         filio.h                 \
4959         getopt.h                \
4960         grp.h                   \
4961         io.h                    \
4962         libutil.h               \
4963         limits.h                \
4964         locale.h                \
4965         netinet/tcp.h   \
4966         malloc.h                \
4967         memory.h                \
4968         psap.h                  \
4969         pwd.h                   \
4970         process.h               \
4971         resolv.h                \
4972         sgtty.h                 \
4973         shadow.h                \
4974         stddef.h                \
4975         string.h                \
4976         strings.h               \
4977         sysexits.h              \
4978         sys/file.h              \
4979         sys/filio.h             \
4980         sys/errno.h             \
4981         sys/ioctl.h             \
4982         sys/param.h             \
4983         sys/queue.h             \
4984         sys/resource.h  \
4985         sys/select.h    \
4986         sys/socket.h    \
4987         sys/syslog.h    \
4988         sys/time.h              \
4989         sys/types.h             \
4990         syslog.h                \
4991         termios.h               \
4992         unistd.h                \
4993         winsock.h               \
4994         winsock2.h              \
4995
4996 do
4997 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4998 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4999 echo "configure:5000: checking for $ac_hdr" >&5
5000 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5001   echo $ac_n "(cached) $ac_c" 1>&6
5002 else
5003   cat > conftest.$ac_ext <<EOF
5004 #line 5005 "configure"
5005 #include "confdefs.h"
5006 #include <$ac_hdr>
5007 EOF
5008 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5009 { (eval echo configure:5010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5010 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5011 if test -z "$ac_err"; then
5012   rm -rf conftest*
5013   eval "ac_cv_header_$ac_safe=yes"
5014 else
5015   echo "$ac_err" >&5
5016   echo "configure: failed program was:" >&5
5017   cat conftest.$ac_ext >&5
5018   rm -rf conftest*
5019   eval "ac_cv_header_$ac_safe=no"
5020 fi
5021 rm -f conftest*
5022 fi
5023 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5024   echo "$ac_t""yes" 1>&6
5025     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5026   cat >> confdefs.h <<EOF
5027 #define $ac_tr_hdr 1
5028 EOF
5029  
5030 else
5031   echo "$ac_t""no" 1>&6
5032 fi
5033 done
5034
5035
5036
5037
5038 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
5039 echo "configure:5040: checking for dlopen" >&5
5040 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5041   echo $ac_n "(cached) $ac_c" 1>&6
5042 else
5043   cat > conftest.$ac_ext <<EOF
5044 #line 5045 "configure"
5045 #include "confdefs.h"
5046 /* System header to define __stub macros and hopefully few prototypes,
5047     which can conflict with char dlopen(); below.  */
5048 #include <assert.h>
5049 /* Override any gcc2 internal prototype to avoid an error.  */
5050 /* We use char because int might match the return type of a gcc2
5051     builtin and then its argument prototype would still apply.  */
5052 char dlopen();
5053 char (*f)();
5054
5055 int main() {
5056
5057 /* The GNU C library defines this for functions which it implements
5058     to always fail with ENOSYS.  Some functions are actually named
5059     something starting with __ and the normal name is an alias.  */
5060 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5061 choke me
5062 #else
5063 f = dlopen;
5064 #endif
5065
5066 ; return 0; }
5067 EOF
5068 if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5069   rm -rf conftest*
5070   eval "ac_cv_func_dlopen=yes"
5071 else
5072   echo "configure: failed program was:" >&5
5073   cat conftest.$ac_ext >&5
5074   rm -rf conftest*
5075   eval "ac_cv_func_dlopen=no"
5076 fi
5077 rm -f conftest*
5078 fi
5079
5080 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5081   echo "$ac_t""yes" 1>&6
5082   :
5083 else
5084   echo "$ac_t""no" 1>&6
5085 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5086 echo "configure:5087: checking for dlopen in -ldl" >&5
5087 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5088 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5089   echo $ac_n "(cached) $ac_c" 1>&6
5090 else
5091   ac_save_LIBS="$LIBS"
5092 LIBS="-ldl  $LIBS"
5093 cat > conftest.$ac_ext <<EOF
5094 #line 5095 "configure"
5095 #include "confdefs.h"
5096 /* Override any gcc2 internal prototype to avoid an error.  */
5097 /* We use char because int might match the return type of a gcc2
5098     builtin and then its argument prototype would still apply.  */
5099 char dlopen();
5100
5101 int main() {
5102 dlopen()
5103 ; return 0; }
5104 EOF
5105 if { (eval echo configure:5106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5106   rm -rf conftest*
5107   eval "ac_cv_lib_$ac_lib_var=yes"
5108 else
5109   echo "configure: failed program was:" >&5
5110   cat conftest.$ac_ext >&5
5111   rm -rf conftest*
5112   eval "ac_cv_lib_$ac_lib_var=no"
5113 fi
5114 rm -f conftest*
5115 LIBS="$ac_save_LIBS"
5116
5117 fi
5118 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5119   echo "$ac_t""yes" 1>&6
5120     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5121     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5122   cat >> confdefs.h <<EOF
5123 #define $ac_tr_lib 1
5124 EOF
5125
5126   LIBS="-ldl $LIBS"
5127
5128 else
5129   echo "$ac_t""no" 1>&6
5130 fi
5131
5132 fi
5133
5134
5135 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5136 echo "configure:5137: checking for sigset in -lV3" >&5
5137 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5138 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5139   echo $ac_n "(cached) $ac_c" 1>&6
5140 else
5141   ac_save_LIBS="$LIBS"
5142 LIBS="-lV3  $LIBS"
5143 cat > conftest.$ac_ext <<EOF
5144 #line 5145 "configure"
5145 #include "confdefs.h"
5146 /* Override any gcc2 internal prototype to avoid an error.  */
5147 /* We use char because int might match the return type of a gcc2
5148     builtin and then its argument prototype would still apply.  */
5149 char sigset();
5150
5151 int main() {
5152 sigset()
5153 ; return 0; }
5154 EOF
5155 if { (eval echo configure:5156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5156   rm -rf conftest*
5157   eval "ac_cv_lib_$ac_lib_var=yes"
5158 else
5159   echo "configure: failed program was:" >&5
5160   cat conftest.$ac_ext >&5
5161   rm -rf conftest*
5162   eval "ac_cv_lib_$ac_lib_var=no"
5163 fi
5164 rm -f conftest*
5165 LIBS="$ac_save_LIBS"
5166
5167 fi
5168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5169   echo "$ac_t""yes" 1>&6
5170     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5171     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5172   cat >> confdefs.h <<EOF
5173 #define $ac_tr_lib 1
5174 EOF
5175
5176   LIBS="-lV3 $LIBS"
5177
5178 else
5179   echo "$ac_t""no" 1>&6
5180 fi
5181
5182
5183 echo $ac_n "checking for winsock""... $ac_c" 1>&6
5184 echo "configure:5185: checking for winsock" >&5
5185 save_LIBS="$LIBS"
5186 for curlib in ws2_32 wsock32; do
5187         LIBS="$LIBS -l$curlib"
5188         cat > conftest.$ac_ext <<EOF
5189 #line 5190 "configure"
5190 #include "confdefs.h"
5191
5192                         char socket@12();
5193                         char select@20();
5194                         char closesocket@4();
5195                         char gethostname@8();
5196                         
5197 int main() {
5198
5199                         socket@12();
5200                         select@20();
5201                         closesocket@4();
5202                         gethostname@8();
5203                         
5204 ; return 0; }
5205 EOF
5206 if { (eval echo configure:5207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5207   rm -rf conftest*
5208   have_winsock=yes
5209 else
5210   echo "configure: failed program was:" >&5
5211   cat conftest.$ac_ext >&5
5212   rm -rf conftest*
5213   have_winsock=no
5214 fi
5215 rm -f conftest*
5216
5217         if test $have_winsock = yes; then
5218                 cat >> confdefs.h <<\EOF
5219 #define HAVE_WINSOCK 1
5220 EOF
5221
5222                 ac_cv_func_socket=yes
5223                 ac_cv_func_select=yes
5224                 ac_cv_func_closesocket=yes
5225                 ac_cv_func_gethostname=yes
5226                 if test $curlib = ws2_32; then
5227                         have_winsock=winsock2
5228                         cat >> confdefs.h <<\EOF
5229 #define HAVE_WINSOCK2 1
5230 EOF
5231
5232                 fi
5233                 break
5234         fi
5235         LIBS="$save_LIBS"
5236 done
5237 echo "$ac_t""$have_winsock" 1>&6
5238
5239
5240 echo $ac_n "checking for socket""... $ac_c" 1>&6
5241 echo "configure:5242: checking for socket" >&5
5242 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5243   echo $ac_n "(cached) $ac_c" 1>&6
5244 else
5245   cat > conftest.$ac_ext <<EOF
5246 #line 5247 "configure"
5247 #include "confdefs.h"
5248 /* System header to define __stub macros and hopefully few prototypes,
5249     which can conflict with char socket(); below.  */
5250 #include <assert.h>
5251 /* Override any gcc2 internal prototype to avoid an error.  */
5252 /* We use char because int might match the return type of a gcc2
5253     builtin and then its argument prototype would still apply.  */
5254 char socket();
5255 char (*f)();
5256
5257 int main() {
5258
5259 /* The GNU C library defines this for functions which it implements
5260     to always fail with ENOSYS.  Some functions are actually named
5261     something starting with __ and the normal name is an alias.  */
5262 #if defined (__stub_socket) || defined (__stub___socket)
5263 choke me
5264 #else
5265 f = socket;
5266 #endif
5267
5268 ; return 0; }
5269 EOF
5270 if { (eval echo configure:5271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5271   rm -rf conftest*
5272   eval "ac_cv_func_socket=yes"
5273 else
5274   echo "configure: failed program was:" >&5
5275   cat conftest.$ac_ext >&5
5276   rm -rf conftest*
5277   eval "ac_cv_func_socket=no"
5278 fi
5279 rm -f conftest*
5280 fi
5281
5282 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5283   echo "$ac_t""yes" 1>&6
5284   :
5285 else
5286   echo "$ac_t""no" 1>&6
5287         
5288         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5289 echo "configure:5290: checking for main in -lsocket" >&5
5290 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5291 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5292   echo $ac_n "(cached) $ac_c" 1>&6
5293 else
5294   ac_save_LIBS="$LIBS"
5295 LIBS="-lsocket  $LIBS"
5296 cat > conftest.$ac_ext <<EOF
5297 #line 5298 "configure"
5298 #include "confdefs.h"
5299
5300 int main() {
5301 main()
5302 ; return 0; }
5303 EOF
5304 if { (eval echo configure:5305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5305   rm -rf conftest*
5306   eval "ac_cv_lib_$ac_lib_var=yes"
5307 else
5308   echo "configure: failed program was:" >&5
5309   cat conftest.$ac_ext >&5
5310   rm -rf conftest*
5311   eval "ac_cv_lib_$ac_lib_var=no"
5312 fi
5313 rm -f conftest*
5314 LIBS="$ac_save_LIBS"
5315
5316 fi
5317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5318   echo "$ac_t""yes" 1>&6
5319     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5320     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5321   cat >> confdefs.h <<EOF
5322 #define $ac_tr_lib 1
5323 EOF
5324
5325   LIBS="-lsocket $LIBS"
5326
5327 else
5328   echo "$ac_t""no" 1>&6
5329 fi
5330
5331         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5332 echo "configure:5333: checking for main in -lnet" >&5
5333 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5334 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5335   echo $ac_n "(cached) $ac_c" 1>&6
5336 else
5337   ac_save_LIBS="$LIBS"
5338 LIBS="-lnet  $LIBS"
5339 cat > conftest.$ac_ext <<EOF
5340 #line 5341 "configure"
5341 #include "confdefs.h"
5342
5343 int main() {
5344 main()
5345 ; return 0; }
5346 EOF
5347 if { (eval echo configure:5348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5348   rm -rf conftest*
5349   eval "ac_cv_lib_$ac_lib_var=yes"
5350 else
5351   echo "configure: failed program was:" >&5
5352   cat conftest.$ac_ext >&5
5353   rm -rf conftest*
5354   eval "ac_cv_lib_$ac_lib_var=no"
5355 fi
5356 rm -f conftest*
5357 LIBS="$ac_save_LIBS"
5358
5359 fi
5360 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5361   echo "$ac_t""yes" 1>&6
5362     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5363     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5364   cat >> confdefs.h <<EOF
5365 #define $ac_tr_lib 1
5366 EOF
5367
5368   LIBS="-lnet $LIBS"
5369
5370 else
5371   echo "$ac_t""no" 1>&6
5372 fi
5373
5374         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5375 echo "configure:5376: checking for main in -lnsl_s" >&5
5376 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5377 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5378   echo $ac_n "(cached) $ac_c" 1>&6
5379 else
5380   ac_save_LIBS="$LIBS"
5381 LIBS="-lnsl_s  $LIBS"
5382 cat > conftest.$ac_ext <<EOF
5383 #line 5384 "configure"
5384 #include "confdefs.h"
5385
5386 int main() {
5387 main()
5388 ; return 0; }
5389 EOF
5390 if { (eval echo configure:5391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5391   rm -rf conftest*
5392   eval "ac_cv_lib_$ac_lib_var=yes"
5393 else
5394   echo "configure: failed program was:" >&5
5395   cat conftest.$ac_ext >&5
5396   rm -rf conftest*
5397   eval "ac_cv_lib_$ac_lib_var=no"
5398 fi
5399 rm -f conftest*
5400 LIBS="$ac_save_LIBS"
5401
5402 fi
5403 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5404   echo "$ac_t""yes" 1>&6
5405     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5406     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5407   cat >> confdefs.h <<EOF
5408 #define $ac_tr_lib 1
5409 EOF
5410
5411   LIBS="-lnsl_s $LIBS"
5412
5413 else
5414   echo "$ac_t""no" 1>&6
5415 fi
5416
5417         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5418 echo "configure:5419: checking for main in -lnsl" >&5
5419 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5420 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5421   echo $ac_n "(cached) $ac_c" 1>&6
5422 else
5423   ac_save_LIBS="$LIBS"
5424 LIBS="-lnsl  $LIBS"
5425 cat > conftest.$ac_ext <<EOF
5426 #line 5427 "configure"
5427 #include "confdefs.h"
5428
5429 int main() {
5430 main()
5431 ; return 0; }
5432 EOF
5433 if { (eval echo configure:5434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5434   rm -rf conftest*
5435   eval "ac_cv_lib_$ac_lib_var=yes"
5436 else
5437   echo "configure: failed program was:" >&5
5438   cat conftest.$ac_ext >&5
5439   rm -rf conftest*
5440   eval "ac_cv_lib_$ac_lib_var=no"
5441 fi
5442 rm -f conftest*
5443 LIBS="$ac_save_LIBS"
5444
5445 fi
5446 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5447   echo "$ac_t""yes" 1>&6
5448     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5449     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5450   cat >> confdefs.h <<EOF
5451 #define $ac_tr_lib 1
5452 EOF
5453
5454   LIBS="-lnsl $LIBS"
5455
5456 else
5457   echo "$ac_t""no" 1>&6
5458 fi
5459
5460         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5461 echo "configure:5462: checking for socket in -linet" >&5
5462 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5463 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5464   echo $ac_n "(cached) $ac_c" 1>&6
5465 else
5466   ac_save_LIBS="$LIBS"
5467 LIBS="-linet  $LIBS"
5468 cat > conftest.$ac_ext <<EOF
5469 #line 5470 "configure"
5470 #include "confdefs.h"
5471 /* Override any gcc2 internal prototype to avoid an error.  */
5472 /* We use char because int might match the return type of a gcc2
5473     builtin and then its argument prototype would still apply.  */
5474 char socket();
5475
5476 int main() {
5477 socket()
5478 ; return 0; }
5479 EOF
5480 if { (eval echo configure:5481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5481   rm -rf conftest*
5482   eval "ac_cv_lib_$ac_lib_var=yes"
5483 else
5484   echo "configure: failed program was:" >&5
5485   cat conftest.$ac_ext >&5
5486   rm -rf conftest*
5487   eval "ac_cv_lib_$ac_lib_var=no"
5488 fi
5489 rm -f conftest*
5490 LIBS="$ac_save_LIBS"
5491
5492 fi
5493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5494   echo "$ac_t""yes" 1>&6
5495     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5496     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5497   cat >> confdefs.h <<EOF
5498 #define $ac_tr_lib 1
5499 EOF
5500
5501   LIBS="-linet $LIBS"
5502
5503 else
5504   echo "$ac_t""no" 1>&6
5505 fi
5506
5507         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5508 echo "configure:5509: checking for main in -lgen" >&5
5509 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5510 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5511   echo $ac_n "(cached) $ac_c" 1>&6
5512 else
5513   ac_save_LIBS="$LIBS"
5514 LIBS="-lgen  $LIBS"
5515 cat > conftest.$ac_ext <<EOF
5516 #line 5517 "configure"
5517 #include "confdefs.h"
5518
5519 int main() {
5520 main()
5521 ; return 0; }
5522 EOF
5523 if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5524   rm -rf conftest*
5525   eval "ac_cv_lib_$ac_lib_var=yes"
5526 else
5527   echo "configure: failed program was:" >&5
5528   cat conftest.$ac_ext >&5
5529   rm -rf conftest*
5530   eval "ac_cv_lib_$ac_lib_var=no"
5531 fi
5532 rm -f conftest*
5533 LIBS="$ac_save_LIBS"
5534
5535 fi
5536 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5537   echo "$ac_t""yes" 1>&6
5538     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5539     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5540   cat >> confdefs.h <<EOF
5541 #define $ac_tr_lib 1
5542 EOF
5543
5544   LIBS="-lgen $LIBS"
5545
5546 else
5547   echo "$ac_t""no" 1>&6
5548 fi
5549
5550
5551 fi
5552
5553
5554 echo $ac_n "checking for select""... $ac_c" 1>&6
5555 echo "configure:5556: checking for select" >&5
5556 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5557   echo $ac_n "(cached) $ac_c" 1>&6
5558 else
5559   cat > conftest.$ac_ext <<EOF
5560 #line 5561 "configure"
5561 #include "confdefs.h"
5562 /* System header to define __stub macros and hopefully few prototypes,
5563     which can conflict with char select(); below.  */
5564 #include <assert.h>
5565 /* Override any gcc2 internal prototype to avoid an error.  */
5566 /* We use char because int might match the return type of a gcc2
5567     builtin and then its argument prototype would still apply.  */
5568 char select();
5569 char (*f)();
5570
5571 int main() {
5572
5573 /* The GNU C library defines this for functions which it implements
5574     to always fail with ENOSYS.  Some functions are actually named
5575     something starting with __ and the normal name is an alias.  */
5576 #if defined (__stub_select) || defined (__stub___select)
5577 choke me
5578 #else
5579 f = select;
5580 #endif
5581
5582 ; return 0; }
5583 EOF
5584 if { (eval echo configure:5585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5585   rm -rf conftest*
5586   eval "ac_cv_func_select=yes"
5587 else
5588   echo "configure: failed program was:" >&5
5589   cat conftest.$ac_ext >&5
5590   rm -rf conftest*
5591   eval "ac_cv_func_select=no"
5592 fi
5593 rm -f conftest*
5594 fi
5595
5596 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5597   echo "$ac_t""yes" 1>&6
5598   :
5599 else
5600   echo "$ac_t""no" 1>&6
5601 { echo "configure: error: select() required." 1>&2; exit 1; }
5602 fi
5603
5604
5605 if test "${ac_cv_header_winsock_h}" != yes; then
5606                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5607 echo "configure:5608: checking types of arguments for select()" >&5
5608  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5609   echo $ac_n "(cached) $ac_c" 1>&6
5610 else
5611    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5612   echo $ac_n "(cached) $ac_c" 1>&6
5613 else
5614     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5615   echo $ac_n "(cached) $ac_c" 1>&6
5616 else
5617      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5618      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5619       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5620        cat > conftest.$ac_ext <<EOF
5621 #line 5622 "configure"
5622 #include "confdefs.h"
5623 #ifdef HAVE_SYS_TYPES_H
5624 #include <sys/types.h>
5625 #endif
5626 #ifdef HAVE_SYS_TIME_H
5627 #include <sys/time.h>
5628 #endif
5629 #ifdef HAVE_SYS_SELECT_H
5630 #include <sys/select.h>
5631 #endif
5632 #ifdef HAVE_SYS_SOCKET_H
5633 #include <sys/socket.h>
5634 #endif
5635 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);
5636 int main() {
5637
5638 ; return 0; }
5639 EOF
5640 if { (eval echo configure:5641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5641   rm -rf conftest*
5642           ac_not_found=no ; break 3
5643 else
5644   echo "configure: failed program was:" >&5
5645   cat conftest.$ac_ext >&5
5646   rm -rf conftest*
5647   ac_not_found=yes
5648 fi
5649 rm -f conftest*
5650       done
5651      done
5652     done
5653    
5654 fi
5655   
5656 fi
5657  
5658 fi
5659  if test "$ac_not_found" = yes; then
5660   ac_cv_func_select_arg1=int 
5661   ac_cv_func_select_arg234='int *' 
5662   ac_cv_func_select_arg5='struct timeval *'
5663  fi
5664  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5665  cat >> confdefs.h <<EOF
5666 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5667 EOF
5668
5669  cat >> confdefs.h <<EOF
5670 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5671 EOF
5672
5673  cat >> confdefs.h <<EOF
5674 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5675 EOF
5676
5677
5678 fi
5679
5680
5681 for ac_hdr in regex.h 
5682 do
5683 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5684 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5685 echo "configure:5686: checking for $ac_hdr" >&5
5686 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5687   echo $ac_n "(cached) $ac_c" 1>&6
5688 else
5689   cat > conftest.$ac_ext <<EOF
5690 #line 5691 "configure"
5691 #include "confdefs.h"
5692 #include <$ac_hdr>
5693 EOF
5694 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5695 { (eval echo configure:5696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5696 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5697 if test -z "$ac_err"; then
5698   rm -rf conftest*
5699   eval "ac_cv_header_$ac_safe=yes"
5700 else
5701   echo "$ac_err" >&5
5702   echo "configure: failed program was:" >&5
5703   cat conftest.$ac_ext >&5
5704   rm -rf conftest*
5705   eval "ac_cv_header_$ac_safe=no"
5706 fi
5707 rm -f conftest*
5708 fi
5709 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5710   echo "$ac_t""yes" 1>&6
5711     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5712   cat >> confdefs.h <<EOF
5713 #define $ac_tr_hdr 1
5714 EOF
5715  
5716 else
5717   echo "$ac_t""no" 1>&6
5718 fi
5719 done
5720
5721 if test "$ac_cv_header_regex_h" != yes ; then
5722         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5723 fi
5724
5725 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
5726 echo "configure:5727: checking for library containing regfree" >&5
5727 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
5728   echo $ac_n "(cached) $ac_c" 1>&6
5729 else
5730   ac_func_search_save_LIBS="$LIBS"
5731 ac_cv_search_regfree="no"
5732 cat > conftest.$ac_ext <<EOF
5733 #line 5734 "configure"
5734 #include "confdefs.h"
5735 /* Override any gcc2 internal prototype to avoid an error.  */
5736 /* We use char because int might match the return type of a gcc2
5737     builtin and then its argument prototype would still apply.  */
5738 char regfree();
5739
5740 int main() {
5741 regfree()
5742 ; return 0; }
5743 EOF
5744 if { (eval echo configure:5745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5745   rm -rf conftest*
5746   ac_cv_search_regfree="none required"
5747 else
5748   echo "configure: failed program was:" >&5
5749   cat conftest.$ac_ext >&5
5750 fi
5751 rm -f conftest*
5752 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
5753 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
5754 cat > conftest.$ac_ext <<EOF
5755 #line 5756 "configure"
5756 #include "confdefs.h"
5757 /* Override any gcc2 internal prototype to avoid an error.  */
5758 /* We use char because int might match the return type of a gcc2
5759     builtin and then its argument prototype would still apply.  */
5760 char regfree();
5761
5762 int main() {
5763 regfree()
5764 ; return 0; }
5765 EOF
5766 if { (eval echo configure:5767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5767   rm -rf conftest*
5768   ac_cv_search_regfree="-l$ac_lib"
5769 break
5770 else
5771   echo "configure: failed program was:" >&5
5772   cat conftest.$ac_ext >&5
5773 fi
5774 rm -f conftest*
5775 done
5776 LIBS="$ac_func_search_save_LIBS"
5777 fi
5778
5779 echo "$ac_t""$ac_cv_search_regfree" 1>&6
5780 if test "$ac_cv_search_regfree" != "no"; then
5781   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
5782   :
5783 else :
5784   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5785 fi
5786
5787
5788 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5789 echo "configure:5790: checking for compatible POSIX regex" >&5
5790 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5791   echo $ac_n "(cached) $ac_c" 1>&6
5792 else
5793   
5794         if test "$cross_compiling" = yes; then
5795   ol_cv_c_posix_regex=cross
5796 else
5797   cat > conftest.$ac_ext <<EOF
5798 #line 5799 "configure"
5799 #include "confdefs.h"
5800
5801 #include <sys/types.h>
5802 #include <regex.h>
5803 static char *pattern, *string;
5804 main()
5805 {
5806         int rc;
5807         regex_t re;
5808
5809         pattern = "^A";
5810
5811         if(regcomp(&re, pattern, 0)) {
5812                 return -1;
5813         }
5814         
5815         string = "ALL MATCH";
5816         
5817         rc = regexec(&re, string, 0, (void*)0, 0);
5818
5819         regfree(&re);
5820
5821         return rc;
5822 }
5823 EOF
5824 if { (eval echo configure:5825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5825 then
5826   ol_cv_c_posix_regex=yes
5827 else
5828   echo "configure: failed program was:" >&5
5829   cat conftest.$ac_ext >&5
5830   rm -fr conftest*
5831   ol_cv_c_posix_regex=no
5832 fi
5833 rm -fr conftest*
5834 fi
5835
5836 fi
5837
5838 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5839
5840 if test "$ol_cv_c_posix_regex" = no ; then
5841         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5842 fi
5843
5844 echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
5845 echo "configure:5846: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
5846 save_LIBS="$LIBS"
5847 LIBS="$LIBS -lrpcrt4"
5848 cat > conftest.$ac_ext <<EOF
5849 #line 5850 "configure"
5850 #include "confdefs.h"
5851
5852                 char UuidCreate@4();
5853                 char UuidToStringA@8();
5854                 
5855 int main() {
5856
5857                 UuidCreate@4();
5858                 UuidToStringA@8();
5859                 
5860 ; return 0; }
5861 EOF
5862 if { (eval echo configure:5863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5863   rm -rf conftest*
5864   need_rpcrt=yes
5865 else
5866   echo "configure: failed program was:" >&5
5867   cat conftest.$ac_ext >&5
5868   rm -rf conftest*
5869   need_rpcrt=no
5870 fi
5871 rm -f conftest*
5872 if test $need_rpcrt = yes; then
5873         SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
5874 fi
5875 LIBS="$save_LIBS"
5876 echo "$ac_t""$need_rpcrt" 1>&6
5877
5878 ol_link_dnssrv=no
5879 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5880 echo "configure:5881: checking for res_query" >&5
5881 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5882   echo $ac_n "(cached) $ac_c" 1>&6
5883 else
5884   cat > conftest.$ac_ext <<EOF
5885 #line 5886 "configure"
5886 #include "confdefs.h"
5887 /* System header to define __stub macros and hopefully few prototypes,
5888     which can conflict with char res_query(); below.  */
5889 #include <assert.h>
5890 /* Override any gcc2 internal prototype to avoid an error.  */
5891 /* We use char because int might match the return type of a gcc2
5892     builtin and then its argument prototype would still apply.  */
5893 char res_query();
5894 char (*f)();
5895
5896 int main() {
5897
5898 /* The GNU C library defines this for functions which it implements
5899     to always fail with ENOSYS.  Some functions are actually named
5900     something starting with __ and the normal name is an alias.  */
5901 #if defined (__stub_res_query) || defined (__stub___res_query)
5902 choke me
5903 #else
5904 f = res_query;
5905 #endif
5906
5907 ; return 0; }
5908 EOF
5909 if { (eval echo configure:5910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5910   rm -rf conftest*
5911   eval "ac_cv_func_res_query=yes"
5912 else
5913   echo "configure: failed program was:" >&5
5914   cat conftest.$ac_ext >&5
5915   rm -rf conftest*
5916   eval "ac_cv_func_res_query=no"
5917 fi
5918 rm -f conftest*
5919 fi
5920
5921 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5922   echo "$ac_t""yes" 1>&6
5923   :
5924 else
5925   echo "$ac_t""no" 1>&6
5926 fi
5927
5928 if test $ac_cv_func_res_query = no ; then 
5929         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5930 echo "configure:5931: checking for __res_query" >&5
5931 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5932   echo $ac_n "(cached) $ac_c" 1>&6
5933 else
5934   cat > conftest.$ac_ext <<EOF
5935 #line 5936 "configure"
5936 #include "confdefs.h"
5937 /* System header to define __stub macros and hopefully few prototypes,
5938     which can conflict with char __res_query(); below.  */
5939 #include <assert.h>
5940 /* Override any gcc2 internal prototype to avoid an error.  */
5941 /* We use char because int might match the return type of a gcc2
5942     builtin and then its argument prototype would still apply.  */
5943 char __res_query();
5944 char (*f)();
5945
5946 int main() {
5947
5948 /* The GNU C library defines this for functions which it implements
5949     to always fail with ENOSYS.  Some functions are actually named
5950     something starting with __ and the normal name is an alias.  */
5951 #if defined (__stub___res_query) || defined (__stub_____res_query)
5952 choke me
5953 #else
5954 f = __res_query;
5955 #endif
5956
5957 ; return 0; }
5958 EOF
5959 if { (eval echo configure:5960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5960   rm -rf conftest*
5961   eval "ac_cv_func___res_query=yes"
5962 else
5963   echo "configure: failed program was:" >&5
5964   cat conftest.$ac_ext >&5
5965   rm -rf conftest*
5966   eval "ac_cv_func___res_query=no"
5967 fi
5968 rm -f conftest*
5969 fi
5970
5971 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5972   echo "$ac_t""yes" 1>&6
5973   :
5974 else
5975   echo "$ac_t""no" 1>&6
5976 fi
5977
5978         ac_cv_func_res_query=$ac_cv_func___res_query
5979 fi
5980
5981 if test $ac_cv_func_res_query = no ; then 
5982         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5983 echo "configure:5984: checking for res_query in -lbind" >&5
5984 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5985 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5986   echo $ac_n "(cached) $ac_c" 1>&6
5987 else
5988   ac_save_LIBS="$LIBS"
5989 LIBS="-lbind  $LIBS"
5990 cat > conftest.$ac_ext <<EOF
5991 #line 5992 "configure"
5992 #include "confdefs.h"
5993 /* Override any gcc2 internal prototype to avoid an error.  */
5994 /* We use char because int might match the return type of a gcc2
5995     builtin and then its argument prototype would still apply.  */
5996 char res_query();
5997
5998 int main() {
5999 res_query()
6000 ; return 0; }
6001 EOF
6002 if { (eval echo configure:6003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6003   rm -rf conftest*
6004   eval "ac_cv_lib_$ac_lib_var=yes"
6005 else
6006   echo "configure: failed program was:" >&5
6007   cat conftest.$ac_ext >&5
6008   rm -rf conftest*
6009   eval "ac_cv_lib_$ac_lib_var=no"
6010 fi
6011 rm -f conftest*
6012 LIBS="$ac_save_LIBS"
6013
6014 fi
6015 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6016   echo "$ac_t""yes" 1>&6
6017     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6018     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6019   cat >> confdefs.h <<EOF
6020 #define $ac_tr_lib 1
6021 EOF
6022
6023   LIBS="-lbind $LIBS"
6024
6025 else
6026   echo "$ac_t""no" 1>&6
6027 fi
6028
6029         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
6030 fi
6031
6032 if test $ac_cv_func_res_query = no ; then 
6033         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
6034 echo "configure:6035: checking for __res_query in -lbind" >&5
6035 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
6036 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6037   echo $ac_n "(cached) $ac_c" 1>&6
6038 else
6039   ac_save_LIBS="$LIBS"
6040 LIBS="-lbind  $LIBS"
6041 cat > conftest.$ac_ext <<EOF
6042 #line 6043 "configure"
6043 #include "confdefs.h"
6044 /* Override any gcc2 internal prototype to avoid an error.  */
6045 /* We use char because int might match the return type of a gcc2
6046     builtin and then its argument prototype would still apply.  */
6047 char __res_query();
6048
6049 int main() {
6050 __res_query()
6051 ; return 0; }
6052 EOF
6053 if { (eval echo configure:6054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6054   rm -rf conftest*
6055   eval "ac_cv_lib_$ac_lib_var=yes"
6056 else
6057   echo "configure: failed program was:" >&5
6058   cat conftest.$ac_ext >&5
6059   rm -rf conftest*
6060   eval "ac_cv_lib_$ac_lib_var=no"
6061 fi
6062 rm -f conftest*
6063 LIBS="$ac_save_LIBS"
6064
6065 fi
6066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6067   echo "$ac_t""yes" 1>&6
6068     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6069     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6070   cat >> confdefs.h <<EOF
6071 #define $ac_tr_lib 1
6072 EOF
6073
6074   LIBS="-lbind $LIBS"
6075
6076 else
6077   echo "$ac_t""no" 1>&6
6078 fi
6079
6080         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
6081 fi
6082
6083 if test $ac_cv_func_res_query = no ; then 
6084         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
6085 echo "configure:6086: checking for res_query in -lresolv" >&5
6086 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
6087 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6088   echo $ac_n "(cached) $ac_c" 1>&6
6089 else
6090   ac_save_LIBS="$LIBS"
6091 LIBS="-lresolv  $LIBS"
6092 cat > conftest.$ac_ext <<EOF
6093 #line 6094 "configure"
6094 #include "confdefs.h"
6095 /* Override any gcc2 internal prototype to avoid an error.  */
6096 /* We use char because int might match the return type of a gcc2
6097     builtin and then its argument prototype would still apply.  */
6098 char res_query();
6099
6100 int main() {
6101 res_query()
6102 ; return 0; }
6103 EOF
6104 if { (eval echo configure:6105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6105   rm -rf conftest*
6106   eval "ac_cv_lib_$ac_lib_var=yes"
6107 else
6108   echo "configure: failed program was:" >&5
6109   cat conftest.$ac_ext >&5
6110   rm -rf conftest*
6111   eval "ac_cv_lib_$ac_lib_var=no"
6112 fi
6113 rm -f conftest*
6114 LIBS="$ac_save_LIBS"
6115
6116 fi
6117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6118   echo "$ac_t""yes" 1>&6
6119     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6120     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6121   cat >> confdefs.h <<EOF
6122 #define $ac_tr_lib 1
6123 EOF
6124
6125   LIBS="-lresolv $LIBS"
6126
6127 else
6128   echo "$ac_t""no" 1>&6
6129 fi
6130
6131         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6132 fi
6133
6134 if test $ac_cv_func_res_query = no ; then 
6135         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
6136 echo "configure:6137: checking for __res_query in -lresolv" >&5
6137 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
6138 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6139   echo $ac_n "(cached) $ac_c" 1>&6
6140 else
6141   ac_save_LIBS="$LIBS"
6142 LIBS="-lresolv  $LIBS"
6143 cat > conftest.$ac_ext <<EOF
6144 #line 6145 "configure"
6145 #include "confdefs.h"
6146 /* Override any gcc2 internal prototype to avoid an error.  */
6147 /* We use char because int might match the return type of a gcc2
6148     builtin and then its argument prototype would still apply.  */
6149 char __res_query();
6150
6151 int main() {
6152 __res_query()
6153 ; return 0; }
6154 EOF
6155 if { (eval echo configure:6156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6156   rm -rf conftest*
6157   eval "ac_cv_lib_$ac_lib_var=yes"
6158 else
6159   echo "configure: failed program was:" >&5
6160   cat conftest.$ac_ext >&5
6161   rm -rf conftest*
6162   eval "ac_cv_lib_$ac_lib_var=no"
6163 fi
6164 rm -f conftest*
6165 LIBS="$ac_save_LIBS"
6166
6167 fi
6168 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6169   echo "$ac_t""yes" 1>&6
6170     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6171     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6172   cat >> confdefs.h <<EOF
6173 #define $ac_tr_lib 1
6174 EOF
6175
6176   LIBS="-lresolv $LIBS"
6177
6178 else
6179   echo "$ac_t""no" 1>&6
6180 fi
6181
6182         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
6183 fi
6184
6185 if test "$ac_cv_func_res_query" = yes ; then
6186         cat >> confdefs.h <<\EOF
6187 #define HAVE_RES_QUERY 1
6188 EOF
6189
6190
6191         if test $ol_enable_dnssrv != no ; then
6192                 ol_link_dnssrv=yes
6193         fi
6194 fi
6195
6196 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6197         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6198 fi
6199
6200 for ac_func in getaddrinfo inet_ntop 
6201 do
6202 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6203 echo "configure:6204: checking for $ac_func" >&5
6204 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6205   echo $ac_n "(cached) $ac_c" 1>&6
6206 else
6207   cat > conftest.$ac_ext <<EOF
6208 #line 6209 "configure"
6209 #include "confdefs.h"
6210 /* System header to define __stub macros and hopefully few prototypes,
6211     which can conflict with char $ac_func(); below.  */
6212 #include <assert.h>
6213 /* Override any gcc2 internal prototype to avoid an error.  */
6214 /* We use char because int might match the return type of a gcc2
6215     builtin and then its argument prototype would still apply.  */
6216 char $ac_func();
6217 char (*f)();
6218
6219 int main() {
6220
6221 /* The GNU C library defines this for functions which it implements
6222     to always fail with ENOSYS.  Some functions are actually named
6223     something starting with __ and the normal name is an alias.  */
6224 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6225 choke me
6226 #else
6227 f = $ac_func;
6228 #endif
6229
6230 ; return 0; }
6231 EOF
6232 if { (eval echo configure:6233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6233   rm -rf conftest*
6234   eval "ac_cv_func_$ac_func=yes"
6235 else
6236   echo "configure: failed program was:" >&5
6237   cat conftest.$ac_ext >&5
6238   rm -rf conftest*
6239   eval "ac_cv_func_$ac_func=no"
6240 fi
6241 rm -f conftest*
6242 fi
6243
6244 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6245   echo "$ac_t""yes" 1>&6
6246     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6247   cat >> confdefs.h <<EOF
6248 #define $ac_tr_func 1
6249 EOF
6250  
6251 else
6252   echo "$ac_t""no" 1>&6
6253 fi
6254 done
6255
6256
6257 ol_link_ipv6=no
6258 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6259         if test $ol_enable_ipv6 = yes ; then
6260                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6261         fi
6262 else
6263         for ac_func in gai_strerror 
6264 do
6265 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6266 echo "configure:6267: checking for $ac_func" >&5
6267 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6268   echo $ac_n "(cached) $ac_c" 1>&6
6269 else
6270   cat > conftest.$ac_ext <<EOF
6271 #line 6272 "configure"
6272 #include "confdefs.h"
6273 /* System header to define __stub macros and hopefully few prototypes,
6274     which can conflict with char $ac_func(); below.  */
6275 #include <assert.h>
6276 /* Override any gcc2 internal prototype to avoid an error.  */
6277 /* We use char because int might match the return type of a gcc2
6278     builtin and then its argument prototype would still apply.  */
6279 char $ac_func();
6280 char (*f)();
6281
6282 int main() {
6283
6284 /* The GNU C library defines this for functions which it implements
6285     to always fail with ENOSYS.  Some functions are actually named
6286     something starting with __ and the normal name is an alias.  */
6287 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6288 choke me
6289 #else
6290 f = $ac_func;
6291 #endif
6292
6293 ; return 0; }
6294 EOF
6295 if { (eval echo configure:6296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6296   rm -rf conftest*
6297   eval "ac_cv_func_$ac_func=yes"
6298 else
6299   echo "configure: failed program was:" >&5
6300   cat conftest.$ac_ext >&5
6301   rm -rf conftest*
6302   eval "ac_cv_func_$ac_func=no"
6303 fi
6304 rm -f conftest*
6305 fi
6306
6307 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6308   echo "$ac_t""yes" 1>&6
6309     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6310   cat >> confdefs.h <<EOF
6311 #define $ac_tr_func 1
6312 EOF
6313  
6314 else
6315   echo "$ac_t""no" 1>&6
6316 fi
6317 done
6318
6319
6320         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6321 echo "configure:6322: checking INET6_ADDRSTRLEN" >&5
6322 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6323   echo $ac_n "(cached) $ac_c" 1>&6
6324 else
6325   
6326                 cat > conftest.$ac_ext <<EOF
6327 #line 6328 "configure"
6328 #include "confdefs.h"
6329
6330 #                       include <netinet/in.h>
6331 #                       ifdef INET6_ADDRSTRLEN
6332                                 __has_inet6_addrstrlen__;
6333 #                       endif
6334                 
6335 EOF
6336 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6337   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6338   rm -rf conftest*
6339   ol_cv_inet6_addrstrlen=yes
6340 else
6341   rm -rf conftest*
6342   ol_cv_inet6_addrstrlen=no
6343 fi
6344 rm -f conftest*
6345
6346 fi
6347
6348 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6349
6350         if test $ol_cv_inet6_addrstrlen = yes ; then
6351                 ol_link_ipv6=yes
6352         elif test $ol_enable_ipv6 = yes ; then
6353                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6354         fi
6355 fi
6356
6357 if test $ol_enable_local != no ; then
6358         for ac_hdr in sys/un.h 
6359 do
6360 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6361 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6362 echo "configure:6363: checking for $ac_hdr" >&5
6363 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6364   echo $ac_n "(cached) $ac_c" 1>&6
6365 else
6366   cat > conftest.$ac_ext <<EOF
6367 #line 6368 "configure"
6368 #include "confdefs.h"
6369 #include <$ac_hdr>
6370 EOF
6371 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6372 { (eval echo configure:6373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6373 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6374 if test -z "$ac_err"; then
6375   rm -rf conftest*
6376   eval "ac_cv_header_$ac_safe=yes"
6377 else
6378   echo "$ac_err" >&5
6379   echo "configure: failed program was:" >&5
6380   cat conftest.$ac_ext >&5
6381   rm -rf conftest*
6382   eval "ac_cv_header_$ac_safe=no"
6383 fi
6384 rm -f conftest*
6385 fi
6386 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6387   echo "$ac_t""yes" 1>&6
6388     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6389   cat >> confdefs.h <<EOF
6390 #define $ac_tr_hdr 1
6391 EOF
6392  
6393 else
6394   echo "$ac_t""no" 1>&6
6395 fi
6396 done
6397
6398
6399         if test $ol_enable_local = auto ; then
6400                 ol_enable_local=$ac_cv_header_sys_un_h
6401         elif test $ac_cv_header_sys_un_h = no ; then
6402                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6403         fi
6404 fi
6405
6406 ol_link_kbind=no
6407 ol_link_kpasswd=no
6408 ol_link_krb5=no
6409 ol_link_krb4=no
6410
6411 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6412         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6413         -o $ol_with_kerberos = k425 ; then
6414
6415         for ac_hdr in krb5.h
6416 do
6417 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6418 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6419 echo "configure:6420: checking for $ac_hdr" >&5
6420 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6421   echo $ac_n "(cached) $ac_c" 1>&6
6422 else
6423   cat > conftest.$ac_ext <<EOF
6424 #line 6425 "configure"
6425 #include "confdefs.h"
6426 #include <$ac_hdr>
6427 EOF
6428 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6429 { (eval echo configure:6430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6430 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6431 if test -z "$ac_err"; then
6432   rm -rf conftest*
6433   eval "ac_cv_header_$ac_safe=yes"
6434 else
6435   echo "$ac_err" >&5
6436   echo "configure: failed program was:" >&5
6437   cat conftest.$ac_ext >&5
6438   rm -rf conftest*
6439   eval "ac_cv_header_$ac_safe=no"
6440 fi
6441 rm -f conftest*
6442 fi
6443 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6444   echo "$ac_t""yes" 1>&6
6445     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6446   cat >> confdefs.h <<EOF
6447 #define $ac_tr_hdr 1
6448 EOF
6449  
6450 else
6451   echo "$ac_t""no" 1>&6
6452 fi
6453 done
6454
6455
6456         if test $ac_cv_header_krb5_h = yes ; then
6457                                 for ac_hdr in heim_err.h
6458 do
6459 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6460 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6461 echo "configure:6462: checking for $ac_hdr" >&5
6462 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6463   echo $ac_n "(cached) $ac_c" 1>&6
6464 else
6465   cat > conftest.$ac_ext <<EOF
6466 #line 6467 "configure"
6467 #include "confdefs.h"
6468 #include <$ac_hdr>
6469 EOF
6470 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6471 { (eval echo configure:6472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6472 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6473 if test -z "$ac_err"; then
6474   rm -rf conftest*
6475   eval "ac_cv_header_$ac_safe=yes"
6476 else
6477   echo "$ac_err" >&5
6478   echo "configure: failed program was:" >&5
6479   cat conftest.$ac_ext >&5
6480   rm -rf conftest*
6481   eval "ac_cv_header_$ac_safe=no"
6482 fi
6483 rm -f conftest*
6484 fi
6485 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6486   echo "$ac_t""yes" 1>&6
6487     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6488   cat >> confdefs.h <<EOF
6489 #define $ac_tr_hdr 1
6490 EOF
6491  
6492 else
6493   echo "$ac_t""no" 1>&6
6494 fi
6495 done
6496
6497                 if test $ac_cv_header_heim_err_h = yes ; then
6498                         krb5_impl=heimdal
6499                 else
6500                         krb5_impl=mit
6501                 fi
6502
6503                 if test $krb5_impl = mit; then
6504                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6505 echo "configure:6506: checking for main in -lk5crypto" >&5
6506 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6507 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6508   echo $ac_n "(cached) $ac_c" 1>&6
6509 else
6510   ac_save_LIBS="$LIBS"
6511 LIBS="-lk5crypto  $LIBS"
6512 cat > conftest.$ac_ext <<EOF
6513 #line 6514 "configure"
6514 #include "confdefs.h"
6515
6516 int main() {
6517 main()
6518 ; return 0; }
6519 EOF
6520 if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6521   rm -rf conftest*
6522   eval "ac_cv_lib_$ac_lib_var=yes"
6523 else
6524   echo "configure: failed program was:" >&5
6525   cat conftest.$ac_ext >&5
6526   rm -rf conftest*
6527   eval "ac_cv_lib_$ac_lib_var=no"
6528 fi
6529 rm -f conftest*
6530 LIBS="$ac_save_LIBS"
6531
6532 fi
6533 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6534   echo "$ac_t""yes" 1>&6
6535   krb5crypto=k5crypto
6536 else
6537   echo "$ac_t""no" 1>&6
6538 krb5crypto=crypto
6539 fi
6540
6541
6542                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6543 echo "configure:6544: checking for main in -lkrb5" >&5
6544 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6545 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6546   echo $ac_n "(cached) $ac_c" 1>&6
6547 else
6548   ac_save_LIBS="$LIBS"
6549 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6550 cat > conftest.$ac_ext <<EOF
6551 #line 6552 "configure"
6552 #include "confdefs.h"
6553
6554 int main() {
6555 main()
6556 ; return 0; }
6557 EOF
6558 if { (eval echo configure:6559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6559   rm -rf conftest*
6560   eval "ac_cv_lib_$ac_lib_var=yes"
6561 else
6562   echo "configure: failed program was:" >&5
6563   cat conftest.$ac_ext >&5
6564   rm -rf conftest*
6565   eval "ac_cv_lib_$ac_lib_var=no"
6566 fi
6567 rm -f conftest*
6568 LIBS="$ac_save_LIBS"
6569
6570 fi
6571 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6572   echo "$ac_t""yes" 1>&6
6573   have_krb5=yes
6574                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6575 else
6576   echo "$ac_t""no" 1>&6
6577 have_krb5=no
6578 fi
6579
6580
6581                 elif test $krb5_impl = heimdal; then
6582                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6583 echo "configure:6584: checking for main in -lkrb5" >&5
6584 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6585 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6586   echo $ac_n "(cached) $ac_c" 1>&6
6587 else
6588   ac_save_LIBS="$LIBS"
6589 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6590 cat > conftest.$ac_ext <<EOF
6591 #line 6592 "configure"
6592 #include "confdefs.h"
6593
6594 int main() {
6595 main()
6596 ; return 0; }
6597 EOF
6598 if { (eval echo configure:6599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6599   rm -rf conftest*
6600   eval "ac_cv_lib_$ac_lib_var=yes"
6601 else
6602   echo "configure: failed program was:" >&5
6603   cat conftest.$ac_ext >&5
6604   rm -rf conftest*
6605   eval "ac_cv_lib_$ac_lib_var=no"
6606 fi
6607 rm -f conftest*
6608 LIBS="$ac_save_LIBS"
6609
6610 fi
6611 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6612   echo "$ac_t""yes" 1>&6
6613   have_krb5=yes
6614                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6615 else
6616   echo "$ac_t""no" 1>&6
6617 have_krb5=no
6618 fi
6619
6620
6621                         cat >> confdefs.h <<\EOF
6622 #define HAVE_HEIMDAL_KERBEROS 1
6623 EOF
6624
6625
6626                 else
6627                         have_krb5=no
6628                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6629                 fi
6630
6631                 if test $have_krb5 = yes ; then
6632                         ol_link_krb5=yes
6633
6634                         cat >> confdefs.h <<\EOF
6635 #define HAVE_KRB5 1
6636 EOF
6637
6638
6639                         if test $ol_enable_kpasswd != no ; then
6640                                 ol_link_kpasswd=yes;
6641                         fi
6642
6643                         if test $ol_with_kerberos = k5only ; then
6644                                 ol_with_kerberos=found
6645                         fi
6646
6647                 elif test $ol_with_kerberos != auto ; then
6648                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6649                 fi
6650
6651         fi
6652 fi
6653
6654 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6655         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6656
6657         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6658 do
6659 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6660 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6661 echo "configure:6662: checking for $ac_hdr" >&5
6662 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6663   echo $ac_n "(cached) $ac_c" 1>&6
6664 else
6665   cat > conftest.$ac_ext <<EOF
6666 #line 6667 "configure"
6667 #include "confdefs.h"
6668 #include <$ac_hdr>
6669 EOF
6670 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6671 { (eval echo configure:6672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6672 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6673 if test -z "$ac_err"; then
6674   rm -rf conftest*
6675   eval "ac_cv_header_$ac_safe=yes"
6676 else
6677   echo "$ac_err" >&5
6678   echo "configure: failed program was:" >&5
6679   cat conftest.$ac_ext >&5
6680   rm -rf conftest*
6681   eval "ac_cv_header_$ac_safe=no"
6682 fi
6683 rm -f conftest*
6684 fi
6685 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6686   echo "$ac_t""yes" 1>&6
6687     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6688   cat >> confdefs.h <<EOF
6689 #define $ac_tr_hdr 1
6690 EOF
6691  
6692 else
6693   echo "$ac_t""no" 1>&6
6694 fi
6695 done
6696
6697
6698         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6699                 if test $krb5_impl = mit; then
6700                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6701 echo "configure:6702: checking for main in -lkrb4" >&5
6702 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6703 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6704   echo $ac_n "(cached) $ac_c" 1>&6
6705 else
6706   ac_save_LIBS="$LIBS"
6707 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6708 cat > conftest.$ac_ext <<EOF
6709 #line 6710 "configure"
6710 #include "confdefs.h"
6711
6712 int main() {
6713 main()
6714 ; return 0; }
6715 EOF
6716 if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6717   rm -rf conftest*
6718   eval "ac_cv_lib_$ac_lib_var=yes"
6719 else
6720   echo "configure: failed program was:" >&5
6721   cat conftest.$ac_ext >&5
6722   rm -rf conftest*
6723   eval "ac_cv_lib_$ac_lib_var=no"
6724 fi
6725 rm -f conftest*
6726 LIBS="$ac_save_LIBS"
6727
6728 fi
6729 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6730   echo "$ac_t""yes" 1>&6
6731   have_k425=yes
6732                                 KRB4_LIBS="-lkrb4 -ldes425"
6733 else
6734   echo "$ac_t""no" 1>&6
6735 have_k425=no
6736 fi
6737
6738
6739                 elif test $krb5_impl = heimdal; then
6740                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6741 echo "configure:6742: checking for main in -lkrb4" >&5
6742 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6743 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6744   echo $ac_n "(cached) $ac_c" 1>&6
6745 else
6746   ac_save_LIBS="$LIBS"
6747 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6748 cat > conftest.$ac_ext <<EOF
6749 #line 6750 "configure"
6750 #include "confdefs.h"
6751
6752 int main() {
6753 main()
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6757   rm -rf conftest*
6758   eval "ac_cv_lib_$ac_lib_var=yes"
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   eval "ac_cv_lib_$ac_lib_var=no"
6764 fi
6765 rm -f conftest*
6766 LIBS="$ac_save_LIBS"
6767
6768 fi
6769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6770   echo "$ac_t""yes" 1>&6
6771   have_k425=yes
6772                                 KRB4_LIBS="-lkrb4"
6773 else
6774   echo "$ac_t""no" 1>&6
6775 have_k425=no
6776 fi
6777
6778
6779                 else
6780                         have_425=no
6781                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6782                 fi
6783
6784                 if test $have_k425 = yes ; then
6785                         ol_with_kerberos=found
6786                         ol_link_krb4=yes
6787
6788                         cat >> confdefs.h <<\EOF
6789 #define HAVE_KRB425 1
6790 EOF
6791
6792                         cat >> confdefs.h <<\EOF
6793 #define HAVE_KRB4 1
6794 EOF
6795
6796
6797                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6798 echo "configure:6799: checking for des_debug in Kerberos libraries" >&5
6799 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6800   echo $ac_n "(cached) $ac_c" 1>&6
6801 else
6802   
6803                                                                 save_LIBS="$LIBS"
6804                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6805                                 cat > conftest.$ac_ext <<EOF
6806 #line 6807 "configure"
6807 #include "confdefs.h"
6808
6809 #include <kerberosIV/krb.h>
6810 #include <kerberosIV/des.h>
6811 extern int des_debug;
6812
6813 int main() {
6814
6815 des_debug = 1;
6816
6817 ; return 0; }
6818 EOF
6819 if { (eval echo configure:6820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6820   rm -rf conftest*
6821   ol_cv_var_des_debug=yes
6822 else
6823   echo "configure: failed program was:" >&5
6824   cat conftest.$ac_ext >&5
6825   rm -rf conftest*
6826   ol_cv_var_des_debug=no
6827 fi
6828 rm -f conftest*
6829                                                                 LIBS="$save_LIBS"
6830                         
6831 fi
6832
6833 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6834
6835                         if test $ol_cv_var_des_debug = yes ; then
6836                                 cat >> confdefs.h <<\EOF
6837 #define HAVE_DES_DEBUG 1
6838 EOF
6839
6840                         fi
6841
6842                         LIBS="$save_LIBS"
6843                 fi
6844         fi
6845 fi
6846
6847 if test $ol_link_krb5 = yes ; then
6848         ol_with_kerberos=found
6849 fi
6850
6851 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6852         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6853
6854         for ac_hdr in krb.h des.h krb-archaeology.h 
6855 do
6856 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6857 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6858 echo "configure:6859: checking for $ac_hdr" >&5
6859 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6860   echo $ac_n "(cached) $ac_c" 1>&6
6861 else
6862   cat > conftest.$ac_ext <<EOF
6863 #line 6864 "configure"
6864 #include "confdefs.h"
6865 #include <$ac_hdr>
6866 EOF
6867 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6868 { (eval echo configure:6869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6869 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6870 if test -z "$ac_err"; then
6871   rm -rf conftest*
6872   eval "ac_cv_header_$ac_safe=yes"
6873 else
6874   echo "$ac_err" >&5
6875   echo "configure: failed program was:" >&5
6876   cat conftest.$ac_ext >&5
6877   rm -rf conftest*
6878   eval "ac_cv_header_$ac_safe=no"
6879 fi
6880 rm -f conftest*
6881 fi
6882 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6883   echo "$ac_t""yes" 1>&6
6884     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6885   cat >> confdefs.h <<EOF
6886 #define $ac_tr_hdr 1
6887 EOF
6888  
6889 else
6890   echo "$ac_t""no" 1>&6
6891 fi
6892 done
6893
6894
6895         if test $ac_cv_header_krb_h = yes ; then
6896                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6897 echo "configure:6898: checking for main in -lkrb" >&5
6898 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6899 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6900   echo $ac_n "(cached) $ac_c" 1>&6
6901 else
6902   ac_save_LIBS="$LIBS"
6903 LIBS="-lkrb -ldes $LIBS"
6904 cat > conftest.$ac_ext <<EOF
6905 #line 6906 "configure"
6906 #include "confdefs.h"
6907
6908 int main() {
6909 main()
6910 ; return 0; }
6911 EOF
6912 if { (eval echo configure:6913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6913   rm -rf conftest*
6914   eval "ac_cv_lib_$ac_lib_var=yes"
6915 else
6916   echo "configure: failed program was:" >&5
6917   cat conftest.$ac_ext >&5
6918   rm -rf conftest*
6919   eval "ac_cv_lib_$ac_lib_var=no"
6920 fi
6921 rm -f conftest*
6922 LIBS="$ac_save_LIBS"
6923
6924 fi
6925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6926   echo "$ac_t""yes" 1>&6
6927   have_k4=yes
6928 else
6929   echo "$ac_t""no" 1>&6
6930 have_k4=no
6931 fi
6932
6933
6934                 if test $have_k4 = yes ; then
6935                         ol_with_kerberos=found
6936                         ol_link_krb4=yes
6937
6938                         cat >> confdefs.h <<\EOF
6939 #define HAVE_KRB4 1
6940 EOF
6941
6942
6943                         KRB4_LIBS="-lkrb -ldes"
6944
6945                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6946                                 cat >> confdefs.h <<\EOF
6947 #define HAVE_KTH_KERBEROS 1
6948 EOF
6949
6950                         fi
6951                 fi
6952         fi
6953 fi
6954
6955 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6956         ol_link_kpasswd=yes
6957 fi
6958
6959 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6960         ol_link_kbind=yes
6961
6962 elif test $ol_enable_kbind = yes ; then
6963         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6964 fi
6965
6966 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6967         cat >> confdefs.h <<\EOF
6968 #define HAVE_KERBEROS 1
6969 EOF
6970
6971
6972 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6973         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6974 fi
6975
6976 ol_link_tls=no
6977 if test $ol_with_tls != no ; then
6978         for ac_hdr in openssl/ssl.h ssl.h
6979 do
6980 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6981 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6982 echo "configure:6983: checking for $ac_hdr" >&5
6983 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6984   echo $ac_n "(cached) $ac_c" 1>&6
6985 else
6986   cat > conftest.$ac_ext <<EOF
6987 #line 6988 "configure"
6988 #include "confdefs.h"
6989 #include <$ac_hdr>
6990 EOF
6991 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6992 { (eval echo configure:6993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6993 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6994 if test -z "$ac_err"; then
6995   rm -rf conftest*
6996   eval "ac_cv_header_$ac_safe=yes"
6997 else
6998   echo "$ac_err" >&5
6999   echo "configure: failed program was:" >&5
7000   cat conftest.$ac_ext >&5
7001   rm -rf conftest*
7002   eval "ac_cv_header_$ac_safe=no"
7003 fi
7004 rm -f conftest*
7005 fi
7006 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7007   echo "$ac_t""yes" 1>&6
7008     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7009   cat >> confdefs.h <<EOF
7010 #define $ac_tr_hdr 1
7011 EOF
7012  
7013 else
7014   echo "$ac_t""no" 1>&6
7015 fi
7016 done
7017
7018         
7019         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
7020                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
7021 echo "configure:7022: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
7022 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
7023 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7024   echo $ac_n "(cached) $ac_c" 1>&6
7025 else
7026   ac_save_LIBS="$LIBS"
7027 LIBS="-lssl -lcrypto $LIBS"
7028 cat > conftest.$ac_ext <<EOF
7029 #line 7030 "configure"
7030 #include "confdefs.h"
7031 /* Override any gcc2 internal prototype to avoid an error.  */
7032 /* We use char because int might match the return type of a gcc2
7033     builtin and then its argument prototype would still apply.  */
7034 char SSLeay_add_ssl_algorithms();
7035
7036 int main() {
7037 SSLeay_add_ssl_algorithms()
7038 ; return 0; }
7039 EOF
7040 if { (eval echo configure:7041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7041   rm -rf conftest*
7042   eval "ac_cv_lib_$ac_lib_var=yes"
7043 else
7044   echo "configure: failed program was:" >&5
7045   cat conftest.$ac_ext >&5
7046   rm -rf conftest*
7047   eval "ac_cv_lib_$ac_lib_var=no"
7048 fi
7049 rm -f conftest*
7050 LIBS="$ac_save_LIBS"
7051
7052 fi
7053 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7054   echo "$ac_t""yes" 1>&6
7055   have_ssleay=yes
7056                         need_rsaref=no
7057 else
7058   echo "$ac_t""no" 1>&6
7059 have_ssleay=no
7060 fi
7061
7062                         
7063                 if test $have_ssleay = no ; then
7064                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
7065 echo "configure:7066: checking for SSL_library_init in -lssl" >&5
7066 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
7067 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7068   echo $ac_n "(cached) $ac_c" 1>&6
7069 else
7070   ac_save_LIBS="$LIBS"
7071 LIBS="-lssl -lcrypto $LIBS"
7072 cat > conftest.$ac_ext <<EOF
7073 #line 7074 "configure"
7074 #include "confdefs.h"
7075 /* Override any gcc2 internal prototype to avoid an error.  */
7076 /* We use char because int might match the return type of a gcc2
7077     builtin and then its argument prototype would still apply.  */
7078 char SSL_library_init();
7079
7080 int main() {
7081 SSL_library_init()
7082 ; return 0; }
7083 EOF
7084 if { (eval echo configure:7085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7085   rm -rf conftest*
7086   eval "ac_cv_lib_$ac_lib_var=yes"
7087 else
7088   echo "configure: failed program was:" >&5
7089   cat conftest.$ac_ext >&5
7090   rm -rf conftest*
7091   eval "ac_cv_lib_$ac_lib_var=no"
7092 fi
7093 rm -f conftest*
7094 LIBS="$ac_save_LIBS"
7095
7096 fi
7097 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7098   echo "$ac_t""yes" 1>&6
7099   have_ssleay=yes
7100                                 need_rsaref=no
7101 else
7102   echo "$ac_t""no" 1>&6
7103 have_ssleay=no
7104 fi
7105
7106                 fi
7107
7108                 if test $have_ssleay = no ; then
7109                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
7110 echo "configure:7111: checking for ssl3_accept in -lssl" >&5
7111 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
7112 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7113   echo $ac_n "(cached) $ac_c" 1>&6
7114 else
7115   ac_save_LIBS="$LIBS"
7116 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
7117 cat > conftest.$ac_ext <<EOF
7118 #line 7119 "configure"
7119 #include "confdefs.h"
7120 /* Override any gcc2 internal prototype to avoid an error.  */
7121 /* We use char because int might match the return type of a gcc2
7122     builtin and then its argument prototype would still apply.  */
7123 char ssl3_accept();
7124
7125 int main() {
7126 ssl3_accept()
7127 ; return 0; }
7128 EOF
7129 if { (eval echo configure:7130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7130   rm -rf conftest*
7131   eval "ac_cv_lib_$ac_lib_var=yes"
7132 else
7133   echo "configure: failed program was:" >&5
7134   cat conftest.$ac_ext >&5
7135   rm -rf conftest*
7136   eval "ac_cv_lib_$ac_lib_var=no"
7137 fi
7138 rm -f conftest*
7139 LIBS="$ac_save_LIBS"
7140
7141 fi
7142 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7143   echo "$ac_t""yes" 1>&6
7144   have_ssleay=yes
7145                                 need_rsaref=yes
7146 else
7147   echo "$ac_t""no" 1>&6
7148 have_ssleay=no
7149 fi
7150
7151                 fi
7152
7153                 if test $have_ssleay = yes ; then
7154                         ol_with_tls=found
7155                         ol_link_tls=yes
7156
7157                         cat >> confdefs.h <<\EOF
7158 #define HAVE_SSLEAY 1
7159 EOF
7160
7161
7162                         if test $need_rsaref = yes; then
7163                                 cat >> confdefs.h <<\EOF
7164 #define HAVE_RSAREF 1
7165 EOF
7166
7167
7168                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7169                         else
7170                                 TLS_LIBS="-lssl -lcrypto"
7171                         fi
7172                 fi
7173         fi
7174
7175 else
7176         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7177 fi
7178
7179 if test $ol_link_tls = yes ; then
7180         cat >> confdefs.h <<\EOF
7181 #define HAVE_TLS 1
7182 EOF
7183
7184
7185 elif test $ol_with_tls = auto ; then
7186         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7187         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7188
7189 elif test $ol_with_tls != no ; then
7190         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7191 fi
7192
7193 if test $ol_enable_lmpasswd != no; then
7194         if test $ol_link_tls != yes ; then
7195                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7196         fi
7197
7198         cat >> confdefs.h <<\EOF
7199 #define SLAPD_LMHASH 1
7200 EOF
7201
7202 fi
7203
7204 for ac_func in \
7205         ctime_r                 \
7206         gethostbyname_r gethostbyaddr_r \
7207
7208 do
7209 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7210 echo "configure:7211: checking for $ac_func" >&5
7211 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7212   echo $ac_n "(cached) $ac_c" 1>&6
7213 else
7214   cat > conftest.$ac_ext <<EOF
7215 #line 7216 "configure"
7216 #include "confdefs.h"
7217 /* System header to define __stub macros and hopefully few prototypes,
7218     which can conflict with char $ac_func(); below.  */
7219 #include <assert.h>
7220 /* Override any gcc2 internal prototype to avoid an error.  */
7221 /* We use char because int might match the return type of a gcc2
7222     builtin and then its argument prototype would still apply.  */
7223 char $ac_func();
7224 char (*f)();
7225
7226 int main() {
7227
7228 /* The GNU C library defines this for functions which it implements
7229     to always fail with ENOSYS.  Some functions are actually named
7230     something starting with __ and the normal name is an alias.  */
7231 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7232 choke me
7233 #else
7234 f = $ac_func;
7235 #endif
7236
7237 ; return 0; }
7238 EOF
7239 if { (eval echo configure:7240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7240   rm -rf conftest*
7241   eval "ac_cv_func_$ac_func=yes"
7242 else
7243   echo "configure: failed program was:" >&5
7244   cat conftest.$ac_ext >&5
7245   rm -rf conftest*
7246   eval "ac_cv_func_$ac_func=no"
7247 fi
7248 rm -f conftest*
7249 fi
7250
7251 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7252   echo "$ac_t""yes" 1>&6
7253     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7254   cat >> confdefs.h <<EOF
7255 #define $ac_tr_func 1
7256 EOF
7257  
7258 else
7259   echo "$ac_t""no" 1>&6
7260 fi
7261 done
7262
7263
7264 if test "$ac_cv_func_ctime_r" = no ; then
7265         ol_cv_func_ctime_r_nargs=0
7266 else
7267         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7268 echo "configure:7269: checking number of arguments of ctime_r" >&5
7269 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7270   echo $ac_n "(cached) $ac_c" 1>&6
7271 else
7272   cat > conftest.$ac_ext <<EOF
7273 #line 7274 "configure"
7274 #include "confdefs.h"
7275 #include <time.h>
7276 int main() {
7277 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7278 ; return 0; }
7279 EOF
7280 if { (eval echo configure:7281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7281   rm -rf conftest*
7282   ol_cv_func_ctime_r_nargs3=yes
7283 else
7284   echo "configure: failed program was:" >&5
7285   cat conftest.$ac_ext >&5
7286   rm -rf conftest*
7287   ol_cv_func_ctime_r_nargs3=no
7288 fi
7289 rm -f conftest*
7290
7291         cat > conftest.$ac_ext <<EOF
7292 #line 7293 "configure"
7293 #include "confdefs.h"
7294 #include <time.h>
7295 int main() {
7296 time_t ti; char *buffer; ctime_r(&ti,buffer);
7297 ; return 0; }
7298 EOF
7299 if { (eval echo configure:7300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7300   rm -rf conftest*
7301   ol_cv_func_ctime_r_nargs2=yes
7302 else
7303   echo "configure: failed program was:" >&5
7304   cat conftest.$ac_ext >&5
7305   rm -rf conftest*
7306   ol_cv_func_ctime_r_nargs2=no
7307 fi
7308 rm -f conftest*
7309
7310         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7311                 $ol_cv_func_ctime_r_nargs2 = no ; then
7312
7313                 ol_cv_func_ctime_r_nargs=3
7314
7315         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7316                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7317
7318                 ol_cv_func_ctime_r_nargs=2
7319
7320         else
7321                 ol_cv_func_ctime_r_nargs=0
7322         fi
7323   
7324 fi
7325
7326 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7327
7328   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7329         cat >> confdefs.h <<EOF
7330 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7331 EOF
7332
7333   fi
7334
7335 fi
7336
7337 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7338         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7339 echo "configure:7340: checking number of arguments of gethostbyname_r" >&5
7340 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7341   echo $ac_n "(cached) $ac_c" 1>&6
7342 else
7343   cat > conftest.$ac_ext <<EOF
7344 #line 7345 "configure"
7345 #include "confdefs.h"
7346 #include <sys/types.h>
7347 #include <sys/socket.h>
7348 #include <netinet/in.h>
7349 #include <netdb.h>
7350 #define BUFSIZE (sizeof(struct hostent)+10)
7351 int main() {
7352 struct hostent hent; char buffer[BUFSIZE];
7353                 int bufsize=BUFSIZE;int h_errno;
7354                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7355                         buffer, bufsize, &h_errno);
7356 ; return 0; }
7357 EOF
7358 if { (eval echo configure:7359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7359   rm -rf conftest*
7360   ol_cv_func_gethostbyname_r_nargs5=yes
7361 else
7362   echo "configure: failed program was:" >&5
7363   cat conftest.$ac_ext >&5
7364   rm -rf conftest*
7365   ol_cv_func_gethostbyname_r_nargs5=no
7366 fi
7367 rm -f conftest*
7368
7369         cat > conftest.$ac_ext <<EOF
7370 #line 7371 "configure"
7371 #include "confdefs.h"
7372 #include <sys/types.h>
7373 #include <sys/socket.h>
7374 #include <netinet/in.h>
7375 #include <netdb.h>
7376 #define BUFSIZE (sizeof(struct hostent)+10)
7377 int main() {
7378 struct hostent hent;struct hostent *rhent;
7379                 char buffer[BUFSIZE];
7380                 int bufsize=BUFSIZE;int h_errno;
7381                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7382                         &rhent, &h_errno);
7383 ; return 0; }
7384 EOF
7385 if { (eval echo configure:7386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7386   rm -rf conftest*
7387   ol_cv_func_gethostbyname_r_nargs6=yes
7388 else
7389   echo "configure: failed program was:" >&5
7390   cat conftest.$ac_ext >&5
7391   rm -rf conftest*
7392   ol_cv_func_gethostbyname_r_nargs6=no
7393 fi
7394 rm -f conftest*
7395
7396         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7397                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7398
7399                 ol_cv_func_gethostbyname_r_nargs=5
7400
7401         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7402                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7403
7404                 ol_cv_func_gethostbyname_r_nargs=6
7405
7406         else
7407                 ol_cv_func_gethostbyname_r_nargs=0
7408         fi
7409   
7410 fi
7411
7412 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7413   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7414         cat >> confdefs.h <<EOF
7415 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7416 EOF
7417
7418   fi
7419
7420 else
7421         ol_cv_func_gethostbyname_r_nargs=0
7422 fi
7423  
7424 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7425         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7426 echo "configure:7427: checking number of arguments of gethostbyaddr_r" >&5
7427 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7428   echo $ac_n "(cached) $ac_c" 1>&6
7429 else
7430   cat > conftest.$ac_ext <<EOF
7431 #line 7432 "configure"
7432 #include "confdefs.h"
7433 #include <sys/types.h>
7434 #include <sys/socket.h>
7435 #include <netinet/in.h>
7436 #include <netdb.h>
7437 #define BUFSIZE (sizeof(struct hostent)+10)
7438 int main() {
7439 struct hostent hent; char buffer[BUFSIZE]; 
7440             struct in_addr add;
7441             size_t alen=sizeof(struct in_addr);
7442             int bufsize=BUFSIZE;int h_errno;
7443                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7444                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7445 ; return 0; }
7446 EOF
7447 if { (eval echo configure:7448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7448   rm -rf conftest*
7449   ol_cv_func_gethostbyaddr_r_nargs7=yes
7450 else
7451   echo "configure: failed program was:" >&5
7452   cat conftest.$ac_ext >&5
7453   rm -rf conftest*
7454   ol_cv_func_gethostbyaddr_r_nargs7=no
7455 fi
7456 rm -f conftest*
7457
7458         cat > conftest.$ac_ext <<EOF
7459 #line 7460 "configure"
7460 #include "confdefs.h"
7461 #include <sys/types.h>
7462 #include <sys/socket.h>
7463 #include <netinet/in.h>
7464 #include <netdb.h>
7465 #define BUFSIZE (sizeof(struct hostent)+10)
7466 int main() {
7467 struct hostent hent;
7468                 struct hostent *rhent; char buffer[BUFSIZE]; 
7469                 struct in_addr add;
7470                 size_t alen=sizeof(struct in_addr);
7471                 int bufsize=BUFSIZE;int h_errno;
7472                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7473                         alen, AF_INET, &hent, buffer, bufsize, 
7474                         &rhent, &h_errno);
7475 ; return 0; }
7476 EOF
7477 if { (eval echo configure:7478: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7478   rm -rf conftest*
7479   ol_cv_func_gethostbyaddr_r_nargs8=yes
7480 else
7481   echo "configure: failed program was:" >&5
7482   cat conftest.$ac_ext >&5
7483   rm -rf conftest*
7484   ol_cv_func_gethostbyaddr_r_nargs8=no
7485 fi
7486 rm -f conftest*
7487
7488         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7489                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7490
7491                 ol_cv_func_gethostbyaddr_r_nargs=7
7492
7493         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7494                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7495
7496                 ol_cv_func_gethostbyaddr_r_nargs=8
7497
7498         else
7499                 ol_cv_func_gethostbyaddr_r_nargs=0
7500         fi
7501   
7502 fi
7503
7504 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7505   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7506     cat >> confdefs.h <<EOF
7507 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7508 EOF
7509
7510   fi
7511
7512 else
7513         ol_cv_func_gethostbyaddr_r_nargs=0
7514 fi
7515
7516 if test "$ac_cv_func_ctime_r" = yes \
7517         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7518         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7519         -a "$ac_cv_func_gethostbyname_r" = yes \
7520         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7521         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7522         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7523         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7524         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7525         ; then
7526  
7527         cat >> confdefs.h <<\EOF
7528 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7529 EOF
7530
7531 fi
7532
7533 ol_link_threads=no
7534
7535 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7536         -o $ol_with_threads = nt ; then
7537
7538         
7539         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7540 echo "configure:7541: checking for _beginthread" >&5
7541 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7542   echo $ac_n "(cached) $ac_c" 1>&6
7543 else
7544   cat > conftest.$ac_ext <<EOF
7545 #line 7546 "configure"
7546 #include "confdefs.h"
7547 /* System header to define __stub macros and hopefully few prototypes,
7548     which can conflict with char _beginthread(); below.  */
7549 #include <assert.h>
7550 /* Override any gcc2 internal prototype to avoid an error.  */
7551 /* We use char because int might match the return type of a gcc2
7552     builtin and then its argument prototype would still apply.  */
7553 char _beginthread();
7554 char (*f)();
7555
7556 int main() {
7557
7558 /* The GNU C library defines this for functions which it implements
7559     to always fail with ENOSYS.  Some functions are actually named
7560     something starting with __ and the normal name is an alias.  */
7561 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7562 choke me
7563 #else
7564 f = _beginthread;
7565 #endif
7566
7567 ; return 0; }
7568 EOF
7569 if { (eval echo configure:7570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7570   rm -rf conftest*
7571   eval "ac_cv_func__beginthread=yes"
7572 else
7573   echo "configure: failed program was:" >&5
7574   cat conftest.$ac_ext >&5
7575   rm -rf conftest*
7576   eval "ac_cv_func__beginthread=no"
7577 fi
7578 rm -f conftest*
7579 fi
7580
7581 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7582   echo "$ac_t""yes" 1>&6
7583   :
7584 else
7585   echo "$ac_t""no" 1>&6
7586 fi
7587
7588
7589         if test $ac_cv_func__beginthread = yes ; then
7590                 cat >> confdefs.h <<\EOF
7591 #define HAVE_NT_THREADS 1
7592 EOF
7593
7594                 ol_cv_nt_threads=yes
7595         fi
7596
7597
7598         if test "$ol_cv_nt_threads" = yes ; then
7599                 ol_link_threads=nt
7600                 ol_with_threads=found
7601                 ol_with_yielding_select=yes
7602
7603                 cat >> confdefs.h <<\EOF
7604 #define HAVE_NT_SERVICE_MANAGER 1
7605 EOF
7606
7607                 cat >> confdefs.h <<\EOF
7608 #define HAVE_NT_EVENT_LOG 1
7609 EOF
7610
7611         fi
7612
7613         if test $ol_with_threads = nt ; then
7614                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7615         fi
7616 fi
7617
7618 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7619         -o $ol_with_threads = posix ; then
7620
7621         for ac_hdr in pthread.h
7622 do
7623 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7624 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7625 echo "configure:7626: checking for $ac_hdr" >&5
7626 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7627   echo $ac_n "(cached) $ac_c" 1>&6
7628 else
7629   cat > conftest.$ac_ext <<EOF
7630 #line 7631 "configure"
7631 #include "confdefs.h"
7632 #include <$ac_hdr>
7633 EOF
7634 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7635 { (eval echo configure:7636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7636 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7637 if test -z "$ac_err"; then
7638   rm -rf conftest*
7639   eval "ac_cv_header_$ac_safe=yes"
7640 else
7641   echo "$ac_err" >&5
7642   echo "configure: failed program was:" >&5
7643   cat conftest.$ac_ext >&5
7644   rm -rf conftest*
7645   eval "ac_cv_header_$ac_safe=no"
7646 fi
7647 rm -f conftest*
7648 fi
7649 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7650   echo "$ac_t""yes" 1>&6
7651     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7652   cat >> confdefs.h <<EOF
7653 #define $ac_tr_hdr 1
7654 EOF
7655  
7656 else
7657   echo "$ac_t""no" 1>&6
7658 fi
7659 done
7660
7661
7662         if test $ac_cv_header_pthread_h = yes ; then
7663                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7664 echo "configure:7665: checking POSIX thread version" >&5
7665 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7666   echo $ac_n "(cached) $ac_c" 1>&6
7667 else
7668   
7669         cat > conftest.$ac_ext <<EOF
7670 #line 7671 "configure"
7671 #include "confdefs.h"
7672
7673 #               include <pthread.h>
7674                 /* this check could be improved */
7675 #               ifdef PTHREAD_ONCE_INIT
7676                         pthread_version_final;
7677 #               endif
7678         
7679 EOF
7680 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7681   egrep "pthread_version_final" >/dev/null 2>&1; then
7682   rm -rf conftest*
7683   ol_pthread_final=yes
7684 else
7685   rm -rf conftest*
7686   ol_pthread_final=no
7687 fi
7688 rm -f conftest*
7689
7690
7691         cat > conftest.$ac_ext <<EOF
7692 #line 7693 "configure"
7693 #include "confdefs.h"
7694
7695 #               include <pthread.h>
7696                 /* this check could be improved */
7697 #               ifdef pthread_once_init
7698                         pthread_version_draft4;
7699 #               endif
7700         
7701 EOF
7702 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7703   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7704   rm -rf conftest*
7705   ol_pthread_draft4=yes
7706 else
7707   rm -rf conftest*
7708   ol_pthread_draft4=no
7709 fi
7710 rm -f conftest*
7711
7712
7713         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7714                 ol_cv_pthread_version=final
7715         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7716                 ol_cv_pthread_version=draft4
7717         else
7718                 ol_cv_pthread_version=unknown
7719         fi
7720
7721 fi
7722
7723 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7724
7725
7726                 if test $ol_cv_pthread_version = final ; then
7727                         cat >> confdefs.h <<\EOF
7728 #define HAVE_PTHREADS_FINAL 1
7729 EOF
7730
7731                 elif test $ol_cv_pthread_version = draft4 ; then
7732                         cat >> confdefs.h <<\EOF
7733 #define HAVE_PTHREADS_D4 1
7734 EOF
7735
7736                 else
7737                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7738                 fi
7739
7740                 # consider threads found
7741                 ol_with_threads=found
7742
7743                 
7744         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7745 echo "configure:7746: checking for LinuxThreads pthread.h" >&5
7746 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7747   echo $ac_n "(cached) $ac_c" 1>&6
7748 else
7749   cat > conftest.$ac_ext <<EOF
7750 #line 7751 "configure"
7751 #include "confdefs.h"
7752 #include <pthread.h>
7753 EOF
7754 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7755   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7756   rm -rf conftest*
7757   ol_cv_header_linux_threads=yes
7758 else
7759   rm -rf conftest*
7760   ol_cv_header_linux_threads=no
7761 fi
7762 rm -f conftest*
7763
7764                 
7765 fi
7766
7767 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7768         if test $ol_cv_header_linux_threads = yes; then
7769                 cat >> confdefs.h <<\EOF
7770 #define HAVE_LINUX_THREADS 1
7771 EOF
7772
7773         fi
7774
7775                 
7776         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7777 echo "configure:7778: checking for GNU Pth pthread.h" >&5
7778 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7779   echo $ac_n "(cached) $ac_c" 1>&6
7780 else
7781   cat > conftest.$ac_ext <<EOF
7782 #line 7783 "configure"
7783 #include "confdefs.h"
7784 #include <pthread.h>
7785 #ifdef _POSIX_THREAD_IS_GNU_PTH
7786         __gnu_pth__;
7787 #endif
7788
7789 EOF
7790 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7791   egrep "__gnu_pth__" >/dev/null 2>&1; then
7792   rm -rf conftest*
7793   ol_cv_header_gnu_pth_pthread_h=yes
7794 else
7795   rm -rf conftest*
7796   ol_cv_header_gnu_pth_pthread_h=no
7797 fi
7798 rm -f conftest*
7799
7800                 
7801 fi
7802
7803 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7804
7805
7806                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7807                         for ac_hdr in sched.h
7808 do
7809 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7810 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7811 echo "configure:7812: checking for $ac_hdr" >&5
7812 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7813   echo $ac_n "(cached) $ac_c" 1>&6
7814 else
7815   cat > conftest.$ac_ext <<EOF
7816 #line 7817 "configure"
7817 #include "confdefs.h"
7818 #include <$ac_hdr>
7819 EOF
7820 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7821 { (eval echo configure:7822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7822 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7823 if test -z "$ac_err"; then
7824   rm -rf conftest*
7825   eval "ac_cv_header_$ac_safe=yes"
7826 else
7827   echo "$ac_err" >&5
7828   echo "configure: failed program was:" >&5
7829   cat conftest.$ac_ext >&5
7830   rm -rf conftest*
7831   eval "ac_cv_header_$ac_safe=no"
7832 fi
7833 rm -f conftest*
7834 fi
7835 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7836   echo "$ac_t""yes" 1>&6
7837     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7838   cat >> confdefs.h <<EOF
7839 #define $ac_tr_hdr 1
7840 EOF
7841  
7842 else
7843   echo "$ac_t""no" 1>&6
7844 fi
7845 done
7846
7847                 fi
7848
7849                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7850                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7851 echo "configure:7852: checking for pthread_create in default libraries" >&5
7852 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7853   echo $ac_n "(cached) $ac_c" 1>&6
7854 else
7855   
7856                 if test "$cross_compiling" = yes; then
7857   cat > conftest.$ac_ext <<EOF
7858 #line 7859 "configure"
7859 #include "confdefs.h"
7860 /* pthread test headers */
7861 #include <pthread.h>
7862 #ifndef NULL
7863 #define NULL (void*)0
7864 #endif
7865
7866 static void *task(p)
7867         void *p;
7868 {
7869         return (void *) (p == NULL);
7870 }
7871
7872 int main() {
7873
7874         /* pthread test function */
7875         pthread_t t;
7876         int status;
7877         int detach = 1;
7878
7879 #ifdef HAVE_PTHREADS_FINAL
7880         /* Final pthreads */
7881         pthread_attr_t attr;
7882
7883         status = pthread_attr_init(&attr);
7884         if( status ) return status;
7885
7886 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7887         if( !detach ) {
7888 #if defined( PTHREAD_CREATE_JOINABLE )
7889                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7890 #else
7891                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7892 #endif
7893
7894 #ifdef PTHREAD_CREATE_DETACHED
7895         } else {
7896                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7897 #endif
7898         }
7899         if( status ) return status;
7900 #endif
7901
7902         status = pthread_create( &t, &attr, task, NULL );
7903         if( status ) return status;
7904
7905 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7906         if( detach ) {
7907                 /* give thread a chance to complete */
7908                 /* it should remain joinable and hence detachable */
7909                 sleep( 1 );
7910
7911                 status = pthread_detach( t );
7912                 if( status ) return status;
7913         }
7914 #endif
7915
7916 #else
7917         /* Draft 4 pthreads */
7918         status = pthread_create( &t, pthread_attr_default, task, NULL );
7919         if( status ) return status;
7920
7921         if( detach ) {
7922                 /* give thread a chance to complete */
7923                 /* it should remain joinable and hence detachable */
7924                 sleep( 1 );
7925
7926                 status = pthread_detach( &t );
7927                 if( status ) return status;
7928         }
7929 #endif
7930
7931 #ifdef HAVE_LINUX_THREADS
7932         pthread_kill_other_threads_np();
7933 #endif
7934
7935         return 0;
7936
7937 ; return 0; }
7938 EOF
7939 if { (eval echo configure:7940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7940   rm -rf conftest*
7941   ol_cv_pthread_create=yes
7942 else
7943   echo "configure: failed program was:" >&5
7944   cat conftest.$ac_ext >&5
7945   rm -rf conftest*
7946   ol_cv_pthread_create=no
7947 fi
7948 rm -f conftest*
7949 else
7950   cat > conftest.$ac_ext <<EOF
7951 #line 7952 "configure"
7952 #include "confdefs.h"
7953 /* pthread test headers */
7954 #include <pthread.h>
7955 #ifndef NULL
7956 #define NULL (void*)0
7957 #endif
7958
7959 static void *task(p)
7960         void *p;
7961 {
7962         return (void *) (p == NULL);
7963 }
7964
7965
7966 int main(argc, argv)
7967         int argc;
7968         char **argv;
7969 {
7970
7971         /* pthread test function */
7972         pthread_t t;
7973         int status;
7974         int detach = 1;
7975
7976 #ifdef HAVE_PTHREADS_FINAL
7977         /* Final pthreads */
7978         pthread_attr_t attr;
7979
7980         status = pthread_attr_init(&attr);
7981         if( status ) return status;
7982
7983 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7984         if( !detach ) {
7985 #if defined( PTHREAD_CREATE_JOINABLE )
7986                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7987 #else
7988                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7989 #endif
7990
7991 #ifdef PTHREAD_CREATE_DETACHED
7992         } else {
7993                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7994 #endif
7995         }
7996         if( status ) return status;
7997 #endif
7998
7999         status = pthread_create( &t, &attr, task, NULL );
8000         if( status ) return status;
8001
8002 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8003         if( detach ) {
8004                 /* give thread a chance to complete */
8005                 /* it should remain joinable and hence detachable */
8006                 sleep( 1 );
8007
8008                 status = pthread_detach( t );
8009                 if( status ) return status;
8010         }
8011 #endif
8012
8013 #else
8014         /* Draft 4 pthreads */
8015         status = pthread_create( &t, pthread_attr_default, task, NULL );
8016         if( status ) return status;
8017
8018         if( detach ) {
8019                 /* give thread a chance to complete */
8020                 /* it should remain joinable and hence detachable */
8021                 sleep( 1 );
8022
8023                 status = pthread_detach( &t );
8024                 if( status ) return status;
8025         }
8026 #endif
8027
8028 #ifdef HAVE_LINUX_THREADS
8029         pthread_kill_other_threads_np();
8030 #endif
8031
8032         return 0;
8033
8034 }
8035
8036 EOF
8037 if { (eval echo configure:8038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8038 then
8039   ol_cv_pthread_create=yes
8040 else
8041   echo "configure: failed program was:" >&5
8042   cat conftest.$ac_ext >&5
8043   rm -fr conftest*
8044   ol_cv_pthread_create=no
8045 fi
8046 rm -fr conftest*
8047 fi
8048
8049 fi
8050
8051 echo "$ac_t""$ol_cv_pthread_create" 1>&6
8052
8053                 if test $ol_cv_pthread_create != no ; then
8054                         ol_link_threads=posix
8055                         ol_link_pthreads=""
8056                 fi
8057                 
8058                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
8059 if test "$ol_link_threads" = no ; then
8060         # try -kthread
8061         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
8062 echo "configure:8063: checking for pthread link with -kthread" >&5
8063 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
8064   echo $ac_n "(cached) $ac_c" 1>&6
8065 else
8066   
8067                 # save the flags
8068                 ol_LIBS="$LIBS"
8069                 LIBS="-kthread $LIBS"
8070
8071                 if test "$cross_compiling" = yes; then
8072   cat > conftest.$ac_ext <<EOF
8073 #line 8074 "configure"
8074 #include "confdefs.h"
8075 /* pthread test headers */
8076 #include <pthread.h>
8077 #ifndef NULL
8078 #define NULL (void*)0
8079 #endif
8080
8081 static void *task(p)
8082         void *p;
8083 {
8084         return (void *) (p == NULL);
8085 }
8086
8087 int main() {
8088
8089         /* pthread test function */
8090         pthread_t t;
8091         int status;
8092         int detach = 1;
8093
8094 #ifdef HAVE_PTHREADS_FINAL
8095         /* Final pthreads */
8096         pthread_attr_t attr;
8097
8098         status = pthread_attr_init(&attr);
8099         if( status ) return status;
8100
8101 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8102         if( !detach ) {
8103 #if defined( PTHREAD_CREATE_JOINABLE )
8104                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8105 #else
8106                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8107 #endif
8108
8109 #ifdef PTHREAD_CREATE_DETACHED
8110         } else {
8111                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8112 #endif
8113         }
8114         if( status ) return status;
8115 #endif
8116
8117         status = pthread_create( &t, &attr, task, NULL );
8118         if( status ) return status;
8119
8120 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8121         if( detach ) {
8122                 /* give thread a chance to complete */
8123                 /* it should remain joinable and hence detachable */
8124                 sleep( 1 );
8125
8126                 status = pthread_detach( t );
8127                 if( status ) return status;
8128         }
8129 #endif
8130
8131 #else
8132         /* Draft 4 pthreads */
8133         status = pthread_create( &t, pthread_attr_default, task, NULL );
8134         if( status ) return status;
8135
8136         if( detach ) {
8137                 /* give thread a chance to complete */
8138                 /* it should remain joinable and hence detachable */
8139                 sleep( 1 );
8140
8141                 status = pthread_detach( &t );
8142                 if( status ) return status;
8143         }
8144 #endif
8145
8146 #ifdef HAVE_LINUX_THREADS
8147         pthread_kill_other_threads_np();
8148 #endif
8149
8150         return 0;
8151
8152 ; return 0; }
8153 EOF
8154 if { (eval echo configure:8155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8155   rm -rf conftest*
8156   ol_cv_pthread_kthread=yes
8157 else
8158   echo "configure: failed program was:" >&5
8159   cat conftest.$ac_ext >&5
8160   rm -rf conftest*
8161   ol_cv_pthread_kthread=no
8162 fi
8163 rm -f conftest*
8164 else
8165   cat > conftest.$ac_ext <<EOF
8166 #line 8167 "configure"
8167 #include "confdefs.h"
8168 /* pthread test headers */
8169 #include <pthread.h>
8170 #ifndef NULL
8171 #define NULL (void*)0
8172 #endif
8173
8174 static void *task(p)
8175         void *p;
8176 {
8177         return (void *) (p == NULL);
8178 }
8179
8180
8181 int main(argc, argv)
8182         int argc;
8183         char **argv;
8184 {
8185
8186         /* pthread test function */
8187         pthread_t t;
8188         int status;
8189         int detach = 1;
8190
8191 #ifdef HAVE_PTHREADS_FINAL
8192         /* Final pthreads */
8193         pthread_attr_t attr;
8194
8195         status = pthread_attr_init(&attr);
8196         if( status ) return status;
8197
8198 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8199         if( !detach ) {
8200 #if defined( PTHREAD_CREATE_JOINABLE )
8201                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8202 #else
8203                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8204 #endif
8205
8206 #ifdef PTHREAD_CREATE_DETACHED
8207         } else {
8208                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8209 #endif
8210         }
8211         if( status ) return status;
8212 #endif
8213
8214         status = pthread_create( &t, &attr, task, NULL );
8215         if( status ) return status;
8216
8217 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8218         if( detach ) {
8219                 /* give thread a chance to complete */
8220                 /* it should remain joinable and hence detachable */
8221                 sleep( 1 );
8222
8223                 status = pthread_detach( t );
8224                 if( status ) return status;
8225         }
8226 #endif
8227
8228 #else
8229         /* Draft 4 pthreads */
8230         status = pthread_create( &t, pthread_attr_default, task, NULL );
8231         if( status ) return status;
8232
8233         if( detach ) {
8234                 /* give thread a chance to complete */
8235                 /* it should remain joinable and hence detachable */
8236                 sleep( 1 );
8237
8238                 status = pthread_detach( &t );
8239                 if( status ) return status;
8240         }
8241 #endif
8242
8243 #ifdef HAVE_LINUX_THREADS
8244         pthread_kill_other_threads_np();
8245 #endif
8246
8247         return 0;
8248
8249 }
8250
8251 EOF
8252 if { (eval echo configure:8253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8253 then
8254   ol_cv_pthread_kthread=yes
8255 else
8256   echo "configure: failed program was:" >&5
8257   cat conftest.$ac_ext >&5
8258   rm -fr conftest*
8259   ol_cv_pthread_kthread=no
8260 fi
8261 rm -fr conftest*
8262 fi
8263
8264
8265                 # restore the LIBS
8266                 LIBS="$ol_LIBS"
8267         
8268 fi
8269
8270 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8271
8272         if test $ol_cv_pthread_kthread = yes ; then
8273                 ol_link_pthreads="-kthread"
8274                 ol_link_threads=posix
8275         fi
8276 fi
8277
8278                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8279 if test "$ol_link_threads" = no ; then
8280         # try -pthread
8281         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8282 echo "configure:8283: checking for pthread link with -pthread" >&5
8283 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8284   echo $ac_n "(cached) $ac_c" 1>&6
8285 else
8286   
8287                 # save the flags
8288                 ol_LIBS="$LIBS"
8289                 LIBS="-pthread $LIBS"
8290
8291                 if test "$cross_compiling" = yes; then
8292   cat > conftest.$ac_ext <<EOF
8293 #line 8294 "configure"
8294 #include "confdefs.h"
8295 /* pthread test headers */
8296 #include <pthread.h>
8297 #ifndef NULL
8298 #define NULL (void*)0
8299 #endif
8300
8301 static void *task(p)
8302         void *p;
8303 {
8304         return (void *) (p == NULL);
8305 }
8306
8307 int main() {
8308
8309         /* pthread test function */
8310         pthread_t t;
8311         int status;
8312         int detach = 1;
8313
8314 #ifdef HAVE_PTHREADS_FINAL
8315         /* Final pthreads */
8316         pthread_attr_t attr;
8317
8318         status = pthread_attr_init(&attr);
8319         if( status ) return status;
8320
8321 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8322         if( !detach ) {
8323 #if defined( PTHREAD_CREATE_JOINABLE )
8324                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8325 #else
8326                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8327 #endif
8328
8329 #ifdef PTHREAD_CREATE_DETACHED
8330         } else {
8331                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8332 #endif
8333         }
8334         if( status ) return status;
8335 #endif
8336
8337         status = pthread_create( &t, &attr, task, NULL );
8338         if( status ) return status;
8339
8340 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8341         if( detach ) {
8342                 /* give thread a chance to complete */
8343                 /* it should remain joinable and hence detachable */
8344                 sleep( 1 );
8345
8346                 status = pthread_detach( t );
8347                 if( status ) return status;
8348         }
8349 #endif
8350
8351 #else
8352         /* Draft 4 pthreads */
8353         status = pthread_create( &t, pthread_attr_default, task, NULL );
8354         if( status ) return status;
8355
8356         if( detach ) {
8357                 /* give thread a chance to complete */
8358                 /* it should remain joinable and hence detachable */
8359                 sleep( 1 );
8360
8361                 status = pthread_detach( &t );
8362                 if( status ) return status;
8363         }
8364 #endif
8365
8366 #ifdef HAVE_LINUX_THREADS
8367         pthread_kill_other_threads_np();
8368 #endif
8369
8370         return 0;
8371
8372 ; return 0; }
8373 EOF
8374 if { (eval echo configure:8375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8375   rm -rf conftest*
8376   ol_cv_pthread_pthread=yes
8377 else
8378   echo "configure: failed program was:" >&5
8379   cat conftest.$ac_ext >&5
8380   rm -rf conftest*
8381   ol_cv_pthread_pthread=no
8382 fi
8383 rm -f conftest*
8384 else
8385   cat > conftest.$ac_ext <<EOF
8386 #line 8387 "configure"
8387 #include "confdefs.h"
8388 /* pthread test headers */
8389 #include <pthread.h>
8390 #ifndef NULL
8391 #define NULL (void*)0
8392 #endif
8393
8394 static void *task(p)
8395         void *p;
8396 {
8397         return (void *) (p == NULL);
8398 }
8399
8400
8401 int main(argc, argv)
8402         int argc;
8403         char **argv;
8404 {
8405
8406         /* pthread test function */
8407         pthread_t t;
8408         int status;
8409         int detach = 1;
8410
8411 #ifdef HAVE_PTHREADS_FINAL
8412         /* Final pthreads */
8413         pthread_attr_t attr;
8414
8415         status = pthread_attr_init(&attr);
8416         if( status ) return status;
8417
8418 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8419         if( !detach ) {
8420 #if defined( PTHREAD_CREATE_JOINABLE )
8421                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8422 #else
8423                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8424 #endif
8425
8426 #ifdef PTHREAD_CREATE_DETACHED
8427         } else {
8428                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8429 #endif
8430         }
8431         if( status ) return status;
8432 #endif
8433
8434         status = pthread_create( &t, &attr, task, NULL );
8435         if( status ) return status;
8436
8437 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8438         if( detach ) {
8439                 /* give thread a chance to complete */
8440                 /* it should remain joinable and hence detachable */
8441                 sleep( 1 );
8442
8443                 status = pthread_detach( t );
8444                 if( status ) return status;
8445         }
8446 #endif
8447
8448 #else
8449         /* Draft 4 pthreads */
8450         status = pthread_create( &t, pthread_attr_default, task, NULL );
8451         if( status ) return status;
8452
8453         if( detach ) {
8454                 /* give thread a chance to complete */
8455                 /* it should remain joinable and hence detachable */
8456                 sleep( 1 );
8457
8458                 status = pthread_detach( &t );
8459                 if( status ) return status;
8460         }
8461 #endif
8462
8463 #ifdef HAVE_LINUX_THREADS
8464         pthread_kill_other_threads_np();
8465 #endif
8466
8467         return 0;
8468
8469 }
8470
8471 EOF
8472 if { (eval echo configure:8473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8473 then
8474   ol_cv_pthread_pthread=yes
8475 else
8476   echo "configure: failed program was:" >&5
8477   cat conftest.$ac_ext >&5
8478   rm -fr conftest*
8479   ol_cv_pthread_pthread=no
8480 fi
8481 rm -fr conftest*
8482 fi
8483
8484
8485                 # restore the LIBS
8486                 LIBS="$ol_LIBS"
8487         
8488 fi
8489
8490 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8491
8492         if test $ol_cv_pthread_pthread = yes ; then
8493                 ol_link_pthreads="-pthread"
8494                 ol_link_threads=posix
8495         fi
8496 fi
8497
8498                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8499 if test "$ol_link_threads" = no ; then
8500         # try -pthreads
8501         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8502 echo "configure:8503: checking for pthread link with -pthreads" >&5
8503 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8504   echo $ac_n "(cached) $ac_c" 1>&6
8505 else
8506   
8507                 # save the flags
8508                 ol_LIBS="$LIBS"
8509                 LIBS="-pthreads $LIBS"
8510
8511                 if test "$cross_compiling" = yes; then
8512   cat > conftest.$ac_ext <<EOF
8513 #line 8514 "configure"
8514 #include "confdefs.h"
8515 /* pthread test headers */
8516 #include <pthread.h>
8517 #ifndef NULL
8518 #define NULL (void*)0
8519 #endif
8520
8521 static void *task(p)
8522         void *p;
8523 {
8524         return (void *) (p == NULL);
8525 }
8526
8527 int main() {
8528
8529         /* pthread test function */
8530         pthread_t t;
8531         int status;
8532         int detach = 1;
8533
8534 #ifdef HAVE_PTHREADS_FINAL
8535         /* Final pthreads */
8536         pthread_attr_t attr;
8537
8538         status = pthread_attr_init(&attr);
8539         if( status ) return status;
8540
8541 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8542         if( !detach ) {
8543 #if defined( PTHREAD_CREATE_JOINABLE )
8544                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8545 #else
8546                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8547 #endif
8548
8549 #ifdef PTHREAD_CREATE_DETACHED
8550         } else {
8551                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8552 #endif
8553         }
8554         if( status ) return status;
8555 #endif
8556
8557         status = pthread_create( &t, &attr, task, NULL );
8558         if( status ) return status;
8559
8560 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8561         if( detach ) {
8562                 /* give thread a chance to complete */
8563                 /* it should remain joinable and hence detachable */
8564                 sleep( 1 );
8565
8566                 status = pthread_detach( t );
8567                 if( status ) return status;
8568         }
8569 #endif
8570
8571 #else
8572         /* Draft 4 pthreads */
8573         status = pthread_create( &t, pthread_attr_default, task, NULL );
8574         if( status ) return status;
8575
8576         if( detach ) {
8577                 /* give thread a chance to complete */
8578                 /* it should remain joinable and hence detachable */
8579                 sleep( 1 );
8580
8581                 status = pthread_detach( &t );
8582                 if( status ) return status;
8583         }
8584 #endif
8585
8586 #ifdef HAVE_LINUX_THREADS
8587         pthread_kill_other_threads_np();
8588 #endif
8589
8590         return 0;
8591
8592 ; return 0; }
8593 EOF
8594 if { (eval echo configure:8595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8595   rm -rf conftest*
8596   ol_cv_pthread_pthreads=yes
8597 else
8598   echo "configure: failed program was:" >&5
8599   cat conftest.$ac_ext >&5
8600   rm -rf conftest*
8601   ol_cv_pthread_pthreads=no
8602 fi
8603 rm -f conftest*
8604 else
8605   cat > conftest.$ac_ext <<EOF
8606 #line 8607 "configure"
8607 #include "confdefs.h"
8608 /* pthread test headers */
8609 #include <pthread.h>
8610 #ifndef NULL
8611 #define NULL (void*)0
8612 #endif
8613
8614 static void *task(p)
8615         void *p;
8616 {
8617         return (void *) (p == NULL);
8618 }
8619
8620
8621 int main(argc, argv)
8622         int argc;
8623         char **argv;
8624 {
8625
8626         /* pthread test function */
8627         pthread_t t;
8628         int status;
8629         int detach = 1;
8630
8631 #ifdef HAVE_PTHREADS_FINAL
8632         /* Final pthreads */
8633         pthread_attr_t attr;
8634
8635         status = pthread_attr_init(&attr);
8636         if( status ) return status;
8637
8638 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8639         if( !detach ) {
8640 #if defined( PTHREAD_CREATE_JOINABLE )
8641                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8642 #else
8643                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8644 #endif
8645
8646 #ifdef PTHREAD_CREATE_DETACHED
8647         } else {
8648                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8649 #endif
8650         }
8651         if( status ) return status;
8652 #endif
8653
8654         status = pthread_create( &t, &attr, task, NULL );
8655         if( status ) return status;
8656
8657 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8658         if( detach ) {
8659                 /* give thread a chance to complete */
8660                 /* it should remain joinable and hence detachable */
8661                 sleep( 1 );
8662
8663                 status = pthread_detach( t );
8664                 if( status ) return status;
8665         }
8666 #endif
8667
8668 #else
8669         /* Draft 4 pthreads */
8670         status = pthread_create( &t, pthread_attr_default, task, NULL );
8671         if( status ) return status;
8672
8673         if( detach ) {
8674                 /* give thread a chance to complete */
8675                 /* it should remain joinable and hence detachable */
8676                 sleep( 1 );
8677
8678                 status = pthread_detach( &t );
8679                 if( status ) return status;
8680         }
8681 #endif
8682
8683 #ifdef HAVE_LINUX_THREADS
8684         pthread_kill_other_threads_np();
8685 #endif
8686
8687         return 0;
8688
8689 }
8690
8691 EOF
8692 if { (eval echo configure:8693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8693 then
8694   ol_cv_pthread_pthreads=yes
8695 else
8696   echo "configure: failed program was:" >&5
8697   cat conftest.$ac_ext >&5
8698   rm -fr conftest*
8699   ol_cv_pthread_pthreads=no
8700 fi
8701 rm -fr conftest*
8702 fi
8703
8704
8705                 # restore the LIBS
8706                 LIBS="$ol_LIBS"
8707         
8708 fi
8709
8710 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8711
8712         if test $ol_cv_pthread_pthreads = yes ; then
8713                 ol_link_pthreads="-pthreads"
8714                 ol_link_threads=posix
8715         fi
8716 fi
8717
8718                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8719 if test "$ol_link_threads" = no ; then
8720         # try -mthreads
8721         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8722 echo "configure:8723: checking for pthread link with -mthreads" >&5
8723 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8724   echo $ac_n "(cached) $ac_c" 1>&6
8725 else
8726   
8727                 # save the flags
8728                 ol_LIBS="$LIBS"
8729                 LIBS="-mthreads $LIBS"
8730
8731                 if test "$cross_compiling" = yes; then
8732   cat > conftest.$ac_ext <<EOF
8733 #line 8734 "configure"
8734 #include "confdefs.h"
8735 /* pthread test headers */
8736 #include <pthread.h>
8737 #ifndef NULL
8738 #define NULL (void*)0
8739 #endif
8740
8741 static void *task(p)
8742         void *p;
8743 {
8744         return (void *) (p == NULL);
8745 }
8746
8747 int main() {
8748
8749         /* pthread test function */
8750         pthread_t t;
8751         int status;
8752         int detach = 1;
8753
8754 #ifdef HAVE_PTHREADS_FINAL
8755         /* Final pthreads */
8756         pthread_attr_t attr;
8757
8758         status = pthread_attr_init(&attr);
8759         if( status ) return status;
8760
8761 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8762         if( !detach ) {
8763 #if defined( PTHREAD_CREATE_JOINABLE )
8764                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8765 #else
8766                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8767 #endif
8768
8769 #ifdef PTHREAD_CREATE_DETACHED
8770         } else {
8771                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8772 #endif
8773         }
8774         if( status ) return status;
8775 #endif
8776
8777         status = pthread_create( &t, &attr, task, NULL );
8778         if( status ) return status;
8779
8780 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8781         if( detach ) {
8782                 /* give thread a chance to complete */
8783                 /* it should remain joinable and hence detachable */
8784                 sleep( 1 );
8785
8786                 status = pthread_detach( t );
8787                 if( status ) return status;
8788         }
8789 #endif
8790
8791 #else
8792         /* Draft 4 pthreads */
8793         status = pthread_create( &t, pthread_attr_default, task, NULL );
8794         if( status ) return status;
8795
8796         if( detach ) {
8797                 /* give thread a chance to complete */
8798                 /* it should remain joinable and hence detachable */
8799                 sleep( 1 );
8800
8801                 status = pthread_detach( &t );
8802                 if( status ) return status;
8803         }
8804 #endif
8805
8806 #ifdef HAVE_LINUX_THREADS
8807         pthread_kill_other_threads_np();
8808 #endif
8809
8810         return 0;
8811
8812 ; return 0; }
8813 EOF
8814 if { (eval echo configure:8815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8815   rm -rf conftest*
8816   ol_cv_pthread_mthreads=yes
8817 else
8818   echo "configure: failed program was:" >&5
8819   cat conftest.$ac_ext >&5
8820   rm -rf conftest*
8821   ol_cv_pthread_mthreads=no
8822 fi
8823 rm -f conftest*
8824 else
8825   cat > conftest.$ac_ext <<EOF
8826 #line 8827 "configure"
8827 #include "confdefs.h"
8828 /* pthread test headers */
8829 #include <pthread.h>
8830 #ifndef NULL
8831 #define NULL (void*)0
8832 #endif
8833
8834 static void *task(p)
8835         void *p;
8836 {
8837         return (void *) (p == NULL);
8838 }
8839
8840
8841 int main(argc, argv)
8842         int argc;
8843         char **argv;
8844 {
8845
8846         /* pthread test function */
8847         pthread_t t;
8848         int status;
8849         int detach = 1;
8850
8851 #ifdef HAVE_PTHREADS_FINAL
8852         /* Final pthreads */
8853         pthread_attr_t attr;
8854
8855         status = pthread_attr_init(&attr);
8856         if( status ) return status;
8857
8858 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8859         if( !detach ) {
8860 #if defined( PTHREAD_CREATE_JOINABLE )
8861                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8862 #else
8863                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8864 #endif
8865
8866 #ifdef PTHREAD_CREATE_DETACHED
8867         } else {
8868                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8869 #endif
8870         }
8871         if( status ) return status;
8872 #endif
8873
8874         status = pthread_create( &t, &attr, task, NULL );
8875         if( status ) return status;
8876
8877 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8878         if( detach ) {
8879                 /* give thread a chance to complete */
8880                 /* it should remain joinable and hence detachable */
8881                 sleep( 1 );
8882
8883                 status = pthread_detach( t );
8884                 if( status ) return status;
8885         }
8886 #endif
8887
8888 #else
8889         /* Draft 4 pthreads */
8890         status = pthread_create( &t, pthread_attr_default, task, NULL );
8891         if( status ) return status;
8892
8893         if( detach ) {
8894                 /* give thread a chance to complete */
8895                 /* it should remain joinable and hence detachable */
8896                 sleep( 1 );
8897
8898                 status = pthread_detach( &t );
8899                 if( status ) return status;
8900         }
8901 #endif
8902
8903 #ifdef HAVE_LINUX_THREADS
8904         pthread_kill_other_threads_np();
8905 #endif
8906
8907         return 0;
8908
8909 }
8910
8911 EOF
8912 if { (eval echo configure:8913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8913 then
8914   ol_cv_pthread_mthreads=yes
8915 else
8916   echo "configure: failed program was:" >&5
8917   cat conftest.$ac_ext >&5
8918   rm -fr conftest*
8919   ol_cv_pthread_mthreads=no
8920 fi
8921 rm -fr conftest*
8922 fi
8923
8924
8925                 # restore the LIBS
8926                 LIBS="$ol_LIBS"
8927         
8928 fi
8929
8930 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8931
8932         if test $ol_cv_pthread_mthreads = yes ; then
8933                 ol_link_pthreads="-mthreads"
8934                 ol_link_threads=posix
8935         fi
8936 fi
8937
8938                 # Pthread try link: -thread (ol_cv_pthread_thread)
8939 if test "$ol_link_threads" = no ; then
8940         # try -thread
8941         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8942 echo "configure:8943: checking for pthread link with -thread" >&5
8943 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8944   echo $ac_n "(cached) $ac_c" 1>&6
8945 else
8946   
8947                 # save the flags
8948                 ol_LIBS="$LIBS"
8949                 LIBS="-thread $LIBS"
8950
8951                 if test "$cross_compiling" = yes; then
8952   cat > conftest.$ac_ext <<EOF
8953 #line 8954 "configure"
8954 #include "confdefs.h"
8955 /* pthread test headers */
8956 #include <pthread.h>
8957 #ifndef NULL
8958 #define NULL (void*)0
8959 #endif
8960
8961 static void *task(p)
8962         void *p;
8963 {
8964         return (void *) (p == NULL);
8965 }
8966
8967 int main() {
8968
8969         /* pthread test function */
8970         pthread_t t;
8971         int status;
8972         int detach = 1;
8973
8974 #ifdef HAVE_PTHREADS_FINAL
8975         /* Final pthreads */
8976         pthread_attr_t attr;
8977
8978         status = pthread_attr_init(&attr);
8979         if( status ) return status;
8980
8981 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8982         if( !detach ) {
8983 #if defined( PTHREAD_CREATE_JOINABLE )
8984                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8985 #else
8986                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8987 #endif
8988
8989 #ifdef PTHREAD_CREATE_DETACHED
8990         } else {
8991                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8992 #endif
8993         }
8994         if( status ) return status;
8995 #endif
8996
8997         status = pthread_create( &t, &attr, task, NULL );
8998         if( status ) return status;
8999
9000 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9001         if( detach ) {
9002                 /* give thread a chance to complete */
9003                 /* it should remain joinable and hence detachable */
9004                 sleep( 1 );
9005
9006                 status = pthread_detach( t );
9007                 if( status ) return status;
9008         }
9009 #endif
9010
9011 #else
9012         /* Draft 4 pthreads */
9013         status = pthread_create( &t, pthread_attr_default, task, NULL );
9014         if( status ) return status;
9015
9016         if( detach ) {
9017                 /* give thread a chance to complete */
9018                 /* it should remain joinable and hence detachable */
9019                 sleep( 1 );
9020
9021                 status = pthread_detach( &t );
9022                 if( status ) return status;
9023         }
9024 #endif
9025
9026 #ifdef HAVE_LINUX_THREADS
9027         pthread_kill_other_threads_np();
9028 #endif
9029
9030         return 0;
9031
9032 ; return 0; }
9033 EOF
9034 if { (eval echo configure:9035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9035   rm -rf conftest*
9036   ol_cv_pthread_thread=yes
9037 else
9038   echo "configure: failed program was:" >&5
9039   cat conftest.$ac_ext >&5
9040   rm -rf conftest*
9041   ol_cv_pthread_thread=no
9042 fi
9043 rm -f conftest*
9044 else
9045   cat > conftest.$ac_ext <<EOF
9046 #line 9047 "configure"
9047 #include "confdefs.h"
9048 /* pthread test headers */
9049 #include <pthread.h>
9050 #ifndef NULL
9051 #define NULL (void*)0
9052 #endif
9053
9054 static void *task(p)
9055         void *p;
9056 {
9057         return (void *) (p == NULL);
9058 }
9059
9060
9061 int main(argc, argv)
9062         int argc;
9063         char **argv;
9064 {
9065
9066         /* pthread test function */
9067         pthread_t t;
9068         int status;
9069         int detach = 1;
9070
9071 #ifdef HAVE_PTHREADS_FINAL
9072         /* Final pthreads */
9073         pthread_attr_t attr;
9074
9075         status = pthread_attr_init(&attr);
9076         if( status ) return status;
9077
9078 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9079         if( !detach ) {
9080 #if defined( PTHREAD_CREATE_JOINABLE )
9081                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9082 #else
9083                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9084 #endif
9085
9086 #ifdef PTHREAD_CREATE_DETACHED
9087         } else {
9088                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9089 #endif
9090         }
9091         if( status ) return status;
9092 #endif
9093
9094         status = pthread_create( &t, &attr, task, NULL );
9095         if( status ) return status;
9096
9097 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9098         if( detach ) {
9099                 /* give thread a chance to complete */
9100                 /* it should remain joinable and hence detachable */
9101                 sleep( 1 );
9102
9103                 status = pthread_detach( t );
9104                 if( status ) return status;
9105         }
9106 #endif
9107
9108 #else
9109         /* Draft 4 pthreads */
9110         status = pthread_create( &t, pthread_attr_default, task, NULL );
9111         if( status ) return status;
9112
9113         if( detach ) {
9114                 /* give thread a chance to complete */
9115                 /* it should remain joinable and hence detachable */
9116                 sleep( 1 );
9117
9118                 status = pthread_detach( &t );
9119                 if( status ) return status;
9120         }
9121 #endif
9122
9123 #ifdef HAVE_LINUX_THREADS
9124         pthread_kill_other_threads_np();
9125 #endif
9126
9127         return 0;
9128
9129 }
9130
9131 EOF
9132 if { (eval echo configure:9133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9133 then
9134   ol_cv_pthread_thread=yes
9135 else
9136   echo "configure: failed program was:" >&5
9137   cat conftest.$ac_ext >&5
9138   rm -fr conftest*
9139   ol_cv_pthread_thread=no
9140 fi
9141 rm -fr conftest*
9142 fi
9143
9144
9145                 # restore the LIBS
9146                 LIBS="$ol_LIBS"
9147         
9148 fi
9149
9150 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9151
9152         if test $ol_cv_pthread_thread = yes ; then
9153                 ol_link_pthreads="-thread"
9154                 ol_link_threads=posix
9155         fi
9156 fi
9157
9158
9159                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9160 if test "$ol_link_threads" = no ; then
9161         # try -lpthread -lmach -lexc -lc_r
9162         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9163 echo "configure:9164: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9164 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9165   echo $ac_n "(cached) $ac_c" 1>&6
9166 else
9167   
9168                 # save the flags
9169                 ol_LIBS="$LIBS"
9170                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9171
9172                 if test "$cross_compiling" = yes; then
9173   cat > conftest.$ac_ext <<EOF
9174 #line 9175 "configure"
9175 #include "confdefs.h"
9176 /* pthread test headers */
9177 #include <pthread.h>
9178 #ifndef NULL
9179 #define NULL (void*)0
9180 #endif
9181
9182 static void *task(p)
9183         void *p;
9184 {
9185         return (void *) (p == NULL);
9186 }
9187
9188 int main() {
9189
9190         /* pthread test function */
9191         pthread_t t;
9192         int status;
9193         int detach = 1;
9194
9195 #ifdef HAVE_PTHREADS_FINAL
9196         /* Final pthreads */
9197         pthread_attr_t attr;
9198
9199         status = pthread_attr_init(&attr);
9200         if( status ) return status;
9201
9202 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9203         if( !detach ) {
9204 #if defined( PTHREAD_CREATE_JOINABLE )
9205                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9206 #else
9207                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9208 #endif
9209
9210 #ifdef PTHREAD_CREATE_DETACHED
9211         } else {
9212                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9213 #endif
9214         }
9215         if( status ) return status;
9216 #endif
9217
9218         status = pthread_create( &t, &attr, task, NULL );
9219         if( status ) return status;
9220
9221 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9222         if( detach ) {
9223                 /* give thread a chance to complete */
9224                 /* it should remain joinable and hence detachable */
9225                 sleep( 1 );
9226
9227                 status = pthread_detach( t );
9228                 if( status ) return status;
9229         }
9230 #endif
9231
9232 #else
9233         /* Draft 4 pthreads */
9234         status = pthread_create( &t, pthread_attr_default, task, NULL );
9235         if( status ) return status;
9236
9237         if( detach ) {
9238                 /* give thread a chance to complete */
9239                 /* it should remain joinable and hence detachable */
9240                 sleep( 1 );
9241
9242                 status = pthread_detach( &t );
9243                 if( status ) return status;
9244         }
9245 #endif
9246
9247 #ifdef HAVE_LINUX_THREADS
9248         pthread_kill_other_threads_np();
9249 #endif
9250
9251         return 0;
9252
9253 ; return 0; }
9254 EOF
9255 if { (eval echo configure:9256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9256   rm -rf conftest*
9257   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9258 else
9259   echo "configure: failed program was:" >&5
9260   cat conftest.$ac_ext >&5
9261   rm -rf conftest*
9262   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9263 fi
9264 rm -f conftest*
9265 else
9266   cat > conftest.$ac_ext <<EOF
9267 #line 9268 "configure"
9268 #include "confdefs.h"
9269 /* pthread test headers */
9270 #include <pthread.h>
9271 #ifndef NULL
9272 #define NULL (void*)0
9273 #endif
9274
9275 static void *task(p)
9276         void *p;
9277 {
9278         return (void *) (p == NULL);
9279 }
9280
9281
9282 int main(argc, argv)
9283         int argc;
9284         char **argv;
9285 {
9286
9287         /* pthread test function */
9288         pthread_t t;
9289         int status;
9290         int detach = 1;
9291
9292 #ifdef HAVE_PTHREADS_FINAL
9293         /* Final pthreads */
9294         pthread_attr_t attr;
9295
9296         status = pthread_attr_init(&attr);
9297         if( status ) return status;
9298
9299 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9300         if( !detach ) {
9301 #if defined( PTHREAD_CREATE_JOINABLE )
9302                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9303 #else
9304                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9305 #endif
9306
9307 #ifdef PTHREAD_CREATE_DETACHED
9308         } else {
9309                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9310 #endif
9311         }
9312         if( status ) return status;
9313 #endif
9314
9315         status = pthread_create( &t, &attr, task, NULL );
9316         if( status ) return status;
9317
9318 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9319         if( detach ) {
9320                 /* give thread a chance to complete */
9321                 /* it should remain joinable and hence detachable */
9322                 sleep( 1 );
9323
9324                 status = pthread_detach( t );
9325                 if( status ) return status;
9326         }
9327 #endif
9328
9329 #else
9330         /* Draft 4 pthreads */
9331         status = pthread_create( &t, pthread_attr_default, task, NULL );
9332         if( status ) return status;
9333
9334         if( detach ) {
9335                 /* give thread a chance to complete */
9336                 /* it should remain joinable and hence detachable */
9337                 sleep( 1 );
9338
9339                 status = pthread_detach( &t );
9340                 if( status ) return status;
9341         }
9342 #endif
9343
9344 #ifdef HAVE_LINUX_THREADS
9345         pthread_kill_other_threads_np();
9346 #endif
9347
9348         return 0;
9349
9350 }
9351
9352 EOF
9353 if { (eval echo configure:9354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9354 then
9355   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9356 else
9357   echo "configure: failed program was:" >&5
9358   cat conftest.$ac_ext >&5
9359   rm -fr conftest*
9360   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9361 fi
9362 rm -fr conftest*
9363 fi
9364
9365
9366                 # restore the LIBS
9367                 LIBS="$ol_LIBS"
9368         
9369 fi
9370
9371 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9372
9373         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9374                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9375                 ol_link_threads=posix
9376         fi
9377 fi
9378
9379                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9380 if test "$ol_link_threads" = no ; then
9381         # try -lpthread -lmach -lexc
9382         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9383 echo "configure:9384: checking for pthread link with -lpthread -lmach -lexc" >&5
9384 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9385   echo $ac_n "(cached) $ac_c" 1>&6
9386 else
9387   
9388                 # save the flags
9389                 ol_LIBS="$LIBS"
9390                 LIBS="-lpthread -lmach -lexc $LIBS"
9391
9392                 if test "$cross_compiling" = yes; then
9393   cat > conftest.$ac_ext <<EOF
9394 #line 9395 "configure"
9395 #include "confdefs.h"
9396 /* pthread test headers */
9397 #include <pthread.h>
9398 #ifndef NULL
9399 #define NULL (void*)0
9400 #endif
9401
9402 static void *task(p)
9403         void *p;
9404 {
9405         return (void *) (p == NULL);
9406 }
9407
9408 int main() {
9409
9410         /* pthread test function */
9411         pthread_t t;
9412         int status;
9413         int detach = 1;
9414
9415 #ifdef HAVE_PTHREADS_FINAL
9416         /* Final pthreads */
9417         pthread_attr_t attr;
9418
9419         status = pthread_attr_init(&attr);
9420         if( status ) return status;
9421
9422 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9423         if( !detach ) {
9424 #if defined( PTHREAD_CREATE_JOINABLE )
9425                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9426 #else
9427                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9428 #endif
9429
9430 #ifdef PTHREAD_CREATE_DETACHED
9431         } else {
9432                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9433 #endif
9434         }
9435         if( status ) return status;
9436 #endif
9437
9438         status = pthread_create( &t, &attr, task, NULL );
9439         if( status ) return status;
9440
9441 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9442         if( detach ) {
9443                 /* give thread a chance to complete */
9444                 /* it should remain joinable and hence detachable */
9445                 sleep( 1 );
9446
9447                 status = pthread_detach( t );
9448                 if( status ) return status;
9449         }
9450 #endif
9451
9452 #else
9453         /* Draft 4 pthreads */
9454         status = pthread_create( &t, pthread_attr_default, task, NULL );
9455         if( status ) return status;
9456
9457         if( detach ) {
9458                 /* give thread a chance to complete */
9459                 /* it should remain joinable and hence detachable */
9460                 sleep( 1 );
9461
9462                 status = pthread_detach( &t );
9463                 if( status ) return status;
9464         }
9465 #endif
9466
9467 #ifdef HAVE_LINUX_THREADS
9468         pthread_kill_other_threads_np();
9469 #endif
9470
9471         return 0;
9472
9473 ; return 0; }
9474 EOF
9475 if { (eval echo configure:9476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9476   rm -rf conftest*
9477   ol_cv_pthread_lpthread_lmach_lexc=yes
9478 else
9479   echo "configure: failed program was:" >&5
9480   cat conftest.$ac_ext >&5
9481   rm -rf conftest*
9482   ol_cv_pthread_lpthread_lmach_lexc=no
9483 fi
9484 rm -f conftest*
9485 else
9486   cat > conftest.$ac_ext <<EOF
9487 #line 9488 "configure"
9488 #include "confdefs.h"
9489 /* pthread test headers */
9490 #include <pthread.h>
9491 #ifndef NULL
9492 #define NULL (void*)0
9493 #endif
9494
9495 static void *task(p)
9496         void *p;
9497 {
9498         return (void *) (p == NULL);
9499 }
9500
9501
9502 int main(argc, argv)
9503         int argc;
9504         char **argv;
9505 {
9506
9507         /* pthread test function */
9508         pthread_t t;
9509         int status;
9510         int detach = 1;
9511
9512 #ifdef HAVE_PTHREADS_FINAL
9513         /* Final pthreads */
9514         pthread_attr_t attr;
9515
9516         status = pthread_attr_init(&attr);
9517         if( status ) return status;
9518
9519 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9520         if( !detach ) {
9521 #if defined( PTHREAD_CREATE_JOINABLE )
9522                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9523 #else
9524                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9525 #endif
9526
9527 #ifdef PTHREAD_CREATE_DETACHED
9528         } else {
9529                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9530 #endif
9531         }
9532         if( status ) return status;
9533 #endif
9534
9535         status = pthread_create( &t, &attr, task, NULL );
9536         if( status ) return status;
9537
9538 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9539         if( detach ) {
9540                 /* give thread a chance to complete */
9541                 /* it should remain joinable and hence detachable */
9542                 sleep( 1 );
9543
9544                 status = pthread_detach( t );
9545                 if( status ) return status;
9546         }
9547 #endif
9548
9549 #else
9550         /* Draft 4 pthreads */
9551         status = pthread_create( &t, pthread_attr_default, task, NULL );
9552         if( status ) return status;
9553
9554         if( detach ) {
9555                 /* give thread a chance to complete */
9556                 /* it should remain joinable and hence detachable */
9557                 sleep( 1 );
9558
9559                 status = pthread_detach( &t );
9560                 if( status ) return status;
9561         }
9562 #endif
9563
9564 #ifdef HAVE_LINUX_THREADS
9565         pthread_kill_other_threads_np();
9566 #endif
9567
9568         return 0;
9569
9570 }
9571
9572 EOF
9573 if { (eval echo configure:9574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9574 then
9575   ol_cv_pthread_lpthread_lmach_lexc=yes
9576 else
9577   echo "configure: failed program was:" >&5
9578   cat conftest.$ac_ext >&5
9579   rm -fr conftest*
9580   ol_cv_pthread_lpthread_lmach_lexc=no
9581 fi
9582 rm -fr conftest*
9583 fi
9584
9585
9586                 # restore the LIBS
9587                 LIBS="$ol_LIBS"
9588         
9589 fi
9590
9591 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9592
9593         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9594                 ol_link_pthreads="-lpthread -lmach -lexc"
9595                 ol_link_threads=posix
9596         fi
9597 fi
9598
9599
9600                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9601 if test "$ol_link_threads" = no ; then
9602         # try -lpthread -Wl,-woff,85
9603         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9604 echo "configure:9605: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9605 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9606   echo $ac_n "(cached) $ac_c" 1>&6
9607 else
9608   
9609                 # save the flags
9610                 ol_LIBS="$LIBS"
9611                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9612
9613                 if test "$cross_compiling" = yes; then
9614   cat > conftest.$ac_ext <<EOF
9615 #line 9616 "configure"
9616 #include "confdefs.h"
9617 /* pthread test headers */
9618 #include <pthread.h>
9619 #ifndef NULL
9620 #define NULL (void*)0
9621 #endif
9622
9623 static void *task(p)
9624         void *p;
9625 {
9626         return (void *) (p == NULL);
9627 }
9628
9629 int main() {
9630
9631         /* pthread test function */
9632         pthread_t t;
9633         int status;
9634         int detach = 1;
9635
9636 #ifdef HAVE_PTHREADS_FINAL
9637         /* Final pthreads */
9638         pthread_attr_t attr;
9639
9640         status = pthread_attr_init(&attr);
9641         if( status ) return status;
9642
9643 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9644         if( !detach ) {
9645 #if defined( PTHREAD_CREATE_JOINABLE )
9646                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9647 #else
9648                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9649 #endif
9650
9651 #ifdef PTHREAD_CREATE_DETACHED
9652         } else {
9653                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9654 #endif
9655         }
9656         if( status ) return status;
9657 #endif
9658
9659         status = pthread_create( &t, &attr, task, NULL );
9660         if( status ) return status;
9661
9662 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9663         if( detach ) {
9664                 /* give thread a chance to complete */
9665                 /* it should remain joinable and hence detachable */
9666                 sleep( 1 );
9667
9668                 status = pthread_detach( t );
9669                 if( status ) return status;
9670         }
9671 #endif
9672
9673 #else
9674         /* Draft 4 pthreads */
9675         status = pthread_create( &t, pthread_attr_default, task, NULL );
9676         if( status ) return status;
9677
9678         if( detach ) {
9679                 /* give thread a chance to complete */
9680                 /* it should remain joinable and hence detachable */
9681                 sleep( 1 );
9682
9683                 status = pthread_detach( &t );
9684                 if( status ) return status;
9685         }
9686 #endif
9687
9688 #ifdef HAVE_LINUX_THREADS
9689         pthread_kill_other_threads_np();
9690 #endif
9691
9692         return 0;
9693
9694 ; return 0; }
9695 EOF
9696 if { (eval echo configure:9697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9697   rm -rf conftest*
9698   ol_cv_pthread_lib_lpthread_woff=yes
9699 else
9700   echo "configure: failed program was:" >&5
9701   cat conftest.$ac_ext >&5
9702   rm -rf conftest*
9703   ol_cv_pthread_lib_lpthread_woff=no
9704 fi
9705 rm -f conftest*
9706 else
9707   cat > conftest.$ac_ext <<EOF
9708 #line 9709 "configure"
9709 #include "confdefs.h"
9710 /* pthread test headers */
9711 #include <pthread.h>
9712 #ifndef NULL
9713 #define NULL (void*)0
9714 #endif
9715
9716 static void *task(p)
9717         void *p;
9718 {
9719         return (void *) (p == NULL);
9720 }
9721
9722
9723 int main(argc, argv)
9724         int argc;
9725         char **argv;
9726 {
9727
9728         /* pthread test function */
9729         pthread_t t;
9730         int status;
9731         int detach = 1;
9732
9733 #ifdef HAVE_PTHREADS_FINAL
9734         /* Final pthreads */
9735         pthread_attr_t attr;
9736
9737         status = pthread_attr_init(&attr);
9738         if( status ) return status;
9739
9740 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9741         if( !detach ) {
9742 #if defined( PTHREAD_CREATE_JOINABLE )
9743                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9744 #else
9745                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9746 #endif
9747
9748 #ifdef PTHREAD_CREATE_DETACHED
9749         } else {
9750                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9751 #endif
9752         }
9753         if( status ) return status;
9754 #endif
9755
9756         status = pthread_create( &t, &attr, task, NULL );
9757         if( status ) return status;
9758
9759 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9760         if( detach ) {
9761                 /* give thread a chance to complete */
9762                 /* it should remain joinable and hence detachable */
9763                 sleep( 1 );
9764
9765                 status = pthread_detach( t );
9766                 if( status ) return status;
9767         }
9768 #endif
9769
9770 #else
9771         /* Draft 4 pthreads */
9772         status = pthread_create( &t, pthread_attr_default, task, NULL );
9773         if( status ) return status;
9774
9775         if( detach ) {
9776                 /* give thread a chance to complete */
9777                 /* it should remain joinable and hence detachable */
9778                 sleep( 1 );
9779
9780                 status = pthread_detach( &t );
9781                 if( status ) return status;
9782         }
9783 #endif
9784
9785 #ifdef HAVE_LINUX_THREADS
9786         pthread_kill_other_threads_np();
9787 #endif
9788
9789         return 0;
9790
9791 }
9792
9793 EOF
9794 if { (eval echo configure:9795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9795 then
9796   ol_cv_pthread_lib_lpthread_woff=yes
9797 else
9798   echo "configure: failed program was:" >&5
9799   cat conftest.$ac_ext >&5
9800   rm -fr conftest*
9801   ol_cv_pthread_lib_lpthread_woff=no
9802 fi
9803 rm -fr conftest*
9804 fi
9805
9806
9807                 # restore the LIBS
9808                 LIBS="$ol_LIBS"
9809         
9810 fi
9811
9812 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9813
9814         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9815                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9816                 ol_link_threads=posix
9817         fi
9818 fi
9819
9820
9821                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9822 if test "$ol_link_threads" = no ; then
9823         # try -lpthread
9824         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9825 echo "configure:9826: checking for pthread link with -lpthread" >&5
9826 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9827   echo $ac_n "(cached) $ac_c" 1>&6
9828 else
9829   
9830                 # save the flags
9831                 ol_LIBS="$LIBS"
9832                 LIBS="-lpthread $LIBS"
9833
9834                 if test "$cross_compiling" = yes; then
9835   cat > conftest.$ac_ext <<EOF
9836 #line 9837 "configure"
9837 #include "confdefs.h"
9838 /* pthread test headers */
9839 #include <pthread.h>
9840 #ifndef NULL
9841 #define NULL (void*)0
9842 #endif
9843
9844 static void *task(p)
9845         void *p;
9846 {
9847         return (void *) (p == NULL);
9848 }
9849
9850 int main() {
9851
9852         /* pthread test function */
9853         pthread_t t;
9854         int status;
9855         int detach = 1;
9856
9857 #ifdef HAVE_PTHREADS_FINAL
9858         /* Final pthreads */
9859         pthread_attr_t attr;
9860
9861         status = pthread_attr_init(&attr);
9862         if( status ) return status;
9863
9864 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9865         if( !detach ) {
9866 #if defined( PTHREAD_CREATE_JOINABLE )
9867                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9868 #else
9869                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9870 #endif
9871
9872 #ifdef PTHREAD_CREATE_DETACHED
9873         } else {
9874                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9875 #endif
9876         }
9877         if( status ) return status;
9878 #endif
9879
9880         status = pthread_create( &t, &attr, task, NULL );
9881         if( status ) return status;
9882
9883 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9884         if( detach ) {
9885                 /* give thread a chance to complete */
9886                 /* it should remain joinable and hence detachable */
9887                 sleep( 1 );
9888
9889                 status = pthread_detach( t );
9890                 if( status ) return status;
9891         }
9892 #endif
9893
9894 #else
9895         /* Draft 4 pthreads */
9896         status = pthread_create( &t, pthread_attr_default, task, NULL );
9897         if( status ) return status;
9898
9899         if( detach ) {
9900                 /* give thread a chance to complete */
9901                 /* it should remain joinable and hence detachable */
9902                 sleep( 1 );
9903
9904                 status = pthread_detach( &t );
9905                 if( status ) return status;
9906         }
9907 #endif
9908
9909 #ifdef HAVE_LINUX_THREADS
9910         pthread_kill_other_threads_np();
9911 #endif
9912
9913         return 0;
9914
9915 ; return 0; }
9916 EOF
9917 if { (eval echo configure:9918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9918   rm -rf conftest*
9919   ol_cv_pthread_lpthread=yes
9920 else
9921   echo "configure: failed program was:" >&5
9922   cat conftest.$ac_ext >&5
9923   rm -rf conftest*
9924   ol_cv_pthread_lpthread=no
9925 fi
9926 rm -f conftest*
9927 else
9928   cat > conftest.$ac_ext <<EOF
9929 #line 9930 "configure"
9930 #include "confdefs.h"
9931 /* pthread test headers */
9932 #include <pthread.h>
9933 #ifndef NULL
9934 #define NULL (void*)0
9935 #endif
9936
9937 static void *task(p)
9938         void *p;
9939 {
9940         return (void *) (p == NULL);
9941 }
9942
9943
9944 int main(argc, argv)
9945         int argc;
9946         char **argv;
9947 {
9948
9949         /* pthread test function */
9950         pthread_t t;
9951         int status;
9952         int detach = 1;
9953
9954 #ifdef HAVE_PTHREADS_FINAL
9955         /* Final pthreads */
9956         pthread_attr_t attr;
9957
9958         status = pthread_attr_init(&attr);
9959         if( status ) return status;
9960
9961 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9962         if( !detach ) {
9963 #if defined( PTHREAD_CREATE_JOINABLE )
9964                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9965 #else
9966                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9967 #endif
9968
9969 #ifdef PTHREAD_CREATE_DETACHED
9970         } else {
9971                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9972 #endif
9973         }
9974         if( status ) return status;
9975 #endif
9976
9977         status = pthread_create( &t, &attr, task, NULL );
9978         if( status ) return status;
9979
9980 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9981         if( detach ) {
9982                 /* give thread a chance to complete */
9983                 /* it should remain joinable and hence detachable */
9984                 sleep( 1 );
9985
9986                 status = pthread_detach( t );
9987                 if( status ) return status;
9988         }
9989 #endif
9990
9991 #else
9992         /* Draft 4 pthreads */
9993         status = pthread_create( &t, pthread_attr_default, task, NULL );
9994         if( status ) return status;
9995
9996         if( detach ) {
9997                 /* give thread a chance to complete */
9998                 /* it should remain joinable and hence detachable */
9999                 sleep( 1 );
10000
10001                 status = pthread_detach( &t );
10002                 if( status ) return status;
10003         }
10004 #endif
10005
10006 #ifdef HAVE_LINUX_THREADS
10007         pthread_kill_other_threads_np();
10008 #endif
10009
10010         return 0;
10011
10012 }
10013
10014 EOF
10015 if { (eval echo configure:10016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10016 then
10017   ol_cv_pthread_lpthread=yes
10018 else
10019   echo "configure: failed program was:" >&5
10020   cat conftest.$ac_ext >&5
10021   rm -fr conftest*
10022   ol_cv_pthread_lpthread=no
10023 fi
10024 rm -fr conftest*
10025 fi
10026
10027
10028                 # restore the LIBS
10029                 LIBS="$ol_LIBS"
10030         
10031 fi
10032
10033 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
10034
10035         if test $ol_cv_pthread_lpthread = yes ; then
10036                 ol_link_pthreads="-lpthread"
10037                 ol_link_threads=posix
10038         fi
10039 fi
10040
10041                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
10042 if test "$ol_link_threads" = no ; then
10043         # try -lc_r
10044         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
10045 echo "configure:10046: checking for pthread link with -lc_r" >&5
10046 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
10047   echo $ac_n "(cached) $ac_c" 1>&6
10048 else
10049   
10050                 # save the flags
10051                 ol_LIBS="$LIBS"
10052                 LIBS="-lc_r $LIBS"
10053
10054                 if test "$cross_compiling" = yes; then
10055   cat > conftest.$ac_ext <<EOF
10056 #line 10057 "configure"
10057 #include "confdefs.h"
10058 /* pthread test headers */
10059 #include <pthread.h>
10060 #ifndef NULL
10061 #define NULL (void*)0
10062 #endif
10063
10064 static void *task(p)
10065         void *p;
10066 {
10067         return (void *) (p == NULL);
10068 }
10069
10070 int main() {
10071
10072         /* pthread test function */
10073         pthread_t t;
10074         int status;
10075         int detach = 1;
10076
10077 #ifdef HAVE_PTHREADS_FINAL
10078         /* Final pthreads */
10079         pthread_attr_t attr;
10080
10081         status = pthread_attr_init(&attr);
10082         if( status ) return status;
10083
10084 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10085         if( !detach ) {
10086 #if defined( PTHREAD_CREATE_JOINABLE )
10087                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10088 #else
10089                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10090 #endif
10091
10092 #ifdef PTHREAD_CREATE_DETACHED
10093         } else {
10094                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10095 #endif
10096         }
10097         if( status ) return status;
10098 #endif
10099
10100         status = pthread_create( &t, &attr, task, NULL );
10101         if( status ) return status;
10102
10103 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10104         if( detach ) {
10105                 /* give thread a chance to complete */
10106                 /* it should remain joinable and hence detachable */
10107                 sleep( 1 );
10108
10109                 status = pthread_detach( t );
10110                 if( status ) return status;
10111         }
10112 #endif
10113
10114 #else
10115         /* Draft 4 pthreads */
10116         status = pthread_create( &t, pthread_attr_default, task, NULL );
10117         if( status ) return status;
10118
10119         if( detach ) {
10120                 /* give thread a chance to complete */
10121                 /* it should remain joinable and hence detachable */
10122                 sleep( 1 );
10123
10124                 status = pthread_detach( &t );
10125                 if( status ) return status;
10126         }
10127 #endif
10128
10129 #ifdef HAVE_LINUX_THREADS
10130         pthread_kill_other_threads_np();
10131 #endif
10132
10133         return 0;
10134
10135 ; return 0; }
10136 EOF
10137 if { (eval echo configure:10138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10138   rm -rf conftest*
10139   ol_cv_pthread_lc_r=yes
10140 else
10141   echo "configure: failed program was:" >&5
10142   cat conftest.$ac_ext >&5
10143   rm -rf conftest*
10144   ol_cv_pthread_lc_r=no
10145 fi
10146 rm -f conftest*
10147 else
10148   cat > conftest.$ac_ext <<EOF
10149 #line 10150 "configure"
10150 #include "confdefs.h"
10151 /* pthread test headers */
10152 #include <pthread.h>
10153 #ifndef NULL
10154 #define NULL (void*)0
10155 #endif
10156
10157 static void *task(p)
10158         void *p;
10159 {
10160         return (void *) (p == NULL);
10161 }
10162
10163
10164 int main(argc, argv)
10165         int argc;
10166         char **argv;
10167 {
10168
10169         /* pthread test function */
10170         pthread_t t;
10171         int status;
10172         int detach = 1;
10173
10174 #ifdef HAVE_PTHREADS_FINAL
10175         /* Final pthreads */
10176         pthread_attr_t attr;
10177
10178         status = pthread_attr_init(&attr);
10179         if( status ) return status;
10180
10181 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10182         if( !detach ) {
10183 #if defined( PTHREAD_CREATE_JOINABLE )
10184                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10185 #else
10186                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10187 #endif
10188
10189 #ifdef PTHREAD_CREATE_DETACHED
10190         } else {
10191                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10192 #endif
10193         }
10194         if( status ) return status;
10195 #endif
10196
10197         status = pthread_create( &t, &attr, task, NULL );
10198         if( status ) return status;
10199
10200 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10201         if( detach ) {
10202                 /* give thread a chance to complete */
10203                 /* it should remain joinable and hence detachable */
10204                 sleep( 1 );
10205
10206                 status = pthread_detach( t );
10207                 if( status ) return status;
10208         }
10209 #endif
10210
10211 #else
10212         /* Draft 4 pthreads */
10213         status = pthread_create( &t, pthread_attr_default, task, NULL );
10214         if( status ) return status;
10215
10216         if( detach ) {
10217                 /* give thread a chance to complete */
10218                 /* it should remain joinable and hence detachable */
10219                 sleep( 1 );
10220
10221                 status = pthread_detach( &t );
10222                 if( status ) return status;
10223         }
10224 #endif
10225
10226 #ifdef HAVE_LINUX_THREADS
10227         pthread_kill_other_threads_np();
10228 #endif
10229
10230         return 0;
10231
10232 }
10233
10234 EOF
10235 if { (eval echo configure:10236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10236 then
10237   ol_cv_pthread_lc_r=yes
10238 else
10239   echo "configure: failed program was:" >&5
10240   cat conftest.$ac_ext >&5
10241   rm -fr conftest*
10242   ol_cv_pthread_lc_r=no
10243 fi
10244 rm -fr conftest*
10245 fi
10246
10247
10248                 # restore the LIBS
10249                 LIBS="$ol_LIBS"
10250         
10251 fi
10252
10253 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10254
10255         if test $ol_cv_pthread_lc_r = yes ; then
10256                 ol_link_pthreads="-lc_r"
10257                 ol_link_threads=posix
10258         fi
10259 fi
10260
10261
10262                 # Pthread try link: -threads (ol_cv_pthread_threads)
10263 if test "$ol_link_threads" = no ; then
10264         # try -threads
10265         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10266 echo "configure:10267: checking for pthread link with -threads" >&5
10267 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10268   echo $ac_n "(cached) $ac_c" 1>&6
10269 else
10270   
10271                 # save the flags
10272                 ol_LIBS="$LIBS"
10273                 LIBS="-threads $LIBS"
10274
10275                 if test "$cross_compiling" = yes; then
10276   cat > conftest.$ac_ext <<EOF
10277 #line 10278 "configure"
10278 #include "confdefs.h"
10279 /* pthread test headers */
10280 #include <pthread.h>
10281 #ifndef NULL
10282 #define NULL (void*)0
10283 #endif
10284
10285 static void *task(p)
10286         void *p;
10287 {
10288         return (void *) (p == NULL);
10289 }
10290
10291 int main() {
10292
10293         /* pthread test function */
10294         pthread_t t;
10295         int status;
10296         int detach = 1;
10297
10298 #ifdef HAVE_PTHREADS_FINAL
10299         /* Final pthreads */
10300         pthread_attr_t attr;
10301
10302         status = pthread_attr_init(&attr);
10303         if( status ) return status;
10304
10305 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10306         if( !detach ) {
10307 #if defined( PTHREAD_CREATE_JOINABLE )
10308                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10309 #else
10310                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10311 #endif
10312
10313 #ifdef PTHREAD_CREATE_DETACHED
10314         } else {
10315                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10316 #endif
10317         }
10318         if( status ) return status;
10319 #endif
10320
10321         status = pthread_create( &t, &attr, task, NULL );
10322         if( status ) return status;
10323
10324 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10325         if( detach ) {
10326                 /* give thread a chance to complete */
10327                 /* it should remain joinable and hence detachable */
10328                 sleep( 1 );
10329
10330                 status = pthread_detach( t );
10331                 if( status ) return status;
10332         }
10333 #endif
10334
10335 #else
10336         /* Draft 4 pthreads */
10337         status = pthread_create( &t, pthread_attr_default, task, NULL );
10338         if( status ) return status;
10339
10340         if( detach ) {
10341                 /* give thread a chance to complete */
10342                 /* it should remain joinable and hence detachable */
10343                 sleep( 1 );
10344
10345                 status = pthread_detach( &t );
10346                 if( status ) return status;
10347         }
10348 #endif
10349
10350 #ifdef HAVE_LINUX_THREADS
10351         pthread_kill_other_threads_np();
10352 #endif
10353
10354         return 0;
10355
10356 ; return 0; }
10357 EOF
10358 if { (eval echo configure:10359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10359   rm -rf conftest*
10360   ol_cv_pthread_threads=yes
10361 else
10362   echo "configure: failed program was:" >&5
10363   cat conftest.$ac_ext >&5
10364   rm -rf conftest*
10365   ol_cv_pthread_threads=no
10366 fi
10367 rm -f conftest*
10368 else
10369   cat > conftest.$ac_ext <<EOF
10370 #line 10371 "configure"
10371 #include "confdefs.h"
10372 /* pthread test headers */
10373 #include <pthread.h>
10374 #ifndef NULL
10375 #define NULL (void*)0
10376 #endif
10377
10378 static void *task(p)
10379         void *p;
10380 {
10381         return (void *) (p == NULL);
10382 }
10383
10384
10385 int main(argc, argv)
10386         int argc;
10387         char **argv;
10388 {
10389
10390         /* pthread test function */
10391         pthread_t t;
10392         int status;
10393         int detach = 1;
10394
10395 #ifdef HAVE_PTHREADS_FINAL
10396         /* Final pthreads */
10397         pthread_attr_t attr;
10398
10399         status = pthread_attr_init(&attr);
10400         if( status ) return status;
10401
10402 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10403         if( !detach ) {
10404 #if defined( PTHREAD_CREATE_JOINABLE )
10405                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10406 #else
10407                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10408 #endif
10409
10410 #ifdef PTHREAD_CREATE_DETACHED
10411         } else {
10412                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10413 #endif
10414         }
10415         if( status ) return status;
10416 #endif
10417
10418         status = pthread_create( &t, &attr, task, NULL );
10419         if( status ) return status;
10420
10421 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10422         if( detach ) {
10423                 /* give thread a chance to complete */
10424                 /* it should remain joinable and hence detachable */
10425                 sleep( 1 );
10426
10427                 status = pthread_detach( t );
10428                 if( status ) return status;
10429         }
10430 #endif
10431
10432 #else
10433         /* Draft 4 pthreads */
10434         status = pthread_create( &t, pthread_attr_default, task, NULL );
10435         if( status ) return status;
10436
10437         if( detach ) {
10438                 /* give thread a chance to complete */
10439                 /* it should remain joinable and hence detachable */
10440                 sleep( 1 );
10441
10442                 status = pthread_detach( &t );
10443                 if( status ) return status;
10444         }
10445 #endif
10446
10447 #ifdef HAVE_LINUX_THREADS
10448         pthread_kill_other_threads_np();
10449 #endif
10450
10451         return 0;
10452
10453 }
10454
10455 EOF
10456 if { (eval echo configure:10457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10457 then
10458   ol_cv_pthread_threads=yes
10459 else
10460   echo "configure: failed program was:" >&5
10461   cat conftest.$ac_ext >&5
10462   rm -fr conftest*
10463   ol_cv_pthread_threads=no
10464 fi
10465 rm -fr conftest*
10466 fi
10467
10468
10469                 # restore the LIBS
10470                 LIBS="$ol_LIBS"
10471         
10472 fi
10473
10474 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10475
10476         if test $ol_cv_pthread_threads = yes ; then
10477                 ol_link_pthreads="-threads"
10478                 ol_link_threads=posix
10479         fi
10480 fi
10481
10482
10483                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10484 if test "$ol_link_threads" = no ; then
10485         # try -lpthreads -lmach -lexc -lc_r
10486         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10487 echo "configure:10488: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10488 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10489   echo $ac_n "(cached) $ac_c" 1>&6
10490 else
10491   
10492                 # save the flags
10493                 ol_LIBS="$LIBS"
10494                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10495
10496                 if test "$cross_compiling" = yes; then
10497   cat > conftest.$ac_ext <<EOF
10498 #line 10499 "configure"
10499 #include "confdefs.h"
10500 /* pthread test headers */
10501 #include <pthread.h>
10502 #ifndef NULL
10503 #define NULL (void*)0
10504 #endif
10505
10506 static void *task(p)
10507         void *p;
10508 {
10509         return (void *) (p == NULL);
10510 }
10511
10512 int main() {
10513
10514         /* pthread test function */
10515         pthread_t t;
10516         int status;
10517         int detach = 1;
10518
10519 #ifdef HAVE_PTHREADS_FINAL
10520         /* Final pthreads */
10521         pthread_attr_t attr;
10522
10523         status = pthread_attr_init(&attr);
10524         if( status ) return status;
10525
10526 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10527         if( !detach ) {
10528 #if defined( PTHREAD_CREATE_JOINABLE )
10529                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10530 #else
10531                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10532 #endif
10533
10534 #ifdef PTHREAD_CREATE_DETACHED
10535         } else {
10536                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10537 #endif
10538         }
10539         if( status ) return status;
10540 #endif
10541
10542         status = pthread_create( &t, &attr, task, NULL );
10543         if( status ) return status;
10544
10545 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10546         if( detach ) {
10547                 /* give thread a chance to complete */
10548                 /* it should remain joinable and hence detachable */
10549                 sleep( 1 );
10550
10551                 status = pthread_detach( t );
10552                 if( status ) return status;
10553         }
10554 #endif
10555
10556 #else
10557         /* Draft 4 pthreads */
10558         status = pthread_create( &t, pthread_attr_default, task, NULL );
10559         if( status ) return status;
10560
10561         if( detach ) {
10562                 /* give thread a chance to complete */
10563                 /* it should remain joinable and hence detachable */
10564                 sleep( 1 );
10565
10566                 status = pthread_detach( &t );
10567                 if( status ) return status;
10568         }
10569 #endif
10570
10571 #ifdef HAVE_LINUX_THREADS
10572         pthread_kill_other_threads_np();
10573 #endif
10574
10575         return 0;
10576
10577 ; return 0; }
10578 EOF
10579 if { (eval echo configure:10580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10580   rm -rf conftest*
10581   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10582 else
10583   echo "configure: failed program was:" >&5
10584   cat conftest.$ac_ext >&5
10585   rm -rf conftest*
10586   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10587 fi
10588 rm -f conftest*
10589 else
10590   cat > conftest.$ac_ext <<EOF
10591 #line 10592 "configure"
10592 #include "confdefs.h"
10593 /* pthread test headers */
10594 #include <pthread.h>
10595 #ifndef NULL
10596 #define NULL (void*)0
10597 #endif
10598
10599 static void *task(p)
10600         void *p;
10601 {
10602         return (void *) (p == NULL);
10603 }
10604
10605
10606 int main(argc, argv)
10607         int argc;
10608         char **argv;
10609 {
10610
10611         /* pthread test function */
10612         pthread_t t;
10613         int status;
10614         int detach = 1;
10615
10616 #ifdef HAVE_PTHREADS_FINAL
10617         /* Final pthreads */
10618         pthread_attr_t attr;
10619
10620         status = pthread_attr_init(&attr);
10621         if( status ) return status;
10622
10623 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10624         if( !detach ) {
10625 #if defined( PTHREAD_CREATE_JOINABLE )
10626                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10627 #else
10628                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10629 #endif
10630
10631 #ifdef PTHREAD_CREATE_DETACHED
10632         } else {
10633                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10634 #endif
10635         }
10636         if( status ) return status;
10637 #endif
10638
10639         status = pthread_create( &t, &attr, task, NULL );
10640         if( status ) return status;
10641
10642 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10643         if( detach ) {
10644                 /* give thread a chance to complete */
10645                 /* it should remain joinable and hence detachable */
10646                 sleep( 1 );
10647
10648                 status = pthread_detach( t );
10649                 if( status ) return status;
10650         }
10651 #endif
10652
10653 #else
10654         /* Draft 4 pthreads */
10655         status = pthread_create( &t, pthread_attr_default, task, NULL );
10656         if( status ) return status;
10657
10658         if( detach ) {
10659                 /* give thread a chance to complete */
10660                 /* it should remain joinable and hence detachable */
10661                 sleep( 1 );
10662
10663                 status = pthread_detach( &t );
10664                 if( status ) return status;
10665         }
10666 #endif
10667
10668 #ifdef HAVE_LINUX_THREADS
10669         pthread_kill_other_threads_np();
10670 #endif
10671
10672         return 0;
10673
10674 }
10675
10676 EOF
10677 if { (eval echo configure:10678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10678 then
10679   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10680 else
10681   echo "configure: failed program was:" >&5
10682   cat conftest.$ac_ext >&5
10683   rm -fr conftest*
10684   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10685 fi
10686 rm -fr conftest*
10687 fi
10688
10689
10690                 # restore the LIBS
10691                 LIBS="$ol_LIBS"
10692         
10693 fi
10694
10695 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10696
10697         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10698                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10699                 ol_link_threads=posix
10700         fi
10701 fi
10702
10703                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10704 if test "$ol_link_threads" = no ; then
10705         # try -lpthreads -lmach -lexc
10706         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10707 echo "configure:10708: checking for pthread link with -lpthreads -lmach -lexc" >&5
10708 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10709   echo $ac_n "(cached) $ac_c" 1>&6
10710 else
10711   
10712                 # save the flags
10713                 ol_LIBS="$LIBS"
10714                 LIBS="-lpthreads -lmach -lexc $LIBS"
10715
10716                 if test "$cross_compiling" = yes; then
10717   cat > conftest.$ac_ext <<EOF
10718 #line 10719 "configure"
10719 #include "confdefs.h"
10720 /* pthread test headers */
10721 #include <pthread.h>
10722 #ifndef NULL
10723 #define NULL (void*)0
10724 #endif
10725
10726 static void *task(p)
10727         void *p;
10728 {
10729         return (void *) (p == NULL);
10730 }
10731
10732 int main() {
10733
10734         /* pthread test function */
10735         pthread_t t;
10736         int status;
10737         int detach = 1;
10738
10739 #ifdef HAVE_PTHREADS_FINAL
10740         /* Final pthreads */
10741         pthread_attr_t attr;
10742
10743         status = pthread_attr_init(&attr);
10744         if( status ) return status;
10745
10746 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10747         if( !detach ) {
10748 #if defined( PTHREAD_CREATE_JOINABLE )
10749                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10750 #else
10751                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10752 #endif
10753
10754 #ifdef PTHREAD_CREATE_DETACHED
10755         } else {
10756                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10757 #endif
10758         }
10759         if( status ) return status;
10760 #endif
10761
10762         status = pthread_create( &t, &attr, task, NULL );
10763         if( status ) return status;
10764
10765 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10766         if( detach ) {
10767                 /* give thread a chance to complete */
10768                 /* it should remain joinable and hence detachable */
10769                 sleep( 1 );
10770
10771                 status = pthread_detach( t );
10772                 if( status ) return status;
10773         }
10774 #endif
10775
10776 #else
10777         /* Draft 4 pthreads */
10778         status = pthread_create( &t, pthread_attr_default, task, NULL );
10779         if( status ) return status;
10780
10781         if( detach ) {
10782                 /* give thread a chance to complete */
10783                 /* it should remain joinable and hence detachable */
10784                 sleep( 1 );
10785
10786                 status = pthread_detach( &t );
10787                 if( status ) return status;
10788         }
10789 #endif
10790
10791 #ifdef HAVE_LINUX_THREADS
10792         pthread_kill_other_threads_np();
10793 #endif
10794
10795         return 0;
10796
10797 ; return 0; }
10798 EOF
10799 if { (eval echo configure:10800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10800   rm -rf conftest*
10801   ol_cv_pthread_lpthreads_lmach_lexc=yes
10802 else
10803   echo "configure: failed program was:" >&5
10804   cat conftest.$ac_ext >&5
10805   rm -rf conftest*
10806   ol_cv_pthread_lpthreads_lmach_lexc=no
10807 fi
10808 rm -f conftest*
10809 else
10810   cat > conftest.$ac_ext <<EOF
10811 #line 10812 "configure"
10812 #include "confdefs.h"
10813 /* pthread test headers */
10814 #include <pthread.h>
10815 #ifndef NULL
10816 #define NULL (void*)0
10817 #endif
10818
10819 static void *task(p)
10820         void *p;
10821 {
10822         return (void *) (p == NULL);
10823 }
10824
10825
10826 int main(argc, argv)
10827         int argc;
10828         char **argv;
10829 {
10830
10831         /* pthread test function */
10832         pthread_t t;
10833         int status;
10834         int detach = 1;
10835
10836 #ifdef HAVE_PTHREADS_FINAL
10837         /* Final pthreads */
10838         pthread_attr_t attr;
10839
10840         status = pthread_attr_init(&attr);
10841         if( status ) return status;
10842
10843 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10844         if( !detach ) {
10845 #if defined( PTHREAD_CREATE_JOINABLE )
10846                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10847 #else
10848                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10849 #endif
10850
10851 #ifdef PTHREAD_CREATE_DETACHED
10852         } else {
10853                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10854 #endif
10855         }
10856         if( status ) return status;
10857 #endif
10858
10859         status = pthread_create( &t, &attr, task, NULL );
10860         if( status ) return status;
10861
10862 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10863         if( detach ) {
10864                 /* give thread a chance to complete */
10865                 /* it should remain joinable and hence detachable */
10866                 sleep( 1 );
10867
10868                 status = pthread_detach( t );
10869                 if( status ) return status;
10870         }
10871 #endif
10872
10873 #else
10874         /* Draft 4 pthreads */
10875         status = pthread_create( &t, pthread_attr_default, task, NULL );
10876         if( status ) return status;
10877
10878         if( detach ) {
10879                 /* give thread a chance to complete */
10880                 /* it should remain joinable and hence detachable */
10881                 sleep( 1 );
10882
10883                 status = pthread_detach( &t );
10884                 if( status ) return status;
10885         }
10886 #endif
10887
10888 #ifdef HAVE_LINUX_THREADS
10889         pthread_kill_other_threads_np();
10890 #endif
10891
10892         return 0;
10893
10894 }
10895
10896 EOF
10897 if { (eval echo configure:10898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10898 then
10899   ol_cv_pthread_lpthreads_lmach_lexc=yes
10900 else
10901   echo "configure: failed program was:" >&5
10902   cat conftest.$ac_ext >&5
10903   rm -fr conftest*
10904   ol_cv_pthread_lpthreads_lmach_lexc=no
10905 fi
10906 rm -fr conftest*
10907 fi
10908
10909
10910                 # restore the LIBS
10911                 LIBS="$ol_LIBS"
10912         
10913 fi
10914
10915 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10916
10917         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10918                 ol_link_pthreads="-lpthreads -lmach -lexc"
10919                 ol_link_threads=posix
10920         fi
10921 fi
10922
10923                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10924 if test "$ol_link_threads" = no ; then
10925         # try -lpthreads -lexc
10926         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10927 echo "configure:10928: checking for pthread link with -lpthreads -lexc" >&5
10928 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10929   echo $ac_n "(cached) $ac_c" 1>&6
10930 else
10931   
10932                 # save the flags
10933                 ol_LIBS="$LIBS"
10934                 LIBS="-lpthreads -lexc $LIBS"
10935
10936                 if test "$cross_compiling" = yes; then
10937   cat > conftest.$ac_ext <<EOF
10938 #line 10939 "configure"
10939 #include "confdefs.h"
10940 /* pthread test headers */
10941 #include <pthread.h>
10942 #ifndef NULL
10943 #define NULL (void*)0
10944 #endif
10945
10946 static void *task(p)
10947         void *p;
10948 {
10949         return (void *) (p == NULL);
10950 }
10951
10952 int main() {
10953
10954         /* pthread test function */
10955         pthread_t t;
10956         int status;
10957         int detach = 1;
10958
10959 #ifdef HAVE_PTHREADS_FINAL
10960         /* Final pthreads */
10961         pthread_attr_t attr;
10962
10963         status = pthread_attr_init(&attr);
10964         if( status ) return status;
10965
10966 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10967         if( !detach ) {
10968 #if defined( PTHREAD_CREATE_JOINABLE )
10969                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10970 #else
10971                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10972 #endif
10973
10974 #ifdef PTHREAD_CREATE_DETACHED
10975         } else {
10976                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10977 #endif
10978         }
10979         if( status ) return status;
10980 #endif
10981
10982         status = pthread_create( &t, &attr, task, NULL );
10983         if( status ) return status;
10984
10985 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10986         if( detach ) {
10987                 /* give thread a chance to complete */
10988                 /* it should remain joinable and hence detachable */
10989                 sleep( 1 );
10990
10991                 status = pthread_detach( t );
10992                 if( status ) return status;
10993         }
10994 #endif
10995
10996 #else
10997         /* Draft 4 pthreads */
10998         status = pthread_create( &t, pthread_attr_default, task, NULL );
10999         if( status ) return status;
11000
11001         if( detach ) {
11002                 /* give thread a chance to complete */
11003                 /* it should remain joinable and hence detachable */
11004                 sleep( 1 );
11005
11006                 status = pthread_detach( &t );
11007                 if( status ) return status;
11008         }
11009 #endif
11010
11011 #ifdef HAVE_LINUX_THREADS
11012         pthread_kill_other_threads_np();
11013 #endif
11014
11015         return 0;
11016
11017 ; return 0; }
11018 EOF
11019 if { (eval echo configure:11020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11020   rm -rf conftest*
11021   ol_cv_pthread_lpthreads_lexc=yes
11022 else
11023   echo "configure: failed program was:" >&5
11024   cat conftest.$ac_ext >&5
11025   rm -rf conftest*
11026   ol_cv_pthread_lpthreads_lexc=no
11027 fi
11028 rm -f conftest*
11029 else
11030   cat > conftest.$ac_ext <<EOF
11031 #line 11032 "configure"
11032 #include "confdefs.h"
11033 /* pthread test headers */
11034 #include <pthread.h>
11035 #ifndef NULL
11036 #define NULL (void*)0
11037 #endif
11038
11039 static void *task(p)
11040         void *p;
11041 {
11042         return (void *) (p == NULL);
11043 }
11044
11045
11046 int main(argc, argv)
11047         int argc;
11048         char **argv;
11049 {
11050
11051         /* pthread test function */
11052         pthread_t t;
11053         int status;
11054         int detach = 1;
11055
11056 #ifdef HAVE_PTHREADS_FINAL
11057         /* Final pthreads */
11058         pthread_attr_t attr;
11059
11060         status = pthread_attr_init(&attr);
11061         if( status ) return status;
11062
11063 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11064         if( !detach ) {
11065 #if defined( PTHREAD_CREATE_JOINABLE )
11066                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11067 #else
11068                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11069 #endif
11070
11071 #ifdef PTHREAD_CREATE_DETACHED
11072         } else {
11073                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11074 #endif
11075         }
11076         if( status ) return status;
11077 #endif
11078
11079         status = pthread_create( &t, &attr, task, NULL );
11080         if( status ) return status;
11081
11082 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11083         if( detach ) {
11084                 /* give thread a chance to complete */
11085                 /* it should remain joinable and hence detachable */
11086                 sleep( 1 );
11087
11088                 status = pthread_detach( t );
11089                 if( status ) return status;
11090         }
11091 #endif
11092
11093 #else
11094         /* Draft 4 pthreads */
11095         status = pthread_create( &t, pthread_attr_default, task, NULL );
11096         if( status ) return status;
11097
11098         if( detach ) {
11099                 /* give thread a chance to complete */
11100                 /* it should remain joinable and hence detachable */
11101                 sleep( 1 );
11102
11103                 status = pthread_detach( &t );
11104                 if( status ) return status;
11105         }
11106 #endif
11107
11108 #ifdef HAVE_LINUX_THREADS
11109         pthread_kill_other_threads_np();
11110 #endif
11111
11112         return 0;
11113
11114 }
11115
11116 EOF
11117 if { (eval echo configure:11118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11118 then
11119   ol_cv_pthread_lpthreads_lexc=yes
11120 else
11121   echo "configure: failed program was:" >&5
11122   cat conftest.$ac_ext >&5
11123   rm -fr conftest*
11124   ol_cv_pthread_lpthreads_lexc=no
11125 fi
11126 rm -fr conftest*
11127 fi
11128
11129
11130                 # restore the LIBS
11131                 LIBS="$ol_LIBS"
11132         
11133 fi
11134
11135 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
11136
11137         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
11138                 ol_link_pthreads="-lpthreads -lexc"
11139                 ol_link_threads=posix
11140         fi
11141 fi
11142
11143
11144                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
11145 if test "$ol_link_threads" = no ; then
11146         # try -lpthreads
11147         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
11148 echo "configure:11149: checking for pthread link with -lpthreads" >&5
11149 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11150   echo $ac_n "(cached) $ac_c" 1>&6
11151 else
11152   
11153                 # save the flags
11154                 ol_LIBS="$LIBS"
11155                 LIBS="-lpthreads $LIBS"
11156
11157                 if test "$cross_compiling" = yes; then
11158   cat > conftest.$ac_ext <<EOF
11159 #line 11160 "configure"
11160 #include "confdefs.h"
11161 /* pthread test headers */
11162 #include <pthread.h>
11163 #ifndef NULL
11164 #define NULL (void*)0
11165 #endif
11166
11167 static void *task(p)
11168         void *p;
11169 {
11170         return (void *) (p == NULL);
11171 }
11172
11173 int main() {
11174
11175         /* pthread test function */
11176         pthread_t t;
11177         int status;
11178         int detach = 1;
11179
11180 #ifdef HAVE_PTHREADS_FINAL
11181         /* Final pthreads */
11182         pthread_attr_t attr;
11183
11184         status = pthread_attr_init(&attr);
11185         if( status ) return status;
11186
11187 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11188         if( !detach ) {
11189 #if defined( PTHREAD_CREATE_JOINABLE )
11190                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11191 #else
11192                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11193 #endif
11194
11195 #ifdef PTHREAD_CREATE_DETACHED
11196         } else {
11197                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11198 #endif
11199         }
11200         if( status ) return status;
11201 #endif
11202
11203         status = pthread_create( &t, &attr, task, NULL );
11204         if( status ) return status;
11205
11206 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11207         if( detach ) {
11208                 /* give thread a chance to complete */
11209                 /* it should remain joinable and hence detachable */
11210                 sleep( 1 );
11211
11212                 status = pthread_detach( t );
11213                 if( status ) return status;
11214         }
11215 #endif
11216
11217 #else
11218         /* Draft 4 pthreads */
11219         status = pthread_create( &t, pthread_attr_default, task, NULL );
11220         if( status ) return status;
11221
11222         if( detach ) {
11223                 /* give thread a chance to complete */
11224                 /* it should remain joinable and hence detachable */
11225                 sleep( 1 );
11226
11227                 status = pthread_detach( &t );
11228                 if( status ) return status;
11229         }
11230 #endif
11231
11232 #ifdef HAVE_LINUX_THREADS
11233         pthread_kill_other_threads_np();
11234 #endif
11235
11236         return 0;
11237
11238 ; return 0; }
11239 EOF
11240 if { (eval echo configure:11241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11241   rm -rf conftest*
11242   ol_cv_pthread_lib_lpthreads=yes
11243 else
11244   echo "configure: failed program was:" >&5
11245   cat conftest.$ac_ext >&5
11246   rm -rf conftest*
11247   ol_cv_pthread_lib_lpthreads=no
11248 fi
11249 rm -f conftest*
11250 else
11251   cat > conftest.$ac_ext <<EOF
11252 #line 11253 "configure"
11253 #include "confdefs.h"
11254 /* pthread test headers */
11255 #include <pthread.h>
11256 #ifndef NULL
11257 #define NULL (void*)0
11258 #endif
11259
11260 static void *task(p)
11261         void *p;
11262 {
11263         return (void *) (p == NULL);
11264 }
11265
11266
11267 int main(argc, argv)
11268         int argc;
11269         char **argv;
11270 {
11271
11272         /* pthread test function */
11273         pthread_t t;
11274         int status;
11275         int detach = 1;
11276
11277 #ifdef HAVE_PTHREADS_FINAL
11278         /* Final pthreads */
11279         pthread_attr_t attr;
11280
11281         status = pthread_attr_init(&attr);
11282         if( status ) return status;
11283
11284 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11285         if( !detach ) {
11286 #if defined( PTHREAD_CREATE_JOINABLE )
11287                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11288 #else
11289                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11290 #endif
11291
11292 #ifdef PTHREAD_CREATE_DETACHED
11293         } else {
11294                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11295 #endif
11296         }
11297         if( status ) return status;
11298 #endif
11299
11300         status = pthread_create( &t, &attr, task, NULL );
11301         if( status ) return status;
11302
11303 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11304         if( detach ) {
11305                 /* give thread a chance to complete */
11306                 /* it should remain joinable and hence detachable */
11307                 sleep( 1 );
11308
11309                 status = pthread_detach( t );
11310                 if( status ) return status;
11311         }
11312 #endif
11313
11314 #else
11315         /* Draft 4 pthreads */
11316         status = pthread_create( &t, pthread_attr_default, task, NULL );
11317         if( status ) return status;
11318
11319         if( detach ) {
11320                 /* give thread a chance to complete */
11321                 /* it should remain joinable and hence detachable */
11322                 sleep( 1 );
11323
11324                 status = pthread_detach( &t );
11325                 if( status ) return status;
11326         }
11327 #endif
11328
11329 #ifdef HAVE_LINUX_THREADS
11330         pthread_kill_other_threads_np();
11331 #endif
11332
11333         return 0;
11334
11335 }
11336
11337 EOF
11338 if { (eval echo configure:11339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11339 then
11340   ol_cv_pthread_lib_lpthreads=yes
11341 else
11342   echo "configure: failed program was:" >&5
11343   cat conftest.$ac_ext >&5
11344   rm -fr conftest*
11345   ol_cv_pthread_lib_lpthreads=no
11346 fi
11347 rm -fr conftest*
11348 fi
11349
11350
11351                 # restore the LIBS
11352                 LIBS="$ol_LIBS"
11353         
11354 fi
11355
11356 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11357
11358         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11359                 ol_link_pthreads="-lpthreads"
11360                 ol_link_threads=posix
11361         fi
11362 fi
11363
11364
11365                 if test $ol_link_threads != no ; then
11366                         cat >> confdefs.h <<\EOF
11367 #define HAVE_PTHREADS 1
11368 EOF
11369
11370
11371                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11372
11373                                                 save_CPPFLAGS="$CPPFLAGS"
11374                         save_LIBS="$LIBS"
11375                         LIBS="$LTHREAD_LIBS $LIBS"
11376
11377                                                                                                 for ac_func in sched_yield pthread_yield
11378 do
11379 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11380 echo "configure:11381: checking for $ac_func" >&5
11381 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11382   echo $ac_n "(cached) $ac_c" 1>&6
11383 else
11384   cat > conftest.$ac_ext <<EOF
11385 #line 11386 "configure"
11386 #include "confdefs.h"
11387 /* System header to define __stub macros and hopefully few prototypes,
11388     which can conflict with char $ac_func(); below.  */
11389 #include <assert.h>
11390 /* Override any gcc2 internal prototype to avoid an error.  */
11391 /* We use char because int might match the return type of a gcc2
11392     builtin and then its argument prototype would still apply.  */
11393 char $ac_func();
11394 char (*f)();
11395
11396 int main() {
11397
11398 /* The GNU C library defines this for functions which it implements
11399     to always fail with ENOSYS.  Some functions are actually named
11400     something starting with __ and the normal name is an alias.  */
11401 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11402 choke me
11403 #else
11404 f = $ac_func;
11405 #endif
11406
11407 ; return 0; }
11408 EOF
11409 if { (eval echo configure:11410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11410   rm -rf conftest*
11411   eval "ac_cv_func_$ac_func=yes"
11412 else
11413   echo "configure: failed program was:" >&5
11414   cat conftest.$ac_ext >&5
11415   rm -rf conftest*
11416   eval "ac_cv_func_$ac_func=no"
11417 fi
11418 rm -f conftest*
11419 fi
11420
11421 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11422   echo "$ac_t""yes" 1>&6
11423     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11424   cat >> confdefs.h <<EOF
11425 #define $ac_tr_func 1
11426 EOF
11427  
11428 else
11429   echo "$ac_t""no" 1>&6
11430 fi
11431 done
11432
11433
11434                         if test $ac_cv_func_sched_yield = no -a \
11435                                 $ac_cv_func_pthread_yield = no ; then
11436                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11437 echo "configure:11438: checking for sched_yield in -lrt" >&5
11438 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11439 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11440   echo $ac_n "(cached) $ac_c" 1>&6
11441 else
11442   ac_save_LIBS="$LIBS"
11443 LIBS="-lrt  $LIBS"
11444 cat > conftest.$ac_ext <<EOF
11445 #line 11446 "configure"
11446 #include "confdefs.h"
11447 /* Override any gcc2 internal prototype to avoid an error.  */
11448 /* We use char because int might match the return type of a gcc2
11449     builtin and then its argument prototype would still apply.  */
11450 char sched_yield();
11451
11452 int main() {
11453 sched_yield()
11454 ; return 0; }
11455 EOF
11456 if { (eval echo configure:11457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11457   rm -rf conftest*
11458   eval "ac_cv_lib_$ac_lib_var=yes"
11459 else
11460   echo "configure: failed program was:" >&5
11461   cat conftest.$ac_ext >&5
11462   rm -rf conftest*
11463   eval "ac_cv_lib_$ac_lib_var=no"
11464 fi
11465 rm -f conftest*
11466 LIBS="$ac_save_LIBS"
11467
11468 fi
11469 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11470   echo "$ac_t""yes" 1>&6
11471   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11472                                         cat >> confdefs.h <<\EOF
11473 #define HAVE_SCHED_YIELD 1
11474 EOF
11475
11476                                         ac_cv_func_sched_yield=yes
11477 else
11478   echo "$ac_t""no" 1>&6
11479 ac_cv_func_sched_yield=no
11480 fi
11481
11482                         fi
11483                         if test $ac_cv_func_sched_yield = no -a \
11484                                 $ac_cv_func_pthread_yield = no ; then
11485                                                                                                 for ac_func in thr_yield
11486 do
11487 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11488 echo "configure:11489: checking for $ac_func" >&5
11489 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11490   echo $ac_n "(cached) $ac_c" 1>&6
11491 else
11492   cat > conftest.$ac_ext <<EOF
11493 #line 11494 "configure"
11494 #include "confdefs.h"
11495 /* System header to define __stub macros and hopefully few prototypes,
11496     which can conflict with char $ac_func(); below.  */
11497 #include <assert.h>
11498 /* Override any gcc2 internal prototype to avoid an error.  */
11499 /* We use char because int might match the return type of a gcc2
11500     builtin and then its argument prototype would still apply.  */
11501 char $ac_func();
11502 char (*f)();
11503
11504 int main() {
11505
11506 /* The GNU C library defines this for functions which it implements
11507     to always fail with ENOSYS.  Some functions are actually named
11508     something starting with __ and the normal name is an alias.  */
11509 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11510 choke me
11511 #else
11512 f = $ac_func;
11513 #endif
11514
11515 ; return 0; }
11516 EOF
11517 if { (eval echo configure:11518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11518   rm -rf conftest*
11519   eval "ac_cv_func_$ac_func=yes"
11520 else
11521   echo "configure: failed program was:" >&5
11522   cat conftest.$ac_ext >&5
11523   rm -rf conftest*
11524   eval "ac_cv_func_$ac_func=no"
11525 fi
11526 rm -f conftest*
11527 fi
11528
11529 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11530   echo "$ac_t""yes" 1>&6
11531     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11532   cat >> confdefs.h <<EOF
11533 #define $ac_tr_func 1
11534 EOF
11535  
11536 else
11537   echo "$ac_t""no" 1>&6
11538 fi
11539 done
11540
11541                         fi
11542                         if test $ac_cv_func_sched_yield = no -a \
11543                                 $ac_cv_func_pthread_yield = no -a \
11544                                 "$ac_cv_func_thr_yield" = no ; then
11545                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11546                         fi
11547
11548                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11549 do
11550 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11551 echo "configure:11552: checking for $ac_func" >&5
11552 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11553   echo $ac_n "(cached) $ac_c" 1>&6
11554 else
11555   cat > conftest.$ac_ext <<EOF
11556 #line 11557 "configure"
11557 #include "confdefs.h"
11558 /* System header to define __stub macros and hopefully few prototypes,
11559     which can conflict with char $ac_func(); below.  */
11560 #include <assert.h>
11561 /* Override any gcc2 internal prototype to avoid an error.  */
11562 /* We use char because int might match the return type of a gcc2
11563     builtin and then its argument prototype would still apply.  */
11564 char $ac_func();
11565 char (*f)();
11566
11567 int main() {
11568
11569 /* The GNU C library defines this for functions which it implements
11570     to always fail with ENOSYS.  Some functions are actually named
11571     something starting with __ and the normal name is an alias.  */
11572 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11573 choke me
11574 #else
11575 f = $ac_func;
11576 #endif
11577
11578 ; return 0; }
11579 EOF
11580 if { (eval echo configure:11581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11581   rm -rf conftest*
11582   eval "ac_cv_func_$ac_func=yes"
11583 else
11584   echo "configure: failed program was:" >&5
11585   cat conftest.$ac_ext >&5
11586   rm -rf conftest*
11587   eval "ac_cv_func_$ac_func=no"
11588 fi
11589 rm -f conftest*
11590 fi
11591
11592 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11593   echo "$ac_t""yes" 1>&6
11594     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11595   cat >> confdefs.h <<EOF
11596 #define $ac_tr_func 1
11597 EOF
11598  
11599 else
11600   echo "$ac_t""no" 1>&6
11601 fi
11602 done
11603
11604
11605                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11606 echo "configure:11607: checking for pthread_detach with <pthread.h>" >&5
11607 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11608   echo $ac_n "(cached) $ac_c" 1>&6
11609 else
11610   
11611                                                                 cat > conftest.$ac_ext <<EOF
11612 #line 11613 "configure"
11613 #include "confdefs.h"
11614
11615 #include <pthread.h>
11616 #ifndef NULL
11617 #define NULL (void*)0
11618 #endif
11619
11620 int main() {
11621 pthread_detach(NULL);
11622 ; return 0; }
11623 EOF
11624 if { (eval echo configure:11625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11625   rm -rf conftest*
11626   ol_cv_func_pthread_detach=yes
11627 else
11628   echo "configure: failed program was:" >&5
11629   cat conftest.$ac_ext >&5
11630   rm -rf conftest*
11631   ol_cv_func_pthread_detach=no
11632 fi
11633 rm -f conftest*
11634                         
11635 fi
11636
11637 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11638
11639                         if test $ol_cv_func_pthread_detach = no ; then
11640                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11641                         fi
11642
11643                         cat >> confdefs.h <<\EOF
11644 #define HAVE_PTHREAD_DETACH 1
11645 EOF
11646
11647
11648                                                 for ac_func in \
11649                                 pthread_setconcurrency \
11650                                 pthread_getconcurrency \
11651                                 thr_setconcurrency \
11652                                 thr_getconcurrency \
11653                         
11654 do
11655 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11656 echo "configure:11657: checking for $ac_func" >&5
11657 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11658   echo $ac_n "(cached) $ac_c" 1>&6
11659 else
11660   cat > conftest.$ac_ext <<EOF
11661 #line 11662 "configure"
11662 #include "confdefs.h"
11663 /* System header to define __stub macros and hopefully few prototypes,
11664     which can conflict with char $ac_func(); below.  */
11665 #include <assert.h>
11666 /* Override any gcc2 internal prototype to avoid an error.  */
11667 /* We use char because int might match the return type of a gcc2
11668     builtin and then its argument prototype would still apply.  */
11669 char $ac_func();
11670 char (*f)();
11671
11672 int main() {
11673
11674 /* The GNU C library defines this for functions which it implements
11675     to always fail with ENOSYS.  Some functions are actually named
11676     something starting with __ and the normal name is an alias.  */
11677 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11678 choke me
11679 #else
11680 f = $ac_func;
11681 #endif
11682
11683 ; return 0; }
11684 EOF
11685 if { (eval echo configure:11686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11686   rm -rf conftest*
11687   eval "ac_cv_func_$ac_func=yes"
11688 else
11689   echo "configure: failed program was:" >&5
11690   cat conftest.$ac_ext >&5
11691   rm -rf conftest*
11692   eval "ac_cv_func_$ac_func=no"
11693 fi
11694 rm -f conftest*
11695 fi
11696
11697 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11698   echo "$ac_t""yes" 1>&6
11699     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11700   cat >> confdefs.h <<EOF
11701 #define $ac_tr_func 1
11702 EOF
11703  
11704 else
11705   echo "$ac_t""no" 1>&6
11706 fi
11707 done
11708
11709
11710                         
11711         for ac_func in pthread_kill_other_threads_np
11712 do
11713 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11714 echo "configure:11715: checking for $ac_func" >&5
11715 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11716   echo $ac_n "(cached) $ac_c" 1>&6
11717 else
11718   cat > conftest.$ac_ext <<EOF
11719 #line 11720 "configure"
11720 #include "confdefs.h"
11721 /* System header to define __stub macros and hopefully few prototypes,
11722     which can conflict with char $ac_func(); below.  */
11723 #include <assert.h>
11724 /* Override any gcc2 internal prototype to avoid an error.  */
11725 /* We use char because int might match the return type of a gcc2
11726     builtin and then its argument prototype would still apply.  */
11727 char $ac_func();
11728 char (*f)();
11729
11730 int main() {
11731
11732 /* The GNU C library defines this for functions which it implements
11733     to always fail with ENOSYS.  Some functions are actually named
11734     something starting with __ and the normal name is an alias.  */
11735 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11736 choke me
11737 #else
11738 f = $ac_func;
11739 #endif
11740
11741 ; return 0; }
11742 EOF
11743 if { (eval echo configure:11744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11744   rm -rf conftest*
11745   eval "ac_cv_func_$ac_func=yes"
11746 else
11747   echo "configure: failed program was:" >&5
11748   cat conftest.$ac_ext >&5
11749   rm -rf conftest*
11750   eval "ac_cv_func_$ac_func=no"
11751 fi
11752 rm -f conftest*
11753 fi
11754
11755 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11756   echo "$ac_t""yes" 1>&6
11757     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11758   cat >> confdefs.h <<EOF
11759 #define $ac_tr_func 1
11760 EOF
11761  
11762 else
11763   echo "$ac_t""no" 1>&6
11764 fi
11765 done
11766
11767         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11768 echo "configure:11769: checking for LinuxThreads implementation" >&5
11769 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11770   echo $ac_n "(cached) $ac_c" 1>&6
11771 else
11772   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11773 fi
11774
11775 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11776
11777                         
11778         
11779         
11780         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11781 echo "configure:11782: checking for LinuxThreads consistency" >&5
11782 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11783   echo $ac_n "(cached) $ac_c" 1>&6
11784 else
11785   
11786                 if test $ol_cv_header_linux_threads = yes -a \
11787                         $ol_cv_sys_linux_threads = yes; then
11788                         ol_cv_linux_threads=yes
11789                 elif test $ol_cv_header_linux_threads = no -a \
11790                         $ol_cv_sys_linux_threads = no; then
11791                         ol_cv_linux_threads=no
11792                 else
11793                         ol_cv_linux_threads=error
11794                 fi
11795         
11796 fi
11797
11798 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11799
11800
11801                         if test $ol_cv_linux_threads = error; then
11802                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11803                         fi
11804
11805                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11806 echo "configure:11807: checking if pthread_create() works" >&5
11807 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11808   echo $ac_n "(cached) $ac_c" 1>&6
11809 else
11810   
11811                         if test "$cross_compiling" = yes; then
11812                                 ol_cv_pthread_create_works=yes
11813 else
11814   cat > conftest.$ac_ext <<EOF
11815 #line 11816 "configure"
11816 #include "confdefs.h"
11817 /* pthread test headers */
11818 #include <pthread.h>
11819 #ifndef NULL
11820 #define NULL (void*)0
11821 #endif
11822
11823 static void *task(p)
11824         void *p;
11825 {
11826         return (void *) (p == NULL);
11827 }
11828
11829
11830 int main(argc, argv)
11831         int argc;
11832         char **argv;
11833 {
11834
11835         /* pthread test function */
11836         pthread_t t;
11837         int status;
11838         int detach = 1;
11839
11840 #ifdef HAVE_PTHREADS_FINAL
11841         /* Final pthreads */
11842         pthread_attr_t attr;
11843
11844         status = pthread_attr_init(&attr);
11845         if( status ) return status;
11846
11847 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11848         if( !detach ) {
11849 #if defined( PTHREAD_CREATE_JOINABLE )
11850                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11851 #else
11852                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11853 #endif
11854
11855 #ifdef PTHREAD_CREATE_DETACHED
11856         } else {
11857                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11858 #endif
11859         }
11860         if( status ) return status;
11861 #endif
11862
11863         status = pthread_create( &t, &attr, task, NULL );
11864         if( status ) return status;
11865
11866 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11867         if( detach ) {
11868                 /* give thread a chance to complete */
11869                 /* it should remain joinable and hence detachable */
11870                 sleep( 1 );
11871
11872                 status = pthread_detach( t );
11873                 if( status ) return status;
11874         }
11875 #endif
11876
11877 #else
11878         /* Draft 4 pthreads */
11879         status = pthread_create( &t, pthread_attr_default, task, NULL );
11880         if( status ) return status;
11881
11882         if( detach ) {
11883                 /* give thread a chance to complete */
11884                 /* it should remain joinable and hence detachable */
11885                 sleep( 1 );
11886
11887                 status = pthread_detach( &t );
11888                 if( status ) return status;
11889         }
11890 #endif
11891
11892 #ifdef HAVE_LINUX_THREADS
11893         pthread_kill_other_threads_np();
11894 #endif
11895
11896         return 0;
11897
11898 }
11899
11900 EOF
11901 if { (eval echo configure:11902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11902 then
11903   ol_cv_pthread_create_works=yes
11904 else
11905   echo "configure: failed program was:" >&5
11906   cat conftest.$ac_ext >&5
11907   rm -fr conftest*
11908   ol_cv_pthread_create_works=no
11909 fi
11910 rm -fr conftest*
11911 fi
11912
11913 fi
11914
11915 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11916
11917                         if test $ol_cv_pthread_create_works = no ; then
11918                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11919                         fi
11920
11921                                                 if test $ol_with_yielding_select = auto ; then
11922                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11923 echo "configure:11924: checking if select yields when using pthreads" >&5
11924 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11925   echo $ac_n "(cached) $ac_c" 1>&6
11926 else
11927   
11928                                 if test "$cross_compiling" = yes; then
11929   ol_cv_pthread_select_yields=cross
11930 else
11931   cat > conftest.$ac_ext <<EOF
11932 #line 11933 "configure"
11933 #include "confdefs.h"
11934
11935 #include <sys/types.h>
11936 #include <sys/time.h>
11937 #include <unistd.h>
11938 #include <pthread.h>
11939 #ifndef NULL
11940 #define NULL (void*) 0
11941 #endif
11942
11943 static int fildes[2];
11944
11945 static void *task(p)
11946         void *p;
11947 {
11948         int i;
11949         struct timeval tv;
11950
11951         fd_set rfds;
11952
11953         tv.tv_sec=10;
11954         tv.tv_usec=0;
11955
11956         FD_ZERO(&rfds);
11957         FD_SET(fildes[0], &rfds);
11958
11959         /* we're not interested in any fds */
11960         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11961
11962         if(i < 0) {
11963                 perror("select");
11964                 exit(10);
11965         }
11966
11967         exit(0); /* if we exit here, the select blocked the whole process */
11968 }
11969
11970 int main(argc, argv)
11971         int argc;
11972         char **argv;
11973 {
11974         pthread_t t;
11975
11976         /* create a pipe to select */
11977         if(pipe(&fildes[0])) {
11978                 perror("select");
11979                 exit(1);
11980         }
11981
11982 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11983         (void) pthread_setconcurrency(2);
11984 #else
11985 #ifdef HAVE_THR_SETCONCURRENCY
11986         /* Set Solaris LWP concurrency to 2 */
11987         thr_setconcurrency(2);
11988 #endif
11989 #endif
11990
11991 #if HAVE_PTHREADS_D4
11992         pthread_create(&t, pthread_attr_default, task, NULL);
11993 #else
11994         pthread_create(&t, NULL, task, NULL);
11995 #endif
11996
11997 #if HAVE_SCHED_YIELD
11998         sched_yield();  /* make sure task runs first */
11999 #else
12000 #ifdef HAVE_PTHREAD_YIELD
12001         pthread_yield();        /* make sure task runs first */
12002 #endif
12003 #endif
12004
12005         exit(2);
12006 }
12007 EOF
12008 if { (eval echo configure:12009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12009 then
12010   ol_cv_pthread_select_yields=no
12011 else
12012   echo "configure: failed program was:" >&5
12013   cat conftest.$ac_ext >&5
12014   rm -fr conftest*
12015   ol_cv_pthread_select_yields=yes
12016 fi
12017 rm -fr conftest*
12018 fi
12019
12020 fi
12021
12022 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
12023
12024                                 if test $ol_cv_pthread_select_yields = cross ; then
12025                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
12026                                 fi
12027
12028                                 if test $ol_cv_pthread_select_yields = yes ; then
12029                                         ol_with_yielding_select=yes
12030                                 fi
12031                         fi
12032
12033                                                 CPPFLAGS="$save_CPPFLAGS"
12034                         LIBS="$save_LIBS"
12035                 else
12036                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
12037                 fi
12038         fi
12039
12040         if test $ol_with_threads = posix ; then
12041                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
12042         fi
12043 fi
12044
12045 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12046         -o $ol_with_threads = mach ; then
12047
12048                 for ac_hdr in mach/cthreads.h cthread.h
12049 do
12050 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12051 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12052 echo "configure:12053: checking for $ac_hdr" >&5
12053 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12054   echo $ac_n "(cached) $ac_c" 1>&6
12055 else
12056   cat > conftest.$ac_ext <<EOF
12057 #line 12058 "configure"
12058 #include "confdefs.h"
12059 #include <$ac_hdr>
12060 EOF
12061 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12062 { (eval echo configure:12063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12063 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12064 if test -z "$ac_err"; then
12065   rm -rf conftest*
12066   eval "ac_cv_header_$ac_safe=yes"
12067 else
12068   echo "$ac_err" >&5
12069   echo "configure: failed program was:" >&5
12070   cat conftest.$ac_ext >&5
12071   rm -rf conftest*
12072   eval "ac_cv_header_$ac_safe=no"
12073 fi
12074 rm -f conftest*
12075 fi
12076 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12077   echo "$ac_t""yes" 1>&6
12078     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12079   cat >> confdefs.h <<EOF
12080 #define $ac_tr_hdr 1
12081 EOF
12082  
12083 else
12084   echo "$ac_t""no" 1>&6
12085 fi
12086 done
12087
12088         if test $ac_cv_header_mach_cthreads_h = yes ; then
12089                 ol_with_threads=found
12090
12091                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12092 echo "configure:12093: checking for cthread_fork" >&5
12093 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12094   echo $ac_n "(cached) $ac_c" 1>&6
12095 else
12096   cat > conftest.$ac_ext <<EOF
12097 #line 12098 "configure"
12098 #include "confdefs.h"
12099 /* System header to define __stub macros and hopefully few prototypes,
12100     which can conflict with char cthread_fork(); below.  */
12101 #include <assert.h>
12102 /* Override any gcc2 internal prototype to avoid an error.  */
12103 /* We use char because int might match the return type of a gcc2
12104     builtin and then its argument prototype would still apply.  */
12105 char cthread_fork();
12106 char (*f)();
12107
12108 int main() {
12109
12110 /* The GNU C library defines this for functions which it implements
12111     to always fail with ENOSYS.  Some functions are actually named
12112     something starting with __ and the normal name is an alias.  */
12113 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12114 choke me
12115 #else
12116 f = cthread_fork;
12117 #endif
12118
12119 ; return 0; }
12120 EOF
12121 if { (eval echo configure:12122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12122   rm -rf conftest*
12123   eval "ac_cv_func_cthread_fork=yes"
12124 else
12125   echo "configure: failed program was:" >&5
12126   cat conftest.$ac_ext >&5
12127   rm -rf conftest*
12128   eval "ac_cv_func_cthread_fork=no"
12129 fi
12130 rm -f conftest*
12131 fi
12132
12133 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12134   echo "$ac_t""yes" 1>&6
12135   ol_link_threads=yes
12136 else
12137   echo "$ac_t""no" 1>&6
12138 fi
12139
12140
12141                 if test $ol_link_threads = no ; then
12142                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
12143 echo "configure:12144: checking for cthread_fork with -all_load" >&5
12144 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
12145   echo $ac_n "(cached) $ac_c" 1>&6
12146 else
12147   
12148                                                                 save_LIBS="$LIBS"
12149                                 LIBS="-all_load $LIBS"
12150                                 cat > conftest.$ac_ext <<EOF
12151 #line 12152 "configure"
12152 #include "confdefs.h"
12153 #include <mach/cthreads.h>
12154 int main() {
12155
12156                                         cthread_fork((void *)0, (void *)0);
12157                                         
12158 ; return 0; }
12159 EOF
12160 if { (eval echo configure:12161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12161   rm -rf conftest*
12162   ol_cv_cthread_all_load=yes
12163 else
12164   echo "configure: failed program was:" >&5
12165   cat conftest.$ac_ext >&5
12166   rm -rf conftest*
12167   ol_cv_cthread_all_load=no
12168 fi
12169 rm -f conftest*
12170                                                                 LIBS="$save_LIBS"
12171                         
12172 fi
12173
12174 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12175
12176                         if test $ol_cv_cthread_all_load = yes ; then
12177                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12178                                 ol_link_threads=mach
12179                         fi
12180                 fi
12181
12182         elif test $ac_cv_header_cthreads_h = yes ; then
12183                                 
12184                 ol_with_threads=found
12185  
12186                                 save_LIBS="$LIBS"
12187                 LIBS="$LIBS -lthreads"
12188                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12189 echo "configure:12190: checking for cthread_fork" >&5
12190 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12191   echo $ac_n "(cached) $ac_c" 1>&6
12192 else
12193   cat > conftest.$ac_ext <<EOF
12194 #line 12195 "configure"
12195 #include "confdefs.h"
12196 /* System header to define __stub macros and hopefully few prototypes,
12197     which can conflict with char cthread_fork(); below.  */
12198 #include <assert.h>
12199 /* Override any gcc2 internal prototype to avoid an error.  */
12200 /* We use char because int might match the return type of a gcc2
12201     builtin and then its argument prototype would still apply.  */
12202 char cthread_fork();
12203 char (*f)();
12204
12205 int main() {
12206
12207 /* The GNU C library defines this for functions which it implements
12208     to always fail with ENOSYS.  Some functions are actually named
12209     something starting with __ and the normal name is an alias.  */
12210 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12211 choke me
12212 #else
12213 f = cthread_fork;
12214 #endif
12215
12216 ; return 0; }
12217 EOF
12218 if { (eval echo configure:12219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12219   rm -rf conftest*
12220   eval "ac_cv_func_cthread_fork=yes"
12221 else
12222   echo "configure: failed program was:" >&5
12223   cat conftest.$ac_ext >&5
12224   rm -rf conftest*
12225   eval "ac_cv_func_cthread_fork=no"
12226 fi
12227 rm -f conftest*
12228 fi
12229
12230 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12231   echo "$ac_t""yes" 1>&6
12232   ol_link_threads=yes
12233 else
12234   echo "$ac_t""no" 1>&6
12235 fi
12236
12237                 LIBS="$save_LIBS"
12238
12239                 if test $ol_link_threads = yes ; then
12240                         LTHREAD_LIBS="-lthreads"
12241                         ol_link_threads=mach
12242                 else
12243                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12244                 fi
12245
12246         elif test $ol_with_threads = mach ; then
12247                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12248         fi
12249
12250         if test $ol_link_threads = mach ; then
12251                 cat >> confdefs.h <<\EOF
12252 #define HAVE_MACH_CTHREADS 1
12253 EOF
12254
12255         elif test $ol_with_threads = found ; then
12256                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12257         fi
12258 fi
12259
12260 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12261         -o $ol_with_threads = pth ; then
12262
12263         for ac_hdr in pth.h
12264 do
12265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12267 echo "configure:12268: checking for $ac_hdr" >&5
12268 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12269   echo $ac_n "(cached) $ac_c" 1>&6
12270 else
12271   cat > conftest.$ac_ext <<EOF
12272 #line 12273 "configure"
12273 #include "confdefs.h"
12274 #include <$ac_hdr>
12275 EOF
12276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12277 { (eval echo configure:12278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12278 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12279 if test -z "$ac_err"; then
12280   rm -rf conftest*
12281   eval "ac_cv_header_$ac_safe=yes"
12282 else
12283   echo "$ac_err" >&5
12284   echo "configure: failed program was:" >&5
12285   cat conftest.$ac_ext >&5
12286   rm -rf conftest*
12287   eval "ac_cv_header_$ac_safe=no"
12288 fi
12289 rm -f conftest*
12290 fi
12291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12292   echo "$ac_t""yes" 1>&6
12293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12294   cat >> confdefs.h <<EOF
12295 #define $ac_tr_hdr 1
12296 EOF
12297  
12298 else
12299   echo "$ac_t""no" 1>&6
12300 fi
12301 done
12302
12303
12304         if test $ac_cv_header_pth_h = yes ; then
12305                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12306 echo "configure:12307: checking for pth_version in -lpth" >&5
12307 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12308 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12309   echo $ac_n "(cached) $ac_c" 1>&6
12310 else
12311   ac_save_LIBS="$LIBS"
12312 LIBS="-lpth  $LIBS"
12313 cat > conftest.$ac_ext <<EOF
12314 #line 12315 "configure"
12315 #include "confdefs.h"
12316 /* Override any gcc2 internal prototype to avoid an error.  */
12317 /* We use char because int might match the return type of a gcc2
12318     builtin and then its argument prototype would still apply.  */
12319 char pth_version();
12320
12321 int main() {
12322 pth_version()
12323 ; return 0; }
12324 EOF
12325 if { (eval echo configure:12326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12326   rm -rf conftest*
12327   eval "ac_cv_lib_$ac_lib_var=yes"
12328 else
12329   echo "configure: failed program was:" >&5
12330   cat conftest.$ac_ext >&5
12331   rm -rf conftest*
12332   eval "ac_cv_lib_$ac_lib_var=no"
12333 fi
12334 rm -f conftest*
12335 LIBS="$ac_save_LIBS"
12336
12337 fi
12338 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12339   echo "$ac_t""yes" 1>&6
12340   have_pth=yes
12341 else
12342   echo "$ac_t""no" 1>&6
12343 have_pth=no
12344 fi
12345
12346
12347                 if test $have_pth = yes ; then
12348                         cat >> confdefs.h <<\EOF
12349 #define HAVE_GNU_PTH 1
12350 EOF
12351
12352                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12353                         ol_link_threads=pth
12354
12355                         if test $ol_with_yielding_select = auto ; then
12356                                 ol_with_yielding_select=yes
12357                         fi
12358                 fi
12359         fi
12360 fi
12361
12362 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12363         -o $ol_with_threads = lwp ; then
12364
12365                 for ac_hdr in thread.h synch.h
12366 do
12367 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12368 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12369 echo "configure:12370: checking for $ac_hdr" >&5
12370 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12371   echo $ac_n "(cached) $ac_c" 1>&6
12372 else
12373   cat > conftest.$ac_ext <<EOF
12374 #line 12375 "configure"
12375 #include "confdefs.h"
12376 #include <$ac_hdr>
12377 EOF
12378 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12379 { (eval echo configure:12380: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12380 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12381 if test -z "$ac_err"; then
12382   rm -rf conftest*
12383   eval "ac_cv_header_$ac_safe=yes"
12384 else
12385   echo "$ac_err" >&5
12386   echo "configure: failed program was:" >&5
12387   cat conftest.$ac_ext >&5
12388   rm -rf conftest*
12389   eval "ac_cv_header_$ac_safe=no"
12390 fi
12391 rm -f conftest*
12392 fi
12393 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12394   echo "$ac_t""yes" 1>&6
12395     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12396   cat >> confdefs.h <<EOF
12397 #define $ac_tr_hdr 1
12398 EOF
12399  
12400 else
12401   echo "$ac_t""no" 1>&6
12402 fi
12403 done
12404
12405         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12406                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12407 echo "configure:12408: checking for thr_create in -lthread" >&5
12408 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12409 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12410   echo $ac_n "(cached) $ac_c" 1>&6
12411 else
12412   ac_save_LIBS="$LIBS"
12413 LIBS="-lthread  $LIBS"
12414 cat > conftest.$ac_ext <<EOF
12415 #line 12416 "configure"
12416 #include "confdefs.h"
12417 /* Override any gcc2 internal prototype to avoid an error.  */
12418 /* We use char because int might match the return type of a gcc2
12419     builtin and then its argument prototype would still apply.  */
12420 char thr_create();
12421
12422 int main() {
12423 thr_create()
12424 ; return 0; }
12425 EOF
12426 if { (eval echo configure:12427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12427   rm -rf conftest*
12428   eval "ac_cv_lib_$ac_lib_var=yes"
12429 else
12430   echo "configure: failed program was:" >&5
12431   cat conftest.$ac_ext >&5
12432   rm -rf conftest*
12433   eval "ac_cv_lib_$ac_lib_var=no"
12434 fi
12435 rm -f conftest*
12436 LIBS="$ac_save_LIBS"
12437
12438 fi
12439 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12440   echo "$ac_t""yes" 1>&6
12441   have_thr=yes
12442 else
12443   echo "$ac_t""no" 1>&6
12444 have_thr=no
12445 fi
12446
12447
12448                 if test $have_thr = yes ; then
12449                         cat >> confdefs.h <<\EOF
12450 #define HAVE_THR 1
12451 EOF
12452
12453                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12454                         ol_link_threads=thr
12455
12456                         if test $ol_with_yielding_select = auto ; then
12457                                 ol_with_yielding_select=yes
12458                         fi
12459
12460                                                 for ac_func in \
12461                                 thr_setconcurrency \
12462                                 thr_getconcurrency \
12463                         
12464 do
12465 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12466 echo "configure:12467: checking for $ac_func" >&5
12467 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12468   echo $ac_n "(cached) $ac_c" 1>&6
12469 else
12470   cat > conftest.$ac_ext <<EOF
12471 #line 12472 "configure"
12472 #include "confdefs.h"
12473 /* System header to define __stub macros and hopefully few prototypes,
12474     which can conflict with char $ac_func(); below.  */
12475 #include <assert.h>
12476 /* Override any gcc2 internal prototype to avoid an error.  */
12477 /* We use char because int might match the return type of a gcc2
12478     builtin and then its argument prototype would still apply.  */
12479 char $ac_func();
12480 char (*f)();
12481
12482 int main() {
12483
12484 /* The GNU C library defines this for functions which it implements
12485     to always fail with ENOSYS.  Some functions are actually named
12486     something starting with __ and the normal name is an alias.  */
12487 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12488 choke me
12489 #else
12490 f = $ac_func;
12491 #endif
12492
12493 ; return 0; }
12494 EOF
12495 if { (eval echo configure:12496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12496   rm -rf conftest*
12497   eval "ac_cv_func_$ac_func=yes"
12498 else
12499   echo "configure: failed program was:" >&5
12500   cat conftest.$ac_ext >&5
12501   rm -rf conftest*
12502   eval "ac_cv_func_$ac_func=no"
12503 fi
12504 rm -f conftest*
12505 fi
12506
12507 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12508   echo "$ac_t""yes" 1>&6
12509     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12510   cat >> confdefs.h <<EOF
12511 #define $ac_tr_func 1
12512 EOF
12513  
12514 else
12515   echo "$ac_t""no" 1>&6
12516 fi
12517 done
12518
12519                 fi
12520         fi
12521
12522                 for ac_hdr in lwp/lwp.h
12523 do
12524 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12525 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12526 echo "configure:12527: checking for $ac_hdr" >&5
12527 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12528   echo $ac_n "(cached) $ac_c" 1>&6
12529 else
12530   cat > conftest.$ac_ext <<EOF
12531 #line 12532 "configure"
12532 #include "confdefs.h"
12533 #include <$ac_hdr>
12534 EOF
12535 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12536 { (eval echo configure:12537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12537 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12538 if test -z "$ac_err"; then
12539   rm -rf conftest*
12540   eval "ac_cv_header_$ac_safe=yes"
12541 else
12542   echo "$ac_err" >&5
12543   echo "configure: failed program was:" >&5
12544   cat conftest.$ac_ext >&5
12545   rm -rf conftest*
12546   eval "ac_cv_header_$ac_safe=no"
12547 fi
12548 rm -f conftest*
12549 fi
12550 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12551   echo "$ac_t""yes" 1>&6
12552     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12553   cat >> confdefs.h <<EOF
12554 #define $ac_tr_hdr 1
12555 EOF
12556  
12557 else
12558   echo "$ac_t""no" 1>&6
12559 fi
12560 done
12561
12562         if test $ac_cv_header_lwp_lwp_h = yes ; then
12563                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12564 echo "configure:12565: checking for lwp_create in -llwp" >&5
12565 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12566 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12567   echo $ac_n "(cached) $ac_c" 1>&6
12568 else
12569   ac_save_LIBS="$LIBS"
12570 LIBS="-llwp  $LIBS"
12571 cat > conftest.$ac_ext <<EOF
12572 #line 12573 "configure"
12573 #include "confdefs.h"
12574 /* Override any gcc2 internal prototype to avoid an error.  */
12575 /* We use char because int might match the return type of a gcc2
12576     builtin and then its argument prototype would still apply.  */
12577 char lwp_create();
12578
12579 int main() {
12580 lwp_create()
12581 ; return 0; }
12582 EOF
12583 if { (eval echo configure:12584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12584   rm -rf conftest*
12585   eval "ac_cv_lib_$ac_lib_var=yes"
12586 else
12587   echo "configure: failed program was:" >&5
12588   cat conftest.$ac_ext >&5
12589   rm -rf conftest*
12590   eval "ac_cv_lib_$ac_lib_var=no"
12591 fi
12592 rm -f conftest*
12593 LIBS="$ac_save_LIBS"
12594
12595 fi
12596 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12597   echo "$ac_t""yes" 1>&6
12598   have_lwp=yes
12599 else
12600   echo "$ac_t""no" 1>&6
12601 have_lwp=no
12602 fi
12603
12604
12605                 if test $have_lwp = yes ; then
12606                         cat >> confdefs.h <<\EOF
12607 #define HAVE_LWP 1
12608 EOF
12609
12610                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12611                         ol_link_threads=lwp
12612
12613                         if test $ol_with_yielding_select = auto ; then
12614                                 ol_with_yielding_select=no
12615                         fi
12616                 fi
12617         fi
12618 fi
12619
12620 if test $ol_with_yielding_select = yes ; then
12621         cat >> confdefs.h <<\EOF
12622 #define HAVE_YIELDING_SELECT 1
12623 EOF
12624
12625 fi
12626
12627 if test $ol_with_threads = manual ; then
12628                 ol_link_threads=yes
12629
12630         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12631
12632         for ac_hdr in pthread.h sched.h
12633 do
12634 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12635 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12636 echo "configure:12637: checking for $ac_hdr" >&5
12637 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12638   echo $ac_n "(cached) $ac_c" 1>&6
12639 else
12640   cat > conftest.$ac_ext <<EOF
12641 #line 12642 "configure"
12642 #include "confdefs.h"
12643 #include <$ac_hdr>
12644 EOF
12645 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12646 { (eval echo configure:12647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12647 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12648 if test -z "$ac_err"; then
12649   rm -rf conftest*
12650   eval "ac_cv_header_$ac_safe=yes"
12651 else
12652   echo "$ac_err" >&5
12653   echo "configure: failed program was:" >&5
12654   cat conftest.$ac_ext >&5
12655   rm -rf conftest*
12656   eval "ac_cv_header_$ac_safe=no"
12657 fi
12658 rm -f conftest*
12659 fi
12660 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12661   echo "$ac_t""yes" 1>&6
12662     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12663   cat >> confdefs.h <<EOF
12664 #define $ac_tr_hdr 1
12665 EOF
12666  
12667 else
12668   echo "$ac_t""no" 1>&6
12669 fi
12670 done
12671
12672         for ac_func in sched_yield pthread_yield
12673 do
12674 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12675 echo "configure:12676: checking for $ac_func" >&5
12676 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12677   echo $ac_n "(cached) $ac_c" 1>&6
12678 else
12679   cat > conftest.$ac_ext <<EOF
12680 #line 12681 "configure"
12681 #include "confdefs.h"
12682 /* System header to define __stub macros and hopefully few prototypes,
12683     which can conflict with char $ac_func(); below.  */
12684 #include <assert.h>
12685 /* Override any gcc2 internal prototype to avoid an error.  */
12686 /* We use char because int might match the return type of a gcc2
12687     builtin and then its argument prototype would still apply.  */
12688 char $ac_func();
12689 char (*f)();
12690
12691 int main() {
12692
12693 /* The GNU C library defines this for functions which it implements
12694     to always fail with ENOSYS.  Some functions are actually named
12695     something starting with __ and the normal name is an alias.  */
12696 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12697 choke me
12698 #else
12699 f = $ac_func;
12700 #endif
12701
12702 ; return 0; }
12703 EOF
12704 if { (eval echo configure:12705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12705   rm -rf conftest*
12706   eval "ac_cv_func_$ac_func=yes"
12707 else
12708   echo "configure: failed program was:" >&5
12709   cat conftest.$ac_ext >&5
12710   rm -rf conftest*
12711   eval "ac_cv_func_$ac_func=no"
12712 fi
12713 rm -f conftest*
12714 fi
12715
12716 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12717   echo "$ac_t""yes" 1>&6
12718     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12719   cat >> confdefs.h <<EOF
12720 #define $ac_tr_func 1
12721 EOF
12722  
12723 else
12724   echo "$ac_t""no" 1>&6
12725 fi
12726 done
12727
12728         
12729         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12730 echo "configure:12731: checking for LinuxThreads pthread.h" >&5
12731 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12732   echo $ac_n "(cached) $ac_c" 1>&6
12733 else
12734   cat > conftest.$ac_ext <<EOF
12735 #line 12736 "configure"
12736 #include "confdefs.h"
12737 #include <pthread.h>
12738 EOF
12739 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12740   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12741   rm -rf conftest*
12742   ol_cv_header_linux_threads=yes
12743 else
12744   rm -rf conftest*
12745   ol_cv_header_linux_threads=no
12746 fi
12747 rm -f conftest*
12748
12749                 
12750 fi
12751
12752 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12753         if test $ol_cv_header_linux_threads = yes; then
12754                 cat >> confdefs.h <<\EOF
12755 #define HAVE_LINUX_THREADS 1
12756 EOF
12757
12758         fi
12759
12760
12761         for ac_hdr in mach/cthreads.h
12762 do
12763 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12764 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12765 echo "configure:12766: checking for $ac_hdr" >&5
12766 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12767   echo $ac_n "(cached) $ac_c" 1>&6
12768 else
12769   cat > conftest.$ac_ext <<EOF
12770 #line 12771 "configure"
12771 #include "confdefs.h"
12772 #include <$ac_hdr>
12773 EOF
12774 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12775 { (eval echo configure:12776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12776 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12777 if test -z "$ac_err"; then
12778   rm -rf conftest*
12779   eval "ac_cv_header_$ac_safe=yes"
12780 else
12781   echo "$ac_err" >&5
12782   echo "configure: failed program was:" >&5
12783   cat conftest.$ac_ext >&5
12784   rm -rf conftest*
12785   eval "ac_cv_header_$ac_safe=no"
12786 fi
12787 rm -f conftest*
12788 fi
12789 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12790   echo "$ac_t""yes" 1>&6
12791     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12792   cat >> confdefs.h <<EOF
12793 #define $ac_tr_hdr 1
12794 EOF
12795  
12796 else
12797   echo "$ac_t""no" 1>&6
12798 fi
12799 done
12800
12801         for ac_hdr in lwp/lwp.h
12802 do
12803 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12804 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12805 echo "configure:12806: checking for $ac_hdr" >&5
12806 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12807   echo $ac_n "(cached) $ac_c" 1>&6
12808 else
12809   cat > conftest.$ac_ext <<EOF
12810 #line 12811 "configure"
12811 #include "confdefs.h"
12812 #include <$ac_hdr>
12813 EOF
12814 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12815 { (eval echo configure:12816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12816 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12817 if test -z "$ac_err"; then
12818   rm -rf conftest*
12819   eval "ac_cv_header_$ac_safe=yes"
12820 else
12821   echo "$ac_err" >&5
12822   echo "configure: failed program was:" >&5
12823   cat conftest.$ac_ext >&5
12824   rm -rf conftest*
12825   eval "ac_cv_header_$ac_safe=no"
12826 fi
12827 rm -f conftest*
12828 fi
12829 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12830   echo "$ac_t""yes" 1>&6
12831     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12832   cat >> confdefs.h <<EOF
12833 #define $ac_tr_hdr 1
12834 EOF
12835  
12836 else
12837   echo "$ac_t""no" 1>&6
12838 fi
12839 done
12840
12841         for ac_hdr in thread.h synch.h
12842 do
12843 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12844 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12845 echo "configure:12846: checking for $ac_hdr" >&5
12846 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12847   echo $ac_n "(cached) $ac_c" 1>&6
12848 else
12849   cat > conftest.$ac_ext <<EOF
12850 #line 12851 "configure"
12851 #include "confdefs.h"
12852 #include <$ac_hdr>
12853 EOF
12854 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12855 { (eval echo configure:12856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12856 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12857 if test -z "$ac_err"; then
12858   rm -rf conftest*
12859   eval "ac_cv_header_$ac_safe=yes"
12860 else
12861   echo "$ac_err" >&5
12862   echo "configure: failed program was:" >&5
12863   cat conftest.$ac_ext >&5
12864   rm -rf conftest*
12865   eval "ac_cv_header_$ac_safe=no"
12866 fi
12867 rm -f conftest*
12868 fi
12869 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12870   echo "$ac_t""yes" 1>&6
12871     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12872   cat >> confdefs.h <<EOF
12873 #define $ac_tr_hdr 1
12874 EOF
12875  
12876 else
12877   echo "$ac_t""no" 1>&6
12878 fi
12879 done
12880
12881 fi
12882
12883 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12884                         cat >> confdefs.h <<\EOF
12885 #define REENTRANT 1
12886 EOF
12887
12888         cat >> confdefs.h <<\EOF
12889 #define _REENTRANT 1
12890 EOF
12891
12892         cat >> confdefs.h <<\EOF
12893 #define THREAD_SAFE 1
12894 EOF
12895
12896         cat >> confdefs.h <<\EOF
12897 #define _THREAD_SAFE 1
12898 EOF
12899
12900         cat >> confdefs.h <<\EOF
12901 #define THREADSAFE 1
12902 EOF
12903
12904         cat >> confdefs.h <<\EOF
12905 #define _THREADSAFE 1
12906 EOF
12907
12908         cat >> confdefs.h <<\EOF
12909 #define _SGI_MP_SOURCE 1
12910 EOF
12911
12912
12913                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12914 echo "configure:12915: checking for thread specific errno" >&5
12915 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12916   echo $ac_n "(cached) $ac_c" 1>&6
12917 else
12918   
12919                 cat > conftest.$ac_ext <<EOF
12920 #line 12921 "configure"
12921 #include "confdefs.h"
12922 #include <errno.h>
12923 int main() {
12924 errno = 0;
12925 ; return 0; }
12926 EOF
12927 if { (eval echo configure:12928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12928   rm -rf conftest*
12929   ol_cv_errno_thread_specific=yes
12930 else
12931   echo "configure: failed program was:" >&5
12932   cat conftest.$ac_ext >&5
12933   rm -rf conftest*
12934   ol_cv_errno_thread_specific=no
12935 fi
12936 rm -f conftest*
12937         
12938 fi
12939
12940 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12941
12942                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12943 echo "configure:12944: checking for thread specific h_errno" >&5
12944 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12945   echo $ac_n "(cached) $ac_c" 1>&6
12946 else
12947   
12948                 cat > conftest.$ac_ext <<EOF
12949 #line 12950 "configure"
12950 #include "confdefs.h"
12951 #include <netdb.h>
12952 int main() {
12953 h_errno = 0;
12954 ; return 0; }
12955 EOF
12956 if { (eval echo configure:12957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12957   rm -rf conftest*
12958   ol_cv_h_errno_thread_specific=yes
12959 else
12960   echo "configure: failed program was:" >&5
12961   cat conftest.$ac_ext >&5
12962   rm -rf conftest*
12963   ol_cv_h_errno_thread_specific=no
12964 fi
12965 rm -f conftest*
12966         
12967 fi
12968
12969 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12970
12971         if test $ol_cv_errno_thread_specific != yes \
12972                 -o $ol_cv_h_errno_thread_specific != yes ; then
12973                 LIBS="$LTHREAD_LIBS $LIBS"
12974                 LTHREAD_LIBS=""
12975         fi
12976
12977 fi  
12978
12979 if test $ol_link_threads = no ; then
12980         if test $ol_with_threads = yes ; then
12981                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12982         fi
12983
12984         if test $ol_with_threads = auto ; then
12985                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12986                 ol_with_threads=no
12987         fi
12988
12989         cat >> confdefs.h <<\EOF
12990 #define NO_THREADS 1
12991 EOF
12992
12993         LTHREAD_LIBS=""
12994 fi
12995
12996 if test $ol_link_threads != no ; then
12997         cat >> confdefs.h <<\EOF
12998 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12999 EOF
13000
13001 fi
13002
13003 ol_link_ldbm=no 
13004
13005 if test $ol_with_ldbm_api = auto \
13006         -o $ol_with_ldbm_api = berkeley \
13007         -o $ol_with_ldbm_api = bcompat ; then
13008
13009         if test $ol_with_ldbm_api = bcompat; then \
13010                 ol_cv_berkeley_db=no
13011 for ac_hdr in db_185.h db.h
13012 do
13013 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13014 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13015 echo "configure:13016: checking for $ac_hdr" >&5
13016 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13017   echo $ac_n "(cached) $ac_c" 1>&6
13018 else
13019   cat > conftest.$ac_ext <<EOF
13020 #line 13021 "configure"
13021 #include "confdefs.h"
13022 #include <$ac_hdr>
13023 EOF
13024 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13025 { (eval echo configure:13026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13026 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13027 if test -z "$ac_err"; then
13028   rm -rf conftest*
13029   eval "ac_cv_header_$ac_safe=yes"
13030 else
13031   echo "$ac_err" >&5
13032   echo "configure: failed program was:" >&5
13033   cat conftest.$ac_ext >&5
13034   rm -rf conftest*
13035   eval "ac_cv_header_$ac_safe=no"
13036 fi
13037 rm -f conftest*
13038 fi
13039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13040   echo "$ac_t""yes" 1>&6
13041     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13042   cat >> confdefs.h <<EOF
13043 #define $ac_tr_hdr 1
13044 EOF
13045  
13046 else
13047   echo "$ac_t""no" 1>&6
13048 fi
13049 done
13050
13051 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
13052         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
13053 echo "configure:13054: checking if Berkeley DB header compatibility" >&5
13054 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
13055   echo $ac_n "(cached) $ac_c" 1>&6
13056 else
13057   
13058                 cat > conftest.$ac_ext <<EOF
13059 #line 13060 "configure"
13060 #include "confdefs.h"
13061
13062 #if HAVE_DB_185_H
13063 #       include <db_185.h>
13064 #else
13065 #       include <db.h>
13066 #endif
13067
13068  /* this check could be improved */
13069 #ifndef DB_VERSION_MAJOR
13070 #       define DB_VERSION_MAJOR 1
13071 #endif
13072
13073 #if DB_VERSION_MAJOR == 1 
13074         __db_version_1
13075 #endif
13076
13077 EOF
13078 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13079   egrep "__db_version_1" >/dev/null 2>&1; then
13080   rm -rf conftest*
13081   ol_cv_header_db1=yes
13082 else
13083   rm -rf conftest*
13084   ol_cv_header_db1=no
13085 fi
13086 rm -f conftest*
13087
13088 fi
13089
13090 echo "$ac_t""$ol_cv_header_db1" 1>&6
13091
13092         if test $ol_cv_header_db1 = yes ; then
13093                 ol_cv_lib_db=no
13094 if test $ol_cv_lib_db = no ; then
13095         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13096 echo "configure:13097: checking for Berkeley DB link (default)" >&5
13097 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13098   echo $ac_n "(cached) $ac_c" 1>&6
13099 else
13100   
13101         ol_DB_LIB=
13102         ol_LIBS=$LIBS
13103         LIBS="$ol_DB_LIB $LIBS"
13104
13105         cat > conftest.$ac_ext <<EOF
13106 #line 13107 "configure"
13107 #include "confdefs.h"
13108
13109 #ifdef HAVE_DB_185_H
13110 # include <db_185.h>
13111 #else
13112 # include <db.h>
13113 #endif
13114
13115 #ifndef DB_VERSION_MAJOR
13116 # define DB_VERSION_MAJOR 1
13117 #endif
13118
13119 #ifndef NULL
13120 #define NULL ((void*)0)
13121 #endif
13122
13123 int main() {
13124
13125 #if DB_VERSION_MAJOR > 1
13126         {
13127                 char *version;
13128                 int major, minor, patch;
13129
13130                 version = db_version( &major, &minor, &patch );
13131
13132                 if( major != DB_VERSION_MAJOR ||
13133                         minor < DB_VERSION_MINOR )
13134                 {
13135                         printf("Berkeley DB version mismatch\n"
13136                                 "\texpected: %s\n\tgot: %s\n",
13137                                 DB_VERSION_STRING, version);
13138                         return 1;
13139                 }
13140         }
13141 #endif
13142
13143 #if DB_VERSION_MAJOR > 2
13144         db_env_create( NULL, 0 );
13145 #elif DB_VERSION_MAJOR > 1
13146         db_appexit( NULL );
13147 #else
13148         (void) dbopen( NULL, 0, 0, 0, NULL);
13149 #endif
13150
13151 ; return 0; }
13152 EOF
13153 if { (eval echo configure:13154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13154   rm -rf conftest*
13155   ol_cv_db_none=yes
13156 else
13157   echo "configure: failed program was:" >&5
13158   cat conftest.$ac_ext >&5
13159   rm -rf conftest*
13160   ol_cv_db_none=no
13161 fi
13162 rm -f conftest*
13163
13164         LIBS="$ol_LIBS"
13165
13166 fi
13167
13168 echo "$ac_t""$ol_cv_db_none" 1>&6
13169
13170         if test $ol_cv_db_none = yes ; then
13171                 ol_cv_lib_db=yes
13172         fi
13173 fi
13174
13175 if test $ol_cv_lib_db = no ; then
13176         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13177 echo "configure:13178: checking for Berkeley DB link (-ldb)" >&5
13178 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13179   echo $ac_n "(cached) $ac_c" 1>&6
13180 else
13181   
13182         ol_DB_LIB=-ldb
13183         ol_LIBS=$LIBS
13184         LIBS="$ol_DB_LIB $LIBS"
13185
13186         cat > conftest.$ac_ext <<EOF
13187 #line 13188 "configure"
13188 #include "confdefs.h"
13189
13190 #ifdef HAVE_DB_185_H
13191 # include <db_185.h>
13192 #else
13193 # include <db.h>
13194 #endif
13195
13196 #ifndef DB_VERSION_MAJOR
13197 # define DB_VERSION_MAJOR 1
13198 #endif
13199
13200 #ifndef NULL
13201 #define NULL ((void*)0)
13202 #endif
13203
13204 int main() {
13205
13206 #if DB_VERSION_MAJOR > 1
13207         {
13208                 char *version;
13209                 int major, minor, patch;
13210
13211                 version = db_version( &major, &minor, &patch );
13212
13213                 if( major != DB_VERSION_MAJOR ||
13214                         minor < DB_VERSION_MINOR )
13215                 {
13216                         printf("Berkeley DB version mismatch\n"
13217                                 "\texpected: %s\n\tgot: %s\n",
13218                                 DB_VERSION_STRING, version);
13219                         return 1;
13220                 }
13221         }
13222 #endif
13223
13224 #if DB_VERSION_MAJOR > 2
13225         db_env_create( NULL, 0 );
13226 #elif DB_VERSION_MAJOR > 1
13227         db_appexit( NULL );
13228 #else
13229         (void) dbopen( NULL, 0, 0, 0, NULL);
13230 #endif
13231
13232 ; return 0; }
13233 EOF
13234 if { (eval echo configure:13235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13235   rm -rf conftest*
13236   ol_cv_db_db=yes
13237 else
13238   echo "configure: failed program was:" >&5
13239   cat conftest.$ac_ext >&5
13240   rm -rf conftest*
13241   ol_cv_db_db=no
13242 fi
13243 rm -f conftest*
13244
13245         LIBS="$ol_LIBS"
13246
13247 fi
13248
13249 echo "$ac_t""$ol_cv_db_db" 1>&6
13250
13251         if test $ol_cv_db_db = yes ; then
13252                 ol_cv_lib_db=-ldb
13253         fi
13254 fi
13255
13256 if test $ol_cv_lib_db = no ; then
13257         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13258 echo "configure:13259: checking for Berkeley DB link (-ldb3)" >&5
13259 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13260   echo $ac_n "(cached) $ac_c" 1>&6
13261 else
13262   
13263         ol_DB_LIB=-ldb3
13264         ol_LIBS=$LIBS
13265         LIBS="$ol_DB_LIB $LIBS"
13266
13267         cat > conftest.$ac_ext <<EOF
13268 #line 13269 "configure"
13269 #include "confdefs.h"
13270
13271 #ifdef HAVE_DB_185_H
13272 # include <db_185.h>
13273 #else
13274 # include <db.h>
13275 #endif
13276
13277 #ifndef DB_VERSION_MAJOR
13278 # define DB_VERSION_MAJOR 1
13279 #endif
13280
13281 #ifndef NULL
13282 #define NULL ((void*)0)
13283 #endif
13284
13285 int main() {
13286
13287 #if DB_VERSION_MAJOR > 1
13288         {
13289                 char *version;
13290                 int major, minor, patch;
13291
13292                 version = db_version( &major, &minor, &patch );
13293
13294                 if( major != DB_VERSION_MAJOR ||
13295                         minor < DB_VERSION_MINOR )
13296                 {
13297                         printf("Berkeley DB version mismatch\n"
13298                                 "\texpected: %s\n\tgot: %s\n",
13299                                 DB_VERSION_STRING, version);
13300                         return 1;
13301                 }
13302         }
13303 #endif
13304
13305 #if DB_VERSION_MAJOR > 2
13306         db_env_create( NULL, 0 );
13307 #elif DB_VERSION_MAJOR > 1
13308         db_appexit( NULL );
13309 #else
13310         (void) dbopen( NULL, 0, 0, 0, NULL);
13311 #endif
13312
13313 ; return 0; }
13314 EOF
13315 if { (eval echo configure:13316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13316   rm -rf conftest*
13317   ol_cv_db_db3=yes
13318 else
13319   echo "configure: failed program was:" >&5
13320   cat conftest.$ac_ext >&5
13321   rm -rf conftest*
13322   ol_cv_db_db3=no
13323 fi
13324 rm -f conftest*
13325
13326         LIBS="$ol_LIBS"
13327
13328 fi
13329
13330 echo "$ac_t""$ol_cv_db_db3" 1>&6
13331
13332         if test $ol_cv_db_db3 = yes ; then
13333                 ol_cv_lib_db=-ldb3
13334         fi
13335 fi
13336
13337 if test $ol_cv_lib_db = no ; then
13338         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13339 echo "configure:13340: checking for Berkeley DB link (-ldb2)" >&5
13340 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13341   echo $ac_n "(cached) $ac_c" 1>&6
13342 else
13343   
13344         ol_DB_LIB=-ldb2
13345         ol_LIBS=$LIBS
13346         LIBS="$ol_DB_LIB $LIBS"
13347
13348         cat > conftest.$ac_ext <<EOF
13349 #line 13350 "configure"
13350 #include "confdefs.h"
13351
13352 #ifdef HAVE_DB_185_H
13353 # include <db_185.h>
13354 #else
13355 # include <db.h>
13356 #endif
13357
13358 #ifndef DB_VERSION_MAJOR
13359 # define DB_VERSION_MAJOR 1
13360 #endif
13361
13362 #ifndef NULL
13363 #define NULL ((void*)0)
13364 #endif
13365
13366 int main() {
13367
13368 #if DB_VERSION_MAJOR > 1
13369         {
13370                 char *version;
13371                 int major, minor, patch;
13372
13373                 version = db_version( &major, &minor, &patch );
13374
13375                 if( major != DB_VERSION_MAJOR ||
13376                         minor < DB_VERSION_MINOR )
13377                 {
13378                         printf("Berkeley DB version mismatch\n"
13379                                 "\texpected: %s\n\tgot: %s\n",
13380                                 DB_VERSION_STRING, version);
13381                         return 1;
13382                 }
13383         }
13384 #endif
13385
13386 #if DB_VERSION_MAJOR > 2
13387         db_env_create( NULL, 0 );
13388 #elif DB_VERSION_MAJOR > 1
13389         db_appexit( NULL );
13390 #else
13391         (void) dbopen( NULL, 0, 0, 0, NULL);
13392 #endif
13393
13394 ; return 0; }
13395 EOF
13396 if { (eval echo configure:13397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13397   rm -rf conftest*
13398   ol_cv_db_db2=yes
13399 else
13400   echo "configure: failed program was:" >&5
13401   cat conftest.$ac_ext >&5
13402   rm -rf conftest*
13403   ol_cv_db_db2=no
13404 fi
13405 rm -f conftest*
13406
13407         LIBS="$ol_LIBS"
13408
13409 fi
13410
13411 echo "$ac_t""$ol_cv_db_db2" 1>&6
13412
13413         if test $ol_cv_db_db2 = yes ; then
13414                 ol_cv_lib_db=-ldb2
13415         fi
13416 fi
13417
13418 if test $ol_cv_lib_db = no ; then
13419         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13420 echo "configure:13421: checking for Berkeley DB link (-ldb1)" >&5
13421 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13422   echo $ac_n "(cached) $ac_c" 1>&6
13423 else
13424   
13425         ol_DB_LIB=-ldb1
13426         ol_LIBS=$LIBS
13427         LIBS="$ol_DB_LIB $LIBS"
13428
13429         cat > conftest.$ac_ext <<EOF
13430 #line 13431 "configure"
13431 #include "confdefs.h"
13432
13433 #ifdef HAVE_DB_185_H
13434 # include <db_185.h>
13435 #else
13436 # include <db.h>
13437 #endif
13438
13439 #ifndef DB_VERSION_MAJOR
13440 # define DB_VERSION_MAJOR 1
13441 #endif
13442
13443 #ifndef NULL
13444 #define NULL ((void*)0)
13445 #endif
13446
13447 int main() {
13448
13449 #if DB_VERSION_MAJOR > 1
13450         {
13451                 char *version;
13452                 int major, minor, patch;
13453
13454                 version = db_version( &major, &minor, &patch );
13455
13456                 if( major != DB_VERSION_MAJOR ||
13457                         minor < DB_VERSION_MINOR )
13458                 {
13459                         printf("Berkeley DB version mismatch\n"
13460                                 "\texpected: %s\n\tgot: %s\n",
13461                                 DB_VERSION_STRING, version);
13462                         return 1;
13463                 }
13464         }
13465 #endif
13466
13467 #if DB_VERSION_MAJOR > 2
13468         db_env_create( NULL, 0 );
13469 #elif DB_VERSION_MAJOR > 1
13470         db_appexit( NULL );
13471 #else
13472         (void) dbopen( NULL, 0, 0, 0, NULL);
13473 #endif
13474
13475 ; return 0; }
13476 EOF
13477 if { (eval echo configure:13478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13478   rm -rf conftest*
13479   ol_cv_db_db1=yes
13480 else
13481   echo "configure: failed program was:" >&5
13482   cat conftest.$ac_ext >&5
13483   rm -rf conftest*
13484   ol_cv_db_db1=no
13485 fi
13486 rm -f conftest*
13487
13488         LIBS="$ol_LIBS"
13489
13490 fi
13491
13492 echo "$ac_t""$ol_cv_db_db1" 1>&6
13493
13494         if test $ol_cv_db_db1 = yes ; then
13495                 ol_cv_lib_db=-ldb1
13496         fi
13497 fi
13498
13499
13500                 if test "$ol_cv_lib_db" != no ; then
13501                         ol_cv_berkeley_db=yes
13502                 fi
13503         fi
13504 fi
13505
13506         else
13507                 ol_cv_berkeley_db=no
13508 for ac_hdr in db.h
13509 do
13510 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13511 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13512 echo "configure:13513: checking for $ac_hdr" >&5
13513 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13514   echo $ac_n "(cached) $ac_c" 1>&6
13515 else
13516   cat > conftest.$ac_ext <<EOF
13517 #line 13518 "configure"
13518 #include "confdefs.h"
13519 #include <$ac_hdr>
13520 EOF
13521 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13522 { (eval echo configure:13523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13523 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13524 if test -z "$ac_err"; then
13525   rm -rf conftest*
13526   eval "ac_cv_header_$ac_safe=yes"
13527 else
13528   echo "$ac_err" >&5
13529   echo "configure: failed program was:" >&5
13530   cat conftest.$ac_ext >&5
13531   rm -rf conftest*
13532   eval "ac_cv_header_$ac_safe=no"
13533 fi
13534 rm -f conftest*
13535 fi
13536 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13537   echo "$ac_t""yes" 1>&6
13538     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13539   cat >> confdefs.h <<EOF
13540 #define $ac_tr_hdr 1
13541 EOF
13542  
13543 else
13544   echo "$ac_t""no" 1>&6
13545 fi
13546 done
13547
13548 if test $ac_cv_header_db_h = yes; then
13549         ol_cv_lib_db=no
13550 if test $ol_cv_lib_db = no ; then
13551         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13552 echo "configure:13553: checking for Berkeley DB link (default)" >&5
13553 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13554   echo $ac_n "(cached) $ac_c" 1>&6
13555 else
13556   
13557         ol_DB_LIB=
13558         ol_LIBS=$LIBS
13559         LIBS="$ol_DB_LIB $LIBS"
13560
13561         cat > conftest.$ac_ext <<EOF
13562 #line 13563 "configure"
13563 #include "confdefs.h"
13564
13565 #ifdef HAVE_DB_185_H
13566 # include <db_185.h>
13567 #else
13568 # include <db.h>
13569 #endif
13570
13571 #ifndef DB_VERSION_MAJOR
13572 # define DB_VERSION_MAJOR 1
13573 #endif
13574
13575 #ifndef NULL
13576 #define NULL ((void*)0)
13577 #endif
13578
13579 int main() {
13580
13581 #if DB_VERSION_MAJOR > 1
13582         {
13583                 char *version;
13584                 int major, minor, patch;
13585
13586                 version = db_version( &major, &minor, &patch );
13587
13588                 if( major != DB_VERSION_MAJOR ||
13589                         minor < DB_VERSION_MINOR )
13590                 {
13591                         printf("Berkeley DB version mismatch\n"
13592                                 "\texpected: %s\n\tgot: %s\n",
13593                                 DB_VERSION_STRING, version);
13594                         return 1;
13595                 }
13596         }
13597 #endif
13598
13599 #if DB_VERSION_MAJOR > 2
13600         db_env_create( NULL, 0 );
13601 #elif DB_VERSION_MAJOR > 1
13602         db_appexit( NULL );
13603 #else
13604         (void) dbopen( NULL, 0, 0, 0, NULL);
13605 #endif
13606
13607 ; return 0; }
13608 EOF
13609 if { (eval echo configure:13610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13610   rm -rf conftest*
13611   ol_cv_db_none=yes
13612 else
13613   echo "configure: failed program was:" >&5
13614   cat conftest.$ac_ext >&5
13615   rm -rf conftest*
13616   ol_cv_db_none=no
13617 fi
13618 rm -f conftest*
13619
13620         LIBS="$ol_LIBS"
13621
13622 fi
13623
13624 echo "$ac_t""$ol_cv_db_none" 1>&6
13625
13626         if test $ol_cv_db_none = yes ; then
13627                 ol_cv_lib_db=yes
13628         fi
13629 fi
13630
13631 if test $ol_cv_lib_db = no ; then
13632         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13633 echo "configure:13634: checking for Berkeley DB link (-ldb)" >&5
13634 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13635   echo $ac_n "(cached) $ac_c" 1>&6
13636 else
13637   
13638         ol_DB_LIB=-ldb
13639         ol_LIBS=$LIBS
13640         LIBS="$ol_DB_LIB $LIBS"
13641
13642         cat > conftest.$ac_ext <<EOF
13643 #line 13644 "configure"
13644 #include "confdefs.h"
13645
13646 #ifdef HAVE_DB_185_H
13647 # include <db_185.h>
13648 #else
13649 # include <db.h>
13650 #endif
13651
13652 #ifndef DB_VERSION_MAJOR
13653 # define DB_VERSION_MAJOR 1
13654 #endif
13655
13656 #ifndef NULL
13657 #define NULL ((void*)0)
13658 #endif
13659
13660 int main() {
13661
13662 #if DB_VERSION_MAJOR > 1
13663         {
13664                 char *version;
13665                 int major, minor, patch;
13666
13667                 version = db_version( &major, &minor, &patch );
13668
13669                 if( major != DB_VERSION_MAJOR ||
13670                         minor < DB_VERSION_MINOR )
13671                 {
13672                         printf("Berkeley DB version mismatch\n"
13673                                 "\texpected: %s\n\tgot: %s\n",
13674                                 DB_VERSION_STRING, version);
13675                         return 1;
13676                 }
13677         }
13678 #endif
13679
13680 #if DB_VERSION_MAJOR > 2
13681         db_env_create( NULL, 0 );
13682 #elif DB_VERSION_MAJOR > 1
13683         db_appexit( NULL );
13684 #else
13685         (void) dbopen( NULL, 0, 0, 0, NULL);
13686 #endif
13687
13688 ; return 0; }
13689 EOF
13690 if { (eval echo configure:13691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13691   rm -rf conftest*
13692   ol_cv_db_db=yes
13693 else
13694   echo "configure: failed program was:" >&5
13695   cat conftest.$ac_ext >&5
13696   rm -rf conftest*
13697   ol_cv_db_db=no
13698 fi
13699 rm -f conftest*
13700
13701         LIBS="$ol_LIBS"
13702
13703 fi
13704
13705 echo "$ac_t""$ol_cv_db_db" 1>&6
13706
13707         if test $ol_cv_db_db = yes ; then
13708                 ol_cv_lib_db=-ldb
13709         fi
13710 fi
13711
13712 if test $ol_cv_lib_db = no ; then
13713         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13714 echo "configure:13715: checking for Berkeley DB link (-ldb3)" >&5
13715 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13716   echo $ac_n "(cached) $ac_c" 1>&6
13717 else
13718   
13719         ol_DB_LIB=-ldb3
13720         ol_LIBS=$LIBS
13721         LIBS="$ol_DB_LIB $LIBS"
13722
13723         cat > conftest.$ac_ext <<EOF
13724 #line 13725 "configure"
13725 #include "confdefs.h"
13726
13727 #ifdef HAVE_DB_185_H
13728 # include <db_185.h>
13729 #else
13730 # include <db.h>
13731 #endif
13732
13733 #ifndef DB_VERSION_MAJOR
13734 # define DB_VERSION_MAJOR 1
13735 #endif
13736
13737 #ifndef NULL
13738 #define NULL ((void*)0)
13739 #endif
13740
13741 int main() {
13742
13743 #if DB_VERSION_MAJOR > 1
13744         {
13745                 char *version;
13746                 int major, minor, patch;
13747
13748                 version = db_version( &major, &minor, &patch );
13749
13750                 if( major != DB_VERSION_MAJOR ||
13751                         minor < DB_VERSION_MINOR )
13752                 {
13753                         printf("Berkeley DB version mismatch\n"
13754                                 "\texpected: %s\n\tgot: %s\n",
13755                                 DB_VERSION_STRING, version);
13756                         return 1;
13757                 }
13758         }
13759 #endif
13760
13761 #if DB_VERSION_MAJOR > 2
13762         db_env_create( NULL, 0 );
13763 #elif DB_VERSION_MAJOR > 1
13764         db_appexit( NULL );
13765 #else
13766         (void) dbopen( NULL, 0, 0, 0, NULL);
13767 #endif
13768
13769 ; return 0; }
13770 EOF
13771 if { (eval echo configure:13772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13772   rm -rf conftest*
13773   ol_cv_db_db3=yes
13774 else
13775   echo "configure: failed program was:" >&5
13776   cat conftest.$ac_ext >&5
13777   rm -rf conftest*
13778   ol_cv_db_db3=no
13779 fi
13780 rm -f conftest*
13781
13782         LIBS="$ol_LIBS"
13783
13784 fi
13785
13786 echo "$ac_t""$ol_cv_db_db3" 1>&6
13787
13788         if test $ol_cv_db_db3 = yes ; then
13789                 ol_cv_lib_db=-ldb3
13790         fi
13791 fi
13792
13793 if test $ol_cv_lib_db = no ; then
13794         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13795 echo "configure:13796: checking for Berkeley DB link (-ldb2)" >&5
13796 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13797   echo $ac_n "(cached) $ac_c" 1>&6
13798 else
13799   
13800         ol_DB_LIB=-ldb2
13801         ol_LIBS=$LIBS
13802         LIBS="$ol_DB_LIB $LIBS"
13803
13804         cat > conftest.$ac_ext <<EOF
13805 #line 13806 "configure"
13806 #include "confdefs.h"
13807
13808 #ifdef HAVE_DB_185_H
13809 # include <db_185.h>
13810 #else
13811 # include <db.h>
13812 #endif
13813
13814 #ifndef DB_VERSION_MAJOR
13815 # define DB_VERSION_MAJOR 1
13816 #endif
13817
13818 #ifndef NULL
13819 #define NULL ((void*)0)
13820 #endif
13821
13822 int main() {
13823
13824 #if DB_VERSION_MAJOR > 1
13825         {
13826                 char *version;
13827                 int major, minor, patch;
13828
13829                 version = db_version( &major, &minor, &patch );
13830
13831                 if( major != DB_VERSION_MAJOR ||
13832                         minor < DB_VERSION_MINOR )
13833                 {
13834                         printf("Berkeley DB version mismatch\n"
13835                                 "\texpected: %s\n\tgot: %s\n",
13836                                 DB_VERSION_STRING, version);
13837                         return 1;
13838                 }
13839         }
13840 #endif
13841
13842 #if DB_VERSION_MAJOR > 2
13843         db_env_create( NULL, 0 );
13844 #elif DB_VERSION_MAJOR > 1
13845         db_appexit( NULL );
13846 #else
13847         (void) dbopen( NULL, 0, 0, 0, NULL);
13848 #endif
13849
13850 ; return 0; }
13851 EOF
13852 if { (eval echo configure:13853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13853   rm -rf conftest*
13854   ol_cv_db_db2=yes
13855 else
13856   echo "configure: failed program was:" >&5
13857   cat conftest.$ac_ext >&5
13858   rm -rf conftest*
13859   ol_cv_db_db2=no
13860 fi
13861 rm -f conftest*
13862
13863         LIBS="$ol_LIBS"
13864
13865 fi
13866
13867 echo "$ac_t""$ol_cv_db_db2" 1>&6
13868
13869         if test $ol_cv_db_db2 = yes ; then
13870                 ol_cv_lib_db=-ldb2
13871         fi
13872 fi
13873
13874 if test $ol_cv_lib_db = no ; then
13875         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13876 echo "configure:13877: checking for Berkeley DB link (-ldb1)" >&5
13877 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13878   echo $ac_n "(cached) $ac_c" 1>&6
13879 else
13880   
13881         ol_DB_LIB=-ldb1
13882         ol_LIBS=$LIBS
13883         LIBS="$ol_DB_LIB $LIBS"
13884
13885         cat > conftest.$ac_ext <<EOF
13886 #line 13887 "configure"
13887 #include "confdefs.h"
13888
13889 #ifdef HAVE_DB_185_H
13890 # include <db_185.h>
13891 #else
13892 # include <db.h>
13893 #endif
13894
13895 #ifndef DB_VERSION_MAJOR
13896 # define DB_VERSION_MAJOR 1
13897 #endif
13898
13899 #ifndef NULL
13900 #define NULL ((void*)0)
13901 #endif
13902
13903 int main() {
13904
13905 #if DB_VERSION_MAJOR > 1
13906         {
13907                 char *version;
13908                 int major, minor, patch;
13909
13910                 version = db_version( &major, &minor, &patch );
13911
13912                 if( major != DB_VERSION_MAJOR ||
13913                         minor < DB_VERSION_MINOR )
13914                 {
13915                         printf("Berkeley DB version mismatch\n"
13916                                 "\texpected: %s\n\tgot: %s\n",
13917                                 DB_VERSION_STRING, version);
13918                         return 1;
13919                 }
13920         }
13921 #endif
13922
13923 #if DB_VERSION_MAJOR > 2
13924         db_env_create( NULL, 0 );
13925 #elif DB_VERSION_MAJOR > 1
13926         db_appexit( NULL );
13927 #else
13928         (void) dbopen( NULL, 0, 0, 0, NULL);
13929 #endif
13930
13931 ; return 0; }
13932 EOF
13933 if { (eval echo configure:13934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13934   rm -rf conftest*
13935   ol_cv_db_db1=yes
13936 else
13937   echo "configure: failed program was:" >&5
13938   cat conftest.$ac_ext >&5
13939   rm -rf conftest*
13940   ol_cv_db_db1=no
13941 fi
13942 rm -f conftest*
13943
13944         LIBS="$ol_LIBS"
13945
13946 fi
13947
13948 echo "$ac_t""$ol_cv_db_db1" 1>&6
13949
13950         if test $ol_cv_db_db1 = yes ; then
13951                 ol_cv_lib_db=-ldb1
13952         fi
13953 fi
13954
13955
13956         if test "$ol_cv_lib_db" != no ; then
13957                 ol_cv_berkeley_db=yes
13958                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13959 echo "configure:13960: checking for Berkeley DB thread support" >&5
13960 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13961   echo $ac_n "(cached) $ac_c" 1>&6
13962 else
13963   
13964         ol_LIBS="$LIBS"
13965         if test $ol_cv_lib_db != yes ; then
13966                 LIBS="$ol_cv_lib_db"
13967         fi
13968
13969         if test "$cross_compiling" = yes; then
13970   ol_cv_berkeley_db_thread=cross
13971 else
13972   cat > conftest.$ac_ext <<EOF
13973 #line 13974 "configure"
13974 #include "confdefs.h"
13975
13976 #ifdef HAVE_DB_185_H
13977         choke me;
13978 #else
13979 #include <db.h>
13980 #endif
13981 #ifndef NULL
13982 #define NULL ((void *)0)
13983 #endif
13984 main()
13985 {
13986         int rc;
13987         u_int32_t flags = DB_CREATE |
13988 #ifdef DB_PRIVATE
13989                 DB_PRIVATE |
13990 #endif
13991                 DB_THREAD;
13992
13993 #if DB_VERSION_MAJOR > 2
13994         DB_ENV *env = NULL;
13995
13996         rc = db_env_create( &env, 0 );
13997
13998         flags |= DB_INIT_MPOOL;
13999 #ifdef DB_MPOOL_PRIVATE
14000         flags |= DB_MPOOL_PRIVATE;
14001 #endif
14002
14003         if( rc ) {
14004                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14005                 return rc;
14006         }
14007
14008 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
14009         rc = env->open( env, NULL, flags, 0 );
14010 #else
14011         rc = env->open( env, NULL, NULL, flags, 0 );
14012 #endif
14013
14014         if ( rc == 0 ) {
14015                 rc = env->close( env, 0 );
14016         }
14017
14018         if( rc ) {
14019                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14020                 return rc;
14021         }
14022
14023 #else
14024         DB_ENV env;
14025         memset( &env, '\0', sizeof(env) );
14026
14027         rc = db_appinit( NULL, NULL, &env, flags );
14028
14029         if( rc == 0 ) {
14030                 db_appexit( &env );
14031         }
14032
14033         unlink("__db_mpool.share");
14034         unlink("__db_lock.share");
14035 #endif
14036
14037         return rc;
14038 }
14039 EOF
14040 if { (eval echo configure:14041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14041 then
14042   ol_cv_berkeley_db_thread=yes
14043 else
14044   echo "configure: failed program was:" >&5
14045   cat conftest.$ac_ext >&5
14046   rm -fr conftest*
14047   ol_cv_berkeley_db_thread=no
14048 fi
14049 rm -fr conftest*
14050 fi
14051
14052
14053         LIBS="$ol_LIBS"
14054
14055         if test $ol_cv_berkeley_db_thread != no ; then
14056                 cat >> confdefs.h <<\EOF
14057 #define HAVE_BERKELEY_DB_THREAD 1
14058 EOF
14059
14060         fi
14061
14062 fi
14063
14064 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
14065         fi
14066 fi
14067
14068         fi
14069
14070         if test $ol_cv_berkeley_db != no ; then
14071                 cat >> confdefs.h <<\EOF
14072 #define HAVE_BERKELEY_DB 1
14073 EOF
14074
14075
14076                 ol_link_ldbm=berkeley
14077                 ol_with_ldbm_api=berkeley
14078
14079                 if test $ol_with_ldbm_type = hash ; then
14080                         cat >> confdefs.h <<\EOF
14081 #define LDBM_USE_DBHASH 1
14082 EOF
14083
14084                 else
14085                         cat >> confdefs.h <<\EOF
14086 #define LDBM_USE_DBBTREE 1
14087 EOF
14088
14089                 fi
14090
14091                                                 if test $ol_cv_lib_db != yes ; then
14092                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
14093                 fi
14094         fi
14095 fi
14096
14097 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
14098         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
14099 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
14100         ol_enable_bdb=yes
14101 fi
14102
14103 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
14104         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
14105         ol_with_ldbm_api=none
14106 fi
14107
14108 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
14109         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
14110 echo "configure:14111: checking for MDBM library" >&5
14111 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
14112   echo $ac_n "(cached) $ac_c" 1>&6
14113 else
14114         ol_LIBS="$LIBS"
14115         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
14116 echo "configure:14117: checking for mdbm_set_chain" >&5
14117 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
14118   echo $ac_n "(cached) $ac_c" 1>&6
14119 else
14120   cat > conftest.$ac_ext <<EOF
14121 #line 14122 "configure"
14122 #include "confdefs.h"
14123 /* System header to define __stub macros and hopefully few prototypes,
14124     which can conflict with char mdbm_set_chain(); below.  */
14125 #include <assert.h>
14126 /* Override any gcc2 internal prototype to avoid an error.  */
14127 /* We use char because int might match the return type of a gcc2
14128     builtin and then its argument prototype would still apply.  */
14129 char mdbm_set_chain();
14130 char (*f)();
14131
14132 int main() {
14133
14134 /* The GNU C library defines this for functions which it implements
14135     to always fail with ENOSYS.  Some functions are actually named
14136     something starting with __ and the normal name is an alias.  */
14137 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
14138 choke me
14139 #else
14140 f = mdbm_set_chain;
14141 #endif
14142
14143 ; return 0; }
14144 EOF
14145 if { (eval echo configure:14146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14146   rm -rf conftest*
14147   eval "ac_cv_func_mdbm_set_chain=yes"
14148 else
14149   echo "configure: failed program was:" >&5
14150   cat conftest.$ac_ext >&5
14151   rm -rf conftest*
14152   eval "ac_cv_func_mdbm_set_chain=no"
14153 fi
14154 rm -f conftest*
14155 fi
14156
14157 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
14158   echo "$ac_t""yes" 1>&6
14159   ol_cv_lib_mdbm=yes
14160 else
14161   echo "$ac_t""no" 1>&6
14162
14163                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
14164 echo "configure:14165: checking for mdbm_set_chain in -lmdbm" >&5
14165 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
14166 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14167   echo $ac_n "(cached) $ac_c" 1>&6
14168 else
14169   ac_save_LIBS="$LIBS"
14170 LIBS="-lmdbm  $LIBS"
14171 cat > conftest.$ac_ext <<EOF
14172 #line 14173 "configure"
14173 #include "confdefs.h"
14174 /* Override any gcc2 internal prototype to avoid an error.  */
14175 /* We use char because int might match the return type of a gcc2
14176     builtin and then its argument prototype would still apply.  */
14177 char mdbm_set_chain();
14178
14179 int main() {
14180 mdbm_set_chain()
14181 ; return 0; }
14182 EOF
14183 if { (eval echo configure:14184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14184   rm -rf conftest*
14185   eval "ac_cv_lib_$ac_lib_var=yes"
14186 else
14187   echo "configure: failed program was:" >&5
14188   cat conftest.$ac_ext >&5
14189   rm -rf conftest*
14190   eval "ac_cv_lib_$ac_lib_var=no"
14191 fi
14192 rm -f conftest*
14193 LIBS="$ac_save_LIBS"
14194
14195 fi
14196 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14197   echo "$ac_t""yes" 1>&6
14198   ol_cv_lib_mdbm=-lmdbm
14199 else
14200   echo "$ac_t""no" 1>&6
14201 ol_cv_lib_mdbm=no
14202 fi
14203
14204         
14205 fi
14206
14207         LIBS="$ol_LIBS"
14208
14209 fi
14210
14211 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14212
14213
14214  for ac_hdr in mdbm.h
14215 do
14216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14217 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14218 echo "configure:14219: checking for $ac_hdr" >&5
14219 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14220   echo $ac_n "(cached) $ac_c" 1>&6
14221 else
14222   cat > conftest.$ac_ext <<EOF
14223 #line 14224 "configure"
14224 #include "confdefs.h"
14225 #include <$ac_hdr>
14226 EOF
14227 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14228 { (eval echo configure:14229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14229 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14230 if test -z "$ac_err"; then
14231   rm -rf conftest*
14232   eval "ac_cv_header_$ac_safe=yes"
14233 else
14234   echo "$ac_err" >&5
14235   echo "configure: failed program was:" >&5
14236   cat conftest.$ac_ext >&5
14237   rm -rf conftest*
14238   eval "ac_cv_header_$ac_safe=no"
14239 fi
14240 rm -f conftest*
14241 fi
14242 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14243   echo "$ac_t""yes" 1>&6
14244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14245   cat >> confdefs.h <<EOF
14246 #define $ac_tr_hdr 1
14247 EOF
14248  
14249 else
14250   echo "$ac_t""no" 1>&6
14251 fi
14252 done
14253
14254  echo $ac_n "checking for db""... $ac_c" 1>&6
14255 echo "configure:14256: checking for db" >&5
14256 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14257   echo $ac_n "(cached) $ac_c" 1>&6
14258 else
14259   
14260         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14261                 ol_cv_mdbm=no
14262         else
14263                 ol_cv_mdbm=yes
14264         fi
14265
14266 fi
14267
14268 echo "$ac_t""$ol_cv_mdbm" 1>&6
14269  if test $ol_cv_mdbm = yes ; then
14270         cat >> confdefs.h <<\EOF
14271 #define HAVE_MDBM 1
14272 EOF
14273
14274  fi
14275
14276
14277         if test $ol_cv_mdbm = yes ; then
14278                 ol_link_ldbm=mdbm
14279                 ol_with_ldbm_api=mdbm
14280                 if test $ol_cv_lib_mdbm != yes ; then
14281                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14282                 fi
14283         fi
14284 fi
14285
14286 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14287         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14288 echo "configure:14289: checking for GDBM library" >&5
14289 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14290   echo $ac_n "(cached) $ac_c" 1>&6
14291 else
14292         ol_LIBS="$LIBS"
14293         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14294 echo "configure:14295: checking for gdbm_open" >&5
14295 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14296   echo $ac_n "(cached) $ac_c" 1>&6
14297 else
14298   cat > conftest.$ac_ext <<EOF
14299 #line 14300 "configure"
14300 #include "confdefs.h"
14301 /* System header to define __stub macros and hopefully few prototypes,
14302     which can conflict with char gdbm_open(); below.  */
14303 #include <assert.h>
14304 /* Override any gcc2 internal prototype to avoid an error.  */
14305 /* We use char because int might match the return type of a gcc2
14306     builtin and then its argument prototype would still apply.  */
14307 char gdbm_open();
14308 char (*f)();
14309
14310 int main() {
14311
14312 /* The GNU C library defines this for functions which it implements
14313     to always fail with ENOSYS.  Some functions are actually named
14314     something starting with __ and the normal name is an alias.  */
14315 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14316 choke me
14317 #else
14318 f = gdbm_open;
14319 #endif
14320
14321 ; return 0; }
14322 EOF
14323 if { (eval echo configure:14324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14324   rm -rf conftest*
14325   eval "ac_cv_func_gdbm_open=yes"
14326 else
14327   echo "configure: failed program was:" >&5
14328   cat conftest.$ac_ext >&5
14329   rm -rf conftest*
14330   eval "ac_cv_func_gdbm_open=no"
14331 fi
14332 rm -f conftest*
14333 fi
14334
14335 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14336   echo "$ac_t""yes" 1>&6
14337   ol_cv_lib_gdbm=yes
14338 else
14339   echo "$ac_t""no" 1>&6
14340
14341                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14342 echo "configure:14343: checking for gdbm_open in -lgdbm" >&5
14343 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14344 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14345   echo $ac_n "(cached) $ac_c" 1>&6
14346 else
14347   ac_save_LIBS="$LIBS"
14348 LIBS="-lgdbm  $LIBS"
14349 cat > conftest.$ac_ext <<EOF
14350 #line 14351 "configure"
14351 #include "confdefs.h"
14352 /* Override any gcc2 internal prototype to avoid an error.  */
14353 /* We use char because int might match the return type of a gcc2
14354     builtin and then its argument prototype would still apply.  */
14355 char gdbm_open();
14356
14357 int main() {
14358 gdbm_open()
14359 ; return 0; }
14360 EOF
14361 if { (eval echo configure:14362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14362   rm -rf conftest*
14363   eval "ac_cv_lib_$ac_lib_var=yes"
14364 else
14365   echo "configure: failed program was:" >&5
14366   cat conftest.$ac_ext >&5
14367   rm -rf conftest*
14368   eval "ac_cv_lib_$ac_lib_var=no"
14369 fi
14370 rm -f conftest*
14371 LIBS="$ac_save_LIBS"
14372
14373 fi
14374 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14375   echo "$ac_t""yes" 1>&6
14376   ol_cv_lib_gdbm=-lgdbm
14377 else
14378   echo "$ac_t""no" 1>&6
14379 ol_cv_lib_gdbm=no
14380 fi
14381
14382         
14383 fi
14384
14385         LIBS="$ol_LIBS"
14386
14387 fi
14388
14389 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14390
14391
14392  for ac_hdr in gdbm.h
14393 do
14394 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14395 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14396 echo "configure:14397: checking for $ac_hdr" >&5
14397 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14398   echo $ac_n "(cached) $ac_c" 1>&6
14399 else
14400   cat > conftest.$ac_ext <<EOF
14401 #line 14402 "configure"
14402 #include "confdefs.h"
14403 #include <$ac_hdr>
14404 EOF
14405 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14406 { (eval echo configure:14407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14407 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14408 if test -z "$ac_err"; then
14409   rm -rf conftest*
14410   eval "ac_cv_header_$ac_safe=yes"
14411 else
14412   echo "$ac_err" >&5
14413   echo "configure: failed program was:" >&5
14414   cat conftest.$ac_ext >&5
14415   rm -rf conftest*
14416   eval "ac_cv_header_$ac_safe=no"
14417 fi
14418 rm -f conftest*
14419 fi
14420 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14421   echo "$ac_t""yes" 1>&6
14422     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14423   cat >> confdefs.h <<EOF
14424 #define $ac_tr_hdr 1
14425 EOF
14426  
14427 else
14428   echo "$ac_t""no" 1>&6
14429 fi
14430 done
14431
14432  echo $ac_n "checking for db""... $ac_c" 1>&6
14433 echo "configure:14434: checking for db" >&5
14434 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14435   echo $ac_n "(cached) $ac_c" 1>&6
14436 else
14437   
14438         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14439                 ol_cv_gdbm=no
14440         else
14441                 ol_cv_gdbm=yes
14442         fi
14443
14444 fi
14445
14446 echo "$ac_t""$ol_cv_gdbm" 1>&6
14447  if test $ol_cv_gdbm = yes ; then
14448         cat >> confdefs.h <<\EOF
14449 #define HAVE_GDBM 1
14450 EOF
14451
14452  fi
14453
14454
14455         if test $ol_cv_gdbm = yes ; then
14456                 ol_link_ldbm=gdbm
14457                 ol_with_ldbm_api=gdbm
14458
14459                 if test $ol_cv_lib_gdbm != yes ; then
14460                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14461                 fi
14462         fi
14463 fi
14464
14465 if test $ol_with_ldbm_api = ndbm ; then
14466         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14467 echo "configure:14468: checking for NDBM library" >&5
14468 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14469   echo $ac_n "(cached) $ac_c" 1>&6
14470 else
14471         ol_LIBS="$LIBS"
14472         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14473 echo "configure:14474: checking for dbm_open" >&5
14474 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14475   echo $ac_n "(cached) $ac_c" 1>&6
14476 else
14477   cat > conftest.$ac_ext <<EOF
14478 #line 14479 "configure"
14479 #include "confdefs.h"
14480 /* System header to define __stub macros and hopefully few prototypes,
14481     which can conflict with char dbm_open(); below.  */
14482 #include <assert.h>
14483 /* Override any gcc2 internal prototype to avoid an error.  */
14484 /* We use char because int might match the return type of a gcc2
14485     builtin and then its argument prototype would still apply.  */
14486 char dbm_open();
14487 char (*f)();
14488
14489 int main() {
14490
14491 /* The GNU C library defines this for functions which it implements
14492     to always fail with ENOSYS.  Some functions are actually named
14493     something starting with __ and the normal name is an alias.  */
14494 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14495 choke me
14496 #else
14497 f = dbm_open;
14498 #endif
14499
14500 ; return 0; }
14501 EOF
14502 if { (eval echo configure:14503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14503   rm -rf conftest*
14504   eval "ac_cv_func_dbm_open=yes"
14505 else
14506   echo "configure: failed program was:" >&5
14507   cat conftest.$ac_ext >&5
14508   rm -rf conftest*
14509   eval "ac_cv_func_dbm_open=no"
14510 fi
14511 rm -f conftest*
14512 fi
14513
14514 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14515   echo "$ac_t""yes" 1>&6
14516   ol_cv_lib_ndbm=yes
14517 else
14518   echo "$ac_t""no" 1>&6
14519
14520                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14521 echo "configure:14522: checking for dbm_open in -lndbm" >&5
14522 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14523 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14524   echo $ac_n "(cached) $ac_c" 1>&6
14525 else
14526   ac_save_LIBS="$LIBS"
14527 LIBS="-lndbm  $LIBS"
14528 cat > conftest.$ac_ext <<EOF
14529 #line 14530 "configure"
14530 #include "confdefs.h"
14531 /* Override any gcc2 internal prototype to avoid an error.  */
14532 /* We use char because int might match the return type of a gcc2
14533     builtin and then its argument prototype would still apply.  */
14534 char dbm_open();
14535
14536 int main() {
14537 dbm_open()
14538 ; return 0; }
14539 EOF
14540 if { (eval echo configure:14541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14541   rm -rf conftest*
14542   eval "ac_cv_lib_$ac_lib_var=yes"
14543 else
14544   echo "configure: failed program was:" >&5
14545   cat conftest.$ac_ext >&5
14546   rm -rf conftest*
14547   eval "ac_cv_lib_$ac_lib_var=no"
14548 fi
14549 rm -f conftest*
14550 LIBS="$ac_save_LIBS"
14551
14552 fi
14553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14554   echo "$ac_t""yes" 1>&6
14555   ol_cv_lib_ndbm=-lndbm
14556 else
14557   echo "$ac_t""no" 1>&6
14558
14559                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14560 echo "configure:14561: checking for dbm_open in -ldbm" >&5
14561 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14562 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14563   echo $ac_n "(cached) $ac_c" 1>&6
14564 else
14565   ac_save_LIBS="$LIBS"
14566 LIBS="-ldbm  $LIBS"
14567 cat > conftest.$ac_ext <<EOF
14568 #line 14569 "configure"
14569 #include "confdefs.h"
14570 /* Override any gcc2 internal prototype to avoid an error.  */
14571 /* We use char because int might match the return type of a gcc2
14572     builtin and then its argument prototype would still apply.  */
14573 char dbm_open();
14574
14575 int main() {
14576 dbm_open()
14577 ; return 0; }
14578 EOF
14579 if { (eval echo configure:14580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14580   rm -rf conftest*
14581   eval "ac_cv_lib_$ac_lib_var=yes"
14582 else
14583   echo "configure: failed program was:" >&5
14584   cat conftest.$ac_ext >&5
14585   rm -rf conftest*
14586   eval "ac_cv_lib_$ac_lib_var=no"
14587 fi
14588 rm -f conftest*
14589 LIBS="$ac_save_LIBS"
14590
14591 fi
14592 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14593   echo "$ac_t""yes" 1>&6
14594   ol_cv_lib_ndbm=-ldbm
14595 else
14596   echo "$ac_t""no" 1>&6
14597 ol_cv_lib_ndbm=no
14598 fi
14599                 
14600 fi
14601
14602         
14603 fi
14604
14605         LIBS="$ol_LIBS"
14606
14607 fi
14608
14609 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14610
14611
14612  for ac_hdr in ndbm.h
14613 do
14614 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14615 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14616 echo "configure:14617: checking for $ac_hdr" >&5
14617 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14618   echo $ac_n "(cached) $ac_c" 1>&6
14619 else
14620   cat > conftest.$ac_ext <<EOF
14621 #line 14622 "configure"
14622 #include "confdefs.h"
14623 #include <$ac_hdr>
14624 EOF
14625 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14626 { (eval echo configure:14627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14627 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14628 if test -z "$ac_err"; then
14629   rm -rf conftest*
14630   eval "ac_cv_header_$ac_safe=yes"
14631 else
14632   echo "$ac_err" >&5
14633   echo "configure: failed program was:" >&5
14634   cat conftest.$ac_ext >&5
14635   rm -rf conftest*
14636   eval "ac_cv_header_$ac_safe=no"
14637 fi
14638 rm -f conftest*
14639 fi
14640 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14641   echo "$ac_t""yes" 1>&6
14642     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14643   cat >> confdefs.h <<EOF
14644 #define $ac_tr_hdr 1
14645 EOF
14646  
14647 else
14648   echo "$ac_t""no" 1>&6
14649 fi
14650 done
14651
14652  echo $ac_n "checking for db""... $ac_c" 1>&6
14653 echo "configure:14654: checking for db" >&5
14654 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14655   echo $ac_n "(cached) $ac_c" 1>&6
14656 else
14657   
14658         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14659                 ol_cv_ndbm=no
14660         else
14661                 ol_cv_ndbm=yes
14662         fi
14663
14664 fi
14665
14666 echo "$ac_t""$ol_cv_ndbm" 1>&6
14667  if test $ol_cv_ndbm = yes ; then
14668         cat >> confdefs.h <<\EOF
14669 #define HAVE_NDBM 1
14670 EOF
14671
14672  fi
14673
14674
14675         if test $ol_cv_ndbm = yes ; then
14676                 ol_link_ldbm=ndbm
14677                 ol_with_ldbm_api=ndbm
14678
14679                 if test $ol_cv_lib_ndbm != yes ; then
14680                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14681                 fi
14682         fi
14683 fi
14684
14685 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14686         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14687         if test $ol_enable_ldbm = yes ; then
14688                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14689         fi
14690
14691         echo "configure: warning: disabling LDBM" 1>&2
14692         ol_enable_ldbm=no
14693 fi
14694
14695 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14696         BUILD_LIBS_DYNAMIC=shared
14697         cat >> confdefs.h <<\EOF
14698 #define LDAP_LIBS_DYNAMIC 1
14699 EOF
14700
14701 else
14702         BUILD_LIBS_DYNAMIC=static
14703 fi
14704
14705 if test $ol_enable_wrappers != no ; then
14706         for ac_hdr in tcpd.h
14707 do
14708 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14709 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14710 echo "configure:14711: checking for $ac_hdr" >&5
14711 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14712   echo $ac_n "(cached) $ac_c" 1>&6
14713 else
14714   cat > conftest.$ac_ext <<EOF
14715 #line 14716 "configure"
14716 #include "confdefs.h"
14717 #include <$ac_hdr>
14718 EOF
14719 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14720 { (eval echo configure:14721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14721 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14722 if test -z "$ac_err"; then
14723   rm -rf conftest*
14724   eval "ac_cv_header_$ac_safe=yes"
14725 else
14726   echo "$ac_err" >&5
14727   echo "configure: failed program was:" >&5
14728   cat conftest.$ac_ext >&5
14729   rm -rf conftest*
14730   eval "ac_cv_header_$ac_safe=no"
14731 fi
14732 rm -f conftest*
14733 fi
14734 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14735   echo "$ac_t""yes" 1>&6
14736     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14737   cat >> confdefs.h <<EOF
14738 #define $ac_tr_hdr 1
14739 EOF
14740  
14741 else
14742   echo "$ac_t""no" 1>&6
14743 fi
14744 done
14745
14746
14747         if test $ac_cv_header_tcpd_h != yes ; then
14748                 have_wrappers=no
14749         else
14750                 cat > conftest.$ac_ext <<EOF
14751 #line 14752 "configure"
14752 #include "confdefs.h"
14753
14754 int allow_severity = 0;
14755 int deny_severity  = 0;
14756                 
14757 int main() {
14758 hosts_access()
14759 ; return 0; }
14760 EOF
14761 if { (eval echo configure:14762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14762   rm -rf conftest*
14763   have_wrappers=yes
14764 else
14765   echo "configure: failed program was:" >&5
14766   cat conftest.$ac_ext >&5
14767   rm -rf conftest*
14768   have_wrappers=no
14769 fi
14770 rm -f conftest*
14771         fi
14772
14773         if test $have_wrappers = yes ; then
14774                 cat >> confdefs.h <<\EOF
14775 #define HAVE_TCPD 1
14776 EOF
14777
14778                 WRAP_LIBS="-lwrap"
14779
14780                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14781 echo "configure:14782: checking for main in -lnsl" >&5
14782 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14783 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14784   echo $ac_n "(cached) $ac_c" 1>&6
14785 else
14786   ac_save_LIBS="$LIBS"
14787 LIBS="-lnsl  $LIBS"
14788 cat > conftest.$ac_ext <<EOF
14789 #line 14790 "configure"
14790 #include "confdefs.h"
14791
14792 int main() {
14793 main()
14794 ; return 0; }
14795 EOF
14796 if { (eval echo configure:14797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14797   rm -rf conftest*
14798   eval "ac_cv_lib_$ac_lib_var=yes"
14799 else
14800   echo "configure: failed program was:" >&5
14801   cat conftest.$ac_ext >&5
14802   rm -rf conftest*
14803   eval "ac_cv_lib_$ac_lib_var=no"
14804 fi
14805 rm -f conftest*
14806 LIBS="$ac_save_LIBS"
14807
14808 fi
14809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14810   echo "$ac_t""yes" 1>&6
14811     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14812     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14813   cat >> confdefs.h <<EOF
14814 #define $ac_tr_lib 1
14815 EOF
14816
14817   LIBS="-lnsl $LIBS"
14818
14819 else
14820   echo "$ac_t""no" 1>&6
14821 fi
14822
14823         else
14824                 echo "configure: warning: could not find -lwrap" 1>&2
14825                 if test $ol_enable_wrappers = yes ; then
14826                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14827                 fi
14828
14829                 echo "configure: warning: disabling wrappers support" 1>&2
14830                 ol_enable_wrappers=no
14831                 WRAP_LIBS=""
14832         fi
14833 fi
14834
14835 if test $ol_enable_syslog != no ; then
14836         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14837 echo "configure:14838: checking for openlog" >&5
14838 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14839   echo $ac_n "(cached) $ac_c" 1>&6
14840 else
14841   cat > conftest.$ac_ext <<EOF
14842 #line 14843 "configure"
14843 #include "confdefs.h"
14844 /* System header to define __stub macros and hopefully few prototypes,
14845     which can conflict with char openlog(); below.  */
14846 #include <assert.h>
14847 /* Override any gcc2 internal prototype to avoid an error.  */
14848 /* We use char because int might match the return type of a gcc2
14849     builtin and then its argument prototype would still apply.  */
14850 char openlog();
14851 char (*f)();
14852
14853 int main() {
14854
14855 /* The GNU C library defines this for functions which it implements
14856     to always fail with ENOSYS.  Some functions are actually named
14857     something starting with __ and the normal name is an alias.  */
14858 #if defined (__stub_openlog) || defined (__stub___openlog)
14859 choke me
14860 #else
14861 f = openlog;
14862 #endif
14863
14864 ; return 0; }
14865 EOF
14866 if { (eval echo configure:14867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14867   rm -rf conftest*
14868   eval "ac_cv_func_openlog=yes"
14869 else
14870   echo "configure: failed program was:" >&5
14871   cat conftest.$ac_ext >&5
14872   rm -rf conftest*
14873   eval "ac_cv_func_openlog=no"
14874 fi
14875 rm -f conftest*
14876 fi
14877
14878 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14879   echo "$ac_t""yes" 1>&6
14880   :
14881 else
14882   echo "$ac_t""no" 1>&6
14883 fi
14884
14885         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14886                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14887         fi
14888         ol_enable_syslog=$ac_cv_func_openlog
14889 fi
14890
14891
14892 ol_link_sql=no
14893 if test $ol_enable_sql != no ; then
14894         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14895 echo "configure:14896: checking for SQLDriverConnect in -liodbc" >&5
14896 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14897 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14898   echo $ac_n "(cached) $ac_c" 1>&6
14899 else
14900   ac_save_LIBS="$LIBS"
14901 LIBS="-liodbc  $LIBS"
14902 cat > conftest.$ac_ext <<EOF
14903 #line 14904 "configure"
14904 #include "confdefs.h"
14905 /* Override any gcc2 internal prototype to avoid an error.  */
14906 /* We use char because int might match the return type of a gcc2
14907     builtin and then its argument prototype would still apply.  */
14908 char SQLDriverConnect();
14909
14910 int main() {
14911 SQLDriverConnect()
14912 ; return 0; }
14913 EOF
14914 if { (eval echo configure:14915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14915   rm -rf conftest*
14916   eval "ac_cv_lib_$ac_lib_var=yes"
14917 else
14918   echo "configure: failed program was:" >&5
14919   cat conftest.$ac_ext >&5
14920   rm -rf conftest*
14921   eval "ac_cv_lib_$ac_lib_var=no"
14922 fi
14923 rm -f conftest*
14924 LIBS="$ac_save_LIBS"
14925
14926 fi
14927 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14928   echo "$ac_t""yes" 1>&6
14929   have_iodbc=yes
14930 else
14931   echo "$ac_t""no" 1>&6
14932 have_iodbc=no
14933 fi
14934
14935         if test $have_iodbc = yes ; then
14936                 ol_link_sql="-liodbc"
14937         else
14938                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14939 echo "configure:14940: checking for SQLDriverConnect in -lodbc" >&5
14940 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14941 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14942   echo $ac_n "(cached) $ac_c" 1>&6
14943 else
14944   ac_save_LIBS="$LIBS"
14945 LIBS="-lodbc  $LIBS"
14946 cat > conftest.$ac_ext <<EOF
14947 #line 14948 "configure"
14948 #include "confdefs.h"
14949 /* Override any gcc2 internal prototype to avoid an error.  */
14950 /* We use char because int might match the return type of a gcc2
14951     builtin and then its argument prototype would still apply.  */
14952 char SQLDriverConnect();
14953
14954 int main() {
14955 SQLDriverConnect()
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   eval "ac_cv_lib_$ac_lib_var=yes"
14961 else
14962   echo "configure: failed program was:" >&5
14963   cat conftest.$ac_ext >&5
14964   rm -rf conftest*
14965   eval "ac_cv_lib_$ac_lib_var=no"
14966 fi
14967 rm -f conftest*
14968 LIBS="$ac_save_LIBS"
14969
14970 fi
14971 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14972   echo "$ac_t""yes" 1>&6
14973   have_odbc=yes
14974 else
14975   echo "$ac_t""no" 1>&6
14976 have_odbc=no
14977 fi
14978
14979                 if test $have_odbc = yes ; then
14980                         ol_link_sql="-lodbc"
14981                 fi
14982         fi
14983
14984         if test $ol_link_sql != no ; then
14985                 SLAPD_SQL_LIBS="$ol_link_sql"
14986
14987         elif test $ol_enable_sql != auto ; then
14988                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14989         fi
14990 fi
14991
14992 if test $ol_enable_tcl != no ; then
14993         for ac_hdr in tcl.h
14994 do
14995 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14996 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14997 echo "configure:14998: checking for $ac_hdr" >&5
14998 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14999   echo $ac_n "(cached) $ac_c" 1>&6
15000 else
15001   cat > conftest.$ac_ext <<EOF
15002 #line 15003 "configure"
15003 #include "confdefs.h"
15004 #include <$ac_hdr>
15005 EOF
15006 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15007 { (eval echo configure:15008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15008 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15009 if test -z "$ac_err"; then
15010   rm -rf conftest*
15011   eval "ac_cv_header_$ac_safe=yes"
15012 else
15013   echo "$ac_err" >&5
15014   echo "configure: failed program was:" >&5
15015   cat conftest.$ac_ext >&5
15016   rm -rf conftest*
15017   eval "ac_cv_header_$ac_safe=no"
15018 fi
15019 rm -f conftest*
15020 fi
15021 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15022   echo "$ac_t""yes" 1>&6
15023     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15024   cat >> confdefs.h <<EOF
15025 #define $ac_tr_hdr 1
15026 EOF
15027  
15028 else
15029   echo "$ac_t""no" 1>&6
15030 fi
15031 done
15032
15033
15034         if test $ac_cv_header_tcl_h != yes ; then
15035                 have_tcl=no
15036         else
15037                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
15038                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
15039 echo "configure:15040: checking for main in -l$lib" >&5
15040 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
15041 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15042   echo $ac_n "(cached) $ac_c" 1>&6
15043 else
15044   ac_save_LIBS="$LIBS"
15045 LIBS="-l$lib  $LIBS"
15046 cat > conftest.$ac_ext <<EOF
15047 #line 15048 "configure"
15048 #include "confdefs.h"
15049
15050 int main() {
15051 main()
15052 ; return 0; }
15053 EOF
15054 if { (eval echo configure:15055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15055   rm -rf conftest*
15056   eval "ac_cv_lib_$ac_lib_var=yes"
15057 else
15058   echo "configure: failed program was:" >&5
15059   cat conftest.$ac_ext >&5
15060   rm -rf conftest*
15061   eval "ac_cv_lib_$ac_lib_var=no"
15062 fi
15063 rm -f conftest*
15064 LIBS="$ac_save_LIBS"
15065
15066 fi
15067 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15068   echo "$ac_t""yes" 1>&6
15069   have_tcl=yes
15070                            if test x"$ol_with_tcl_module" = "xstatic" ; then
15071                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
15072                            else
15073                                         MOD_TCL_LIB="-l${lib}"
15074                            fi;break
15075 else
15076   echo "$ac_t""no" 1>&6
15077 have_tcl=no
15078 fi
15079
15080                 done
15081         fi
15082
15083         if test $have_tcl != yes ; then
15084                 echo "configure: warning: could not find -ltcl" 1>&2
15085                 if test $ol_enable_tcl = yes ; then
15086                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
15087                 fi
15088
15089                 ol_enable_tcl=no
15090         fi
15091 fi
15092
15093 ol_link_termcap=no
15094 for ac_hdr in termcap.h ncurses.h
15095 do
15096 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15097 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15098 echo "configure:15099: checking for $ac_hdr" >&5
15099 if eval "test \"\${ac_cv_header_$ac_safe+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 #include <$ac_hdr>
15106 EOF
15107 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15108 { (eval echo configure:15109: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15109 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15110 if test -z "$ac_err"; then
15111   rm -rf conftest*
15112   eval "ac_cv_header_$ac_safe=yes"
15113 else
15114   echo "$ac_err" >&5
15115   echo "configure: failed program was:" >&5
15116   cat conftest.$ac_ext >&5
15117   rm -rf conftest*
15118   eval "ac_cv_header_$ac_safe=no"
15119 fi
15120 rm -f conftest*
15121 fi
15122 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15123   echo "$ac_t""yes" 1>&6
15124     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15125   cat >> confdefs.h <<EOF
15126 #define $ac_tr_hdr 1
15127 EOF
15128  
15129 else
15130   echo "$ac_t""no" 1>&6
15131 fi
15132 done
15133
15134
15135 if test $ol_link_termcap = no ; then
15136         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
15137 echo "configure:15138: checking for tputs in -ltermcap" >&5
15138 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
15139 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15140   echo $ac_n "(cached) $ac_c" 1>&6
15141 else
15142   ac_save_LIBS="$LIBS"
15143 LIBS="-ltermcap  $LIBS"
15144 cat > conftest.$ac_ext <<EOF
15145 #line 15146 "configure"
15146 #include "confdefs.h"
15147 /* Override any gcc2 internal prototype to avoid an error.  */
15148 /* We use char because int might match the return type of a gcc2
15149     builtin and then its argument prototype would still apply.  */
15150 char tputs();
15151
15152 int main() {
15153 tputs()
15154 ; return 0; }
15155 EOF
15156 if { (eval echo configure:15157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15157   rm -rf conftest*
15158   eval "ac_cv_lib_$ac_lib_var=yes"
15159 else
15160   echo "configure: failed program was:" >&5
15161   cat conftest.$ac_ext >&5
15162   rm -rf conftest*
15163   eval "ac_cv_lib_$ac_lib_var=no"
15164 fi
15165 rm -f conftest*
15166 LIBS="$ac_save_LIBS"
15167
15168 fi
15169 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15170   echo "$ac_t""yes" 1>&6
15171   have_termcap=yes
15172 else
15173   echo "$ac_t""no" 1>&6
15174 have_termcap=no
15175 fi
15176
15177         if test $have_termcap = yes ; then
15178                 cat >> confdefs.h <<\EOF
15179 #define HAVE_TERMCAP 1
15180 EOF
15181
15182                 ol_link_termcap=yes
15183                 TERMCAP_LIBS=-ltermcap
15184         fi
15185 fi
15186
15187 if test $ol_link_termcap = no ; then
15188         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
15189 echo "configure:15190: checking for initscr in -lncurses" >&5
15190 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
15191 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15192   echo $ac_n "(cached) $ac_c" 1>&6
15193 else
15194   ac_save_LIBS="$LIBS"
15195 LIBS="-lncurses  $LIBS"
15196 cat > conftest.$ac_ext <<EOF
15197 #line 15198 "configure"
15198 #include "confdefs.h"
15199 /* Override any gcc2 internal prototype to avoid an error.  */
15200 /* We use char because int might match the return type of a gcc2
15201     builtin and then its argument prototype would still apply.  */
15202 char initscr();
15203
15204 int main() {
15205 initscr()
15206 ; return 0; }
15207 EOF
15208 if { (eval echo configure:15209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15209   rm -rf conftest*
15210   eval "ac_cv_lib_$ac_lib_var=yes"
15211 else
15212   echo "configure: failed program was:" >&5
15213   cat conftest.$ac_ext >&5
15214   rm -rf conftest*
15215   eval "ac_cv_lib_$ac_lib_var=no"
15216 fi
15217 rm -f conftest*
15218 LIBS="$ac_save_LIBS"
15219
15220 fi
15221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15222   echo "$ac_t""yes" 1>&6
15223   have_ncurses=yes
15224 else
15225   echo "$ac_t""no" 1>&6
15226 have_ncurses=no
15227 fi
15228
15229         if test $have_ncurses = yes ; then
15230                 cat >> confdefs.h <<\EOF
15231 #define HAVE_NCURSES 1
15232 EOF
15233
15234                 ol_link_termcap=yes
15235                 TERMCAP_LIBS=-lncurses
15236         fi
15237 fi
15238
15239 if test $ol_link_termcap = no ; then
15240         cat >> confdefs.h <<\EOF
15241 #define NO_TERMCAP 1
15242 EOF
15243
15244         TERMCAP_LIBS=
15245 fi
15246
15247 ol_link_sasl=no
15248 ol_link_spasswd=no
15249 if test $ol_with_cyrus_sasl != no ; then
15250         for ac_hdr in sasl.h
15251 do
15252 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15253 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15254 echo "configure:15255: checking for $ac_hdr" >&5
15255 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15256   echo $ac_n "(cached) $ac_c" 1>&6
15257 else
15258   cat > conftest.$ac_ext <<EOF
15259 #line 15260 "configure"
15260 #include "confdefs.h"
15261 #include <$ac_hdr>
15262 EOF
15263 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15264 { (eval echo configure:15265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15265 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15266 if test -z "$ac_err"; then
15267   rm -rf conftest*
15268   eval "ac_cv_header_$ac_safe=yes"
15269 else
15270   echo "$ac_err" >&5
15271   echo "configure: failed program was:" >&5
15272   cat conftest.$ac_ext >&5
15273   rm -rf conftest*
15274   eval "ac_cv_header_$ac_safe=no"
15275 fi
15276 rm -f conftest*
15277 fi
15278 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15279   echo "$ac_t""yes" 1>&6
15280     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15281   cat >> confdefs.h <<EOF
15282 #define $ac_tr_hdr 1
15283 EOF
15284  
15285 else
15286   echo "$ac_t""no" 1>&6
15287 fi
15288 done
15289
15290
15291         if test $ac_cv_header_sasl_h = yes ; then
15292                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15293 echo "configure:15294: checking for sasl_client_init in -lsasl" >&5
15294 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15295 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15296   echo $ac_n "(cached) $ac_c" 1>&6
15297 else
15298   ac_save_LIBS="$LIBS"
15299 LIBS="-lsasl  $LIBS"
15300 cat > conftest.$ac_ext <<EOF
15301 #line 15302 "configure"
15302 #include "confdefs.h"
15303 /* Override any gcc2 internal prototype to avoid an error.  */
15304 /* We use char because int might match the return type of a gcc2
15305     builtin and then its argument prototype would still apply.  */
15306 char sasl_client_init();
15307
15308 int main() {
15309 sasl_client_init()
15310 ; return 0; }
15311 EOF
15312 if { (eval echo configure:15313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15313   rm -rf conftest*
15314   eval "ac_cv_lib_$ac_lib_var=yes"
15315 else
15316   echo "configure: failed program was:" >&5
15317   cat conftest.$ac_ext >&5
15318   rm -rf conftest*
15319   eval "ac_cv_lib_$ac_lib_var=no"
15320 fi
15321 rm -f conftest*
15322 LIBS="$ac_save_LIBS"
15323
15324 fi
15325 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15326   echo "$ac_t""yes" 1>&6
15327   have_cyrus_sasl=yes
15328 else
15329   echo "$ac_t""no" 1>&6
15330 have_cyrus_sasl=no
15331 fi
15332
15333
15334                 if test $have_cyrus_sasl != no ; then
15335                         SASL_LIBS="-lsasl"
15336                         cat >> confdefs.h <<\EOF
15337 #define HAVE_CYRUS_SASL 1
15338 EOF
15339
15340                         ol_link_sasl=yes
15341                 fi
15342         fi
15343
15344         if test $ol_link_sasl = no ; then
15345                 if test $ol_with_cyrus_sasl != auto ; then
15346                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15347                 else
15348                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15349                         echo "configure: warning: SASL authentication not supported!" 1>&2
15350                         if test $ol_link_tls = no ; then
15351                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15352                         fi
15353                 fi
15354
15355         elif test $ol_enable_spasswd != no ; then
15356                 ol_link_spasswd=yes
15357         fi
15358
15359 else
15360         echo "configure: warning: SASL authentication not supported!" 1>&2
15361         if test $ol_link_tls = no ; then
15362                 echo "configure: warning: Strong authentication not supported!" 1>&2
15363         fi
15364 fi
15365
15366 if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
15367         dev=no
15368         if test -r /dev/urandom ; then
15369                 dev="/dev/urandom";
15370         elif test -r /idev/urandom ; then
15371                 dev="/idev/urandom";
15372         elif test -r /dev/srandom ; then
15373                 dev="/dev/srandom";
15374         elif test -r /dev/random ; then
15375                 dev="/dev/random";
15376         elif test -r /idev/random ; then
15377                 dev="/idev/random";
15378         fi
15379
15380         if test $dev != no ; then
15381                 cat >> confdefs.h <<EOF
15382 #define URANDOM_DEVICE "$dev"
15383 EOF
15384
15385         fi
15386 fi
15387
15388 ol_link_fetch=no
15389 if test $ol_with_fetch != no ; then
15390         ol_LIBS=$LIBS
15391 LIBS="-lfetch -lcom_err $LIBS"
15392 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15393 echo "configure:15394: checking fetch(3) library" >&5
15394 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15395   echo $ac_n "(cached) $ac_c" 1>&6
15396 else
15397   
15398         cat > conftest.$ac_ext <<EOF
15399 #line 15400 "configure"
15400 #include "confdefs.h"
15401
15402 #include <sys/param.h>
15403 #include <stdio.h>
15404 #include <fetch.h>
15405 int main() {
15406 struct url *u = fetchParseURL("file:///"); 
15407 ; return 0; }
15408 EOF
15409 if { (eval echo configure:15410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15410   rm -rf conftest*
15411   ol_cv_lib_fetch=yes
15412 else
15413   echo "configure: failed program was:" >&5
15414   cat conftest.$ac_ext >&5
15415   rm -rf conftest*
15416   ol_cv_lib_fetch=no
15417 fi
15418 rm -f conftest*
15419 fi
15420
15421 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15422 LIBS=$ol_LIBS
15423 if test $ol_cv_lib_fetch != no ; then
15424         ol_link_fetch="-lfetch -lcom_err"
15425         cat >> confdefs.h <<\EOF
15426 #define HAVE_FETCH 1
15427 EOF
15428
15429 fi
15430
15431
15432         if test $ol_cv_lib_fetch != no ; then
15433                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15434                 ol_link_fetch=freebsd
15435
15436         elif test $ol_with_fetch != auto ; then
15437                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15438         fi 
15439 fi
15440
15441 ol_link_readline=no
15442 if test $ol_with_readline != no ; then
15443         for ac_hdr in readline/readline.h readline/history.h
15444 do
15445 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15446 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15447 echo "configure:15448: checking for $ac_hdr" >&5
15448 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15449   echo $ac_n "(cached) $ac_c" 1>&6
15450 else
15451   cat > conftest.$ac_ext <<EOF
15452 #line 15453 "configure"
15453 #include "confdefs.h"
15454 #include <$ac_hdr>
15455 EOF
15456 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15457 { (eval echo configure:15458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15458 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15459 if test -z "$ac_err"; then
15460   rm -rf conftest*
15461   eval "ac_cv_header_$ac_safe=yes"
15462 else
15463   echo "$ac_err" >&5
15464   echo "configure: failed program was:" >&5
15465   cat conftest.$ac_ext >&5
15466   rm -rf conftest*
15467   eval "ac_cv_header_$ac_safe=no"
15468 fi
15469 rm -f conftest*
15470 fi
15471 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15472   echo "$ac_t""yes" 1>&6
15473     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15474   cat >> confdefs.h <<EOF
15475 #define $ac_tr_hdr 1
15476 EOF
15477  
15478 else
15479   echo "$ac_t""no" 1>&6
15480 fi
15481 done
15482
15483
15484         if test $ac_cv_header_readline_readline_h = yes ; then
15485                 save_LIBS="$LIBS"
15486                 LIBS="$TERMCAP_LIBS $LIBS"
15487                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15488 echo "configure:15489: checking for readline in -lreadline" >&5
15489 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15490 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15491   echo $ac_n "(cached) $ac_c" 1>&6
15492 else
15493   ac_save_LIBS="$LIBS"
15494 LIBS="-lreadline  $LIBS"
15495 cat > conftest.$ac_ext <<EOF
15496 #line 15497 "configure"
15497 #include "confdefs.h"
15498 /* Override any gcc2 internal prototype to avoid an error.  */
15499 /* We use char because int might match the return type of a gcc2
15500     builtin and then its argument prototype would still apply.  */
15501 char readline();
15502
15503 int main() {
15504 readline()
15505 ; return 0; }
15506 EOF
15507 if { (eval echo configure:15508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15508   rm -rf conftest*
15509   eval "ac_cv_lib_$ac_lib_var=yes"
15510 else
15511   echo "configure: failed program was:" >&5
15512   cat conftest.$ac_ext >&5
15513   rm -rf conftest*
15514   eval "ac_cv_lib_$ac_lib_var=no"
15515 fi
15516 rm -f conftest*
15517 LIBS="$ac_save_LIBS"
15518
15519 fi
15520 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15521   echo "$ac_t""yes" 1>&6
15522   have_readline=yes
15523 else
15524   echo "$ac_t""no" 1>&6
15525 have_readline=no
15526 fi
15527
15528                 LIBS="$save_LIBS"
15529                         
15530                 if test $have_readline = yes ; then
15531                         ol_with_readline=found
15532                         ol_link_readline=yes
15533
15534                         READLINE_LIBS="-lreadline"
15535                 fi
15536         fi
15537 fi
15538
15539 if test $ol_link_readline = yes ; then
15540         cat >> confdefs.h <<\EOF
15541 #define HAVE_READLINE 1
15542 EOF
15543
15544 fi
15545
15546
15547 if test $ol_enable_crypt != no ; then
15548         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15549 echo "configure:15550: checking for crypt" >&5
15550 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15551   echo $ac_n "(cached) $ac_c" 1>&6
15552 else
15553   cat > conftest.$ac_ext <<EOF
15554 #line 15555 "configure"
15555 #include "confdefs.h"
15556 /* System header to define __stub macros and hopefully few prototypes,
15557     which can conflict with char crypt(); below.  */
15558 #include <assert.h>
15559 /* Override any gcc2 internal prototype to avoid an error.  */
15560 /* We use char because int might match the return type of a gcc2
15561     builtin and then its argument prototype would still apply.  */
15562 char crypt();
15563 char (*f)();
15564
15565 int main() {
15566
15567 /* The GNU C library defines this for functions which it implements
15568     to always fail with ENOSYS.  Some functions are actually named
15569     something starting with __ and the normal name is an alias.  */
15570 #if defined (__stub_crypt) || defined (__stub___crypt)
15571 choke me
15572 #else
15573 f = crypt;
15574 #endif
15575
15576 ; return 0; }
15577 EOF
15578 if { (eval echo configure:15579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15579   rm -rf conftest*
15580   eval "ac_cv_func_crypt=yes"
15581 else
15582   echo "configure: failed program was:" >&5
15583   cat conftest.$ac_ext >&5
15584   rm -rf conftest*
15585   eval "ac_cv_func_crypt=no"
15586 fi
15587 rm -f conftest*
15588 fi
15589
15590 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15591   echo "$ac_t""yes" 1>&6
15592   have_crypt=yes
15593 else
15594   echo "$ac_t""no" 1>&6
15595
15596                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15597 echo "configure:15598: checking for crypt in -lcrypt" >&5
15598 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15599 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15600   echo $ac_n "(cached) $ac_c" 1>&6
15601 else
15602   ac_save_LIBS="$LIBS"
15603 LIBS="-lcrypt  $LIBS"
15604 cat > conftest.$ac_ext <<EOF
15605 #line 15606 "configure"
15606 #include "confdefs.h"
15607 /* Override any gcc2 internal prototype to avoid an error.  */
15608 /* We use char because int might match the return type of a gcc2
15609     builtin and then its argument prototype would still apply.  */
15610 char crypt();
15611
15612 int main() {
15613 crypt()
15614 ; return 0; }
15615 EOF
15616 if { (eval echo configure:15617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15617   rm -rf conftest*
15618   eval "ac_cv_lib_$ac_lib_var=yes"
15619 else
15620   echo "configure: failed program was:" >&5
15621   cat conftest.$ac_ext >&5
15622   rm -rf conftest*
15623   eval "ac_cv_lib_$ac_lib_var=no"
15624 fi
15625 rm -f conftest*
15626 LIBS="$ac_save_LIBS"
15627
15628 fi
15629 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15630   echo "$ac_t""yes" 1>&6
15631   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15632                         have_crypt=yes
15633 else
15634   echo "$ac_t""no" 1>&6
15635 have_crypt=no
15636 fi
15637
15638 fi
15639
15640
15641         if test $have_crypt = yes ; then
15642                 cat >> confdefs.h <<\EOF
15643 #define HAVE_CRYPT 1
15644 EOF
15645
15646         else
15647                 echo "configure: warning: could not find crypt" 1>&2
15648                 if test $ol_enable_crypt = yes ; then
15649                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15650                 fi
15651
15652                 echo "configure: warning: disabling crypt support" 1>&2
15653                 ol_enable_crypt=no
15654         fi
15655 fi
15656
15657 if test $ol_enable_proctitle != no ; then
15658         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15659 echo "configure:15660: checking for setproctitle" >&5
15660 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15661   echo $ac_n "(cached) $ac_c" 1>&6
15662 else
15663   cat > conftest.$ac_ext <<EOF
15664 #line 15665 "configure"
15665 #include "confdefs.h"
15666 /* System header to define __stub macros and hopefully few prototypes,
15667     which can conflict with char setproctitle(); below.  */
15668 #include <assert.h>
15669 /* Override any gcc2 internal prototype to avoid an error.  */
15670 /* We use char because int might match the return type of a gcc2
15671     builtin and then its argument prototype would still apply.  */
15672 char setproctitle();
15673 char (*f)();
15674
15675 int main() {
15676
15677 /* The GNU C library defines this for functions which it implements
15678     to always fail with ENOSYS.  Some functions are actually named
15679     something starting with __ and the normal name is an alias.  */
15680 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15681 choke me
15682 #else
15683 f = setproctitle;
15684 #endif
15685
15686 ; return 0; }
15687 EOF
15688 if { (eval echo configure:15689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15689   rm -rf conftest*
15690   eval "ac_cv_func_setproctitle=yes"
15691 else
15692   echo "configure: failed program was:" >&5
15693   cat conftest.$ac_ext >&5
15694   rm -rf conftest*
15695   eval "ac_cv_func_setproctitle=no"
15696 fi
15697 rm -f conftest*
15698 fi
15699
15700 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15701   echo "$ac_t""yes" 1>&6
15702   have_setproctitle=yes
15703 else
15704   echo "$ac_t""no" 1>&6
15705
15706                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15707 echo "configure:15708: checking for setproctitle in -lutil" >&5
15708 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15709 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15710   echo $ac_n "(cached) $ac_c" 1>&6
15711 else
15712   ac_save_LIBS="$LIBS"
15713 LIBS="-lutil  $LIBS"
15714 cat > conftest.$ac_ext <<EOF
15715 #line 15716 "configure"
15716 #include "confdefs.h"
15717 /* Override any gcc2 internal prototype to avoid an error.  */
15718 /* We use char because int might match the return type of a gcc2
15719     builtin and then its argument prototype would still apply.  */
15720 char setproctitle();
15721
15722 int main() {
15723 setproctitle()
15724 ; return 0; }
15725 EOF
15726 if { (eval echo configure:15727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15727   rm -rf conftest*
15728   eval "ac_cv_lib_$ac_lib_var=yes"
15729 else
15730   echo "configure: failed program was:" >&5
15731   cat conftest.$ac_ext >&5
15732   rm -rf conftest*
15733   eval "ac_cv_lib_$ac_lib_var=no"
15734 fi
15735 rm -f conftest*
15736 LIBS="$ac_save_LIBS"
15737
15738 fi
15739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15740   echo "$ac_t""yes" 1>&6
15741   have_setproctitle=yes
15742                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15743 else
15744   echo "$ac_t""no" 1>&6
15745 have_setproctitle=no
15746                         LIBOBJS="$LIBOBJS setproctitle.o"
15747                         LIBSRCS="$LIBSRCS setproctitle.c"
15748 fi
15749
15750 fi
15751
15752
15753         if test $have_setproctitle = yes ; then
15754                 cat >> confdefs.h <<\EOF
15755 #define HAVE_SETPROCTITLE 1
15756 EOF
15757
15758         fi
15759 fi
15760
15761 if test $ol_enable_slp != no ; then
15762         for ac_hdr in slp.h 
15763 do
15764 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15765 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15766 echo "configure:15767: checking for $ac_hdr" >&5
15767 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15768   echo $ac_n "(cached) $ac_c" 1>&6
15769 else
15770   cat > conftest.$ac_ext <<EOF
15771 #line 15772 "configure"
15772 #include "confdefs.h"
15773 #include <$ac_hdr>
15774 EOF
15775 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15776 { (eval echo configure:15777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15777 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15778 if test -z "$ac_err"; then
15779   rm -rf conftest*
15780   eval "ac_cv_header_$ac_safe=yes"
15781 else
15782   echo "$ac_err" >&5
15783   echo "configure: failed program was:" >&5
15784   cat conftest.$ac_ext >&5
15785   rm -rf conftest*
15786   eval "ac_cv_header_$ac_safe=no"
15787 fi
15788 rm -f conftest*
15789 fi
15790 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15791   echo "$ac_t""yes" 1>&6
15792     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15793   cat >> confdefs.h <<EOF
15794 #define $ac_tr_hdr 1
15795 EOF
15796  
15797 else
15798   echo "$ac_t""no" 1>&6
15799 fi
15800 done
15801
15802
15803         if test $ac_cv_header_slp_h = yes ; then
15804                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15805 echo "configure:15806: checking for SLPOpen in -lslp" >&5
15806 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15807 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15808   echo $ac_n "(cached) $ac_c" 1>&6
15809 else
15810   ac_save_LIBS="$LIBS"
15811 LIBS="-lslp  $LIBS"
15812 cat > conftest.$ac_ext <<EOF
15813 #line 15814 "configure"
15814 #include "confdefs.h"
15815 /* Override any gcc2 internal prototype to avoid an error.  */
15816 /* We use char because int might match the return type of a gcc2
15817     builtin and then its argument prototype would still apply.  */
15818 char SLPOpen();
15819
15820 int main() {
15821 SLPOpen()
15822 ; return 0; }
15823 EOF
15824 if { (eval echo configure:15825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15825   rm -rf conftest*
15826   eval "ac_cv_lib_$ac_lib_var=yes"
15827 else
15828   echo "configure: failed program was:" >&5
15829   cat conftest.$ac_ext >&5
15830   rm -rf conftest*
15831   eval "ac_cv_lib_$ac_lib_var=no"
15832 fi
15833 rm -f conftest*
15834 LIBS="$ac_save_LIBS"
15835
15836 fi
15837 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15838   echo "$ac_t""yes" 1>&6
15839   have_slp=yes
15840 else
15841   echo "$ac_t""no" 1>&6
15842 have_slp=no
15843 fi
15844
15845                 if test $have_slp = yes ; then
15846                         cat >> confdefs.h <<\EOF
15847 #define HAVE_SLP 1
15848 EOF
15849
15850                         SLAPD_SLP_LIBS=-lslp
15851                 fi
15852
15853         elif test $ol_enable_slp = yes ; then
15854                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15855         fi
15856 fi
15857
15858 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15859 echo "configure:15860: checking for ANSI C header files" >&5
15860 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15861   echo $ac_n "(cached) $ac_c" 1>&6
15862 else
15863   cat > conftest.$ac_ext <<EOF
15864 #line 15865 "configure"
15865 #include "confdefs.h"
15866 #include <stdlib.h>
15867 #include <stdarg.h>
15868 #include <string.h>
15869 #include <float.h>
15870 EOF
15871 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15872 { (eval echo configure:15873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15873 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15874 if test -z "$ac_err"; then
15875   rm -rf conftest*
15876   ac_cv_header_stdc=yes
15877 else
15878   echo "$ac_err" >&5
15879   echo "configure: failed program was:" >&5
15880   cat conftest.$ac_ext >&5
15881   rm -rf conftest*
15882   ac_cv_header_stdc=no
15883 fi
15884 rm -f conftest*
15885
15886 if test $ac_cv_header_stdc = yes; then
15887   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15888 cat > conftest.$ac_ext <<EOF
15889 #line 15890 "configure"
15890 #include "confdefs.h"
15891 #include <string.h>
15892 EOF
15893 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15894   egrep "memchr" >/dev/null 2>&1; then
15895   :
15896 else
15897   rm -rf conftest*
15898   ac_cv_header_stdc=no
15899 fi
15900 rm -f conftest*
15901
15902 fi
15903
15904 if test $ac_cv_header_stdc = yes; then
15905   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15906 cat > conftest.$ac_ext <<EOF
15907 #line 15908 "configure"
15908 #include "confdefs.h"
15909 #include <stdlib.h>
15910 EOF
15911 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15912   egrep "free" >/dev/null 2>&1; then
15913   :
15914 else
15915   rm -rf conftest*
15916   ac_cv_header_stdc=no
15917 fi
15918 rm -f conftest*
15919
15920 fi
15921
15922 if test $ac_cv_header_stdc = yes; then
15923   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15924 if test "$cross_compiling" = yes; then
15925   :
15926 else
15927   cat > conftest.$ac_ext <<EOF
15928 #line 15929 "configure"
15929 #include "confdefs.h"
15930 #include <ctype.h>
15931 #if ((' ' & 0x0FF) == 0x020)
15932 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15933 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15934 #else
15935 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15936  || ('j' <= (c) && (c) <= 'r') \
15937  || ('s' <= (c) && (c) <= 'z'))
15938 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15939 #endif
15940 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15941 int main () { int i; for (i = 0; i < 256; i++)
15942 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15943 exit (0); }
15944
15945 EOF
15946 if { (eval echo configure:15947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15947 then
15948   :
15949 else
15950   echo "configure: failed program was:" >&5
15951   cat conftest.$ac_ext >&5
15952   rm -fr conftest*
15953   ac_cv_header_stdc=no
15954 fi
15955 rm -fr conftest*
15956 fi
15957
15958 fi
15959 fi
15960
15961 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15962 if test $ac_cv_header_stdc = yes; then
15963   cat >> confdefs.h <<\EOF
15964 #define STDC_HEADERS 1
15965 EOF
15966
15967 fi
15968
15969 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15970 echo "configure:15971: checking for mode_t" >&5
15971 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15972   echo $ac_n "(cached) $ac_c" 1>&6
15973 else
15974   cat > conftest.$ac_ext <<EOF
15975 #line 15976 "configure"
15976 #include "confdefs.h"
15977 #include <sys/types.h>
15978 #if STDC_HEADERS
15979 #include <stdlib.h>
15980 #include <stddef.h>
15981 #endif
15982
15983 EOF
15984 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15985   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15986   rm -rf conftest*
15987   eval "ac_cv_type_mode_t=yes"
15988 else
15989   rm -rf conftest*
15990   eval "ac_cv_type_mode_t=no"
15991 fi
15992 rm -f conftest*
15993
15994 fi
15995 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15996   echo "$ac_t""yes" 1>&6
15997 else
15998   echo "$ac_t""no" 1>&6
15999   cat >> confdefs.h <<EOF
16000 #define mode_t int
16001 EOF
16002
16003 fi
16004
16005 echo $ac_n "checking for off_t""... $ac_c" 1>&6
16006 echo "configure:16007: checking for off_t" >&5
16007 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
16008   echo $ac_n "(cached) $ac_c" 1>&6
16009 else
16010   cat > conftest.$ac_ext <<EOF
16011 #line 16012 "configure"
16012 #include "confdefs.h"
16013 #include <sys/types.h>
16014 #if STDC_HEADERS
16015 #include <stdlib.h>
16016 #include <stddef.h>
16017 #endif
16018
16019 EOF
16020 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16021   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16022   rm -rf conftest*
16023   eval "ac_cv_type_off_t=yes"
16024 else
16025   rm -rf conftest*
16026   eval "ac_cv_type_off_t=no"
16027 fi
16028 rm -f conftest*
16029
16030 fi
16031 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
16032   echo "$ac_t""yes" 1>&6
16033 else
16034   echo "$ac_t""no" 1>&6
16035   cat >> confdefs.h <<EOF
16036 #define off_t long
16037 EOF
16038
16039 fi
16040
16041 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
16042 echo "configure:16043: checking for pid_t" >&5
16043 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
16044   echo $ac_n "(cached) $ac_c" 1>&6
16045 else
16046   cat > conftest.$ac_ext <<EOF
16047 #line 16048 "configure"
16048 #include "confdefs.h"
16049 #include <sys/types.h>
16050 #if STDC_HEADERS
16051 #include <stdlib.h>
16052 #include <stddef.h>
16053 #endif
16054
16055 EOF
16056 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16057   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16058   rm -rf conftest*
16059   eval "ac_cv_type_pid_t=yes"
16060 else
16061   rm -rf conftest*
16062   eval "ac_cv_type_pid_t=no"
16063 fi
16064 rm -f conftest*
16065
16066 fi
16067 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
16068   echo "$ac_t""yes" 1>&6
16069 else
16070   echo "$ac_t""no" 1>&6
16071   cat >> confdefs.h <<EOF
16072 #define pid_t int
16073 EOF
16074
16075 fi
16076
16077 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
16078 echo "configure:16079: checking for ptrdiff_t" >&5
16079 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
16080   echo $ac_n "(cached) $ac_c" 1>&6
16081 else
16082   cat > conftest.$ac_ext <<EOF
16083 #line 16084 "configure"
16084 #include "confdefs.h"
16085 #include <stddef.h>
16086 int main() {
16087 ptrdiff_t p
16088 ; return 0; }
16089 EOF
16090 if { (eval echo configure:16091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16091   rm -rf conftest*
16092   am_cv_type_ptrdiff_t=yes
16093 else
16094   echo "configure: failed program was:" >&5
16095   cat conftest.$ac_ext >&5
16096   rm -rf conftest*
16097   am_cv_type_ptrdiff_t=no
16098 fi
16099 rm -f conftest*
16100 fi
16101
16102 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
16103    if test $am_cv_type_ptrdiff_t = yes; then
16104      cat >> confdefs.h <<\EOF
16105 #define HAVE_PTRDIFF_T 1
16106 EOF
16107
16108    fi
16109
16110 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
16111 echo "configure:16112: checking return type of signal handlers" >&5
16112 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
16113   echo $ac_n "(cached) $ac_c" 1>&6
16114 else
16115   cat > conftest.$ac_ext <<EOF
16116 #line 16117 "configure"
16117 #include "confdefs.h"
16118 #include <sys/types.h>
16119 #include <signal.h>
16120 #ifdef signal
16121 #undef signal
16122 #endif
16123 #ifdef __cplusplus
16124 extern "C" void (*signal (int, void (*)(int)))(int);
16125 #else
16126 void (*signal ()) ();
16127 #endif
16128
16129 int main() {
16130 int i;
16131 ; return 0; }
16132 EOF
16133 if { (eval echo configure:16134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16134   rm -rf conftest*
16135   ac_cv_type_signal=void
16136 else
16137   echo "configure: failed program was:" >&5
16138   cat conftest.$ac_ext >&5
16139   rm -rf conftest*
16140   ac_cv_type_signal=int
16141 fi
16142 rm -f conftest*
16143 fi
16144
16145 echo "$ac_t""$ac_cv_type_signal" 1>&6
16146 cat >> confdefs.h <<EOF
16147 #define RETSIGTYPE $ac_cv_type_signal
16148 EOF
16149
16150
16151 echo $ac_n "checking for size_t""... $ac_c" 1>&6
16152 echo "configure:16153: checking for size_t" >&5
16153 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
16154   echo $ac_n "(cached) $ac_c" 1>&6
16155 else
16156   cat > conftest.$ac_ext <<EOF
16157 #line 16158 "configure"
16158 #include "confdefs.h"
16159 #include <sys/types.h>
16160 #if STDC_HEADERS
16161 #include <stdlib.h>
16162 #include <stddef.h>
16163 #endif
16164
16165 EOF
16166 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16167   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16168   rm -rf conftest*
16169   eval "ac_cv_type_size_t=yes"
16170 else
16171   rm -rf conftest*
16172   eval "ac_cv_type_size_t=no"
16173 fi
16174 rm -f conftest*
16175
16176 fi
16177 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
16178   echo "$ac_t""yes" 1>&6
16179 else
16180   echo "$ac_t""no" 1>&6
16181   cat >> confdefs.h <<EOF
16182 #define size_t unsigned
16183 EOF
16184
16185 fi
16186
16187
16188 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
16189 echo "configure:16190: checking for ssize_t" >&5
16190 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
16191   echo $ac_n "(cached) $ac_c" 1>&6
16192 else
16193   cat > conftest.$ac_ext <<EOF
16194 #line 16195 "configure"
16195 #include "confdefs.h"
16196 #include <sys/types.h>
16197 #if STDC_HEADERS
16198 #include <stdlib.h>
16199 #include <stddef.h>
16200 #endif
16201
16202 EOF
16203 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16204   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16205   rm -rf conftest*
16206   eval "ac_cv_type_ssize_t=yes"
16207 else
16208   rm -rf conftest*
16209   eval "ac_cv_type_ssize_t=no"
16210 fi
16211 rm -f conftest*
16212
16213 fi
16214 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
16215   echo "$ac_t""yes" 1>&6
16216 else
16217   echo "$ac_t""no" 1>&6
16218   cat >> confdefs.h <<EOF
16219 #define ssize_t signed int
16220 EOF
16221
16222 fi
16223
16224 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16225 echo "configure:16226: checking for caddr_t" >&5
16226 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16227   echo $ac_n "(cached) $ac_c" 1>&6
16228 else
16229   cat > conftest.$ac_ext <<EOF
16230 #line 16231 "configure"
16231 #include "confdefs.h"
16232 #include <sys/types.h>
16233 #if STDC_HEADERS
16234 #include <stdlib.h>
16235 #include <stddef.h>
16236 #endif
16237
16238 EOF
16239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16240   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16241   rm -rf conftest*
16242   eval "ac_cv_type_caddr_t=yes"
16243 else
16244   rm -rf conftest*
16245   eval "ac_cv_type_caddr_t=no"
16246 fi
16247 rm -f conftest*
16248
16249 fi
16250 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16251   echo "$ac_t""yes" 1>&6
16252 else
16253   echo "$ac_t""no" 1>&6
16254   cat >> confdefs.h <<EOF
16255 #define caddr_t char *
16256 EOF
16257
16258 fi
16259
16260
16261 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16262 echo "configure:16263: checking for socklen_t" >&5
16263 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16264   echo $ac_n "(cached) $ac_c" 1>&6
16265 else
16266   cat > conftest.$ac_ext <<EOF
16267 #line 16268 "configure"
16268 #include "confdefs.h"
16269
16270 #ifdef HAVE_SYS_TYPES_H
16271 #include <sys/types.h>
16272 #endif
16273 #ifdef HAVE_SYS_SOCKET_H
16274 #include <sys/socket.h>
16275 #endif
16276
16277 int main() {
16278 socklen_t len;
16279 ; return 0; }
16280 EOF
16281 if { (eval echo configure:16282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16282   rm -rf conftest*
16283   ol_cv_type_socklen_t=yes
16284 else
16285   echo "configure: failed program was:" >&5
16286   cat conftest.$ac_ext >&5
16287   rm -rf conftest*
16288   ol_cv_type_socklen_t=no
16289 fi
16290 rm -f conftest*
16291 fi
16292
16293 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16294   if test $ol_cv_type_socklen_t = no; then
16295     cat >> confdefs.h <<\EOF
16296 #define socklen_t int
16297 EOF
16298
16299   fi
16300  
16301 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16302 echo "configure:16303: checking for member st_blksize in aggregate type struct stat" >&5
16303 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16304   echo $ac_n "(cached) $ac_c" 1>&6
16305 else
16306   cat > conftest.$ac_ext <<EOF
16307 #line 16308 "configure"
16308 #include "confdefs.h"
16309 #include <sys/types.h>
16310 #include <sys/stat.h>
16311 int main() {
16312 struct stat foo; foo.st_blksize;
16313 ; return 0; }
16314 EOF
16315 if { (eval echo configure:16316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16316   rm -rf conftest*
16317   ac_cv_c_struct_member_st_blksize=yes
16318 else
16319   echo "configure: failed program was:" >&5
16320   cat conftest.$ac_ext >&5
16321   rm -rf conftest*
16322   ac_cv_c_struct_member_st_blksize=no
16323 fi
16324 rm -f conftest*
16325 fi
16326
16327 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16328 st_blksize="$ac_cv_c_struct_member_st_blksize"
16329 if test $ac_cv_c_struct_member_st_blksize = yes; then
16330   cat >> confdefs.h <<\EOF
16331 #define HAVE_ST_BLKSIZE 1
16332 EOF
16333
16334 fi
16335
16336 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16337 echo "configure:16338: checking whether time.h and sys/time.h may both be included" >&5
16338 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16339   echo $ac_n "(cached) $ac_c" 1>&6
16340 else
16341   cat > conftest.$ac_ext <<EOF
16342 #line 16343 "configure"
16343 #include "confdefs.h"
16344 #include <sys/types.h>
16345 #include <sys/time.h>
16346 #include <time.h>
16347 int main() {
16348 struct tm *tp;
16349 ; return 0; }
16350 EOF
16351 if { (eval echo configure:16352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16352   rm -rf conftest*
16353   ac_cv_header_time=yes
16354 else
16355   echo "configure: failed program was:" >&5
16356   cat conftest.$ac_ext >&5
16357   rm -rf conftest*
16358   ac_cv_header_time=no
16359 fi
16360 rm -f conftest*
16361 fi
16362
16363 echo "$ac_t""$ac_cv_header_time" 1>&6
16364 if test $ac_cv_header_time = yes; then
16365   cat >> confdefs.h <<\EOF
16366 #define TIME_WITH_SYS_TIME 1
16367 EOF
16368
16369 fi
16370
16371 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16372 echo "configure:16373: checking whether struct tm is in sys/time.h or time.h" >&5
16373 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16374   echo $ac_n "(cached) $ac_c" 1>&6
16375 else
16376   cat > conftest.$ac_ext <<EOF
16377 #line 16378 "configure"
16378 #include "confdefs.h"
16379 #include <sys/types.h>
16380 #include <time.h>
16381 int main() {
16382 struct tm *tp; tp->tm_sec;
16383 ; return 0; }
16384 EOF
16385 if { (eval echo configure:16386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16386   rm -rf conftest*
16387   ac_cv_struct_tm=time.h
16388 else
16389   echo "configure: failed program was:" >&5
16390   cat conftest.$ac_ext >&5
16391   rm -rf conftest*
16392   ac_cv_struct_tm=sys/time.h
16393 fi
16394 rm -f conftest*
16395 fi
16396
16397 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16398 if test $ac_cv_struct_tm = sys/time.h; then
16399   cat >> confdefs.h <<\EOF
16400 #define TM_IN_SYS_TIME 1
16401 EOF
16402
16403 fi
16404
16405 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16406 echo "configure:16407: checking for uid_t in sys/types.h" >&5
16407 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16408   echo $ac_n "(cached) $ac_c" 1>&6
16409 else
16410   cat > conftest.$ac_ext <<EOF
16411 #line 16412 "configure"
16412 #include "confdefs.h"
16413 #include <sys/types.h>
16414 EOF
16415 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16416   egrep "uid_t" >/dev/null 2>&1; then
16417   rm -rf conftest*
16418   ac_cv_type_uid_t=yes
16419 else
16420   rm -rf conftest*
16421   ac_cv_type_uid_t=no
16422 fi
16423 rm -f conftest*
16424
16425 fi
16426
16427 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16428 if test $ac_cv_type_uid_t = no; then
16429   cat >> confdefs.h <<\EOF
16430 #define uid_t int
16431 EOF
16432
16433   cat >> confdefs.h <<\EOF
16434 #define gid_t int
16435 EOF
16436
16437 fi
16438
16439 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16440 echo "configure:16441: checking for sig_atomic_t" >&5
16441 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16442   echo $ac_n "(cached) $ac_c" 1>&6
16443 else
16444   cat > conftest.$ac_ext <<EOF
16445 #line 16446 "configure"
16446 #include "confdefs.h"
16447 #include <signal.h>
16448 int main() {
16449 sig_atomic_t atomic;
16450 ; return 0; }
16451 EOF
16452 if { (eval echo configure:16453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16453   rm -rf conftest*
16454   ol_cv_type_sig_atomic_t=yes
16455 else
16456   echo "configure: failed program was:" >&5
16457   cat conftest.$ac_ext >&5
16458   rm -rf conftest*
16459   ol_cv_type_sig_atomic_t=no
16460 fi
16461 rm -f conftest*
16462 fi
16463
16464 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16465   if test $ol_cv_type_sig_atomic_t = no; then
16466     cat >> confdefs.h <<\EOF
16467 #define sig_atomic_t int
16468 EOF
16469
16470   fi
16471  
16472
16473
16474 # test for pw_gecos in struct passwd
16475 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16476 echo "configure:16477: checking struct passwd for pw_gecos" >&5
16477 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16478   echo $ac_n "(cached) $ac_c" 1>&6
16479 else
16480   
16481         cat > conftest.$ac_ext <<EOF
16482 #line 16483 "configure"
16483 #include "confdefs.h"
16484 #include <pwd.h>
16485 int main() {
16486
16487         struct passwd pwd;
16488         pwd.pw_gecos = pwd.pw_name;
16489
16490 ; return 0; }
16491 EOF
16492 if { (eval echo configure:16493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16493   rm -rf conftest*
16494   ol_cv_struct_passwd_pw_gecos=yes
16495 else
16496   echo "configure: failed program was:" >&5
16497   cat conftest.$ac_ext >&5
16498   rm -rf conftest*
16499   ol_cv_struct_passwd_pw_gecos=no
16500 fi
16501 rm -f conftest*
16502 fi
16503
16504 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16505 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16506         cat >> confdefs.h <<\EOF
16507 #define HAVE_PW_GECOS 1
16508 EOF
16509
16510 fi
16511
16512 # test for pw_passwd in struct passwd
16513 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16514 echo "configure:16515: checking struct passwd for pw_passwd" >&5
16515 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16516   echo $ac_n "(cached) $ac_c" 1>&6
16517 else
16518   
16519         cat > conftest.$ac_ext <<EOF
16520 #line 16521 "configure"
16521 #include "confdefs.h"
16522 #include <pwd.h>
16523 int main() {
16524
16525         struct passwd pwd;
16526         pwd.pw_passwd = pwd.pw_name;
16527
16528 ; return 0; }
16529 EOF
16530 if { (eval echo configure:16531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16531   rm -rf conftest*
16532   ol_cv_struct_passwd_pw_passwd=yes
16533 else
16534   echo "configure: failed program was:" >&5
16535   cat conftest.$ac_ext >&5
16536   rm -rf conftest*
16537   ol_cv_struct_passwd_pw_passwd=no
16538 fi
16539 rm -f conftest*
16540 fi
16541
16542 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16543 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16544         cat >> confdefs.h <<\EOF
16545 #define HAVE_PW_PASSWD 1
16546 EOF
16547
16548 fi
16549
16550
16551 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16552 echo "configure:16553: checking if toupper() requires islower()" >&5
16553 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16554   echo $ac_n "(cached) $ac_c" 1>&6
16555 else
16556   
16557         if test "$cross_compiling" = yes; then
16558   ol_cv_c_upper_lower=safe
16559 else
16560   cat > conftest.$ac_ext <<EOF
16561 #line 16562 "configure"
16562 #include "confdefs.h"
16563
16564 #include <ctype.h>
16565 main()
16566 {
16567         if ('C' == toupper('C'))
16568                 exit(0);
16569         else
16570                 exit(1);
16571 }
16572 EOF
16573 if { (eval echo configure:16574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16574 then
16575   ol_cv_c_upper_lower=no
16576 else
16577   echo "configure: failed program was:" >&5
16578   cat conftest.$ac_ext >&5
16579   rm -fr conftest*
16580   ol_cv_c_upper_lower=yes
16581 fi
16582 rm -fr conftest*
16583 fi
16584
16585 fi
16586
16587 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16588 if test $ol_cv_c_upper_lower != no ; then
16589         cat >> confdefs.h <<\EOF
16590 #define C_UPPER_LOWER 1
16591 EOF
16592
16593 fi
16594
16595 echo $ac_n "checking for working const""... $ac_c" 1>&6
16596 echo "configure:16597: checking for working const" >&5
16597 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16598   echo $ac_n "(cached) $ac_c" 1>&6
16599 else
16600   cat > conftest.$ac_ext <<EOF
16601 #line 16602 "configure"
16602 #include "confdefs.h"
16603
16604 int main() {
16605
16606 /* Ultrix mips cc rejects this.  */
16607 typedef int charset[2]; const charset x;
16608 /* SunOS 4.1.1 cc rejects this.  */
16609 char const *const *ccp;
16610 char **p;
16611 /* NEC SVR4.0.2 mips cc rejects this.  */
16612 struct point {int x, y;};
16613 static struct point const zero = {0,0};
16614 /* AIX XL C 1.02.0.0 rejects this.
16615    It does not let you subtract one const X* pointer from another in an arm
16616    of an if-expression whose if-part is not a constant expression */
16617 const char *g = "string";
16618 ccp = &g + (g ? g-g : 0);
16619 /* HPUX 7.0 cc rejects these. */
16620 ++ccp;
16621 p = (char**) ccp;
16622 ccp = (char const *const *) p;
16623 { /* SCO 3.2v4 cc rejects this.  */
16624   char *t;
16625   char const *s = 0 ? (char *) 0 : (char const *) 0;
16626
16627   *t++ = 0;
16628 }
16629 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16630   int x[] = {25, 17};
16631   const int *foo = &x[0];
16632   ++foo;
16633 }
16634 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16635   typedef const int *iptr;
16636   iptr p = 0;
16637   ++p;
16638 }
16639 { /* AIX XL C 1.02.0.0 rejects this saying
16640      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16641   struct s { int j; const int *ap[3]; };
16642   struct s *b; b->j = 5;
16643 }
16644 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16645   const int foo = 10;
16646 }
16647
16648 ; return 0; }
16649 EOF
16650 if { (eval echo configure:16651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16651   rm -rf conftest*
16652   ac_cv_c_const=yes
16653 else
16654   echo "configure: failed program was:" >&5
16655   cat conftest.$ac_ext >&5
16656   rm -rf conftest*
16657   ac_cv_c_const=no
16658 fi
16659 rm -f conftest*
16660 fi
16661
16662 echo "$ac_t""$ac_cv_c_const" 1>&6
16663 if test $ac_cv_c_const = no; then
16664   cat >> confdefs.h <<\EOF
16665 #define const 
16666 EOF
16667
16668 fi
16669
16670 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16671 echo "configure:16672: checking if compiler understands volatile" >&5
16672 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16673   echo $ac_n "(cached) $ac_c" 1>&6
16674 else
16675   cat > conftest.$ac_ext <<EOF
16676 #line 16677 "configure"
16677 #include "confdefs.h"
16678 int x, y, z;
16679 int main() {
16680 volatile int a; int * volatile b = x ? &y : &z;
16681       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16682       *b = 0;
16683 ; return 0; }
16684 EOF
16685 if { (eval echo configure:16686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16686   rm -rf conftest*
16687   ol_cv_c_volatile=yes
16688 else
16689   echo "configure: failed program was:" >&5
16690   cat conftest.$ac_ext >&5
16691   rm -rf conftest*
16692   ol_cv_c_volatile=no
16693 fi
16694 rm -f conftest*
16695 fi
16696
16697 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16698   if test $ol_cv_c_volatile = yes; then
16699     : 
16700   else
16701     cat >> confdefs.h <<\EOF
16702 #define volatile 
16703 EOF
16704
16705   fi
16706  
16707
16708 if test $cross_compiling = yes ; then
16709         cat >> confdefs.h <<\EOF
16710 #define CROSS_COMPILING 1
16711 EOF
16712
16713 else
16714         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16715 echo "configure:16716: checking whether byte ordering is bigendian" >&5
16716 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16717   echo $ac_n "(cached) $ac_c" 1>&6
16718 else
16719   ac_cv_c_bigendian=unknown
16720 # See if sys/param.h defines the BYTE_ORDER macro.
16721 cat > conftest.$ac_ext <<EOF
16722 #line 16723 "configure"
16723 #include "confdefs.h"
16724 #include <sys/types.h>
16725 #include <sys/param.h>
16726 int main() {
16727
16728 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16729  bogus endian macros
16730 #endif
16731 ; return 0; }
16732 EOF
16733 if { (eval echo configure:16734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16734   rm -rf conftest*
16735   # It does; now see whether it defined to BIG_ENDIAN or not.
16736 cat > conftest.$ac_ext <<EOF
16737 #line 16738 "configure"
16738 #include "confdefs.h"
16739 #include <sys/types.h>
16740 #include <sys/param.h>
16741 int main() {
16742
16743 #if BYTE_ORDER != BIG_ENDIAN
16744  not big endian
16745 #endif
16746 ; return 0; }
16747 EOF
16748 if { (eval echo configure:16749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16749   rm -rf conftest*
16750   ac_cv_c_bigendian=yes
16751 else
16752   echo "configure: failed program was:" >&5
16753   cat conftest.$ac_ext >&5
16754   rm -rf conftest*
16755   ac_cv_c_bigendian=no
16756 fi
16757 rm -f conftest*
16758 else
16759   echo "configure: failed program was:" >&5
16760   cat conftest.$ac_ext >&5
16761 fi
16762 rm -f conftest*
16763 if test $ac_cv_c_bigendian = unknown; then
16764 if test "$cross_compiling" = yes; then
16765     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16766 else
16767   cat > conftest.$ac_ext <<EOF
16768 #line 16769 "configure"
16769 #include "confdefs.h"
16770 main () {
16771   /* Are we little or big endian?  From Harbison&Steele.  */
16772   union
16773   {
16774     long l;
16775     char c[sizeof (long)];
16776   } u;
16777   u.l = 1;
16778   exit (u.c[sizeof (long) - 1] == 1);
16779 }
16780 EOF
16781 if { (eval echo configure:16782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16782 then
16783   ac_cv_c_bigendian=no
16784 else
16785   echo "configure: failed program was:" >&5
16786   cat conftest.$ac_ext >&5
16787   rm -fr conftest*
16788   ac_cv_c_bigendian=yes
16789 fi
16790 rm -fr conftest*
16791 fi
16792
16793 fi
16794 fi
16795
16796 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16797 if test $ac_cv_c_bigendian = yes; then
16798   cat >> confdefs.h <<\EOF
16799 #define WORDS_BIGENDIAN 1
16800 EOF
16801
16802 fi
16803
16804 fi
16805
16806 echo $ac_n "checking size of short""... $ac_c" 1>&6
16807 echo "configure:16808: checking size of short" >&5 
16808 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16809   echo $ac_n "(cached) $ac_c" 1>&6
16810 else
16811   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16812   cat > conftest.$ac_ext <<EOF
16813 #line 16814 "configure"
16814 #include "confdefs.h"
16815 #include "confdefs.h" 
16816 #include <sys/types.h> 
16817  
16818
16819 int main() {
16820 switch (0) case 0: case (sizeof (short) == $ac_size):;
16821 ; return 0; }
16822 EOF
16823 if { (eval echo configure:16824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16824   rm -rf conftest*
16825   ac_cv_sizeof_short=$ac_size
16826 else
16827   echo "configure: failed program was:" >&5
16828   cat conftest.$ac_ext >&5
16829 fi
16830 rm -f conftest* 
16831   if test x$ac_cv_sizeof_short != x ; then break; fi 
16832 done 
16833
16834 fi
16835  
16836 if test x$ac_cv_sizeof_short = x ; then 
16837   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16838 fi 
16839 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16840 cat >> confdefs.h <<EOF
16841 #define SIZEOF_SHORT $ac_cv_sizeof_short
16842 EOF
16843  
16844  
16845 echo $ac_n "checking size of int""... $ac_c" 1>&6
16846 echo "configure:16847: checking size of int" >&5 
16847 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16848   echo $ac_n "(cached) $ac_c" 1>&6
16849 else
16850   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16851   cat > conftest.$ac_ext <<EOF
16852 #line 16853 "configure"
16853 #include "confdefs.h"
16854 #include "confdefs.h" 
16855 #include <sys/types.h> 
16856  
16857
16858 int main() {
16859 switch (0) case 0: case (sizeof (int) == $ac_size):;
16860 ; return 0; }
16861 EOF
16862 if { (eval echo configure:16863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16863   rm -rf conftest*
16864   ac_cv_sizeof_int=$ac_size
16865 else
16866   echo "configure: failed program was:" >&5
16867   cat conftest.$ac_ext >&5
16868 fi
16869 rm -f conftest* 
16870   if test x$ac_cv_sizeof_int != x ; then break; fi 
16871 done 
16872
16873 fi
16874  
16875 if test x$ac_cv_sizeof_int = x ; then 
16876   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16877 fi 
16878 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16879 cat >> confdefs.h <<EOF
16880 #define SIZEOF_INT $ac_cv_sizeof_int
16881 EOF
16882  
16883  
16884 echo $ac_n "checking size of long""... $ac_c" 1>&6
16885 echo "configure:16886: checking size of long" >&5 
16886 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16887   echo $ac_n "(cached) $ac_c" 1>&6
16888 else
16889   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16890   cat > conftest.$ac_ext <<EOF
16891 #line 16892 "configure"
16892 #include "confdefs.h"
16893 #include "confdefs.h" 
16894 #include <sys/types.h> 
16895  
16896
16897 int main() {
16898 switch (0) case 0: case (sizeof (long) == $ac_size):;
16899 ; return 0; }
16900 EOF
16901 if { (eval echo configure:16902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16902   rm -rf conftest*
16903   ac_cv_sizeof_long=$ac_size
16904 else
16905   echo "configure: failed program was:" >&5
16906   cat conftest.$ac_ext >&5
16907 fi
16908 rm -f conftest* 
16909   if test x$ac_cv_sizeof_long != x ; then break; fi 
16910 done 
16911
16912 fi
16913  
16914 if test x$ac_cv_sizeof_long = x ; then 
16915   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16916 fi 
16917 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16918 cat >> confdefs.h <<EOF
16919 #define SIZEOF_LONG $ac_cv_sizeof_long
16920 EOF
16921  
16922
16923
16924 if test "$ac_cv_sizeof_int" -lt 4 ; then
16925         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16926
16927         cat >> confdefs.h <<\EOF
16928 #define LBER_INT_T long
16929 EOF
16930
16931 else
16932         cat >> confdefs.h <<\EOF
16933 #define LBER_INT_T int
16934 EOF
16935
16936 fi
16937
16938 cat >> confdefs.h <<\EOF
16939 #define LBER_LEN_T long
16940 EOF
16941
16942 cat >> confdefs.h <<\EOF
16943 #define LBER_SOCKET_T int
16944 EOF
16945
16946 cat >> confdefs.h <<\EOF
16947 #define LBER_TAG_T long
16948 EOF
16949
16950
16951 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16952 echo "configure:16953: checking for 8-bit clean memcmp" >&5
16953 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16954   echo $ac_n "(cached) $ac_c" 1>&6
16955 else
16956   if test "$cross_compiling" = yes; then
16957   ac_cv_func_memcmp_clean=no
16958 else
16959   cat > conftest.$ac_ext <<EOF
16960 #line 16961 "configure"
16961 #include "confdefs.h"
16962
16963 main()
16964 {
16965   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16966   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16967 }
16968
16969 EOF
16970 if { (eval echo configure:16971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16971 then
16972   ac_cv_func_memcmp_clean=yes
16973 else
16974   echo "configure: failed program was:" >&5
16975   cat conftest.$ac_ext >&5
16976   rm -fr conftest*
16977   ac_cv_func_memcmp_clean=no
16978 fi
16979 rm -fr conftest*
16980 fi
16981
16982 fi
16983
16984 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16985 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16986
16987 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16988 echo "configure:16989: checking for strftime" >&5
16989 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16990   echo $ac_n "(cached) $ac_c" 1>&6
16991 else
16992   cat > conftest.$ac_ext <<EOF
16993 #line 16994 "configure"
16994 #include "confdefs.h"
16995 /* System header to define __stub macros and hopefully few prototypes,
16996     which can conflict with char strftime(); below.  */
16997 #include <assert.h>
16998 /* Override any gcc2 internal prototype to avoid an error.  */
16999 /* We use char because int might match the return type of a gcc2
17000     builtin and then its argument prototype would still apply.  */
17001 char strftime();
17002 char (*f)();
17003
17004 int main() {
17005
17006 /* The GNU C library defines this for functions which it implements
17007     to always fail with ENOSYS.  Some functions are actually named
17008     something starting with __ and the normal name is an alias.  */
17009 #if defined (__stub_strftime) || defined (__stub___strftime)
17010 choke me
17011 #else
17012 f = strftime;
17013 #endif
17014
17015 ; return 0; }
17016 EOF
17017 if { (eval echo configure:17018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17018   rm -rf conftest*
17019   eval "ac_cv_func_strftime=yes"
17020 else
17021   echo "configure: failed program was:" >&5
17022   cat conftest.$ac_ext >&5
17023   rm -rf conftest*
17024   eval "ac_cv_func_strftime=no"
17025 fi
17026 rm -f conftest*
17027 fi
17028
17029 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
17030   echo "$ac_t""yes" 1>&6
17031   cat >> confdefs.h <<\EOF
17032 #define HAVE_STRFTIME 1
17033 EOF
17034
17035 else
17036   echo "$ac_t""no" 1>&6
17037 # strftime is in -lintl on SCO UNIX.
17038 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
17039 echo "configure:17040: checking for strftime in -lintl" >&5
17040 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
17041 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
17042   echo $ac_n "(cached) $ac_c" 1>&6
17043 else
17044   ac_save_LIBS="$LIBS"
17045 LIBS="-lintl  $LIBS"
17046 cat > conftest.$ac_ext <<EOF
17047 #line 17048 "configure"
17048 #include "confdefs.h"
17049 /* Override any gcc2 internal prototype to avoid an error.  */
17050 /* We use char because int might match the return type of a gcc2
17051     builtin and then its argument prototype would still apply.  */
17052 char strftime();
17053
17054 int main() {
17055 strftime()
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_lib_$ac_lib_var=yes"
17061 else
17062   echo "configure: failed program was:" >&5
17063   cat conftest.$ac_ext >&5
17064   rm -rf conftest*
17065   eval "ac_cv_lib_$ac_lib_var=no"
17066 fi
17067 rm -f conftest*
17068 LIBS="$ac_save_LIBS"
17069
17070 fi
17071 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
17072   echo "$ac_t""yes" 1>&6
17073   cat >> confdefs.h <<\EOF
17074 #define HAVE_STRFTIME 1
17075 EOF
17076
17077 LIBS="-lintl $LIBS"
17078 else
17079   echo "$ac_t""no" 1>&6
17080 fi
17081
17082 fi
17083
17084
17085 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
17086 echo "configure:17087: checking for inet_aton()" >&5
17087 if eval "test \"\${ol_cv_func_inet_aton+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
17094 #ifdef HAVE_SYS_TYPES_H
17095 #       include <sys/types.h>
17096 #endif
17097 #ifdef HAVE_SYS_SOCKET_H
17098 #       include <sys/socket.h>
17099 #       ifdef HAVE_SYS_SELECT_H
17100 #               include <sys/select.h>
17101 #       endif
17102 #       include <netinet/in.h>
17103 #       ifdef HAVE_ARPA_INET_H
17104 #               include <arpa/inet.h>
17105 #       endif
17106 #endif
17107
17108 int main() {
17109 struct in_addr in;
17110 int rc = inet_aton( "255.255.255.255", &in );
17111 ; return 0; }
17112 EOF
17113 if { (eval echo configure:17114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17114   rm -rf conftest*
17115   ol_cv_func_inet_aton=yes
17116 else
17117   echo "configure: failed program was:" >&5
17118   cat conftest.$ac_ext >&5
17119   rm -rf conftest*
17120   ol_cv_func_inet_aton=no
17121 fi
17122 rm -f conftest*
17123 fi
17124
17125 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
17126   if test $ol_cv_func_inet_aton != no; then
17127     cat >> confdefs.h <<\EOF
17128 #define HAVE_INET_ATON 1
17129 EOF
17130
17131   fi
17132  
17133
17134 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
17135 echo "configure:17136: checking for _spawnlp" >&5
17136 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
17137   echo $ac_n "(cached) $ac_c" 1>&6
17138 else
17139   cat > conftest.$ac_ext <<EOF
17140 #line 17141 "configure"
17141 #include "confdefs.h"
17142 /* System header to define __stub macros and hopefully few prototypes,
17143     which can conflict with char _spawnlp(); below.  */
17144 #include <assert.h>
17145 /* Override any gcc2 internal prototype to avoid an error.  */
17146 /* We use char because int might match the return type of a gcc2
17147     builtin and then its argument prototype would still apply.  */
17148 char _spawnlp();
17149 char (*f)();
17150
17151 int main() {
17152
17153 /* The GNU C library defines this for functions which it implements
17154     to always fail with ENOSYS.  Some functions are actually named
17155     something starting with __ and the normal name is an alias.  */
17156 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
17157 choke me
17158 #else
17159 f = _spawnlp;
17160 #endif
17161
17162 ; return 0; }
17163 EOF
17164 if { (eval echo configure:17165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17165   rm -rf conftest*
17166   eval "ac_cv_func__spawnlp=yes"
17167 else
17168   echo "configure: failed program was:" >&5
17169   cat conftest.$ac_ext >&5
17170   rm -rf conftest*
17171   eval "ac_cv_func__spawnlp=no"
17172 fi
17173 rm -f conftest*
17174 fi
17175
17176 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
17177   echo "$ac_t""yes" 1>&6
17178   cat >> confdefs.h <<\EOF
17179 #define HAVE_SPAWNLP 1
17180 EOF
17181
17182 else
17183   echo "$ac_t""no" 1>&6
17184 fi
17185
17186
17187 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
17188 echo "configure:17189: checking for _snprintf" >&5
17189 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
17190   echo $ac_n "(cached) $ac_c" 1>&6
17191 else
17192   cat > conftest.$ac_ext <<EOF
17193 #line 17194 "configure"
17194 #include "confdefs.h"
17195 /* System header to define __stub macros and hopefully few prototypes,
17196     which can conflict with char _snprintf(); below.  */
17197 #include <assert.h>
17198 /* Override any gcc2 internal prototype to avoid an error.  */
17199 /* We use char because int might match the return type of a gcc2
17200     builtin and then its argument prototype would still apply.  */
17201 char _snprintf();
17202 char (*f)();
17203
17204 int main() {
17205
17206 /* The GNU C library defines this for functions which it implements
17207     to always fail with ENOSYS.  Some functions are actually named
17208     something starting with __ and the normal name is an alias.  */
17209 #if defined (__stub__snprintf) || defined (__stub____snprintf)
17210 choke me
17211 #else
17212 f = _snprintf;
17213 #endif
17214
17215 ; return 0; }
17216 EOF
17217 if { (eval echo configure:17218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17218   rm -rf conftest*
17219   eval "ac_cv_func__snprintf=yes"
17220 else
17221   echo "configure: failed program was:" >&5
17222   cat conftest.$ac_ext >&5
17223   rm -rf conftest*
17224   eval "ac_cv_func__snprintf=no"
17225 fi
17226 rm -f conftest*
17227 fi
17228
17229 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17230   echo "$ac_t""yes" 1>&6
17231   ac_cv_func_snprintf=yes
17232         cat >> confdefs.h <<\EOF
17233 #define snprintf _snprintf
17234 EOF
17235
17236
17237 else
17238   echo "$ac_t""no" 1>&6
17239 fi
17240
17241
17242 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17243 echo "configure:17244: checking for _vsnprintf" >&5
17244 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17245   echo $ac_n "(cached) $ac_c" 1>&6
17246 else
17247   cat > conftest.$ac_ext <<EOF
17248 #line 17249 "configure"
17249 #include "confdefs.h"
17250 /* System header to define __stub macros and hopefully few prototypes,
17251     which can conflict with char _vsnprintf(); below.  */
17252 #include <assert.h>
17253 /* Override any gcc2 internal prototype to avoid an error.  */
17254 /* We use char because int might match the return type of a gcc2
17255     builtin and then its argument prototype would still apply.  */
17256 char _vsnprintf();
17257 char (*f)();
17258
17259 int main() {
17260
17261 /* The GNU C library defines this for functions which it implements
17262     to always fail with ENOSYS.  Some functions are actually named
17263     something starting with __ and the normal name is an alias.  */
17264 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17265 choke me
17266 #else
17267 f = _vsnprintf;
17268 #endif
17269
17270 ; return 0; }
17271 EOF
17272 if { (eval echo configure:17273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17273   rm -rf conftest*
17274   eval "ac_cv_func__vsnprintf=yes"
17275 else
17276   echo "configure: failed program was:" >&5
17277   cat conftest.$ac_ext >&5
17278   rm -rf conftest*
17279   eval "ac_cv_func__vsnprintf=no"
17280 fi
17281 rm -f conftest*
17282 fi
17283
17284 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17285   echo "$ac_t""yes" 1>&6
17286   ac_cv_func_vsnprintf=yes
17287         cat >> confdefs.h <<\EOF
17288 #define vsnprintf _vsnprintf
17289 EOF
17290
17291
17292 else
17293   echo "$ac_t""no" 1>&6
17294 fi
17295
17296
17297 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17298 echo "configure:17299: checking for vprintf" >&5
17299 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17300   echo $ac_n "(cached) $ac_c" 1>&6
17301 else
17302   cat > conftest.$ac_ext <<EOF
17303 #line 17304 "configure"
17304 #include "confdefs.h"
17305 /* System header to define __stub macros and hopefully few prototypes,
17306     which can conflict with char vprintf(); below.  */
17307 #include <assert.h>
17308 /* Override any gcc2 internal prototype to avoid an error.  */
17309 /* We use char because int might match the return type of a gcc2
17310     builtin and then its argument prototype would still apply.  */
17311 char vprintf();
17312 char (*f)();
17313
17314 int main() {
17315
17316 /* The GNU C library defines this for functions which it implements
17317     to always fail with ENOSYS.  Some functions are actually named
17318     something starting with __ and the normal name is an alias.  */
17319 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17320 choke me
17321 #else
17322 f = vprintf;
17323 #endif
17324
17325 ; return 0; }
17326 EOF
17327 if { (eval echo configure:17328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17328   rm -rf conftest*
17329   eval "ac_cv_func_vprintf=yes"
17330 else
17331   echo "configure: failed program was:" >&5
17332   cat conftest.$ac_ext >&5
17333   rm -rf conftest*
17334   eval "ac_cv_func_vprintf=no"
17335 fi
17336 rm -f conftest*
17337 fi
17338
17339 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17340   echo "$ac_t""yes" 1>&6
17341   cat >> confdefs.h <<\EOF
17342 #define HAVE_VPRINTF 1
17343 EOF
17344
17345 else
17346   echo "$ac_t""no" 1>&6
17347 fi
17348
17349 if test "$ac_cv_func_vprintf" != yes; then
17350 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17351 echo "configure:17352: checking for _doprnt" >&5
17352 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17353   echo $ac_n "(cached) $ac_c" 1>&6
17354 else
17355   cat > conftest.$ac_ext <<EOF
17356 #line 17357 "configure"
17357 #include "confdefs.h"
17358 /* System header to define __stub macros and hopefully few prototypes,
17359     which can conflict with char _doprnt(); below.  */
17360 #include <assert.h>
17361 /* Override any gcc2 internal prototype to avoid an error.  */
17362 /* We use char because int might match the return type of a gcc2
17363     builtin and then its argument prototype would still apply.  */
17364 char _doprnt();
17365 char (*f)();
17366
17367 int main() {
17368
17369 /* The GNU C library defines this for functions which it implements
17370     to always fail with ENOSYS.  Some functions are actually named
17371     something starting with __ and the normal name is an alias.  */
17372 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17373 choke me
17374 #else
17375 f = _doprnt;
17376 #endif
17377
17378 ; return 0; }
17379 EOF
17380 if { (eval echo configure:17381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17381   rm -rf conftest*
17382   eval "ac_cv_func__doprnt=yes"
17383 else
17384   echo "configure: failed program was:" >&5
17385   cat conftest.$ac_ext >&5
17386   rm -rf conftest*
17387   eval "ac_cv_func__doprnt=no"
17388 fi
17389 rm -f conftest*
17390 fi
17391
17392 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17393   echo "$ac_t""yes" 1>&6
17394   cat >> confdefs.h <<\EOF
17395 #define HAVE_DOPRNT 1
17396 EOF
17397
17398 else
17399   echo "$ac_t""no" 1>&6
17400 fi
17401
17402 fi
17403
17404
17405 if test $ac_cv_func_vprintf = yes ; then
17406                 for ac_func in vsnprintf vsprintf
17407 do
17408 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17409 echo "configure:17410: checking for $ac_func" >&5
17410 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17411   echo $ac_n "(cached) $ac_c" 1>&6
17412 else
17413   cat > conftest.$ac_ext <<EOF
17414 #line 17415 "configure"
17415 #include "confdefs.h"
17416 /* System header to define __stub macros and hopefully few prototypes,
17417     which can conflict with char $ac_func(); below.  */
17418 #include <assert.h>
17419 /* Override any gcc2 internal prototype to avoid an error.  */
17420 /* We use char because int might match the return type of a gcc2
17421     builtin and then its argument prototype would still apply.  */
17422 char $ac_func();
17423 char (*f)();
17424
17425 int main() {
17426
17427 /* The GNU C library defines this for functions which it implements
17428     to always fail with ENOSYS.  Some functions are actually named
17429     something starting with __ and the normal name is an alias.  */
17430 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17431 choke me
17432 #else
17433 f = $ac_func;
17434 #endif
17435
17436 ; return 0; }
17437 EOF
17438 if { (eval echo configure:17439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17439   rm -rf conftest*
17440   eval "ac_cv_func_$ac_func=yes"
17441 else
17442   echo "configure: failed program was:" >&5
17443   cat conftest.$ac_ext >&5
17444   rm -rf conftest*
17445   eval "ac_cv_func_$ac_func=no"
17446 fi
17447 rm -f conftest*
17448 fi
17449
17450 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17451   echo "$ac_t""yes" 1>&6
17452     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17453   cat >> confdefs.h <<EOF
17454 #define $ac_tr_func 1
17455 EOF
17456  
17457 else
17458   echo "$ac_t""no" 1>&6
17459 fi
17460 done
17461
17462 fi
17463
17464 for ac_func in \
17465         bcopy                   \
17466         closesocket             \
17467         chroot                  \
17468         endgrent                \
17469         endpwent                \
17470         fcntl                   \
17471         flock                   \
17472         getdtablesize   \
17473         getgrgid                \
17474         gethostname             \
17475         getpass                 \
17476         getpassphrase   \
17477         getpwuid                \
17478         getpwnam                \
17479         getspnam                \
17480         gettimeofday    \
17481         initgroups              \
17482         lockf                   \
17483         memcpy                  \
17484         memmove                 \
17485         mkstemp                 \
17486         mktemp                  \
17487         pipe                    \
17488         read                    \
17489         recv                    \
17490         recvfrom                \
17491         setpwfile               \
17492         setgid                  \
17493         setegid                 \
17494         setsid                  \
17495         setuid                  \
17496         seteuid                 \
17497         sigaction               \
17498         signal                  \
17499         sigset                  \
17500         strdup                  \
17501         strerror                \
17502         strpbrk                 \
17503         strrchr                 \
17504         strsep                  \
17505         strstr                  \
17506         strtol                  \
17507         strtoul                 \
17508         strspn                  \
17509         sysconf                 \
17510         usleep                  \
17511         waitpid                 \
17512         wait4                   \
17513         write                   \
17514         send                    \
17515         sendto                  \
17516
17517 do
17518 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17519 echo "configure:17520: checking for $ac_func" >&5
17520 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17521   echo $ac_n "(cached) $ac_c" 1>&6
17522 else
17523   cat > conftest.$ac_ext <<EOF
17524 #line 17525 "configure"
17525 #include "confdefs.h"
17526 /* System header to define __stub macros and hopefully few prototypes,
17527     which can conflict with char $ac_func(); below.  */
17528 #include <assert.h>
17529 /* Override any gcc2 internal prototype to avoid an error.  */
17530 /* We use char because int might match the return type of a gcc2
17531     builtin and then its argument prototype would still apply.  */
17532 char $ac_func();
17533 char (*f)();
17534
17535 int main() {
17536
17537 /* The GNU C library defines this for functions which it implements
17538     to always fail with ENOSYS.  Some functions are actually named
17539     something starting with __ and the normal name is an alias.  */
17540 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17541 choke me
17542 #else
17543 f = $ac_func;
17544 #endif
17545
17546 ; return 0; }
17547 EOF
17548 if { (eval echo configure:17549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17549   rm -rf conftest*
17550   eval "ac_cv_func_$ac_func=yes"
17551 else
17552   echo "configure: failed program was:" >&5
17553   cat conftest.$ac_ext >&5
17554   rm -rf conftest*
17555   eval "ac_cv_func_$ac_func=no"
17556 fi
17557 rm -f conftest*
17558 fi
17559
17560 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17561   echo "$ac_t""yes" 1>&6
17562     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17563   cat >> confdefs.h <<EOF
17564 #define $ac_tr_func 1
17565 EOF
17566  
17567 else
17568   echo "$ac_t""no" 1>&6
17569 fi
17570 done
17571
17572
17573 for ac_func in getopt
17574 do
17575 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17576 echo "configure:17577: checking for $ac_func" >&5
17577 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17578   echo $ac_n "(cached) $ac_c" 1>&6
17579 else
17580   cat > conftest.$ac_ext <<EOF
17581 #line 17582 "configure"
17582 #include "confdefs.h"
17583 /* System header to define __stub macros and hopefully few prototypes,
17584     which can conflict with char $ac_func(); below.  */
17585 #include <assert.h>
17586 /* Override any gcc2 internal prototype to avoid an error.  */
17587 /* We use char because int might match the return type of a gcc2
17588     builtin and then its argument prototype would still apply.  */
17589 char $ac_func();
17590 char (*f)();
17591
17592 int main() {
17593
17594 /* The GNU C library defines this for functions which it implements
17595     to always fail with ENOSYS.  Some functions are actually named
17596     something starting with __ and the normal name is an alias.  */
17597 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17598 choke me
17599 #else
17600 f = $ac_func;
17601 #endif
17602
17603 ; return 0; }
17604 EOF
17605 if { (eval echo configure:17606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17606   rm -rf conftest*
17607   eval "ac_cv_func_$ac_func=yes"
17608 else
17609   echo "configure: failed program was:" >&5
17610   cat conftest.$ac_ext >&5
17611   rm -rf conftest*
17612   eval "ac_cv_func_$ac_func=no"
17613 fi
17614 rm -f conftest*
17615 fi
17616
17617 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17618   echo "$ac_t""yes" 1>&6
17619     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17620   cat >> confdefs.h <<EOF
17621 #define $ac_tr_func 1
17622 EOF
17623  
17624 else
17625   echo "$ac_t""no" 1>&6
17626 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17627 fi
17628 done
17629
17630
17631
17632 if test "$ac_cv_func_getopt" != yes; then
17633         LIBSRCS="$LIBSRCS getopt.c"
17634 fi
17635
17636 # Check Configuration
17637 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17638 echo "configure:17639: checking declaration of sys_errlist" >&5
17639 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17640   echo $ac_n "(cached) $ac_c" 1>&6
17641 else
17642   
17643         cat > conftest.$ac_ext <<EOF
17644 #line 17645 "configure"
17645 #include "confdefs.h"
17646
17647 #include <stdio.h>
17648 #include <sys/types.h>
17649 #include <errno.h>
17650 #ifdef WINNT
17651 #include <stdlib.h>
17652 #endif 
17653 int main() {
17654 char *c = (char *) *sys_errlist
17655 ; return 0; }
17656 EOF
17657 if { (eval echo configure:17658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17658   rm -rf conftest*
17659   ol_cv_dcl_sys_errlist=yes
17660         ol_cv_have_sys_errlist=yes
17661 else
17662   echo "configure: failed program was:" >&5
17663   cat conftest.$ac_ext >&5
17664   rm -rf conftest*
17665   ol_cv_dcl_sys_errlist=no
17666 fi
17667 rm -f conftest*
17668 fi
17669
17670 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17671 #
17672 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17673 if test $ol_cv_dcl_sys_errlist = no ; then
17674         cat >> confdefs.h <<\EOF
17675 #define DECL_SYS_ERRLIST 1
17676 EOF
17677
17678
17679         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17680 echo "configure:17681: checking existence of sys_errlist" >&5
17681 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17682   echo $ac_n "(cached) $ac_c" 1>&6
17683 else
17684   
17685                 cat > conftest.$ac_ext <<EOF
17686 #line 17687 "configure"
17687 #include "confdefs.h"
17688 #include <errno.h>
17689 int main() {
17690 char *c = (char *) *sys_errlist
17691 ; return 0; }
17692 EOF
17693 if { (eval echo configure:17694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17694   rm -rf conftest*
17695   ol_cv_have_sys_errlist=yes
17696 else
17697   echo "configure: failed program was:" >&5
17698   cat conftest.$ac_ext >&5
17699   rm -rf conftest*
17700   ol_cv_have_sys_errlist=no
17701 fi
17702 rm -f conftest*
17703 fi
17704
17705 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17706 fi
17707 if test $ol_cv_have_sys_errlist = yes ; then
17708         cat >> confdefs.h <<\EOF
17709 #define HAVE_SYS_ERRLIST 1
17710 EOF
17711
17712 fi
17713
17714
17715
17716 if test "$ol_enable_debug" != no ; then
17717         cat >> confdefs.h <<\EOF
17718 #define LDAP_DEBUG 1
17719 EOF
17720
17721 fi
17722 if test "$ol_enable_syslog" = yes ; then
17723         cat >> confdefs.h <<\EOF
17724 #define LDAP_SYSLOG 1
17725 EOF
17726
17727 fi
17728 if test "$ol_enable_cache" = no ; then
17729         cat >> confdefs.h <<\EOF
17730 #define LDAP_NOCACHE 1
17731 EOF
17732
17733 fi
17734 if test "$ol_link_kbind" != no ; then
17735         cat >> confdefs.h <<\EOF
17736 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17737 EOF
17738
17739 fi
17740 if test "$ol_enable_proctitle" != no ; then
17741         cat >> confdefs.h <<\EOF
17742 #define LDAP_PROCTITLE 1
17743 EOF
17744
17745 fi
17746 if test "$ol_enable_referrals" != no ; then
17747         cat >> confdefs.h <<\EOF
17748 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17749 EOF
17750
17751 fi
17752 if test "$ol_enable_local" != no; then
17753         cat >> confdefs.h <<\EOF
17754 #define LDAP_PF_LOCAL 1
17755 EOF
17756
17757 fi
17758 if test "$ol_link_ipv6" != no; then
17759         cat >> confdefs.h <<\EOF
17760 #define LDAP_PF_INET6 1
17761 EOF
17762
17763 fi
17764 if test "$ol_enable_cleartext" != no ; then
17765         cat >> confdefs.h <<\EOF
17766 #define SLAPD_CLEARTEXT 1
17767 EOF
17768
17769 fi
17770 if test "$ol_enable_crypt" != no ; then
17771         cat >> confdefs.h <<\EOF
17772 #define SLAPD_CRYPT 1
17773 EOF
17774
17775 fi
17776 if test "$ol_link_kpasswd" != no ; then
17777         cat >> confdefs.h <<\EOF
17778 #define SLAPD_KPASSWD 1
17779 EOF
17780
17781 fi
17782 if test "$ol_link_spasswd" != no ; then
17783         cat >> confdefs.h <<\EOF
17784 #define SLAPD_SPASSWD 1
17785 EOF
17786
17787 fi
17788 if test "$ol_enable_phonetic" != no ; then
17789         cat >> confdefs.h <<\EOF
17790 #define SLAPD_PHONETIC 1
17791 EOF
17792
17793 fi
17794 if test "$ol_enable_rlookups" != no ; then
17795         cat >> confdefs.h <<\EOF
17796 #define SLAPD_RLOOKUPS 1
17797 EOF
17798
17799 fi
17800 if test "$ol_enable_aci" != no ; then
17801         cat >> confdefs.h <<\EOF
17802 #define SLAPD_ACI_ENABLED 1
17803 EOF
17804
17805 fi
17806
17807 if test "$ol_link_modules" != no ; then
17808         cat >> confdefs.h <<\EOF
17809 #define SLAPD_MODULES 1
17810 EOF
17811
17812         BUILD_SLAPD=yes
17813         SLAPD_MODULES_LDFLAGS="-dlopen self"
17814 fi
17815
17816 if test "$ol_enable_bdb" != no ; then
17817         cat >> confdefs.h <<\EOF
17818 #define SLAPD_BDB 1
17819 EOF
17820
17821         BUILD_SLAPD=yes
17822         BUILD_BDB=yes
17823         if test "$ol_with_bdb_module" != static ; then
17824                 cat >> confdefs.h <<\EOF
17825 #define SLAPD_BDB_DYNAMIC 1
17826 EOF
17827
17828                 BUILD_BDB=mod
17829                 BUILD_BDB_DYNAMIC=shared
17830                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17831                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
17832         else
17833                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
17834         fi
17835 fi
17836
17837 if test "$ol_link_dnssrv" != no ; then
17838         cat >> confdefs.h <<\EOF
17839 #define SLAPD_DNSSRV 1
17840 EOF
17841
17842         BUILD_SLAPD=yes
17843         BUILD_DNSSRV=yes
17844         if test "$ol_with_dnssrv_module" != static ; then
17845                 cat >> confdefs.h <<\EOF
17846 #define SLAPD_DNSSRV_DYNAMIC 1
17847 EOF
17848
17849                 BUILD_DNSSRV=mod
17850                 BUILD_DNSSRV_DYNAMIC=shared
17851                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17852                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
17853         else
17854                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
17855         fi
17856 fi
17857
17858 if test "$ol_enable_ldap" != no ; then
17859         cat >> confdefs.h <<\EOF
17860 #define SLAPD_LDAP 1
17861 EOF
17862
17863         BUILD_SLAPD=yes
17864         BUILD_LDAP=yes
17865         if test "$ol_with_ldap_module" != static ; then
17866                 cat >> confdefs.h <<\EOF
17867 #define SLAPD_LDAP_DYNAMIC 1
17868 EOF
17869
17870                 BUILD_LDAP=mod
17871                 BUILD_LDAP_DYNAMIC=shared
17872                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17873                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
17874         else
17875                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
17876         fi
17877 fi
17878
17879 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17880         cat >> confdefs.h <<\EOF
17881 #define SLAPD_LDBM 1
17882 EOF
17883
17884         BUILD_SLAPD=yes
17885         BUILD_LDBM=yes
17886         LDBM_LIB="-lldbm"
17887         if test "$ol_with_ldbm_module" != static ; then
17888                 cat >> confdefs.h <<\EOF
17889 #define SLAPD_LDBM_DYNAMIC 1
17890 EOF
17891
17892                 BUILD_LDBM=mod
17893                 BUILD_LDBM_DYNAMIC=shared
17894                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17895                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
17896         else
17897                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
17898         fi
17899 fi
17900
17901 if test "$ol_enable_meta" != no ; then
17902         if test "$ol_enable_ldap" = no ; then
17903                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17904         fi
17905         if test "$ol_enable_rewrite" = no ; then
17906                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17907         fi
17908         cat >> confdefs.h <<\EOF
17909 #define SLAPD_META 1
17910 EOF
17911
17912         BUILD_SLAPD=yes
17913         BUILD_META=yes
17914         if test "$ol_with_meta_module" != static ; then
17915                 cat >> confdefs.h <<\EOF
17916 #define SLAPD_META_DYNAMIC 1
17917 EOF
17918
17919                 BUILD_META=mod
17920                 BUILD_META_DYNAMIC=shared
17921                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17922                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
17923         else
17924                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
17925         fi
17926 fi
17927
17928 if test "$ol_enable_monitor" != no ; then
17929         cat >> confdefs.h <<\EOF
17930 #define SLAPD_MONITOR 1
17931 EOF
17932
17933         BUILD_SLAPD=yes
17934         BUILD_MONITOR=yes
17935         if test "$ol_with_monitor_module" != static ; then
17936                 cat >> confdefs.h <<\EOF
17937 #define SLAPD_MONITOR_DYNAMIC 1
17938 EOF
17939
17940                 BUILD_MONITOR=mod
17941                 BUILD_MONITOR_DYNAMIC=shared
17942                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17943                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
17944         else
17945                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
17946         fi
17947 fi
17948
17949 if test "$ol_enable_passwd" != no ; then
17950         cat >> confdefs.h <<\EOF
17951 #define SLAPD_PASSWD 1
17952 EOF
17953
17954         BUILD_SLAPD=yes
17955         BUILD_PASSWD=yes
17956         if test "$ol_with_passwd_module" != static ; then
17957                 cat >> confdefs.h <<\EOF
17958 #define SLAPD_PASSWD_DYNAMIC 1
17959 EOF
17960
17961                 BUILD_PASSWD=mod
17962                 BUILD_PASSWD_DYNAMIC=shared
17963                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17964                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
17965         else
17966                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
17967         fi
17968 fi
17969
17970 if test "$ol_link_perl" != no ; then
17971         cat >> confdefs.h <<\EOF
17972 #define SLAPD_PERL 1
17973 EOF
17974
17975         BUILD_SLAPD=yes
17976         BUILD_PERL=yes
17977         if test "$ol_with_perl_module" != static ; then
17978                 cat >> confdefs.h <<\EOF
17979 #define SLAPD_PERL_DYNAMIC 1
17980 EOF
17981
17982                 BUILD_PERL=mod
17983                 BUILD_PERL_DYNAMIC=shared
17984                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17985                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
17986         else
17987                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
17988         fi
17989 fi
17990
17991 if test "$ol_enable_shell" != no ; then
17992         cat >> confdefs.h <<\EOF
17993 #define SLAPD_SHELL 1
17994 EOF
17995
17996         BUILD_SLAPD=yes
17997         BUILD_SHELL=yes
17998         if test "$ol_with_shell_module" != static ; then
17999                 cat >> confdefs.h <<\EOF
18000 #define SLAPD_SHELL_DYNAMIC 1
18001 EOF
18002
18003                 BUILD_SHELL=mod
18004                 BUILD_SHELL_DYNAMIC=shared
18005                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
18006                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
18007         else
18008                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
18009         fi
18010 fi
18011
18012 if test "$ol_enable_tcl" != no ; then
18013         cat >> confdefs.h <<\EOF
18014 #define SLAPD_TCL 1
18015 EOF
18016
18017         BUILD_SLAPD=yes
18018         BUILD_TCL=yes
18019         if test "$ol_with_tcl_module" != static; then
18020                 cat >> confdefs.h <<\EOF
18021 #define SLAPD_TCL_DYNAMIC 1
18022 EOF
18023
18024                 BUILD_TCL=mod
18025                 BUILD_TCL_DYNAMIC=shared
18026                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
18027                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
18028         else
18029                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
18030         fi
18031 fi
18032
18033 if test "$ol_link_sql" != no ; then
18034         cat >> confdefs.h <<\EOF
18035 #define SLAPD_SQL 1
18036 EOF
18037
18038         BUILD_SLAPD=yes
18039         BUILD_SQL=yes
18040         if test "$ol_with_sql_module" != static; then
18041                 cat >> confdefs.h <<\EOF
18042 #define SLAPD_SQL_DYNAMIC 1
18043 EOF
18044
18045                 BUILD_SQL=mod
18046                 BUILD_SQL_DYNAMIC=shared
18047                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
18048                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
18049         else
18050                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
18051         fi
18052 fi
18053
18054 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
18055         $BUILD_SLAPD = yes ; then
18056         BUILD_SLURPD=yes
18057 fi
18058
18059 if test "$ol_enable_rewrite" != no ; then
18060         cat >> confdefs.h <<\EOF
18061 #define ENABLE_REWRITE 1
18062 EOF
18063
18064         BUILD_REWRITE=yes
18065         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
18066 fi
18067
18068
18069
18070 if test "$ac_cv_mingw32" = yes ; then
18071         PLAT=NT
18072         SLAPD_MODULES_LDFLAGS=
18073         SLAPD_MODULES_LIST=
18074 else
18075         PLAT=UNIX
18076 fi
18077
18078
18079
18080
18081
18082
18083   
18084   
18085   
18086   
18087   
18088   
18089   
18090   
18091   
18092   
18093   
18094   
18095   
18096   
18097   
18098   
18099   
18100   
18101   
18102   
18103   
18104   
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146 trap '' 1 2 15
18147
18148 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
18149
18150 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18151 # Let make expand exec_prefix.
18152 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18153
18154 # Any assignment to VPATH causes Sun make to only execute
18155 # the first set of double-colon rules, so remove it if not needed.
18156 # If there is a colon in the path, we need to keep it.
18157 if test "x$srcdir" = x.; then
18158   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
18159 fi
18160
18161 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
18162
18163 DEFS=-DHAVE_CONFIG_H
18164
18165 # Without the "./", some shells look in PATH for config.status.
18166 : ${CONFIG_STATUS=./config.status}
18167
18168 echo creating $CONFIG_STATUS
18169 rm -f $CONFIG_STATUS
18170 cat > $CONFIG_STATUS <<EOF
18171 #! /bin/sh
18172 # Generated automatically by configure.
18173 # Run this file to recreate the current configuration.
18174 # This directory was configured as follows,
18175 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18176 #
18177 # $0 $ac_configure_args
18178 #
18179 # Compiler output produced by configure, useful for debugging
18180 # configure, is in ./config.log if it exists.
18181
18182 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
18183 for ac_option
18184 do
18185   case "\$ac_option" in
18186   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18187     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
18188     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
18189   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
18190     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
18191     exit 0 ;;
18192   -help | --help | --hel | --he | --h)
18193     echo "\$ac_cs_usage"; exit 0 ;;
18194   *) echo "\$ac_cs_usage"; exit 1 ;;
18195   esac
18196 done
18197
18198 ac_given_srcdir=$srcdir
18199 ac_given_INSTALL="$INSTALL"
18200
18201 trap 'rm -fr `echo "\
18202 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18203 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18204 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18205 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18206 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18207 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18208 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18209 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18210 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18211 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18212 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18213 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18214 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18215 include/Makefile:build/top.mk:include/Makefile.in \
18216 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18217 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18218 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18219 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18220 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18221 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18222 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18223 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18224 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18225 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18226 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18227 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18228 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18229 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18230 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18231 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18232 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18233 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18234 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18235 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18236 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18237 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18238 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18239 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18240 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18241 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18242 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18243 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18244  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18245 EOF
18246 cat >> $CONFIG_STATUS <<EOF
18247
18248 # Protect against being on the right side of a sed subst in config.status.
18249 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18250  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18251 $ac_vpsub
18252 $extrasub
18253 s%@SHELL@%$SHELL%g
18254 s%@CFLAGS@%$CFLAGS%g
18255 s%@CPPFLAGS@%$CPPFLAGS%g
18256 s%@CXXFLAGS@%$CXXFLAGS%g
18257 s%@FFLAGS@%$FFLAGS%g
18258 s%@DEFS@%$DEFS%g
18259 s%@LDFLAGS@%$LDFLAGS%g
18260 s%@LIBS@%$LIBS%g
18261 s%@exec_prefix@%$exec_prefix%g
18262 s%@prefix@%$prefix%g
18263 s%@program_transform_name@%$program_transform_name%g
18264 s%@bindir@%$bindir%g
18265 s%@sbindir@%$sbindir%g
18266 s%@libexecdir@%$libexecdir%g
18267 s%@datadir@%$datadir%g
18268 s%@sysconfdir@%$sysconfdir%g
18269 s%@sharedstatedir@%$sharedstatedir%g
18270 s%@localstatedir@%$localstatedir%g
18271 s%@libdir@%$libdir%g
18272 s%@includedir@%$includedir%g
18273 s%@oldincludedir@%$oldincludedir%g
18274 s%@infodir@%$infodir%g
18275 s%@mandir@%$mandir%g
18276 s%@host@%$host%g
18277 s%@host_alias@%$host_alias%g
18278 s%@host_cpu@%$host_cpu%g
18279 s%@host_vendor@%$host_vendor%g
18280 s%@host_os@%$host_os%g
18281 s%@target@%$target%g
18282 s%@target_alias@%$target_alias%g
18283 s%@target_cpu@%$target_cpu%g
18284 s%@target_vendor@%$target_vendor%g
18285 s%@target_os@%$target_os%g
18286 s%@build@%$build%g
18287 s%@build_alias@%$build_alias%g
18288 s%@build_cpu@%$build_cpu%g
18289 s%@build_vendor@%$build_vendor%g
18290 s%@build_os@%$build_os%g
18291 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18292 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18293 s%@INSTALL_DATA@%$INSTALL_DATA%g
18294 s%@PACKAGE@%$PACKAGE%g
18295 s%@VERSION@%$VERSION%g
18296 s%@ACLOCAL@%$ACLOCAL%g
18297 s%@AUTOCONF@%$AUTOCONF%g
18298 s%@AUTOMAKE@%$AUTOMAKE%g
18299 s%@AUTOHEADER@%$AUTOHEADER%g
18300 s%@MAKEINFO@%$MAKEINFO%g
18301 s%@install_sh@%$install_sh%g
18302 s%@AMTAR@%$AMTAR%g
18303 s%@AWK@%$AWK%g
18304 s%@AMTARFLAGS@%$AMTARFLAGS%g
18305 s%@SET_MAKE@%$SET_MAKE%g
18306 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18307 s%@top_builddir@%$top_builddir%g
18308 s%@ldap_subdir@%$ldap_subdir%g
18309 s%@CC@%$CC%g
18310 s%@AR@%$AR%g
18311 s%@RANLIB@%$RANLIB%g
18312 s%@LN_S@%$LN_S%g
18313 s%@DLLTOOL@%$DLLTOOL%g
18314 s%@AS@%$AS%g
18315 s%@OBJDUMP@%$OBJDUMP%g
18316 s%@LIBTOOL@%$LIBTOOL%g
18317 s%@LN_H@%$LN_H%g
18318 s%@SENDMAIL@%$SENDMAIL%g
18319 s%@EDITOR@%$EDITOR%g
18320 s%@FINGER@%$FINGER%g
18321 s%@PERLBIN@%$PERLBIN%g
18322 s%@CPP@%$CPP%g
18323 s%@EXEEXT@%$EXEEXT%g
18324 s%@OBJEXT@%$OBJEXT%g
18325 s%@OL_MKDEP@%$OL_MKDEP%g
18326 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18327 s%@LIBOBJS@%$LIBOBJS%g
18328 s%@LIBSRCS@%$LIBSRCS%g
18329 s%@PLAT@%$PLAT%g
18330 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
18331 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18332 s%@BUILD_BDB@%$BUILD_BDB%g
18333 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18334 s%@BUILD_LDAP@%$BUILD_LDAP%g
18335 s%@BUILD_LDBM@%$BUILD_LDBM%g
18336 s%@BUILD_META@%$BUILD_META%g
18337 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18338 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18339 s%@BUILD_PERL@%$BUILD_PERL%g
18340 s%@BUILD_SHELL@%$BUILD_SHELL%g
18341 s%@BUILD_SQL@%$BUILD_SQL%g
18342 s%@BUILD_TCL@%$BUILD_TCL%g
18343 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18344 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18345 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18346 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18347 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18348 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18349 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18350 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18351 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18352 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18353 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18354 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18355 s%@LDBM_LIB@%$LDBM_LIB%g
18356 s%@LDAP_LIBS@%$LDAP_LIBS%g
18357 s%@LDIF_LIBS@%$LDIF_LIBS%g
18358 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18359 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18360 s%@LDBM_LIBS@%$LDBM_LIBS%g
18361 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18362 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18363 s%@WRAP_LIBS@%$WRAP_LIBS%g
18364 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18365 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18366 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18367 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18368 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
18369 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
18370 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18371 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18372 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18373 s%@KRB4_LIBS@%$KRB4_LIBS%g
18374 s%@KRB5_LIBS@%$KRB5_LIBS%g
18375 s%@READLINE_LIBS@%$READLINE_LIBS%g
18376 s%@SASL_LIBS@%$SASL_LIBS%g
18377 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18378 s%@TLS_LIBS@%$TLS_LIBS%g
18379 s%@MODULES_LIBS@%$MODULES_LIBS%g
18380 s%@AUTH_LIBS@%$AUTH_LIBS%g
18381 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18382 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18383 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18384 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18385
18386 CEOF
18387 EOF
18388
18389 cat >> $CONFIG_STATUS <<\EOF
18390
18391 # Split the substitutions into bite-sized pieces for seds with
18392 # small command number limits, like on Digital OSF/1 and HP-UX.
18393 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18394 ac_file=1 # Number of current file.
18395 ac_beg=1 # First line for current file.
18396 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18397 ac_more_lines=:
18398 ac_sed_cmds=""
18399 while $ac_more_lines; do
18400   if test $ac_beg -gt 1; then
18401     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18402   else
18403     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18404   fi
18405   if test ! -s conftest.s$ac_file; then
18406     ac_more_lines=false
18407     rm -f conftest.s$ac_file
18408   else
18409     if test -z "$ac_sed_cmds"; then
18410       ac_sed_cmds="sed -f conftest.s$ac_file"
18411     else
18412       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18413     fi
18414     ac_file=`expr $ac_file + 1`
18415     ac_beg=$ac_end
18416     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18417   fi
18418 done
18419 if test -z "$ac_sed_cmds"; then
18420   ac_sed_cmds=cat
18421 fi
18422 EOF
18423
18424 cat >> $CONFIG_STATUS <<EOF
18425
18426 CONFIG_FILES=\${CONFIG_FILES-"\
18427 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18428 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18429 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18430 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18431 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18432 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18433 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18434 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18435 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18436 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18437 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18438 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18439 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18440 include/Makefile:build/top.mk:include/Makefile.in \
18441 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18442 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18443 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18444 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18445 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18446 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18447 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18448 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18449 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18450 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18451 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18452 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18453 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18454 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18455 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18456 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18457 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18458 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18459 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18460 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18461 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18462 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18463 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18464 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18465 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18466 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18467 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18468 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18469 "}
18470 EOF
18471 cat >> $CONFIG_STATUS <<\EOF
18472 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18473   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18474   case "$ac_file" in
18475   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18476        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18477   *) ac_file_in="${ac_file}.in" ;;
18478   esac
18479
18480   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18481
18482   # Remove last slash and all that follows it.  Not all systems have dirname.
18483   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18484   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18485     # The file is in a subdirectory.
18486     test ! -d "$ac_dir" && mkdir "$ac_dir"
18487     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18488     # A "../" for each directory in $ac_dir_suffix.
18489     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18490   else
18491     ac_dir_suffix= ac_dots=
18492   fi
18493
18494   case "$ac_given_srcdir" in
18495   .)  srcdir=.
18496       if test -z "$ac_dots"; then top_srcdir=.
18497       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18498   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18499   *) # Relative path.
18500     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18501     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18502   esac
18503
18504   case "$ac_given_INSTALL" in
18505   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18506   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18507   esac
18508
18509   echo creating "$ac_file"
18510   rm -f "$ac_file"
18511   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18512   case "$ac_file" in
18513   *[Mm]akefile*) ac_comsub="1i\\
18514 # $configure_input" ;;
18515   *) ac_comsub= ;;
18516   esac
18517
18518   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18519   sed -e "$ac_comsub
18520 s%@configure_input@%$configure_input%g
18521 s%@srcdir@%$srcdir%g
18522 s%@top_srcdir@%$top_srcdir%g
18523 s%@INSTALL@%$INSTALL%g
18524 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18525 fi; done
18526 rm -f conftest.s*
18527
18528 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18529 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18530 #
18531 # ac_d sets the value in "#define NAME VALUE" lines.
18532 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18533 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18534 ac_dC='\3'
18535 ac_dD='%g'
18536 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18537 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18538 ac_uB='\([      ]\)%\1#\2define\3'
18539 ac_uC=' '
18540 ac_uD='\4%g'
18541 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18542 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18543 ac_eB='$%\1#\2define\3'
18544 ac_eC=' '
18545 ac_eD='%g'
18546
18547 if test "${CONFIG_HEADERS+set}" != set; then
18548 EOF
18549 cat >> $CONFIG_STATUS <<EOF
18550   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18551 EOF
18552 cat >> $CONFIG_STATUS <<\EOF
18553 fi
18554 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18555   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18556   case "$ac_file" in
18557   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18558        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18559   *) ac_file_in="${ac_file}.in" ;;
18560   esac
18561
18562   echo creating $ac_file
18563
18564   rm -f conftest.frag conftest.in conftest.out
18565   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18566   cat $ac_file_inputs > conftest.in
18567
18568 EOF
18569
18570 # Transform confdefs.h into a sed script conftest.vals that substitutes
18571 # the proper values into config.h.in to produce config.h.  And first:
18572 # Protect against being on the right side of a sed subst in config.status.
18573 # Protect against being in an unquoted here document in config.status.
18574 rm -f conftest.vals
18575 cat > conftest.hdr <<\EOF
18576 s/[\\&%]/\\&/g
18577 s%[\\$`]%\\&%g
18578 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18579 s%ac_d%ac_u%gp
18580 s%ac_u%ac_e%gp
18581 EOF
18582 sed -n -f conftest.hdr confdefs.h > conftest.vals
18583 rm -f conftest.hdr
18584
18585 # This sed command replaces #undef with comments.  This is necessary, for
18586 # example, in the case of _POSIX_SOURCE, which is predefined and required
18587 # on some systems where configure will not decide to define it.
18588 cat >> conftest.vals <<\EOF
18589 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18590 EOF
18591
18592 # Break up conftest.vals because some shells have a limit on
18593 # the size of here documents, and old seds have small limits too.
18594
18595 rm -f conftest.tail
18596 while :
18597 do
18598   ac_lines=`grep -c . conftest.vals`
18599   # grep -c gives empty output for an empty file on some AIX systems.
18600   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18601   # Write a limited-size here document to conftest.frag.
18602   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18603   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18604   echo 'CEOF
18605   sed -f conftest.frag conftest.in > conftest.out
18606   rm -f conftest.in
18607   mv conftest.out conftest.in
18608 ' >> $CONFIG_STATUS
18609   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18610   rm -f conftest.vals
18611   mv conftest.tail conftest.vals
18612 done
18613 rm -f conftest.vals
18614
18615 cat >> $CONFIG_STATUS <<\EOF
18616   rm -f conftest.frag conftest.h
18617   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18618   cat conftest.in >> conftest.h
18619   rm -f conftest.in
18620   if cmp -s $ac_file conftest.h 2>/dev/null; then
18621     echo "$ac_file is unchanged"
18622     rm -f conftest.h
18623   else
18624     # Remove last slash and all that follows it.  Not all systems have dirname.
18625       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18626       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18627       # The file is in a subdirectory.
18628       test ! -d "$ac_dir" && mkdir "$ac_dir"
18629     fi
18630     rm -f $ac_file
18631     mv conftest.h $ac_file
18632   fi
18633 fi; done
18634
18635 EOF
18636 cat >> $CONFIG_STATUS <<EOF
18637
18638 EOF
18639 cat >> $CONFIG_STATUS <<\EOF
18640
18641 date > stamp-h
18642 echo Please \"make depend\" to build dependencies
18643
18644 exit 0
18645 EOF
18646 chmod +x $CONFIG_STATUS
18647 rm -fr confdefs* $ac_clean_files
18648 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18649