]> git.sur5r.net Git - openldap/blob - configure
another round at cleaning it up: better naming, more attributes and so
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.395 2002/01/21 02:12:41 kurt Exp  
4
5 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-rewrite        enable rewrite [no]"
48 ac_help="$ac_help
49   --enable-x-compile      enable cross compiling [no]"
50 ac_help="$ac_help
51   --with-cyrus-sasl       with Cyrus SASL support [auto]"
52 ac_help="$ac_help
53   --with-fetch            with fetch URL support [auto]"
54 ac_help="$ac_help
55   --with-kerberos         with Kerberos support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65 SLAPD (Standalone LDAP Daemon) Options:"
66 ac_help="$ac_help
67   --enable-slapd          enable building slapd [yes]"
68 ac_help="$ac_help
69     --enable-aci          enable per-object ACIs (experimental) [no]"
70 ac_help="$ac_help
71     --enable-cleartext    enable cleartext passwords [yes]"
72 ac_help="$ac_help
73     --enable-crypt        enable crypt(3) passwords [no]"
74 ac_help="$ac_help
75     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
76 ac_help="$ac_help
77     --enable-kpasswd      enable Kerberos password verification [no]"
78 ac_help="$ac_help
79     --enable-lmpasswd     enable LAN Manager passwords [no]"
80 ac_help="$ac_help
81     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
82 ac_help="$ac_help
83     --enable-modules      enable dynamic module support [no]"
84 ac_help="$ac_help
85     --enable-phonetic     enable phonetic/soundex [no]"
86 ac_help="$ac_help
87     --enable-rlookups     enable reverse lookups [no]"
88 ac_help="$ac_help
89     --enable-slp          enable SLPv2 support [no]"
90 ac_help="$ac_help
91     --enable-wrappers     enable tcp wrapper support [no]"
92 ac_help="$ac_help
93     --enable-bdb          enable Berkeley DB backend [yes]"
94 ac_help="$ac_help
95     --with-bdb-module     module type [static]"
96 ac_help="$ac_help
97     --enable-dnssrv       enable dnssrv backend [no]"
98 ac_help="$ac_help
99     --with-dnssrv-module  module type [static]"
100 ac_help="$ac_help
101     --enable-ldap         enable ldap backend [no]"
102 ac_help="$ac_help
103     --with-ldap-module    module type [static]"
104 ac_help="$ac_help
105     --enable-ldbm         enable ldbm backend [no]"
106 ac_help="$ac_help
107     --with-ldbm-api       with LDBM API [auto]"
108 ac_help="$ac_help
109     --with-ldbm-module    module type [static]"
110 ac_help="$ac_help
111     --with-ldbm-type      use LDBM type [auto]"
112 ac_help="$ac_help
113     --enable-meta         enable metadirectory backend [no]"
114 ac_help="$ac_help
115     --with-meta-module    module type [static]"
116 ac_help="$ac_help
117     --enable-monitor      enable monitor backend [no]"
118 ac_help="$ac_help
119     --with-monitor-module module type [static]"
120 ac_help="$ac_help
121     --enable-passwd       enable passwd backend [no]"
122 ac_help="$ac_help
123     --with-passwd-module  module type [static]"
124 ac_help="$ac_help
125     --enable-perl         enable perl backend [no]"
126 ac_help="$ac_help
127     --with-perl-module    module type [static]"
128 ac_help="$ac_help
129     --enable-shell        enable shell backend [no]"
130 ac_help="$ac_help
131     --with-shell-module   module type [static]"
132 ac_help="$ac_help
133     --enable-sql          enable sql backend [no]"
134 ac_help="$ac_help
135     --with-sql-module     module type [static]"
136 ac_help="$ac_help
137     --enable-tcl          enable tcl backend [no]"
138 ac_help="$ac_help
139     --with-tcl-module     module type [static]"
140 ac_help="$ac_help
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145 Library Generation & Linking Options"
146 ac_help="$ac_help
147   --enable-static[=PKGS]  build static libraries [default=yes]"
148 ac_help="$ac_help
149   --enable-shared[=PKGS]  build shared libraries [default=yes]"
150 ac_help="$ac_help
151   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
152 ac_help="$ac_help
153   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
154 ac_help="$ac_help
155   --disable-libtool-lock  avoid locking (might break parallel builds)"
156
157 # Initialize some variables set by options.
158 # The variables have the same names as the options, with
159 # dashes changed to underlines.
160 build=NONE
161 cache_file=./config.cache
162 exec_prefix=NONE
163 host=NONE
164 no_create=
165 nonopt=NONE
166 no_recursion=
167 prefix=NONE
168 program_prefix=NONE
169 program_suffix=NONE
170 program_transform_name=s,x,x,
171 silent=
172 site=
173 srcdir=
174 target=NONE
175 verbose=
176 x_includes=NONE
177 x_libraries=NONE
178 bindir='${exec_prefix}/bin'
179 sbindir='${exec_prefix}/sbin'
180 libexecdir='${exec_prefix}/libexec'
181 datadir='${prefix}/share'
182 sysconfdir='${prefix}/etc'
183 sharedstatedir='${prefix}/com'
184 localstatedir='${prefix}/var'
185 libdir='${exec_prefix}/lib'
186 includedir='${prefix}/include'
187 oldincludedir='/usr/include'
188 infodir='${prefix}/info'
189 mandir='${prefix}/man'
190
191 # Initialize some other variables.
192 subdirs=
193 MFLAGS= MAKEFLAGS=
194 SHELL=${CONFIG_SHELL-/bin/sh}
195 # Maximum number of lines to put in a shell here document.
196 ac_max_here_lines=12
197
198 ac_prev=
199 for ac_option
200 do
201
202   # If the previous option needs an argument, assign it.
203   if test -n "$ac_prev"; then
204     eval "$ac_prev=\$ac_option"
205     ac_prev=
206     continue
207   fi
208
209   case "$ac_option" in
210   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
211   *) ac_optarg= ;;
212   esac
213
214   # Accept the important Cygnus configure options, so we can diagnose typos.
215
216   case "$ac_option" in
217
218   -bindir | --bindir | --bindi | --bind | --bin | --bi)
219     ac_prev=bindir ;;
220   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
221     bindir="$ac_optarg" ;;
222
223   -build | --build | --buil | --bui | --bu)
224     ac_prev=build ;;
225   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
226     build="$ac_optarg" ;;
227
228   -cache-file | --cache-file | --cache-fil | --cache-fi \
229   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
230     ac_prev=cache_file ;;
231   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
232   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
233     cache_file="$ac_optarg" ;;
234
235   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
236     ac_prev=datadir ;;
237   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
238   | --da=*)
239     datadir="$ac_optarg" ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
243     # Reject names that are not valid shell variable names.
244     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
245       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
246     fi
247     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
248     eval "enable_${ac_feature}=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
252     # Reject names that are not valid shell variable names.
253     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
254       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
255     fi
256     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
257     case "$ac_option" in
258       *=*) ;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_${ac_feature}='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix="$ac_optarg" ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he)
277     # Omit some internal or obsolete options to make the list less imposing.
278     # This message is too long to be a string in the A/UX 3.1 sh.
279     cat << EOF
280 Usage: configure [options] [host]
281 Options: [defaults in brackets after descriptions]
282 Configuration:
283   --cache-file=FILE       cache test results in FILE
284   --help                  print this message
285   --no-create             do not create output files
286   --quiet, --silent       do not print \`checking...' messages
287   --version               print the version of autoconf that created configure
288 Directory and file names:
289   --prefix=PREFIX         install architecture-independent files in PREFIX
290                           [$ac_default_prefix]
291   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
292                           [same as prefix]
293   --bindir=DIR            user executables in DIR [EPREFIX/bin]
294   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
295   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
296   --datadir=DIR           read-only architecture-independent data in DIR
297                           [PREFIX/share]
298   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
299   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
300                           [PREFIX/com]
301   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
302   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
303   --includedir=DIR        C header files in DIR [PREFIX/include]
304   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
305   --infodir=DIR           info documentation in DIR [PREFIX/info]
306   --mandir=DIR            man documentation in DIR [PREFIX/man]
307   --srcdir=DIR            find the sources in DIR [configure dir or ..]
308   --program-prefix=PREFIX prepend PREFIX to installed program names
309   --program-suffix=SUFFIX append SUFFIX to installed program names
310   --program-transform-name=PROGRAM
311                           run sed PROGRAM on installed program names
312 EOF
313     cat << EOF
314 Host type:
315   --build=BUILD           configure for building on BUILD [BUILD=HOST]
316   --host=HOST             configure for HOST [guessed]
317   --target=TARGET         configure for TARGET [TARGET=HOST]
318 Features and packages:
319   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
320   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
321   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
322   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
323   --x-includes=DIR        X include files are in DIR
324   --x-libraries=DIR       X library files are in DIR
325 EOF
326     if test -n "$ac_help"; then
327       echo "--enable and --with options recognized:$ac_help"
328     fi
329     exit 0 ;;
330
331   -host | --host | --hos | --ho)
332     ac_prev=host ;;
333   -host=* | --host=* | --hos=* | --ho=*)
334     host="$ac_optarg" ;;
335
336   -includedir | --includedir | --includedi | --included | --include \
337   | --includ | --inclu | --incl | --inc)
338     ac_prev=includedir ;;
339   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
340   | --includ=* | --inclu=* | --incl=* | --inc=*)
341     includedir="$ac_optarg" ;;
342
343   -infodir | --infodir | --infodi | --infod | --info | --inf)
344     ac_prev=infodir ;;
345   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
346     infodir="$ac_optarg" ;;
347
348   -libdir | --libdir | --libdi | --libd)
349     ac_prev=libdir ;;
350   -libdir=* | --libdir=* | --libdi=* | --libd=*)
351     libdir="$ac_optarg" ;;
352
353   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
354   | --libexe | --libex | --libe)
355     ac_prev=libexecdir ;;
356   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
357   | --libexe=* | --libex=* | --libe=*)
358     libexecdir="$ac_optarg" ;;
359
360   -localstatedir | --localstatedir | --localstatedi | --localstated \
361   | --localstate | --localstat | --localsta | --localst \
362   | --locals | --local | --loca | --loc | --lo)
363     ac_prev=localstatedir ;;
364   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
365   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
366   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
367     localstatedir="$ac_optarg" ;;
368
369   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
370     ac_prev=mandir ;;
371   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
372     mandir="$ac_optarg" ;;
373
374   -nfp | --nfp | --nf)
375     # Obsolete; use --without-fp.
376     with_fp=no ;;
377
378   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
379   | --no-cr | --no-c)
380     no_create=yes ;;
381
382   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
383   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
384     no_recursion=yes ;;
385
386   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
387   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
388   | --oldin | --oldi | --old | --ol | --o)
389     ac_prev=oldincludedir ;;
390   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
391   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
392   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
393     oldincludedir="$ac_optarg" ;;
394
395   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
396     ac_prev=prefix ;;
397   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
398     prefix="$ac_optarg" ;;
399
400   -program-prefix | --program-prefix | --program-prefi | --program-pref \
401   | --program-pre | --program-pr | --program-p)
402     ac_prev=program_prefix ;;
403   -program-prefix=* | --program-prefix=* | --program-prefi=* \
404   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
405     program_prefix="$ac_optarg" ;;
406
407   -program-suffix | --program-suffix | --program-suffi | --program-suff \
408   | --program-suf | --program-su | --program-s)
409     ac_prev=program_suffix ;;
410   -program-suffix=* | --program-suffix=* | --program-suffi=* \
411   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
412     program_suffix="$ac_optarg" ;;
413
414   -program-transform-name | --program-transform-name \
415   | --program-transform-nam | --program-transform-na \
416   | --program-transform-n | --program-transform- \
417   | --program-transform | --program-transfor \
418   | --program-transfo | --program-transf \
419   | --program-trans | --program-tran \
420   | --progr-tra | --program-tr | --program-t)
421     ac_prev=program_transform_name ;;
422   -program-transform-name=* | --program-transform-name=* \
423   | --program-transform-nam=* | --program-transform-na=* \
424   | --program-transform-n=* | --program-transform-=* \
425   | --program-transform=* | --program-transfor=* \
426   | --program-transfo=* | --program-transf=* \
427   | --program-trans=* | --program-tran=* \
428   | --progr-tra=* | --program-tr=* | --program-t=*)
429     program_transform_name="$ac_optarg" ;;
430
431   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
432   | -silent | --silent | --silen | --sile | --sil)
433     silent=yes ;;
434
435   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
436     ac_prev=sbindir ;;
437   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
438   | --sbi=* | --sb=*)
439     sbindir="$ac_optarg" ;;
440
441   -sharedstatedir | --sharedstatedir | --sharedstatedi \
442   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
443   | --sharedst | --shareds | --shared | --share | --shar \
444   | --sha | --sh)
445     ac_prev=sharedstatedir ;;
446   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
447   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
448   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
449   | --sha=* | --sh=*)
450     sharedstatedir="$ac_optarg" ;;
451
452   -site | --site | --sit)
453     ac_prev=site ;;
454   -site=* | --site=* | --sit=*)
455     site="$ac_optarg" ;;
456
457   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
458     ac_prev=srcdir ;;
459   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
460     srcdir="$ac_optarg" ;;
461
462   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
463   | --syscon | --sysco | --sysc | --sys | --sy)
464     ac_prev=sysconfdir ;;
465   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
466   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
467     sysconfdir="$ac_optarg" ;;
468
469   -target | --target | --targe | --targ | --tar | --ta | --t)
470     ac_prev=target ;;
471   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
472     target="$ac_optarg" ;;
473
474   -v | -verbose | --verbose | --verbos | --verbo | --verb)
475     verbose=yes ;;
476
477   -version | --version | --versio | --versi | --vers)
478     echo "configure generated by autoconf version 2.13.1"
479     exit 0 ;;
480
481   -with-* | --with-*)
482     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
483     # Reject names that are not valid shell variable names.
484     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
485       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
486     fi
487     ac_package=`echo $ac_package| sed 's/-/_/g'`
488     case "$ac_option" in
489       *=*) ;;
490       *) ac_optarg=yes ;;
491     esac
492     eval "with_${ac_package}='$ac_optarg'" ;;
493
494   -without-* | --without-*)
495     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
496     # Reject names that are not valid shell variable names.
497     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
498       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
499     fi
500     ac_package=`echo $ac_package| sed 's/-/_/g'`
501     eval "with_${ac_package}=no" ;;
502
503   --x)
504     # Obsolete; use --with-x.
505     with_x=yes ;;
506
507   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
508   | --x-incl | --x-inc | --x-in | --x-i)
509     ac_prev=x_includes ;;
510   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
511   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
512     x_includes="$ac_optarg" ;;
513
514   -x-libraries | --x-libraries | --x-librarie | --x-librari \
515   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
516     ac_prev=x_libraries ;;
517   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
518   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
519     x_libraries="$ac_optarg" ;;
520
521   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
522     ;;
523
524   *)
525     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
526       echo "configure: warning: $ac_option: invalid host type" 1>&2
527     fi
528     if test "x$nonopt" != xNONE; then
529       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
530     fi
531     nonopt="$ac_option"
532     ;;
533
534   esac
535 done
536
537 if test -n "$ac_prev"; then
538   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
539 fi
540
541 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
542
543 # File descriptor usage:
544 # 0 standard input
545 # 1 file creation
546 # 2 errors and warnings
547 # 3 some systems may open it to /dev/tty
548 # 4 used on the Kubota Titan
549 # 6 checking for... messages and results
550 # 5 compiler messages saved in config.log
551 if test "$silent" = yes; then
552   exec 6>/dev/null
553 else
554   exec 6>&1
555 fi
556 exec 5>./config.log
557
558 echo "\
559 This file contains any messages produced by compilers while
560 running configure, to aid debugging if configure makes a mistake.
561 " 1>&5
562
563 # Strip out --no-create and --no-recursion so they do not pile up.
564 # Also quote any args containing shell metacharacters.
565 ac_configure_args=
566 for ac_arg
567 do
568   case "$ac_arg" in
569   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
570   | --no-cr | --no-c) ;;
571   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
572   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
573   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
574   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
575   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
576   esac
577 done
578
579 # NLS nuisances.
580 # Only set these to C if already set.  These must not be set unconditionally
581 # because not all systems understand e.g. LANG=C (notably SCO).
582 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
583 # Non-C LC_CTYPE values break the ctype check.
584 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
585 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
586 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
587 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
588
589 # confdefs.h avoids OS command line length limits that DEFS can exceed.
590 rm -rf conftest* confdefs.h
591 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
592 echo > confdefs.h
593
594 # A filename unique to this package, relative to the directory that
595 # configure is in, which we can look for to find out if srcdir is correct.
596 ac_unique_file=build/version.sh
597
598 # Find the source files, if location was not specified.
599 if test -z "$srcdir"; then
600   ac_srcdir_defaulted=yes
601   # Try the directory containing this script, then its parent.
602   ac_prog=$0
603   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
604   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
605   srcdir=$ac_confdir
606   if test ! -r $srcdir/$ac_unique_file; then
607     srcdir=..
608   fi
609 else
610   ac_srcdir_defaulted=no
611 fi
612 if test ! -r $srcdir/$ac_unique_file; then
613   if test "$ac_srcdir_defaulted" = yes; then
614     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
615   else
616     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
617   fi
618 fi
619 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
620
621 # Prefer explicitly selected file to automatically selected ones.
622 if test -z "$CONFIG_SITE"; then
623   if test "x$prefix" != xNONE; then
624     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
625   else
626     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
627   fi
628 fi
629 for ac_site_file in $CONFIG_SITE; do
630   if test -r "$ac_site_file"; then
631     echo "loading site script $ac_site_file"
632     . "$ac_site_file"
633   fi
634 done
635
636
637 ac_ext=c
638 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
639 ac_cpp='$CPP $CPPFLAGS'
640 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
641 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
642 cross_compiling=$ac_cv_prog_cc_cross
643
644 ac_exeext=
645 ac_objext=o
646 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
647   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
648   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
649     ac_n= ac_c='
650 ' ac_t='        '
651   else
652     ac_n=-n ac_c= ac_t=
653   fi
654 else
655   ac_n= ac_c='\c' ac_t=
656 fi
657
658
659 # set unset (borrowed from autoconf 2.49c)
660 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
661   ol_unset=unset
662 else
663   ol_unset=false
664 fi
665 # unset CDPATH
666 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
667
668 ac_aux_dir=
669 for ac_dir in build $srcdir/build; do
670   if test -f $ac_dir/install-sh; then
671     ac_aux_dir=$ac_dir
672     ac_install_sh="$ac_aux_dir/install-sh -c"
673     break
674   elif test -f $ac_dir/install.sh; then
675     ac_aux_dir=$ac_dir
676     ac_install_sh="$ac_aux_dir/install.sh -c"
677     break
678   elif test -f $ac_dir/shtool; then
679     ac_aux_dir=$ac_dir
680     ac_install_sh="$ac_aux_dir/shtool install -c"
681     break
682   fi
683 done
684 if test -z "$ac_aux_dir"; then
685   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
686 fi
687 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
688 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
689 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
690
691 eval `$ac_aux_dir/version.sh`
692 if test -z "$OL_STRING"; then
693         { echo "configure: error: could not determine version" 1>&2; exit 1; }
694 fi
695
696 echo "Configuring $OL_STRING ..."
697
698
699 echo $ac_n "checking host system type""... $ac_c" 1>&6
700 echo "configure:701: checking host system type" >&5
701 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
702
703 # Make sure we can run config.sub.
704   if $ac_config_sub sun4 >/dev/null 2>&1; then :
705     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
706   fi
707
708   ac_cv_host_alias=$host
709   case "$ac_cv_host_alias" in
710   NONE)
711     case $nonopt in
712     NONE)
713       if ac_cv_host_alias=`$ac_config_guess`; then :
714       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
715       fi ;;
716     *) ac_cv_host_alias=$nonopt ;;
717     esac ;;
718   esac
719
720   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
721   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
722   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
723   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
724 else
725   echo $ac_n "(cached) $ac_c" 1>&6
726 fi
727
728 echo "$ac_t""$ac_cv_host" 1>&6
729
730 host=$ac_cv_host
731 host_alias=$ac_cv_host_alias
732 host_cpu=$ac_cv_host_cpu
733 host_vendor=$ac_cv_host_vendor
734 host_os=$ac_cv_host_os
735
736
737
738
739
740 echo $ac_n "checking target system type""... $ac_c" 1>&6
741 echo "configure:742: checking target system type" >&5
742 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
743
744 # Make sure we can run config.sub.
745   if $ac_config_sub sun4 >/dev/null 2>&1; then :
746     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
747   fi
748
749   ac_cv_target_alias=$target
750   case "$ac_cv_target_alias" in
751   NONE)
752     case $nonopt in
753     NONE)
754       ac_cv_target_alias=$host_alias ;;
755
756     *) ac_cv_target_alias=$nonopt ;;
757     esac ;;
758   esac
759
760   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
761   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
762   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
763   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
764 else
765   echo $ac_n "(cached) $ac_c" 1>&6
766 fi
767
768 echo "$ac_t""$ac_cv_target" 1>&6
769
770 target=$ac_cv_target
771 target_alias=$ac_cv_target_alias
772 target_cpu=$ac_cv_target_cpu
773 target_vendor=$ac_cv_target_vendor
774 target_os=$ac_cv_target_os
775
776
777
778
779
780 echo $ac_n "checking build system type""... $ac_c" 1>&6
781 echo "configure:782: checking build system type" >&5
782 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
783
784 # Make sure we can run config.sub.
785   if $ac_config_sub sun4 >/dev/null 2>&1; then :
786     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
787   fi
788
789   ac_cv_build_alias=$build
790   case "$ac_cv_build_alias" in
791   NONE)
792     case $nonopt in
793     NONE)
794       ac_cv_build_alias=$host_alias ;;
795
796     *) ac_cv_build_alias=$nonopt ;;
797     esac ;;
798   esac
799
800   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
801   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
802   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
803   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
804 else
805   echo $ac_n "(cached) $ac_c" 1>&6
806 fi
807
808 echo "$ac_t""$ac_cv_build" 1>&6
809
810 build=$ac_cv_build
811 build_alias=$ac_cv_build_alias
812 build_cpu=$ac_cv_build_cpu
813 build_vendor=$ac_cv_build_vendor
814 build_os=$ac_cv_build_os
815
816
817
818
819
820 # Do some error checking and defaulting for the host and target type.
821 # The inputs are:
822 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
823 #
824 # The rules are:
825 # 1. You are not allowed to specify --host, --target, and nonopt at the
826 #    same time.
827 # 2. Host defaults to nonopt.
828 # 3. If nonopt is not specified, then host defaults to the current host,
829 #    as determined by config.guess.
830 # 4. Target and build default to nonopt.
831 # 5. If nonopt is not specified, then target and build default to host.
832
833 # The aliases save the names the user supplied, while $host etc.
834 # will get canonicalized.
835 case $host---$target---$nonopt in
836 NONE---*---* | *---NONE---* | *---*---NONE) ;;
837 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
838 esac
839
840 test "$host_alias" != "$target_alias" &&
841   test "$program_prefix$program_suffix$program_transform_name" = \
842     NONENONEs,x,x, &&
843   program_prefix=${target_alias}-
844
845
846 # Find a good install program.  We prefer a C program (faster),
847 # so one script is as good as another.  But avoid the broken or
848 # incompatible versions:
849 # SysV /etc/install, /usr/sbin/install
850 # SunOS /usr/etc/install
851 # IRIX /sbin/install
852 # AIX /bin/install
853 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
854 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
855 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
856 # ./install, which can be erroneously created by make from ./install.sh.
857 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
858 echo "configure:859: checking for a BSD compatible install" >&5
859 if test -z "$INSTALL"; then
860 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
861   echo $ac_n "(cached) $ac_c" 1>&6
862 else
863     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
864   for ac_dir in $PATH; do
865     # Account for people who put trailing slashes in PATH elements.
866     case "$ac_dir/" in
867     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
868     *)
869       # OSF1 and SCO ODT 3.0 have their own names for install.
870       # Don't use installbsd from OSF since it installs stuff as root
871       # by default.
872       for ac_prog in ginstall scoinst install; do
873         if test -f $ac_dir/$ac_prog; then
874           if test $ac_prog = install &&
875             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
876             # AIX install.  It has an incompatible calling convention.
877             :
878           elif test $ac_prog = install &&
879             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
880             # program-specific install script used by HP pwplus--don't use.
881             :
882           else
883             ac_cv_path_install="$ac_dir/$ac_prog -c"
884             break 2
885           fi
886         fi
887       done
888       ;;
889     esac
890   done
891   IFS="$ac_save_IFS"
892
893 fi
894   if test "${ac_cv_path_install+set}" = set; then
895     INSTALL="$ac_cv_path_install"
896   else
897     # As a last resort, use the slow shell script.  We don't cache a
898     # path for INSTALL within a source directory, because that will
899     # break other packages using the cache if that directory is
900     # removed, or if the path is relative.
901     INSTALL="$ac_install_sh"
902   fi
903 fi
904 echo "$ac_t""$INSTALL" 1>&6
905
906 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
907 # It thinks the first close brace ends the variable substitution.
908 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
909
910 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
911
912 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
913
914 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
915 echo "configure:916: checking whether build environment is sane" >&5
916 # Just in case
917 sleep 1
918 echo timestamp > conftestfile
919 # Do `set' in a subshell so we don't clobber the current shell's
920 # arguments.  Must try -L first in case configure is actually a
921 # symlink; some systems play weird games with the mod time of symlinks
922 # (eg FreeBSD returns the mod time of the symlink's containing
923 # directory).
924 if (
925    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
926    if test "$*" = "X"; then
927       # -L didn't work.
928       set X `ls -t $srcdir/configure conftestfile`
929    fi
930    if test "$*" != "X $srcdir/configure conftestfile" \
931       && test "$*" != "X conftestfile $srcdir/configure"; then
932
933       # If neither matched, then we have a broken ls.  This can happen
934       # if, for instance, CONFIG_SHELL is bash and it inherits a
935       # broken ls alias from the environment.  This has actually
936       # happened.  Such a system could not be considered "sane".
937       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
938 alias in your environment" 1>&2; exit 1; }
939    fi
940
941    test "$2" = conftestfile
942    )
943 then
944    # Ok.
945    :
946 else
947    { echo "configure: error: newly created file is older than distributed files!
948 Check your system clock" 1>&2; exit 1; }
949 fi
950 rm -f conftest*
951 echo "$ac_t""yes" 1>&6
952 if test "$program_transform_name" = s,x,x,; then
953   program_transform_name=
954 else
955   # Double any \ or $.  echo might interpret backslashes.
956   cat <<\EOF_SED > conftestsed
957 s,\\,\\\\,g; s,\$,$$,g
958 EOF_SED
959   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
960   rm -f conftestsed
961 fi
962 test "$program_prefix" != NONE &&
963   program_transform_name="s,^,${program_prefix},;$program_transform_name"
964 # Use a double $ so make ignores it.
965 test "$program_suffix" != NONE &&
966   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
967
968 # sed with no file args requires a program.
969 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
970
971 for ac_prog in mawk gawk nawk awk
972 do
973 # Extract the first word of "$ac_prog", so it can be a program name with args.
974 set dummy $ac_prog; ac_word=$2
975 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
976 echo "configure:977: checking for $ac_word" >&5
977 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   if test -n "$AWK"; then
981   ac_cv_prog_AWK="$AWK" # Let the user override the test.
982 else
983   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
984   ac_dummy="$PATH"
985   for ac_dir in $ac_dummy; do
986     test -z "$ac_dir" && ac_dir=.
987     if test -f $ac_dir/$ac_word; then
988       ac_cv_prog_AWK="$ac_prog"
989       break
990     fi
991   done
992   IFS="$ac_save_ifs"
993 fi
994 fi
995 AWK="$ac_cv_prog_AWK"
996 if test -n "$AWK"; then
997   echo "$ac_t""$AWK" 1>&6
998 else
999   echo "$ac_t""no" 1>&6
1000 fi
1001
1002 test -n "$AWK" && break
1003 done
1004
1005 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether ${MAKE-make} sets \${MAKE}" >&5
1007 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1008 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1009   echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011   cat > conftestmake <<\EOF
1012 all:
1013         @echo 'ac_maketemp="${MAKE}"'
1014 EOF
1015 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1016 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1017 if test -n "$ac_maketemp"; then
1018   eval ac_cv_prog_make_${ac_make}_set=yes
1019 else
1020   eval ac_cv_prog_make_${ac_make}_set=no
1021 fi
1022 rm -f conftestmake
1023 fi
1024 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1025   echo "$ac_t""yes" 1>&6
1026   SET_MAKE=
1027 else
1028   echo "$ac_t""no" 1>&6
1029   SET_MAKE="MAKE=${MAKE-make}"
1030 fi
1031
1032
1033
1034 PACKAGE=$OL_PACKAGE
1035
1036 VERSION=$OL_VERSION
1037
1038 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1039   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1040 fi
1041
1042
1043
1044 missing_dir=`cd $ac_aux_dir && pwd`
1045 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working aclocal" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1051    ACLOCAL=aclocal
1052    echo "$ac_t""found" 1>&6
1053 else
1054    ACLOCAL="$missing_dir/missing aclocal"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoconf" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOCONF=autoconf
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOCONF="$missing_dir/missing autoconf"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working automake" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (automake --version) < /dev/null > /dev/null 2>&1; then
1077    AUTOMAKE=automake
1078    echo "$ac_t""found" 1>&6
1079 else
1080    AUTOMAKE="$missing_dir/missing automake"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1085 echo "configure:1086: checking for working autoheader" >&5
1086 # Run test in a subshell; some versions of sh will print an error if
1087 # an executable is not found, even if stderr is redirected.
1088 # Redirect stdin to placate older versions of autoconf.  Sigh.
1089 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1090    AUTOHEADER=autoheader
1091    echo "$ac_t""found" 1>&6
1092 else
1093    AUTOHEADER="$missing_dir/missing autoheader"
1094    echo "$ac_t""missing" 1>&6
1095 fi
1096
1097 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1098 echo "configure:1099: checking for working makeinfo" >&5
1099 # Run test in a subshell; some versions of sh will print an error if
1100 # an executable is not found, even if stderr is redirected.
1101 # Redirect stdin to placate older versions of autoconf.  Sigh.
1102 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1103    MAKEINFO=makeinfo
1104    echo "$ac_t""found" 1>&6
1105 else
1106    MAKEINFO="$missing_dir/missing makeinfo"
1107    echo "$ac_t""missing" 1>&6
1108 fi
1109
1110 install_sh="$missing_dir/install-sh"
1111 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1112
1113 for ac_prog in gnutar gtar tar
1114 do
1115 # Extract the first word of "$ac_prog", so it can be a program name with args.
1116 set dummy $ac_prog; ac_word=$2
1117 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1118 echo "configure:1119: checking for $ac_word" >&5
1119 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1120   echo $ac_n "(cached) $ac_c" 1>&6
1121 else
1122   if test -n "$AMTAR"; then
1123   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1124 else
1125   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1126   ac_dummy="$PATH"
1127   for ac_dir in $ac_dummy; do
1128     test -z "$ac_dir" && ac_dir=.
1129     if test -f $ac_dir/$ac_word; then
1130       ac_cv_prog_AMTAR="$ac_prog"
1131       break
1132     fi
1133   done
1134   IFS="$ac_save_ifs"
1135 fi
1136 fi
1137 AMTAR="$ac_cv_prog_AMTAR"
1138 if test -n "$AMTAR"; then
1139   echo "$ac_t""$AMTAR" 1>&6
1140 else
1141   echo "$ac_t""no" 1>&6
1142 fi
1143
1144 test -n "$AMTAR" && break
1145 done
1146
1147
1148 AMTARFLAGS=
1149 if test -n "$AMTAR"; then
1150   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1151         AMTARFLAGS=o
1152   fi
1153 fi
1154
1155 cat >> confdefs.h <<EOF
1156 #define OPENLDAP_PACKAGE "$PACKAGE"
1157 EOF
1158
1159 cat >> confdefs.h <<EOF
1160 #define OPENLDAP_VERSION "$VERSION"
1161 EOF
1162
1163
1164 cat >> confdefs.h <<EOF
1165 #define LDAP_VENDOR_VERSION $OL_API_INC
1166 EOF
1167
1168 cat >> confdefs.h <<EOF
1169 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1170 EOF
1171
1172 cat >> confdefs.h <<EOF
1173 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1174 EOF
1175
1176 cat >> confdefs.h <<EOF
1177 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1178 EOF
1179
1180
1181 OPENLDAP_LIBVERSION=$OL_API_LIB
1182
1183
1184
1185 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1186 echo "configure:1187: checking configure arguments" >&5
1187
1188
1189 top_builddir=`pwd`
1190
1191 ldap_subdir="/openldap"
1192
1193 # Check whether --with-subdir or --without-subdir was given.
1194 if test "${with_subdir+set}" = set; then
1195   withval="$with_subdir"
1196   case "$withval" in
1197         no) ldap_subdir=""
1198                 ;;
1199         yes)
1200                 ;;
1201         /*|\\*)
1202                 ldap_subdir="$withval"
1203                 ;;
1204         *)
1205                 ldap_subdir="/$withval"
1206                 ;;
1207 esac
1208
1209 fi
1210
1211
1212 # OpenLDAP --enable-debug
1213         # Check whether --enable-debug or --disable-debug was given.
1214 if test "${enable_debug+set}" = set; then
1215   enableval="$enable_debug"
1216   
1217         ol_arg=invalid
1218         for ol_val in auto yes no ; do
1219                 if test "$enableval" = "$ol_val" ; then
1220                         ol_arg="$ol_val"
1221                 fi
1222         done
1223         if test "$ol_arg" = "invalid" ; then
1224                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1225         fi
1226         ol_enable_debug="$ol_arg"
1227
1228 else
1229         ol_enable_debug="yes"
1230 fi
1231 # end --enable-debug
1232 # OpenLDAP --enable-syslog
1233         # Check whether --enable-syslog or --disable-syslog was given.
1234 if test "${enable_syslog+set}" = set; then
1235   enableval="$enable_syslog"
1236   
1237         ol_arg=invalid
1238         for ol_val in auto yes no ; do
1239                 if test "$enableval" = "$ol_val" ; then
1240                         ol_arg="$ol_val"
1241                 fi
1242         done
1243         if test "$ol_arg" = "invalid" ; then
1244                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1245         fi
1246         ol_enable_syslog="$ol_arg"
1247
1248 else
1249         ol_enable_syslog="auto"
1250 fi
1251 # end --enable-syslog
1252 # OpenLDAP --enable-proctitle
1253         # Check whether --enable-proctitle or --disable-proctitle was given.
1254 if test "${enable_proctitle+set}" = set; then
1255   enableval="$enable_proctitle"
1256   
1257         ol_arg=invalid
1258         for ol_val in auto yes no ; do
1259                 if test "$enableval" = "$ol_val" ; then
1260                         ol_arg="$ol_val"
1261                 fi
1262         done
1263         if test "$ol_arg" = "invalid" ; then
1264                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1265         fi
1266         ol_enable_proctitle="$ol_arg"
1267
1268 else
1269         ol_enable_proctitle="yes"
1270 fi
1271 # end --enable-proctitle
1272 # OpenLDAP --enable-cache
1273         # Check whether --enable-cache or --disable-cache was given.
1274 if test "${enable_cache+set}" = set; then
1275   enableval="$enable_cache"
1276   
1277         ol_arg=invalid
1278         for ol_val in auto yes no ; do
1279                 if test "$enableval" = "$ol_val" ; then
1280                         ol_arg="$ol_val"
1281                 fi
1282         done
1283         if test "$ol_arg" = "invalid" ; then
1284                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1285         fi
1286         ol_enable_cache="$ol_arg"
1287
1288 else
1289         ol_enable_cache="no"
1290 fi
1291 # end --enable-cache
1292 # OpenLDAP --enable-referrals
1293         # Check whether --enable-referrals or --disable-referrals was given.
1294 if test "${enable_referrals+set}" = set; then
1295   enableval="$enable_referrals"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1305         fi
1306         ol_enable_referrals="$ol_arg"
1307
1308 else
1309         ol_enable_referrals="no"
1310 fi
1311 # end --enable-referrals
1312 # OpenLDAP --enable-kbind
1313         # Check whether --enable-kbind or --disable-kbind was given.
1314 if test "${enable_kbind+set}" = set; then
1315   enableval="$enable_kbind"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1325         fi
1326         ol_enable_kbind="$ol_arg"
1327
1328 else
1329         ol_enable_kbind="no"
1330 fi
1331 # end --enable-kbind
1332 # OpenLDAP --enable-ipv6
1333         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1334 if test "${enable_ipv6+set}" = set; then
1335   enableval="$enable_ipv6"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto yes no ; do
1339                 if test "$enableval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1345         fi
1346         ol_enable_ipv6="$ol_arg"
1347
1348 else
1349         ol_enable_ipv6="auto"
1350 fi
1351 # end --enable-ipv6
1352 # OpenLDAP --enable-local
1353         # Check whether --enable-local or --disable-local was given.
1354 if test "${enable_local+set}" = set; then
1355   enableval="$enable_local"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no ; do
1359                 if test "$enableval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1365         fi
1366         ol_enable_local="$ol_arg"
1367
1368 else
1369         ol_enable_local="auto"
1370 fi
1371 # end --enable-local
1372 # OpenLDAP --enable-rewrite
1373         # Check whether --enable-rewrite or --disable-rewrite was given.
1374 if test "${enable_rewrite+set}" = set; then
1375   enableval="$enable_rewrite"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto yes no ; do
1379                 if test "$enableval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1385         fi
1386         ol_enable_rewrite="$ol_arg"
1387
1388 else
1389         ol_enable_rewrite="no"
1390 fi
1391 # end --enable-rewrite
1392 # OpenLDAP --enable-x_compile
1393         # Check whether --enable-x_compile or --disable-x_compile was given.
1394 if test "${enable_x_compile+set}" = set; then
1395   enableval="$enable_x_compile"
1396   
1397         ol_arg=invalid
1398         for ol_val in yes no ; do
1399                 if test "$enableval" = "$ol_val" ; then
1400                         ol_arg="$ol_val"
1401                 fi
1402         done
1403         if test "$ol_arg" = "invalid" ; then
1404                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1405         fi
1406         ol_enable_x_compile="$ol_arg"
1407
1408 else
1409         ol_enable_x_compile="no"
1410 fi
1411 # end --enable-x_compile
1412
1413
1414 # OpenLDAP --with-cyrus_sasl
1415         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1416 if test "${with_cyrus_sasl+set}" = set; then
1417   withval="$with_cyrus_sasl"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no  ; do
1421                 if test "$withval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1427         fi
1428         ol_with_cyrus_sasl="$ol_arg"
1429
1430 else
1431         ol_with_cyrus_sasl="auto"
1432 fi
1433 # end --with-cyrus_sasl
1434
1435 # OpenLDAP --with-fetch
1436         # Check whether --with-fetch or --without-fetch was given.
1437 if test "${with_fetch+set}" = set; then
1438   withval="$with_fetch"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1448         fi
1449         ol_with_fetch="$ol_arg"
1450
1451 else
1452         ol_with_fetch="auto"
1453 fi
1454 # end --with-fetch
1455
1456 # OpenLDAP --with-kerberos
1457         # Check whether --with-kerberos or --without-kerberos was given.
1458 if test "${with_kerberos+set}" = set; then
1459   withval="$with_kerberos"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1469         fi
1470         ol_with_kerberos="$ol_arg"
1471
1472 else
1473         ol_with_kerberos="auto"
1474 fi
1475 # end --with-kerberos
1476
1477 # OpenLDAP --with-readline
1478         # Check whether --with-readline or --without-readline was given.
1479 if test "${with_readline+set}" = set; then
1480   withval="$with_readline"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no  ; do
1484                 if test "$withval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1490         fi
1491         ol_with_readline="$ol_arg"
1492
1493 else
1494         ol_with_readline="auto"
1495 fi
1496 # end --with-readline
1497
1498 # OpenLDAP --with-threads
1499         # Check whether --with-threads or --without-threads was given.
1500 if test "${with_threads+set}" = set; then
1501   withval="$with_threads"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1505                 if test "$withval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1511         fi
1512         ol_with_threads="$ol_arg"
1513
1514 else
1515         ol_with_threads="auto"
1516 fi
1517 # end --with-threads
1518
1519 # OpenLDAP --with-tls
1520         # Check whether --with-tls or --without-tls was given.
1521 if test "${with_tls+set}" = set; then
1522   withval="$with_tls"
1523   
1524         ol_arg=invalid
1525         for ol_val in auto ssleay openssl yes no  ; do
1526                 if test "$withval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1532         fi
1533         ol_with_tls="$ol_arg"
1534
1535 else
1536         ol_with_tls="auto"
1537 fi
1538 # end --with-tls
1539
1540 # OpenLDAP --with-yielding_select
1541         # Check whether --with-yielding_select or --without-yielding_select was given.
1542 if test "${with_yielding_select+set}" = set; then
1543   withval="$with_yielding_select"
1544   
1545         ol_arg=invalid
1546         for ol_val in auto yes no manual  ; do
1547                 if test "$withval" = "$ol_val" ; then
1548                         ol_arg="$ol_val"
1549                 fi
1550         done
1551         if test "$ol_arg" = "invalid" ; then
1552                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1553         fi
1554         ol_with_yielding_select="$ol_arg"
1555
1556 else
1557         ol_with_yielding_select="auto"
1558 fi
1559 # end --with-yielding_select
1560
1561
1562
1563 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1564 if test "${with_xxslapdoptions+set}" = set; then
1565   withval="$with_xxslapdoptions"
1566   :
1567 fi
1568
1569 # OpenLDAP --enable-slapd
1570         # Check whether --enable-slapd or --disable-slapd was given.
1571 if test "${enable_slapd+set}" = set; then
1572   enableval="$enable_slapd"
1573   
1574         ol_arg=invalid
1575         for ol_val in auto yes no ; do
1576                 if test "$enableval" = "$ol_val" ; then
1577                         ol_arg="$ol_val"
1578                 fi
1579         done
1580         if test "$ol_arg" = "invalid" ; then
1581                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1582         fi
1583         ol_enable_slapd="$ol_arg"
1584
1585 else
1586         ol_enable_slapd="yes"
1587 fi
1588 # end --enable-slapd
1589 # OpenLDAP --enable-aci
1590         # Check whether --enable-aci or --disable-aci was given.
1591 if test "${enable_aci+set}" = set; then
1592   enableval="$enable_aci"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no ; do
1596                 if test "$enableval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1602         fi
1603         ol_enable_aci="$ol_arg"
1604
1605 else
1606         ol_enable_aci="no"
1607 fi
1608 # end --enable-aci
1609 # OpenLDAP --enable-cleartext
1610         # Check whether --enable-cleartext or --disable-cleartext was given.
1611 if test "${enable_cleartext+set}" = set; then
1612   enableval="$enable_cleartext"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto yes no ; do
1616                 if test "$enableval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1622         fi
1623         ol_enable_cleartext="$ol_arg"
1624
1625 else
1626         ol_enable_cleartext="yes"
1627 fi
1628 # end --enable-cleartext
1629 # OpenLDAP --enable-crypt
1630         # Check whether --enable-crypt or --disable-crypt was given.
1631 if test "${enable_crypt+set}" = set; then
1632   enableval="$enable_crypt"
1633   
1634         ol_arg=invalid
1635         for ol_val in auto yes no ; do
1636                 if test "$enableval" = "$ol_val" ; then
1637                         ol_arg="$ol_val"
1638                 fi
1639         done
1640         if test "$ol_arg" = "invalid" ; then
1641                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1642         fi
1643         ol_enable_crypt="$ol_arg"
1644
1645 else
1646         ol_enable_crypt="no"
1647 fi
1648 # end --enable-crypt
1649 # OpenLDAP --enable-dynamic
1650         # Check whether --enable-dynamic or --disable-dynamic was given.
1651 if test "${enable_dynamic+set}" = set; then
1652   enableval="$enable_dynamic"
1653   
1654         ol_arg=invalid
1655         for ol_val in auto yes no ; do
1656                 if test "$enableval" = "$ol_val" ; then
1657                         ol_arg="$ol_val"
1658                 fi
1659         done
1660         if test "$ol_arg" = "invalid" ; then
1661                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1662         fi
1663         ol_enable_dynamic="$ol_arg"
1664
1665 else
1666         ol_enable_dynamic="no"
1667 fi
1668 # end --enable-dynamic
1669 # OpenLDAP --enable-kpasswd
1670         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1671 if test "${enable_kpasswd+set}" = set; then
1672   enableval="$enable_kpasswd"
1673   
1674         ol_arg=invalid
1675         for ol_val in auto yes no ; do
1676                 if test "$enableval" = "$ol_val" ; then
1677                         ol_arg="$ol_val"
1678                 fi
1679         done
1680         if test "$ol_arg" = "invalid" ; then
1681                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1682         fi
1683         ol_enable_kpasswd="$ol_arg"
1684
1685 else
1686         ol_enable_kpasswd="no"
1687 fi
1688 # end --enable-kpasswd
1689 # OpenLDAP --enable-lmpasswd
1690         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1691 if test "${enable_lmpasswd+set}" = set; then
1692   enableval="$enable_lmpasswd"
1693   
1694         ol_arg=invalid
1695         for ol_val in auto yes no ; do
1696                 if test "$enableval" = "$ol_val" ; then
1697                         ol_arg="$ol_val"
1698                 fi
1699         done
1700         if test "$ol_arg" = "invalid" ; then
1701                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1702         fi
1703         ol_enable_lmpasswd="$ol_arg"
1704
1705 else
1706         ol_enable_lmpasswd="no"
1707 fi
1708 # end --enable-lmpasswd
1709 # OpenLDAP --enable-spasswd
1710         # Check whether --enable-spasswd or --disable-spasswd was given.
1711 if test "${enable_spasswd+set}" = set; then
1712   enableval="$enable_spasswd"
1713   
1714         ol_arg=invalid
1715         for ol_val in auto yes no ; do
1716                 if test "$enableval" = "$ol_val" ; then
1717                         ol_arg="$ol_val"
1718                 fi
1719         done
1720         if test "$ol_arg" = "invalid" ; then
1721                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1722         fi
1723         ol_enable_spasswd="$ol_arg"
1724
1725 else
1726         ol_enable_spasswd="no"
1727 fi
1728 # end --enable-spasswd
1729 # OpenLDAP --enable-modules
1730         # Check whether --enable-modules or --disable-modules was given.
1731 if test "${enable_modules+set}" = set; then
1732   enableval="$enable_modules"
1733   
1734         ol_arg=invalid
1735         for ol_val in auto yes no ; do
1736                 if test "$enableval" = "$ol_val" ; then
1737                         ol_arg="$ol_val"
1738                 fi
1739         done
1740         if test "$ol_arg" = "invalid" ; then
1741                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1742         fi
1743         ol_enable_modules="$ol_arg"
1744
1745 else
1746         ol_enable_modules="no"
1747 fi
1748 # end --enable-modules
1749 # OpenLDAP --enable-phonetic
1750         # Check whether --enable-phonetic or --disable-phonetic was given.
1751 if test "${enable_phonetic+set}" = set; then
1752   enableval="$enable_phonetic"
1753   
1754         ol_arg=invalid
1755         for ol_val in auto yes no ; do
1756                 if test "$enableval" = "$ol_val" ; then
1757                         ol_arg="$ol_val"
1758                 fi
1759         done
1760         if test "$ol_arg" = "invalid" ; then
1761                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1762         fi
1763         ol_enable_phonetic="$ol_arg"
1764
1765 else
1766         ol_enable_phonetic="no"
1767 fi
1768 # end --enable-phonetic
1769 # OpenLDAP --enable-rlookups
1770         # Check whether --enable-rlookups or --disable-rlookups was given.
1771 if test "${enable_rlookups+set}" = set; then
1772   enableval="$enable_rlookups"
1773   
1774         ol_arg=invalid
1775         for ol_val in auto yes no ; do
1776                 if test "$enableval" = "$ol_val" ; then
1777                         ol_arg="$ol_val"
1778                 fi
1779         done
1780         if test "$ol_arg" = "invalid" ; then
1781                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1782         fi
1783         ol_enable_rlookups="$ol_arg"
1784
1785 else
1786         ol_enable_rlookups="no"
1787 fi
1788 # end --enable-rlookups
1789 # OpenLDAP --enable-slp
1790         # Check whether --enable-slp or --disable-slp was given.
1791 if test "${enable_slp+set}" = set; then
1792   enableval="$enable_slp"
1793   
1794         ol_arg=invalid
1795         for ol_val in auto yes no ; do
1796                 if test "$enableval" = "$ol_val" ; then
1797                         ol_arg="$ol_val"
1798                 fi
1799         done
1800         if test "$ol_arg" = "invalid" ; then
1801                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1802         fi
1803         ol_enable_slp="$ol_arg"
1804
1805 else
1806         ol_enable_slp="no"
1807 fi
1808 # end --enable-slp
1809 # OpenLDAP --enable-wrappers
1810         # Check whether --enable-wrappers or --disable-wrappers was given.
1811 if test "${enable_wrappers+set}" = set; then
1812   enableval="$enable_wrappers"
1813   
1814         ol_arg=invalid
1815         for ol_val in auto yes no ; do
1816                 if test "$enableval" = "$ol_val" ; then
1817                         ol_arg="$ol_val"
1818                 fi
1819         done
1820         if test "$ol_arg" = "invalid" ; then
1821                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1822         fi
1823         ol_enable_wrappers="$ol_arg"
1824
1825 else
1826         ol_enable_wrappers="no"
1827 fi
1828 # end --enable-wrappers
1829
1830 # OpenLDAP --enable-bdb
1831         # Check whether --enable-bdb or --disable-bdb was given.
1832 if test "${enable_bdb+set}" = set; then
1833   enableval="$enable_bdb"
1834   
1835         ol_arg=invalid
1836         for ol_val in auto yes no ; do
1837                 if test "$enableval" = "$ol_val" ; then
1838                         ol_arg="$ol_val"
1839                 fi
1840         done
1841         if test "$ol_arg" = "invalid" ; then
1842                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1843         fi
1844         ol_enable_bdb="$ol_arg"
1845
1846 else
1847         ol_enable_bdb="yes"
1848 fi
1849 # end --enable-bdb
1850 # OpenLDAP --with-bdb_module
1851         # Check whether --with-bdb_module or --without-bdb_module was given.
1852 if test "${with_bdb_module+set}" = set; then
1853   withval="$with_bdb_module"
1854   
1855         ol_arg=invalid
1856         for ol_val in static dynamic ; do
1857                 if test "$withval" = "$ol_val" ; then
1858                         ol_arg="$ol_val"
1859                 fi
1860         done
1861         if test "$ol_arg" = "invalid" ; then
1862                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1863         fi
1864         ol_with_bdb_module="$ol_arg"
1865
1866 else
1867         ol_with_bdb_module="static"
1868 fi
1869 # end --with-bdb_module
1870
1871 # OpenLDAP --enable-dnssrv
1872         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1873 if test "${enable_dnssrv+set}" = set; then
1874   enableval="$enable_dnssrv"
1875   
1876         ol_arg=invalid
1877         for ol_val in auto yes no ; do
1878                 if test "$enableval" = "$ol_val" ; then
1879                         ol_arg="$ol_val"
1880                 fi
1881         done
1882         if test "$ol_arg" = "invalid" ; then
1883                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1884         fi
1885         ol_enable_dnssrv="$ol_arg"
1886
1887 else
1888         ol_enable_dnssrv="no"
1889 fi
1890 # end --enable-dnssrv
1891 # OpenLDAP --with-dnssrv_module
1892         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1893 if test "${with_dnssrv_module+set}" = set; then
1894   withval="$with_dnssrv_module"
1895   
1896         ol_arg=invalid
1897         for ol_val in static dynamic ; do
1898                 if test "$withval" = "$ol_val" ; then
1899                         ol_arg="$ol_val"
1900                 fi
1901         done
1902         if test "$ol_arg" = "invalid" ; then
1903                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1904         fi
1905         ol_with_dnssrv_module="$ol_arg"
1906
1907 else
1908         ol_with_dnssrv_module="static"
1909 fi
1910 # end --with-dnssrv_module
1911
1912 # OpenLDAP --enable-ldap
1913         # Check whether --enable-ldap or --disable-ldap was given.
1914 if test "${enable_ldap+set}" = set; then
1915   enableval="$enable_ldap"
1916   
1917         ol_arg=invalid
1918         for ol_val in auto yes no ; do
1919                 if test "$enableval" = "$ol_val" ; then
1920                         ol_arg="$ol_val"
1921                 fi
1922         done
1923         if test "$ol_arg" = "invalid" ; then
1924                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1925         fi
1926         ol_enable_ldap="$ol_arg"
1927
1928 else
1929         ol_enable_ldap="no"
1930 fi
1931 # end --enable-ldap
1932 # OpenLDAP --with-ldap_module
1933         # Check whether --with-ldap_module or --without-ldap_module was given.
1934 if test "${with_ldap_module+set}" = set; then
1935   withval="$with_ldap_module"
1936   
1937         ol_arg=invalid
1938         for ol_val in static dynamic ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1945         fi
1946         ol_with_ldap_module="$ol_arg"
1947
1948 else
1949         ol_with_ldap_module="static"
1950 fi
1951 # end --with-ldap_module
1952
1953 # OpenLDAP --enable-ldbm
1954         # Check whether --enable-ldbm or --disable-ldbm was given.
1955 if test "${enable_ldbm+set}" = set; then
1956   enableval="$enable_ldbm"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1966         fi
1967         ol_enable_ldbm="$ol_arg"
1968
1969 else
1970         ol_enable_ldbm="no"
1971 fi
1972 # end --enable-ldbm
1973 # OpenLDAP --with-ldbm_api
1974         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1975 if test "${with_ldbm_api+set}" = set; then
1976   withval="$with_ldbm_api"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1986         fi
1987         ol_with_ldbm_api="$ol_arg"
1988
1989 else
1990         ol_with_ldbm_api="auto"
1991 fi
1992 # end --with-ldbm_api
1993
1994 # OpenLDAP --with-ldbm_module
1995         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1996 if test "${with_ldbm_module+set}" = set; then
1997   withval="$with_ldbm_module"
1998   
1999         ol_arg=invalid
2000         for ol_val in static dynamic ; do
2001                 if test "$withval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2007         fi
2008         ol_with_ldbm_module="$ol_arg"
2009
2010 else
2011         ol_with_ldbm_module="static"
2012 fi
2013 # end --with-ldbm_module
2014
2015 # OpenLDAP --with-ldbm_type
2016         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2017 if test "${with_ldbm_type+set}" = set; then
2018   withval="$with_ldbm_type"
2019   
2020         ol_arg=invalid
2021         for ol_val in auto btree hash ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2028         fi
2029         ol_with_ldbm_type="$ol_arg"
2030
2031 else
2032         ol_with_ldbm_type="auto"
2033 fi
2034 # end --with-ldbm_type
2035
2036 # OpenLDAP --enable-meta
2037         # Check whether --enable-meta or --disable-meta was given.
2038 if test "${enable_meta+set}" = set; then
2039   enableval="$enable_meta"
2040   
2041         ol_arg=invalid
2042         for ol_val in auto yes no ; do
2043                 if test "$enableval" = "$ol_val" ; then
2044                         ol_arg="$ol_val"
2045                 fi
2046         done
2047         if test "$ol_arg" = "invalid" ; then
2048                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2049         fi
2050         ol_enable_meta="$ol_arg"
2051
2052 else
2053         ol_enable_meta="no"
2054 fi
2055 # end --enable-meta
2056 # OpenLDAP --with-meta_module
2057         # Check whether --with-meta_module or --without-meta_module was given.
2058 if test "${with_meta_module+set}" = set; then
2059   withval="$with_meta_module"
2060   
2061         ol_arg=invalid
2062         for ol_val in static dynamic ; do
2063                 if test "$withval" = "$ol_val" ; then
2064                         ol_arg="$ol_val"
2065                 fi
2066         done
2067         if test "$ol_arg" = "invalid" ; then
2068                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2069         fi
2070         ol_with_meta_module="$ol_arg"
2071
2072 else
2073         ol_with_meta_module="static"
2074 fi
2075 # end --with-meta_module
2076
2077 # OpenLDAP --enable-monitor
2078         # Check whether --enable-monitor or --disable-monitor was given.
2079 if test "${enable_monitor+set}" = set; then
2080   enableval="$enable_monitor"
2081   
2082         ol_arg=invalid
2083         for ol_val in auto yes no ; do
2084                 if test "$enableval" = "$ol_val" ; then
2085                         ol_arg="$ol_val"
2086                 fi
2087         done
2088         if test "$ol_arg" = "invalid" ; then
2089                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2090         fi
2091         ol_enable_monitor="$ol_arg"
2092
2093 else
2094         ol_enable_monitor="no"
2095 fi
2096 # end --enable-monitor
2097 # OpenLDAP --with-monitor_module
2098         # Check whether --with-monitor_module or --without-monitor_module was given.
2099 if test "${with_monitor_module+set}" = set; then
2100   withval="$with_monitor_module"
2101   
2102         ol_arg=invalid
2103         for ol_val in static dynamic ; do
2104                 if test "$withval" = "$ol_val" ; then
2105                         ol_arg="$ol_val"
2106                 fi
2107         done
2108         if test "$ol_arg" = "invalid" ; then
2109                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2110         fi
2111         ol_with_monitor_module="$ol_arg"
2112
2113 else
2114         ol_with_monitor_module="static"
2115 fi
2116 # end --with-monitor_module
2117
2118 # OpenLDAP --enable-passwd
2119         # Check whether --enable-passwd or --disable-passwd was given.
2120 if test "${enable_passwd+set}" = set; then
2121   enableval="$enable_passwd"
2122   
2123         ol_arg=invalid
2124         for ol_val in auto yes no ; do
2125                 if test "$enableval" = "$ol_val" ; then
2126                         ol_arg="$ol_val"
2127                 fi
2128         done
2129         if test "$ol_arg" = "invalid" ; then
2130                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2131         fi
2132         ol_enable_passwd="$ol_arg"
2133
2134 else
2135         ol_enable_passwd="no"
2136 fi
2137 # end --enable-passwd
2138 # OpenLDAP --with-passwd_module
2139         # Check whether --with-passwd_module or --without-passwd_module was given.
2140 if test "${with_passwd_module+set}" = set; then
2141   withval="$with_passwd_module"
2142   
2143         ol_arg=invalid
2144         for ol_val in static dynamic ; do
2145                 if test "$withval" = "$ol_val" ; then
2146                         ol_arg="$ol_val"
2147                 fi
2148         done
2149         if test "$ol_arg" = "invalid" ; then
2150                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2151         fi
2152         ol_with_passwd_module="$ol_arg"
2153
2154 else
2155         ol_with_passwd_module="static"
2156 fi
2157 # end --with-passwd_module
2158
2159 # OpenLDAP --enable-perl
2160         # Check whether --enable-perl or --disable-perl was given.
2161 if test "${enable_perl+set}" = set; then
2162   enableval="$enable_perl"
2163   
2164         ol_arg=invalid
2165         for ol_val in auto yes no ; do
2166                 if test "$enableval" = "$ol_val" ; then
2167                         ol_arg="$ol_val"
2168                 fi
2169         done
2170         if test "$ol_arg" = "invalid" ; then
2171                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2172         fi
2173         ol_enable_perl="$ol_arg"
2174
2175 else
2176         ol_enable_perl="no"
2177 fi
2178 # end --enable-perl
2179 # OpenLDAP --with-perl_module
2180         # Check whether --with-perl_module or --without-perl_module was given.
2181 if test "${with_perl_module+set}" = set; then
2182   withval="$with_perl_module"
2183   
2184         ol_arg=invalid
2185         for ol_val in static dynamic ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2192         fi
2193         ol_with_perl_module="$ol_arg"
2194
2195 else
2196         ol_with_perl_module="static"
2197 fi
2198 # end --with-perl_module
2199
2200 # OpenLDAP --enable-shell
2201         # Check whether --enable-shell or --disable-shell was given.
2202 if test "${enable_shell+set}" = set; then
2203   enableval="$enable_shell"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2213         fi
2214         ol_enable_shell="$ol_arg"
2215
2216 else
2217         ol_enable_shell="no"
2218 fi
2219 # end --enable-shell
2220 # OpenLDAP --with-shell_module
2221         # Check whether --with-shell_module or --without-shell_module was given.
2222 if test "${with_shell_module+set}" = set; then
2223   withval="$with_shell_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_shell_module="$ol_arg"
2235
2236 else
2237         ol_with_shell_module="static"
2238 fi
2239 # end --with-shell_module
2240
2241 # OpenLDAP --enable-sql
2242         # Check whether --enable-sql or --disable-sql was given.
2243 if test "${enable_sql+set}" = set; then
2244   enableval="$enable_sql"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2254         fi
2255         ol_enable_sql="$ol_arg"
2256
2257 else
2258         ol_enable_sql="no"
2259 fi
2260 # end --enable-sql
2261 # OpenLDAP --with-sql_module
2262         # Check whether --with-sql_module or --without-sql_module was given.
2263 if test "${with_sql_module+set}" = set; then
2264   withval="$with_sql_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_sql_module="$ol_arg"
2276
2277 else
2278         ol_with_sql_module="static"
2279 fi
2280 # end --with-sql_module
2281
2282 # OpenLDAP --enable-tcl
2283         # Check whether --enable-tcl or --disable-tcl was given.
2284 if test "${enable_tcl+set}" = set; then
2285   enableval="$enable_tcl"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2295         fi
2296         ol_enable_tcl="$ol_arg"
2297
2298 else
2299         ol_enable_tcl="no"
2300 fi
2301 # end --enable-tcl
2302 # OpenLDAP --with-tcl_module
2303         # Check whether --with-tcl_module or --without-tcl_module was given.
2304 if test "${with_tcl_module+set}" = set; then
2305   withval="$with_tcl_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_tcl_module="$ol_arg"
2317
2318 else
2319         ol_with_tcl_module="static"
2320 fi
2321 # end --with-tcl_module
2322
2323
2324 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2325 if test "${with_xxslurpdoptions+set}" = set; then
2326   withval="$with_xxslurpdoptions"
2327   :
2328 fi
2329
2330 # OpenLDAP --enable-slurpd
2331         # Check whether --enable-slurpd or --disable-slurpd was given.
2332 if test "${enable_slurpd+set}" = set; then
2333   enableval="$enable_slurpd"
2334   
2335         ol_arg=invalid
2336         for ol_val in auto yes no ; do
2337                 if test "$enableval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2343         fi
2344         ol_enable_slurpd="$ol_arg"
2345
2346 else
2347         ol_enable_slurpd="auto"
2348 fi
2349 # end --enable-slurpd
2350
2351 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2352 if test "${with_xxliboptions+set}" = set; then
2353   withval="$with_xxliboptions"
2354   :
2355 fi
2356
2357 # Check whether --enable-static or --disable-static was given.
2358 if test "${enable_static+set}" = set; then
2359   enableval="$enable_static"
2360   p=${PACKAGE-default}
2361 case "$enableval" in
2362 yes) enable_static=yes ;;
2363 no) enable_static=no ;;
2364 *)
2365   enable_static=no
2366   # Look at the argument we got.  We use all the common list separators.
2367   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2368   for pkg in $enableval; do
2369     if test "X$pkg" = "X$p"; then
2370       enable_static=yes
2371     fi
2372   done
2373   IFS="$ac_save_ifs"
2374   ;;
2375 esac
2376 else
2377   enable_static=yes
2378 fi
2379
2380 # Check whether --enable-shared or --disable-shared was given.
2381 if test "${enable_shared+set}" = set; then
2382   enableval="$enable_shared"
2383   p=${PACKAGE-default}
2384 case "$enableval" in
2385 yes) enable_shared=yes ;;
2386 no) enable_shared=no ;;
2387 *)
2388   enable_shared=no
2389   # Look at the argument we got.  We use all the common list separators.
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2391   for pkg in $enableval; do
2392     if test "X$pkg" = "X$p"; then
2393       enable_shared=yes
2394     fi
2395   done
2396   IFS="$ac_save_ifs"
2397   ;;
2398 esac
2399 else
2400   enable_shared=yes
2401 fi
2402
2403
2404
2405 # validate options
2406 if test $ol_enable_slapd = no ; then
2407                 if test $ol_enable_bdb = yes ; then
2408                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2409         fi
2410         if test $ol_enable_dnssrv = yes ; then
2411                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2412         fi
2413         if test $ol_enable_ldap = yes ; then
2414                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2415         fi
2416         if test $ol_enable_ldbm = yes ; then
2417                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2418         fi
2419         if test $ol_enable_meta = yes ; then
2420                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2421         fi
2422         if test $ol_enable_monitor = yes ; then
2423                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2424         fi
2425         if test $ol_enable_passwd = yes ; then
2426                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2427         fi
2428         if test $ol_enable_perl = yes ; then
2429                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2430         fi
2431         if test $ol_enable_shell = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2433         fi
2434         if test $ol_enable_tcl = yes ; then
2435                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2436         fi
2437         if test $ol_enable_sql = yes ; then
2438                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2439         fi
2440         if test $ol_enable_modules = yes ; then
2441                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2442         fi
2443         if test $ol_enable_wrappers = yes ; then
2444                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2445         fi
2446         if test $ol_enable_phonetic = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2448         fi
2449         if test $ol_enable_rlookups = yes ; then
2450                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2451         fi
2452         if test $ol_enable_aci = yes ; then
2453                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2454         fi
2455         if test $ol_with_ldbm_api != auto ; then
2456                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2457         fi
2458         if test $ol_with_ldbm_type != auto ; then
2459                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2460         fi
2461         if test $ol_with_bdb_module != static ; then
2462                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2463         fi
2464         if test $ol_with_dnssrv_module != static ; then
2465                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2466         fi
2467         if test $ol_with_ldap_module != static ; then
2468                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2469         fi
2470         if test $ol_with_ldbm_module != static ; then
2471                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2472         fi
2473         if test $ol_with_meta_module != static ; then
2474                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2475         fi
2476         if test $ol_with_monitor_module != static ; then
2477                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2478         fi
2479         if test $ol_with_passwd_module != static ; then
2480                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2481         fi
2482         if test $ol_with_perl_module != static ; then
2483                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2484         fi
2485         if test $ol_with_shell_module != static ; then
2486                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2487         fi
2488         if test $ol_with_tcl_module != static ; then
2489                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2490         fi
2491         if test $ol_with_sql_module != static ; then
2492                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2493         fi
2494         if test $ol_enable_slurpd = yes ; then
2495                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2496         fi
2497         if test $ol_enable_rewrite = yes ; then
2498                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2499         fi
2500
2501         # force settings to no
2502         ol_enable_bdb=no
2503         ol_enable_dnssrv=no
2504         ol_enable_ldap=no
2505         ol_enable_ldbm=no
2506         ol_enable_meta=no
2507         ol_enable_monitor=no
2508         ol_enable_passwd=no
2509         ol_enable_perl=no
2510         ol_enable_shell=no
2511         ol_enable_tcl=no
2512         ol_enable_sql=no
2513
2514         ol_enable_modules=no
2515         ol_enable_phonetic=no
2516         ol_enable_rlookups=no
2517         ol_enable_aci=no
2518         ol_enable_wrappers=no
2519         ol_enable_dynamic=no
2520
2521         ol_with_ldbm_api=no
2522         ol_with_ldbm_type=no
2523
2524         ol_with_bdb_module=static
2525         ol_with_dnssrv_module=static
2526         ol_with_ldap_module=static
2527         ol_with_ldbm_module=static
2528         ol_with_meta_module=static
2529         ol_with_monitor_module=static
2530         ol_with_passwd_module=static
2531         ol_with_perl_module=static
2532         ol_with_shell_module=static
2533         ol_with_tcl_module=static
2534         ol_with_sql_module=static
2535
2536         ol_enable_slurpd=no
2537
2538         ol_enable_rewrite=no
2539
2540 elif test $ol_enable_ldbm = no ; then
2541         
2542         if test $ol_with_ldbm_api != auto ; then
2543                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2544         fi
2545
2546         if test $ol_with_ldbm_type != auto ; then
2547                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2548         fi
2549
2550         if test $ol_with_ldbm_module != static ; then
2551                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2552         fi
2553
2554         if test $ol_enable_modules != yes -a \
2555                 $ol_enable_bdb = no -a \
2556                 $ol_enable_dnssrv = no -a \
2557                 $ol_enable_ldap = no -a \
2558                 $ol_enable_meta = no -a \
2559                 $ol_enable_monitor = no -a \
2560                 $ol_enable_passwd = no -a \
2561                 $ol_enable_perl = no -a \
2562                 $ol_enable_shell = no -a \
2563                 $ol_enable_sql = no -a \
2564                 $ol_enable_tcl = no ; then
2565
2566                 if test $ol_enable_slapd = yes ; then
2567                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2568                 else
2569                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2570                         ol_enable_slapd=no
2571                 fi
2572         fi
2573
2574         ol_with_ldbm_api=no
2575         ol_with_ldbm_type=no
2576         ol_with_ldbm_module=static
2577
2578         if test $ol_enable_bdb != no ; then
2579                 ol_with_ldbm_api=berkeley
2580         fi
2581
2582 else
2583                 if test $ol_with_ldbm_api = gdbm -a \
2584                 $ol_with_ldbm_type = btree ; then
2585                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2586         fi
2587         if test $ol_with_ldbm_api = mdbm -a \
2588                 $ol_with_ldbm_type = btree ; then
2589                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2590         fi
2591         if test $ol_with_ldbm_api = ndbm -a \
2592                 $ol_with_ldbm_type = btree ; then
2593                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2594         fi
2595
2596         if test $ol_enable_bdb = yes ; then
2597                 if test $ol_with_ldbm_api = auto ; then
2598                         ol_with_ldbm_api=berkeley
2599                 elif test $ol_with_ldbm_api != berkeley ; then
2600                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2601                 fi
2602
2603         elif test $ol_enable_bdb = auto ; then
2604                 if test $ol_with_ldbm_api != berkeley \
2605                         -o $ol_with_ldbm_api != auto ; then
2606                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2607                         ol_enable_bdb=no
2608                 fi
2609         fi
2610 fi
2611
2612 if test $ol_enable_slurpd = yes ; then
2613                 if test $ol_with_threads = no ; then
2614                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2615         fi
2616 fi
2617
2618 if test $ol_enable_lmpasswd = yes ; then
2619         if test $ol_with_tls = no ; then
2620                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2621         fi
2622 fi
2623
2624 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2625         if test $ol_with_kerberos = no ; then
2626                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2627         elif test $ol_with_kerberos = auto ; then
2628                 ol_with_kerberos=yes
2629         fi
2630
2631 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2632         if test $ol_with_kerberos = auto ; then
2633                 ol_with_kerberos=no
2634         elif test $ol_with_kerberos != no ; then
2635                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2636                 ol_with_kerberos=no
2637         fi
2638 fi
2639
2640 if test $ol_enable_spasswd = yes ; then
2641         if test $ol_with_cyrus_sasl = no ; then
2642                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2643         fi
2644         ol_with_cyrus_sasl=yes
2645 fi
2646
2647 echo "$ac_t""done" 1>&6
2648
2649 LDAP_LIBS=
2650 LDIF_LIBS=
2651 LDBM_LIB=
2652 LDBM_LIBS=
2653 LTHREAD_LIBS=
2654 LUTIL_LIBS=
2655
2656 SLAPD_LIBS=
2657 SLURPD_LIBS=
2658
2659 BUILD_SLAPD=no
2660 BUILD_SLURPD=no
2661
2662 BUILD_THREAD=no
2663
2664 BUILD_BDB=no
2665 BUILD_DNSSRV=no
2666 BUILD_LDAP=no
2667 BUILD_LDBM=no
2668 BUILD_META=no
2669 BUILD_MONITOR=no
2670 BUILD_PASSWD=no
2671 BUILD_PERL=no
2672 BUILD_SHELL=no
2673 BUILD_SQL=no
2674 BUILD_TCL=no
2675
2676 BUILD_BDB_DYNAMIC=static
2677 BUILD_DNSSRV_DYNAMIC=static
2678 BUILD_LDAP_DYNAMIC=static
2679 BUILD_LDBM_DYNAMIC=static
2680 BUILD_META_DYNAMIC=static
2681 BUILD_MONITOR_DYNAMIC=static
2682 BUILD_PASSWD_DYNAMIC=static
2683 BUILD_PERL_DYNAMIC=static
2684 BUILD_SHELL_DYNAMIC=static
2685 BUILD_TCL_DYNAMIC=static
2686 BUILD_SQL_DYNAMIC=static
2687
2688 SLAPD_MODULES_LDFLAGS=
2689 SLAPD_MODULES_CPPFLAGS=
2690 SLAPD_MODULES_LIST=
2691
2692 SLAPD_STATIC_BACKENDS=
2693 SLAPD_DYNAMIC_BACKENDS=
2694
2695 SLAPD_PERL_LDFLAGS=
2696 MOD_PERL_LDFLAGS=
2697 PERL_CPPFLAGS=
2698
2699 SLAPD_SQL_LDFLAGS=
2700 SLAPD_SQL_LIBS=
2701 SLAPD_SQL_INCLUDES=
2702
2703 MOD_TCL_LIB=
2704 KRB4_LIBS=
2705 KRB5_LIBS=
2706 READLINE_LIBS=
2707 SASL_LIBS=
2708 TERMCAP_LIBS=
2709 TLS_LIBS=
2710 MODULES_LIBS=
2711 AUTH_LIBS=
2712
2713 SLAPD_SLP_LIBS=
2714
2715
2716
2717 cat >> confdefs.h <<\EOF
2718 #define HAVE_MKVERSION 1
2719 EOF
2720
2721
2722
2723
2724 ol_aix_threads=no
2725 case "$target" in
2726 *-*-aix*)       if test -z "$CC" ; then
2727                 case "$ol_with_threads" in
2728                 auto | yes |  posix) ol_aix_threads=yes ;;
2729                 esac
2730         fi
2731 ;;
2732 esac
2733
2734 if test $ol_aix_threads = yes ; then
2735         if test -z "${CC}" ; then
2736                 for ac_prog in cc_r xlc_r cc
2737 do
2738 # Extract the first word of "$ac_prog", so it can be a program name with args.
2739 set dummy $ac_prog; ac_word=$2
2740 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2741 echo "configure:2742: checking for $ac_word" >&5
2742 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2743   echo $ac_n "(cached) $ac_c" 1>&6
2744 else
2745   if test -n "$CC"; then
2746   ac_cv_prog_CC="$CC" # Let the user override the test.
2747 else
2748   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2749   ac_dummy="$PATH"
2750   for ac_dir in $ac_dummy; do
2751     test -z "$ac_dir" && ac_dir=.
2752     if test -f $ac_dir/$ac_word; then
2753       ac_cv_prog_CC="$ac_prog"
2754       break
2755     fi
2756   done
2757   IFS="$ac_save_ifs"
2758 fi
2759 fi
2760 CC="$ac_cv_prog_CC"
2761 if test -n "$CC"; then
2762   echo "$ac_t""$CC" 1>&6
2763 else
2764   echo "$ac_t""no" 1>&6
2765 fi
2766
2767 test -n "$CC" && break
2768 done
2769
2770
2771                 if test "$CC" = cc ; then
2772                                                 if test $ol_with_threads != auto ; then
2773                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2774                         else
2775                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2776                         fi
2777                         ol_with_threads=no
2778                 fi
2779         fi
2780
2781         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2782                 ol_with_threads=posix
2783                 ol_cv_pthread_create=yes
2784         fi
2785 fi
2786
2787 if test -z "${CC}"; then
2788         for ac_prog in cc
2789 do
2790 # Extract the first word of "$ac_prog", so it can be a program name with args.
2791 set dummy $ac_prog; ac_word=$2
2792 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2793 echo "configure:2794: checking for $ac_word" >&5
2794 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   if test -n "$CC"; then
2798   ac_cv_prog_CC="$CC" # Let the user override the test.
2799 else
2800   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2801   ac_dummy="$PATH"
2802   for ac_dir in $ac_dummy; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/$ac_word; then
2805       ac_cv_prog_CC="$ac_prog"
2806       break
2807     fi
2808   done
2809   IFS="$ac_save_ifs"
2810 fi
2811 fi
2812 CC="$ac_cv_prog_CC"
2813 if test -n "$CC"; then
2814   echo "$ac_t""$CC" 1>&6
2815 else
2816   echo "$ac_t""no" 1>&6
2817 fi
2818
2819 test -n "$CC" && break
2820 done
2821
2822 fi
2823
2824
2825 for ac_prog in ar gar
2826 do
2827 # Extract the first word of "$ac_prog", so it can be a program name with args.
2828 set dummy $ac_prog; ac_word=$2
2829 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2830 echo "configure:2831: checking for $ac_word" >&5
2831 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2832   echo $ac_n "(cached) $ac_c" 1>&6
2833 else
2834   if test -n "$AR"; then
2835   ac_cv_prog_AR="$AR" # Let the user override the test.
2836 else
2837   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2838   ac_dummy="$PATH"
2839   for ac_dir in $ac_dummy; do
2840     test -z "$ac_dir" && ac_dir=.
2841     if test -f $ac_dir/$ac_word; then
2842       ac_cv_prog_AR="$ac_prog"
2843       break
2844     fi
2845   done
2846   IFS="$ac_save_ifs"
2847 fi
2848 fi
2849 AR="$ac_cv_prog_AR"
2850 if test -n "$AR"; then
2851   echo "$ac_t""$AR" 1>&6
2852 else
2853   echo "$ac_t""no" 1>&6
2854 fi
2855
2856 test -n "$AR" && break
2857 done
2858 test -n "$AR" || AR="ar"
2859
2860
2861
2862
2863 # Check whether --enable-fast-install or --disable-fast-install was given.
2864 if test "${enable_fast_install+set}" = set; then
2865   enableval="$enable_fast_install"
2866   p=${PACKAGE-default}
2867 case "$enableval" in
2868 yes) enable_fast_install=yes ;;
2869 no) enable_fast_install=no ;;
2870 *)
2871   enable_fast_install=no
2872   # Look at the argument we got.  We use all the common list separators.
2873   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2874   for pkg in $enableval; do
2875     if test "X$pkg" = "X$p"; then
2876       enable_fast_install=yes
2877     fi
2878   done
2879   IFS="$ac_save_ifs"
2880   ;;
2881 esac
2882 else
2883   enable_fast_install=yes
2884 fi
2885
2886 # Extract the first word of "ranlib", so it can be a program name with args.
2887 set dummy ranlib; ac_word=$2
2888 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2889 echo "configure:2890: checking for $ac_word" >&5
2890 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   if test -n "$RANLIB"; then
2894   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2895 else
2896   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2897   ac_dummy="$PATH"
2898   for ac_dir in $ac_dummy; do
2899     test -z "$ac_dir" && ac_dir=.
2900     if test -f $ac_dir/$ac_word; then
2901       ac_cv_prog_RANLIB="ranlib"
2902       break
2903     fi
2904   done
2905   IFS="$ac_save_ifs"
2906   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2907 fi
2908 fi
2909 RANLIB="$ac_cv_prog_RANLIB"
2910 if test -n "$RANLIB"; then
2911   echo "$ac_t""$RANLIB" 1>&6
2912 else
2913   echo "$ac_t""no" 1>&6
2914 fi
2915
2916 # Extract the first word of "gcc", so it can be a program name with args.
2917 set dummy gcc; ac_word=$2
2918 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2919 echo "configure:2920: checking for $ac_word" >&5
2920 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2921   echo $ac_n "(cached) $ac_c" 1>&6
2922 else
2923   if test -n "$CC"; then
2924   ac_cv_prog_CC="$CC" # Let the user override the test.
2925 else
2926   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2927   ac_dummy="$PATH"
2928   for ac_dir in $ac_dummy; do
2929     test -z "$ac_dir" && ac_dir=.
2930     if test -f $ac_dir/$ac_word; then
2931       ac_cv_prog_CC="gcc"
2932       break
2933     fi
2934   done
2935   IFS="$ac_save_ifs"
2936 fi
2937 fi
2938 CC="$ac_cv_prog_CC"
2939 if test -n "$CC"; then
2940   echo "$ac_t""$CC" 1>&6
2941 else
2942   echo "$ac_t""no" 1>&6
2943 fi
2944
2945 if test -z "$CC"; then
2946   # Extract the first word of "cc", so it can be a program name with args.
2947 set dummy cc; ac_word=$2
2948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2949 echo "configure:2950: checking for $ac_word" >&5
2950 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2951   echo $ac_n "(cached) $ac_c" 1>&6
2952 else
2953   if test -n "$CC"; then
2954   ac_cv_prog_CC="$CC" # Let the user override the test.
2955 else
2956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2957   ac_prog_rejected=no
2958   ac_dummy="$PATH"
2959   for ac_dir in $ac_dummy; do
2960     test -z "$ac_dir" && ac_dir=.
2961     if test -f $ac_dir/$ac_word; then
2962       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2963         ac_prog_rejected=yes
2964         continue
2965       fi
2966       ac_cv_prog_CC="cc"
2967       break
2968     fi
2969   done
2970   IFS="$ac_save_ifs"
2971 if test $ac_prog_rejected = yes; then
2972   # We found a bogon in the path, so make sure we never use it.
2973   set dummy $ac_cv_prog_CC
2974   shift
2975   if test $# -gt 0; then
2976     # We chose a different compiler from the bogus one.
2977     # However, it has the same basename, so the bogon will be chosen
2978     # first if we set CC to just the basename; use the full file name.
2979     shift
2980     set dummy "$ac_dir/$ac_word" "$@"
2981     shift
2982     ac_cv_prog_CC="$@"
2983   fi
2984 fi
2985 fi
2986 fi
2987 CC="$ac_cv_prog_CC"
2988 if test -n "$CC"; then
2989   echo "$ac_t""$CC" 1>&6
2990 else
2991   echo "$ac_t""no" 1>&6
2992 fi
2993
2994   if test -z "$CC"; then
2995     case "`uname -s`" in
2996     *win32* | *WIN32* | *CYGWIN*)
2997       # Extract the first word of "cl", so it can be a program name with args.
2998 set dummy cl; ac_word=$2
2999 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3000 echo "configure:3001: checking for $ac_word" >&5
3001 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
3002   echo $ac_n "(cached) $ac_c" 1>&6
3003 else
3004   if test -n "$CC"; then
3005   ac_cv_prog_CC="$CC" # Let the user override the test.
3006 else
3007   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3008   ac_dummy="$PATH"
3009   for ac_dir in $ac_dummy; do
3010     test -z "$ac_dir" && ac_dir=.
3011     if test -f $ac_dir/$ac_word; then
3012       ac_cv_prog_CC="cl"
3013       break
3014     fi
3015   done
3016   IFS="$ac_save_ifs"
3017 fi
3018 fi
3019 CC="$ac_cv_prog_CC"
3020 if test -n "$CC"; then
3021   echo "$ac_t""$CC" 1>&6
3022 else
3023   echo "$ac_t""no" 1>&6
3024 fi
3025  ;;
3026     esac
3027   fi
3028   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3029 fi
3030
3031 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3032 echo "configure:3033: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3033
3034 ac_ext=c
3035 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3036 ac_cpp='$CPP $CPPFLAGS'
3037 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3038 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3039 cross_compiling=$ac_cv_prog_cc_cross
3040
3041 cat > conftest.$ac_ext << EOF
3042
3043 #line 3044 "configure"
3044 #include "confdefs.h"
3045
3046 main(){return(0);}
3047 EOF
3048 if { (eval echo configure:3049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3049   ac_cv_prog_cc_works=yes
3050   # If we can't run a trivial program, we are probably using a cross compiler.
3051   if (./conftest; exit) 2>/dev/null; then
3052     ac_cv_prog_cc_cross=no
3053   else
3054     ac_cv_prog_cc_cross=yes
3055   fi
3056 else
3057   echo "configure: failed program was:" >&5
3058   cat conftest.$ac_ext >&5
3059   ac_cv_prog_cc_works=no
3060 fi
3061 rm -fr conftest*
3062 ac_ext=c
3063 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3064 ac_cpp='$CPP $CPPFLAGS'
3065 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3066 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3067 cross_compiling=$ac_cv_prog_cc_cross
3068
3069 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3070 if test $ac_cv_prog_cc_works = no; then
3071   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3072 fi
3073 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3074 echo "configure:3075: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3075 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3076 cross_compiling=$ac_cv_prog_cc_cross
3077
3078 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3079 echo "configure:3080: checking whether we are using GNU C" >&5
3080 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3081   echo $ac_n "(cached) $ac_c" 1>&6
3082 else
3083   cat > conftest.c <<EOF
3084 #ifdef __GNUC__
3085   yes;
3086 #endif
3087 EOF
3088 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3089   ac_cv_prog_gcc=yes
3090 else
3091   ac_cv_prog_gcc=no
3092 fi
3093 fi
3094
3095 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3096
3097 if test $ac_cv_prog_gcc = yes; then
3098   GCC=yes
3099 else
3100   GCC=
3101 fi
3102
3103 ac_test_CFLAGS="${CFLAGS+set}"
3104 ac_save_CFLAGS="$CFLAGS"
3105 CFLAGS=
3106 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3107 echo "configure:3108: checking whether ${CC-cc} accepts -g" >&5
3108 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   echo 'void f(){}' > conftest.c
3112 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3113   ac_cv_prog_cc_g=yes
3114 else
3115   ac_cv_prog_cc_g=no
3116 fi
3117 rm -f conftest*
3118
3119 fi
3120
3121 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3122 if test "$ac_test_CFLAGS" = set; then
3123   CFLAGS="$ac_save_CFLAGS"
3124 elif test $ac_cv_prog_cc_g = yes; then
3125   if test "$GCC" = yes; then
3126     CFLAGS="-g -O2"
3127   else
3128     CFLAGS="-g"
3129   fi
3130 else
3131   if test "$GCC" = yes; then
3132     CFLAGS="-O2"
3133   else
3134     CFLAGS=
3135   fi
3136 fi
3137
3138 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3139 if test "${with_gnu_ld+set}" = set; then
3140   withval="$with_gnu_ld"
3141   test "$withval" = no || with_gnu_ld=yes
3142 else
3143   with_gnu_ld=no
3144 fi
3145
3146 ac_prog=ld
3147 if test "$ac_cv_prog_gcc" = yes; then
3148   # Check if gcc -print-prog-name=ld gives a path.
3149   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3150 echo "configure:3151: checking for ld used by GCC" >&5
3151   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3152   case "$ac_prog" in
3153     # Accept absolute paths.
3154     [\\/]* | [A-Za-z]:[\\/]*)
3155       re_direlt='/[^/][^/]*/\.\./'
3156       # Canonicalize the path of ld
3157       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3158       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3159         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3160       done
3161       test -z "$LD" && LD="$ac_prog"
3162       ;;
3163   "")
3164     # If it fails, then pretend we aren't using GCC.
3165     ac_prog=ld
3166     ;;
3167   *)
3168     # If it is relative, then search for the first ld in PATH.
3169     with_gnu_ld=unknown
3170     ;;
3171   esac
3172 elif test "$with_gnu_ld" = yes; then
3173   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3174 echo "configure:3175: checking for GNU ld" >&5
3175 else
3176   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3177 echo "configure:3178: checking for non-GNU ld" >&5
3178 fi
3179 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3180   echo $ac_n "(cached) $ac_c" 1>&6
3181 else
3182   if test -z "$LD"; then
3183   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3184   for ac_dir in $PATH; do
3185     test -z "$ac_dir" && ac_dir=.
3186     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3187       ac_cv_path_LD="$ac_dir/$ac_prog"
3188       # Check to see if the program is GNU ld.  I'd rather use --version,
3189       # but apparently some GNU ld's only accept -v.
3190       # Break only if it was the GNU/non-GNU ld that we prefer.
3191       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3192         test "$with_gnu_ld" != no && break
3193       else
3194         test "$with_gnu_ld" != yes && break
3195       fi
3196     fi
3197   done
3198   IFS="$ac_save_ifs"
3199 else
3200   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3201 fi
3202 fi
3203
3204 LD="$ac_cv_path_LD"
3205 if test -n "$LD"; then
3206   echo "$ac_t""$LD" 1>&6
3207 else
3208   echo "$ac_t""no" 1>&6
3209 fi
3210 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3211 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3212 echo "configure:3213: checking if the linker ($LD) is GNU ld" >&5
3213 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3214   echo $ac_n "(cached) $ac_c" 1>&6
3215 else
3216   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3217 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3218   ac_cv_prog_gnu_ld=yes
3219 else
3220   ac_cv_prog_gnu_ld=no
3221 fi
3222 fi
3223
3224 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3225
3226
3227 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3228 echo "configure:3229: checking for BSD-compatible nm" >&5
3229 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   if test -n "$NM"; then
3233   # Let the user override the test.
3234   ac_cv_path_NM="$NM"
3235 else
3236   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3237   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3238     test -z "$ac_dir" && ac_dir=.
3239     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3240       # Check to see if the nm accepts a BSD-compat flag.
3241       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3242       #   nm: unknown option "B" ignored
3243       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3244         ac_cv_path_NM="$ac_dir/nm -B"
3245         break
3246       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3247         ac_cv_path_NM="$ac_dir/nm -p"
3248         break
3249       else
3250         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3251         continue # so that we can try to find one that supports BSD flags
3252       fi
3253     fi
3254   done
3255   IFS="$ac_save_ifs"
3256   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3257 fi
3258 fi
3259
3260 NM="$ac_cv_path_NM"
3261 echo "$ac_t""$NM" 1>&6
3262
3263 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3264 echo "configure:3265: checking whether ln -s works" >&5
3265 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3266   echo $ac_n "(cached) $ac_c" 1>&6
3267 else
3268   rm -f conftestdata
3269 if ln -s X conftestdata 2>/dev/null
3270 then
3271   rm -f conftestdata
3272   ac_cv_prog_LN_S="ln -s"
3273 else
3274   ac_cv_prog_LN_S=ln
3275 fi
3276 fi
3277 LN_S="$ac_cv_prog_LN_S"
3278 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3279   echo "$ac_t""yes" 1>&6
3280 else
3281   echo "$ac_t""no" 1>&6
3282 fi
3283
3284 if test $host != $build; then
3285   ac_tool_prefix=${host_alias}-
3286 else
3287   ac_tool_prefix=
3288 fi
3289
3290
3291 case "$target" in
3292 NONE) lt_target="$host" ;;
3293 *) lt_target="$target" ;;
3294 esac
3295
3296 # Check for any special flags to pass to ltconfig.
3297 libtool_flags="--cache-file=$cache_file"
3298 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3299 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3300 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3301 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3302 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3303 libtool_flags="$libtool_flags --enable-dlopen"
3304 libtool_flags="$libtool_flags --enable-win32-dll"
3305 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3306 if test "${enable_libtool_lock+set}" = set; then
3307   enableval="$enable_libtool_lock"
3308   :
3309 fi
3310
3311 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3312 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3313
3314 # Some flags need to be propagated to the compiler or linker for good
3315 # libtool support.
3316 case "$lt_target" in
3317 *-*-irix6*)
3318   # Find out which ABI we are using.
3319   echo '#line 3320 "configure"' > conftest.$ac_ext
3320   if { (eval echo configure:3321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3321     case "`/usr/bin/file conftest.o`" in
3322     *32-bit*)
3323       LD="${LD-ld} -32"
3324       ;;
3325     *N32*)
3326       LD="${LD-ld} -n32"
3327       ;;
3328     *64-bit*)
3329       LD="${LD-ld} -64"
3330       ;;
3331     esac
3332   fi
3333   rm -rf conftest*
3334   ;;
3335
3336 *-*-sco3.2v5*)
3337   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3338   SAVE_CFLAGS="$CFLAGS"
3339   CFLAGS="$CFLAGS -belf"
3340   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3341 echo "configure:3342: checking whether the C compiler needs -belf" >&5
3342 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3343   echo $ac_n "(cached) $ac_c" 1>&6
3344 else
3345   cat > conftest.$ac_ext <<EOF
3346 #line 3347 "configure"
3347 #include "confdefs.h"
3348
3349 int main() {
3350
3351 ; return 0; }
3352 EOF
3353 if { (eval echo configure:3354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3354   rm -rf conftest*
3355   lt_cv_cc_needs_belf=yes
3356 else
3357   echo "configure: failed program was:" >&5
3358   cat conftest.$ac_ext >&5
3359   rm -rf conftest*
3360   lt_cv_cc_needs_belf=no
3361 fi
3362 rm -f conftest*
3363 fi
3364
3365 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3366   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3367     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3368     CFLAGS="$SAVE_CFLAGS"
3369   fi
3370   ;;
3371
3372 *-*-cygwin* | *-*-mingw*)
3373   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3374 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3375 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3376 echo "configure:3377: checking for $ac_word" >&5
3377 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3378   echo $ac_n "(cached) $ac_c" 1>&6
3379 else
3380   if test -n "$DLLTOOL"; then
3381   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3382 else
3383   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3384   ac_dummy="$PATH"
3385   for ac_dir in $ac_dummy; do
3386     test -z "$ac_dir" && ac_dir=.
3387     if test -f $ac_dir/$ac_word; then
3388       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3389       break
3390     fi
3391   done
3392   IFS="$ac_save_ifs"
3393 fi
3394 fi
3395 DLLTOOL="$ac_cv_prog_DLLTOOL"
3396 if test -n "$DLLTOOL"; then
3397   echo "$ac_t""$DLLTOOL" 1>&6
3398 else
3399   echo "$ac_t""no" 1>&6
3400 fi
3401
3402
3403 if test -z "$ac_cv_prog_DLLTOOL"; then
3404 if test -n "$ac_tool_prefix"; then
3405   # Extract the first word of "dlltool", so it can be a program name with args.
3406 set dummy dlltool; ac_word=$2
3407 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3408 echo "configure:3409: checking for $ac_word" >&5
3409 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3410   echo $ac_n "(cached) $ac_c" 1>&6
3411 else
3412   if test -n "$DLLTOOL"; then
3413   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3414 else
3415   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3416   ac_dummy="$PATH"
3417   for ac_dir in $ac_dummy; do
3418     test -z "$ac_dir" && ac_dir=.
3419     if test -f $ac_dir/$ac_word; then
3420       ac_cv_prog_DLLTOOL="dlltool"
3421       break
3422     fi
3423   done
3424   IFS="$ac_save_ifs"
3425   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3426 fi
3427 fi
3428 DLLTOOL="$ac_cv_prog_DLLTOOL"
3429 if test -n "$DLLTOOL"; then
3430   echo "$ac_t""$DLLTOOL" 1>&6
3431 else
3432   echo "$ac_t""no" 1>&6
3433 fi
3434
3435 else
3436   DLLTOOL="false"
3437 fi
3438 fi
3439
3440   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3441 set dummy ${ac_tool_prefix}as; ac_word=$2
3442 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3443 echo "configure:3444: checking for $ac_word" >&5
3444 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3445   echo $ac_n "(cached) $ac_c" 1>&6
3446 else
3447   if test -n "$AS"; then
3448   ac_cv_prog_AS="$AS" # Let the user override the test.
3449 else
3450   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3451   ac_dummy="$PATH"
3452   for ac_dir in $ac_dummy; do
3453     test -z "$ac_dir" && ac_dir=.
3454     if test -f $ac_dir/$ac_word; then
3455       ac_cv_prog_AS="${ac_tool_prefix}as"
3456       break
3457     fi
3458   done
3459   IFS="$ac_save_ifs"
3460 fi
3461 fi
3462 AS="$ac_cv_prog_AS"
3463 if test -n "$AS"; then
3464   echo "$ac_t""$AS" 1>&6
3465 else
3466   echo "$ac_t""no" 1>&6
3467 fi
3468
3469
3470 if test -z "$ac_cv_prog_AS"; then
3471 if test -n "$ac_tool_prefix"; then
3472   # Extract the first word of "as", so it can be a program name with args.
3473 set dummy as; ac_word=$2
3474 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3475 echo "configure:3476: checking for $ac_word" >&5
3476 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3477   echo $ac_n "(cached) $ac_c" 1>&6
3478 else
3479   if test -n "$AS"; then
3480   ac_cv_prog_AS="$AS" # Let the user override the test.
3481 else
3482   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3483   ac_dummy="$PATH"
3484   for ac_dir in $ac_dummy; do
3485     test -z "$ac_dir" && ac_dir=.
3486     if test -f $ac_dir/$ac_word; then
3487       ac_cv_prog_AS="as"
3488       break
3489     fi
3490   done
3491   IFS="$ac_save_ifs"
3492   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3493 fi
3494 fi
3495 AS="$ac_cv_prog_AS"
3496 if test -n "$AS"; then
3497   echo "$ac_t""$AS" 1>&6
3498 else
3499   echo "$ac_t""no" 1>&6
3500 fi
3501
3502 else
3503   AS="false"
3504 fi
3505 fi
3506
3507   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3508 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3509 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3510 echo "configure:3511: checking for $ac_word" >&5
3511 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3512   echo $ac_n "(cached) $ac_c" 1>&6
3513 else
3514   if test -n "$OBJDUMP"; then
3515   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3516 else
3517   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3518   ac_dummy="$PATH"
3519   for ac_dir in $ac_dummy; do
3520     test -z "$ac_dir" && ac_dir=.
3521     if test -f $ac_dir/$ac_word; then
3522       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3523       break
3524     fi
3525   done
3526   IFS="$ac_save_ifs"
3527 fi
3528 fi
3529 OBJDUMP="$ac_cv_prog_OBJDUMP"
3530 if test -n "$OBJDUMP"; then
3531   echo "$ac_t""$OBJDUMP" 1>&6
3532 else
3533   echo "$ac_t""no" 1>&6
3534 fi
3535
3536
3537 if test -z "$ac_cv_prog_OBJDUMP"; then
3538 if test -n "$ac_tool_prefix"; then
3539   # Extract the first word of "objdump", so it can be a program name with args.
3540 set dummy objdump; ac_word=$2
3541 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3542 echo "configure:3543: checking for $ac_word" >&5
3543 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3544   echo $ac_n "(cached) $ac_c" 1>&6
3545 else
3546   if test -n "$OBJDUMP"; then
3547   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3548 else
3549   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3550   ac_dummy="$PATH"
3551   for ac_dir in $ac_dummy; do
3552     test -z "$ac_dir" && ac_dir=.
3553     if test -f $ac_dir/$ac_word; then
3554       ac_cv_prog_OBJDUMP="objdump"
3555       break
3556     fi
3557   done
3558   IFS="$ac_save_ifs"
3559   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3560 fi
3561 fi
3562 OBJDUMP="$ac_cv_prog_OBJDUMP"
3563 if test -n "$OBJDUMP"; then
3564   echo "$ac_t""$OBJDUMP" 1>&6
3565 else
3566   echo "$ac_t""no" 1>&6
3567 fi
3568
3569 else
3570   OBJDUMP="false"
3571 fi
3572 fi
3573
3574   ;;
3575
3576 esac
3577
3578
3579 # Save cache, so that ltconfig can load it
3580
3581
3582 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3583 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3584 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3585 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3586 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3587 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3588 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3589 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3590
3591 # Reload cache, that may have been modified by ltconfig
3592
3593
3594 # This can be used to rebuild libtool when needed
3595 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3596
3597 # Always use our own libtool.
3598 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3599
3600 # Redirect the config.log output again, so that the ltconfig log is not
3601 # clobbered by the next message.
3602 exec 5>>./config.log
3603
3604
3605 for ac_prog in mawk gawk nawk awk
3606 do
3607 # Extract the first word of "$ac_prog", so it can be a program name with args.
3608 set dummy $ac_prog; ac_word=$2
3609 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3610 echo "configure:3611: checking for $ac_word" >&5
3611 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3612   echo $ac_n "(cached) $ac_c" 1>&6
3613 else
3614   if test -n "$AWK"; then
3615   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3616 else
3617   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3618   ac_dummy="$PATH"
3619   for ac_dir in $ac_dummy; do
3620     test -z "$ac_dir" && ac_dir=.
3621     if test -f $ac_dir/$ac_word; then
3622       ac_cv_prog_AWK="$ac_prog"
3623       break
3624     fi
3625   done
3626   IFS="$ac_save_ifs"
3627 fi
3628 fi
3629 AWK="$ac_cv_prog_AWK"
3630 if test -n "$AWK"; then
3631   echo "$ac_t""$AWK" 1>&6
3632 else
3633   echo "$ac_t""no" 1>&6
3634 fi
3635
3636 test -n "$AWK" && break
3637 done
3638
3639 # test for ln hardlink support
3640 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3641 echo "configure:3642: checking whether ln works" >&5
3642 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3643   echo $ac_n "(cached) $ac_c" 1>&6
3644 else
3645   rm -f conftest.src conftest.dst
3646 echo "conftest" > conftest.src
3647 if ln conftest.src conftest.dst 2>/dev/null
3648 then
3649   ol_cv_prog_LN_H="ln"
3650 else
3651   ol_cv_prog_LN_H="cp"
3652 fi
3653 rm -f conftest.src conftest.dst
3654
3655 fi
3656 LN_H="$ol_cv_prog_LN_H"
3657 if test "$ol_cv_prog_LN_H" = "ln"; then
3658         echo "$ac_t""yes" 1>&6
3659 else
3660         echo "$ac_t""no" 1>&6
3661 fi
3662
3663 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3664 echo "configure:3665: checking whether ln -s works" >&5
3665 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3666   echo $ac_n "(cached) $ac_c" 1>&6
3667 else
3668   rm -f conftestdata
3669 if ln -s X conftestdata 2>/dev/null
3670 then
3671   rm -f conftestdata
3672   ac_cv_prog_LN_S="ln -s"
3673 else
3674   ac_cv_prog_LN_S=ln
3675 fi
3676 fi
3677 LN_S="$ac_cv_prog_LN_S"
3678 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3679   echo "$ac_t""yes" 1>&6
3680 else
3681   echo "$ac_t""no" 1>&6
3682 fi
3683
3684
3685 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3686         LN_S="$LN_H"
3687 fi
3688
3689 # Extract the first word of "sendmail", so it can be a program name with args.
3690 set dummy sendmail; ac_word=$2
3691 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3692 echo "configure:3693: checking for $ac_word" >&5
3693 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3694   echo $ac_n "(cached) $ac_c" 1>&6
3695 else
3696   case "$SENDMAIL" in
3697   /*)
3698   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3699   ;;
3700   ?:/*)
3701   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3702   ;;
3703   *)
3704   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3705   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3706   for ac_dir in $ac_dummy; do 
3707     test -z "$ac_dir" && ac_dir=.
3708     if test -f $ac_dir/$ac_word; then
3709       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3710       break
3711     fi
3712   done
3713   IFS="$ac_save_ifs"
3714   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3715   ;;
3716 esac
3717 fi
3718 SENDMAIL="$ac_cv_path_SENDMAIL"
3719 if test -n "$SENDMAIL"; then
3720   echo "$ac_t""$SENDMAIL" 1>&6
3721 else
3722   echo "$ac_t""no" 1>&6
3723 fi
3724
3725 # Extract the first word of "vi", so it can be a program name with args.
3726 set dummy vi; ac_word=$2
3727 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3728 echo "configure:3729: checking for $ac_word" >&5
3729 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3730   echo $ac_n "(cached) $ac_c" 1>&6
3731 else
3732   case "$EDITOR" in
3733   /*)
3734   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3735   ;;
3736   ?:/*)
3737   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3738   ;;
3739   *)
3740   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3741   ac_dummy="$PATH:/usr/ucb"
3742   for ac_dir in $ac_dummy; do 
3743     test -z "$ac_dir" && ac_dir=.
3744     if test -f $ac_dir/$ac_word; then
3745       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3746       break
3747     fi
3748   done
3749   IFS="$ac_save_ifs"
3750   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3751   ;;
3752 esac
3753 fi
3754 EDITOR="$ac_cv_path_EDITOR"
3755 if test -n "$EDITOR"; then
3756   echo "$ac_t""$EDITOR" 1>&6
3757 else
3758   echo "$ac_t""no" 1>&6
3759 fi
3760
3761 # Extract the first word of "finger", so it can be a program name with args.
3762 set dummy finger; ac_word=$2
3763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3764 echo "configure:3765: checking for $ac_word" >&5
3765 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3766   echo $ac_n "(cached) $ac_c" 1>&6
3767 else
3768   case "$FINGER" in
3769   /*)
3770   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3771   ;;
3772   ?:/*)
3773   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3774   ;;
3775   *)
3776   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3777   ac_dummy="$PATH:/usr/ucb"
3778   for ac_dir in $ac_dummy; do 
3779     test -z "$ac_dir" && ac_dir=.
3780     if test -f $ac_dir/$ac_word; then
3781       ac_cv_path_FINGER="$ac_dir/$ac_word"
3782       break
3783     fi
3784   done
3785   IFS="$ac_save_ifs"
3786   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3787   ;;
3788 esac
3789 fi
3790 FINGER="$ac_cv_path_FINGER"
3791 if test -n "$FINGER"; then
3792   echo "$ac_t""$FINGER" 1>&6
3793 else
3794   echo "$ac_t""no" 1>&6
3795 fi
3796
3797
3798 ol_link_perl=no
3799 if test $ol_enable_perl != no ; then
3800         # Extract the first word of "perl", so it can be a program name with args.
3801 set dummy perl; ac_word=$2
3802 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3803 echo "configure:3804: checking for $ac_word" >&5
3804 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3805   echo $ac_n "(cached) $ac_c" 1>&6
3806 else
3807   case "$PERLBIN" in
3808   /*)
3809   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3810   ;;
3811   ?:/*)
3812   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3813   ;;
3814   *)
3815   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3816   ac_dummy="$PATH"
3817   for ac_dir in $ac_dummy; do 
3818     test -z "$ac_dir" && ac_dir=.
3819     if test -f $ac_dir/$ac_word; then
3820       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3821       break
3822     fi
3823   done
3824   IFS="$ac_save_ifs"
3825   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3826   ;;
3827 esac
3828 fi
3829 PERLBIN="$ac_cv_path_PERLBIN"
3830 if test -n "$PERLBIN"; then
3831   echo "$ac_t""$PERLBIN" 1>&6
3832 else
3833   echo "$ac_t""no" 1>&6
3834 fi
3835
3836
3837         if test "no$PERLBIN" = "no" ; then
3838                 if test $ol_enable_perl = yes ; then
3839                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3840                 fi
3841
3842         else
3843                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3844                 if test x"$ol_with_perl_module" = "xstatic" ; then
3845                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3846                 else
3847                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3848                 fi
3849                                 ol_link_perl=yes
3850         fi
3851 fi
3852
3853 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3854 echo "configure:3855: checking how to run the C preprocessor" >&5
3855 # On Suns, sometimes $CPP names a directory.
3856 if test -n "$CPP" && test -d "$CPP"; then
3857   CPP=
3858 fi
3859 if test -z "$CPP"; then
3860 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863     # This must be in double quotes, not single quotes, because CPP may get
3864   # substituted into the Makefile and "${CC-cc}" will confuse make.
3865   CPP="${CC-cc} -E"
3866   # On the NeXT, cc -E runs the code through the compiler's parser,
3867   # not just through cpp.
3868   cat > conftest.$ac_ext <<EOF
3869 #line 3870 "configure"
3870 #include "confdefs.h"
3871 #include <assert.h>
3872 Syntax Error
3873 EOF
3874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3875 { (eval echo configure:3876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3877 if test -z "$ac_err"; then
3878   :
3879 else
3880   echo "$ac_err" >&5
3881   echo "configure: failed program was:" >&5
3882   cat conftest.$ac_ext >&5
3883   rm -rf conftest*
3884   CPP="${CC-cc} -E -traditional-cpp"
3885   cat > conftest.$ac_ext <<EOF
3886 #line 3887 "configure"
3887 #include "confdefs.h"
3888 #include <assert.h>
3889 Syntax Error
3890 EOF
3891 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3892 { (eval echo configure:3893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3893 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3894 if test -z "$ac_err"; then
3895   :
3896 else
3897   echo "$ac_err" >&5
3898   echo "configure: failed program was:" >&5
3899   cat conftest.$ac_ext >&5
3900   rm -rf conftest*
3901   CPP="${CC-cc} -nologo -E"
3902   cat > conftest.$ac_ext <<EOF
3903 #line 3904 "configure"
3904 #include "confdefs.h"
3905 #include <assert.h>
3906 Syntax Error
3907 EOF
3908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3909 { (eval echo configure:3910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3911 if test -z "$ac_err"; then
3912   :
3913 else
3914   echo "$ac_err" >&5
3915   echo "configure: failed program was:" >&5
3916   cat conftest.$ac_ext >&5
3917   rm -rf conftest*
3918   CPP=/lib/cpp
3919 fi
3920 rm -f conftest*
3921 fi
3922 rm -f conftest*
3923 fi
3924 rm -f conftest*
3925   ac_cv_prog_CPP="$CPP"
3926 fi
3927   CPP="$ac_cv_prog_CPP"
3928 else
3929   ac_cv_prog_CPP="$CPP"
3930 fi
3931 echo "$ac_t""$CPP" 1>&6
3932
3933
3934 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3935         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3936
3937 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3938         echo "configure: warning: programs compiled here do run here..." 1>&2
3939         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3940
3941 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3942         echo "configure: warning: programs compiled here do not run here..." 1>&2
3943         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3944 fi
3945
3946 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3947 echo "configure:3948: checking for AIX" >&5
3948 cat > conftest.$ac_ext <<EOF
3949 #line 3950 "configure"
3950 #include "confdefs.h"
3951 #ifdef _AIX
3952   yes
3953 #endif
3954
3955 EOF
3956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3957   egrep "yes" >/dev/null 2>&1; then
3958   rm -rf conftest*
3959   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3960 #define _ALL_SOURCE 1
3961 EOF
3962
3963 else
3964   rm -rf conftest*
3965   echo "$ac_t""no" 1>&6
3966 fi
3967 rm -f conftest*
3968
3969
3970 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3971 echo "configure:3972: checking for POSIXized ISC" >&5
3972 if test -d /etc/conf/kconfig.d &&
3973   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3974 then
3975   echo "$ac_t""yes" 1>&6
3976   ISC=yes # If later tests want to check for ISC.
3977   cat >> confdefs.h <<\EOF
3978 #define _POSIX_SOURCE 1
3979 EOF
3980
3981   if test "$GCC" = yes; then
3982     CC="$CC -posix"
3983   else
3984     CC="$CC -Xp"
3985   fi
3986 else
3987   echo "$ac_t""no" 1>&6
3988   ISC=
3989 fi
3990
3991 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3992 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3993 echo "configure:3994: checking for minix/config.h" >&5
3994 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3995   echo $ac_n "(cached) $ac_c" 1>&6
3996 else
3997   cat > conftest.$ac_ext <<EOF
3998 #line 3999 "configure"
3999 #include "confdefs.h"
4000 #include <minix/config.h>
4001 EOF
4002 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4003 { (eval echo configure:4004: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4004 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4005 if test -z "$ac_err"; then
4006   rm -rf conftest*
4007   eval "ac_cv_header_$ac_safe=yes"
4008 else
4009   echo "$ac_err" >&5
4010   echo "configure: failed program was:" >&5
4011   cat conftest.$ac_ext >&5
4012   rm -rf conftest*
4013   eval "ac_cv_header_$ac_safe=no"
4014 fi
4015 rm -f conftest*
4016 fi
4017 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4018   echo "$ac_t""yes" 1>&6
4019   MINIX=yes
4020 else
4021   echo "$ac_t""no" 1>&6
4022 MINIX=
4023 fi
4024
4025 if test "$MINIX" = yes; then
4026   cat >> confdefs.h <<\EOF
4027 #define _POSIX_SOURCE 1
4028 EOF
4029
4030   cat >> confdefs.h <<\EOF
4031 #define _POSIX_1_SOURCE 2
4032 EOF
4033
4034   cat >> confdefs.h <<\EOF
4035 #define _MINIX 1
4036 EOF
4037
4038 fi
4039
4040
4041 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4042 echo "configure:4043: checking for Cygwin environment" >&5
4043 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4044   echo $ac_n "(cached) $ac_c" 1>&6
4045 else
4046   cat > conftest.$ac_ext <<EOF
4047 #line 4048 "configure"
4048 #include "confdefs.h"
4049
4050 int main() {
4051
4052 #ifndef __CYGWIN__
4053 #define __CYGWIN__ __CYGWIN32__
4054 #endif
4055 return __CYGWIN__;
4056 ; return 0; }
4057 EOF
4058 if { (eval echo configure:4059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4059   rm -rf conftest*
4060   ac_cv_cygwin=yes
4061 else
4062   echo "configure: failed program was:" >&5
4063   cat conftest.$ac_ext >&5
4064   rm -rf conftest*
4065   ac_cv_cygwin=no
4066 fi
4067 rm -f conftest*
4068 fi
4069
4070 echo "$ac_t""$ac_cv_cygwin" 1>&6
4071 CYGWIN=
4072 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4073 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4074 echo "configure:4075: checking for mingw32 environment" >&5
4075 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4076   echo $ac_n "(cached) $ac_c" 1>&6
4077 else
4078   cat > conftest.$ac_ext <<EOF
4079 #line 4080 "configure"
4080 #include "confdefs.h"
4081
4082 int main() {
4083 return __MINGW32__;
4084 ; return 0; }
4085 EOF
4086 if { (eval echo configure:4087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4087   rm -rf conftest*
4088   ac_cv_mingw32=yes
4089 else
4090   echo "configure: failed program was:" >&5
4091   cat conftest.$ac_ext >&5
4092   rm -rf conftest*
4093   ac_cv_mingw32=no
4094 fi
4095 rm -f conftest*
4096 fi
4097
4098 echo "$ac_t""$ac_cv_mingw32" 1>&6
4099 MINGW32=
4100 test "$ac_cv_mingw32" = yes && MINGW32=yes
4101 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4102 echo "configure:4103: checking for EMX OS/2 environment" >&5
4103 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4104   echo $ac_n "(cached) $ac_c" 1>&6
4105 else
4106   cat > conftest.$ac_ext <<EOF
4107 #line 4108 "configure"
4108 #include "confdefs.h"
4109
4110 int main() {
4111 return __EMX__;
4112 ; return 0; }
4113 EOF
4114 if { (eval echo configure:4115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4115   rm -rf conftest*
4116   ac_cv_emxos2=yes
4117 else
4118   echo "configure: failed program was:" >&5
4119   cat conftest.$ac_ext >&5
4120   rm -rf conftest*
4121   ac_cv_emxos2=no
4122 fi
4123 rm -f conftest*
4124 fi
4125
4126 echo "$ac_t""$ac_cv_emxos2" 1>&6
4127 EMXOS2=
4128 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4129
4130
4131
4132 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4133 echo "configure:4134: checking for executable suffix" >&5
4134 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4135   echo $ac_n "(cached) $ac_c" 1>&6
4136 else
4137   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4138   ac_cv_exeext=.exe
4139 else
4140   rm -f conftest*
4141   echo 'int main () { return 0; }' > conftest.$ac_ext
4142   ac_cv_exeext=
4143   if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4144     for file in conftest.*; do
4145       case $file in
4146       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4147       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4148       esac
4149     done
4150   else
4151     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4152   fi
4153   rm -f conftest*
4154   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4155 fi
4156 fi
4157
4158 EXEEXT=""
4159 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4160 echo "$ac_t""${ac_cv_exeext}" 1>&6
4161 ac_exeext=$EXEEXT
4162
4163 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4164 echo "configure:4165: checking for object suffix" >&5
4165 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4166   echo $ac_n "(cached) $ac_c" 1>&6
4167 else
4168   rm -f conftest*
4169 echo 'int i = 1;' > conftest.$ac_ext
4170 if { (eval echo configure:4171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4171   for ac_file in conftest.*; do
4172     case $ac_file in
4173     *.c) ;;
4174     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4175     esac
4176   done
4177 else
4178   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4179 fi
4180 rm -f conftest*
4181 fi
4182
4183 echo "$ac_t""$ac_cv_objext" 1>&6
4184 OBJEXT=$ac_cv_objext
4185 ac_objext=$ac_cv_objext
4186
4187
4188 cat >> confdefs.h <<EOF
4189 #define EXEEXT "${EXEEXT}"
4190 EOF
4191
4192
4193 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4194 echo "configure:4195: checking for be_app in -lbe" >&5
4195 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4196 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4197   echo $ac_n "(cached) $ac_c" 1>&6
4198 else
4199   ac_save_LIBS="$LIBS"
4200 LIBS="-lbe -lroot -lnet $LIBS"
4201 cat > conftest.$ac_ext <<EOF
4202 #line 4203 "configure"
4203 #include "confdefs.h"
4204 /* Override any gcc2 internal prototype to avoid an error.  */
4205 /* We use char because int might match the return type of a gcc2
4206     builtin and then its argument prototype would still apply.  */
4207 char be_app();
4208
4209 int main() {
4210 be_app()
4211 ; return 0; }
4212 EOF
4213 if { (eval echo configure:4214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4214   rm -rf conftest*
4215   eval "ac_cv_lib_$ac_lib_var=yes"
4216 else
4217   echo "configure: failed program was:" >&5
4218   cat conftest.$ac_ext >&5
4219   rm -rf conftest*
4220   eval "ac_cv_lib_$ac_lib_var=no"
4221 fi
4222 rm -f conftest*
4223 LIBS="$ac_save_LIBS"
4224
4225 fi
4226 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4227   echo "$ac_t""yes" 1>&6
4228   LIBS="$LIBS -lbe -lroot -lnet"
4229 else
4230   echo "$ac_t""no" 1>&6
4231 :
4232 fi
4233
4234
4235
4236
4237
4238 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4239 echo "configure:4240: checking for ${CC-cc} option to accept ANSI C" >&5
4240 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4241   echo $ac_n "(cached) $ac_c" 1>&6
4242 else
4243   am_cv_prog_cc_stdc=no
4244 ac_save_CC="$CC"
4245 # Don't try gcc -ansi; that turns off useful extensions and
4246 # breaks some systems' header files.
4247 # AIX                   -qlanglvl=ansi
4248 # Ultrix and OSF/1      -std1
4249 # HP-UX 10.20 and later -Ae
4250 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4251 # SVR4                  -Xc -D__EXTENSIONS__
4252 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4253 do
4254   CC="$ac_save_CC $ac_arg"
4255   cat > conftest.$ac_ext <<EOF
4256 #line 4257 "configure"
4257 #include "confdefs.h"
4258 #include <stdarg.h>
4259 #include <stdio.h>
4260 #include <sys/types.h>
4261 #include <sys/stat.h>
4262 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4263 struct buf { int x; };
4264 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4265 static char *e (p, i)
4266      char **p;
4267      int i;
4268 {
4269   return p[i];
4270 }
4271 static char *f (char * (*g) (char **, int), char **p, ...)
4272 {
4273   char *s;
4274   va_list v;
4275   va_start (v,p);
4276   s = g (p, va_arg (v,int));
4277   va_end (v);
4278   return s;
4279 }
4280 int test (int i, double x);
4281 struct s1 {int (*f) (int a);};
4282 struct s2 {int (*f) (double a);};
4283 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4284 int argc;
4285 char **argv;
4286
4287 int main() {
4288
4289 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4290
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4294   rm -rf conftest*
4295   am_cv_prog_cc_stdc="$ac_arg"; break
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299 fi
4300 rm -f conftest*
4301 done
4302 CC="$ac_save_CC"
4303
4304 fi
4305
4306 if test -z "$am_cv_prog_cc_stdc"; then
4307   echo "$ac_t""none needed" 1>&6
4308 else
4309   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4310 fi
4311 case "x$am_cv_prog_cc_stdc" in
4312   x|xno) ;;
4313   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4314 esac
4315
4316 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4317         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4318 fi
4319
4320 # test for make depend flag
4321 OL_MKDEP=
4322 OL_MKDEP_FLAGS=
4323 if test -z "${MKDEP}"; then
4324         OL_MKDEP="${CC-cc}"
4325         if test -z "${MKDEP_FLAGS}"; then
4326                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4327 echo "configure:4328: checking for ${OL_MKDEP} depend flag" >&5
4328 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4329   echo $ac_n "(cached) $ac_c" 1>&6
4330 else
4331   
4332                         ol_cv_mkdep=no
4333                         for flag in "-M" "-xM"; do
4334                                 cat > conftest.c <<EOF
4335  noCode;
4336 EOF
4337                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4338                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4339                                 then
4340                                         if test ! -f conftest."${ac_object}" ; then
4341                                                 ol_cv_mkdep=$flag
4342                                                 OL_MKDEP_FLAGS="$flag"
4343                                                 break
4344                                         fi
4345                                 fi
4346                         done
4347                         rm -f conftest*
4348                 
4349 fi
4350
4351 echo "$ac_t""$ol_cv_mkdep" 1>&6
4352         else
4353                 cc_cv_mkdep=yes
4354                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4355         fi
4356 else
4357         cc_cv_mkdep=yes
4358         OL_MKDEP="${MKDEP}"
4359         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4360 fi
4361
4362
4363
4364 if test "${ol_cv_mkdep}" = no ; then
4365         # this will soon become an error
4366         echo "configure: warning: do not know how to generate dependencies" 1>&2
4367 fi
4368
4369 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4370 echo "configure:4371: checking for afopen in -ls" >&5
4371 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4373   echo $ac_n "(cached) $ac_c" 1>&6
4374 else
4375   ac_save_LIBS="$LIBS"
4376 LIBS="-ls  $LIBS"
4377 cat > conftest.$ac_ext <<EOF
4378 #line 4379 "configure"
4379 #include "confdefs.h"
4380 /* Override any gcc2 internal prototype to avoid an error.  */
4381 /* We use char because int might match the return type of a gcc2
4382     builtin and then its argument prototype would still apply.  */
4383 char afopen();
4384
4385 int main() {
4386 afopen()
4387 ; return 0; }
4388 EOF
4389 if { (eval echo configure:4390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4390   rm -rf conftest*
4391   eval "ac_cv_lib_$ac_lib_var=yes"
4392 else
4393   echo "configure: failed program was:" >&5
4394   cat conftest.$ac_ext >&5
4395   rm -rf conftest*
4396   eval "ac_cv_lib_$ac_lib_var=no"
4397 fi
4398 rm -f conftest*
4399 LIBS="$ac_save_LIBS"
4400
4401 fi
4402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4403   echo "$ac_t""yes" 1>&6
4404   
4405         AUTH_LIBS=-ls
4406         cat >> confdefs.h <<\EOF
4407 #define HAVE_AIX_SECURITY 1
4408 EOF
4409
4410
4411 else
4412   echo "$ac_t""no" 1>&6
4413 fi
4414
4415
4416
4417 ol_link_modules=no
4418 if test $ol_enable_modules != no ; then
4419         for ac_hdr in ltdl.h
4420 do
4421 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4422 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4423 echo "configure:4424: checking for $ac_hdr" >&5
4424 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4425   echo $ac_n "(cached) $ac_c" 1>&6
4426 else
4427   cat > conftest.$ac_ext <<EOF
4428 #line 4429 "configure"
4429 #include "confdefs.h"
4430 #include <$ac_hdr>
4431 EOF
4432 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4433 { (eval echo configure:4434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4434 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4435 if test -z "$ac_err"; then
4436   rm -rf conftest*
4437   eval "ac_cv_header_$ac_safe=yes"
4438 else
4439   echo "$ac_err" >&5
4440   echo "configure: failed program was:" >&5
4441   cat conftest.$ac_ext >&5
4442   rm -rf conftest*
4443   eval "ac_cv_header_$ac_safe=no"
4444 fi
4445 rm -f conftest*
4446 fi
4447 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4448   echo "$ac_t""yes" 1>&6
4449     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4450   cat >> confdefs.h <<EOF
4451 #define $ac_tr_hdr 1
4452 EOF
4453  
4454 else
4455   echo "$ac_t""no" 1>&6
4456 fi
4457 done
4458
4459
4460         if test $ac_cv_header_ltdl_h = no ; then
4461                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4462         fi
4463
4464         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4465 echo "configure:4466: checking for lt_dlinit in -lltdl" >&5
4466 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4467 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4468   echo $ac_n "(cached) $ac_c" 1>&6
4469 else
4470   ac_save_LIBS="$LIBS"
4471 LIBS="-lltdl  $LIBS"
4472 cat > conftest.$ac_ext <<EOF
4473 #line 4474 "configure"
4474 #include "confdefs.h"
4475 /* Override any gcc2 internal prototype to avoid an error.  */
4476 /* We use char because int might match the return type of a gcc2
4477     builtin and then its argument prototype would still apply.  */
4478 char lt_dlinit();
4479
4480 int main() {
4481 lt_dlinit()
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   eval "ac_cv_lib_$ac_lib_var=yes"
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   eval "ac_cv_lib_$ac_lib_var=no"
4492 fi
4493 rm -f conftest*
4494 LIBS="$ac_save_LIBS"
4495
4496 fi
4497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4498   echo "$ac_t""yes" 1>&6
4499   
4500                 MODULES_LIBS=-lltdl
4501                 cat >> confdefs.h <<\EOF
4502 #define HAVE_LIBLTDL 1
4503 EOF
4504
4505         
4506 else
4507   echo "$ac_t""no" 1>&6
4508 fi
4509
4510
4511         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4512                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4513         fi
4514         ol_link_modules=yes
4515 else
4516         ol_with_bdb_module=static
4517         ol_with_dnssrv_module=static
4518         ol_with_ldap_module=static
4519         ol_with_ldbm_module=static
4520         ol_with_meta_module=static
4521         ol_with_monitor_module=static
4522         ol_with_passwd_module=static
4523         ol_with_perl_module=static
4524         ol_with_shell_module=static
4525         ol_with_tcl_module=static
4526         ol_with_sql_module=static
4527 fi
4528
4529 # test for EBCDIC
4530 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4531 echo "configure:4532: checking for EBCDIC" >&5
4532 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4533   echo $ac_n "(cached) $ac_c" 1>&6
4534 else
4535   
4536         cat > conftest.$ac_ext <<EOF
4537 #line 4538 "configure"
4538 #include "confdefs.h"
4539
4540 #if !('M' == 0xd4)
4541 #include <__ASCII__/generate_error.h>
4542 #endif
4543
4544 EOF
4545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4546 { (eval echo configure:4547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4548 if test -z "$ac_err"; then
4549   rm -rf conftest*
4550   ol_cv_cpp_ebcdic=yes
4551 else
4552   echo "$ac_err" >&5
4553   echo "configure: failed program was:" >&5
4554   cat conftest.$ac_ext >&5
4555   rm -rf conftest*
4556   ol_cv_cpp_ebcdic=no
4557 fi
4558 rm -f conftest*
4559 fi
4560
4561 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4562 if test $ol_cv_cpp_ebcdic = yes ; then
4563         cat >> confdefs.h <<\EOF
4564 #define HAVE_EBCDIC 1
4565 EOF
4566
4567 fi
4568
4569 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4570 echo "configure:4571: checking for ANSI C header files" >&5
4571 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4572   echo $ac_n "(cached) $ac_c" 1>&6
4573 else
4574   cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 #include <stdlib.h>
4578 #include <stdarg.h>
4579 #include <string.h>
4580 #include <float.h>
4581 EOF
4582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4583 { (eval echo configure:4584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4584 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4585 if test -z "$ac_err"; then
4586   rm -rf conftest*
4587   ol_cv_header_stdc=yes
4588 else
4589   echo "$ac_err" >&5
4590   echo "configure: failed program was:" >&5
4591   cat conftest.$ac_ext >&5
4592   rm -rf conftest*
4593   ol_cv_header_stdc=no
4594 fi
4595 rm -f conftest*
4596
4597 if test $ol_cv_header_stdc = yes; then
4598   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4599 cat > conftest.$ac_ext <<EOF
4600 #line 4601 "configure"
4601 #include "confdefs.h"
4602 #include <string.h>
4603 EOF
4604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4605   egrep "memchr" >/dev/null 2>&1; then
4606   :
4607 else
4608   rm -rf conftest*
4609   ol_cv_header_stdc=no
4610 fi
4611 rm -f conftest*
4612
4613 fi
4614
4615 if test $ol_cv_header_stdc = yes; then
4616   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4617 cat > conftest.$ac_ext <<EOF
4618 #line 4619 "configure"
4619 #include "confdefs.h"
4620 #include <stdlib.h>
4621 EOF
4622 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4623   egrep "free" >/dev/null 2>&1; then
4624   :
4625 else
4626   rm -rf conftest*
4627   ol_cv_header_stdc=no
4628 fi
4629 rm -f conftest*
4630
4631 fi
4632
4633 if test $ol_cv_header_stdc = yes; then
4634   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4635 if test "$cross_compiling" = yes; then
4636   :
4637 else
4638   cat > conftest.$ac_ext <<EOF
4639 #line 4640 "configure"
4640 #include "confdefs.h"
4641 #include <ctype.h>
4642 #ifndef HAVE_EBCDIC
4643 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4644 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4645 #else
4646 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4647                 || ('j' <= (c) && (c) <= 'r') \
4648                 || ('s' <= (c) && (c) <= 'z'))
4649 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4650 #endif
4651 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4652 int main () { int i; for (i = 0; i < 256; i++)
4653 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4654 exit (0); }
4655
4656 EOF
4657 if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4658 then
4659   :
4660 else
4661   echo "configure: failed program was:" >&5
4662   cat conftest.$ac_ext >&5
4663   rm -fr conftest*
4664   ol_cv_header_stdc=no
4665 fi
4666 rm -fr conftest*
4667 fi
4668
4669 fi
4670 fi
4671
4672 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4673 if test $ol_cv_header_stdc = yes; then
4674   cat >> confdefs.h <<\EOF
4675 #define STDC_HEADERS 1
4676 EOF
4677
4678 fi
4679 ac_cv_header_stdc=disable
4680
4681
4682 if test $ol_cv_header_stdc != yes; then
4683         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4684 fi
4685
4686 ac_header_dirent=no
4687 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4688 do
4689 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4690 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4691 echo "configure:4692: checking for $ac_hdr that defines DIR" >&5
4692 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4693   echo $ac_n "(cached) $ac_c" 1>&6
4694 else
4695   cat > conftest.$ac_ext <<EOF
4696 #line 4697 "configure"
4697 #include "confdefs.h"
4698 #include <sys/types.h>
4699 #include <$ac_hdr>
4700 int main() {
4701 DIR *dirp = 0;
4702 ; return 0; }
4703 EOF
4704 if { (eval echo configure:4705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4705   rm -rf conftest*
4706   eval "ac_cv_header_dirent_$ac_safe=yes"
4707 else
4708   echo "configure: failed program was:" >&5
4709   cat conftest.$ac_ext >&5
4710   rm -rf conftest*
4711   eval "ac_cv_header_dirent_$ac_safe=no"
4712 fi
4713 rm -f conftest*
4714 fi
4715 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4716   echo "$ac_t""yes" 1>&6
4717     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4718   cat >> confdefs.h <<EOF
4719 #define $ac_tr_hdr 1
4720 EOF
4721  ac_header_dirent=$ac_hdr; break
4722 else
4723   echo "$ac_t""no" 1>&6
4724 fi
4725 done
4726 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4727 if test $ac_header_dirent = dirent.h; then
4728 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4729 echo "configure:4730: checking for opendir in -ldir" >&5
4730 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4731 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4732   echo $ac_n "(cached) $ac_c" 1>&6
4733 else
4734   ac_save_LIBS="$LIBS"
4735 LIBS="-ldir  $LIBS"
4736 cat > conftest.$ac_ext <<EOF
4737 #line 4738 "configure"
4738 #include "confdefs.h"
4739 /* Override any gcc2 internal prototype to avoid an error.  */
4740 /* We use char because int might match the return type of a gcc2
4741     builtin and then its argument prototype would still apply.  */
4742 char opendir();
4743
4744 int main() {
4745 opendir()
4746 ; return 0; }
4747 EOF
4748 if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4749   rm -rf conftest*
4750   eval "ac_cv_lib_$ac_lib_var=yes"
4751 else
4752   echo "configure: failed program was:" >&5
4753   cat conftest.$ac_ext >&5
4754   rm -rf conftest*
4755   eval "ac_cv_lib_$ac_lib_var=no"
4756 fi
4757 rm -f conftest*
4758 LIBS="$ac_save_LIBS"
4759
4760 fi
4761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4762   echo "$ac_t""yes" 1>&6
4763   LIBS="$LIBS -ldir"
4764 else
4765   echo "$ac_t""no" 1>&6
4766 fi
4767
4768 else
4769 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4770 echo "configure:4771: checking for opendir in -lx" >&5
4771 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4772 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4773   echo $ac_n "(cached) $ac_c" 1>&6
4774 else
4775   ac_save_LIBS="$LIBS"
4776 LIBS="-lx  $LIBS"
4777 cat > conftest.$ac_ext <<EOF
4778 #line 4779 "configure"
4779 #include "confdefs.h"
4780 /* Override any gcc2 internal prototype to avoid an error.  */
4781 /* We use char because int might match the return type of a gcc2
4782     builtin and then its argument prototype would still apply.  */
4783 char opendir();
4784
4785 int main() {
4786 opendir()
4787 ; return 0; }
4788 EOF
4789 if { (eval echo configure:4790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4790   rm -rf conftest*
4791   eval "ac_cv_lib_$ac_lib_var=yes"
4792 else
4793   echo "configure: failed program was:" >&5
4794   cat conftest.$ac_ext >&5
4795   rm -rf conftest*
4796   eval "ac_cv_lib_$ac_lib_var=no"
4797 fi
4798 rm -f conftest*
4799 LIBS="$ac_save_LIBS"
4800
4801 fi
4802 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4803   echo "$ac_t""yes" 1>&6
4804   LIBS="$LIBS -lx"
4805 else
4806   echo "$ac_t""no" 1>&6
4807 fi
4808
4809 fi
4810
4811 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4812 echo "configure:4813: checking for sys/wait.h that is POSIX.1 compatible" >&5
4813 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816   cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819 #include <sys/types.h>
4820 #include <sys/wait.h>
4821 #ifndef WEXITSTATUS
4822 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4823 #endif
4824 #ifndef WIFEXITED
4825 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4826 #endif
4827 int main() {
4828 int s;
4829 wait (&s);
4830 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4831 ; return 0; }
4832 EOF
4833 if { (eval echo configure:4834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4834   rm -rf conftest*
4835   ac_cv_header_sys_wait_h=yes
4836 else
4837   echo "configure: failed program was:" >&5
4838   cat conftest.$ac_ext >&5
4839   rm -rf conftest*
4840   ac_cv_header_sys_wait_h=no
4841 fi
4842 rm -f conftest*
4843 fi
4844
4845 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4846 if test $ac_cv_header_sys_wait_h = yes; then
4847   cat >> confdefs.h <<\EOF
4848 #define HAVE_SYS_WAIT_H 1
4849 EOF
4850
4851 fi
4852
4853 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4854 echo "configure:4855: checking POSIX termios" >&5
4855 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4856   echo $ac_n "(cached) $ac_c" 1>&6
4857 else
4858   cat > conftest.$ac_ext <<EOF
4859 #line 4860 "configure"
4860 #include "confdefs.h"
4861 #include <sys/types.h>
4862 #include <unistd.h>
4863 #include <termios.h>
4864 int main() {
4865 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4866    tcgetattr(0, 0);
4867 ; return 0; }
4868 EOF
4869 if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4870   rm -rf conftest*
4871   am_cv_sys_posix_termios=yes
4872 else
4873   echo "configure: failed program was:" >&5
4874   cat conftest.$ac_ext >&5
4875   rm -rf conftest*
4876   am_cv_sys_posix_termios=no
4877 fi
4878 rm -f conftest*
4879 fi
4880
4881 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4882
4883
4884  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4885 echo "configure:4886: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4886 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4887   echo $ac_n "(cached) $ac_c" 1>&6
4888 else
4889   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4890
4891   gwinsz_in_termios_h=no
4892   if test $am_cv_sys_posix_termios = yes; then
4893     cat > conftest.$ac_ext <<EOF
4894 #line 4895 "configure"
4895 #include "confdefs.h"
4896 #include <sys/types.h>
4897 #     include <termios.h>
4898 #     ifdef TIOCGWINSZ
4899         yes
4900 #     endif
4901     
4902 EOF
4903 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4904   egrep "yes" >/dev/null 2>&1; then
4905   rm -rf conftest*
4906   gwinsz_in_termios_h=yes
4907 fi
4908 rm -f conftest*
4909
4910   fi
4911
4912   if test $gwinsz_in_termios_h = no; then
4913     cat > conftest.$ac_ext <<EOF
4914 #line 4915 "configure"
4915 #include "confdefs.h"
4916 #include <sys/types.h>
4917 #     include <sys/ioctl.h>
4918 #     ifdef TIOCGWINSZ
4919         yes
4920 #     endif
4921     
4922 EOF
4923 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4924   egrep "yes" >/dev/null 2>&1; then
4925   rm -rf conftest*
4926   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4927 fi
4928 rm -f conftest*
4929
4930   fi
4931   
4932 fi
4933
4934 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4935   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4936     cat >> confdefs.h <<\EOF
4937 #define GWINSZ_IN_SYS_IOCTL 1
4938 EOF
4939
4940   fi
4941
4942 if test $am_cv_sys_posix_termios = yes ; then
4943         cat >> confdefs.h <<\EOF
4944 #define HAVE_POSIX_TERMIOS 1
4945 EOF
4946
4947 fi
4948
4949 for ac_hdr in \
4950         arpa/inet.h             \
4951         arpa/nameser.h  \
4952         assert.h                \
4953         conio.h                 \
4954         crypt.h                 \
4955         direct.h                \
4956         errno.h                 \
4957         fcntl.h                 \
4958         filio.h                 \
4959         getopt.h                \
4960         grp.h                   \
4961         io.h                    \
4962         libutil.h               \
4963         limits.h                \
4964         locale.h                \
4965         netinet/tcp.h   \
4966         malloc.h                \
4967         memory.h                \
4968         psap.h                  \
4969         pwd.h                   \
4970         process.h               \
4971         resolv.h                \
4972         sgtty.h                 \
4973         shadow.h                \
4974         stddef.h                \
4975         string.h                \
4976         strings.h               \
4977         sysexits.h              \
4978         sys/file.h              \
4979         sys/filio.h             \
4980         sys/errno.h             \
4981         sys/ioctl.h             \
4982         sys/param.h             \
4983         sys/resource.h  \
4984         sys/select.h    \
4985         sys/socket.h    \
4986         sys/syslog.h    \
4987         sys/time.h              \
4988         sys/types.h             \
4989         syslog.h                \
4990         termios.h               \
4991         unistd.h                \
4992         winsock.h               \
4993         winsock2.h              \
4994
4995 do
4996 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4997 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4998 echo "configure:4999: checking for $ac_hdr" >&5
4999 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5000   echo $ac_n "(cached) $ac_c" 1>&6
5001 else
5002   cat > conftest.$ac_ext <<EOF
5003 #line 5004 "configure"
5004 #include "confdefs.h"
5005 #include <$ac_hdr>
5006 EOF
5007 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5008 { (eval echo configure:5009: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5009 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5010 if test -z "$ac_err"; then
5011   rm -rf conftest*
5012   eval "ac_cv_header_$ac_safe=yes"
5013 else
5014   echo "$ac_err" >&5
5015   echo "configure: failed program was:" >&5
5016   cat conftest.$ac_ext >&5
5017   rm -rf conftest*
5018   eval "ac_cv_header_$ac_safe=no"
5019 fi
5020 rm -f conftest*
5021 fi
5022 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5023   echo "$ac_t""yes" 1>&6
5024     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5025   cat >> confdefs.h <<EOF
5026 #define $ac_tr_hdr 1
5027 EOF
5028  
5029 else
5030   echo "$ac_t""no" 1>&6
5031 fi
5032 done
5033
5034
5035
5036
5037 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
5038 echo "configure:5039: checking for dlopen" >&5
5039 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5040   echo $ac_n "(cached) $ac_c" 1>&6
5041 else
5042   cat > conftest.$ac_ext <<EOF
5043 #line 5044 "configure"
5044 #include "confdefs.h"
5045 /* System header to define __stub macros and hopefully few prototypes,
5046     which can conflict with char dlopen(); below.  */
5047 #include <assert.h>
5048 /* Override any gcc2 internal prototype to avoid an error.  */
5049 /* We use char because int might match the return type of a gcc2
5050     builtin and then its argument prototype would still apply.  */
5051 char dlopen();
5052 char (*f)();
5053
5054 int main() {
5055
5056 /* The GNU C library defines this for functions which it implements
5057     to always fail with ENOSYS.  Some functions are actually named
5058     something starting with __ and the normal name is an alias.  */
5059 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5060 choke me
5061 #else
5062 f = dlopen;
5063 #endif
5064
5065 ; return 0; }
5066 EOF
5067 if { (eval echo configure:5068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5068   rm -rf conftest*
5069   eval "ac_cv_func_dlopen=yes"
5070 else
5071   echo "configure: failed program was:" >&5
5072   cat conftest.$ac_ext >&5
5073   rm -rf conftest*
5074   eval "ac_cv_func_dlopen=no"
5075 fi
5076 rm -f conftest*
5077 fi
5078
5079 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5080   echo "$ac_t""yes" 1>&6
5081   :
5082 else
5083   echo "$ac_t""no" 1>&6
5084 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5085 echo "configure:5086: checking for dlopen in -ldl" >&5
5086 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5087 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5088   echo $ac_n "(cached) $ac_c" 1>&6
5089 else
5090   ac_save_LIBS="$LIBS"
5091 LIBS="-ldl  $LIBS"
5092 cat > conftest.$ac_ext <<EOF
5093 #line 5094 "configure"
5094 #include "confdefs.h"
5095 /* Override any gcc2 internal prototype to avoid an error.  */
5096 /* We use char because int might match the return type of a gcc2
5097     builtin and then its argument prototype would still apply.  */
5098 char dlopen();
5099
5100 int main() {
5101 dlopen()
5102 ; return 0; }
5103 EOF
5104 if { (eval echo configure:5105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5105   rm -rf conftest*
5106   eval "ac_cv_lib_$ac_lib_var=yes"
5107 else
5108   echo "configure: failed program was:" >&5
5109   cat conftest.$ac_ext >&5
5110   rm -rf conftest*
5111   eval "ac_cv_lib_$ac_lib_var=no"
5112 fi
5113 rm -f conftest*
5114 LIBS="$ac_save_LIBS"
5115
5116 fi
5117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5118   echo "$ac_t""yes" 1>&6
5119     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5120     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5121   cat >> confdefs.h <<EOF
5122 #define $ac_tr_lib 1
5123 EOF
5124
5125   LIBS="-ldl $LIBS"
5126
5127 else
5128   echo "$ac_t""no" 1>&6
5129 fi
5130
5131 fi
5132
5133
5134
5135 echo $ac_n "checking for winsock""... $ac_c" 1>&6
5136 echo "configure:5137: checking for winsock" >&5
5137 save_LIBS="$LIBS"
5138 for curlib in ws2_32 wsock32; do
5139         LIBS="$LIBS -l$curlib"
5140         cat > conftest.$ac_ext <<EOF
5141 #line 5142 "configure"
5142 #include "confdefs.h"
5143
5144                         char socket@12();
5145                         char select@20();
5146                         char closesocket@4();
5147                         char gethostname@8();
5148                         
5149 int main() {
5150
5151                         socket@12();
5152                         select@20();
5153                         closesocket@4();
5154                         gethostname@8();
5155                         
5156 ; return 0; }
5157 EOF
5158 if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5159   rm -rf conftest*
5160   have_winsock=yes
5161 else
5162   echo "configure: failed program was:" >&5
5163   cat conftest.$ac_ext >&5
5164   rm -rf conftest*
5165   have_winsock=no
5166 fi
5167 rm -f conftest*
5168
5169         if test $have_winsock = yes; then
5170                 cat >> confdefs.h <<\EOF
5171 #define HAVE_WINSOCK 1
5172 EOF
5173
5174                 ac_cv_func_socket=yes
5175                 ac_cv_func_select=yes
5176                 ac_cv_func_closesocket=yes
5177                 ac_cv_func_gethostname=yes
5178                 if test $curlib = ws2_32; then
5179                         have_winsock=winsock2
5180                         cat >> confdefs.h <<\EOF
5181 #define HAVE_WINSOCK2 1
5182 EOF
5183
5184                 fi
5185                 break
5186         fi
5187         LIBS="$save_LIBS"
5188 done
5189 echo "$ac_t""$have_winsock" 1>&6
5190
5191
5192 echo $ac_n "checking for socket""... $ac_c" 1>&6
5193 echo "configure:5194: checking for socket" >&5
5194 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5195   echo $ac_n "(cached) $ac_c" 1>&6
5196 else
5197   cat > conftest.$ac_ext <<EOF
5198 #line 5199 "configure"
5199 #include "confdefs.h"
5200 /* System header to define __stub macros and hopefully few prototypes,
5201     which can conflict with char socket(); below.  */
5202 #include <assert.h>
5203 /* Override any gcc2 internal prototype to avoid an error.  */
5204 /* We use char because int might match the return type of a gcc2
5205     builtin and then its argument prototype would still apply.  */
5206 char socket();
5207 char (*f)();
5208
5209 int main() {
5210
5211 /* The GNU C library defines this for functions which it implements
5212     to always fail with ENOSYS.  Some functions are actually named
5213     something starting with __ and the normal name is an alias.  */
5214 #if defined (__stub_socket) || defined (__stub___socket)
5215 choke me
5216 #else
5217 f = socket;
5218 #endif
5219
5220 ; return 0; }
5221 EOF
5222 if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5223   rm -rf conftest*
5224   eval "ac_cv_func_socket=yes"
5225 else
5226   echo "configure: failed program was:" >&5
5227   cat conftest.$ac_ext >&5
5228   rm -rf conftest*
5229   eval "ac_cv_func_socket=no"
5230 fi
5231 rm -f conftest*
5232 fi
5233
5234 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5235   echo "$ac_t""yes" 1>&6
5236   :
5237 else
5238   echo "$ac_t""no" 1>&6
5239         
5240         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5241 echo "configure:5242: checking for main in -lsocket" >&5
5242 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5243 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5244   echo $ac_n "(cached) $ac_c" 1>&6
5245 else
5246   ac_save_LIBS="$LIBS"
5247 LIBS="-lsocket  $LIBS"
5248 cat > conftest.$ac_ext <<EOF
5249 #line 5250 "configure"
5250 #include "confdefs.h"
5251
5252 int main() {
5253 main()
5254 ; return 0; }
5255 EOF
5256 if { (eval echo configure:5257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5257   rm -rf conftest*
5258   eval "ac_cv_lib_$ac_lib_var=yes"
5259 else
5260   echo "configure: failed program was:" >&5
5261   cat conftest.$ac_ext >&5
5262   rm -rf conftest*
5263   eval "ac_cv_lib_$ac_lib_var=no"
5264 fi
5265 rm -f conftest*
5266 LIBS="$ac_save_LIBS"
5267
5268 fi
5269 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5270   echo "$ac_t""yes" 1>&6
5271     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5272     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5273   cat >> confdefs.h <<EOF
5274 #define $ac_tr_lib 1
5275 EOF
5276
5277   LIBS="-lsocket $LIBS"
5278
5279 else
5280   echo "$ac_t""no" 1>&6
5281 fi
5282
5283         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5284 echo "configure:5285: checking for main in -lnet" >&5
5285 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5286 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5287   echo $ac_n "(cached) $ac_c" 1>&6
5288 else
5289   ac_save_LIBS="$LIBS"
5290 LIBS="-lnet  $LIBS"
5291 cat > conftest.$ac_ext <<EOF
5292 #line 5293 "configure"
5293 #include "confdefs.h"
5294
5295 int main() {
5296 main()
5297 ; return 0; }
5298 EOF
5299 if { (eval echo configure:5300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5300   rm -rf conftest*
5301   eval "ac_cv_lib_$ac_lib_var=yes"
5302 else
5303   echo "configure: failed program was:" >&5
5304   cat conftest.$ac_ext >&5
5305   rm -rf conftest*
5306   eval "ac_cv_lib_$ac_lib_var=no"
5307 fi
5308 rm -f conftest*
5309 LIBS="$ac_save_LIBS"
5310
5311 fi
5312 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5313   echo "$ac_t""yes" 1>&6
5314     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5315     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5316   cat >> confdefs.h <<EOF
5317 #define $ac_tr_lib 1
5318 EOF
5319
5320   LIBS="-lnet $LIBS"
5321
5322 else
5323   echo "$ac_t""no" 1>&6
5324 fi
5325
5326         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5327 echo "configure:5328: checking for main in -lnsl_s" >&5
5328 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5329 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5330   echo $ac_n "(cached) $ac_c" 1>&6
5331 else
5332   ac_save_LIBS="$LIBS"
5333 LIBS="-lnsl_s  $LIBS"
5334 cat > conftest.$ac_ext <<EOF
5335 #line 5336 "configure"
5336 #include "confdefs.h"
5337
5338 int main() {
5339 main()
5340 ; return 0; }
5341 EOF
5342 if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5343   rm -rf conftest*
5344   eval "ac_cv_lib_$ac_lib_var=yes"
5345 else
5346   echo "configure: failed program was:" >&5
5347   cat conftest.$ac_ext >&5
5348   rm -rf conftest*
5349   eval "ac_cv_lib_$ac_lib_var=no"
5350 fi
5351 rm -f conftest*
5352 LIBS="$ac_save_LIBS"
5353
5354 fi
5355 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5356   echo "$ac_t""yes" 1>&6
5357     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5358     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5359   cat >> confdefs.h <<EOF
5360 #define $ac_tr_lib 1
5361 EOF
5362
5363   LIBS="-lnsl_s $LIBS"
5364
5365 else
5366   echo "$ac_t""no" 1>&6
5367 fi
5368
5369         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5370 echo "configure:5371: checking for main in -lnsl" >&5
5371 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5373   echo $ac_n "(cached) $ac_c" 1>&6
5374 else
5375   ac_save_LIBS="$LIBS"
5376 LIBS="-lnsl  $LIBS"
5377 cat > conftest.$ac_ext <<EOF
5378 #line 5379 "configure"
5379 #include "confdefs.h"
5380
5381 int main() {
5382 main()
5383 ; return 0; }
5384 EOF
5385 if { (eval echo configure:5386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5386   rm -rf conftest*
5387   eval "ac_cv_lib_$ac_lib_var=yes"
5388 else
5389   echo "configure: failed program was:" >&5
5390   cat conftest.$ac_ext >&5
5391   rm -rf conftest*
5392   eval "ac_cv_lib_$ac_lib_var=no"
5393 fi
5394 rm -f conftest*
5395 LIBS="$ac_save_LIBS"
5396
5397 fi
5398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5399   echo "$ac_t""yes" 1>&6
5400     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5401     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5402   cat >> confdefs.h <<EOF
5403 #define $ac_tr_lib 1
5404 EOF
5405
5406   LIBS="-lnsl $LIBS"
5407
5408 else
5409   echo "$ac_t""no" 1>&6
5410 fi
5411
5412         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5413 echo "configure:5414: checking for socket in -linet" >&5
5414 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5415 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5416   echo $ac_n "(cached) $ac_c" 1>&6
5417 else
5418   ac_save_LIBS="$LIBS"
5419 LIBS="-linet  $LIBS"
5420 cat > conftest.$ac_ext <<EOF
5421 #line 5422 "configure"
5422 #include "confdefs.h"
5423 /* Override any gcc2 internal prototype to avoid an error.  */
5424 /* We use char because int might match the return type of a gcc2
5425     builtin and then its argument prototype would still apply.  */
5426 char socket();
5427
5428 int main() {
5429 socket()
5430 ; return 0; }
5431 EOF
5432 if { (eval echo configure:5433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5433   rm -rf conftest*
5434   eval "ac_cv_lib_$ac_lib_var=yes"
5435 else
5436   echo "configure: failed program was:" >&5
5437   cat conftest.$ac_ext >&5
5438   rm -rf conftest*
5439   eval "ac_cv_lib_$ac_lib_var=no"
5440 fi
5441 rm -f conftest*
5442 LIBS="$ac_save_LIBS"
5443
5444 fi
5445 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5446   echo "$ac_t""yes" 1>&6
5447     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5448     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5449   cat >> confdefs.h <<EOF
5450 #define $ac_tr_lib 1
5451 EOF
5452
5453   LIBS="-linet $LIBS"
5454
5455 else
5456   echo "$ac_t""no" 1>&6
5457 fi
5458
5459         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5460 echo "configure:5461: checking for main in -lgen" >&5
5461 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5462 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5463   echo $ac_n "(cached) $ac_c" 1>&6
5464 else
5465   ac_save_LIBS="$LIBS"
5466 LIBS="-lgen  $LIBS"
5467 cat > conftest.$ac_ext <<EOF
5468 #line 5469 "configure"
5469 #include "confdefs.h"
5470
5471 int main() {
5472 main()
5473 ; return 0; }
5474 EOF
5475 if { (eval echo configure:5476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5476   rm -rf conftest*
5477   eval "ac_cv_lib_$ac_lib_var=yes"
5478 else
5479   echo "configure: failed program was:" >&5
5480   cat conftest.$ac_ext >&5
5481   rm -rf conftest*
5482   eval "ac_cv_lib_$ac_lib_var=no"
5483 fi
5484 rm -f conftest*
5485 LIBS="$ac_save_LIBS"
5486
5487 fi
5488 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5489   echo "$ac_t""yes" 1>&6
5490     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5491     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5492   cat >> confdefs.h <<EOF
5493 #define $ac_tr_lib 1
5494 EOF
5495
5496   LIBS="-lgen $LIBS"
5497
5498 else
5499   echo "$ac_t""no" 1>&6
5500 fi
5501
5502
5503 fi
5504
5505
5506 echo $ac_n "checking for select""... $ac_c" 1>&6
5507 echo "configure:5508: checking for select" >&5
5508 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5509   echo $ac_n "(cached) $ac_c" 1>&6
5510 else
5511   cat > conftest.$ac_ext <<EOF
5512 #line 5513 "configure"
5513 #include "confdefs.h"
5514 /* System header to define __stub macros and hopefully few prototypes,
5515     which can conflict with char select(); below.  */
5516 #include <assert.h>
5517 /* Override any gcc2 internal prototype to avoid an error.  */
5518 /* We use char because int might match the return type of a gcc2
5519     builtin and then its argument prototype would still apply.  */
5520 char select();
5521 char (*f)();
5522
5523 int main() {
5524
5525 /* The GNU C library defines this for functions which it implements
5526     to always fail with ENOSYS.  Some functions are actually named
5527     something starting with __ and the normal name is an alias.  */
5528 #if defined (__stub_select) || defined (__stub___select)
5529 choke me
5530 #else
5531 f = select;
5532 #endif
5533
5534 ; return 0; }
5535 EOF
5536 if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5537   rm -rf conftest*
5538   eval "ac_cv_func_select=yes"
5539 else
5540   echo "configure: failed program was:" >&5
5541   cat conftest.$ac_ext >&5
5542   rm -rf conftest*
5543   eval "ac_cv_func_select=no"
5544 fi
5545 rm -f conftest*
5546 fi
5547
5548 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5549   echo "$ac_t""yes" 1>&6
5550   :
5551 else
5552   echo "$ac_t""no" 1>&6
5553 { echo "configure: error: select() required." 1>&2; exit 1; }
5554 fi
5555
5556
5557 if test "${ac_cv_header_winsock_h}" != yes; then
5558                                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5559 echo "configure:5560: checking types of arguments for select()" >&5
5560  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5561   echo $ac_n "(cached) $ac_c" 1>&6
5562 else
5563    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5564   echo $ac_n "(cached) $ac_c" 1>&6
5565 else
5566     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5567   echo $ac_n "(cached) $ac_c" 1>&6
5568 else
5569      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5570      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5571       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5572        cat > conftest.$ac_ext <<EOF
5573 #line 5574 "configure"
5574 #include "confdefs.h"
5575 #ifdef HAVE_SYS_TYPES_H
5576 #include <sys/types.h>
5577 #endif
5578 #ifdef HAVE_SYS_TIME_H
5579 #include <sys/time.h>
5580 #endif
5581 #ifdef HAVE_SYS_SELECT_H
5582 #include <sys/select.h>
5583 #endif
5584 #ifdef HAVE_SYS_SOCKET_H
5585 #include <sys/socket.h>
5586 #endif
5587 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);
5588 int main() {
5589
5590 ; return 0; }
5591 EOF
5592 if { (eval echo configure:5593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5593   rm -rf conftest*
5594           ac_not_found=no ; break 3
5595 else
5596   echo "configure: failed program was:" >&5
5597   cat conftest.$ac_ext >&5
5598   rm -rf conftest*
5599   ac_not_found=yes
5600 fi
5601 rm -f conftest*
5602       done
5603      done
5604     done
5605    
5606 fi
5607   
5608 fi
5609  
5610 fi
5611  if test "$ac_not_found" = yes; then
5612   ac_cv_func_select_arg1=int 
5613   ac_cv_func_select_arg234='int *' 
5614   ac_cv_func_select_arg5='struct timeval *'
5615  fi
5616  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5617  cat >> confdefs.h <<EOF
5618 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5619 EOF
5620
5621  cat >> confdefs.h <<EOF
5622 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5623 EOF
5624
5625  cat >> confdefs.h <<EOF
5626 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5627 EOF
5628
5629
5630 fi
5631
5632
5633 for ac_hdr in regex.h 
5634 do
5635 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5636 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5637 echo "configure:5638: checking for $ac_hdr" >&5
5638 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5639   echo $ac_n "(cached) $ac_c" 1>&6
5640 else
5641   cat > conftest.$ac_ext <<EOF
5642 #line 5643 "configure"
5643 #include "confdefs.h"
5644 #include <$ac_hdr>
5645 EOF
5646 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5647 { (eval echo configure:5648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5648 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5649 if test -z "$ac_err"; then
5650   rm -rf conftest*
5651   eval "ac_cv_header_$ac_safe=yes"
5652 else
5653   echo "$ac_err" >&5
5654   echo "configure: failed program was:" >&5
5655   cat conftest.$ac_ext >&5
5656   rm -rf conftest*
5657   eval "ac_cv_header_$ac_safe=no"
5658 fi
5659 rm -f conftest*
5660 fi
5661 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5662   echo "$ac_t""yes" 1>&6
5663     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5664   cat >> confdefs.h <<EOF
5665 #define $ac_tr_hdr 1
5666 EOF
5667  
5668 else
5669   echo "$ac_t""no" 1>&6
5670 fi
5671 done
5672
5673 if test "$ac_cv_header_regex_h" != yes ; then
5674         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5675 fi
5676
5677 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
5678 echo "configure:5679: checking for library containing regfree" >&5
5679 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
5680   echo $ac_n "(cached) $ac_c" 1>&6
5681 else
5682   ac_func_search_save_LIBS="$LIBS"
5683 ac_cv_search_regfree="no"
5684 cat > conftest.$ac_ext <<EOF
5685 #line 5686 "configure"
5686 #include "confdefs.h"
5687 /* Override any gcc2 internal prototype to avoid an error.  */
5688 /* We use char because int might match the return type of a gcc2
5689     builtin and then its argument prototype would still apply.  */
5690 char regfree();
5691
5692 int main() {
5693 regfree()
5694 ; return 0; }
5695 EOF
5696 if { (eval echo configure:5697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5697   rm -rf conftest*
5698   ac_cv_search_regfree="none required"
5699 else
5700   echo "configure: failed program was:" >&5
5701   cat conftest.$ac_ext >&5
5702 fi
5703 rm -f conftest*
5704 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
5705 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
5706 cat > conftest.$ac_ext <<EOF
5707 #line 5708 "configure"
5708 #include "confdefs.h"
5709 /* Override any gcc2 internal prototype to avoid an error.  */
5710 /* We use char because int might match the return type of a gcc2
5711     builtin and then its argument prototype would still apply.  */
5712 char regfree();
5713
5714 int main() {
5715 regfree()
5716 ; return 0; }
5717 EOF
5718 if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5719   rm -rf conftest*
5720   ac_cv_search_regfree="-l$ac_lib"
5721 break
5722 else
5723   echo "configure: failed program was:" >&5
5724   cat conftest.$ac_ext >&5
5725 fi
5726 rm -f conftest*
5727 done
5728 LIBS="$ac_func_search_save_LIBS"
5729 fi
5730
5731 echo "$ac_t""$ac_cv_search_regfree" 1>&6
5732 if test "$ac_cv_search_regfree" != "no"; then
5733   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
5734   :
5735 else :
5736   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5737 fi
5738
5739
5740 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5741 echo "configure:5742: checking for compatible POSIX regex" >&5
5742 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5743   echo $ac_n "(cached) $ac_c" 1>&6
5744 else
5745   
5746         if test "$cross_compiling" = yes; then
5747   ol_cv_c_posix_regex=cross
5748 else
5749   cat > conftest.$ac_ext <<EOF
5750 #line 5751 "configure"
5751 #include "confdefs.h"
5752
5753 #include <sys/types.h>
5754 #include <regex.h>
5755 static char *pattern, *string;
5756 main()
5757 {
5758         int rc;
5759         regex_t re;
5760
5761         pattern = "^A";
5762
5763         if(regcomp(&re, pattern, 0)) {
5764                 return -1;
5765         }
5766         
5767         string = "ALL MATCH";
5768         
5769         rc = regexec(&re, string, 0, (void*)0, 0);
5770
5771         regfree(&re);
5772
5773         return rc;
5774 }
5775 EOF
5776 if { (eval echo configure:5777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5777 then
5778   ol_cv_c_posix_regex=yes
5779 else
5780   echo "configure: failed program was:" >&5
5781   cat conftest.$ac_ext >&5
5782   rm -fr conftest*
5783   ol_cv_c_posix_regex=no
5784 fi
5785 rm -fr conftest*
5786 fi
5787
5788 fi
5789
5790 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5791
5792 if test "$ol_cv_c_posix_regex" = no ; then
5793         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5794 fi
5795
5796 echo $ac_n "checking to see if -lrpcrt4 is needed for win32 UUID support""... $ac_c" 1>&6
5797 echo "configure:5798: checking to see if -lrpcrt4 is needed for win32 UUID support" >&5
5798 save_LIBS="$LIBS"
5799 LIBS="$LIBS -lrpcrt4"
5800 cat > conftest.$ac_ext <<EOF
5801 #line 5802 "configure"
5802 #include "confdefs.h"
5803
5804                 char UuidCreate@4();
5805                 char UuidToStringA@8();
5806                 
5807 int main() {
5808
5809                 UuidCreate@4();
5810                 UuidToStringA@8();
5811                 
5812 ; return 0; }
5813 EOF
5814 if { (eval echo configure:5815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5815   rm -rf conftest*
5816   need_rpcrt=yes
5817 else
5818   echo "configure: failed program was:" >&5
5819   cat conftest.$ac_ext >&5
5820   rm -rf conftest*
5821   need_rpcrt=no
5822 fi
5823 rm -f conftest*
5824 if test $need_rpcrt = yes; then
5825         SLAPD_LIBS="$SLAPD_LIBS -lrpcrt4"
5826 fi
5827 LIBS="$save_LIBS"
5828 echo "$ac_t""$need_rpcrt" 1>&6
5829
5830 ol_link_dnssrv=no
5831 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5832 echo "configure:5833: checking for res_query" >&5
5833 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5834   echo $ac_n "(cached) $ac_c" 1>&6
5835 else
5836   cat > conftest.$ac_ext <<EOF
5837 #line 5838 "configure"
5838 #include "confdefs.h"
5839 /* System header to define __stub macros and hopefully few prototypes,
5840     which can conflict with char res_query(); below.  */
5841 #include <assert.h>
5842 /* Override any gcc2 internal prototype to avoid an error.  */
5843 /* We use char because int might match the return type of a gcc2
5844     builtin and then its argument prototype would still apply.  */
5845 char res_query();
5846 char (*f)();
5847
5848 int main() {
5849
5850 /* The GNU C library defines this for functions which it implements
5851     to always fail with ENOSYS.  Some functions are actually named
5852     something starting with __ and the normal name is an alias.  */
5853 #if defined (__stub_res_query) || defined (__stub___res_query)
5854 choke me
5855 #else
5856 f = res_query;
5857 #endif
5858
5859 ; return 0; }
5860 EOF
5861 if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5862   rm -rf conftest*
5863   eval "ac_cv_func_res_query=yes"
5864 else
5865   echo "configure: failed program was:" >&5
5866   cat conftest.$ac_ext >&5
5867   rm -rf conftest*
5868   eval "ac_cv_func_res_query=no"
5869 fi
5870 rm -f conftest*
5871 fi
5872
5873 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5874   echo "$ac_t""yes" 1>&6
5875   :
5876 else
5877   echo "$ac_t""no" 1>&6
5878 fi
5879
5880 if test $ac_cv_func_res_query = no ; then 
5881         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5882 echo "configure:5883: checking for __res_query" >&5
5883 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5884   echo $ac_n "(cached) $ac_c" 1>&6
5885 else
5886   cat > conftest.$ac_ext <<EOF
5887 #line 5888 "configure"
5888 #include "confdefs.h"
5889 /* System header to define __stub macros and hopefully few prototypes,
5890     which can conflict with char __res_query(); below.  */
5891 #include <assert.h>
5892 /* Override any gcc2 internal prototype to avoid an error.  */
5893 /* We use char because int might match the return type of a gcc2
5894     builtin and then its argument prototype would still apply.  */
5895 char __res_query();
5896 char (*f)();
5897
5898 int main() {
5899
5900 /* The GNU C library defines this for functions which it implements
5901     to always fail with ENOSYS.  Some functions are actually named
5902     something starting with __ and the normal name is an alias.  */
5903 #if defined (__stub___res_query) || defined (__stub_____res_query)
5904 choke me
5905 #else
5906 f = __res_query;
5907 #endif
5908
5909 ; return 0; }
5910 EOF
5911 if { (eval echo configure:5912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5912   rm -rf conftest*
5913   eval "ac_cv_func___res_query=yes"
5914 else
5915   echo "configure: failed program was:" >&5
5916   cat conftest.$ac_ext >&5
5917   rm -rf conftest*
5918   eval "ac_cv_func___res_query=no"
5919 fi
5920 rm -f conftest*
5921 fi
5922
5923 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5924   echo "$ac_t""yes" 1>&6
5925   :
5926 else
5927   echo "$ac_t""no" 1>&6
5928 fi
5929
5930         ac_cv_func_res_query=$ac_cv_func___res_query
5931 fi
5932
5933 if test $ac_cv_func_res_query = no ; then 
5934         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5935 echo "configure:5936: checking for res_query in -lbind" >&5
5936 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5937 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5938   echo $ac_n "(cached) $ac_c" 1>&6
5939 else
5940   ac_save_LIBS="$LIBS"
5941 LIBS="-lbind  $LIBS"
5942 cat > conftest.$ac_ext <<EOF
5943 #line 5944 "configure"
5944 #include "confdefs.h"
5945 /* Override any gcc2 internal prototype to avoid an error.  */
5946 /* We use char because int might match the return type of a gcc2
5947     builtin and then its argument prototype would still apply.  */
5948 char res_query();
5949
5950 int main() {
5951 res_query()
5952 ; return 0; }
5953 EOF
5954 if { (eval echo configure:5955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5955   rm -rf conftest*
5956   eval "ac_cv_lib_$ac_lib_var=yes"
5957 else
5958   echo "configure: failed program was:" >&5
5959   cat conftest.$ac_ext >&5
5960   rm -rf conftest*
5961   eval "ac_cv_lib_$ac_lib_var=no"
5962 fi
5963 rm -f conftest*
5964 LIBS="$ac_save_LIBS"
5965
5966 fi
5967 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5968   echo "$ac_t""yes" 1>&6
5969     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5970     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5971   cat >> confdefs.h <<EOF
5972 #define $ac_tr_lib 1
5973 EOF
5974
5975   LIBS="-lbind $LIBS"
5976
5977 else
5978   echo "$ac_t""no" 1>&6
5979 fi
5980
5981         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5982 fi
5983
5984 if test $ac_cv_func_res_query = no ; then 
5985         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5986 echo "configure:5987: checking for __res_query in -lbind" >&5
5987 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5988 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5989   echo $ac_n "(cached) $ac_c" 1>&6
5990 else
5991   ac_save_LIBS="$LIBS"
5992 LIBS="-lbind  $LIBS"
5993 cat > conftest.$ac_ext <<EOF
5994 #line 5995 "configure"
5995 #include "confdefs.h"
5996 /* Override any gcc2 internal prototype to avoid an error.  */
5997 /* We use char because int might match the return type of a gcc2
5998     builtin and then its argument prototype would still apply.  */
5999 char __res_query();
6000
6001 int main() {
6002 __res_query()
6003 ; return 0; }
6004 EOF
6005 if { (eval echo configure:6006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6006   rm -rf conftest*
6007   eval "ac_cv_lib_$ac_lib_var=yes"
6008 else
6009   echo "configure: failed program was:" >&5
6010   cat conftest.$ac_ext >&5
6011   rm -rf conftest*
6012   eval "ac_cv_lib_$ac_lib_var=no"
6013 fi
6014 rm -f conftest*
6015 LIBS="$ac_save_LIBS"
6016
6017 fi
6018 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6019   echo "$ac_t""yes" 1>&6
6020     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6021     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6022   cat >> confdefs.h <<EOF
6023 #define $ac_tr_lib 1
6024 EOF
6025
6026   LIBS="-lbind $LIBS"
6027
6028 else
6029   echo "$ac_t""no" 1>&6
6030 fi
6031
6032         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
6033 fi
6034
6035 if test $ac_cv_func_res_query = no ; then 
6036         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
6037 echo "configure:6038: checking for res_query in -lresolv" >&5
6038 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
6039 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6040   echo $ac_n "(cached) $ac_c" 1>&6
6041 else
6042   ac_save_LIBS="$LIBS"
6043 LIBS="-lresolv  $LIBS"
6044 cat > conftest.$ac_ext <<EOF
6045 #line 6046 "configure"
6046 #include "confdefs.h"
6047 /* Override any gcc2 internal prototype to avoid an error.  */
6048 /* We use char because int might match the return type of a gcc2
6049     builtin and then its argument prototype would still apply.  */
6050 char res_query();
6051
6052 int main() {
6053 res_query()
6054 ; return 0; }
6055 EOF
6056 if { (eval echo configure:6057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6057   rm -rf conftest*
6058   eval "ac_cv_lib_$ac_lib_var=yes"
6059 else
6060   echo "configure: failed program was:" >&5
6061   cat conftest.$ac_ext >&5
6062   rm -rf conftest*
6063   eval "ac_cv_lib_$ac_lib_var=no"
6064 fi
6065 rm -f conftest*
6066 LIBS="$ac_save_LIBS"
6067
6068 fi
6069 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6070   echo "$ac_t""yes" 1>&6
6071     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6072     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6073   cat >> confdefs.h <<EOF
6074 #define $ac_tr_lib 1
6075 EOF
6076
6077   LIBS="-lresolv $LIBS"
6078
6079 else
6080   echo "$ac_t""no" 1>&6
6081 fi
6082
6083         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6084 fi
6085
6086 if test $ac_cv_func_res_query = no ; then 
6087         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
6088 echo "configure:6089: checking for __res_query in -lresolv" >&5
6089 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
6090 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6091   echo $ac_n "(cached) $ac_c" 1>&6
6092 else
6093   ac_save_LIBS="$LIBS"
6094 LIBS="-lresolv  $LIBS"
6095 cat > conftest.$ac_ext <<EOF
6096 #line 6097 "configure"
6097 #include "confdefs.h"
6098 /* Override any gcc2 internal prototype to avoid an error.  */
6099 /* We use char because int might match the return type of a gcc2
6100     builtin and then its argument prototype would still apply.  */
6101 char __res_query();
6102
6103 int main() {
6104 __res_query()
6105 ; return 0; }
6106 EOF
6107 if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6108   rm -rf conftest*
6109   eval "ac_cv_lib_$ac_lib_var=yes"
6110 else
6111   echo "configure: failed program was:" >&5
6112   cat conftest.$ac_ext >&5
6113   rm -rf conftest*
6114   eval "ac_cv_lib_$ac_lib_var=no"
6115 fi
6116 rm -f conftest*
6117 LIBS="$ac_save_LIBS"
6118
6119 fi
6120 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6121   echo "$ac_t""yes" 1>&6
6122     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6123     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6124   cat >> confdefs.h <<EOF
6125 #define $ac_tr_lib 1
6126 EOF
6127
6128   LIBS="-lresolv $LIBS"
6129
6130 else
6131   echo "$ac_t""no" 1>&6
6132 fi
6133
6134         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
6135 fi
6136
6137 if test "$ac_cv_func_res_query" = yes ; then
6138         cat >> confdefs.h <<\EOF
6139 #define HAVE_RES_QUERY 1
6140 EOF
6141
6142
6143         if test $ol_enable_dnssrv != no ; then
6144                 ol_link_dnssrv=yes
6145         fi
6146 fi
6147
6148 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6149         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6150 fi
6151
6152 for ac_func in getaddrinfo gai_strerror inet_ntop 
6153 do
6154 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6155 echo "configure:6156: checking for $ac_func" >&5
6156 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6157   echo $ac_n "(cached) $ac_c" 1>&6
6158 else
6159   cat > conftest.$ac_ext <<EOF
6160 #line 6161 "configure"
6161 #include "confdefs.h"
6162 /* System header to define __stub macros and hopefully few prototypes,
6163     which can conflict with char $ac_func(); below.  */
6164 #include <assert.h>
6165 /* Override any gcc2 internal prototype to avoid an error.  */
6166 /* We use char because int might match the return type of a gcc2
6167     builtin and then its argument prototype would still apply.  */
6168 char $ac_func();
6169 char (*f)();
6170
6171 int main() {
6172
6173 /* The GNU C library defines this for functions which it implements
6174     to always fail with ENOSYS.  Some functions are actually named
6175     something starting with __ and the normal name is an alias.  */
6176 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6177 choke me
6178 #else
6179 f = $ac_func;
6180 #endif
6181
6182 ; return 0; }
6183 EOF
6184 if { (eval echo configure:6185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6185   rm -rf conftest*
6186   eval "ac_cv_func_$ac_func=yes"
6187 else
6188   echo "configure: failed program was:" >&5
6189   cat conftest.$ac_ext >&5
6190   rm -rf conftest*
6191   eval "ac_cv_func_$ac_func=no"
6192 fi
6193 rm -f conftest*
6194 fi
6195
6196 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6197   echo "$ac_t""yes" 1>&6
6198     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6199   cat >> confdefs.h <<EOF
6200 #define $ac_tr_func 1
6201 EOF
6202  
6203 else
6204   echo "$ac_t""no" 1>&6
6205 fi
6206 done
6207
6208
6209 ol_link_ipv6=no
6210 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6211         if test $ol_enable_ipv6 = yes ; then
6212                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6213         fi
6214 elif test $ol_enable_ipv6 != no ; then
6215         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6216 echo "configure:6217: checking INET6_ADDRSTRLEN" >&5
6217 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6218   echo $ac_n "(cached) $ac_c" 1>&6
6219 else
6220   
6221                 cat > conftest.$ac_ext <<EOF
6222 #line 6223 "configure"
6223 #include "confdefs.h"
6224
6225 #                       include <netinet/in.h>
6226 #                       ifdef INET6_ADDRSTRLEN
6227                                 __has_inet6_addrstrlen__;
6228 #                       endif
6229                 
6230 EOF
6231 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6232   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6233   rm -rf conftest*
6234   ol_cv_inet6_addrstrlen=yes
6235 else
6236   rm -rf conftest*
6237   ol_cv_inet6_addrstrlen=no
6238 fi
6239 rm -f conftest*
6240
6241 fi
6242
6243 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6244
6245         if test $ol_cv_inet6_addrstrlen = yes ; then
6246                 ol_link_ipv6=yes
6247         elif test $ol_enable_ipv6 = yes ; then
6248                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6249         fi
6250 fi
6251
6252 if test $ol_enable_local != no ; then
6253         for ac_hdr in sys/un.h 
6254 do
6255 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6256 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6257 echo "configure:6258: checking for $ac_hdr" >&5
6258 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6259   echo $ac_n "(cached) $ac_c" 1>&6
6260 else
6261   cat > conftest.$ac_ext <<EOF
6262 #line 6263 "configure"
6263 #include "confdefs.h"
6264 #include <$ac_hdr>
6265 EOF
6266 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6267 { (eval echo configure:6268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6268 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6269 if test -z "$ac_err"; then
6270   rm -rf conftest*
6271   eval "ac_cv_header_$ac_safe=yes"
6272 else
6273   echo "$ac_err" >&5
6274   echo "configure: failed program was:" >&5
6275   cat conftest.$ac_ext >&5
6276   rm -rf conftest*
6277   eval "ac_cv_header_$ac_safe=no"
6278 fi
6279 rm -f conftest*
6280 fi
6281 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6282   echo "$ac_t""yes" 1>&6
6283     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6284   cat >> confdefs.h <<EOF
6285 #define $ac_tr_hdr 1
6286 EOF
6287  
6288 else
6289   echo "$ac_t""no" 1>&6
6290 fi
6291 done
6292
6293
6294         if test $ol_enable_local = auto ; then
6295                 ol_enable_local=$ac_cv_header_sys_un_h
6296         elif test $ac_cv_header_sys_un_h = no ; then
6297                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6298         fi
6299 fi
6300
6301 ol_link_kbind=no
6302 ol_link_kpasswd=no
6303 ol_link_krb5=no
6304 ol_link_krb4=no
6305
6306 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6307         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6308         -o $ol_with_kerberos = k425 ; then
6309
6310         for ac_hdr in krb5.h
6311 do
6312 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6313 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6314 echo "configure:6315: checking for $ac_hdr" >&5
6315 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6316   echo $ac_n "(cached) $ac_c" 1>&6
6317 else
6318   cat > conftest.$ac_ext <<EOF
6319 #line 6320 "configure"
6320 #include "confdefs.h"
6321 #include <$ac_hdr>
6322 EOF
6323 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6324 { (eval echo configure:6325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6325 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6326 if test -z "$ac_err"; then
6327   rm -rf conftest*
6328   eval "ac_cv_header_$ac_safe=yes"
6329 else
6330   echo "$ac_err" >&5
6331   echo "configure: failed program was:" >&5
6332   cat conftest.$ac_ext >&5
6333   rm -rf conftest*
6334   eval "ac_cv_header_$ac_safe=no"
6335 fi
6336 rm -f conftest*
6337 fi
6338 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6339   echo "$ac_t""yes" 1>&6
6340     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6341   cat >> confdefs.h <<EOF
6342 #define $ac_tr_hdr 1
6343 EOF
6344  
6345 else
6346   echo "$ac_t""no" 1>&6
6347 fi
6348 done
6349
6350
6351         if test $ac_cv_header_krb5_h = yes ; then
6352                                 for ac_hdr in heim_err.h
6353 do
6354 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6355 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6356 echo "configure:6357: checking for $ac_hdr" >&5
6357 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6358   echo $ac_n "(cached) $ac_c" 1>&6
6359 else
6360   cat > conftest.$ac_ext <<EOF
6361 #line 6362 "configure"
6362 #include "confdefs.h"
6363 #include <$ac_hdr>
6364 EOF
6365 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6366 { (eval echo configure:6367: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6367 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6368 if test -z "$ac_err"; then
6369   rm -rf conftest*
6370   eval "ac_cv_header_$ac_safe=yes"
6371 else
6372   echo "$ac_err" >&5
6373   echo "configure: failed program was:" >&5
6374   cat conftest.$ac_ext >&5
6375   rm -rf conftest*
6376   eval "ac_cv_header_$ac_safe=no"
6377 fi
6378 rm -f conftest*
6379 fi
6380 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6381   echo "$ac_t""yes" 1>&6
6382     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6383   cat >> confdefs.h <<EOF
6384 #define $ac_tr_hdr 1
6385 EOF
6386  
6387 else
6388   echo "$ac_t""no" 1>&6
6389 fi
6390 done
6391
6392                 if test $ac_cv_header_heim_err_h = yes ; then
6393                         krb5_impl=heimdal
6394                 else
6395                         krb5_impl=mit
6396                 fi
6397
6398                 if test $krb5_impl = mit; then
6399                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6400 echo "configure:6401: checking for main in -lk5crypto" >&5
6401 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6402 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6403   echo $ac_n "(cached) $ac_c" 1>&6
6404 else
6405   ac_save_LIBS="$LIBS"
6406 LIBS="-lk5crypto  $LIBS"
6407 cat > conftest.$ac_ext <<EOF
6408 #line 6409 "configure"
6409 #include "confdefs.h"
6410
6411 int main() {
6412 main()
6413 ; return 0; }
6414 EOF
6415 if { (eval echo configure:6416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6416   rm -rf conftest*
6417   eval "ac_cv_lib_$ac_lib_var=yes"
6418 else
6419   echo "configure: failed program was:" >&5
6420   cat conftest.$ac_ext >&5
6421   rm -rf conftest*
6422   eval "ac_cv_lib_$ac_lib_var=no"
6423 fi
6424 rm -f conftest*
6425 LIBS="$ac_save_LIBS"
6426
6427 fi
6428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6429   echo "$ac_t""yes" 1>&6
6430   krb5crypto=k5crypto
6431 else
6432   echo "$ac_t""no" 1>&6
6433 krb5crypto=crypto
6434 fi
6435
6436
6437                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6438 echo "configure:6439: checking for main in -lkrb5" >&5
6439 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6440 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6441   echo $ac_n "(cached) $ac_c" 1>&6
6442 else
6443   ac_save_LIBS="$LIBS"
6444 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6445 cat > conftest.$ac_ext <<EOF
6446 #line 6447 "configure"
6447 #include "confdefs.h"
6448
6449 int main() {
6450 main()
6451 ; return 0; }
6452 EOF
6453 if { (eval echo configure:6454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6454   rm -rf conftest*
6455   eval "ac_cv_lib_$ac_lib_var=yes"
6456 else
6457   echo "configure: failed program was:" >&5
6458   cat conftest.$ac_ext >&5
6459   rm -rf conftest*
6460   eval "ac_cv_lib_$ac_lib_var=no"
6461 fi
6462 rm -f conftest*
6463 LIBS="$ac_save_LIBS"
6464
6465 fi
6466 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6467   echo "$ac_t""yes" 1>&6
6468   have_krb5=yes
6469                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6470 else
6471   echo "$ac_t""no" 1>&6
6472 have_krb5=no
6473 fi
6474
6475
6476                 elif test $krb5_impl = heimdal; then
6477                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6478 echo "configure:6479: checking for main in -lkrb5" >&5
6479 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6480 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483   ac_save_LIBS="$LIBS"
6484 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6485 cat > conftest.$ac_ext <<EOF
6486 #line 6487 "configure"
6487 #include "confdefs.h"
6488
6489 int main() {
6490 main()
6491 ; return 0; }
6492 EOF
6493 if { (eval echo configure:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6494   rm -rf conftest*
6495   eval "ac_cv_lib_$ac_lib_var=yes"
6496 else
6497   echo "configure: failed program was:" >&5
6498   cat conftest.$ac_ext >&5
6499   rm -rf conftest*
6500   eval "ac_cv_lib_$ac_lib_var=no"
6501 fi
6502 rm -f conftest*
6503 LIBS="$ac_save_LIBS"
6504
6505 fi
6506 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6507   echo "$ac_t""yes" 1>&6
6508   have_krb5=yes
6509                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6510 else
6511   echo "$ac_t""no" 1>&6
6512 have_krb5=no
6513 fi
6514
6515
6516                         cat >> confdefs.h <<\EOF
6517 #define HAVE_HEIMDAL_KERBEROS 1
6518 EOF
6519
6520
6521                 else
6522                         have_krb5=no
6523                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6524                 fi
6525
6526                 if test $have_krb5 = yes ; then
6527                         ol_link_krb5=yes
6528
6529                         cat >> confdefs.h <<\EOF
6530 #define HAVE_KRB5 1
6531 EOF
6532
6533
6534                         if test $ol_enable_kpasswd != no ; then
6535                                 ol_link_kpasswd=yes;
6536                         fi
6537
6538                         if test $ol_with_kerberos = k5only ; then
6539                                 ol_with_kerberos=found
6540                         fi
6541
6542                 elif test $ol_with_kerberos != auto ; then
6543                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6544                 fi
6545
6546         fi
6547 fi
6548
6549 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6550         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6551
6552         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6553 do
6554 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6555 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6556 echo "configure:6557: checking for $ac_hdr" >&5
6557 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6558   echo $ac_n "(cached) $ac_c" 1>&6
6559 else
6560   cat > conftest.$ac_ext <<EOF
6561 #line 6562 "configure"
6562 #include "confdefs.h"
6563 #include <$ac_hdr>
6564 EOF
6565 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6566 { (eval echo configure:6567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6567 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6568 if test -z "$ac_err"; then
6569   rm -rf conftest*
6570   eval "ac_cv_header_$ac_safe=yes"
6571 else
6572   echo "$ac_err" >&5
6573   echo "configure: failed program was:" >&5
6574   cat conftest.$ac_ext >&5
6575   rm -rf conftest*
6576   eval "ac_cv_header_$ac_safe=no"
6577 fi
6578 rm -f conftest*
6579 fi
6580 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6581   echo "$ac_t""yes" 1>&6
6582     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6583   cat >> confdefs.h <<EOF
6584 #define $ac_tr_hdr 1
6585 EOF
6586  
6587 else
6588   echo "$ac_t""no" 1>&6
6589 fi
6590 done
6591
6592
6593         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6594                 if test $krb5_impl = mit; then
6595                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6596 echo "configure:6597: checking for main in -lkrb4" >&5
6597 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6598 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6599   echo $ac_n "(cached) $ac_c" 1>&6
6600 else
6601   ac_save_LIBS="$LIBS"
6602 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6603 cat > conftest.$ac_ext <<EOF
6604 #line 6605 "configure"
6605 #include "confdefs.h"
6606
6607 int main() {
6608 main()
6609 ; return 0; }
6610 EOF
6611 if { (eval echo configure:6612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6612   rm -rf conftest*
6613   eval "ac_cv_lib_$ac_lib_var=yes"
6614 else
6615   echo "configure: failed program was:" >&5
6616   cat conftest.$ac_ext >&5
6617   rm -rf conftest*
6618   eval "ac_cv_lib_$ac_lib_var=no"
6619 fi
6620 rm -f conftest*
6621 LIBS="$ac_save_LIBS"
6622
6623 fi
6624 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6625   echo "$ac_t""yes" 1>&6
6626   have_k425=yes
6627                                 KRB4_LIBS="-lkrb4 -ldes425"
6628 else
6629   echo "$ac_t""no" 1>&6
6630 have_k425=no
6631 fi
6632
6633
6634                 elif test $krb5_impl = heimdal; then
6635                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6636 echo "configure:6637: checking for main in -lkrb4" >&5
6637 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6638 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6639   echo $ac_n "(cached) $ac_c" 1>&6
6640 else
6641   ac_save_LIBS="$LIBS"
6642 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6643 cat > conftest.$ac_ext <<EOF
6644 #line 6645 "configure"
6645 #include "confdefs.h"
6646
6647 int main() {
6648 main()
6649 ; return 0; }
6650 EOF
6651 if { (eval echo configure:6652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6652   rm -rf conftest*
6653   eval "ac_cv_lib_$ac_lib_var=yes"
6654 else
6655   echo "configure: failed program was:" >&5
6656   cat conftest.$ac_ext >&5
6657   rm -rf conftest*
6658   eval "ac_cv_lib_$ac_lib_var=no"
6659 fi
6660 rm -f conftest*
6661 LIBS="$ac_save_LIBS"
6662
6663 fi
6664 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6665   echo "$ac_t""yes" 1>&6
6666   have_k425=yes
6667                                 KRB4_LIBS="-lkrb4"
6668 else
6669   echo "$ac_t""no" 1>&6
6670 have_k425=no
6671 fi
6672
6673
6674                 else
6675                         have_425=no
6676                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6677                 fi
6678
6679                 if test $have_k425 = yes ; then
6680                         ol_with_kerberos=found
6681                         ol_link_krb4=yes
6682
6683                         cat >> confdefs.h <<\EOF
6684 #define HAVE_KRB425 1
6685 EOF
6686
6687                         cat >> confdefs.h <<\EOF
6688 #define HAVE_KRB4 1
6689 EOF
6690
6691
6692                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6693 echo "configure:6694: checking for des_debug in Kerberos libraries" >&5
6694 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6695   echo $ac_n "(cached) $ac_c" 1>&6
6696 else
6697   
6698                                                                 save_LIBS="$LIBS"
6699                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6700                                 cat > conftest.$ac_ext <<EOF
6701 #line 6702 "configure"
6702 #include "confdefs.h"
6703
6704 #include <kerberosIV/krb.h>
6705 #include <kerberosIV/des.h>
6706 extern int des_debug;
6707
6708 int main() {
6709
6710 des_debug = 1;
6711
6712 ; return 0; }
6713 EOF
6714 if { (eval echo configure:6715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6715   rm -rf conftest*
6716   ol_cv_var_des_debug=yes
6717 else
6718   echo "configure: failed program was:" >&5
6719   cat conftest.$ac_ext >&5
6720   rm -rf conftest*
6721   ol_cv_var_des_debug=no
6722 fi
6723 rm -f conftest*
6724                                                                 LIBS="$save_LIBS"
6725                         
6726 fi
6727
6728 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6729
6730                         if test $ol_cv_var_des_debug = yes ; then
6731                                 cat >> confdefs.h <<\EOF
6732 #define HAVE_DES_DEBUG 1
6733 EOF
6734
6735                         fi
6736
6737                         LIBS="$save_LIBS"
6738                 fi
6739         fi
6740 fi
6741
6742 if test $ol_link_krb5 = yes ; then
6743         ol_with_kerberos=found
6744 fi
6745
6746 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6747         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6748
6749         for ac_hdr in krb.h des.h krb-archaeology.h 
6750 do
6751 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6752 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6753 echo "configure:6754: checking for $ac_hdr" >&5
6754 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6755   echo $ac_n "(cached) $ac_c" 1>&6
6756 else
6757   cat > conftest.$ac_ext <<EOF
6758 #line 6759 "configure"
6759 #include "confdefs.h"
6760 #include <$ac_hdr>
6761 EOF
6762 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6763 { (eval echo configure:6764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6764 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6765 if test -z "$ac_err"; then
6766   rm -rf conftest*
6767   eval "ac_cv_header_$ac_safe=yes"
6768 else
6769   echo "$ac_err" >&5
6770   echo "configure: failed program was:" >&5
6771   cat conftest.$ac_ext >&5
6772   rm -rf conftest*
6773   eval "ac_cv_header_$ac_safe=no"
6774 fi
6775 rm -f conftest*
6776 fi
6777 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6778   echo "$ac_t""yes" 1>&6
6779     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6780   cat >> confdefs.h <<EOF
6781 #define $ac_tr_hdr 1
6782 EOF
6783  
6784 else
6785   echo "$ac_t""no" 1>&6
6786 fi
6787 done
6788
6789
6790         if test $ac_cv_header_krb_h = yes ; then
6791                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6792 echo "configure:6793: checking for main in -lkrb" >&5
6793 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6794 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6795   echo $ac_n "(cached) $ac_c" 1>&6
6796 else
6797   ac_save_LIBS="$LIBS"
6798 LIBS="-lkrb -ldes $LIBS"
6799 cat > conftest.$ac_ext <<EOF
6800 #line 6801 "configure"
6801 #include "confdefs.h"
6802
6803 int main() {
6804 main()
6805 ; return 0; }
6806 EOF
6807 if { (eval echo configure:6808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6808   rm -rf conftest*
6809   eval "ac_cv_lib_$ac_lib_var=yes"
6810 else
6811   echo "configure: failed program was:" >&5
6812   cat conftest.$ac_ext >&5
6813   rm -rf conftest*
6814   eval "ac_cv_lib_$ac_lib_var=no"
6815 fi
6816 rm -f conftest*
6817 LIBS="$ac_save_LIBS"
6818
6819 fi
6820 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6821   echo "$ac_t""yes" 1>&6
6822   have_k4=yes
6823 else
6824   echo "$ac_t""no" 1>&6
6825 have_k4=no
6826 fi
6827
6828
6829                 if test $have_k4 = yes ; then
6830                         ol_with_kerberos=found
6831                         ol_link_krb4=yes
6832
6833                         cat >> confdefs.h <<\EOF
6834 #define HAVE_KRB4 1
6835 EOF
6836
6837
6838                         KRB4_LIBS="-lkrb -ldes"
6839
6840                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6841                                 cat >> confdefs.h <<\EOF
6842 #define HAVE_KTH_KERBEROS 1
6843 EOF
6844
6845                         fi
6846                 fi
6847         fi
6848 fi
6849
6850 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6851         ol_link_kpasswd=yes
6852 fi
6853
6854 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6855         ol_link_kbind=yes
6856
6857 elif test $ol_enable_kbind = yes ; then
6858         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6859 fi
6860
6861 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6862         cat >> confdefs.h <<\EOF
6863 #define HAVE_KERBEROS 1
6864 EOF
6865
6866
6867 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6868         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6869 fi
6870
6871 ol_link_tls=no
6872 if test $ol_with_tls != no ; then
6873         for ac_hdr in openssl/ssl.h ssl.h
6874 do
6875 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6876 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6877 echo "configure:6878: checking for $ac_hdr" >&5
6878 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6879   echo $ac_n "(cached) $ac_c" 1>&6
6880 else
6881   cat > conftest.$ac_ext <<EOF
6882 #line 6883 "configure"
6883 #include "confdefs.h"
6884 #include <$ac_hdr>
6885 EOF
6886 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6887 { (eval echo configure:6888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6888 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6889 if test -z "$ac_err"; then
6890   rm -rf conftest*
6891   eval "ac_cv_header_$ac_safe=yes"
6892 else
6893   echo "$ac_err" >&5
6894   echo "configure: failed program was:" >&5
6895   cat conftest.$ac_ext >&5
6896   rm -rf conftest*
6897   eval "ac_cv_header_$ac_safe=no"
6898 fi
6899 rm -f conftest*
6900 fi
6901 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6902   echo "$ac_t""yes" 1>&6
6903     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6904   cat >> confdefs.h <<EOF
6905 #define $ac_tr_hdr 1
6906 EOF
6907  
6908 else
6909   echo "$ac_t""no" 1>&6
6910 fi
6911 done
6912
6913         
6914         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6915                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6916 echo "configure:6917: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6917 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6918 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6919   echo $ac_n "(cached) $ac_c" 1>&6
6920 else
6921   ac_save_LIBS="$LIBS"
6922 LIBS="-lssl -lcrypto $LIBS"
6923 cat > conftest.$ac_ext <<EOF
6924 #line 6925 "configure"
6925 #include "confdefs.h"
6926 /* Override any gcc2 internal prototype to avoid an error.  */
6927 /* We use char because int might match the return type of a gcc2
6928     builtin and then its argument prototype would still apply.  */
6929 char SSLeay_add_ssl_algorithms();
6930
6931 int main() {
6932 SSLeay_add_ssl_algorithms()
6933 ; return 0; }
6934 EOF
6935 if { (eval echo configure:6936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6936   rm -rf conftest*
6937   eval "ac_cv_lib_$ac_lib_var=yes"
6938 else
6939   echo "configure: failed program was:" >&5
6940   cat conftest.$ac_ext >&5
6941   rm -rf conftest*
6942   eval "ac_cv_lib_$ac_lib_var=no"
6943 fi
6944 rm -f conftest*
6945 LIBS="$ac_save_LIBS"
6946
6947 fi
6948 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6949   echo "$ac_t""yes" 1>&6
6950   have_ssleay=yes
6951                         need_rsaref=no
6952 else
6953   echo "$ac_t""no" 1>&6
6954 have_ssleay=no
6955 fi
6956
6957                         
6958                 if test $have_ssleay = no ; then
6959                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6960 echo "configure:6961: checking for SSL_library_init in -lssl" >&5
6961 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6962 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6963   echo $ac_n "(cached) $ac_c" 1>&6
6964 else
6965   ac_save_LIBS="$LIBS"
6966 LIBS="-lssl -lcrypto $LIBS"
6967 cat > conftest.$ac_ext <<EOF
6968 #line 6969 "configure"
6969 #include "confdefs.h"
6970 /* Override any gcc2 internal prototype to avoid an error.  */
6971 /* We use char because int might match the return type of a gcc2
6972     builtin and then its argument prototype would still apply.  */
6973 char SSL_library_init();
6974
6975 int main() {
6976 SSL_library_init()
6977 ; return 0; }
6978 EOF
6979 if { (eval echo configure:6980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6980   rm -rf conftest*
6981   eval "ac_cv_lib_$ac_lib_var=yes"
6982 else
6983   echo "configure: failed program was:" >&5
6984   cat conftest.$ac_ext >&5
6985   rm -rf conftest*
6986   eval "ac_cv_lib_$ac_lib_var=no"
6987 fi
6988 rm -f conftest*
6989 LIBS="$ac_save_LIBS"
6990
6991 fi
6992 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6993   echo "$ac_t""yes" 1>&6
6994   have_ssleay=yes
6995                                 need_rsaref=no
6996 else
6997   echo "$ac_t""no" 1>&6
6998 have_ssleay=no
6999 fi
7000
7001                 fi
7002
7003                 if test $have_ssleay = no ; then
7004                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
7005 echo "configure:7006: checking for ssl3_accept in -lssl" >&5
7006 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
7007 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7008   echo $ac_n "(cached) $ac_c" 1>&6
7009 else
7010   ac_save_LIBS="$LIBS"
7011 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
7012 cat > conftest.$ac_ext <<EOF
7013 #line 7014 "configure"
7014 #include "confdefs.h"
7015 /* Override any gcc2 internal prototype to avoid an error.  */
7016 /* We use char because int might match the return type of a gcc2
7017     builtin and then its argument prototype would still apply.  */
7018 char ssl3_accept();
7019
7020 int main() {
7021 ssl3_accept()
7022 ; return 0; }
7023 EOF
7024 if { (eval echo configure:7025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7025   rm -rf conftest*
7026   eval "ac_cv_lib_$ac_lib_var=yes"
7027 else
7028   echo "configure: failed program was:" >&5
7029   cat conftest.$ac_ext >&5
7030   rm -rf conftest*
7031   eval "ac_cv_lib_$ac_lib_var=no"
7032 fi
7033 rm -f conftest*
7034 LIBS="$ac_save_LIBS"
7035
7036 fi
7037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7038   echo "$ac_t""yes" 1>&6
7039   have_ssleay=yes
7040                                 need_rsaref=yes
7041 else
7042   echo "$ac_t""no" 1>&6
7043 have_ssleay=no
7044 fi
7045
7046                 fi
7047
7048                 if test $have_ssleay = yes ; then
7049                         ol_with_tls=found
7050                         ol_link_tls=yes
7051
7052                         cat >> confdefs.h <<\EOF
7053 #define HAVE_SSLEAY 1
7054 EOF
7055
7056
7057                         if test $need_rsaref = yes; then
7058                                 cat >> confdefs.h <<\EOF
7059 #define HAVE_RSAREF 1
7060 EOF
7061
7062
7063                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7064                         else
7065                                 TLS_LIBS="-lssl -lcrypto"
7066                         fi
7067                 fi
7068         fi
7069
7070 else
7071         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7072 fi
7073
7074 if test $ol_link_tls = yes ; then
7075         cat >> confdefs.h <<\EOF
7076 #define HAVE_TLS 1
7077 EOF
7078
7079
7080 elif test $ol_with_tls = auto ; then
7081         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7082         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7083
7084 elif test $ol_with_tls != no ; then
7085         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7086 fi
7087
7088 if test $ol_enable_lmpasswd != no; then
7089         if test $ol_link_tls != yes ; then
7090                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7091         fi
7092
7093         cat >> confdefs.h <<\EOF
7094 #define SLAPD_LMHASH 1
7095 EOF
7096
7097 fi
7098
7099 for ac_func in \
7100         ctime_r                 \
7101         gethostbyname_r gethostbyaddr_r \
7102
7103 do
7104 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7105 echo "configure:7106: checking for $ac_func" >&5
7106 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7107   echo $ac_n "(cached) $ac_c" 1>&6
7108 else
7109   cat > conftest.$ac_ext <<EOF
7110 #line 7111 "configure"
7111 #include "confdefs.h"
7112 /* System header to define __stub macros and hopefully few prototypes,
7113     which can conflict with char $ac_func(); below.  */
7114 #include <assert.h>
7115 /* Override any gcc2 internal prototype to avoid an error.  */
7116 /* We use char because int might match the return type of a gcc2
7117     builtin and then its argument prototype would still apply.  */
7118 char $ac_func();
7119 char (*f)();
7120
7121 int main() {
7122
7123 /* The GNU C library defines this for functions which it implements
7124     to always fail with ENOSYS.  Some functions are actually named
7125     something starting with __ and the normal name is an alias.  */
7126 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7127 choke me
7128 #else
7129 f = $ac_func;
7130 #endif
7131
7132 ; return 0; }
7133 EOF
7134 if { (eval echo configure:7135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7135   rm -rf conftest*
7136   eval "ac_cv_func_$ac_func=yes"
7137 else
7138   echo "configure: failed program was:" >&5
7139   cat conftest.$ac_ext >&5
7140   rm -rf conftest*
7141   eval "ac_cv_func_$ac_func=no"
7142 fi
7143 rm -f conftest*
7144 fi
7145
7146 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7147   echo "$ac_t""yes" 1>&6
7148     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7149   cat >> confdefs.h <<EOF
7150 #define $ac_tr_func 1
7151 EOF
7152  
7153 else
7154   echo "$ac_t""no" 1>&6
7155 fi
7156 done
7157
7158
7159 if test "$ac_cv_func_ctime_r" = no ; then
7160         ol_cv_func_ctime_r_nargs=0
7161 else
7162         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7163 echo "configure:7164: checking number of arguments of ctime_r" >&5
7164 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7165   echo $ac_n "(cached) $ac_c" 1>&6
7166 else
7167   cat > conftest.$ac_ext <<EOF
7168 #line 7169 "configure"
7169 #include "confdefs.h"
7170 #include <time.h>
7171 int main() {
7172 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7173 ; return 0; }
7174 EOF
7175 if { (eval echo configure:7176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7176   rm -rf conftest*
7177   ol_cv_func_ctime_r_nargs3=yes
7178 else
7179   echo "configure: failed program was:" >&5
7180   cat conftest.$ac_ext >&5
7181   rm -rf conftest*
7182   ol_cv_func_ctime_r_nargs3=no
7183 fi
7184 rm -f conftest*
7185
7186         cat > conftest.$ac_ext <<EOF
7187 #line 7188 "configure"
7188 #include "confdefs.h"
7189 #include <time.h>
7190 int main() {
7191 time_t ti; char *buffer; ctime_r(&ti,buffer);
7192 ; return 0; }
7193 EOF
7194 if { (eval echo configure:7195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7195   rm -rf conftest*
7196   ol_cv_func_ctime_r_nargs2=yes
7197 else
7198   echo "configure: failed program was:" >&5
7199   cat conftest.$ac_ext >&5
7200   rm -rf conftest*
7201   ol_cv_func_ctime_r_nargs2=no
7202 fi
7203 rm -f conftest*
7204
7205         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7206                 $ol_cv_func_ctime_r_nargs2 = no ; then
7207
7208                 ol_cv_func_ctime_r_nargs=3
7209
7210         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7211                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7212
7213                 ol_cv_func_ctime_r_nargs=2
7214
7215         else
7216                 ol_cv_func_ctime_r_nargs=0
7217         fi
7218   
7219 fi
7220
7221 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7222
7223   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7224         cat >> confdefs.h <<EOF
7225 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7226 EOF
7227
7228   fi
7229
7230 fi
7231
7232 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7233         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7234 echo "configure:7235: checking number of arguments of gethostbyname_r" >&5
7235 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7236   echo $ac_n "(cached) $ac_c" 1>&6
7237 else
7238   cat > conftest.$ac_ext <<EOF
7239 #line 7240 "configure"
7240 #include "confdefs.h"
7241 #include <sys/types.h>
7242 #include <sys/socket.h>
7243 #include <netinet/in.h>
7244 #include <netdb.h>
7245 #define BUFSIZE (sizeof(struct hostent)+10)
7246 int main() {
7247 struct hostent hent; char buffer[BUFSIZE];
7248                 int bufsize=BUFSIZE;int h_errno;
7249                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7250                         buffer, bufsize, &h_errno);
7251 ; return 0; }
7252 EOF
7253 if { (eval echo configure:7254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7254   rm -rf conftest*
7255   ol_cv_func_gethostbyname_r_nargs5=yes
7256 else
7257   echo "configure: failed program was:" >&5
7258   cat conftest.$ac_ext >&5
7259   rm -rf conftest*
7260   ol_cv_func_gethostbyname_r_nargs5=no
7261 fi
7262 rm -f conftest*
7263
7264         cat > conftest.$ac_ext <<EOF
7265 #line 7266 "configure"
7266 #include "confdefs.h"
7267 #include <sys/types.h>
7268 #include <sys/socket.h>
7269 #include <netinet/in.h>
7270 #include <netdb.h>
7271 #define BUFSIZE (sizeof(struct hostent)+10)
7272 int main() {
7273 struct hostent hent;struct hostent *rhent;
7274                 char buffer[BUFSIZE];
7275                 int bufsize=BUFSIZE;int h_errno;
7276                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7277                         &rhent, &h_errno);
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_gethostbyname_r_nargs6=yes
7283 else
7284   echo "configure: failed program was:" >&5
7285   cat conftest.$ac_ext >&5
7286   rm -rf conftest*
7287   ol_cv_func_gethostbyname_r_nargs6=no
7288 fi
7289 rm -f conftest*
7290
7291         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7292                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7293
7294                 ol_cv_func_gethostbyname_r_nargs=5
7295
7296         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7297                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7298
7299                 ol_cv_func_gethostbyname_r_nargs=6
7300
7301         else
7302                 ol_cv_func_gethostbyname_r_nargs=0
7303         fi
7304   
7305 fi
7306
7307 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7308   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7309         cat >> confdefs.h <<EOF
7310 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7311 EOF
7312
7313   fi
7314
7315 else
7316         ol_cv_func_gethostbyname_r_nargs=0
7317 fi
7318  
7319 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7320         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7321 echo "configure:7322: checking number of arguments of gethostbyaddr_r" >&5
7322 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7323   echo $ac_n "(cached) $ac_c" 1>&6
7324 else
7325   cat > conftest.$ac_ext <<EOF
7326 #line 7327 "configure"
7327 #include "confdefs.h"
7328 #include <sys/types.h>
7329 #include <sys/socket.h>
7330 #include <netinet/in.h>
7331 #include <netdb.h>
7332 #define BUFSIZE (sizeof(struct hostent)+10)
7333 int main() {
7334 struct hostent hent; char buffer[BUFSIZE]; 
7335             struct in_addr add;
7336             size_t alen=sizeof(struct in_addr);
7337             int bufsize=BUFSIZE;int h_errno;
7338                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7339                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7340 ; return 0; }
7341 EOF
7342 if { (eval echo configure:7343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7343   rm -rf conftest*
7344   ol_cv_func_gethostbyaddr_r_nargs7=yes
7345 else
7346   echo "configure: failed program was:" >&5
7347   cat conftest.$ac_ext >&5
7348   rm -rf conftest*
7349   ol_cv_func_gethostbyaddr_r_nargs7=no
7350 fi
7351 rm -f conftest*
7352
7353         cat > conftest.$ac_ext <<EOF
7354 #line 7355 "configure"
7355 #include "confdefs.h"
7356 #include <sys/types.h>
7357 #include <sys/socket.h>
7358 #include <netinet/in.h>
7359 #include <netdb.h>
7360 #define BUFSIZE (sizeof(struct hostent)+10)
7361 int main() {
7362 struct hostent hent;
7363                 struct hostent *rhent; char buffer[BUFSIZE]; 
7364                 struct in_addr add;
7365                 size_t alen=sizeof(struct in_addr);
7366                 int bufsize=BUFSIZE;int h_errno;
7367                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7368                         alen, AF_INET, &hent, buffer, bufsize, 
7369                         &rhent, &h_errno);
7370 ; return 0; }
7371 EOF
7372 if { (eval echo configure:7373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7373   rm -rf conftest*
7374   ol_cv_func_gethostbyaddr_r_nargs8=yes
7375 else
7376   echo "configure: failed program was:" >&5
7377   cat conftest.$ac_ext >&5
7378   rm -rf conftest*
7379   ol_cv_func_gethostbyaddr_r_nargs8=no
7380 fi
7381 rm -f conftest*
7382
7383         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7384                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7385
7386                 ol_cv_func_gethostbyaddr_r_nargs=7
7387
7388         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7389                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7390
7391                 ol_cv_func_gethostbyaddr_r_nargs=8
7392
7393         else
7394                 ol_cv_func_gethostbyaddr_r_nargs=0
7395         fi
7396   
7397 fi
7398
7399 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7400   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7401     cat >> confdefs.h <<EOF
7402 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7403 EOF
7404
7405   fi
7406
7407 else
7408         ol_cv_func_gethostbyaddr_r_nargs=0
7409 fi
7410
7411 if test "$ac_cv_func_ctime_r" = yes \
7412         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7413         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7414         -a "$ac_cv_func_gethostbyname_r" = yes \
7415         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7416         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7417         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7418         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7419         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7420         ; then
7421  
7422         cat >> confdefs.h <<\EOF
7423 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7424 EOF
7425
7426 fi
7427
7428 ol_link_threads=no
7429
7430 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7431         -o $ol_with_threads = nt ; then
7432
7433         
7434         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7435 echo "configure:7436: checking for _beginthread" >&5
7436 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7437   echo $ac_n "(cached) $ac_c" 1>&6
7438 else
7439   cat > conftest.$ac_ext <<EOF
7440 #line 7441 "configure"
7441 #include "confdefs.h"
7442 /* System header to define __stub macros and hopefully few prototypes,
7443     which can conflict with char _beginthread(); below.  */
7444 #include <assert.h>
7445 /* Override any gcc2 internal prototype to avoid an error.  */
7446 /* We use char because int might match the return type of a gcc2
7447     builtin and then its argument prototype would still apply.  */
7448 char _beginthread();
7449 char (*f)();
7450
7451 int main() {
7452
7453 /* The GNU C library defines this for functions which it implements
7454     to always fail with ENOSYS.  Some functions are actually named
7455     something starting with __ and the normal name is an alias.  */
7456 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7457 choke me
7458 #else
7459 f = _beginthread;
7460 #endif
7461
7462 ; return 0; }
7463 EOF
7464 if { (eval echo configure:7465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7465   rm -rf conftest*
7466   eval "ac_cv_func__beginthread=yes"
7467 else
7468   echo "configure: failed program was:" >&5
7469   cat conftest.$ac_ext >&5
7470   rm -rf conftest*
7471   eval "ac_cv_func__beginthread=no"
7472 fi
7473 rm -f conftest*
7474 fi
7475
7476 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7477   echo "$ac_t""yes" 1>&6
7478   :
7479 else
7480   echo "$ac_t""no" 1>&6
7481 fi
7482
7483
7484         if test $ac_cv_func__beginthread = yes ; then
7485                 cat >> confdefs.h <<\EOF
7486 #define HAVE_NT_THREADS 1
7487 EOF
7488
7489                 ol_cv_nt_threads=yes
7490         fi
7491
7492
7493         if test "$ol_cv_nt_threads" = yes ; then
7494                 ol_link_threads=nt
7495                 ol_with_threads=found
7496                 ol_with_yielding_select=yes
7497
7498                 cat >> confdefs.h <<\EOF
7499 #define HAVE_NT_SERVICE_MANAGER 1
7500 EOF
7501
7502                 cat >> confdefs.h <<\EOF
7503 #define HAVE_NT_EVENT_LOG 1
7504 EOF
7505
7506         fi
7507
7508         if test $ol_with_threads = nt ; then
7509                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7510         fi
7511 fi
7512
7513 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7514         -o $ol_with_threads = posix ; then
7515
7516         for ac_hdr in pthread.h
7517 do
7518 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7519 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7520 echo "configure:7521: checking for $ac_hdr" >&5
7521 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7522   echo $ac_n "(cached) $ac_c" 1>&6
7523 else
7524   cat > conftest.$ac_ext <<EOF
7525 #line 7526 "configure"
7526 #include "confdefs.h"
7527 #include <$ac_hdr>
7528 EOF
7529 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7530 { (eval echo configure:7531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7531 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7532 if test -z "$ac_err"; then
7533   rm -rf conftest*
7534   eval "ac_cv_header_$ac_safe=yes"
7535 else
7536   echo "$ac_err" >&5
7537   echo "configure: failed program was:" >&5
7538   cat conftest.$ac_ext >&5
7539   rm -rf conftest*
7540   eval "ac_cv_header_$ac_safe=no"
7541 fi
7542 rm -f conftest*
7543 fi
7544 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7545   echo "$ac_t""yes" 1>&6
7546     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7547   cat >> confdefs.h <<EOF
7548 #define $ac_tr_hdr 1
7549 EOF
7550  
7551 else
7552   echo "$ac_t""no" 1>&6
7553 fi
7554 done
7555
7556
7557         if test $ac_cv_header_pthread_h = yes ; then
7558                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7559 echo "configure:7560: checking POSIX thread version" >&5
7560 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7561   echo $ac_n "(cached) $ac_c" 1>&6
7562 else
7563   
7564         cat > conftest.$ac_ext <<EOF
7565 #line 7566 "configure"
7566 #include "confdefs.h"
7567
7568 #               include <pthread.h>
7569                 /* this check could be improved */
7570 #               ifdef PTHREAD_ONCE_INIT
7571                         pthread_version_final;
7572 #               endif
7573         
7574 EOF
7575 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7576   egrep "pthread_version_final" >/dev/null 2>&1; then
7577   rm -rf conftest*
7578   ol_pthread_final=yes
7579 else
7580   rm -rf conftest*
7581   ol_pthread_final=no
7582 fi
7583 rm -f conftest*
7584
7585
7586         cat > conftest.$ac_ext <<EOF
7587 #line 7588 "configure"
7588 #include "confdefs.h"
7589
7590 #               include <pthread.h>
7591                 /* this check could be improved */
7592 #               ifdef pthread_once_init
7593                         pthread_version_draft4;
7594 #               endif
7595         
7596 EOF
7597 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7598   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7599   rm -rf conftest*
7600   ol_pthread_draft4=yes
7601 else
7602   rm -rf conftest*
7603   ol_pthread_draft4=no
7604 fi
7605 rm -f conftest*
7606
7607
7608         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7609                 ol_cv_pthread_version=final
7610         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7611                 ol_cv_pthread_version=draft4
7612         else
7613                 ol_cv_pthread_version=unknown
7614         fi
7615
7616 fi
7617
7618 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7619
7620
7621                 if test $ol_cv_pthread_version = final ; then
7622                         cat >> confdefs.h <<\EOF
7623 #define HAVE_PTHREADS_FINAL 1
7624 EOF
7625
7626                 elif test $ol_cv_pthread_version = draft4 ; then
7627                         cat >> confdefs.h <<\EOF
7628 #define HAVE_PTHREADS_D4 1
7629 EOF
7630
7631                 else
7632                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7633                 fi
7634
7635                 # consider threads found
7636                 ol_with_threads=found
7637
7638                 
7639         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7640 echo "configure:7641: checking for LinuxThreads pthread.h" >&5
7641 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7642   echo $ac_n "(cached) $ac_c" 1>&6
7643 else
7644   cat > conftest.$ac_ext <<EOF
7645 #line 7646 "configure"
7646 #include "confdefs.h"
7647 #include <pthread.h>
7648 EOF
7649 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7650   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7651   rm -rf conftest*
7652   ol_cv_header_linux_threads=yes
7653 else
7654   rm -rf conftest*
7655   ol_cv_header_linux_threads=no
7656 fi
7657 rm -f conftest*
7658
7659                 
7660 fi
7661
7662 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7663         if test $ol_cv_header_linux_threads = yes; then
7664                 cat >> confdefs.h <<\EOF
7665 #define HAVE_LINUX_THREADS 1
7666 EOF
7667
7668         fi
7669
7670                 
7671         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7672 echo "configure:7673: checking for GNU Pth pthread.h" >&5
7673 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7674   echo $ac_n "(cached) $ac_c" 1>&6
7675 else
7676   cat > conftest.$ac_ext <<EOF
7677 #line 7678 "configure"
7678 #include "confdefs.h"
7679 #include <pthread.h>
7680 #ifdef _POSIX_THREAD_IS_GNU_PTH
7681         __gnu_pth__;
7682 #endif
7683
7684 EOF
7685 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7686   egrep "__gnu_pth__" >/dev/null 2>&1; then
7687   rm -rf conftest*
7688   ol_cv_header_gnu_pth_pthread_h=yes
7689 else
7690   rm -rf conftest*
7691   ol_cv_header_gnu_pth_pthread_h=no
7692 fi
7693 rm -f conftest*
7694
7695                 
7696 fi
7697
7698 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7699
7700
7701                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7702                         for ac_hdr in sched.h
7703 do
7704 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7705 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7706 echo "configure:7707: checking for $ac_hdr" >&5
7707 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7708   echo $ac_n "(cached) $ac_c" 1>&6
7709 else
7710   cat > conftest.$ac_ext <<EOF
7711 #line 7712 "configure"
7712 #include "confdefs.h"
7713 #include <$ac_hdr>
7714 EOF
7715 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7716 { (eval echo configure:7717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7717 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7718 if test -z "$ac_err"; then
7719   rm -rf conftest*
7720   eval "ac_cv_header_$ac_safe=yes"
7721 else
7722   echo "$ac_err" >&5
7723   echo "configure: failed program was:" >&5
7724   cat conftest.$ac_ext >&5
7725   rm -rf conftest*
7726   eval "ac_cv_header_$ac_safe=no"
7727 fi
7728 rm -f conftest*
7729 fi
7730 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7731   echo "$ac_t""yes" 1>&6
7732     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7733   cat >> confdefs.h <<EOF
7734 #define $ac_tr_hdr 1
7735 EOF
7736  
7737 else
7738   echo "$ac_t""no" 1>&6
7739 fi
7740 done
7741
7742                 fi
7743
7744                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7745                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7746 echo "configure:7747: checking for pthread_create in default libraries" >&5
7747 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7748   echo $ac_n "(cached) $ac_c" 1>&6
7749 else
7750   
7751                 if test "$cross_compiling" = yes; then
7752   cat > conftest.$ac_ext <<EOF
7753 #line 7754 "configure"
7754 #include "confdefs.h"
7755 /* pthread test headers */
7756 #include <pthread.h>
7757 #ifndef NULL
7758 #define NULL (void*)0
7759 #endif
7760
7761 static void *task(p)
7762         void *p;
7763 {
7764         return (void *) (p == NULL);
7765 }
7766
7767 int main() {
7768
7769         /* pthread test function */
7770         pthread_t t;
7771         int status;
7772         int detach = 1;
7773
7774 #ifdef HAVE_PTHREADS_FINAL
7775         /* Final pthreads */
7776         pthread_attr_t attr;
7777
7778         status = pthread_attr_init(&attr);
7779         if( status ) return status;
7780
7781 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7782         if( !detach ) {
7783 #if defined( PTHREAD_CREATE_JOINABLE )
7784                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7785 #else
7786                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7787 #endif
7788
7789 #ifdef PTHREAD_CREATE_DETACHED
7790         } else {
7791                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7792 #endif
7793         }
7794         if( status ) return status;
7795 #endif
7796
7797         status = pthread_create( &t, &attr, task, NULL );
7798         if( status ) return status;
7799
7800 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7801         if( detach ) {
7802                 /* give thread a chance to complete */
7803                 /* it should remain joinable and hence detachable */
7804                 sleep( 1 );
7805
7806                 status = pthread_detach( t );
7807                 if( status ) return status;
7808         }
7809 #endif
7810
7811 #else
7812         /* Draft 4 pthreads */
7813         status = pthread_create( &t, pthread_attr_default, task, NULL );
7814         if( status ) return status;
7815
7816         if( detach ) {
7817                 /* give thread a chance to complete */
7818                 /* it should remain joinable and hence detachable */
7819                 sleep( 1 );
7820
7821                 status = pthread_detach( &t );
7822                 if( status ) return status;
7823         }
7824 #endif
7825
7826 #ifdef HAVE_LINUX_THREADS
7827         pthread_kill_other_threads_np();
7828 #endif
7829
7830         return 0;
7831
7832 ; return 0; }
7833 EOF
7834 if { (eval echo configure:7835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7835   rm -rf conftest*
7836   ol_cv_pthread_create=yes
7837 else
7838   echo "configure: failed program was:" >&5
7839   cat conftest.$ac_ext >&5
7840   rm -rf conftest*
7841   ol_cv_pthread_create=no
7842 fi
7843 rm -f conftest*
7844 else
7845   cat > conftest.$ac_ext <<EOF
7846 #line 7847 "configure"
7847 #include "confdefs.h"
7848 /* pthread test headers */
7849 #include <pthread.h>
7850 #ifndef NULL
7851 #define NULL (void*)0
7852 #endif
7853
7854 static void *task(p)
7855         void *p;
7856 {
7857         return (void *) (p == NULL);
7858 }
7859
7860
7861 int main(argc, argv)
7862         int argc;
7863         char **argv;
7864 {
7865
7866         /* pthread test function */
7867         pthread_t t;
7868         int status;
7869         int detach = 1;
7870
7871 #ifdef HAVE_PTHREADS_FINAL
7872         /* Final pthreads */
7873         pthread_attr_t attr;
7874
7875         status = pthread_attr_init(&attr);
7876         if( status ) return status;
7877
7878 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7879         if( !detach ) {
7880 #if defined( PTHREAD_CREATE_JOINABLE )
7881                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7882 #else
7883                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7884 #endif
7885
7886 #ifdef PTHREAD_CREATE_DETACHED
7887         } else {
7888                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7889 #endif
7890         }
7891         if( status ) return status;
7892 #endif
7893
7894         status = pthread_create( &t, &attr, task, NULL );
7895         if( status ) return status;
7896
7897 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7898         if( detach ) {
7899                 /* give thread a chance to complete */
7900                 /* it should remain joinable and hence detachable */
7901                 sleep( 1 );
7902
7903                 status = pthread_detach( t );
7904                 if( status ) return status;
7905         }
7906 #endif
7907
7908 #else
7909         /* Draft 4 pthreads */
7910         status = pthread_create( &t, pthread_attr_default, task, NULL );
7911         if( status ) return status;
7912
7913         if( detach ) {
7914                 /* give thread a chance to complete */
7915                 /* it should remain joinable and hence detachable */
7916                 sleep( 1 );
7917
7918                 status = pthread_detach( &t );
7919                 if( status ) return status;
7920         }
7921 #endif
7922
7923 #ifdef HAVE_LINUX_THREADS
7924         pthread_kill_other_threads_np();
7925 #endif
7926
7927         return 0;
7928
7929 }
7930
7931 EOF
7932 if { (eval echo configure:7933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7933 then
7934   ol_cv_pthread_create=yes
7935 else
7936   echo "configure: failed program was:" >&5
7937   cat conftest.$ac_ext >&5
7938   rm -fr conftest*
7939   ol_cv_pthread_create=no
7940 fi
7941 rm -fr conftest*
7942 fi
7943
7944 fi
7945
7946 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7947
7948                 if test $ol_cv_pthread_create != no ; then
7949                         ol_link_threads=posix
7950                         ol_link_pthreads=""
7951                 fi
7952                 
7953                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7954 if test "$ol_link_threads" = no ; then
7955         # try -kthread
7956         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7957 echo "configure:7958: checking for pthread link with -kthread" >&5
7958 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7959   echo $ac_n "(cached) $ac_c" 1>&6
7960 else
7961   
7962                 # save the flags
7963                 ol_LIBS="$LIBS"
7964                 LIBS="-kthread $LIBS"
7965
7966                 if test "$cross_compiling" = yes; then
7967   cat > conftest.$ac_ext <<EOF
7968 #line 7969 "configure"
7969 #include "confdefs.h"
7970 /* pthread test headers */
7971 #include <pthread.h>
7972 #ifndef NULL
7973 #define NULL (void*)0
7974 #endif
7975
7976 static void *task(p)
7977         void *p;
7978 {
7979         return (void *) (p == NULL);
7980 }
7981
7982 int main() {
7983
7984         /* pthread test function */
7985         pthread_t t;
7986         int status;
7987         int detach = 1;
7988
7989 #ifdef HAVE_PTHREADS_FINAL
7990         /* Final pthreads */
7991         pthread_attr_t attr;
7992
7993         status = pthread_attr_init(&attr);
7994         if( status ) return status;
7995
7996 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7997         if( !detach ) {
7998 #if defined( PTHREAD_CREATE_JOINABLE )
7999                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8000 #else
8001                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8002 #endif
8003
8004 #ifdef PTHREAD_CREATE_DETACHED
8005         } else {
8006                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8007 #endif
8008         }
8009         if( status ) return status;
8010 #endif
8011
8012         status = pthread_create( &t, &attr, task, NULL );
8013         if( status ) return status;
8014
8015 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8016         if( detach ) {
8017                 /* give thread a chance to complete */
8018                 /* it should remain joinable and hence detachable */
8019                 sleep( 1 );
8020
8021                 status = pthread_detach( t );
8022                 if( status ) return status;
8023         }
8024 #endif
8025
8026 #else
8027         /* Draft 4 pthreads */
8028         status = pthread_create( &t, pthread_attr_default, task, NULL );
8029         if( status ) return status;
8030
8031         if( detach ) {
8032                 /* give thread a chance to complete */
8033                 /* it should remain joinable and hence detachable */
8034                 sleep( 1 );
8035
8036                 status = pthread_detach( &t );
8037                 if( status ) return status;
8038         }
8039 #endif
8040
8041 #ifdef HAVE_LINUX_THREADS
8042         pthread_kill_other_threads_np();
8043 #endif
8044
8045         return 0;
8046
8047 ; return 0; }
8048 EOF
8049 if { (eval echo configure:8050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8050   rm -rf conftest*
8051   ol_cv_pthread_kthread=yes
8052 else
8053   echo "configure: failed program was:" >&5
8054   cat conftest.$ac_ext >&5
8055   rm -rf conftest*
8056   ol_cv_pthread_kthread=no
8057 fi
8058 rm -f conftest*
8059 else
8060   cat > conftest.$ac_ext <<EOF
8061 #line 8062 "configure"
8062 #include "confdefs.h"
8063 /* pthread test headers */
8064 #include <pthread.h>
8065 #ifndef NULL
8066 #define NULL (void*)0
8067 #endif
8068
8069 static void *task(p)
8070         void *p;
8071 {
8072         return (void *) (p == NULL);
8073 }
8074
8075
8076 int main(argc, argv)
8077         int argc;
8078         char **argv;
8079 {
8080
8081         /* pthread test function */
8082         pthread_t t;
8083         int status;
8084         int detach = 1;
8085
8086 #ifdef HAVE_PTHREADS_FINAL
8087         /* Final pthreads */
8088         pthread_attr_t attr;
8089
8090         status = pthread_attr_init(&attr);
8091         if( status ) return status;
8092
8093 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8094         if( !detach ) {
8095 #if defined( PTHREAD_CREATE_JOINABLE )
8096                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8097 #else
8098                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8099 #endif
8100
8101 #ifdef PTHREAD_CREATE_DETACHED
8102         } else {
8103                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8104 #endif
8105         }
8106         if( status ) return status;
8107 #endif
8108
8109         status = pthread_create( &t, &attr, task, NULL );
8110         if( status ) return status;
8111
8112 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8113         if( detach ) {
8114                 /* give thread a chance to complete */
8115                 /* it should remain joinable and hence detachable */
8116                 sleep( 1 );
8117
8118                 status = pthread_detach( t );
8119                 if( status ) return status;
8120         }
8121 #endif
8122
8123 #else
8124         /* Draft 4 pthreads */
8125         status = pthread_create( &t, pthread_attr_default, task, NULL );
8126         if( status ) return status;
8127
8128         if( detach ) {
8129                 /* give thread a chance to complete */
8130                 /* it should remain joinable and hence detachable */
8131                 sleep( 1 );
8132
8133                 status = pthread_detach( &t );
8134                 if( status ) return status;
8135         }
8136 #endif
8137
8138 #ifdef HAVE_LINUX_THREADS
8139         pthread_kill_other_threads_np();
8140 #endif
8141
8142         return 0;
8143
8144 }
8145
8146 EOF
8147 if { (eval echo configure:8148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8148 then
8149   ol_cv_pthread_kthread=yes
8150 else
8151   echo "configure: failed program was:" >&5
8152   cat conftest.$ac_ext >&5
8153   rm -fr conftest*
8154   ol_cv_pthread_kthread=no
8155 fi
8156 rm -fr conftest*
8157 fi
8158
8159
8160                 # restore the LIBS
8161                 LIBS="$ol_LIBS"
8162         
8163 fi
8164
8165 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8166
8167         if test $ol_cv_pthread_kthread = yes ; then
8168                 ol_link_pthreads="-kthread"
8169                 ol_link_threads=posix
8170         fi
8171 fi
8172
8173                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8174 if test "$ol_link_threads" = no ; then
8175         # try -pthread
8176         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8177 echo "configure:8178: checking for pthread link with -pthread" >&5
8178 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8179   echo $ac_n "(cached) $ac_c" 1>&6
8180 else
8181   
8182                 # save the flags
8183                 ol_LIBS="$LIBS"
8184                 LIBS="-pthread $LIBS"
8185
8186                 if test "$cross_compiling" = yes; then
8187   cat > conftest.$ac_ext <<EOF
8188 #line 8189 "configure"
8189 #include "confdefs.h"
8190 /* pthread test headers */
8191 #include <pthread.h>
8192 #ifndef NULL
8193 #define NULL (void*)0
8194 #endif
8195
8196 static void *task(p)
8197         void *p;
8198 {
8199         return (void *) (p == NULL);
8200 }
8201
8202 int main() {
8203
8204         /* pthread test function */
8205         pthread_t t;
8206         int status;
8207         int detach = 1;
8208
8209 #ifdef HAVE_PTHREADS_FINAL
8210         /* Final pthreads */
8211         pthread_attr_t attr;
8212
8213         status = pthread_attr_init(&attr);
8214         if( status ) return status;
8215
8216 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8217         if( !detach ) {
8218 #if defined( PTHREAD_CREATE_JOINABLE )
8219                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8220 #else
8221                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8222 #endif
8223
8224 #ifdef PTHREAD_CREATE_DETACHED
8225         } else {
8226                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8227 #endif
8228         }
8229         if( status ) return status;
8230 #endif
8231
8232         status = pthread_create( &t, &attr, task, NULL );
8233         if( status ) return status;
8234
8235 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8236         if( detach ) {
8237                 /* give thread a chance to complete */
8238                 /* it should remain joinable and hence detachable */
8239                 sleep( 1 );
8240
8241                 status = pthread_detach( t );
8242                 if( status ) return status;
8243         }
8244 #endif
8245
8246 #else
8247         /* Draft 4 pthreads */
8248         status = pthread_create( &t, pthread_attr_default, task, NULL );
8249         if( status ) return status;
8250
8251         if( detach ) {
8252                 /* give thread a chance to complete */
8253                 /* it should remain joinable and hence detachable */
8254                 sleep( 1 );
8255
8256                 status = pthread_detach( &t );
8257                 if( status ) return status;
8258         }
8259 #endif
8260
8261 #ifdef HAVE_LINUX_THREADS
8262         pthread_kill_other_threads_np();
8263 #endif
8264
8265         return 0;
8266
8267 ; return 0; }
8268 EOF
8269 if { (eval echo configure:8270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8270   rm -rf conftest*
8271   ol_cv_pthread_pthread=yes
8272 else
8273   echo "configure: failed program was:" >&5
8274   cat conftest.$ac_ext >&5
8275   rm -rf conftest*
8276   ol_cv_pthread_pthread=no
8277 fi
8278 rm -f conftest*
8279 else
8280   cat > conftest.$ac_ext <<EOF
8281 #line 8282 "configure"
8282 #include "confdefs.h"
8283 /* pthread test headers */
8284 #include <pthread.h>
8285 #ifndef NULL
8286 #define NULL (void*)0
8287 #endif
8288
8289 static void *task(p)
8290         void *p;
8291 {
8292         return (void *) (p == NULL);
8293 }
8294
8295
8296 int main(argc, argv)
8297         int argc;
8298         char **argv;
8299 {
8300
8301         /* pthread test function */
8302         pthread_t t;
8303         int status;
8304         int detach = 1;
8305
8306 #ifdef HAVE_PTHREADS_FINAL
8307         /* Final pthreads */
8308         pthread_attr_t attr;
8309
8310         status = pthread_attr_init(&attr);
8311         if( status ) return status;
8312
8313 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8314         if( !detach ) {
8315 #if defined( PTHREAD_CREATE_JOINABLE )
8316                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8317 #else
8318                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8319 #endif
8320
8321 #ifdef PTHREAD_CREATE_DETACHED
8322         } else {
8323                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8324 #endif
8325         }
8326         if( status ) return status;
8327 #endif
8328
8329         status = pthread_create( &t, &attr, task, NULL );
8330         if( status ) return status;
8331
8332 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8333         if( detach ) {
8334                 /* give thread a chance to complete */
8335                 /* it should remain joinable and hence detachable */
8336                 sleep( 1 );
8337
8338                 status = pthread_detach( t );
8339                 if( status ) return status;
8340         }
8341 #endif
8342
8343 #else
8344         /* Draft 4 pthreads */
8345         status = pthread_create( &t, pthread_attr_default, task, NULL );
8346         if( status ) return status;
8347
8348         if( detach ) {
8349                 /* give thread a chance to complete */
8350                 /* it should remain joinable and hence detachable */
8351                 sleep( 1 );
8352
8353                 status = pthread_detach( &t );
8354                 if( status ) return status;
8355         }
8356 #endif
8357
8358 #ifdef HAVE_LINUX_THREADS
8359         pthread_kill_other_threads_np();
8360 #endif
8361
8362         return 0;
8363
8364 }
8365
8366 EOF
8367 if { (eval echo configure:8368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8368 then
8369   ol_cv_pthread_pthread=yes
8370 else
8371   echo "configure: failed program was:" >&5
8372   cat conftest.$ac_ext >&5
8373   rm -fr conftest*
8374   ol_cv_pthread_pthread=no
8375 fi
8376 rm -fr conftest*
8377 fi
8378
8379
8380                 # restore the LIBS
8381                 LIBS="$ol_LIBS"
8382         
8383 fi
8384
8385 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8386
8387         if test $ol_cv_pthread_pthread = yes ; then
8388                 ol_link_pthreads="-pthread"
8389                 ol_link_threads=posix
8390         fi
8391 fi
8392
8393                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8394 if test "$ol_link_threads" = no ; then
8395         # try -pthreads
8396         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8397 echo "configure:8398: checking for pthread link with -pthreads" >&5
8398 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8399   echo $ac_n "(cached) $ac_c" 1>&6
8400 else
8401   
8402                 # save the flags
8403                 ol_LIBS="$LIBS"
8404                 LIBS="-pthreads $LIBS"
8405
8406                 if test "$cross_compiling" = yes; then
8407   cat > conftest.$ac_ext <<EOF
8408 #line 8409 "configure"
8409 #include "confdefs.h"
8410 /* pthread test headers */
8411 #include <pthread.h>
8412 #ifndef NULL
8413 #define NULL (void*)0
8414 #endif
8415
8416 static void *task(p)
8417         void *p;
8418 {
8419         return (void *) (p == NULL);
8420 }
8421
8422 int main() {
8423
8424         /* pthread test function */
8425         pthread_t t;
8426         int status;
8427         int detach = 1;
8428
8429 #ifdef HAVE_PTHREADS_FINAL
8430         /* Final pthreads */
8431         pthread_attr_t attr;
8432
8433         status = pthread_attr_init(&attr);
8434         if( status ) return status;
8435
8436 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8437         if( !detach ) {
8438 #if defined( PTHREAD_CREATE_JOINABLE )
8439                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8440 #else
8441                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8442 #endif
8443
8444 #ifdef PTHREAD_CREATE_DETACHED
8445         } else {
8446                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8447 #endif
8448         }
8449         if( status ) return status;
8450 #endif
8451
8452         status = pthread_create( &t, &attr, task, NULL );
8453         if( status ) return status;
8454
8455 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8456         if( detach ) {
8457                 /* give thread a chance to complete */
8458                 /* it should remain joinable and hence detachable */
8459                 sleep( 1 );
8460
8461                 status = pthread_detach( t );
8462                 if( status ) return status;
8463         }
8464 #endif
8465
8466 #else
8467         /* Draft 4 pthreads */
8468         status = pthread_create( &t, pthread_attr_default, task, NULL );
8469         if( status ) return status;
8470
8471         if( detach ) {
8472                 /* give thread a chance to complete */
8473                 /* it should remain joinable and hence detachable */
8474                 sleep( 1 );
8475
8476                 status = pthread_detach( &t );
8477                 if( status ) return status;
8478         }
8479 #endif
8480
8481 #ifdef HAVE_LINUX_THREADS
8482         pthread_kill_other_threads_np();
8483 #endif
8484
8485         return 0;
8486
8487 ; return 0; }
8488 EOF
8489 if { (eval echo configure:8490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8490   rm -rf conftest*
8491   ol_cv_pthread_pthreads=yes
8492 else
8493   echo "configure: failed program was:" >&5
8494   cat conftest.$ac_ext >&5
8495   rm -rf conftest*
8496   ol_cv_pthread_pthreads=no
8497 fi
8498 rm -f conftest*
8499 else
8500   cat > conftest.$ac_ext <<EOF
8501 #line 8502 "configure"
8502 #include "confdefs.h"
8503 /* pthread test headers */
8504 #include <pthread.h>
8505 #ifndef NULL
8506 #define NULL (void*)0
8507 #endif
8508
8509 static void *task(p)
8510         void *p;
8511 {
8512         return (void *) (p == NULL);
8513 }
8514
8515
8516 int main(argc, argv)
8517         int argc;
8518         char **argv;
8519 {
8520
8521         /* pthread test function */
8522         pthread_t t;
8523         int status;
8524         int detach = 1;
8525
8526 #ifdef HAVE_PTHREADS_FINAL
8527         /* Final pthreads */
8528         pthread_attr_t attr;
8529
8530         status = pthread_attr_init(&attr);
8531         if( status ) return status;
8532
8533 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8534         if( !detach ) {
8535 #if defined( PTHREAD_CREATE_JOINABLE )
8536                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8537 #else
8538                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8539 #endif
8540
8541 #ifdef PTHREAD_CREATE_DETACHED
8542         } else {
8543                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8544 #endif
8545         }
8546         if( status ) return status;
8547 #endif
8548
8549         status = pthread_create( &t, &attr, task, NULL );
8550         if( status ) return status;
8551
8552 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8553         if( detach ) {
8554                 /* give thread a chance to complete */
8555                 /* it should remain joinable and hence detachable */
8556                 sleep( 1 );
8557
8558                 status = pthread_detach( t );
8559                 if( status ) return status;
8560         }
8561 #endif
8562
8563 #else
8564         /* Draft 4 pthreads */
8565         status = pthread_create( &t, pthread_attr_default, task, NULL );
8566         if( status ) return status;
8567
8568         if( detach ) {
8569                 /* give thread a chance to complete */
8570                 /* it should remain joinable and hence detachable */
8571                 sleep( 1 );
8572
8573                 status = pthread_detach( &t );
8574                 if( status ) return status;
8575         }
8576 #endif
8577
8578 #ifdef HAVE_LINUX_THREADS
8579         pthread_kill_other_threads_np();
8580 #endif
8581
8582         return 0;
8583
8584 }
8585
8586 EOF
8587 if { (eval echo configure:8588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8588 then
8589   ol_cv_pthread_pthreads=yes
8590 else
8591   echo "configure: failed program was:" >&5
8592   cat conftest.$ac_ext >&5
8593   rm -fr conftest*
8594   ol_cv_pthread_pthreads=no
8595 fi
8596 rm -fr conftest*
8597 fi
8598
8599
8600                 # restore the LIBS
8601                 LIBS="$ol_LIBS"
8602         
8603 fi
8604
8605 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8606
8607         if test $ol_cv_pthread_pthreads = yes ; then
8608                 ol_link_pthreads="-pthreads"
8609                 ol_link_threads=posix
8610         fi
8611 fi
8612
8613                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8614 if test "$ol_link_threads" = no ; then
8615         # try -mthreads
8616         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8617 echo "configure:8618: checking for pthread link with -mthreads" >&5
8618 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8619   echo $ac_n "(cached) $ac_c" 1>&6
8620 else
8621   
8622                 # save the flags
8623                 ol_LIBS="$LIBS"
8624                 LIBS="-mthreads $LIBS"
8625
8626                 if test "$cross_compiling" = yes; then
8627   cat > conftest.$ac_ext <<EOF
8628 #line 8629 "configure"
8629 #include "confdefs.h"
8630 /* pthread test headers */
8631 #include <pthread.h>
8632 #ifndef NULL
8633 #define NULL (void*)0
8634 #endif
8635
8636 static void *task(p)
8637         void *p;
8638 {
8639         return (void *) (p == NULL);
8640 }
8641
8642 int main() {
8643
8644         /* pthread test function */
8645         pthread_t t;
8646         int status;
8647         int detach = 1;
8648
8649 #ifdef HAVE_PTHREADS_FINAL
8650         /* Final pthreads */
8651         pthread_attr_t attr;
8652
8653         status = pthread_attr_init(&attr);
8654         if( status ) return status;
8655
8656 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8657         if( !detach ) {
8658 #if defined( PTHREAD_CREATE_JOINABLE )
8659                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8660 #else
8661                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8662 #endif
8663
8664 #ifdef PTHREAD_CREATE_DETACHED
8665         } else {
8666                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8667 #endif
8668         }
8669         if( status ) return status;
8670 #endif
8671
8672         status = pthread_create( &t, &attr, task, NULL );
8673         if( status ) return status;
8674
8675 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8676         if( detach ) {
8677                 /* give thread a chance to complete */
8678                 /* it should remain joinable and hence detachable */
8679                 sleep( 1 );
8680
8681                 status = pthread_detach( t );
8682                 if( status ) return status;
8683         }
8684 #endif
8685
8686 #else
8687         /* Draft 4 pthreads */
8688         status = pthread_create( &t, pthread_attr_default, task, NULL );
8689         if( status ) return status;
8690
8691         if( detach ) {
8692                 /* give thread a chance to complete */
8693                 /* it should remain joinable and hence detachable */
8694                 sleep( 1 );
8695
8696                 status = pthread_detach( &t );
8697                 if( status ) return status;
8698         }
8699 #endif
8700
8701 #ifdef HAVE_LINUX_THREADS
8702         pthread_kill_other_threads_np();
8703 #endif
8704
8705         return 0;
8706
8707 ; return 0; }
8708 EOF
8709 if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8710   rm -rf conftest*
8711   ol_cv_pthread_mthreads=yes
8712 else
8713   echo "configure: failed program was:" >&5
8714   cat conftest.$ac_ext >&5
8715   rm -rf conftest*
8716   ol_cv_pthread_mthreads=no
8717 fi
8718 rm -f conftest*
8719 else
8720   cat > conftest.$ac_ext <<EOF
8721 #line 8722 "configure"
8722 #include "confdefs.h"
8723 /* pthread test headers */
8724 #include <pthread.h>
8725 #ifndef NULL
8726 #define NULL (void*)0
8727 #endif
8728
8729 static void *task(p)
8730         void *p;
8731 {
8732         return (void *) (p == NULL);
8733 }
8734
8735
8736 int main(argc, argv)
8737         int argc;
8738         char **argv;
8739 {
8740
8741         /* pthread test function */
8742         pthread_t t;
8743         int status;
8744         int detach = 1;
8745
8746 #ifdef HAVE_PTHREADS_FINAL
8747         /* Final pthreads */
8748         pthread_attr_t attr;
8749
8750         status = pthread_attr_init(&attr);
8751         if( status ) return status;
8752
8753 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8754         if( !detach ) {
8755 #if defined( PTHREAD_CREATE_JOINABLE )
8756                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8757 #else
8758                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8759 #endif
8760
8761 #ifdef PTHREAD_CREATE_DETACHED
8762         } else {
8763                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8764 #endif
8765         }
8766         if( status ) return status;
8767 #endif
8768
8769         status = pthread_create( &t, &attr, task, NULL );
8770         if( status ) return status;
8771
8772 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8773         if( detach ) {
8774                 /* give thread a chance to complete */
8775                 /* it should remain joinable and hence detachable */
8776                 sleep( 1 );
8777
8778                 status = pthread_detach( t );
8779                 if( status ) return status;
8780         }
8781 #endif
8782
8783 #else
8784         /* Draft 4 pthreads */
8785         status = pthread_create( &t, pthread_attr_default, task, NULL );
8786         if( status ) return status;
8787
8788         if( detach ) {
8789                 /* give thread a chance to complete */
8790                 /* it should remain joinable and hence detachable */
8791                 sleep( 1 );
8792
8793                 status = pthread_detach( &t );
8794                 if( status ) return status;
8795         }
8796 #endif
8797
8798 #ifdef HAVE_LINUX_THREADS
8799         pthread_kill_other_threads_np();
8800 #endif
8801
8802         return 0;
8803
8804 }
8805
8806 EOF
8807 if { (eval echo configure:8808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8808 then
8809   ol_cv_pthread_mthreads=yes
8810 else
8811   echo "configure: failed program was:" >&5
8812   cat conftest.$ac_ext >&5
8813   rm -fr conftest*
8814   ol_cv_pthread_mthreads=no
8815 fi
8816 rm -fr conftest*
8817 fi
8818
8819
8820                 # restore the LIBS
8821                 LIBS="$ol_LIBS"
8822         
8823 fi
8824
8825 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8826
8827         if test $ol_cv_pthread_mthreads = yes ; then
8828                 ol_link_pthreads="-mthreads"
8829                 ol_link_threads=posix
8830         fi
8831 fi
8832
8833                 # Pthread try link: -thread (ol_cv_pthread_thread)
8834 if test "$ol_link_threads" = no ; then
8835         # try -thread
8836         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8837 echo "configure:8838: checking for pthread link with -thread" >&5
8838 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8839   echo $ac_n "(cached) $ac_c" 1>&6
8840 else
8841   
8842                 # save the flags
8843                 ol_LIBS="$LIBS"
8844                 LIBS="-thread $LIBS"
8845
8846                 if test "$cross_compiling" = yes; then
8847   cat > conftest.$ac_ext <<EOF
8848 #line 8849 "configure"
8849 #include "confdefs.h"
8850 /* pthread test headers */
8851 #include <pthread.h>
8852 #ifndef NULL
8853 #define NULL (void*)0
8854 #endif
8855
8856 static void *task(p)
8857         void *p;
8858 {
8859         return (void *) (p == NULL);
8860 }
8861
8862 int main() {
8863
8864         /* pthread test function */
8865         pthread_t t;
8866         int status;
8867         int detach = 1;
8868
8869 #ifdef HAVE_PTHREADS_FINAL
8870         /* Final pthreads */
8871         pthread_attr_t attr;
8872
8873         status = pthread_attr_init(&attr);
8874         if( status ) return status;
8875
8876 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8877         if( !detach ) {
8878 #if defined( PTHREAD_CREATE_JOINABLE )
8879                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8880 #else
8881                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8882 #endif
8883
8884 #ifdef PTHREAD_CREATE_DETACHED
8885         } else {
8886                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8887 #endif
8888         }
8889         if( status ) return status;
8890 #endif
8891
8892         status = pthread_create( &t, &attr, task, NULL );
8893         if( status ) return status;
8894
8895 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8896         if( detach ) {
8897                 /* give thread a chance to complete */
8898                 /* it should remain joinable and hence detachable */
8899                 sleep( 1 );
8900
8901                 status = pthread_detach( t );
8902                 if( status ) return status;
8903         }
8904 #endif
8905
8906 #else
8907         /* Draft 4 pthreads */
8908         status = pthread_create( &t, pthread_attr_default, task, NULL );
8909         if( status ) return status;
8910
8911         if( detach ) {
8912                 /* give thread a chance to complete */
8913                 /* it should remain joinable and hence detachable */
8914                 sleep( 1 );
8915
8916                 status = pthread_detach( &t );
8917                 if( status ) return status;
8918         }
8919 #endif
8920
8921 #ifdef HAVE_LINUX_THREADS
8922         pthread_kill_other_threads_np();
8923 #endif
8924
8925         return 0;
8926
8927 ; return 0; }
8928 EOF
8929 if { (eval echo configure:8930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8930   rm -rf conftest*
8931   ol_cv_pthread_thread=yes
8932 else
8933   echo "configure: failed program was:" >&5
8934   cat conftest.$ac_ext >&5
8935   rm -rf conftest*
8936   ol_cv_pthread_thread=no
8937 fi
8938 rm -f conftest*
8939 else
8940   cat > conftest.$ac_ext <<EOF
8941 #line 8942 "configure"
8942 #include "confdefs.h"
8943 /* pthread test headers */
8944 #include <pthread.h>
8945 #ifndef NULL
8946 #define NULL (void*)0
8947 #endif
8948
8949 static void *task(p)
8950         void *p;
8951 {
8952         return (void *) (p == NULL);
8953 }
8954
8955
8956 int main(argc, argv)
8957         int argc;
8958         char **argv;
8959 {
8960
8961         /* pthread test function */
8962         pthread_t t;
8963         int status;
8964         int detach = 1;
8965
8966 #ifdef HAVE_PTHREADS_FINAL
8967         /* Final pthreads */
8968         pthread_attr_t attr;
8969
8970         status = pthread_attr_init(&attr);
8971         if( status ) return status;
8972
8973 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8974         if( !detach ) {
8975 #if defined( PTHREAD_CREATE_JOINABLE )
8976                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8977 #else
8978                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8979 #endif
8980
8981 #ifdef PTHREAD_CREATE_DETACHED
8982         } else {
8983                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8984 #endif
8985         }
8986         if( status ) return status;
8987 #endif
8988
8989         status = pthread_create( &t, &attr, task, NULL );
8990         if( status ) return status;
8991
8992 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8993         if( detach ) {
8994                 /* give thread a chance to complete */
8995                 /* it should remain joinable and hence detachable */
8996                 sleep( 1 );
8997
8998                 status = pthread_detach( t );
8999                 if( status ) return status;
9000         }
9001 #endif
9002
9003 #else
9004         /* Draft 4 pthreads */
9005         status = pthread_create( &t, pthread_attr_default, task, NULL );
9006         if( status ) return status;
9007
9008         if( detach ) {
9009                 /* give thread a chance to complete */
9010                 /* it should remain joinable and hence detachable */
9011                 sleep( 1 );
9012
9013                 status = pthread_detach( &t );
9014                 if( status ) return status;
9015         }
9016 #endif
9017
9018 #ifdef HAVE_LINUX_THREADS
9019         pthread_kill_other_threads_np();
9020 #endif
9021
9022         return 0;
9023
9024 }
9025
9026 EOF
9027 if { (eval echo configure:9028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9028 then
9029   ol_cv_pthread_thread=yes
9030 else
9031   echo "configure: failed program was:" >&5
9032   cat conftest.$ac_ext >&5
9033   rm -fr conftest*
9034   ol_cv_pthread_thread=no
9035 fi
9036 rm -fr conftest*
9037 fi
9038
9039
9040                 # restore the LIBS
9041                 LIBS="$ol_LIBS"
9042         
9043 fi
9044
9045 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9046
9047         if test $ol_cv_pthread_thread = yes ; then
9048                 ol_link_pthreads="-thread"
9049                 ol_link_threads=posix
9050         fi
9051 fi
9052
9053
9054                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9055 if test "$ol_link_threads" = no ; then
9056         # try -lpthread -lmach -lexc -lc_r
9057         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9058 echo "configure:9059: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9059 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9060   echo $ac_n "(cached) $ac_c" 1>&6
9061 else
9062   
9063                 # save the flags
9064                 ol_LIBS="$LIBS"
9065                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9066
9067                 if test "$cross_compiling" = yes; then
9068   cat > conftest.$ac_ext <<EOF
9069 #line 9070 "configure"
9070 #include "confdefs.h"
9071 /* pthread test headers */
9072 #include <pthread.h>
9073 #ifndef NULL
9074 #define NULL (void*)0
9075 #endif
9076
9077 static void *task(p)
9078         void *p;
9079 {
9080         return (void *) (p == NULL);
9081 }
9082
9083 int main() {
9084
9085         /* pthread test function */
9086         pthread_t t;
9087         int status;
9088         int detach = 1;
9089
9090 #ifdef HAVE_PTHREADS_FINAL
9091         /* Final pthreads */
9092         pthread_attr_t attr;
9093
9094         status = pthread_attr_init(&attr);
9095         if( status ) return status;
9096
9097 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9098         if( !detach ) {
9099 #if defined( PTHREAD_CREATE_JOINABLE )
9100                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9101 #else
9102                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9103 #endif
9104
9105 #ifdef PTHREAD_CREATE_DETACHED
9106         } else {
9107                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9108 #endif
9109         }
9110         if( status ) return status;
9111 #endif
9112
9113         status = pthread_create( &t, &attr, task, NULL );
9114         if( status ) return status;
9115
9116 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9117         if( detach ) {
9118                 /* give thread a chance to complete */
9119                 /* it should remain joinable and hence detachable */
9120                 sleep( 1 );
9121
9122                 status = pthread_detach( t );
9123                 if( status ) return status;
9124         }
9125 #endif
9126
9127 #else
9128         /* Draft 4 pthreads */
9129         status = pthread_create( &t, pthread_attr_default, task, NULL );
9130         if( status ) return status;
9131
9132         if( detach ) {
9133                 /* give thread a chance to complete */
9134                 /* it should remain joinable and hence detachable */
9135                 sleep( 1 );
9136
9137                 status = pthread_detach( &t );
9138                 if( status ) return status;
9139         }
9140 #endif
9141
9142 #ifdef HAVE_LINUX_THREADS
9143         pthread_kill_other_threads_np();
9144 #endif
9145
9146         return 0;
9147
9148 ; return 0; }
9149 EOF
9150 if { (eval echo configure:9151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9151   rm -rf conftest*
9152   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9153 else
9154   echo "configure: failed program was:" >&5
9155   cat conftest.$ac_ext >&5
9156   rm -rf conftest*
9157   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9158 fi
9159 rm -f conftest*
9160 else
9161   cat > conftest.$ac_ext <<EOF
9162 #line 9163 "configure"
9163 #include "confdefs.h"
9164 /* pthread test headers */
9165 #include <pthread.h>
9166 #ifndef NULL
9167 #define NULL (void*)0
9168 #endif
9169
9170 static void *task(p)
9171         void *p;
9172 {
9173         return (void *) (p == NULL);
9174 }
9175
9176
9177 int main(argc, argv)
9178         int argc;
9179         char **argv;
9180 {
9181
9182         /* pthread test function */
9183         pthread_t t;
9184         int status;
9185         int detach = 1;
9186
9187 #ifdef HAVE_PTHREADS_FINAL
9188         /* Final pthreads */
9189         pthread_attr_t attr;
9190
9191         status = pthread_attr_init(&attr);
9192         if( status ) return status;
9193
9194 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9195         if( !detach ) {
9196 #if defined( PTHREAD_CREATE_JOINABLE )
9197                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9198 #else
9199                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9200 #endif
9201
9202 #ifdef PTHREAD_CREATE_DETACHED
9203         } else {
9204                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9205 #endif
9206         }
9207         if( status ) return status;
9208 #endif
9209
9210         status = pthread_create( &t, &attr, task, NULL );
9211         if( status ) return status;
9212
9213 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9214         if( detach ) {
9215                 /* give thread a chance to complete */
9216                 /* it should remain joinable and hence detachable */
9217                 sleep( 1 );
9218
9219                 status = pthread_detach( t );
9220                 if( status ) return status;
9221         }
9222 #endif
9223
9224 #else
9225         /* Draft 4 pthreads */
9226         status = pthread_create( &t, pthread_attr_default, task, NULL );
9227         if( status ) return status;
9228
9229         if( detach ) {
9230                 /* give thread a chance to complete */
9231                 /* it should remain joinable and hence detachable */
9232                 sleep( 1 );
9233
9234                 status = pthread_detach( &t );
9235                 if( status ) return status;
9236         }
9237 #endif
9238
9239 #ifdef HAVE_LINUX_THREADS
9240         pthread_kill_other_threads_np();
9241 #endif
9242
9243         return 0;
9244
9245 }
9246
9247 EOF
9248 if { (eval echo configure:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9249 then
9250   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9251 else
9252   echo "configure: failed program was:" >&5
9253   cat conftest.$ac_ext >&5
9254   rm -fr conftest*
9255   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9256 fi
9257 rm -fr conftest*
9258 fi
9259
9260
9261                 # restore the LIBS
9262                 LIBS="$ol_LIBS"
9263         
9264 fi
9265
9266 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9267
9268         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9269                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9270                 ol_link_threads=posix
9271         fi
9272 fi
9273
9274                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9275 if test "$ol_link_threads" = no ; then
9276         # try -lpthread -lmach -lexc
9277         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9278 echo "configure:9279: checking for pthread link with -lpthread -lmach -lexc" >&5
9279 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9280   echo $ac_n "(cached) $ac_c" 1>&6
9281 else
9282   
9283                 # save the flags
9284                 ol_LIBS="$LIBS"
9285                 LIBS="-lpthread -lmach -lexc $LIBS"
9286
9287                 if test "$cross_compiling" = yes; then
9288   cat > conftest.$ac_ext <<EOF
9289 #line 9290 "configure"
9290 #include "confdefs.h"
9291 /* pthread test headers */
9292 #include <pthread.h>
9293 #ifndef NULL
9294 #define NULL (void*)0
9295 #endif
9296
9297 static void *task(p)
9298         void *p;
9299 {
9300         return (void *) (p == NULL);
9301 }
9302
9303 int main() {
9304
9305         /* pthread test function */
9306         pthread_t t;
9307         int status;
9308         int detach = 1;
9309
9310 #ifdef HAVE_PTHREADS_FINAL
9311         /* Final pthreads */
9312         pthread_attr_t attr;
9313
9314         status = pthread_attr_init(&attr);
9315         if( status ) return status;
9316
9317 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9318         if( !detach ) {
9319 #if defined( PTHREAD_CREATE_JOINABLE )
9320                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9321 #else
9322                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9323 #endif
9324
9325 #ifdef PTHREAD_CREATE_DETACHED
9326         } else {
9327                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9328 #endif
9329         }
9330         if( status ) return status;
9331 #endif
9332
9333         status = pthread_create( &t, &attr, task, NULL );
9334         if( status ) return status;
9335
9336 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9337         if( detach ) {
9338                 /* give thread a chance to complete */
9339                 /* it should remain joinable and hence detachable */
9340                 sleep( 1 );
9341
9342                 status = pthread_detach( t );
9343                 if( status ) return status;
9344         }
9345 #endif
9346
9347 #else
9348         /* Draft 4 pthreads */
9349         status = pthread_create( &t, pthread_attr_default, task, NULL );
9350         if( status ) return status;
9351
9352         if( detach ) {
9353                 /* give thread a chance to complete */
9354                 /* it should remain joinable and hence detachable */
9355                 sleep( 1 );
9356
9357                 status = pthread_detach( &t );
9358                 if( status ) return status;
9359         }
9360 #endif
9361
9362 #ifdef HAVE_LINUX_THREADS
9363         pthread_kill_other_threads_np();
9364 #endif
9365
9366         return 0;
9367
9368 ; return 0; }
9369 EOF
9370 if { (eval echo configure:9371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9371   rm -rf conftest*
9372   ol_cv_pthread_lpthread_lmach_lexc=yes
9373 else
9374   echo "configure: failed program was:" >&5
9375   cat conftest.$ac_ext >&5
9376   rm -rf conftest*
9377   ol_cv_pthread_lpthread_lmach_lexc=no
9378 fi
9379 rm -f conftest*
9380 else
9381   cat > conftest.$ac_ext <<EOF
9382 #line 9383 "configure"
9383 #include "confdefs.h"
9384 /* pthread test headers */
9385 #include <pthread.h>
9386 #ifndef NULL
9387 #define NULL (void*)0
9388 #endif
9389
9390 static void *task(p)
9391         void *p;
9392 {
9393         return (void *) (p == NULL);
9394 }
9395
9396
9397 int main(argc, argv)
9398         int argc;
9399         char **argv;
9400 {
9401
9402         /* pthread test function */
9403         pthread_t t;
9404         int status;
9405         int detach = 1;
9406
9407 #ifdef HAVE_PTHREADS_FINAL
9408         /* Final pthreads */
9409         pthread_attr_t attr;
9410
9411         status = pthread_attr_init(&attr);
9412         if( status ) return status;
9413
9414 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9415         if( !detach ) {
9416 #if defined( PTHREAD_CREATE_JOINABLE )
9417                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9418 #else
9419                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9420 #endif
9421
9422 #ifdef PTHREAD_CREATE_DETACHED
9423         } else {
9424                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9425 #endif
9426         }
9427         if( status ) return status;
9428 #endif
9429
9430         status = pthread_create( &t, &attr, task, NULL );
9431         if( status ) return status;
9432
9433 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9434         if( detach ) {
9435                 /* give thread a chance to complete */
9436                 /* it should remain joinable and hence detachable */
9437                 sleep( 1 );
9438
9439                 status = pthread_detach( t );
9440                 if( status ) return status;
9441         }
9442 #endif
9443
9444 #else
9445         /* Draft 4 pthreads */
9446         status = pthread_create( &t, pthread_attr_default, task, NULL );
9447         if( status ) return status;
9448
9449         if( detach ) {
9450                 /* give thread a chance to complete */
9451                 /* it should remain joinable and hence detachable */
9452                 sleep( 1 );
9453
9454                 status = pthread_detach( &t );
9455                 if( status ) return status;
9456         }
9457 #endif
9458
9459 #ifdef HAVE_LINUX_THREADS
9460         pthread_kill_other_threads_np();
9461 #endif
9462
9463         return 0;
9464
9465 }
9466
9467 EOF
9468 if { (eval echo configure:9469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9469 then
9470   ol_cv_pthread_lpthread_lmach_lexc=yes
9471 else
9472   echo "configure: failed program was:" >&5
9473   cat conftest.$ac_ext >&5
9474   rm -fr conftest*
9475   ol_cv_pthread_lpthread_lmach_lexc=no
9476 fi
9477 rm -fr conftest*
9478 fi
9479
9480
9481                 # restore the LIBS
9482                 LIBS="$ol_LIBS"
9483         
9484 fi
9485
9486 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9487
9488         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9489                 ol_link_pthreads="-lpthread -lmach -lexc"
9490                 ol_link_threads=posix
9491         fi
9492 fi
9493
9494
9495                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9496 if test "$ol_link_threads" = no ; then
9497         # try -lpthread -Wl,-woff,85
9498         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9499 echo "configure:9500: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9500 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9501   echo $ac_n "(cached) $ac_c" 1>&6
9502 else
9503   
9504                 # save the flags
9505                 ol_LIBS="$LIBS"
9506                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9507
9508                 if test "$cross_compiling" = yes; then
9509   cat > conftest.$ac_ext <<EOF
9510 #line 9511 "configure"
9511 #include "confdefs.h"
9512 /* pthread test headers */
9513 #include <pthread.h>
9514 #ifndef NULL
9515 #define NULL (void*)0
9516 #endif
9517
9518 static void *task(p)
9519         void *p;
9520 {
9521         return (void *) (p == NULL);
9522 }
9523
9524 int main() {
9525
9526         /* pthread test function */
9527         pthread_t t;
9528         int status;
9529         int detach = 1;
9530
9531 #ifdef HAVE_PTHREADS_FINAL
9532         /* Final pthreads */
9533         pthread_attr_t attr;
9534
9535         status = pthread_attr_init(&attr);
9536         if( status ) return status;
9537
9538 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9539         if( !detach ) {
9540 #if defined( PTHREAD_CREATE_JOINABLE )
9541                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9542 #else
9543                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9544 #endif
9545
9546 #ifdef PTHREAD_CREATE_DETACHED
9547         } else {
9548                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9549 #endif
9550         }
9551         if( status ) return status;
9552 #endif
9553
9554         status = pthread_create( &t, &attr, task, NULL );
9555         if( status ) return status;
9556
9557 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9558         if( detach ) {
9559                 /* give thread a chance to complete */
9560                 /* it should remain joinable and hence detachable */
9561                 sleep( 1 );
9562
9563                 status = pthread_detach( t );
9564                 if( status ) return status;
9565         }
9566 #endif
9567
9568 #else
9569         /* Draft 4 pthreads */
9570         status = pthread_create( &t, pthread_attr_default, task, NULL );
9571         if( status ) return status;
9572
9573         if( detach ) {
9574                 /* give thread a chance to complete */
9575                 /* it should remain joinable and hence detachable */
9576                 sleep( 1 );
9577
9578                 status = pthread_detach( &t );
9579                 if( status ) return status;
9580         }
9581 #endif
9582
9583 #ifdef HAVE_LINUX_THREADS
9584         pthread_kill_other_threads_np();
9585 #endif
9586
9587         return 0;
9588
9589 ; return 0; }
9590 EOF
9591 if { (eval echo configure:9592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9592   rm -rf conftest*
9593   ol_cv_pthread_lib_lpthread_woff=yes
9594 else
9595   echo "configure: failed program was:" >&5
9596   cat conftest.$ac_ext >&5
9597   rm -rf conftest*
9598   ol_cv_pthread_lib_lpthread_woff=no
9599 fi
9600 rm -f conftest*
9601 else
9602   cat > conftest.$ac_ext <<EOF
9603 #line 9604 "configure"
9604 #include "confdefs.h"
9605 /* pthread test headers */
9606 #include <pthread.h>
9607 #ifndef NULL
9608 #define NULL (void*)0
9609 #endif
9610
9611 static void *task(p)
9612         void *p;
9613 {
9614         return (void *) (p == NULL);
9615 }
9616
9617
9618 int main(argc, argv)
9619         int argc;
9620         char **argv;
9621 {
9622
9623         /* pthread test function */
9624         pthread_t t;
9625         int status;
9626         int detach = 1;
9627
9628 #ifdef HAVE_PTHREADS_FINAL
9629         /* Final pthreads */
9630         pthread_attr_t attr;
9631
9632         status = pthread_attr_init(&attr);
9633         if( status ) return status;
9634
9635 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9636         if( !detach ) {
9637 #if defined( PTHREAD_CREATE_JOINABLE )
9638                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9639 #else
9640                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9641 #endif
9642
9643 #ifdef PTHREAD_CREATE_DETACHED
9644         } else {
9645                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9646 #endif
9647         }
9648         if( status ) return status;
9649 #endif
9650
9651         status = pthread_create( &t, &attr, task, NULL );
9652         if( status ) return status;
9653
9654 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9655         if( detach ) {
9656                 /* give thread a chance to complete */
9657                 /* it should remain joinable and hence detachable */
9658                 sleep( 1 );
9659
9660                 status = pthread_detach( t );
9661                 if( status ) return status;
9662         }
9663 #endif
9664
9665 #else
9666         /* Draft 4 pthreads */
9667         status = pthread_create( &t, pthread_attr_default, task, NULL );
9668         if( status ) return status;
9669
9670         if( detach ) {
9671                 /* give thread a chance to complete */
9672                 /* it should remain joinable and hence detachable */
9673                 sleep( 1 );
9674
9675                 status = pthread_detach( &t );
9676                 if( status ) return status;
9677         }
9678 #endif
9679
9680 #ifdef HAVE_LINUX_THREADS
9681         pthread_kill_other_threads_np();
9682 #endif
9683
9684         return 0;
9685
9686 }
9687
9688 EOF
9689 if { (eval echo configure:9690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9690 then
9691   ol_cv_pthread_lib_lpthread_woff=yes
9692 else
9693   echo "configure: failed program was:" >&5
9694   cat conftest.$ac_ext >&5
9695   rm -fr conftest*
9696   ol_cv_pthread_lib_lpthread_woff=no
9697 fi
9698 rm -fr conftest*
9699 fi
9700
9701
9702                 # restore the LIBS
9703                 LIBS="$ol_LIBS"
9704         
9705 fi
9706
9707 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9708
9709         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9710                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9711                 ol_link_threads=posix
9712         fi
9713 fi
9714
9715
9716                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9717 if test "$ol_link_threads" = no ; then
9718         # try -lpthread
9719         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9720 echo "configure:9721: checking for pthread link with -lpthread" >&5
9721 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9722   echo $ac_n "(cached) $ac_c" 1>&6
9723 else
9724   
9725                 # save the flags
9726                 ol_LIBS="$LIBS"
9727                 LIBS="-lpthread $LIBS"
9728
9729                 if test "$cross_compiling" = yes; then
9730   cat > conftest.$ac_ext <<EOF
9731 #line 9732 "configure"
9732 #include "confdefs.h"
9733 /* pthread test headers */
9734 #include <pthread.h>
9735 #ifndef NULL
9736 #define NULL (void*)0
9737 #endif
9738
9739 static void *task(p)
9740         void *p;
9741 {
9742         return (void *) (p == NULL);
9743 }
9744
9745 int main() {
9746
9747         /* pthread test function */
9748         pthread_t t;
9749         int status;
9750         int detach = 1;
9751
9752 #ifdef HAVE_PTHREADS_FINAL
9753         /* Final pthreads */
9754         pthread_attr_t attr;
9755
9756         status = pthread_attr_init(&attr);
9757         if( status ) return status;
9758
9759 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9760         if( !detach ) {
9761 #if defined( PTHREAD_CREATE_JOINABLE )
9762                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9763 #else
9764                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9765 #endif
9766
9767 #ifdef PTHREAD_CREATE_DETACHED
9768         } else {
9769                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9770 #endif
9771         }
9772         if( status ) return status;
9773 #endif
9774
9775         status = pthread_create( &t, &attr, task, NULL );
9776         if( status ) return status;
9777
9778 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9779         if( detach ) {
9780                 /* give thread a chance to complete */
9781                 /* it should remain joinable and hence detachable */
9782                 sleep( 1 );
9783
9784                 status = pthread_detach( t );
9785                 if( status ) return status;
9786         }
9787 #endif
9788
9789 #else
9790         /* Draft 4 pthreads */
9791         status = pthread_create( &t, pthread_attr_default, task, NULL );
9792         if( status ) return status;
9793
9794         if( detach ) {
9795                 /* give thread a chance to complete */
9796                 /* it should remain joinable and hence detachable */
9797                 sleep( 1 );
9798
9799                 status = pthread_detach( &t );
9800                 if( status ) return status;
9801         }
9802 #endif
9803
9804 #ifdef HAVE_LINUX_THREADS
9805         pthread_kill_other_threads_np();
9806 #endif
9807
9808         return 0;
9809
9810 ; return 0; }
9811 EOF
9812 if { (eval echo configure:9813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9813   rm -rf conftest*
9814   ol_cv_pthread_lpthread=yes
9815 else
9816   echo "configure: failed program was:" >&5
9817   cat conftest.$ac_ext >&5
9818   rm -rf conftest*
9819   ol_cv_pthread_lpthread=no
9820 fi
9821 rm -f conftest*
9822 else
9823   cat > conftest.$ac_ext <<EOF
9824 #line 9825 "configure"
9825 #include "confdefs.h"
9826 /* pthread test headers */
9827 #include <pthread.h>
9828 #ifndef NULL
9829 #define NULL (void*)0
9830 #endif
9831
9832 static void *task(p)
9833         void *p;
9834 {
9835         return (void *) (p == NULL);
9836 }
9837
9838
9839 int main(argc, argv)
9840         int argc;
9841         char **argv;
9842 {
9843
9844         /* pthread test function */
9845         pthread_t t;
9846         int status;
9847         int detach = 1;
9848
9849 #ifdef HAVE_PTHREADS_FINAL
9850         /* Final pthreads */
9851         pthread_attr_t attr;
9852
9853         status = pthread_attr_init(&attr);
9854         if( status ) return status;
9855
9856 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9857         if( !detach ) {
9858 #if defined( PTHREAD_CREATE_JOINABLE )
9859                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9860 #else
9861                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9862 #endif
9863
9864 #ifdef PTHREAD_CREATE_DETACHED
9865         } else {
9866                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9867 #endif
9868         }
9869         if( status ) return status;
9870 #endif
9871
9872         status = pthread_create( &t, &attr, task, NULL );
9873         if( status ) return status;
9874
9875 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9876         if( detach ) {
9877                 /* give thread a chance to complete */
9878                 /* it should remain joinable and hence detachable */
9879                 sleep( 1 );
9880
9881                 status = pthread_detach( t );
9882                 if( status ) return status;
9883         }
9884 #endif
9885
9886 #else
9887         /* Draft 4 pthreads */
9888         status = pthread_create( &t, pthread_attr_default, task, NULL );
9889         if( status ) return status;
9890
9891         if( detach ) {
9892                 /* give thread a chance to complete */
9893                 /* it should remain joinable and hence detachable */
9894                 sleep( 1 );
9895
9896                 status = pthread_detach( &t );
9897                 if( status ) return status;
9898         }
9899 #endif
9900
9901 #ifdef HAVE_LINUX_THREADS
9902         pthread_kill_other_threads_np();
9903 #endif
9904
9905         return 0;
9906
9907 }
9908
9909 EOF
9910 if { (eval echo configure:9911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9911 then
9912   ol_cv_pthread_lpthread=yes
9913 else
9914   echo "configure: failed program was:" >&5
9915   cat conftest.$ac_ext >&5
9916   rm -fr conftest*
9917   ol_cv_pthread_lpthread=no
9918 fi
9919 rm -fr conftest*
9920 fi
9921
9922
9923                 # restore the LIBS
9924                 LIBS="$ol_LIBS"
9925         
9926 fi
9927
9928 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9929
9930         if test $ol_cv_pthread_lpthread = yes ; then
9931                 ol_link_pthreads="-lpthread"
9932                 ol_link_threads=posix
9933         fi
9934 fi
9935
9936                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9937 if test "$ol_link_threads" = no ; then
9938         # try -lc_r
9939         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9940 echo "configure:9941: checking for pthread link with -lc_r" >&5
9941 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9942   echo $ac_n "(cached) $ac_c" 1>&6
9943 else
9944   
9945                 # save the flags
9946                 ol_LIBS="$LIBS"
9947                 LIBS="-lc_r $LIBS"
9948
9949                 if test "$cross_compiling" = yes; then
9950   cat > conftest.$ac_ext <<EOF
9951 #line 9952 "configure"
9952 #include "confdefs.h"
9953 /* pthread test headers */
9954 #include <pthread.h>
9955 #ifndef NULL
9956 #define NULL (void*)0
9957 #endif
9958
9959 static void *task(p)
9960         void *p;
9961 {
9962         return (void *) (p == NULL);
9963 }
9964
9965 int main() {
9966
9967         /* pthread test function */
9968         pthread_t t;
9969         int status;
9970         int detach = 1;
9971
9972 #ifdef HAVE_PTHREADS_FINAL
9973         /* Final pthreads */
9974         pthread_attr_t attr;
9975
9976         status = pthread_attr_init(&attr);
9977         if( status ) return status;
9978
9979 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9980         if( !detach ) {
9981 #if defined( PTHREAD_CREATE_JOINABLE )
9982                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9983 #else
9984                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9985 #endif
9986
9987 #ifdef PTHREAD_CREATE_DETACHED
9988         } else {
9989                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9990 #endif
9991         }
9992         if( status ) return status;
9993 #endif
9994
9995         status = pthread_create( &t, &attr, task, NULL );
9996         if( status ) return status;
9997
9998 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9999         if( detach ) {
10000                 /* give thread a chance to complete */
10001                 /* it should remain joinable and hence detachable */
10002                 sleep( 1 );
10003
10004                 status = pthread_detach( t );
10005                 if( status ) return status;
10006         }
10007 #endif
10008
10009 #else
10010         /* Draft 4 pthreads */
10011         status = pthread_create( &t, pthread_attr_default, task, NULL );
10012         if( status ) return status;
10013
10014         if( detach ) {
10015                 /* give thread a chance to complete */
10016                 /* it should remain joinable and hence detachable */
10017                 sleep( 1 );
10018
10019                 status = pthread_detach( &t );
10020                 if( status ) return status;
10021         }
10022 #endif
10023
10024 #ifdef HAVE_LINUX_THREADS
10025         pthread_kill_other_threads_np();
10026 #endif
10027
10028         return 0;
10029
10030 ; return 0; }
10031 EOF
10032 if { (eval echo configure:10033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10033   rm -rf conftest*
10034   ol_cv_pthread_lc_r=yes
10035 else
10036   echo "configure: failed program was:" >&5
10037   cat conftest.$ac_ext >&5
10038   rm -rf conftest*
10039   ol_cv_pthread_lc_r=no
10040 fi
10041 rm -f conftest*
10042 else
10043   cat > conftest.$ac_ext <<EOF
10044 #line 10045 "configure"
10045 #include "confdefs.h"
10046 /* pthread test headers */
10047 #include <pthread.h>
10048 #ifndef NULL
10049 #define NULL (void*)0
10050 #endif
10051
10052 static void *task(p)
10053         void *p;
10054 {
10055         return (void *) (p == NULL);
10056 }
10057
10058
10059 int main(argc, argv)
10060         int argc;
10061         char **argv;
10062 {
10063
10064         /* pthread test function */
10065         pthread_t t;
10066         int status;
10067         int detach = 1;
10068
10069 #ifdef HAVE_PTHREADS_FINAL
10070         /* Final pthreads */
10071         pthread_attr_t attr;
10072
10073         status = pthread_attr_init(&attr);
10074         if( status ) return status;
10075
10076 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10077         if( !detach ) {
10078 #if defined( PTHREAD_CREATE_JOINABLE )
10079                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10080 #else
10081                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10082 #endif
10083
10084 #ifdef PTHREAD_CREATE_DETACHED
10085         } else {
10086                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10087 #endif
10088         }
10089         if( status ) return status;
10090 #endif
10091
10092         status = pthread_create( &t, &attr, task, NULL );
10093         if( status ) return status;
10094
10095 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10096         if( detach ) {
10097                 /* give thread a chance to complete */
10098                 /* it should remain joinable and hence detachable */
10099                 sleep( 1 );
10100
10101                 status = pthread_detach( t );
10102                 if( status ) return status;
10103         }
10104 #endif
10105
10106 #else
10107         /* Draft 4 pthreads */
10108         status = pthread_create( &t, pthread_attr_default, task, NULL );
10109         if( status ) return status;
10110
10111         if( detach ) {
10112                 /* give thread a chance to complete */
10113                 /* it should remain joinable and hence detachable */
10114                 sleep( 1 );
10115
10116                 status = pthread_detach( &t );
10117                 if( status ) return status;
10118         }
10119 #endif
10120
10121 #ifdef HAVE_LINUX_THREADS
10122         pthread_kill_other_threads_np();
10123 #endif
10124
10125         return 0;
10126
10127 }
10128
10129 EOF
10130 if { (eval echo configure:10131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10131 then
10132   ol_cv_pthread_lc_r=yes
10133 else
10134   echo "configure: failed program was:" >&5
10135   cat conftest.$ac_ext >&5
10136   rm -fr conftest*
10137   ol_cv_pthread_lc_r=no
10138 fi
10139 rm -fr conftest*
10140 fi
10141
10142
10143                 # restore the LIBS
10144                 LIBS="$ol_LIBS"
10145         
10146 fi
10147
10148 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10149
10150         if test $ol_cv_pthread_lc_r = yes ; then
10151                 ol_link_pthreads="-lc_r"
10152                 ol_link_threads=posix
10153         fi
10154 fi
10155
10156
10157                 # Pthread try link: -threads (ol_cv_pthread_threads)
10158 if test "$ol_link_threads" = no ; then
10159         # try -threads
10160         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10161 echo "configure:10162: checking for pthread link with -threads" >&5
10162 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10163   echo $ac_n "(cached) $ac_c" 1>&6
10164 else
10165   
10166                 # save the flags
10167                 ol_LIBS="$LIBS"
10168                 LIBS="-threads $LIBS"
10169
10170                 if test "$cross_compiling" = yes; then
10171   cat > conftest.$ac_ext <<EOF
10172 #line 10173 "configure"
10173 #include "confdefs.h"
10174 /* pthread test headers */
10175 #include <pthread.h>
10176 #ifndef NULL
10177 #define NULL (void*)0
10178 #endif
10179
10180 static void *task(p)
10181         void *p;
10182 {
10183         return (void *) (p == NULL);
10184 }
10185
10186 int main() {
10187
10188         /* pthread test function */
10189         pthread_t t;
10190         int status;
10191         int detach = 1;
10192
10193 #ifdef HAVE_PTHREADS_FINAL
10194         /* Final pthreads */
10195         pthread_attr_t attr;
10196
10197         status = pthread_attr_init(&attr);
10198         if( status ) return status;
10199
10200 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10201         if( !detach ) {
10202 #if defined( PTHREAD_CREATE_JOINABLE )
10203                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10204 #else
10205                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10206 #endif
10207
10208 #ifdef PTHREAD_CREATE_DETACHED
10209         } else {
10210                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10211 #endif
10212         }
10213         if( status ) return status;
10214 #endif
10215
10216         status = pthread_create( &t, &attr, task, NULL );
10217         if( status ) return status;
10218
10219 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10220         if( detach ) {
10221                 /* give thread a chance to complete */
10222                 /* it should remain joinable and hence detachable */
10223                 sleep( 1 );
10224
10225                 status = pthread_detach( t );
10226                 if( status ) return status;
10227         }
10228 #endif
10229
10230 #else
10231         /* Draft 4 pthreads */
10232         status = pthread_create( &t, pthread_attr_default, task, NULL );
10233         if( status ) return status;
10234
10235         if( detach ) {
10236                 /* give thread a chance to complete */
10237                 /* it should remain joinable and hence detachable */
10238                 sleep( 1 );
10239
10240                 status = pthread_detach( &t );
10241                 if( status ) return status;
10242         }
10243 #endif
10244
10245 #ifdef HAVE_LINUX_THREADS
10246         pthread_kill_other_threads_np();
10247 #endif
10248
10249         return 0;
10250
10251 ; return 0; }
10252 EOF
10253 if { (eval echo configure:10254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10254   rm -rf conftest*
10255   ol_cv_pthread_threads=yes
10256 else
10257   echo "configure: failed program was:" >&5
10258   cat conftest.$ac_ext >&5
10259   rm -rf conftest*
10260   ol_cv_pthread_threads=no
10261 fi
10262 rm -f conftest*
10263 else
10264   cat > conftest.$ac_ext <<EOF
10265 #line 10266 "configure"
10266 #include "confdefs.h"
10267 /* pthread test headers */
10268 #include <pthread.h>
10269 #ifndef NULL
10270 #define NULL (void*)0
10271 #endif
10272
10273 static void *task(p)
10274         void *p;
10275 {
10276         return (void *) (p == NULL);
10277 }
10278
10279
10280 int main(argc, argv)
10281         int argc;
10282         char **argv;
10283 {
10284
10285         /* pthread test function */
10286         pthread_t t;
10287         int status;
10288         int detach = 1;
10289
10290 #ifdef HAVE_PTHREADS_FINAL
10291         /* Final pthreads */
10292         pthread_attr_t attr;
10293
10294         status = pthread_attr_init(&attr);
10295         if( status ) return status;
10296
10297 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10298         if( !detach ) {
10299 #if defined( PTHREAD_CREATE_JOINABLE )
10300                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10301 #else
10302                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10303 #endif
10304
10305 #ifdef PTHREAD_CREATE_DETACHED
10306         } else {
10307                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10308 #endif
10309         }
10310         if( status ) return status;
10311 #endif
10312
10313         status = pthread_create( &t, &attr, task, NULL );
10314         if( status ) return status;
10315
10316 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10317         if( detach ) {
10318                 /* give thread a chance to complete */
10319                 /* it should remain joinable and hence detachable */
10320                 sleep( 1 );
10321
10322                 status = pthread_detach( t );
10323                 if( status ) return status;
10324         }
10325 #endif
10326
10327 #else
10328         /* Draft 4 pthreads */
10329         status = pthread_create( &t, pthread_attr_default, task, NULL );
10330         if( status ) return status;
10331
10332         if( detach ) {
10333                 /* give thread a chance to complete */
10334                 /* it should remain joinable and hence detachable */
10335                 sleep( 1 );
10336
10337                 status = pthread_detach( &t );
10338                 if( status ) return status;
10339         }
10340 #endif
10341
10342 #ifdef HAVE_LINUX_THREADS
10343         pthread_kill_other_threads_np();
10344 #endif
10345
10346         return 0;
10347
10348 }
10349
10350 EOF
10351 if { (eval echo configure:10352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10352 then
10353   ol_cv_pthread_threads=yes
10354 else
10355   echo "configure: failed program was:" >&5
10356   cat conftest.$ac_ext >&5
10357   rm -fr conftest*
10358   ol_cv_pthread_threads=no
10359 fi
10360 rm -fr conftest*
10361 fi
10362
10363
10364                 # restore the LIBS
10365                 LIBS="$ol_LIBS"
10366         
10367 fi
10368
10369 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10370
10371         if test $ol_cv_pthread_threads = yes ; then
10372                 ol_link_pthreads="-threads"
10373                 ol_link_threads=posix
10374         fi
10375 fi
10376
10377
10378                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10379 if test "$ol_link_threads" = no ; then
10380         # try -lpthreads -lmach -lexc -lc_r
10381         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10382 echo "configure:10383: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10383 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10384   echo $ac_n "(cached) $ac_c" 1>&6
10385 else
10386   
10387                 # save the flags
10388                 ol_LIBS="$LIBS"
10389                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10390
10391                 if test "$cross_compiling" = yes; then
10392   cat > conftest.$ac_ext <<EOF
10393 #line 10394 "configure"
10394 #include "confdefs.h"
10395 /* pthread test headers */
10396 #include <pthread.h>
10397 #ifndef NULL
10398 #define NULL (void*)0
10399 #endif
10400
10401 static void *task(p)
10402         void *p;
10403 {
10404         return (void *) (p == NULL);
10405 }
10406
10407 int main() {
10408
10409         /* pthread test function */
10410         pthread_t t;
10411         int status;
10412         int detach = 1;
10413
10414 #ifdef HAVE_PTHREADS_FINAL
10415         /* Final pthreads */
10416         pthread_attr_t attr;
10417
10418         status = pthread_attr_init(&attr);
10419         if( status ) return status;
10420
10421 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10422         if( !detach ) {
10423 #if defined( PTHREAD_CREATE_JOINABLE )
10424                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10425 #else
10426                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10427 #endif
10428
10429 #ifdef PTHREAD_CREATE_DETACHED
10430         } else {
10431                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10432 #endif
10433         }
10434         if( status ) return status;
10435 #endif
10436
10437         status = pthread_create( &t, &attr, task, NULL );
10438         if( status ) return status;
10439
10440 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10441         if( detach ) {
10442                 /* give thread a chance to complete */
10443                 /* it should remain joinable and hence detachable */
10444                 sleep( 1 );
10445
10446                 status = pthread_detach( t );
10447                 if( status ) return status;
10448         }
10449 #endif
10450
10451 #else
10452         /* Draft 4 pthreads */
10453         status = pthread_create( &t, pthread_attr_default, task, NULL );
10454         if( status ) return status;
10455
10456         if( detach ) {
10457                 /* give thread a chance to complete */
10458                 /* it should remain joinable and hence detachable */
10459                 sleep( 1 );
10460
10461                 status = pthread_detach( &t );
10462                 if( status ) return status;
10463         }
10464 #endif
10465
10466 #ifdef HAVE_LINUX_THREADS
10467         pthread_kill_other_threads_np();
10468 #endif
10469
10470         return 0;
10471
10472 ; return 0; }
10473 EOF
10474 if { (eval echo configure:10475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10475   rm -rf conftest*
10476   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10477 else
10478   echo "configure: failed program was:" >&5
10479   cat conftest.$ac_ext >&5
10480   rm -rf conftest*
10481   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10482 fi
10483 rm -f conftest*
10484 else
10485   cat > conftest.$ac_ext <<EOF
10486 #line 10487 "configure"
10487 #include "confdefs.h"
10488 /* pthread test headers */
10489 #include <pthread.h>
10490 #ifndef NULL
10491 #define NULL (void*)0
10492 #endif
10493
10494 static void *task(p)
10495         void *p;
10496 {
10497         return (void *) (p == NULL);
10498 }
10499
10500
10501 int main(argc, argv)
10502         int argc;
10503         char **argv;
10504 {
10505
10506         /* pthread test function */
10507         pthread_t t;
10508         int status;
10509         int detach = 1;
10510
10511 #ifdef HAVE_PTHREADS_FINAL
10512         /* Final pthreads */
10513         pthread_attr_t attr;
10514
10515         status = pthread_attr_init(&attr);
10516         if( status ) return status;
10517
10518 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10519         if( !detach ) {
10520 #if defined( PTHREAD_CREATE_JOINABLE )
10521                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10522 #else
10523                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10524 #endif
10525
10526 #ifdef PTHREAD_CREATE_DETACHED
10527         } else {
10528                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10529 #endif
10530         }
10531         if( status ) return status;
10532 #endif
10533
10534         status = pthread_create( &t, &attr, task, NULL );
10535         if( status ) return status;
10536
10537 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10538         if( detach ) {
10539                 /* give thread a chance to complete */
10540                 /* it should remain joinable and hence detachable */
10541                 sleep( 1 );
10542
10543                 status = pthread_detach( t );
10544                 if( status ) return status;
10545         }
10546 #endif
10547
10548 #else
10549         /* Draft 4 pthreads */
10550         status = pthread_create( &t, pthread_attr_default, task, NULL );
10551         if( status ) return status;
10552
10553         if( detach ) {
10554                 /* give thread a chance to complete */
10555                 /* it should remain joinable and hence detachable */
10556                 sleep( 1 );
10557
10558                 status = pthread_detach( &t );
10559                 if( status ) return status;
10560         }
10561 #endif
10562
10563 #ifdef HAVE_LINUX_THREADS
10564         pthread_kill_other_threads_np();
10565 #endif
10566
10567         return 0;
10568
10569 }
10570
10571 EOF
10572 if { (eval echo configure:10573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10573 then
10574   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10575 else
10576   echo "configure: failed program was:" >&5
10577   cat conftest.$ac_ext >&5
10578   rm -fr conftest*
10579   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10580 fi
10581 rm -fr conftest*
10582 fi
10583
10584
10585                 # restore the LIBS
10586                 LIBS="$ol_LIBS"
10587         
10588 fi
10589
10590 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10591
10592         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10593                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10594                 ol_link_threads=posix
10595         fi
10596 fi
10597
10598                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10599 if test "$ol_link_threads" = no ; then
10600         # try -lpthreads -lmach -lexc
10601         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10602 echo "configure:10603: checking for pthread link with -lpthreads -lmach -lexc" >&5
10603 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10604   echo $ac_n "(cached) $ac_c" 1>&6
10605 else
10606   
10607                 # save the flags
10608                 ol_LIBS="$LIBS"
10609                 LIBS="-lpthreads -lmach -lexc $LIBS"
10610
10611                 if test "$cross_compiling" = yes; then
10612   cat > conftest.$ac_ext <<EOF
10613 #line 10614 "configure"
10614 #include "confdefs.h"
10615 /* pthread test headers */
10616 #include <pthread.h>
10617 #ifndef NULL
10618 #define NULL (void*)0
10619 #endif
10620
10621 static void *task(p)
10622         void *p;
10623 {
10624         return (void *) (p == NULL);
10625 }
10626
10627 int main() {
10628
10629         /* pthread test function */
10630         pthread_t t;
10631         int status;
10632         int detach = 1;
10633
10634 #ifdef HAVE_PTHREADS_FINAL
10635         /* Final pthreads */
10636         pthread_attr_t attr;
10637
10638         status = pthread_attr_init(&attr);
10639         if( status ) return status;
10640
10641 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10642         if( !detach ) {
10643 #if defined( PTHREAD_CREATE_JOINABLE )
10644                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10645 #else
10646                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10647 #endif
10648
10649 #ifdef PTHREAD_CREATE_DETACHED
10650         } else {
10651                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10652 #endif
10653         }
10654         if( status ) return status;
10655 #endif
10656
10657         status = pthread_create( &t, &attr, task, NULL );
10658         if( status ) return status;
10659
10660 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10661         if( detach ) {
10662                 /* give thread a chance to complete */
10663                 /* it should remain joinable and hence detachable */
10664                 sleep( 1 );
10665
10666                 status = pthread_detach( t );
10667                 if( status ) return status;
10668         }
10669 #endif
10670
10671 #else
10672         /* Draft 4 pthreads */
10673         status = pthread_create( &t, pthread_attr_default, task, NULL );
10674         if( status ) return status;
10675
10676         if( detach ) {
10677                 /* give thread a chance to complete */
10678                 /* it should remain joinable and hence detachable */
10679                 sleep( 1 );
10680
10681                 status = pthread_detach( &t );
10682                 if( status ) return status;
10683         }
10684 #endif
10685
10686 #ifdef HAVE_LINUX_THREADS
10687         pthread_kill_other_threads_np();
10688 #endif
10689
10690         return 0;
10691
10692 ; return 0; }
10693 EOF
10694 if { (eval echo configure:10695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10695   rm -rf conftest*
10696   ol_cv_pthread_lpthreads_lmach_lexc=yes
10697 else
10698   echo "configure: failed program was:" >&5
10699   cat conftest.$ac_ext >&5
10700   rm -rf conftest*
10701   ol_cv_pthread_lpthreads_lmach_lexc=no
10702 fi
10703 rm -f conftest*
10704 else
10705   cat > conftest.$ac_ext <<EOF
10706 #line 10707 "configure"
10707 #include "confdefs.h"
10708 /* pthread test headers */
10709 #include <pthread.h>
10710 #ifndef NULL
10711 #define NULL (void*)0
10712 #endif
10713
10714 static void *task(p)
10715         void *p;
10716 {
10717         return (void *) (p == NULL);
10718 }
10719
10720
10721 int main(argc, argv)
10722         int argc;
10723         char **argv;
10724 {
10725
10726         /* pthread test function */
10727         pthread_t t;
10728         int status;
10729         int detach = 1;
10730
10731 #ifdef HAVE_PTHREADS_FINAL
10732         /* Final pthreads */
10733         pthread_attr_t attr;
10734
10735         status = pthread_attr_init(&attr);
10736         if( status ) return status;
10737
10738 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10739         if( !detach ) {
10740 #if defined( PTHREAD_CREATE_JOINABLE )
10741                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10742 #else
10743                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10744 #endif
10745
10746 #ifdef PTHREAD_CREATE_DETACHED
10747         } else {
10748                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10749 #endif
10750         }
10751         if( status ) return status;
10752 #endif
10753
10754         status = pthread_create( &t, &attr, task, NULL );
10755         if( status ) return status;
10756
10757 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10758         if( detach ) {
10759                 /* give thread a chance to complete */
10760                 /* it should remain joinable and hence detachable */
10761                 sleep( 1 );
10762
10763                 status = pthread_detach( t );
10764                 if( status ) return status;
10765         }
10766 #endif
10767
10768 #else
10769         /* Draft 4 pthreads */
10770         status = pthread_create( &t, pthread_attr_default, task, NULL );
10771         if( status ) return status;
10772
10773         if( detach ) {
10774                 /* give thread a chance to complete */
10775                 /* it should remain joinable and hence detachable */
10776                 sleep( 1 );
10777
10778                 status = pthread_detach( &t );
10779                 if( status ) return status;
10780         }
10781 #endif
10782
10783 #ifdef HAVE_LINUX_THREADS
10784         pthread_kill_other_threads_np();
10785 #endif
10786
10787         return 0;
10788
10789 }
10790
10791 EOF
10792 if { (eval echo configure:10793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10793 then
10794   ol_cv_pthread_lpthreads_lmach_lexc=yes
10795 else
10796   echo "configure: failed program was:" >&5
10797   cat conftest.$ac_ext >&5
10798   rm -fr conftest*
10799   ol_cv_pthread_lpthreads_lmach_lexc=no
10800 fi
10801 rm -fr conftest*
10802 fi
10803
10804
10805                 # restore the LIBS
10806                 LIBS="$ol_LIBS"
10807         
10808 fi
10809
10810 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10811
10812         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10813                 ol_link_pthreads="-lpthreads -lmach -lexc"
10814                 ol_link_threads=posix
10815         fi
10816 fi
10817
10818                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10819 if test "$ol_link_threads" = no ; then
10820         # try -lpthreads -lexc
10821         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10822 echo "configure:10823: checking for pthread link with -lpthreads -lexc" >&5
10823 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10824   echo $ac_n "(cached) $ac_c" 1>&6
10825 else
10826   
10827                 # save the flags
10828                 ol_LIBS="$LIBS"
10829                 LIBS="-lpthreads -lexc $LIBS"
10830
10831                 if test "$cross_compiling" = yes; then
10832   cat > conftest.$ac_ext <<EOF
10833 #line 10834 "configure"
10834 #include "confdefs.h"
10835 /* pthread test headers */
10836 #include <pthread.h>
10837 #ifndef NULL
10838 #define NULL (void*)0
10839 #endif
10840
10841 static void *task(p)
10842         void *p;
10843 {
10844         return (void *) (p == NULL);
10845 }
10846
10847 int main() {
10848
10849         /* pthread test function */
10850         pthread_t t;
10851         int status;
10852         int detach = 1;
10853
10854 #ifdef HAVE_PTHREADS_FINAL
10855         /* Final pthreads */
10856         pthread_attr_t attr;
10857
10858         status = pthread_attr_init(&attr);
10859         if( status ) return status;
10860
10861 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10862         if( !detach ) {
10863 #if defined( PTHREAD_CREATE_JOINABLE )
10864                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10865 #else
10866                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10867 #endif
10868
10869 #ifdef PTHREAD_CREATE_DETACHED
10870         } else {
10871                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10872 #endif
10873         }
10874         if( status ) return status;
10875 #endif
10876
10877         status = pthread_create( &t, &attr, task, NULL );
10878         if( status ) return status;
10879
10880 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10881         if( detach ) {
10882                 /* give thread a chance to complete */
10883                 /* it should remain joinable and hence detachable */
10884                 sleep( 1 );
10885
10886                 status = pthread_detach( t );
10887                 if( status ) return status;
10888         }
10889 #endif
10890
10891 #else
10892         /* Draft 4 pthreads */
10893         status = pthread_create( &t, pthread_attr_default, task, NULL );
10894         if( status ) return status;
10895
10896         if( detach ) {
10897                 /* give thread a chance to complete */
10898                 /* it should remain joinable and hence detachable */
10899                 sleep( 1 );
10900
10901                 status = pthread_detach( &t );
10902                 if( status ) return status;
10903         }
10904 #endif
10905
10906 #ifdef HAVE_LINUX_THREADS
10907         pthread_kill_other_threads_np();
10908 #endif
10909
10910         return 0;
10911
10912 ; return 0; }
10913 EOF
10914 if { (eval echo configure:10915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10915   rm -rf conftest*
10916   ol_cv_pthread_lpthreads_lexc=yes
10917 else
10918   echo "configure: failed program was:" >&5
10919   cat conftest.$ac_ext >&5
10920   rm -rf conftest*
10921   ol_cv_pthread_lpthreads_lexc=no
10922 fi
10923 rm -f conftest*
10924 else
10925   cat > conftest.$ac_ext <<EOF
10926 #line 10927 "configure"
10927 #include "confdefs.h"
10928 /* pthread test headers */
10929 #include <pthread.h>
10930 #ifndef NULL
10931 #define NULL (void*)0
10932 #endif
10933
10934 static void *task(p)
10935         void *p;
10936 {
10937         return (void *) (p == NULL);
10938 }
10939
10940
10941 int main(argc, argv)
10942         int argc;
10943         char **argv;
10944 {
10945
10946         /* pthread test function */
10947         pthread_t t;
10948         int status;
10949         int detach = 1;
10950
10951 #ifdef HAVE_PTHREADS_FINAL
10952         /* Final pthreads */
10953         pthread_attr_t attr;
10954
10955         status = pthread_attr_init(&attr);
10956         if( status ) return status;
10957
10958 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10959         if( !detach ) {
10960 #if defined( PTHREAD_CREATE_JOINABLE )
10961                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10962 #else
10963                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10964 #endif
10965
10966 #ifdef PTHREAD_CREATE_DETACHED
10967         } else {
10968                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10969 #endif
10970         }
10971         if( status ) return status;
10972 #endif
10973
10974         status = pthread_create( &t, &attr, task, NULL );
10975         if( status ) return status;
10976
10977 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10978         if( detach ) {
10979                 /* give thread a chance to complete */
10980                 /* it should remain joinable and hence detachable */
10981                 sleep( 1 );
10982
10983                 status = pthread_detach( t );
10984                 if( status ) return status;
10985         }
10986 #endif
10987
10988 #else
10989         /* Draft 4 pthreads */
10990         status = pthread_create( &t, pthread_attr_default, task, NULL );
10991         if( status ) return status;
10992
10993         if( detach ) {
10994                 /* give thread a chance to complete */
10995                 /* it should remain joinable and hence detachable */
10996                 sleep( 1 );
10997
10998                 status = pthread_detach( &t );
10999                 if( status ) return status;
11000         }
11001 #endif
11002
11003 #ifdef HAVE_LINUX_THREADS
11004         pthread_kill_other_threads_np();
11005 #endif
11006
11007         return 0;
11008
11009 }
11010
11011 EOF
11012 if { (eval echo configure:11013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11013 then
11014   ol_cv_pthread_lpthreads_lexc=yes
11015 else
11016   echo "configure: failed program was:" >&5
11017   cat conftest.$ac_ext >&5
11018   rm -fr conftest*
11019   ol_cv_pthread_lpthreads_lexc=no
11020 fi
11021 rm -fr conftest*
11022 fi
11023
11024
11025                 # restore the LIBS
11026                 LIBS="$ol_LIBS"
11027         
11028 fi
11029
11030 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
11031
11032         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
11033                 ol_link_pthreads="-lpthreads -lexc"
11034                 ol_link_threads=posix
11035         fi
11036 fi
11037
11038
11039                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
11040 if test "$ol_link_threads" = no ; then
11041         # try -lpthreads
11042         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
11043 echo "configure:11044: checking for pthread link with -lpthreads" >&5
11044 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11045   echo $ac_n "(cached) $ac_c" 1>&6
11046 else
11047   
11048                 # save the flags
11049                 ol_LIBS="$LIBS"
11050                 LIBS="-lpthreads $LIBS"
11051
11052                 if test "$cross_compiling" = yes; then
11053   cat > conftest.$ac_ext <<EOF
11054 #line 11055 "configure"
11055 #include "confdefs.h"
11056 /* pthread test headers */
11057 #include <pthread.h>
11058 #ifndef NULL
11059 #define NULL (void*)0
11060 #endif
11061
11062 static void *task(p)
11063         void *p;
11064 {
11065         return (void *) (p == NULL);
11066 }
11067
11068 int main() {
11069
11070         /* pthread test function */
11071         pthread_t t;
11072         int status;
11073         int detach = 1;
11074
11075 #ifdef HAVE_PTHREADS_FINAL
11076         /* Final pthreads */
11077         pthread_attr_t attr;
11078
11079         status = pthread_attr_init(&attr);
11080         if( status ) return status;
11081
11082 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11083         if( !detach ) {
11084 #if defined( PTHREAD_CREATE_JOINABLE )
11085                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11086 #else
11087                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11088 #endif
11089
11090 #ifdef PTHREAD_CREATE_DETACHED
11091         } else {
11092                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11093 #endif
11094         }
11095         if( status ) return status;
11096 #endif
11097
11098         status = pthread_create( &t, &attr, task, NULL );
11099         if( status ) return status;
11100
11101 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11102         if( detach ) {
11103                 /* give thread a chance to complete */
11104                 /* it should remain joinable and hence detachable */
11105                 sleep( 1 );
11106
11107                 status = pthread_detach( t );
11108                 if( status ) return status;
11109         }
11110 #endif
11111
11112 #else
11113         /* Draft 4 pthreads */
11114         status = pthread_create( &t, pthread_attr_default, task, NULL );
11115         if( status ) return status;
11116
11117         if( detach ) {
11118                 /* give thread a chance to complete */
11119                 /* it should remain joinable and hence detachable */
11120                 sleep( 1 );
11121
11122                 status = pthread_detach( &t );
11123                 if( status ) return status;
11124         }
11125 #endif
11126
11127 #ifdef HAVE_LINUX_THREADS
11128         pthread_kill_other_threads_np();
11129 #endif
11130
11131         return 0;
11132
11133 ; return 0; }
11134 EOF
11135 if { (eval echo configure:11136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11136   rm -rf conftest*
11137   ol_cv_pthread_lib_lpthreads=yes
11138 else
11139   echo "configure: failed program was:" >&5
11140   cat conftest.$ac_ext >&5
11141   rm -rf conftest*
11142   ol_cv_pthread_lib_lpthreads=no
11143 fi
11144 rm -f conftest*
11145 else
11146   cat > conftest.$ac_ext <<EOF
11147 #line 11148 "configure"
11148 #include "confdefs.h"
11149 /* pthread test headers */
11150 #include <pthread.h>
11151 #ifndef NULL
11152 #define NULL (void*)0
11153 #endif
11154
11155 static void *task(p)
11156         void *p;
11157 {
11158         return (void *) (p == NULL);
11159 }
11160
11161
11162 int main(argc, argv)
11163         int argc;
11164         char **argv;
11165 {
11166
11167         /* pthread test function */
11168         pthread_t t;
11169         int status;
11170         int detach = 1;
11171
11172 #ifdef HAVE_PTHREADS_FINAL
11173         /* Final pthreads */
11174         pthread_attr_t attr;
11175
11176         status = pthread_attr_init(&attr);
11177         if( status ) return status;
11178
11179 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11180         if( !detach ) {
11181 #if defined( PTHREAD_CREATE_JOINABLE )
11182                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11183 #else
11184                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11185 #endif
11186
11187 #ifdef PTHREAD_CREATE_DETACHED
11188         } else {
11189                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11190 #endif
11191         }
11192         if( status ) return status;
11193 #endif
11194
11195         status = pthread_create( &t, &attr, task, NULL );
11196         if( status ) return status;
11197
11198 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11199         if( detach ) {
11200                 /* give thread a chance to complete */
11201                 /* it should remain joinable and hence detachable */
11202                 sleep( 1 );
11203
11204                 status = pthread_detach( t );
11205                 if( status ) return status;
11206         }
11207 #endif
11208
11209 #else
11210         /* Draft 4 pthreads */
11211         status = pthread_create( &t, pthread_attr_default, task, NULL );
11212         if( status ) return status;
11213
11214         if( detach ) {
11215                 /* give thread a chance to complete */
11216                 /* it should remain joinable and hence detachable */
11217                 sleep( 1 );
11218
11219                 status = pthread_detach( &t );
11220                 if( status ) return status;
11221         }
11222 #endif
11223
11224 #ifdef HAVE_LINUX_THREADS
11225         pthread_kill_other_threads_np();
11226 #endif
11227
11228         return 0;
11229
11230 }
11231
11232 EOF
11233 if { (eval echo configure:11234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11234 then
11235   ol_cv_pthread_lib_lpthreads=yes
11236 else
11237   echo "configure: failed program was:" >&5
11238   cat conftest.$ac_ext >&5
11239   rm -fr conftest*
11240   ol_cv_pthread_lib_lpthreads=no
11241 fi
11242 rm -fr conftest*
11243 fi
11244
11245
11246                 # restore the LIBS
11247                 LIBS="$ol_LIBS"
11248         
11249 fi
11250
11251 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11252
11253         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11254                 ol_link_pthreads="-lpthreads"
11255                 ol_link_threads=posix
11256         fi
11257 fi
11258
11259
11260                 if test $ol_link_threads != no ; then
11261                         cat >> confdefs.h <<\EOF
11262 #define HAVE_PTHREADS 1
11263 EOF
11264
11265
11266                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11267
11268                                                 save_CPPFLAGS="$CPPFLAGS"
11269                         save_LIBS="$LIBS"
11270                         LIBS="$LTHREAD_LIBS $LIBS"
11271
11272                                                                                                 for ac_func in sched_yield pthread_yield
11273 do
11274 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11275 echo "configure:11276: checking for $ac_func" >&5
11276 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11277   echo $ac_n "(cached) $ac_c" 1>&6
11278 else
11279   cat > conftest.$ac_ext <<EOF
11280 #line 11281 "configure"
11281 #include "confdefs.h"
11282 /* System header to define __stub macros and hopefully few prototypes,
11283     which can conflict with char $ac_func(); below.  */
11284 #include <assert.h>
11285 /* Override any gcc2 internal prototype to avoid an error.  */
11286 /* We use char because int might match the return type of a gcc2
11287     builtin and then its argument prototype would still apply.  */
11288 char $ac_func();
11289 char (*f)();
11290
11291 int main() {
11292
11293 /* The GNU C library defines this for functions which it implements
11294     to always fail with ENOSYS.  Some functions are actually named
11295     something starting with __ and the normal name is an alias.  */
11296 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11297 choke me
11298 #else
11299 f = $ac_func;
11300 #endif
11301
11302 ; return 0; }
11303 EOF
11304 if { (eval echo configure:11305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11305   rm -rf conftest*
11306   eval "ac_cv_func_$ac_func=yes"
11307 else
11308   echo "configure: failed program was:" >&5
11309   cat conftest.$ac_ext >&5
11310   rm -rf conftest*
11311   eval "ac_cv_func_$ac_func=no"
11312 fi
11313 rm -f conftest*
11314 fi
11315
11316 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11317   echo "$ac_t""yes" 1>&6
11318     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11319   cat >> confdefs.h <<EOF
11320 #define $ac_tr_func 1
11321 EOF
11322  
11323 else
11324   echo "$ac_t""no" 1>&6
11325 fi
11326 done
11327
11328
11329                         if test $ac_cv_func_sched_yield = no -a \
11330                                 $ac_cv_func_pthread_yield = no ; then
11331                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11332 echo "configure:11333: checking for sched_yield in -lrt" >&5
11333 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11334 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11335   echo $ac_n "(cached) $ac_c" 1>&6
11336 else
11337   ac_save_LIBS="$LIBS"
11338 LIBS="-lrt  $LIBS"
11339 cat > conftest.$ac_ext <<EOF
11340 #line 11341 "configure"
11341 #include "confdefs.h"
11342 /* Override any gcc2 internal prototype to avoid an error.  */
11343 /* We use char because int might match the return type of a gcc2
11344     builtin and then its argument prototype would still apply.  */
11345 char sched_yield();
11346
11347 int main() {
11348 sched_yield()
11349 ; return 0; }
11350 EOF
11351 if { (eval echo configure:11352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11352   rm -rf conftest*
11353   eval "ac_cv_lib_$ac_lib_var=yes"
11354 else
11355   echo "configure: failed program was:" >&5
11356   cat conftest.$ac_ext >&5
11357   rm -rf conftest*
11358   eval "ac_cv_lib_$ac_lib_var=no"
11359 fi
11360 rm -f conftest*
11361 LIBS="$ac_save_LIBS"
11362
11363 fi
11364 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11365   echo "$ac_t""yes" 1>&6
11366   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11367                                         cat >> confdefs.h <<\EOF
11368 #define HAVE_SCHED_YIELD 1
11369 EOF
11370
11371                                         ac_cv_func_sched_yield=yes
11372 else
11373   echo "$ac_t""no" 1>&6
11374 ac_cv_func_sched_yield=no
11375 fi
11376
11377                         fi
11378                         if test $ac_cv_func_sched_yield = no -a \
11379                                 $ac_cv_func_pthread_yield = no ; then
11380                                                                                                 for ac_func in thr_yield
11381 do
11382 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11383 echo "configure:11384: checking for $ac_func" >&5
11384 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11385   echo $ac_n "(cached) $ac_c" 1>&6
11386 else
11387   cat > conftest.$ac_ext <<EOF
11388 #line 11389 "configure"
11389 #include "confdefs.h"
11390 /* System header to define __stub macros and hopefully few prototypes,
11391     which can conflict with char $ac_func(); below.  */
11392 #include <assert.h>
11393 /* Override any gcc2 internal prototype to avoid an error.  */
11394 /* We use char because int might match the return type of a gcc2
11395     builtin and then its argument prototype would still apply.  */
11396 char $ac_func();
11397 char (*f)();
11398
11399 int main() {
11400
11401 /* The GNU C library defines this for functions which it implements
11402     to always fail with ENOSYS.  Some functions are actually named
11403     something starting with __ and the normal name is an alias.  */
11404 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11405 choke me
11406 #else
11407 f = $ac_func;
11408 #endif
11409
11410 ; return 0; }
11411 EOF
11412 if { (eval echo configure:11413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11413   rm -rf conftest*
11414   eval "ac_cv_func_$ac_func=yes"
11415 else
11416   echo "configure: failed program was:" >&5
11417   cat conftest.$ac_ext >&5
11418   rm -rf conftest*
11419   eval "ac_cv_func_$ac_func=no"
11420 fi
11421 rm -f conftest*
11422 fi
11423
11424 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11425   echo "$ac_t""yes" 1>&6
11426     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11427   cat >> confdefs.h <<EOF
11428 #define $ac_tr_func 1
11429 EOF
11430  
11431 else
11432   echo "$ac_t""no" 1>&6
11433 fi
11434 done
11435
11436                         fi
11437                         if test $ac_cv_func_sched_yield = no -a \
11438                                 $ac_cv_func_pthread_yield = no -a \
11439                                 "$ac_cv_func_thr_yield" = no ; then
11440                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11441                         fi
11442
11443                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11444 do
11445 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11446 echo "configure:11447: checking for $ac_func" >&5
11447 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11448   echo $ac_n "(cached) $ac_c" 1>&6
11449 else
11450   cat > conftest.$ac_ext <<EOF
11451 #line 11452 "configure"
11452 #include "confdefs.h"
11453 /* System header to define __stub macros and hopefully few prototypes,
11454     which can conflict with char $ac_func(); below.  */
11455 #include <assert.h>
11456 /* Override any gcc2 internal prototype to avoid an error.  */
11457 /* We use char because int might match the return type of a gcc2
11458     builtin and then its argument prototype would still apply.  */
11459 char $ac_func();
11460 char (*f)();
11461
11462 int main() {
11463
11464 /* The GNU C library defines this for functions which it implements
11465     to always fail with ENOSYS.  Some functions are actually named
11466     something starting with __ and the normal name is an alias.  */
11467 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11468 choke me
11469 #else
11470 f = $ac_func;
11471 #endif
11472
11473 ; return 0; }
11474 EOF
11475 if { (eval echo configure:11476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11476   rm -rf conftest*
11477   eval "ac_cv_func_$ac_func=yes"
11478 else
11479   echo "configure: failed program was:" >&5
11480   cat conftest.$ac_ext >&5
11481   rm -rf conftest*
11482   eval "ac_cv_func_$ac_func=no"
11483 fi
11484 rm -f conftest*
11485 fi
11486
11487 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11488   echo "$ac_t""yes" 1>&6
11489     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11490   cat >> confdefs.h <<EOF
11491 #define $ac_tr_func 1
11492 EOF
11493  
11494 else
11495   echo "$ac_t""no" 1>&6
11496 fi
11497 done
11498
11499
11500                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11501 echo "configure:11502: checking for pthread_detach with <pthread.h>" >&5
11502 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11503   echo $ac_n "(cached) $ac_c" 1>&6
11504 else
11505   
11506                                                                 cat > conftest.$ac_ext <<EOF
11507 #line 11508 "configure"
11508 #include "confdefs.h"
11509
11510 #include <pthread.h>
11511 #ifndef NULL
11512 #define NULL (void*)0
11513 #endif
11514
11515 int main() {
11516 pthread_detach(NULL);
11517 ; return 0; }
11518 EOF
11519 if { (eval echo configure:11520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11520   rm -rf conftest*
11521   ol_cv_func_pthread_detach=yes
11522 else
11523   echo "configure: failed program was:" >&5
11524   cat conftest.$ac_ext >&5
11525   rm -rf conftest*
11526   ol_cv_func_pthread_detach=no
11527 fi
11528 rm -f conftest*
11529                         
11530 fi
11531
11532 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11533
11534                         if test $ol_cv_func_pthread_detach = no ; then
11535                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11536                         fi
11537
11538                         cat >> confdefs.h <<\EOF
11539 #define HAVE_PTHREAD_DETACH 1
11540 EOF
11541
11542
11543                                                 for ac_func in \
11544                                 pthread_setconcurrency \
11545                                 pthread_getconcurrency \
11546                                 thr_setconcurrency \
11547                                 thr_getconcurrency \
11548                         
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                         
11606         for ac_func in pthread_kill_other_threads_np
11607 do
11608 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11609 echo "configure:11610: checking for $ac_func" >&5
11610 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11611   echo $ac_n "(cached) $ac_c" 1>&6
11612 else
11613   cat > conftest.$ac_ext <<EOF
11614 #line 11615 "configure"
11615 #include "confdefs.h"
11616 /* System header to define __stub macros and hopefully few prototypes,
11617     which can conflict with char $ac_func(); below.  */
11618 #include <assert.h>
11619 /* Override any gcc2 internal prototype to avoid an error.  */
11620 /* We use char because int might match the return type of a gcc2
11621     builtin and then its argument prototype would still apply.  */
11622 char $ac_func();
11623 char (*f)();
11624
11625 int main() {
11626
11627 /* The GNU C library defines this for functions which it implements
11628     to always fail with ENOSYS.  Some functions are actually named
11629     something starting with __ and the normal name is an alias.  */
11630 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11631 choke me
11632 #else
11633 f = $ac_func;
11634 #endif
11635
11636 ; return 0; }
11637 EOF
11638 if { (eval echo configure:11639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11639   rm -rf conftest*
11640   eval "ac_cv_func_$ac_func=yes"
11641 else
11642   echo "configure: failed program was:" >&5
11643   cat conftest.$ac_ext >&5
11644   rm -rf conftest*
11645   eval "ac_cv_func_$ac_func=no"
11646 fi
11647 rm -f conftest*
11648 fi
11649
11650 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11651   echo "$ac_t""yes" 1>&6
11652     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11653   cat >> confdefs.h <<EOF
11654 #define $ac_tr_func 1
11655 EOF
11656  
11657 else
11658   echo "$ac_t""no" 1>&6
11659 fi
11660 done
11661
11662         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11663 echo "configure:11664: checking for LinuxThreads implementation" >&5
11664 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11665   echo $ac_n "(cached) $ac_c" 1>&6
11666 else
11667   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11668 fi
11669
11670 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11671
11672                         
11673         
11674         
11675         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11676 echo "configure:11677: checking for LinuxThreads consistency" >&5
11677 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11678   echo $ac_n "(cached) $ac_c" 1>&6
11679 else
11680   
11681                 if test $ol_cv_header_linux_threads = yes -a \
11682                         $ol_cv_sys_linux_threads = yes; then
11683                         ol_cv_linux_threads=yes
11684                 elif test $ol_cv_header_linux_threads = no -a \
11685                         $ol_cv_sys_linux_threads = no; then
11686                         ol_cv_linux_threads=no
11687                 else
11688                         ol_cv_linux_threads=error
11689                 fi
11690         
11691 fi
11692
11693 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11694
11695
11696                         if test $ol_cv_linux_threads = error; then
11697                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11698                         fi
11699
11700                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11701 echo "configure:11702: checking if pthread_create() works" >&5
11702 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11703   echo $ac_n "(cached) $ac_c" 1>&6
11704 else
11705   
11706                         if test "$cross_compiling" = yes; then
11707                                 ol_cv_pthread_create_works=yes
11708 else
11709   cat > conftest.$ac_ext <<EOF
11710 #line 11711 "configure"
11711 #include "confdefs.h"
11712 /* pthread test headers */
11713 #include <pthread.h>
11714 #ifndef NULL
11715 #define NULL (void*)0
11716 #endif
11717
11718 static void *task(p)
11719         void *p;
11720 {
11721         return (void *) (p == NULL);
11722 }
11723
11724
11725 int main(argc, argv)
11726         int argc;
11727         char **argv;
11728 {
11729
11730         /* pthread test function */
11731         pthread_t t;
11732         int status;
11733         int detach = 1;
11734
11735 #ifdef HAVE_PTHREADS_FINAL
11736         /* Final pthreads */
11737         pthread_attr_t attr;
11738
11739         status = pthread_attr_init(&attr);
11740         if( status ) return status;
11741
11742 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11743         if( !detach ) {
11744 #if defined( PTHREAD_CREATE_JOINABLE )
11745                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11746 #else
11747                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11748 #endif
11749
11750 #ifdef PTHREAD_CREATE_DETACHED
11751         } else {
11752                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11753 #endif
11754         }
11755         if( status ) return status;
11756 #endif
11757
11758         status = pthread_create( &t, &attr, task, NULL );
11759         if( status ) return status;
11760
11761 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11762         if( detach ) {
11763                 /* give thread a chance to complete */
11764                 /* it should remain joinable and hence detachable */
11765                 sleep( 1 );
11766
11767                 status = pthread_detach( t );
11768                 if( status ) return status;
11769         }
11770 #endif
11771
11772 #else
11773         /* Draft 4 pthreads */
11774         status = pthread_create( &t, pthread_attr_default, task, NULL );
11775         if( status ) return status;
11776
11777         if( detach ) {
11778                 /* give thread a chance to complete */
11779                 /* it should remain joinable and hence detachable */
11780                 sleep( 1 );
11781
11782                 status = pthread_detach( &t );
11783                 if( status ) return status;
11784         }
11785 #endif
11786
11787 #ifdef HAVE_LINUX_THREADS
11788         pthread_kill_other_threads_np();
11789 #endif
11790
11791         return 0;
11792
11793 }
11794
11795 EOF
11796 if { (eval echo configure:11797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11797 then
11798   ol_cv_pthread_create_works=yes
11799 else
11800   echo "configure: failed program was:" >&5
11801   cat conftest.$ac_ext >&5
11802   rm -fr conftest*
11803   ol_cv_pthread_create_works=no
11804 fi
11805 rm -fr conftest*
11806 fi
11807
11808 fi
11809
11810 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11811
11812                         if test $ol_cv_pthread_create_works = no ; then
11813                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11814                         fi
11815
11816                                                 if test $ol_with_yielding_select = auto ; then
11817                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11818 echo "configure:11819: checking if select yields when using pthreads" >&5
11819 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11820   echo $ac_n "(cached) $ac_c" 1>&6
11821 else
11822   
11823                                 if test "$cross_compiling" = yes; then
11824   ol_cv_pthread_select_yields=cross
11825 else
11826   cat > conftest.$ac_ext <<EOF
11827 #line 11828 "configure"
11828 #include "confdefs.h"
11829
11830 #include <sys/types.h>
11831 #include <sys/time.h>
11832 #include <unistd.h>
11833 #include <pthread.h>
11834 #ifndef NULL
11835 #define NULL (void*) 0
11836 #endif
11837
11838 static int fildes[2];
11839
11840 static void *task(p)
11841         void *p;
11842 {
11843         int i;
11844         struct timeval tv;
11845
11846         fd_set rfds;
11847
11848         tv.tv_sec=10;
11849         tv.tv_usec=0;
11850
11851         FD_ZERO(&rfds);
11852         FD_SET(fildes[0], &rfds);
11853
11854         /* we're not interested in any fds */
11855         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11856
11857         if(i < 0) {
11858                 perror("select");
11859                 exit(10);
11860         }
11861
11862         exit(0); /* if we exit here, the select blocked the whole process */
11863 }
11864
11865 int main(argc, argv)
11866         int argc;
11867         char **argv;
11868 {
11869         pthread_t t;
11870
11871         /* create a pipe to select */
11872         if(pipe(&fildes[0])) {
11873                 perror("select");
11874                 exit(1);
11875         }
11876
11877 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11878         (void) pthread_setconcurrency(2);
11879 #else
11880 #ifdef HAVE_THR_SETCONCURRENCY
11881         /* Set Solaris LWP concurrency to 2 */
11882         thr_setconcurrency(2);
11883 #endif
11884 #endif
11885
11886 #if HAVE_PTHREADS_D4
11887         pthread_create(&t, pthread_attr_default, task, NULL);
11888 #else
11889         pthread_create(&t, NULL, task, NULL);
11890 #endif
11891
11892 #if HAVE_SCHED_YIELD
11893         sched_yield();  /* make sure task runs first */
11894 #else
11895 #ifdef HAVE_PTHREAD_YIELD
11896         pthread_yield();        /* make sure task runs first */
11897 #endif
11898 #endif
11899
11900         exit(2);
11901 }
11902 EOF
11903 if { (eval echo configure:11904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11904 then
11905   ol_cv_pthread_select_yields=no
11906 else
11907   echo "configure: failed program was:" >&5
11908   cat conftest.$ac_ext >&5
11909   rm -fr conftest*
11910   ol_cv_pthread_select_yields=yes
11911 fi
11912 rm -fr conftest*
11913 fi
11914
11915 fi
11916
11917 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11918
11919                                 if test $ol_cv_pthread_select_yields = cross ; then
11920                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11921                                 fi
11922
11923                                 if test $ol_cv_pthread_select_yields = yes ; then
11924                                         ol_with_yielding_select=yes
11925                                 fi
11926                         fi
11927
11928                                                 CPPFLAGS="$save_CPPFLAGS"
11929                         LIBS="$save_LIBS"
11930                 else
11931                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11932                 fi
11933         fi
11934
11935         if test $ol_with_threads = posix ; then
11936                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11937         fi
11938 fi
11939
11940 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11941         -o $ol_with_threads = mach ; then
11942
11943                 for ac_hdr in mach/cthreads.h cthreads.h
11944 do
11945 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11946 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11947 echo "configure:11948: checking for $ac_hdr" >&5
11948 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11949   echo $ac_n "(cached) $ac_c" 1>&6
11950 else
11951   cat > conftest.$ac_ext <<EOF
11952 #line 11953 "configure"
11953 #include "confdefs.h"
11954 #include <$ac_hdr>
11955 EOF
11956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11957 { (eval echo configure:11958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11959 if test -z "$ac_err"; then
11960   rm -rf conftest*
11961   eval "ac_cv_header_$ac_safe=yes"
11962 else
11963   echo "$ac_err" >&5
11964   echo "configure: failed program was:" >&5
11965   cat conftest.$ac_ext >&5
11966   rm -rf conftest*
11967   eval "ac_cv_header_$ac_safe=no"
11968 fi
11969 rm -f conftest*
11970 fi
11971 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11972   echo "$ac_t""yes" 1>&6
11973     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11974   cat >> confdefs.h <<EOF
11975 #define $ac_tr_hdr 1
11976 EOF
11977  
11978 else
11979   echo "$ac_t""no" 1>&6
11980 fi
11981 done
11982
11983         if test $ac_cv_header_mach_cthreads_h = yes ; then
11984                 ol_with_threads=found
11985
11986                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11987 echo "configure:11988: checking for cthread_fork" >&5
11988 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11989   echo $ac_n "(cached) $ac_c" 1>&6
11990 else
11991   cat > conftest.$ac_ext <<EOF
11992 #line 11993 "configure"
11993 #include "confdefs.h"
11994 /* System header to define __stub macros and hopefully few prototypes,
11995     which can conflict with char cthread_fork(); below.  */
11996 #include <assert.h>
11997 /* Override any gcc2 internal prototype to avoid an error.  */
11998 /* We use char because int might match the return type of a gcc2
11999     builtin and then its argument prototype would still apply.  */
12000 char cthread_fork();
12001 char (*f)();
12002
12003 int main() {
12004
12005 /* The GNU C library defines this for functions which it implements
12006     to always fail with ENOSYS.  Some functions are actually named
12007     something starting with __ and the normal name is an alias.  */
12008 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12009 choke me
12010 #else
12011 f = cthread_fork;
12012 #endif
12013
12014 ; return 0; }
12015 EOF
12016 if { (eval echo configure:12017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12017   rm -rf conftest*
12018   eval "ac_cv_func_cthread_fork=yes"
12019 else
12020   echo "configure: failed program was:" >&5
12021   cat conftest.$ac_ext >&5
12022   rm -rf conftest*
12023   eval "ac_cv_func_cthread_fork=no"
12024 fi
12025 rm -f conftest*
12026 fi
12027
12028 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12029   echo "$ac_t""yes" 1>&6
12030   ol_link_threads=yes
12031 else
12032   echo "$ac_t""no" 1>&6
12033 fi
12034
12035
12036                 if test $ol_link_threads = no ; then
12037                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
12038 echo "configure:12039: checking for cthread_fork with -all_load" >&5
12039 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
12040   echo $ac_n "(cached) $ac_c" 1>&6
12041 else
12042   
12043                                                                 save_LIBS="$LIBS"
12044                                 LIBS="-all_load $LIBS"
12045                                 cat > conftest.$ac_ext <<EOF
12046 #line 12047 "configure"
12047 #include "confdefs.h"
12048 #include <mach/cthreads.h>
12049 int main() {
12050
12051                                         cthread_fork((void *)0, (void *)0);
12052                                         
12053 ; return 0; }
12054 EOF
12055 if { (eval echo configure:12056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12056   rm -rf conftest*
12057   ol_cv_cthread_all_load=yes
12058 else
12059   echo "configure: failed program was:" >&5
12060   cat conftest.$ac_ext >&5
12061   rm -rf conftest*
12062   ol_cv_cthread_all_load=no
12063 fi
12064 rm -f conftest*
12065                                                                 LIBS="$save_LIBS"
12066                         
12067 fi
12068
12069 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12070
12071                         if test $ol_cv_cthread_all_load = yes ; then
12072                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12073                                 ol_link_threads=mach
12074                                 ol_with_threads=found
12075                         fi
12076                 fi
12077
12078         elif test $ac_cv_header_cthreads_h = yes ; then
12079                                 
12080                 ol_with_threads=found
12081  
12082                                 save_LIBS="$LIBS"
12083                 LIBS="$LIBS -lthreads"
12084                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12085 echo "configure:12086: checking for cthread_fork" >&5
12086 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12087   echo $ac_n "(cached) $ac_c" 1>&6
12088 else
12089   cat > conftest.$ac_ext <<EOF
12090 #line 12091 "configure"
12091 #include "confdefs.h"
12092 /* System header to define __stub macros and hopefully few prototypes,
12093     which can conflict with char cthread_fork(); below.  */
12094 #include <assert.h>
12095 /* Override any gcc2 internal prototype to avoid an error.  */
12096 /* We use char because int might match the return type of a gcc2
12097     builtin and then its argument prototype would still apply.  */
12098 char cthread_fork();
12099 char (*f)();
12100
12101 int main() {
12102
12103 /* The GNU C library defines this for functions which it implements
12104     to always fail with ENOSYS.  Some functions are actually named
12105     something starting with __ and the normal name is an alias.  */
12106 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12107 choke me
12108 #else
12109 f = cthread_fork;
12110 #endif
12111
12112 ; return 0; }
12113 EOF
12114 if { (eval echo configure:12115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12115   rm -rf conftest*
12116   eval "ac_cv_func_cthread_fork=yes"
12117 else
12118   echo "configure: failed program was:" >&5
12119   cat conftest.$ac_ext >&5
12120   rm -rf conftest*
12121   eval "ac_cv_func_cthread_fork=no"
12122 fi
12123 rm -f conftest*
12124 fi
12125
12126 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12127   echo "$ac_t""yes" 1>&6
12128   ol_link_threads=yes
12129 else
12130   echo "$ac_t""no" 1>&6
12131 fi
12132
12133                 LIBS="$save_LIBS"
12134
12135                 if test $ol_link_threads = yes ; then
12136                         LTHREAD_LIBS="-lthreads"
12137                         ol_link_threads=mach
12138                         ol_with_threads=found
12139                 else
12140                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12141                 fi
12142
12143         elif test $ol_with_threads = mach ; then
12144                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12145         fi
12146
12147         if test $ol_link_threads = mach ; then
12148                 cat >> confdefs.h <<\EOF
12149 #define HAVE_MACH_CTHREADS 1
12150 EOF
12151
12152         elif test $ol_with_threads = found ; then
12153                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12154         fi
12155 fi
12156
12157 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12158         -o $ol_with_threads = pth ; then
12159
12160         for ac_hdr in pth.h
12161 do
12162 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12163 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12164 echo "configure:12165: checking for $ac_hdr" >&5
12165 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12166   echo $ac_n "(cached) $ac_c" 1>&6
12167 else
12168   cat > conftest.$ac_ext <<EOF
12169 #line 12170 "configure"
12170 #include "confdefs.h"
12171 #include <$ac_hdr>
12172 EOF
12173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12174 { (eval echo configure:12175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12176 if test -z "$ac_err"; then
12177   rm -rf conftest*
12178   eval "ac_cv_header_$ac_safe=yes"
12179 else
12180   echo "$ac_err" >&5
12181   echo "configure: failed program was:" >&5
12182   cat conftest.$ac_ext >&5
12183   rm -rf conftest*
12184   eval "ac_cv_header_$ac_safe=no"
12185 fi
12186 rm -f conftest*
12187 fi
12188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12189   echo "$ac_t""yes" 1>&6
12190     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12191   cat >> confdefs.h <<EOF
12192 #define $ac_tr_hdr 1
12193 EOF
12194  
12195 else
12196   echo "$ac_t""no" 1>&6
12197 fi
12198 done
12199
12200
12201         if test $ac_cv_header_pth_h = yes ; then
12202                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12203 echo "configure:12204: checking for pth_version in -lpth" >&5
12204 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12205 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12206   echo $ac_n "(cached) $ac_c" 1>&6
12207 else
12208   ac_save_LIBS="$LIBS"
12209 LIBS="-lpth  $LIBS"
12210 cat > conftest.$ac_ext <<EOF
12211 #line 12212 "configure"
12212 #include "confdefs.h"
12213 /* Override any gcc2 internal prototype to avoid an error.  */
12214 /* We use char because int might match the return type of a gcc2
12215     builtin and then its argument prototype would still apply.  */
12216 char pth_version();
12217
12218 int main() {
12219 pth_version()
12220 ; return 0; }
12221 EOF
12222 if { (eval echo configure:12223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12223   rm -rf conftest*
12224   eval "ac_cv_lib_$ac_lib_var=yes"
12225 else
12226   echo "configure: failed program was:" >&5
12227   cat conftest.$ac_ext >&5
12228   rm -rf conftest*
12229   eval "ac_cv_lib_$ac_lib_var=no"
12230 fi
12231 rm -f conftest*
12232 LIBS="$ac_save_LIBS"
12233
12234 fi
12235 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12236   echo "$ac_t""yes" 1>&6
12237   have_pth=yes
12238 else
12239   echo "$ac_t""no" 1>&6
12240 have_pth=no
12241 fi
12242
12243
12244                 if test $have_pth = yes ; then
12245                         cat >> confdefs.h <<\EOF
12246 #define HAVE_GNU_PTH 1
12247 EOF
12248
12249                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12250                         ol_link_threads=pth
12251                         ol_with_threads=found
12252
12253                         if test $ol_with_yielding_select = auto ; then
12254                                 ol_with_yielding_select=yes
12255                         fi
12256                 fi
12257         fi
12258 fi
12259
12260 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12261         -o $ol_with_threads = lwp ; then
12262
12263                 for ac_hdr in thread.h synch.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         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12304                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12305 echo "configure:12306: checking for thr_create in -lthread" >&5
12306 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12307 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12308   echo $ac_n "(cached) $ac_c" 1>&6
12309 else
12310   ac_save_LIBS="$LIBS"
12311 LIBS="-lthread  $LIBS"
12312 cat > conftest.$ac_ext <<EOF
12313 #line 12314 "configure"
12314 #include "confdefs.h"
12315 /* Override any gcc2 internal prototype to avoid an error.  */
12316 /* We use char because int might match the return type of a gcc2
12317     builtin and then its argument prototype would still apply.  */
12318 char thr_create();
12319
12320 int main() {
12321 thr_create()
12322 ; return 0; }
12323 EOF
12324 if { (eval echo configure:12325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12325   rm -rf conftest*
12326   eval "ac_cv_lib_$ac_lib_var=yes"
12327 else
12328   echo "configure: failed program was:" >&5
12329   cat conftest.$ac_ext >&5
12330   rm -rf conftest*
12331   eval "ac_cv_lib_$ac_lib_var=no"
12332 fi
12333 rm -f conftest*
12334 LIBS="$ac_save_LIBS"
12335
12336 fi
12337 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12338   echo "$ac_t""yes" 1>&6
12339   have_thr=yes
12340 else
12341   echo "$ac_t""no" 1>&6
12342 have_thr=no
12343 fi
12344
12345
12346                 if test $have_thr = yes ; then
12347                         cat >> confdefs.h <<\EOF
12348 #define HAVE_THR 1
12349 EOF
12350
12351                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12352                         ol_link_threads=thr
12353
12354                         if test $ol_with_yielding_select = auto ; then
12355                                 ol_with_yielding_select=yes
12356                         fi
12357
12358                                                 for ac_func in \
12359                                 thr_setconcurrency \
12360                                 thr_getconcurrency \
12361                         
12362 do
12363 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12364 echo "configure:12365: checking for $ac_func" >&5
12365 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12366   echo $ac_n "(cached) $ac_c" 1>&6
12367 else
12368   cat > conftest.$ac_ext <<EOF
12369 #line 12370 "configure"
12370 #include "confdefs.h"
12371 /* System header to define __stub macros and hopefully few prototypes,
12372     which can conflict with char $ac_func(); below.  */
12373 #include <assert.h>
12374 /* Override any gcc2 internal prototype to avoid an error.  */
12375 /* We use char because int might match the return type of a gcc2
12376     builtin and then its argument prototype would still apply.  */
12377 char $ac_func();
12378 char (*f)();
12379
12380 int main() {
12381
12382 /* The GNU C library defines this for functions which it implements
12383     to always fail with ENOSYS.  Some functions are actually named
12384     something starting with __ and the normal name is an alias.  */
12385 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12386 choke me
12387 #else
12388 f = $ac_func;
12389 #endif
12390
12391 ; return 0; }
12392 EOF
12393 if { (eval echo configure:12394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12394   rm -rf conftest*
12395   eval "ac_cv_func_$ac_func=yes"
12396 else
12397   echo "configure: failed program was:" >&5
12398   cat conftest.$ac_ext >&5
12399   rm -rf conftest*
12400   eval "ac_cv_func_$ac_func=no"
12401 fi
12402 rm -f conftest*
12403 fi
12404
12405 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12406   echo "$ac_t""yes" 1>&6
12407     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12408   cat >> confdefs.h <<EOF
12409 #define $ac_tr_func 1
12410 EOF
12411  
12412 else
12413   echo "$ac_t""no" 1>&6
12414 fi
12415 done
12416
12417                 fi
12418         fi
12419
12420                 for ac_hdr in lwp/lwp.h
12421 do
12422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12424 echo "configure:12425: checking for $ac_hdr" >&5
12425 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12426   echo $ac_n "(cached) $ac_c" 1>&6
12427 else
12428   cat > conftest.$ac_ext <<EOF
12429 #line 12430 "configure"
12430 #include "confdefs.h"
12431 #include <$ac_hdr>
12432 EOF
12433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12434 { (eval echo configure:12435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12436 if test -z "$ac_err"; then
12437   rm -rf conftest*
12438   eval "ac_cv_header_$ac_safe=yes"
12439 else
12440   echo "$ac_err" >&5
12441   echo "configure: failed program was:" >&5
12442   cat conftest.$ac_ext >&5
12443   rm -rf conftest*
12444   eval "ac_cv_header_$ac_safe=no"
12445 fi
12446 rm -f conftest*
12447 fi
12448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12449   echo "$ac_t""yes" 1>&6
12450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12451   cat >> confdefs.h <<EOF
12452 #define $ac_tr_hdr 1
12453 EOF
12454  
12455 else
12456   echo "$ac_t""no" 1>&6
12457 fi
12458 done
12459
12460         if test $ac_cv_header_lwp_lwp_h = yes ; then
12461                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12462 echo "configure:12463: checking for lwp_create in -llwp" >&5
12463 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12464 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12465   echo $ac_n "(cached) $ac_c" 1>&6
12466 else
12467   ac_save_LIBS="$LIBS"
12468 LIBS="-llwp  $LIBS"
12469 cat > conftest.$ac_ext <<EOF
12470 #line 12471 "configure"
12471 #include "confdefs.h"
12472 /* Override any gcc2 internal prototype to avoid an error.  */
12473 /* We use char because int might match the return type of a gcc2
12474     builtin and then its argument prototype would still apply.  */
12475 char lwp_create();
12476
12477 int main() {
12478 lwp_create()
12479 ; return 0; }
12480 EOF
12481 if { (eval echo configure:12482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12482   rm -rf conftest*
12483   eval "ac_cv_lib_$ac_lib_var=yes"
12484 else
12485   echo "configure: failed program was:" >&5
12486   cat conftest.$ac_ext >&5
12487   rm -rf conftest*
12488   eval "ac_cv_lib_$ac_lib_var=no"
12489 fi
12490 rm -f conftest*
12491 LIBS="$ac_save_LIBS"
12492
12493 fi
12494 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12495   echo "$ac_t""yes" 1>&6
12496   have_lwp=yes
12497 else
12498   echo "$ac_t""no" 1>&6
12499 have_lwp=no
12500 fi
12501
12502
12503                 if test $have_lwp = yes ; then
12504                         cat >> confdefs.h <<\EOF
12505 #define HAVE_LWP 1
12506 EOF
12507
12508                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12509                         ol_link_threads=lwp
12510
12511                         if test $ol_with_yielding_select = auto ; then
12512                                 ol_with_yielding_select=no
12513                         fi
12514                 fi
12515         fi
12516 fi
12517
12518 if test $ol_with_yielding_select = yes ; then
12519         cat >> confdefs.h <<\EOF
12520 #define HAVE_YIELDING_SELECT 1
12521 EOF
12522
12523 fi
12524
12525 if test $ol_with_threads = manual ; then
12526                 ol_link_threads=yes
12527
12528         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12529
12530         for ac_hdr in pthread.h sched.h
12531 do
12532 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12533 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12534 echo "configure:12535: checking for $ac_hdr" >&5
12535 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12536   echo $ac_n "(cached) $ac_c" 1>&6
12537 else
12538   cat > conftest.$ac_ext <<EOF
12539 #line 12540 "configure"
12540 #include "confdefs.h"
12541 #include <$ac_hdr>
12542 EOF
12543 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12544 { (eval echo configure:12545: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12545 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12546 if test -z "$ac_err"; then
12547   rm -rf conftest*
12548   eval "ac_cv_header_$ac_safe=yes"
12549 else
12550   echo "$ac_err" >&5
12551   echo "configure: failed program was:" >&5
12552   cat conftest.$ac_ext >&5
12553   rm -rf conftest*
12554   eval "ac_cv_header_$ac_safe=no"
12555 fi
12556 rm -f conftest*
12557 fi
12558 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12559   echo "$ac_t""yes" 1>&6
12560     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12561   cat >> confdefs.h <<EOF
12562 #define $ac_tr_hdr 1
12563 EOF
12564  
12565 else
12566   echo "$ac_t""no" 1>&6
12567 fi
12568 done
12569
12570         for ac_func in sched_yield pthread_yield
12571 do
12572 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12573 echo "configure:12574: checking for $ac_func" >&5
12574 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12575   echo $ac_n "(cached) $ac_c" 1>&6
12576 else
12577   cat > conftest.$ac_ext <<EOF
12578 #line 12579 "configure"
12579 #include "confdefs.h"
12580 /* System header to define __stub macros and hopefully few prototypes,
12581     which can conflict with char $ac_func(); below.  */
12582 #include <assert.h>
12583 /* Override any gcc2 internal prototype to avoid an error.  */
12584 /* We use char because int might match the return type of a gcc2
12585     builtin and then its argument prototype would still apply.  */
12586 char $ac_func();
12587 char (*f)();
12588
12589 int main() {
12590
12591 /* The GNU C library defines this for functions which it implements
12592     to always fail with ENOSYS.  Some functions are actually named
12593     something starting with __ and the normal name is an alias.  */
12594 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12595 choke me
12596 #else
12597 f = $ac_func;
12598 #endif
12599
12600 ; return 0; }
12601 EOF
12602 if { (eval echo configure:12603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12603   rm -rf conftest*
12604   eval "ac_cv_func_$ac_func=yes"
12605 else
12606   echo "configure: failed program was:" >&5
12607   cat conftest.$ac_ext >&5
12608   rm -rf conftest*
12609   eval "ac_cv_func_$ac_func=no"
12610 fi
12611 rm -f conftest*
12612 fi
12613
12614 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12615   echo "$ac_t""yes" 1>&6
12616     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12617   cat >> confdefs.h <<EOF
12618 #define $ac_tr_func 1
12619 EOF
12620  
12621 else
12622   echo "$ac_t""no" 1>&6
12623 fi
12624 done
12625
12626         
12627         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12628 echo "configure:12629: checking for LinuxThreads pthread.h" >&5
12629 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12630   echo $ac_n "(cached) $ac_c" 1>&6
12631 else
12632   cat > conftest.$ac_ext <<EOF
12633 #line 12634 "configure"
12634 #include "confdefs.h"
12635 #include <pthread.h>
12636 EOF
12637 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12638   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12639   rm -rf conftest*
12640   ol_cv_header_linux_threads=yes
12641 else
12642   rm -rf conftest*
12643   ol_cv_header_linux_threads=no
12644 fi
12645 rm -f conftest*
12646
12647                 
12648 fi
12649
12650 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12651         if test $ol_cv_header_linux_threads = yes; then
12652                 cat >> confdefs.h <<\EOF
12653 #define HAVE_LINUX_THREADS 1
12654 EOF
12655
12656         fi
12657
12658
12659         for ac_hdr in mach/cthreads.h
12660 do
12661 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12662 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12663 echo "configure:12664: checking for $ac_hdr" >&5
12664 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12665   echo $ac_n "(cached) $ac_c" 1>&6
12666 else
12667   cat > conftest.$ac_ext <<EOF
12668 #line 12669 "configure"
12669 #include "confdefs.h"
12670 #include <$ac_hdr>
12671 EOF
12672 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12673 { (eval echo configure:12674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12674 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12675 if test -z "$ac_err"; then
12676   rm -rf conftest*
12677   eval "ac_cv_header_$ac_safe=yes"
12678 else
12679   echo "$ac_err" >&5
12680   echo "configure: failed program was:" >&5
12681   cat conftest.$ac_ext >&5
12682   rm -rf conftest*
12683   eval "ac_cv_header_$ac_safe=no"
12684 fi
12685 rm -f conftest*
12686 fi
12687 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12688   echo "$ac_t""yes" 1>&6
12689     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12690   cat >> confdefs.h <<EOF
12691 #define $ac_tr_hdr 1
12692 EOF
12693  
12694 else
12695   echo "$ac_t""no" 1>&6
12696 fi
12697 done
12698
12699         for ac_hdr in lwp/lwp.h
12700 do
12701 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12702 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12703 echo "configure:12704: checking for $ac_hdr" >&5
12704 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12705   echo $ac_n "(cached) $ac_c" 1>&6
12706 else
12707   cat > conftest.$ac_ext <<EOF
12708 #line 12709 "configure"
12709 #include "confdefs.h"
12710 #include <$ac_hdr>
12711 EOF
12712 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12713 { (eval echo configure:12714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12714 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12715 if test -z "$ac_err"; then
12716   rm -rf conftest*
12717   eval "ac_cv_header_$ac_safe=yes"
12718 else
12719   echo "$ac_err" >&5
12720   echo "configure: failed program was:" >&5
12721   cat conftest.$ac_ext >&5
12722   rm -rf conftest*
12723   eval "ac_cv_header_$ac_safe=no"
12724 fi
12725 rm -f conftest*
12726 fi
12727 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12728   echo "$ac_t""yes" 1>&6
12729     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12730   cat >> confdefs.h <<EOF
12731 #define $ac_tr_hdr 1
12732 EOF
12733  
12734 else
12735   echo "$ac_t""no" 1>&6
12736 fi
12737 done
12738
12739         for ac_hdr in thread.h synch.h
12740 do
12741 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12742 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12743 echo "configure:12744: checking for $ac_hdr" >&5
12744 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12745   echo $ac_n "(cached) $ac_c" 1>&6
12746 else
12747   cat > conftest.$ac_ext <<EOF
12748 #line 12749 "configure"
12749 #include "confdefs.h"
12750 #include <$ac_hdr>
12751 EOF
12752 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12753 { (eval echo configure:12754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12754 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12755 if test -z "$ac_err"; then
12756   rm -rf conftest*
12757   eval "ac_cv_header_$ac_safe=yes"
12758 else
12759   echo "$ac_err" >&5
12760   echo "configure: failed program was:" >&5
12761   cat conftest.$ac_ext >&5
12762   rm -rf conftest*
12763   eval "ac_cv_header_$ac_safe=no"
12764 fi
12765 rm -f conftest*
12766 fi
12767 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12768   echo "$ac_t""yes" 1>&6
12769     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12770   cat >> confdefs.h <<EOF
12771 #define $ac_tr_hdr 1
12772 EOF
12773  
12774 else
12775   echo "$ac_t""no" 1>&6
12776 fi
12777 done
12778
12779 fi
12780
12781 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12782                         cat >> confdefs.h <<\EOF
12783 #define REENTRANT 1
12784 EOF
12785
12786         cat >> confdefs.h <<\EOF
12787 #define _REENTRANT 1
12788 EOF
12789
12790         cat >> confdefs.h <<\EOF
12791 #define THREAD_SAFE 1
12792 EOF
12793
12794         cat >> confdefs.h <<\EOF
12795 #define _THREAD_SAFE 1
12796 EOF
12797
12798         cat >> confdefs.h <<\EOF
12799 #define THREADSAFE 1
12800 EOF
12801
12802         cat >> confdefs.h <<\EOF
12803 #define _THREADSAFE 1
12804 EOF
12805
12806         cat >> confdefs.h <<\EOF
12807 #define _SGI_MP_SOURCE 1
12808 EOF
12809
12810
12811                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12812 echo "configure:12813: checking for thread specific errno" >&5
12813 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12814   echo $ac_n "(cached) $ac_c" 1>&6
12815 else
12816   
12817                 cat > conftest.$ac_ext <<EOF
12818 #line 12819 "configure"
12819 #include "confdefs.h"
12820 #include <errno.h>
12821 int main() {
12822 errno = 0;
12823 ; return 0; }
12824 EOF
12825 if { (eval echo configure:12826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12826   rm -rf conftest*
12827   ol_cv_errno_thread_specific=yes
12828 else
12829   echo "configure: failed program was:" >&5
12830   cat conftest.$ac_ext >&5
12831   rm -rf conftest*
12832   ol_cv_errno_thread_specific=no
12833 fi
12834 rm -f conftest*
12835         
12836 fi
12837
12838 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12839
12840                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12841 echo "configure:12842: checking for thread specific h_errno" >&5
12842 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12843   echo $ac_n "(cached) $ac_c" 1>&6
12844 else
12845   
12846                 cat > conftest.$ac_ext <<EOF
12847 #line 12848 "configure"
12848 #include "confdefs.h"
12849 #include <netdb.h>
12850 int main() {
12851 h_errno = 0;
12852 ; return 0; }
12853 EOF
12854 if { (eval echo configure:12855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12855   rm -rf conftest*
12856   ol_cv_h_errno_thread_specific=yes
12857 else
12858   echo "configure: failed program was:" >&5
12859   cat conftest.$ac_ext >&5
12860   rm -rf conftest*
12861   ol_cv_h_errno_thread_specific=no
12862 fi
12863 rm -f conftest*
12864         
12865 fi
12866
12867 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12868
12869         if test $ol_cv_errno_thread_specific != yes \
12870                 -o $ol_cv_h_errno_thread_specific != yes ; then
12871                 LIBS="$LTHREAD_LIBS $LIBS"
12872                 LTHREAD_LIBS=""
12873         fi
12874
12875 fi  
12876
12877 if test $ol_link_threads = no ; then
12878         if test $ol_with_threads = yes ; then
12879                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12880         fi
12881
12882         if test $ol_with_threads = auto ; then
12883                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12884                 ol_with_threads=no
12885         fi
12886
12887         cat >> confdefs.h <<\EOF
12888 #define NO_THREADS 1
12889 EOF
12890
12891         LTHREAD_LIBS=""
12892 fi
12893
12894 if test $ol_link_threads != no ; then
12895         cat >> confdefs.h <<\EOF
12896 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12897 EOF
12898
12899 fi
12900
12901 ol_link_ldbm=no 
12902
12903 if test $ol_with_ldbm_api = auto \
12904         -o $ol_with_ldbm_api = berkeley \
12905         -o $ol_with_ldbm_api = bcompat ; then
12906
12907         if test $ol_with_ldbm_api = bcompat; then \
12908                 for ac_hdr in db_185.h db.h
12909 do
12910 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12911 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12912 echo "configure:12913: checking for $ac_hdr" >&5
12913 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12914   echo $ac_n "(cached) $ac_c" 1>&6
12915 else
12916   cat > conftest.$ac_ext <<EOF
12917 #line 12918 "configure"
12918 #include "confdefs.h"
12919 #include <$ac_hdr>
12920 EOF
12921 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12922 { (eval echo configure:12923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12923 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12924 if test -z "$ac_err"; then
12925   rm -rf conftest*
12926   eval "ac_cv_header_$ac_safe=yes"
12927 else
12928   echo "$ac_err" >&5
12929   echo "configure: failed program was:" >&5
12930   cat conftest.$ac_ext >&5
12931   rm -rf conftest*
12932   eval "ac_cv_header_$ac_safe=no"
12933 fi
12934 rm -f conftest*
12935 fi
12936 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12937   echo "$ac_t""yes" 1>&6
12938     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12939   cat >> confdefs.h <<EOF
12940 #define $ac_tr_hdr 1
12941 EOF
12942  
12943 else
12944   echo "$ac_t""no" 1>&6
12945 fi
12946 done
12947
12948 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12949         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12950 echo "configure:12951: checking if Berkeley DB header compatibility" >&5
12951 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12952   echo $ac_n "(cached) $ac_c" 1>&6
12953 else
12954   
12955                 cat > conftest.$ac_ext <<EOF
12956 #line 12957 "configure"
12957 #include "confdefs.h"
12958
12959 #if HAVE_DB_185_H
12960 #       include <db_185.h>
12961 #else
12962 #       include <db.h>
12963 #endif
12964
12965  /* this check could be improved */
12966 #ifndef DB_VERSION_MAJOR
12967 #       define DB_VERSION_MAJOR 1
12968 #endif
12969
12970 #if DB_VERSION_MAJOR == 1 
12971         __db_version_1
12972 #endif
12973
12974 EOF
12975 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12976   egrep "__db_version_1" >/dev/null 2>&1; then
12977   rm -rf conftest*
12978   ol_cv_header_db1=yes
12979 else
12980   rm -rf conftest*
12981   ol_cv_header_db1=no
12982 fi
12983 rm -f conftest*
12984
12985 fi
12986
12987 echo "$ac_t""$ol_cv_header_db1" 1>&6
12988
12989         if test $ol_cv_header_db1 = yes ; then
12990                 ol_cv_lib_db=no
12991 if test $ol_cv_lib_db = no ; then
12992         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12993 echo "configure:12994: checking for Berkeley DB link (default)" >&5
12994 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12995   echo $ac_n "(cached) $ac_c" 1>&6
12996 else
12997   
12998         ol_DB_LIB=
12999         ol_LIBS=$LIBS
13000         LIBS="$ol_DB_LIB $LIBS"
13001
13002         cat > conftest.$ac_ext <<EOF
13003 #line 13004 "configure"
13004 #include "confdefs.h"
13005
13006 #ifdef HAVE_DB_185_H
13007 # include <db_185.h>
13008 #else
13009 # include <db.h>
13010 #endif
13011
13012 #ifndef DB_VERSION_MAJOR
13013 # define DB_VERSION_MAJOR 1
13014 #endif
13015
13016 #ifndef NULL
13017 #define NULL ((void*)0)
13018 #endif
13019
13020 int main() {
13021
13022 #if DB_VERSION_MAJOR > 1
13023         {
13024                 char *version;
13025                 int major, minor, patch;
13026
13027                 version = db_version( &major, &minor, &patch );
13028
13029                 if( major != DB_VERSION_MAJOR ||
13030                         minor < DB_VERSION_MINOR )
13031                 {
13032                         printf("Berkeley DB version mismatch\n"
13033                                 "\texpected: %s\n\tgot: %s\n",
13034                                 DB_VERSION_STRING, version);
13035                         return 1;
13036                 }
13037         }
13038 #endif
13039
13040 #if DB_VERSION_MAJOR > 2
13041         db_env_create( NULL, 0 );
13042 #elif DB_VERSION_MAJOR > 1
13043         db_appexit( NULL );
13044 #else
13045         (void) dbopen( NULL, 0, 0, 0, NULL);
13046 #endif
13047
13048 ; return 0; }
13049 EOF
13050 if { (eval echo configure:13051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13051   rm -rf conftest*
13052   ol_cv_db_none=yes
13053 else
13054   echo "configure: failed program was:" >&5
13055   cat conftest.$ac_ext >&5
13056   rm -rf conftest*
13057   ol_cv_db_none=no
13058 fi
13059 rm -f conftest*
13060
13061         LIBS="$ol_LIBS"
13062
13063 fi
13064
13065 echo "$ac_t""$ol_cv_db_none" 1>&6
13066
13067         if test $ol_cv_db_none = yes ; then
13068                 ol_cv_lib_db=yes
13069         fi
13070 fi
13071
13072 if test $ol_cv_lib_db = no ; then
13073         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13074 echo "configure:13075: checking for Berkeley DB link (-ldb)" >&5
13075 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13076   echo $ac_n "(cached) $ac_c" 1>&6
13077 else
13078   
13079         ol_DB_LIB=-ldb
13080         ol_LIBS=$LIBS
13081         LIBS="$ol_DB_LIB $LIBS"
13082
13083         cat > conftest.$ac_ext <<EOF
13084 #line 13085 "configure"
13085 #include "confdefs.h"
13086
13087 #ifdef HAVE_DB_185_H
13088 # include <db_185.h>
13089 #else
13090 # include <db.h>
13091 #endif
13092
13093 #ifndef DB_VERSION_MAJOR
13094 # define DB_VERSION_MAJOR 1
13095 #endif
13096
13097 #ifndef NULL
13098 #define NULL ((void*)0)
13099 #endif
13100
13101 int main() {
13102
13103 #if DB_VERSION_MAJOR > 1
13104         {
13105                 char *version;
13106                 int major, minor, patch;
13107
13108                 version = db_version( &major, &minor, &patch );
13109
13110                 if( major != DB_VERSION_MAJOR ||
13111                         minor < DB_VERSION_MINOR )
13112                 {
13113                         printf("Berkeley DB version mismatch\n"
13114                                 "\texpected: %s\n\tgot: %s\n",
13115                                 DB_VERSION_STRING, version);
13116                         return 1;
13117                 }
13118         }
13119 #endif
13120
13121 #if DB_VERSION_MAJOR > 2
13122         db_env_create( NULL, 0 );
13123 #elif DB_VERSION_MAJOR > 1
13124         db_appexit( NULL );
13125 #else
13126         (void) dbopen( NULL, 0, 0, 0, NULL);
13127 #endif
13128
13129 ; return 0; }
13130 EOF
13131 if { (eval echo configure:13132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13132   rm -rf conftest*
13133   ol_cv_db_db=yes
13134 else
13135   echo "configure: failed program was:" >&5
13136   cat conftest.$ac_ext >&5
13137   rm -rf conftest*
13138   ol_cv_db_db=no
13139 fi
13140 rm -f conftest*
13141
13142         LIBS="$ol_LIBS"
13143
13144 fi
13145
13146 echo "$ac_t""$ol_cv_db_db" 1>&6
13147
13148         if test $ol_cv_db_db = yes ; then
13149                 ol_cv_lib_db=-ldb
13150         fi
13151 fi
13152
13153 if test $ol_cv_lib_db = no ; then
13154         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
13155 echo "configure:13156: checking for Berkeley DB link (-ldb4)" >&5
13156 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
13157   echo $ac_n "(cached) $ac_c" 1>&6
13158 else
13159   
13160         ol_DB_LIB=-ldb4
13161         ol_LIBS=$LIBS
13162         LIBS="$ol_DB_LIB $LIBS"
13163
13164         cat > conftest.$ac_ext <<EOF
13165 #line 13166 "configure"
13166 #include "confdefs.h"
13167
13168 #ifdef HAVE_DB_185_H
13169 # include <db_185.h>
13170 #else
13171 # include <db.h>
13172 #endif
13173
13174 #ifndef DB_VERSION_MAJOR
13175 # define DB_VERSION_MAJOR 1
13176 #endif
13177
13178 #ifndef NULL
13179 #define NULL ((void*)0)
13180 #endif
13181
13182 int main() {
13183
13184 #if DB_VERSION_MAJOR > 1
13185         {
13186                 char *version;
13187                 int major, minor, patch;
13188
13189                 version = db_version( &major, &minor, &patch );
13190
13191                 if( major != DB_VERSION_MAJOR ||
13192                         minor < DB_VERSION_MINOR )
13193                 {
13194                         printf("Berkeley DB version mismatch\n"
13195                                 "\texpected: %s\n\tgot: %s\n",
13196                                 DB_VERSION_STRING, version);
13197                         return 1;
13198                 }
13199         }
13200 #endif
13201
13202 #if DB_VERSION_MAJOR > 2
13203         db_env_create( NULL, 0 );
13204 #elif DB_VERSION_MAJOR > 1
13205         db_appexit( NULL );
13206 #else
13207         (void) dbopen( NULL, 0, 0, 0, NULL);
13208 #endif
13209
13210 ; return 0; }
13211 EOF
13212 if { (eval echo configure:13213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13213   rm -rf conftest*
13214   ol_cv_db_db4=yes
13215 else
13216   echo "configure: failed program was:" >&5
13217   cat conftest.$ac_ext >&5
13218   rm -rf conftest*
13219   ol_cv_db_db4=no
13220 fi
13221 rm -f conftest*
13222
13223         LIBS="$ol_LIBS"
13224
13225 fi
13226
13227 echo "$ac_t""$ol_cv_db_db4" 1>&6
13228
13229         if test $ol_cv_db_db4 = yes ; then
13230                 ol_cv_lib_db=-ldb4
13231         fi
13232 fi
13233
13234 if test $ol_cv_lib_db = no ; then
13235         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13236 echo "configure:13237: checking for Berkeley DB link (-ldb3)" >&5
13237 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13238   echo $ac_n "(cached) $ac_c" 1>&6
13239 else
13240   
13241         ol_DB_LIB=-ldb3
13242         ol_LIBS=$LIBS
13243         LIBS="$ol_DB_LIB $LIBS"
13244
13245         cat > conftest.$ac_ext <<EOF
13246 #line 13247 "configure"
13247 #include "confdefs.h"
13248
13249 #ifdef HAVE_DB_185_H
13250 # include <db_185.h>
13251 #else
13252 # include <db.h>
13253 #endif
13254
13255 #ifndef DB_VERSION_MAJOR
13256 # define DB_VERSION_MAJOR 1
13257 #endif
13258
13259 #ifndef NULL
13260 #define NULL ((void*)0)
13261 #endif
13262
13263 int main() {
13264
13265 #if DB_VERSION_MAJOR > 1
13266         {
13267                 char *version;
13268                 int major, minor, patch;
13269
13270                 version = db_version( &major, &minor, &patch );
13271
13272                 if( major != DB_VERSION_MAJOR ||
13273                         minor < DB_VERSION_MINOR )
13274                 {
13275                         printf("Berkeley DB version mismatch\n"
13276                                 "\texpected: %s\n\tgot: %s\n",
13277                                 DB_VERSION_STRING, version);
13278                         return 1;
13279                 }
13280         }
13281 #endif
13282
13283 #if DB_VERSION_MAJOR > 2
13284         db_env_create( NULL, 0 );
13285 #elif DB_VERSION_MAJOR > 1
13286         db_appexit( NULL );
13287 #else
13288         (void) dbopen( NULL, 0, 0, 0, NULL);
13289 #endif
13290
13291 ; return 0; }
13292 EOF
13293 if { (eval echo configure:13294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13294   rm -rf conftest*
13295   ol_cv_db_db3=yes
13296 else
13297   echo "configure: failed program was:" >&5
13298   cat conftest.$ac_ext >&5
13299   rm -rf conftest*
13300   ol_cv_db_db3=no
13301 fi
13302 rm -f conftest*
13303
13304         LIBS="$ol_LIBS"
13305
13306 fi
13307
13308 echo "$ac_t""$ol_cv_db_db3" 1>&6
13309
13310         if test $ol_cv_db_db3 = yes ; then
13311                 ol_cv_lib_db=-ldb3
13312         fi
13313 fi
13314
13315 if test $ol_cv_lib_db = no ; then
13316         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13317 echo "configure:13318: checking for Berkeley DB link (-ldb2)" >&5
13318 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13319   echo $ac_n "(cached) $ac_c" 1>&6
13320 else
13321   
13322         ol_DB_LIB=-ldb2
13323         ol_LIBS=$LIBS
13324         LIBS="$ol_DB_LIB $LIBS"
13325
13326         cat > conftest.$ac_ext <<EOF
13327 #line 13328 "configure"
13328 #include "confdefs.h"
13329
13330 #ifdef HAVE_DB_185_H
13331 # include <db_185.h>
13332 #else
13333 # include <db.h>
13334 #endif
13335
13336 #ifndef DB_VERSION_MAJOR
13337 # define DB_VERSION_MAJOR 1
13338 #endif
13339
13340 #ifndef NULL
13341 #define NULL ((void*)0)
13342 #endif
13343
13344 int main() {
13345
13346 #if DB_VERSION_MAJOR > 1
13347         {
13348                 char *version;
13349                 int major, minor, patch;
13350
13351                 version = db_version( &major, &minor, &patch );
13352
13353                 if( major != DB_VERSION_MAJOR ||
13354                         minor < DB_VERSION_MINOR )
13355                 {
13356                         printf("Berkeley DB version mismatch\n"
13357                                 "\texpected: %s\n\tgot: %s\n",
13358                                 DB_VERSION_STRING, version);
13359                         return 1;
13360                 }
13361         }
13362 #endif
13363
13364 #if DB_VERSION_MAJOR > 2
13365         db_env_create( NULL, 0 );
13366 #elif DB_VERSION_MAJOR > 1
13367         db_appexit( NULL );
13368 #else
13369         (void) dbopen( NULL, 0, 0, 0, NULL);
13370 #endif
13371
13372 ; return 0; }
13373 EOF
13374 if { (eval echo configure:13375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13375   rm -rf conftest*
13376   ol_cv_db_db2=yes
13377 else
13378   echo "configure: failed program was:" >&5
13379   cat conftest.$ac_ext >&5
13380   rm -rf conftest*
13381   ol_cv_db_db2=no
13382 fi
13383 rm -f conftest*
13384
13385         LIBS="$ol_LIBS"
13386
13387 fi
13388
13389 echo "$ac_t""$ol_cv_db_db2" 1>&6
13390
13391         if test $ol_cv_db_db2 = yes ; then
13392                 ol_cv_lib_db=-ldb2
13393         fi
13394 fi
13395
13396 if test $ol_cv_lib_db = no ; then
13397         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13398 echo "configure:13399: checking for Berkeley DB link (-ldb1)" >&5
13399 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13400   echo $ac_n "(cached) $ac_c" 1>&6
13401 else
13402   
13403         ol_DB_LIB=-ldb1
13404         ol_LIBS=$LIBS
13405         LIBS="$ol_DB_LIB $LIBS"
13406
13407         cat > conftest.$ac_ext <<EOF
13408 #line 13409 "configure"
13409 #include "confdefs.h"
13410
13411 #ifdef HAVE_DB_185_H
13412 # include <db_185.h>
13413 #else
13414 # include <db.h>
13415 #endif
13416
13417 #ifndef DB_VERSION_MAJOR
13418 # define DB_VERSION_MAJOR 1
13419 #endif
13420
13421 #ifndef NULL
13422 #define NULL ((void*)0)
13423 #endif
13424
13425 int main() {
13426
13427 #if DB_VERSION_MAJOR > 1
13428         {
13429                 char *version;
13430                 int major, minor, patch;
13431
13432                 version = db_version( &major, &minor, &patch );
13433
13434                 if( major != DB_VERSION_MAJOR ||
13435                         minor < DB_VERSION_MINOR )
13436                 {
13437                         printf("Berkeley DB version mismatch\n"
13438                                 "\texpected: %s\n\tgot: %s\n",
13439                                 DB_VERSION_STRING, version);
13440                         return 1;
13441                 }
13442         }
13443 #endif
13444
13445 #if DB_VERSION_MAJOR > 2
13446         db_env_create( NULL, 0 );
13447 #elif DB_VERSION_MAJOR > 1
13448         db_appexit( NULL );
13449 #else
13450         (void) dbopen( NULL, 0, 0, 0, NULL);
13451 #endif
13452
13453 ; return 0; }
13454 EOF
13455 if { (eval echo configure:13456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13456   rm -rf conftest*
13457   ol_cv_db_db1=yes
13458 else
13459   echo "configure: failed program was:" >&5
13460   cat conftest.$ac_ext >&5
13461   rm -rf conftest*
13462   ol_cv_db_db1=no
13463 fi
13464 rm -f conftest*
13465
13466         LIBS="$ol_LIBS"
13467
13468 fi
13469
13470 echo "$ac_t""$ol_cv_db_db1" 1>&6
13471
13472         if test $ol_cv_db_db1 = yes ; then
13473                 ol_cv_lib_db=-ldb1
13474         fi
13475 fi
13476
13477
13478                 if test "$ol_cv_lib_db" != no ; then
13479                         ol_cv_berkeley_db=yes
13480                 fi
13481         fi
13482 fi
13483
13484         else
13485                 ol_cv_berkeley_db=no
13486 for ac_hdr in db.h
13487 do
13488 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13489 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13490 echo "configure:13491: checking for $ac_hdr" >&5
13491 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13492   echo $ac_n "(cached) $ac_c" 1>&6
13493 else
13494   cat > conftest.$ac_ext <<EOF
13495 #line 13496 "configure"
13496 #include "confdefs.h"
13497 #include <$ac_hdr>
13498 EOF
13499 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13500 { (eval echo configure:13501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13501 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13502 if test -z "$ac_err"; then
13503   rm -rf conftest*
13504   eval "ac_cv_header_$ac_safe=yes"
13505 else
13506   echo "$ac_err" >&5
13507   echo "configure: failed program was:" >&5
13508   cat conftest.$ac_ext >&5
13509   rm -rf conftest*
13510   eval "ac_cv_header_$ac_safe=no"
13511 fi
13512 rm -f conftest*
13513 fi
13514 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13515   echo "$ac_t""yes" 1>&6
13516     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13517   cat >> confdefs.h <<EOF
13518 #define $ac_tr_hdr 1
13519 EOF
13520  
13521 else
13522   echo "$ac_t""no" 1>&6
13523 fi
13524 done
13525
13526 if test $ac_cv_header_db_h = yes; then
13527         ol_cv_lib_db=no
13528 if test $ol_cv_lib_db = no ; then
13529         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13530 echo "configure:13531: checking for Berkeley DB link (default)" >&5
13531 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13532   echo $ac_n "(cached) $ac_c" 1>&6
13533 else
13534   
13535         ol_DB_LIB=
13536         ol_LIBS=$LIBS
13537         LIBS="$ol_DB_LIB $LIBS"
13538
13539         cat > conftest.$ac_ext <<EOF
13540 #line 13541 "configure"
13541 #include "confdefs.h"
13542
13543 #ifdef HAVE_DB_185_H
13544 # include <db_185.h>
13545 #else
13546 # include <db.h>
13547 #endif
13548
13549 #ifndef DB_VERSION_MAJOR
13550 # define DB_VERSION_MAJOR 1
13551 #endif
13552
13553 #ifndef NULL
13554 #define NULL ((void*)0)
13555 #endif
13556
13557 int main() {
13558
13559 #if DB_VERSION_MAJOR > 1
13560         {
13561                 char *version;
13562                 int major, minor, patch;
13563
13564                 version = db_version( &major, &minor, &patch );
13565
13566                 if( major != DB_VERSION_MAJOR ||
13567                         minor < DB_VERSION_MINOR )
13568                 {
13569                         printf("Berkeley DB version mismatch\n"
13570                                 "\texpected: %s\n\tgot: %s\n",
13571                                 DB_VERSION_STRING, version);
13572                         return 1;
13573                 }
13574         }
13575 #endif
13576
13577 #if DB_VERSION_MAJOR > 2
13578         db_env_create( NULL, 0 );
13579 #elif DB_VERSION_MAJOR > 1
13580         db_appexit( NULL );
13581 #else
13582         (void) dbopen( NULL, 0, 0, 0, NULL);
13583 #endif
13584
13585 ; return 0; }
13586 EOF
13587 if { (eval echo configure:13588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13588   rm -rf conftest*
13589   ol_cv_db_none=yes
13590 else
13591   echo "configure: failed program was:" >&5
13592   cat conftest.$ac_ext >&5
13593   rm -rf conftest*
13594   ol_cv_db_none=no
13595 fi
13596 rm -f conftest*
13597
13598         LIBS="$ol_LIBS"
13599
13600 fi
13601
13602 echo "$ac_t""$ol_cv_db_none" 1>&6
13603
13604         if test $ol_cv_db_none = yes ; then
13605                 ol_cv_lib_db=yes
13606         fi
13607 fi
13608
13609 if test $ol_cv_lib_db = no ; then
13610         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13611 echo "configure:13612: checking for Berkeley DB link (-ldb)" >&5
13612 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13613   echo $ac_n "(cached) $ac_c" 1>&6
13614 else
13615   
13616         ol_DB_LIB=-ldb
13617         ol_LIBS=$LIBS
13618         LIBS="$ol_DB_LIB $LIBS"
13619
13620         cat > conftest.$ac_ext <<EOF
13621 #line 13622 "configure"
13622 #include "confdefs.h"
13623
13624 #ifdef HAVE_DB_185_H
13625 # include <db_185.h>
13626 #else
13627 # include <db.h>
13628 #endif
13629
13630 #ifndef DB_VERSION_MAJOR
13631 # define DB_VERSION_MAJOR 1
13632 #endif
13633
13634 #ifndef NULL
13635 #define NULL ((void*)0)
13636 #endif
13637
13638 int main() {
13639
13640 #if DB_VERSION_MAJOR > 1
13641         {
13642                 char *version;
13643                 int major, minor, patch;
13644
13645                 version = db_version( &major, &minor, &patch );
13646
13647                 if( major != DB_VERSION_MAJOR ||
13648                         minor < DB_VERSION_MINOR )
13649                 {
13650                         printf("Berkeley DB version mismatch\n"
13651                                 "\texpected: %s\n\tgot: %s\n",
13652                                 DB_VERSION_STRING, version);
13653                         return 1;
13654                 }
13655         }
13656 #endif
13657
13658 #if DB_VERSION_MAJOR > 2
13659         db_env_create( NULL, 0 );
13660 #elif DB_VERSION_MAJOR > 1
13661         db_appexit( NULL );
13662 #else
13663         (void) dbopen( NULL, 0, 0, 0, NULL);
13664 #endif
13665
13666 ; return 0; }
13667 EOF
13668 if { (eval echo configure:13669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13669   rm -rf conftest*
13670   ol_cv_db_db=yes
13671 else
13672   echo "configure: failed program was:" >&5
13673   cat conftest.$ac_ext >&5
13674   rm -rf conftest*
13675   ol_cv_db_db=no
13676 fi
13677 rm -f conftest*
13678
13679         LIBS="$ol_LIBS"
13680
13681 fi
13682
13683 echo "$ac_t""$ol_cv_db_db" 1>&6
13684
13685         if test $ol_cv_db_db = yes ; then
13686                 ol_cv_lib_db=-ldb
13687         fi
13688 fi
13689
13690 if test $ol_cv_lib_db = no ; then
13691         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
13692 echo "configure:13693: checking for Berkeley DB link (-ldb4)" >&5
13693 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
13694   echo $ac_n "(cached) $ac_c" 1>&6
13695 else
13696   
13697         ol_DB_LIB=-ldb4
13698         ol_LIBS=$LIBS
13699         LIBS="$ol_DB_LIB $LIBS"
13700
13701         cat > conftest.$ac_ext <<EOF
13702 #line 13703 "configure"
13703 #include "confdefs.h"
13704
13705 #ifdef HAVE_DB_185_H
13706 # include <db_185.h>
13707 #else
13708 # include <db.h>
13709 #endif
13710
13711 #ifndef DB_VERSION_MAJOR
13712 # define DB_VERSION_MAJOR 1
13713 #endif
13714
13715 #ifndef NULL
13716 #define NULL ((void*)0)
13717 #endif
13718
13719 int main() {
13720
13721 #if DB_VERSION_MAJOR > 1
13722         {
13723                 char *version;
13724                 int major, minor, patch;
13725
13726                 version = db_version( &major, &minor, &patch );
13727
13728                 if( major != DB_VERSION_MAJOR ||
13729                         minor < DB_VERSION_MINOR )
13730                 {
13731                         printf("Berkeley DB version mismatch\n"
13732                                 "\texpected: %s\n\tgot: %s\n",
13733                                 DB_VERSION_STRING, version);
13734                         return 1;
13735                 }
13736         }
13737 #endif
13738
13739 #if DB_VERSION_MAJOR > 2
13740         db_env_create( NULL, 0 );
13741 #elif DB_VERSION_MAJOR > 1
13742         db_appexit( NULL );
13743 #else
13744         (void) dbopen( NULL, 0, 0, 0, NULL);
13745 #endif
13746
13747 ; return 0; }
13748 EOF
13749 if { (eval echo configure:13750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13750   rm -rf conftest*
13751   ol_cv_db_db4=yes
13752 else
13753   echo "configure: failed program was:" >&5
13754   cat conftest.$ac_ext >&5
13755   rm -rf conftest*
13756   ol_cv_db_db4=no
13757 fi
13758 rm -f conftest*
13759
13760         LIBS="$ol_LIBS"
13761
13762 fi
13763
13764 echo "$ac_t""$ol_cv_db_db4" 1>&6
13765
13766         if test $ol_cv_db_db4 = yes ; then
13767                 ol_cv_lib_db=-ldb4
13768         fi
13769 fi
13770
13771 if test $ol_cv_lib_db = no ; then
13772         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13773 echo "configure:13774: checking for Berkeley DB link (-ldb3)" >&5
13774 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13775   echo $ac_n "(cached) $ac_c" 1>&6
13776 else
13777   
13778         ol_DB_LIB=-ldb3
13779         ol_LIBS=$LIBS
13780         LIBS="$ol_DB_LIB $LIBS"
13781
13782         cat > conftest.$ac_ext <<EOF
13783 #line 13784 "configure"
13784 #include "confdefs.h"
13785
13786 #ifdef HAVE_DB_185_H
13787 # include <db_185.h>
13788 #else
13789 # include <db.h>
13790 #endif
13791
13792 #ifndef DB_VERSION_MAJOR
13793 # define DB_VERSION_MAJOR 1
13794 #endif
13795
13796 #ifndef NULL
13797 #define NULL ((void*)0)
13798 #endif
13799
13800 int main() {
13801
13802 #if DB_VERSION_MAJOR > 1
13803         {
13804                 char *version;
13805                 int major, minor, patch;
13806
13807                 version = db_version( &major, &minor, &patch );
13808
13809                 if( major != DB_VERSION_MAJOR ||
13810                         minor < DB_VERSION_MINOR )
13811                 {
13812                         printf("Berkeley DB version mismatch\n"
13813                                 "\texpected: %s\n\tgot: %s\n",
13814                                 DB_VERSION_STRING, version);
13815                         return 1;
13816                 }
13817         }
13818 #endif
13819
13820 #if DB_VERSION_MAJOR > 2
13821         db_env_create( NULL, 0 );
13822 #elif DB_VERSION_MAJOR > 1
13823         db_appexit( NULL );
13824 #else
13825         (void) dbopen( NULL, 0, 0, 0, NULL);
13826 #endif
13827
13828 ; return 0; }
13829 EOF
13830 if { (eval echo configure:13831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13831   rm -rf conftest*
13832   ol_cv_db_db3=yes
13833 else
13834   echo "configure: failed program was:" >&5
13835   cat conftest.$ac_ext >&5
13836   rm -rf conftest*
13837   ol_cv_db_db3=no
13838 fi
13839 rm -f conftest*
13840
13841         LIBS="$ol_LIBS"
13842
13843 fi
13844
13845 echo "$ac_t""$ol_cv_db_db3" 1>&6
13846
13847         if test $ol_cv_db_db3 = yes ; then
13848                 ol_cv_lib_db=-ldb3
13849         fi
13850 fi
13851
13852 if test $ol_cv_lib_db = no ; then
13853         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13854 echo "configure:13855: checking for Berkeley DB link (-ldb2)" >&5
13855 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13856   echo $ac_n "(cached) $ac_c" 1>&6
13857 else
13858   
13859         ol_DB_LIB=-ldb2
13860         ol_LIBS=$LIBS
13861         LIBS="$ol_DB_LIB $LIBS"
13862
13863         cat > conftest.$ac_ext <<EOF
13864 #line 13865 "configure"
13865 #include "confdefs.h"
13866
13867 #ifdef HAVE_DB_185_H
13868 # include <db_185.h>
13869 #else
13870 # include <db.h>
13871 #endif
13872
13873 #ifndef DB_VERSION_MAJOR
13874 # define DB_VERSION_MAJOR 1
13875 #endif
13876
13877 #ifndef NULL
13878 #define NULL ((void*)0)
13879 #endif
13880
13881 int main() {
13882
13883 #if DB_VERSION_MAJOR > 1
13884         {
13885                 char *version;
13886                 int major, minor, patch;
13887
13888                 version = db_version( &major, &minor, &patch );
13889
13890                 if( major != DB_VERSION_MAJOR ||
13891                         minor < DB_VERSION_MINOR )
13892                 {
13893                         printf("Berkeley DB version mismatch\n"
13894                                 "\texpected: %s\n\tgot: %s\n",
13895                                 DB_VERSION_STRING, version);
13896                         return 1;
13897                 }
13898         }
13899 #endif
13900
13901 #if DB_VERSION_MAJOR > 2
13902         db_env_create( NULL, 0 );
13903 #elif DB_VERSION_MAJOR > 1
13904         db_appexit( NULL );
13905 #else
13906         (void) dbopen( NULL, 0, 0, 0, NULL);
13907 #endif
13908
13909 ; return 0; }
13910 EOF
13911 if { (eval echo configure:13912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13912   rm -rf conftest*
13913   ol_cv_db_db2=yes
13914 else
13915   echo "configure: failed program was:" >&5
13916   cat conftest.$ac_ext >&5
13917   rm -rf conftest*
13918   ol_cv_db_db2=no
13919 fi
13920 rm -f conftest*
13921
13922         LIBS="$ol_LIBS"
13923
13924 fi
13925
13926 echo "$ac_t""$ol_cv_db_db2" 1>&6
13927
13928         if test $ol_cv_db_db2 = yes ; then
13929                 ol_cv_lib_db=-ldb2
13930         fi
13931 fi
13932
13933 if test $ol_cv_lib_db = no ; then
13934         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13935 echo "configure:13936: checking for Berkeley DB link (-ldb1)" >&5
13936 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13937   echo $ac_n "(cached) $ac_c" 1>&6
13938 else
13939   
13940         ol_DB_LIB=-ldb1
13941         ol_LIBS=$LIBS
13942         LIBS="$ol_DB_LIB $LIBS"
13943
13944         cat > conftest.$ac_ext <<EOF
13945 #line 13946 "configure"
13946 #include "confdefs.h"
13947
13948 #ifdef HAVE_DB_185_H
13949 # include <db_185.h>
13950 #else
13951 # include <db.h>
13952 #endif
13953
13954 #ifndef DB_VERSION_MAJOR
13955 # define DB_VERSION_MAJOR 1
13956 #endif
13957
13958 #ifndef NULL
13959 #define NULL ((void*)0)
13960 #endif
13961
13962 int main() {
13963
13964 #if DB_VERSION_MAJOR > 1
13965         {
13966                 char *version;
13967                 int major, minor, patch;
13968
13969                 version = db_version( &major, &minor, &patch );
13970
13971                 if( major != DB_VERSION_MAJOR ||
13972                         minor < DB_VERSION_MINOR )
13973                 {
13974                         printf("Berkeley DB version mismatch\n"
13975                                 "\texpected: %s\n\tgot: %s\n",
13976                                 DB_VERSION_STRING, version);
13977                         return 1;
13978                 }
13979         }
13980 #endif
13981
13982 #if DB_VERSION_MAJOR > 2
13983         db_env_create( NULL, 0 );
13984 #elif DB_VERSION_MAJOR > 1
13985         db_appexit( NULL );
13986 #else
13987         (void) dbopen( NULL, 0, 0, 0, NULL);
13988 #endif
13989
13990 ; return 0; }
13991 EOF
13992 if { (eval echo configure:13993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13993   rm -rf conftest*
13994   ol_cv_db_db1=yes
13995 else
13996   echo "configure: failed program was:" >&5
13997   cat conftest.$ac_ext >&5
13998   rm -rf conftest*
13999   ol_cv_db_db1=no
14000 fi
14001 rm -f conftest*
14002
14003         LIBS="$ol_LIBS"
14004
14005 fi
14006
14007 echo "$ac_t""$ol_cv_db_db1" 1>&6
14008
14009         if test $ol_cv_db_db1 = yes ; then
14010                 ol_cv_lib_db=-ldb1
14011         fi
14012 fi
14013
14014
14015         if test "$ol_cv_lib_db" != no ; then
14016                 ol_cv_berkeley_db=yes
14017                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
14018 echo "configure:14019: checking for Berkeley DB thread support" >&5
14019 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
14020   echo $ac_n "(cached) $ac_c" 1>&6
14021 else
14022   
14023         ol_LIBS="$LIBS"
14024         if test $ol_cv_lib_db != yes ; then
14025                 LIBS="$ol_cv_lib_db"
14026         fi
14027
14028         if test "$cross_compiling" = yes; then
14029   ol_cv_berkeley_db_thread=cross
14030 else
14031   cat > conftest.$ac_ext <<EOF
14032 #line 14033 "configure"
14033 #include "confdefs.h"
14034
14035 #ifdef HAVE_DB_185_H
14036         choke me;
14037 #else
14038 #include <db.h>
14039 #endif
14040 #ifndef NULL
14041 #define NULL ((void *)0)
14042 #endif
14043 main()
14044 {
14045         int rc;
14046         u_int32_t flags = DB_CREATE |
14047 #ifdef DB_PRIVATE
14048                 DB_PRIVATE |
14049 #endif
14050                 DB_THREAD;
14051
14052 #if DB_VERSION_MAJOR > 2
14053         DB_ENV *env = NULL;
14054
14055         rc = db_env_create( &env, 0 );
14056
14057         flags |= DB_INIT_MPOOL;
14058 #ifdef DB_MPOOL_PRIVATE
14059         flags |= DB_MPOOL_PRIVATE;
14060 #endif
14061
14062         if( rc ) {
14063                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14064                 return rc;
14065         }
14066
14067 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
14068         rc = env->open( env, NULL, flags, 0 );
14069 #else
14070         rc = env->open( env, NULL, NULL, flags, 0 );
14071 #endif
14072
14073         if ( rc == 0 ) {
14074                 rc = env->close( env, 0 );
14075         }
14076
14077         if( rc ) {
14078                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
14079                 return rc;
14080         }
14081
14082 #else
14083         DB_ENV env;
14084         memset( &env, '\0', sizeof(env) );
14085
14086         rc = db_appinit( NULL, NULL, &env, flags );
14087
14088         if( rc == 0 ) {
14089                 db_appexit( &env );
14090         }
14091
14092         unlink("__db_mpool.share");
14093         unlink("__db_lock.share");
14094 #endif
14095
14096         return rc;
14097 }
14098 EOF
14099 if { (eval echo configure:14100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14100 then
14101   ol_cv_berkeley_db_thread=yes
14102 else
14103   echo "configure: failed program was:" >&5
14104   cat conftest.$ac_ext >&5
14105   rm -fr conftest*
14106   ol_cv_berkeley_db_thread=no
14107 fi
14108 rm -fr conftest*
14109 fi
14110
14111
14112         LIBS="$ol_LIBS"
14113
14114         if test $ol_cv_berkeley_db_thread != no ; then
14115                 cat >> confdefs.h <<\EOF
14116 #define HAVE_BERKELEY_DB_THREAD 1
14117 EOF
14118
14119         fi
14120
14121 fi
14122
14123 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
14124         fi
14125 fi
14126
14127         fi
14128
14129         if test $ol_cv_berkeley_db != no ; then
14130                 cat >> confdefs.h <<\EOF
14131 #define HAVE_BERKELEY_DB 1
14132 EOF
14133
14134
14135                 ol_link_ldbm=berkeley
14136                 ol_with_ldbm_api=berkeley
14137
14138                 if test $ol_with_ldbm_type = hash ; then
14139                         cat >> confdefs.h <<\EOF
14140 #define LDBM_USE_DBHASH 1
14141 EOF
14142
14143                 else
14144                         cat >> confdefs.h <<\EOF
14145 #define LDBM_USE_DBBTREE 1
14146 EOF
14147
14148                 fi
14149
14150                                                 if test $ol_cv_lib_db != yes ; then
14151                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
14152                 fi
14153         fi
14154 fi
14155
14156 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
14157         { echo "configure: error: BDB: BerkeleyDB not available" 1>&2; exit 1; }
14158 elif test $ol_enable_bdb != no -a $ol_link_ldbm = berkeley ; then
14159         echo $ac_n "checking Berkeley DB version for BDB backend""... $ac_c" 1>&6
14160 echo "configure:14161: checking Berkeley DB version for BDB backend" >&5
14161 if eval "test \"\${ol_cv_bdb_compat+set}\" = set"; then
14162   echo $ac_n "(cached) $ac_c" 1>&6
14163 else
14164   
14165         cat > conftest.$ac_ext <<EOF
14166 #line 14167 "configure"
14167 #include "confdefs.h"
14168
14169 #include <db.h>
14170
14171  /* this check could be improved */
14172 #ifndef DB_VERSION_MAJOR
14173 #       define DB_VERSION_MAJOR 1
14174 #endif
14175
14176 /* require 3.3 or later */
14177 #if DB_VERSION_MAJOR > 3 
14178         __db_version_compat
14179 #elif DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 3
14180         __db_version_compat
14181 #endif
14182         
14183 EOF
14184 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14185   egrep "__db_version_compat" >/dev/null 2>&1; then
14186   rm -rf conftest*
14187   ol_cv_bdb_compat=yes
14188 else
14189   rm -rf conftest*
14190   ol_cv_bdb_compat=no
14191 fi
14192 rm -f conftest*
14193
14194 fi
14195
14196 echo "$ac_t""$ol_cv_bdb_compat" 1>&6
14197
14198
14199         if test $ol_cv_bdb_compat = yes ; then
14200                 ol_enable_bdb=yes
14201         elif test $ol_enable_bdb = yes ; then
14202                 { echo "configure: error: BDB: BerkeleyDB version incompatible" 1>&2; exit 1; }
14203         else
14204                 ol_enable_bdb=no
14205         fi
14206 fi
14207
14208 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
14209         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
14210         ol_with_ldbm_api=none
14211 fi
14212
14213 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
14214         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
14215 echo "configure:14216: checking for MDBM library" >&5
14216 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
14217   echo $ac_n "(cached) $ac_c" 1>&6
14218 else
14219         ol_LIBS="$LIBS"
14220         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
14221 echo "configure:14222: checking for mdbm_set_chain" >&5
14222 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
14223   echo $ac_n "(cached) $ac_c" 1>&6
14224 else
14225   cat > conftest.$ac_ext <<EOF
14226 #line 14227 "configure"
14227 #include "confdefs.h"
14228 /* System header to define __stub macros and hopefully few prototypes,
14229     which can conflict with char mdbm_set_chain(); below.  */
14230 #include <assert.h>
14231 /* Override any gcc2 internal prototype to avoid an error.  */
14232 /* We use char because int might match the return type of a gcc2
14233     builtin and then its argument prototype would still apply.  */
14234 char mdbm_set_chain();
14235 char (*f)();
14236
14237 int main() {
14238
14239 /* The GNU C library defines this for functions which it implements
14240     to always fail with ENOSYS.  Some functions are actually named
14241     something starting with __ and the normal name is an alias.  */
14242 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
14243 choke me
14244 #else
14245 f = mdbm_set_chain;
14246 #endif
14247
14248 ; return 0; }
14249 EOF
14250 if { (eval echo configure:14251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14251   rm -rf conftest*
14252   eval "ac_cv_func_mdbm_set_chain=yes"
14253 else
14254   echo "configure: failed program was:" >&5
14255   cat conftest.$ac_ext >&5
14256   rm -rf conftest*
14257   eval "ac_cv_func_mdbm_set_chain=no"
14258 fi
14259 rm -f conftest*
14260 fi
14261
14262 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
14263   echo "$ac_t""yes" 1>&6
14264   ol_cv_lib_mdbm=yes
14265 else
14266   echo "$ac_t""no" 1>&6
14267
14268                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
14269 echo "configure:14270: checking for mdbm_set_chain in -lmdbm" >&5
14270 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
14271 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14272   echo $ac_n "(cached) $ac_c" 1>&6
14273 else
14274   ac_save_LIBS="$LIBS"
14275 LIBS="-lmdbm  $LIBS"
14276 cat > conftest.$ac_ext <<EOF
14277 #line 14278 "configure"
14278 #include "confdefs.h"
14279 /* Override any gcc2 internal prototype to avoid an error.  */
14280 /* We use char because int might match the return type of a gcc2
14281     builtin and then its argument prototype would still apply.  */
14282 char mdbm_set_chain();
14283
14284 int main() {
14285 mdbm_set_chain()
14286 ; return 0; }
14287 EOF
14288 if { (eval echo configure:14289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14289   rm -rf conftest*
14290   eval "ac_cv_lib_$ac_lib_var=yes"
14291 else
14292   echo "configure: failed program was:" >&5
14293   cat conftest.$ac_ext >&5
14294   rm -rf conftest*
14295   eval "ac_cv_lib_$ac_lib_var=no"
14296 fi
14297 rm -f conftest*
14298 LIBS="$ac_save_LIBS"
14299
14300 fi
14301 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14302   echo "$ac_t""yes" 1>&6
14303   ol_cv_lib_mdbm=-lmdbm
14304 else
14305   echo "$ac_t""no" 1>&6
14306 ol_cv_lib_mdbm=no
14307 fi
14308
14309         
14310 fi
14311
14312         LIBS="$ol_LIBS"
14313
14314 fi
14315
14316 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14317
14318
14319  for ac_hdr in mdbm.h
14320 do
14321 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14322 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14323 echo "configure:14324: checking for $ac_hdr" >&5
14324 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14325   echo $ac_n "(cached) $ac_c" 1>&6
14326 else
14327   cat > conftest.$ac_ext <<EOF
14328 #line 14329 "configure"
14329 #include "confdefs.h"
14330 #include <$ac_hdr>
14331 EOF
14332 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14333 { (eval echo configure:14334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14334 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14335 if test -z "$ac_err"; then
14336   rm -rf conftest*
14337   eval "ac_cv_header_$ac_safe=yes"
14338 else
14339   echo "$ac_err" >&5
14340   echo "configure: failed program was:" >&5
14341   cat conftest.$ac_ext >&5
14342   rm -rf conftest*
14343   eval "ac_cv_header_$ac_safe=no"
14344 fi
14345 rm -f conftest*
14346 fi
14347 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14348   echo "$ac_t""yes" 1>&6
14349     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14350   cat >> confdefs.h <<EOF
14351 #define $ac_tr_hdr 1
14352 EOF
14353  
14354 else
14355   echo "$ac_t""no" 1>&6
14356 fi
14357 done
14358
14359  echo $ac_n "checking for db""... $ac_c" 1>&6
14360 echo "configure:14361: checking for db" >&5
14361 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14362   echo $ac_n "(cached) $ac_c" 1>&6
14363 else
14364   
14365         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14366                 ol_cv_mdbm=no
14367         else
14368                 ol_cv_mdbm=yes
14369         fi
14370
14371 fi
14372
14373 echo "$ac_t""$ol_cv_mdbm" 1>&6
14374  if test $ol_cv_mdbm = yes ; then
14375         cat >> confdefs.h <<\EOF
14376 #define HAVE_MDBM 1
14377 EOF
14378
14379  fi
14380
14381
14382         if test $ol_cv_mdbm = yes ; then
14383                 ol_link_ldbm=mdbm
14384                 ol_with_ldbm_api=mdbm
14385                 if test $ol_cv_lib_mdbm != yes ; then
14386                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14387                 fi
14388         fi
14389 fi
14390
14391 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14392         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14393 echo "configure:14394: checking for GDBM library" >&5
14394 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14395   echo $ac_n "(cached) $ac_c" 1>&6
14396 else
14397         ol_LIBS="$LIBS"
14398         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14399 echo "configure:14400: checking for gdbm_open" >&5
14400 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14401   echo $ac_n "(cached) $ac_c" 1>&6
14402 else
14403   cat > conftest.$ac_ext <<EOF
14404 #line 14405 "configure"
14405 #include "confdefs.h"
14406 /* System header to define __stub macros and hopefully few prototypes,
14407     which can conflict with char gdbm_open(); below.  */
14408 #include <assert.h>
14409 /* Override any gcc2 internal prototype to avoid an error.  */
14410 /* We use char because int might match the return type of a gcc2
14411     builtin and then its argument prototype would still apply.  */
14412 char gdbm_open();
14413 char (*f)();
14414
14415 int main() {
14416
14417 /* The GNU C library defines this for functions which it implements
14418     to always fail with ENOSYS.  Some functions are actually named
14419     something starting with __ and the normal name is an alias.  */
14420 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14421 choke me
14422 #else
14423 f = gdbm_open;
14424 #endif
14425
14426 ; return 0; }
14427 EOF
14428 if { (eval echo configure:14429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14429   rm -rf conftest*
14430   eval "ac_cv_func_gdbm_open=yes"
14431 else
14432   echo "configure: failed program was:" >&5
14433   cat conftest.$ac_ext >&5
14434   rm -rf conftest*
14435   eval "ac_cv_func_gdbm_open=no"
14436 fi
14437 rm -f conftest*
14438 fi
14439
14440 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14441   echo "$ac_t""yes" 1>&6
14442   ol_cv_lib_gdbm=yes
14443 else
14444   echo "$ac_t""no" 1>&6
14445
14446                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14447 echo "configure:14448: checking for gdbm_open in -lgdbm" >&5
14448 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14449 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14450   echo $ac_n "(cached) $ac_c" 1>&6
14451 else
14452   ac_save_LIBS="$LIBS"
14453 LIBS="-lgdbm  $LIBS"
14454 cat > conftest.$ac_ext <<EOF
14455 #line 14456 "configure"
14456 #include "confdefs.h"
14457 /* Override any gcc2 internal prototype to avoid an error.  */
14458 /* We use char because int might match the return type of a gcc2
14459     builtin and then its argument prototype would still apply.  */
14460 char gdbm_open();
14461
14462 int main() {
14463 gdbm_open()
14464 ; return 0; }
14465 EOF
14466 if { (eval echo configure:14467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14467   rm -rf conftest*
14468   eval "ac_cv_lib_$ac_lib_var=yes"
14469 else
14470   echo "configure: failed program was:" >&5
14471   cat conftest.$ac_ext >&5
14472   rm -rf conftest*
14473   eval "ac_cv_lib_$ac_lib_var=no"
14474 fi
14475 rm -f conftest*
14476 LIBS="$ac_save_LIBS"
14477
14478 fi
14479 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14480   echo "$ac_t""yes" 1>&6
14481   ol_cv_lib_gdbm=-lgdbm
14482 else
14483   echo "$ac_t""no" 1>&6
14484 ol_cv_lib_gdbm=no
14485 fi
14486
14487         
14488 fi
14489
14490         LIBS="$ol_LIBS"
14491
14492 fi
14493
14494 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14495
14496
14497  for ac_hdr in gdbm.h
14498 do
14499 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14500 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14501 echo "configure:14502: checking for $ac_hdr" >&5
14502 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14503   echo $ac_n "(cached) $ac_c" 1>&6
14504 else
14505   cat > conftest.$ac_ext <<EOF
14506 #line 14507 "configure"
14507 #include "confdefs.h"
14508 #include <$ac_hdr>
14509 EOF
14510 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14511 { (eval echo configure:14512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14512 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14513 if test -z "$ac_err"; then
14514   rm -rf conftest*
14515   eval "ac_cv_header_$ac_safe=yes"
14516 else
14517   echo "$ac_err" >&5
14518   echo "configure: failed program was:" >&5
14519   cat conftest.$ac_ext >&5
14520   rm -rf conftest*
14521   eval "ac_cv_header_$ac_safe=no"
14522 fi
14523 rm -f conftest*
14524 fi
14525 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14526   echo "$ac_t""yes" 1>&6
14527     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14528   cat >> confdefs.h <<EOF
14529 #define $ac_tr_hdr 1
14530 EOF
14531  
14532 else
14533   echo "$ac_t""no" 1>&6
14534 fi
14535 done
14536
14537  echo $ac_n "checking for db""... $ac_c" 1>&6
14538 echo "configure:14539: checking for db" >&5
14539 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14540   echo $ac_n "(cached) $ac_c" 1>&6
14541 else
14542   
14543         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14544                 ol_cv_gdbm=no
14545         else
14546                 ol_cv_gdbm=yes
14547         fi
14548
14549 fi
14550
14551 echo "$ac_t""$ol_cv_gdbm" 1>&6
14552  if test $ol_cv_gdbm = yes ; then
14553         cat >> confdefs.h <<\EOF
14554 #define HAVE_GDBM 1
14555 EOF
14556
14557  fi
14558
14559
14560         if test $ol_cv_gdbm = yes ; then
14561                 ol_link_ldbm=gdbm
14562                 ol_with_ldbm_api=gdbm
14563
14564                 if test $ol_cv_lib_gdbm != yes ; then
14565                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14566                 fi
14567         fi
14568 fi
14569
14570 if test $ol_with_ldbm_api = ndbm ; then
14571         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14572 echo "configure:14573: checking for NDBM library" >&5
14573 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14574   echo $ac_n "(cached) $ac_c" 1>&6
14575 else
14576         ol_LIBS="$LIBS"
14577         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14578 echo "configure:14579: checking for dbm_open" >&5
14579 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14580   echo $ac_n "(cached) $ac_c" 1>&6
14581 else
14582   cat > conftest.$ac_ext <<EOF
14583 #line 14584 "configure"
14584 #include "confdefs.h"
14585 /* System header to define __stub macros and hopefully few prototypes,
14586     which can conflict with char dbm_open(); below.  */
14587 #include <assert.h>
14588 /* Override any gcc2 internal prototype to avoid an error.  */
14589 /* We use char because int might match the return type of a gcc2
14590     builtin and then its argument prototype would still apply.  */
14591 char dbm_open();
14592 char (*f)();
14593
14594 int main() {
14595
14596 /* The GNU C library defines this for functions which it implements
14597     to always fail with ENOSYS.  Some functions are actually named
14598     something starting with __ and the normal name is an alias.  */
14599 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14600 choke me
14601 #else
14602 f = dbm_open;
14603 #endif
14604
14605 ; return 0; }
14606 EOF
14607 if { (eval echo configure:14608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14608   rm -rf conftest*
14609   eval "ac_cv_func_dbm_open=yes"
14610 else
14611   echo "configure: failed program was:" >&5
14612   cat conftest.$ac_ext >&5
14613   rm -rf conftest*
14614   eval "ac_cv_func_dbm_open=no"
14615 fi
14616 rm -f conftest*
14617 fi
14618
14619 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14620   echo "$ac_t""yes" 1>&6
14621   ol_cv_lib_ndbm=yes
14622 else
14623   echo "$ac_t""no" 1>&6
14624
14625                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14626 echo "configure:14627: checking for dbm_open in -lndbm" >&5
14627 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14628 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14629   echo $ac_n "(cached) $ac_c" 1>&6
14630 else
14631   ac_save_LIBS="$LIBS"
14632 LIBS="-lndbm  $LIBS"
14633 cat > conftest.$ac_ext <<EOF
14634 #line 14635 "configure"
14635 #include "confdefs.h"
14636 /* Override any gcc2 internal prototype to avoid an error.  */
14637 /* We use char because int might match the return type of a gcc2
14638     builtin and then its argument prototype would still apply.  */
14639 char dbm_open();
14640
14641 int main() {
14642 dbm_open()
14643 ; return 0; }
14644 EOF
14645 if { (eval echo configure:14646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14646   rm -rf conftest*
14647   eval "ac_cv_lib_$ac_lib_var=yes"
14648 else
14649   echo "configure: failed program was:" >&5
14650   cat conftest.$ac_ext >&5
14651   rm -rf conftest*
14652   eval "ac_cv_lib_$ac_lib_var=no"
14653 fi
14654 rm -f conftest*
14655 LIBS="$ac_save_LIBS"
14656
14657 fi
14658 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14659   echo "$ac_t""yes" 1>&6
14660   ol_cv_lib_ndbm=-lndbm
14661 else
14662   echo "$ac_t""no" 1>&6
14663
14664                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14665 echo "configure:14666: checking for dbm_open in -ldbm" >&5
14666 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14667 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14668   echo $ac_n "(cached) $ac_c" 1>&6
14669 else
14670   ac_save_LIBS="$LIBS"
14671 LIBS="-ldbm  $LIBS"
14672 cat > conftest.$ac_ext <<EOF
14673 #line 14674 "configure"
14674 #include "confdefs.h"
14675 /* Override any gcc2 internal prototype to avoid an error.  */
14676 /* We use char because int might match the return type of a gcc2
14677     builtin and then its argument prototype would still apply.  */
14678 char dbm_open();
14679
14680 int main() {
14681 dbm_open()
14682 ; return 0; }
14683 EOF
14684 if { (eval echo configure:14685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14685   rm -rf conftest*
14686   eval "ac_cv_lib_$ac_lib_var=yes"
14687 else
14688   echo "configure: failed program was:" >&5
14689   cat conftest.$ac_ext >&5
14690   rm -rf conftest*
14691   eval "ac_cv_lib_$ac_lib_var=no"
14692 fi
14693 rm -f conftest*
14694 LIBS="$ac_save_LIBS"
14695
14696 fi
14697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14698   echo "$ac_t""yes" 1>&6
14699   ol_cv_lib_ndbm=-ldbm
14700 else
14701   echo "$ac_t""no" 1>&6
14702 ol_cv_lib_ndbm=no
14703 fi
14704                 
14705 fi
14706
14707         
14708 fi
14709
14710         LIBS="$ol_LIBS"
14711
14712 fi
14713
14714 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14715
14716
14717  for ac_hdr in ndbm.h
14718 do
14719 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14720 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14721 echo "configure:14722: checking for $ac_hdr" >&5
14722 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14723   echo $ac_n "(cached) $ac_c" 1>&6
14724 else
14725   cat > conftest.$ac_ext <<EOF
14726 #line 14727 "configure"
14727 #include "confdefs.h"
14728 #include <$ac_hdr>
14729 EOF
14730 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14731 { (eval echo configure:14732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14732 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14733 if test -z "$ac_err"; then
14734   rm -rf conftest*
14735   eval "ac_cv_header_$ac_safe=yes"
14736 else
14737   echo "$ac_err" >&5
14738   echo "configure: failed program was:" >&5
14739   cat conftest.$ac_ext >&5
14740   rm -rf conftest*
14741   eval "ac_cv_header_$ac_safe=no"
14742 fi
14743 rm -f conftest*
14744 fi
14745 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14746   echo "$ac_t""yes" 1>&6
14747     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14748   cat >> confdefs.h <<EOF
14749 #define $ac_tr_hdr 1
14750 EOF
14751  
14752 else
14753   echo "$ac_t""no" 1>&6
14754 fi
14755 done
14756
14757  echo $ac_n "checking for db""... $ac_c" 1>&6
14758 echo "configure:14759: checking for db" >&5
14759 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14760   echo $ac_n "(cached) $ac_c" 1>&6
14761 else
14762   
14763         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14764                 ol_cv_ndbm=no
14765         else
14766                 ol_cv_ndbm=yes
14767         fi
14768
14769 fi
14770
14771 echo "$ac_t""$ol_cv_ndbm" 1>&6
14772  if test $ol_cv_ndbm = yes ; then
14773         cat >> confdefs.h <<\EOF
14774 #define HAVE_NDBM 1
14775 EOF
14776
14777  fi
14778
14779
14780         if test $ol_cv_ndbm = yes ; then
14781                 ol_link_ldbm=ndbm
14782                 ol_with_ldbm_api=ndbm
14783
14784                 if test $ol_cv_lib_ndbm != yes ; then
14785                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14786                 fi
14787         fi
14788 fi
14789
14790 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14791         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14792         if test $ol_enable_ldbm = yes ; then
14793                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14794         fi
14795
14796         echo "configure: warning: disabling LDBM" 1>&2
14797         ol_enable_ldbm=no
14798 fi
14799
14800 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14801         BUILD_LIBS_DYNAMIC=shared
14802         cat >> confdefs.h <<\EOF
14803 #define LDAP_LIBS_DYNAMIC 1
14804 EOF
14805
14806 else
14807         BUILD_LIBS_DYNAMIC=static
14808 fi
14809
14810 if test $ol_enable_wrappers != no ; then
14811         for ac_hdr in tcpd.h
14812 do
14813 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14814 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14815 echo "configure:14816: checking for $ac_hdr" >&5
14816 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14817   echo $ac_n "(cached) $ac_c" 1>&6
14818 else
14819   cat > conftest.$ac_ext <<EOF
14820 #line 14821 "configure"
14821 #include "confdefs.h"
14822 #include <$ac_hdr>
14823 EOF
14824 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14825 { (eval echo configure:14826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14826 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14827 if test -z "$ac_err"; then
14828   rm -rf conftest*
14829   eval "ac_cv_header_$ac_safe=yes"
14830 else
14831   echo "$ac_err" >&5
14832   echo "configure: failed program was:" >&5
14833   cat conftest.$ac_ext >&5
14834   rm -rf conftest*
14835   eval "ac_cv_header_$ac_safe=no"
14836 fi
14837 rm -f conftest*
14838 fi
14839 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14840   echo "$ac_t""yes" 1>&6
14841     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14842   cat >> confdefs.h <<EOF
14843 #define $ac_tr_hdr 1
14844 EOF
14845  
14846 else
14847   echo "$ac_t""no" 1>&6
14848 fi
14849 done
14850
14851
14852         if test $ac_cv_header_tcpd_h != yes ; then
14853                 have_wrappers=no
14854         else
14855                 cat > conftest.$ac_ext <<EOF
14856 #line 14857 "configure"
14857 #include "confdefs.h"
14858
14859 int allow_severity = 0;
14860 int deny_severity  = 0;
14861                 
14862 int main() {
14863 hosts_access()
14864 ; return 0; }
14865 EOF
14866 if { (eval echo configure:14867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14867   rm -rf conftest*
14868   have_wrappers=yes
14869 else
14870   echo "configure: failed program was:" >&5
14871   cat conftest.$ac_ext >&5
14872   rm -rf conftest*
14873   have_wrappers=no
14874 fi
14875 rm -f conftest*
14876         fi
14877
14878         if test $have_wrappers = yes ; then
14879                 cat >> confdefs.h <<\EOF
14880 #define HAVE_TCPD 1
14881 EOF
14882
14883                 WRAP_LIBS="-lwrap"
14884
14885                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14886 echo "configure:14887: checking for main in -lnsl" >&5
14887 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14888 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14889   echo $ac_n "(cached) $ac_c" 1>&6
14890 else
14891   ac_save_LIBS="$LIBS"
14892 LIBS="-lnsl  $LIBS"
14893 cat > conftest.$ac_ext <<EOF
14894 #line 14895 "configure"
14895 #include "confdefs.h"
14896
14897 int main() {
14898 main()
14899 ; return 0; }
14900 EOF
14901 if { (eval echo configure:14902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14902   rm -rf conftest*
14903   eval "ac_cv_lib_$ac_lib_var=yes"
14904 else
14905   echo "configure: failed program was:" >&5
14906   cat conftest.$ac_ext >&5
14907   rm -rf conftest*
14908   eval "ac_cv_lib_$ac_lib_var=no"
14909 fi
14910 rm -f conftest*
14911 LIBS="$ac_save_LIBS"
14912
14913 fi
14914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14915   echo "$ac_t""yes" 1>&6
14916     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14917     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14918   cat >> confdefs.h <<EOF
14919 #define $ac_tr_lib 1
14920 EOF
14921
14922   LIBS="-lnsl $LIBS"
14923
14924 else
14925   echo "$ac_t""no" 1>&6
14926 fi
14927
14928         else
14929                 echo "configure: warning: could not find -lwrap" 1>&2
14930                 if test $ol_enable_wrappers = yes ; then
14931                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14932                 fi
14933
14934                 echo "configure: warning: disabling wrappers support" 1>&2
14935                 ol_enable_wrappers=no
14936                 WRAP_LIBS=""
14937         fi
14938 fi
14939
14940 if test $ol_enable_syslog != no ; then
14941         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14942 echo "configure:14943: checking for openlog" >&5
14943 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14944   echo $ac_n "(cached) $ac_c" 1>&6
14945 else
14946   cat > conftest.$ac_ext <<EOF
14947 #line 14948 "configure"
14948 #include "confdefs.h"
14949 /* System header to define __stub macros and hopefully few prototypes,
14950     which can conflict with char openlog(); below.  */
14951 #include <assert.h>
14952 /* Override any gcc2 internal prototype to avoid an error.  */
14953 /* We use char because int might match the return type of a gcc2
14954     builtin and then its argument prototype would still apply.  */
14955 char openlog();
14956 char (*f)();
14957
14958 int main() {
14959
14960 /* The GNU C library defines this for functions which it implements
14961     to always fail with ENOSYS.  Some functions are actually named
14962     something starting with __ and the normal name is an alias.  */
14963 #if defined (__stub_openlog) || defined (__stub___openlog)
14964 choke me
14965 #else
14966 f = openlog;
14967 #endif
14968
14969 ; return 0; }
14970 EOF
14971 if { (eval echo configure:14972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14972   rm -rf conftest*
14973   eval "ac_cv_func_openlog=yes"
14974 else
14975   echo "configure: failed program was:" >&5
14976   cat conftest.$ac_ext >&5
14977   rm -rf conftest*
14978   eval "ac_cv_func_openlog=no"
14979 fi
14980 rm -f conftest*
14981 fi
14982
14983 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14984   echo "$ac_t""yes" 1>&6
14985   :
14986 else
14987   echo "$ac_t""no" 1>&6
14988 fi
14989
14990         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14991                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14992         fi
14993         ol_enable_syslog=$ac_cv_func_openlog
14994 fi
14995
14996
14997 ol_link_sql=no
14998 if test $ol_enable_sql != no ; then
14999         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
15000 echo "configure:15001: checking for SQLDriverConnect in -liodbc" >&5
15001 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
15002 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15003   echo $ac_n "(cached) $ac_c" 1>&6
15004 else
15005   ac_save_LIBS="$LIBS"
15006 LIBS="-liodbc  $LIBS"
15007 cat > conftest.$ac_ext <<EOF
15008 #line 15009 "configure"
15009 #include "confdefs.h"
15010 /* Override any gcc2 internal prototype to avoid an error.  */
15011 /* We use char because int might match the return type of a gcc2
15012     builtin and then its argument prototype would still apply.  */
15013 char SQLDriverConnect();
15014
15015 int main() {
15016 SQLDriverConnect()
15017 ; return 0; }
15018 EOF
15019 if { (eval echo configure:15020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15020   rm -rf conftest*
15021   eval "ac_cv_lib_$ac_lib_var=yes"
15022 else
15023   echo "configure: failed program was:" >&5
15024   cat conftest.$ac_ext >&5
15025   rm -rf conftest*
15026   eval "ac_cv_lib_$ac_lib_var=no"
15027 fi
15028 rm -f conftest*
15029 LIBS="$ac_save_LIBS"
15030
15031 fi
15032 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15033   echo "$ac_t""yes" 1>&6
15034   have_iodbc=yes
15035 else
15036   echo "$ac_t""no" 1>&6
15037 have_iodbc=no
15038 fi
15039
15040         if test $have_iodbc = yes ; then
15041                 ol_link_sql="-liodbc"
15042         else
15043                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
15044 echo "configure:15045: checking for SQLDriverConnect in -lodbc" >&5
15045 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
15046 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15047   echo $ac_n "(cached) $ac_c" 1>&6
15048 else
15049   ac_save_LIBS="$LIBS"
15050 LIBS="-lodbc  $LIBS"
15051 cat > conftest.$ac_ext <<EOF
15052 #line 15053 "configure"
15053 #include "confdefs.h"
15054 /* Override any gcc2 internal prototype to avoid an error.  */
15055 /* We use char because int might match the return type of a gcc2
15056     builtin and then its argument prototype would still apply.  */
15057 char SQLDriverConnect();
15058
15059 int main() {
15060 SQLDriverConnect()
15061 ; return 0; }
15062 EOF
15063 if { (eval echo configure:15064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15064   rm -rf conftest*
15065   eval "ac_cv_lib_$ac_lib_var=yes"
15066 else
15067   echo "configure: failed program was:" >&5
15068   cat conftest.$ac_ext >&5
15069   rm -rf conftest*
15070   eval "ac_cv_lib_$ac_lib_var=no"
15071 fi
15072 rm -f conftest*
15073 LIBS="$ac_save_LIBS"
15074
15075 fi
15076 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15077   echo "$ac_t""yes" 1>&6
15078   have_odbc=yes
15079 else
15080   echo "$ac_t""no" 1>&6
15081 have_odbc=no
15082 fi
15083
15084                 if test $have_odbc = yes ; then
15085                         ol_link_sql="-lodbc"
15086                 fi
15087         fi
15088
15089         if test $ol_link_sql != no ; then
15090                 SLAPD_SQL_LIBS="$ol_link_sql"
15091
15092         elif test $ol_enable_sql != auto ; then
15093                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
15094         fi
15095 fi
15096
15097 if test $ol_enable_tcl != no ; then
15098         for ac_hdr in tcl.h
15099 do
15100 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15101 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15102 echo "configure:15103: checking for $ac_hdr" >&5
15103 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15104   echo $ac_n "(cached) $ac_c" 1>&6
15105 else
15106   cat > conftest.$ac_ext <<EOF
15107 #line 15108 "configure"
15108 #include "confdefs.h"
15109 #include <$ac_hdr>
15110 EOF
15111 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15112 { (eval echo configure:15113: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15113 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15114 if test -z "$ac_err"; then
15115   rm -rf conftest*
15116   eval "ac_cv_header_$ac_safe=yes"
15117 else
15118   echo "$ac_err" >&5
15119   echo "configure: failed program was:" >&5
15120   cat conftest.$ac_ext >&5
15121   rm -rf conftest*
15122   eval "ac_cv_header_$ac_safe=no"
15123 fi
15124 rm -f conftest*
15125 fi
15126 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15127   echo "$ac_t""yes" 1>&6
15128     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15129   cat >> confdefs.h <<EOF
15130 #define $ac_tr_hdr 1
15131 EOF
15132  
15133 else
15134   echo "$ac_t""no" 1>&6
15135 fi
15136 done
15137
15138
15139         if test $ac_cv_header_tcl_h != yes ; then
15140                 have_tcl=no
15141         else
15142                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
15143                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
15144 echo "configure:15145: checking for main in -l$lib" >&5
15145 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
15146 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15147   echo $ac_n "(cached) $ac_c" 1>&6
15148 else
15149   ac_save_LIBS="$LIBS"
15150 LIBS="-l$lib  $LIBS"
15151 cat > conftest.$ac_ext <<EOF
15152 #line 15153 "configure"
15153 #include "confdefs.h"
15154
15155 int main() {
15156 main()
15157 ; return 0; }
15158 EOF
15159 if { (eval echo configure:15160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15160   rm -rf conftest*
15161   eval "ac_cv_lib_$ac_lib_var=yes"
15162 else
15163   echo "configure: failed program was:" >&5
15164   cat conftest.$ac_ext >&5
15165   rm -rf conftest*
15166   eval "ac_cv_lib_$ac_lib_var=no"
15167 fi
15168 rm -f conftest*
15169 LIBS="$ac_save_LIBS"
15170
15171 fi
15172 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15173   echo "$ac_t""yes" 1>&6
15174   have_tcl=yes
15175                            if test x"$ol_with_tcl_module" = "xstatic" ; then
15176                                         SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
15177                            else
15178                                         MOD_TCL_LIB="-l${lib}"
15179                            fi;break
15180 else
15181   echo "$ac_t""no" 1>&6
15182 have_tcl=no
15183 fi
15184
15185                 done
15186         fi
15187
15188         if test $have_tcl != yes ; then
15189                 echo "configure: warning: could not find -ltcl" 1>&2
15190                 if test $ol_enable_tcl = yes ; then
15191                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
15192                 fi
15193
15194                 ol_enable_tcl=no
15195         fi
15196 fi
15197
15198 ol_link_termcap=no
15199 for ac_hdr in termcap.h ncurses.h
15200 do
15201 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15202 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15203 echo "configure:15204: checking for $ac_hdr" >&5
15204 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15205   echo $ac_n "(cached) $ac_c" 1>&6
15206 else
15207   cat > conftest.$ac_ext <<EOF
15208 #line 15209 "configure"
15209 #include "confdefs.h"
15210 #include <$ac_hdr>
15211 EOF
15212 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15213 { (eval echo configure:15214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15214 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15215 if test -z "$ac_err"; then
15216   rm -rf conftest*
15217   eval "ac_cv_header_$ac_safe=yes"
15218 else
15219   echo "$ac_err" >&5
15220   echo "configure: failed program was:" >&5
15221   cat conftest.$ac_ext >&5
15222   rm -rf conftest*
15223   eval "ac_cv_header_$ac_safe=no"
15224 fi
15225 rm -f conftest*
15226 fi
15227 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15228   echo "$ac_t""yes" 1>&6
15229     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15230   cat >> confdefs.h <<EOF
15231 #define $ac_tr_hdr 1
15232 EOF
15233  
15234 else
15235   echo "$ac_t""no" 1>&6
15236 fi
15237 done
15238
15239
15240 if test $ol_link_termcap = no ; then
15241         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
15242 echo "configure:15243: checking for tputs in -ltermcap" >&5
15243 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
15244 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15245   echo $ac_n "(cached) $ac_c" 1>&6
15246 else
15247   ac_save_LIBS="$LIBS"
15248 LIBS="-ltermcap  $LIBS"
15249 cat > conftest.$ac_ext <<EOF
15250 #line 15251 "configure"
15251 #include "confdefs.h"
15252 /* Override any gcc2 internal prototype to avoid an error.  */
15253 /* We use char because int might match the return type of a gcc2
15254     builtin and then its argument prototype would still apply.  */
15255 char tputs();
15256
15257 int main() {
15258 tputs()
15259 ; return 0; }
15260 EOF
15261 if { (eval echo configure:15262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15262   rm -rf conftest*
15263   eval "ac_cv_lib_$ac_lib_var=yes"
15264 else
15265   echo "configure: failed program was:" >&5
15266   cat conftest.$ac_ext >&5
15267   rm -rf conftest*
15268   eval "ac_cv_lib_$ac_lib_var=no"
15269 fi
15270 rm -f conftest*
15271 LIBS="$ac_save_LIBS"
15272
15273 fi
15274 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15275   echo "$ac_t""yes" 1>&6
15276   have_termcap=yes
15277 else
15278   echo "$ac_t""no" 1>&6
15279 have_termcap=no
15280 fi
15281
15282         if test $have_termcap = yes ; then
15283                 cat >> confdefs.h <<\EOF
15284 #define HAVE_TERMCAP 1
15285 EOF
15286
15287                 ol_link_termcap=yes
15288                 TERMCAP_LIBS=-ltermcap
15289         fi
15290 fi
15291
15292 if test $ol_link_termcap = no ; then
15293         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
15294 echo "configure:15295: checking for initscr in -lncurses" >&5
15295 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
15296 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15297   echo $ac_n "(cached) $ac_c" 1>&6
15298 else
15299   ac_save_LIBS="$LIBS"
15300 LIBS="-lncurses  $LIBS"
15301 cat > conftest.$ac_ext <<EOF
15302 #line 15303 "configure"
15303 #include "confdefs.h"
15304 /* Override any gcc2 internal prototype to avoid an error.  */
15305 /* We use char because int might match the return type of a gcc2
15306     builtin and then its argument prototype would still apply.  */
15307 char initscr();
15308
15309 int main() {
15310 initscr()
15311 ; return 0; }
15312 EOF
15313 if { (eval echo configure:15314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15314   rm -rf conftest*
15315   eval "ac_cv_lib_$ac_lib_var=yes"
15316 else
15317   echo "configure: failed program was:" >&5
15318   cat conftest.$ac_ext >&5
15319   rm -rf conftest*
15320   eval "ac_cv_lib_$ac_lib_var=no"
15321 fi
15322 rm -f conftest*
15323 LIBS="$ac_save_LIBS"
15324
15325 fi
15326 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15327   echo "$ac_t""yes" 1>&6
15328   have_ncurses=yes
15329 else
15330   echo "$ac_t""no" 1>&6
15331 have_ncurses=no
15332 fi
15333
15334         if test $have_ncurses = yes ; then
15335                 cat >> confdefs.h <<\EOF
15336 #define HAVE_NCURSES 1
15337 EOF
15338
15339                 ol_link_termcap=yes
15340                 TERMCAP_LIBS=-lncurses
15341         fi
15342 fi
15343
15344 if test $ol_link_termcap = no ; then
15345         cat >> confdefs.h <<\EOF
15346 #define NO_TERMCAP 1
15347 EOF
15348
15349         TERMCAP_LIBS=
15350 fi
15351
15352 ol_link_sasl=no
15353 ol_link_spasswd=no
15354 if test $ol_with_cyrus_sasl != no ; then
15355         for ac_hdr in sasl.h
15356 do
15357 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15358 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15359 echo "configure:15360: checking for $ac_hdr" >&5
15360 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15361   echo $ac_n "(cached) $ac_c" 1>&6
15362 else
15363   cat > conftest.$ac_ext <<EOF
15364 #line 15365 "configure"
15365 #include "confdefs.h"
15366 #include <$ac_hdr>
15367 EOF
15368 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15369 { (eval echo configure:15370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15370 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15371 if test -z "$ac_err"; then
15372   rm -rf conftest*
15373   eval "ac_cv_header_$ac_safe=yes"
15374 else
15375   echo "$ac_err" >&5
15376   echo "configure: failed program was:" >&5
15377   cat conftest.$ac_ext >&5
15378   rm -rf conftest*
15379   eval "ac_cv_header_$ac_safe=no"
15380 fi
15381 rm -f conftest*
15382 fi
15383 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15384   echo "$ac_t""yes" 1>&6
15385     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15386   cat >> confdefs.h <<EOF
15387 #define $ac_tr_hdr 1
15388 EOF
15389  
15390 else
15391   echo "$ac_t""no" 1>&6
15392 fi
15393 done
15394
15395
15396         if test $ac_cv_header_sasl_h = yes ; then
15397                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15398 echo "configure:15399: checking for sasl_client_init in -lsasl" >&5
15399 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15400 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15401   echo $ac_n "(cached) $ac_c" 1>&6
15402 else
15403   ac_save_LIBS="$LIBS"
15404 LIBS="-lsasl  $LIBS"
15405 cat > conftest.$ac_ext <<EOF
15406 #line 15407 "configure"
15407 #include "confdefs.h"
15408 /* Override any gcc2 internal prototype to avoid an error.  */
15409 /* We use char because int might match the return type of a gcc2
15410     builtin and then its argument prototype would still apply.  */
15411 char sasl_client_init();
15412
15413 int main() {
15414 sasl_client_init()
15415 ; return 0; }
15416 EOF
15417 if { (eval echo configure:15418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15418   rm -rf conftest*
15419   eval "ac_cv_lib_$ac_lib_var=yes"
15420 else
15421   echo "configure: failed program was:" >&5
15422   cat conftest.$ac_ext >&5
15423   rm -rf conftest*
15424   eval "ac_cv_lib_$ac_lib_var=no"
15425 fi
15426 rm -f conftest*
15427 LIBS="$ac_save_LIBS"
15428
15429 fi
15430 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15431   echo "$ac_t""yes" 1>&6
15432   have_cyrus_sasl=yes
15433 else
15434   echo "$ac_t""no" 1>&6
15435 have_cyrus_sasl=no
15436 fi
15437
15438
15439                 if test $have_cyrus_sasl != no ; then
15440                         SASL_LIBS="-lsasl"
15441                         cat >> confdefs.h <<\EOF
15442 #define HAVE_CYRUS_SASL 1
15443 EOF
15444
15445                         ol_link_sasl=yes
15446                 fi
15447         fi
15448
15449         if test $ol_link_sasl = no ; then
15450                 if test $ol_with_cyrus_sasl != auto ; then
15451                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15452                 else
15453                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15454                         echo "configure: warning: SASL authentication not supported!" 1>&2
15455                         if test $ol_link_tls = no ; then
15456                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15457                         fi
15458                 fi
15459
15460         elif test $ol_enable_spasswd != no ; then
15461                 ol_link_spasswd=yes
15462         fi
15463
15464 else
15465         echo "configure: warning: SASL authentication not supported!" 1>&2
15466         if test $ol_link_tls = no ; then
15467                 echo "configure: warning: Strong authentication not supported!" 1>&2
15468         fi
15469 fi
15470
15471 if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
15472         dev=no
15473         if test -r /dev/urandom ; then
15474                 dev="/dev/urandom";
15475         elif test -r /idev/urandom ; then
15476                 dev="/idev/urandom";
15477         elif test -r /dev/srandom ; then
15478                 dev="/dev/srandom";
15479         elif test -r /dev/random ; then
15480                 dev="/dev/random";
15481         elif test -r /idev/random ; then
15482                 dev="/idev/random";
15483         fi
15484
15485         if test $dev != no ; then
15486                 cat >> confdefs.h <<EOF
15487 #define URANDOM_DEVICE "$dev"
15488 EOF
15489
15490         fi
15491 fi
15492
15493 ol_link_fetch=no
15494 if test $ol_with_fetch != no ; then
15495         ol_LIBS=$LIBS
15496 LIBS="-lfetch -lcom_err $LIBS"
15497 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15498 echo "configure:15499: checking fetch(3) library" >&5
15499 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15500   echo $ac_n "(cached) $ac_c" 1>&6
15501 else
15502   
15503         cat > conftest.$ac_ext <<EOF
15504 #line 15505 "configure"
15505 #include "confdefs.h"
15506
15507 #include <sys/param.h>
15508 #include <stdio.h>
15509 #include <fetch.h>
15510 int main() {
15511 struct url *u = fetchParseURL("file:///"); 
15512 ; return 0; }
15513 EOF
15514 if { (eval echo configure:15515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15515   rm -rf conftest*
15516   ol_cv_lib_fetch=yes
15517 else
15518   echo "configure: failed program was:" >&5
15519   cat conftest.$ac_ext >&5
15520   rm -rf conftest*
15521   ol_cv_lib_fetch=no
15522 fi
15523 rm -f conftest*
15524 fi
15525
15526 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15527 LIBS=$ol_LIBS
15528 if test $ol_cv_lib_fetch != no ; then
15529         ol_link_fetch="-lfetch -lcom_err"
15530         cat >> confdefs.h <<\EOF
15531 #define HAVE_FETCH 1
15532 EOF
15533
15534 fi
15535
15536
15537         if test $ol_cv_lib_fetch != no ; then
15538                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15539                 ol_link_fetch=freebsd
15540
15541         elif test $ol_with_fetch != auto ; then
15542                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15543         fi 
15544 fi
15545
15546 ol_link_readline=no
15547 if test $ol_with_readline != no ; then
15548         for ac_hdr in readline/readline.h readline/history.h
15549 do
15550 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15551 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15552 echo "configure:15553: checking for $ac_hdr" >&5
15553 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15554   echo $ac_n "(cached) $ac_c" 1>&6
15555 else
15556   cat > conftest.$ac_ext <<EOF
15557 #line 15558 "configure"
15558 #include "confdefs.h"
15559 #include <$ac_hdr>
15560 EOF
15561 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15562 { (eval echo configure:15563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15563 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15564 if test -z "$ac_err"; then
15565   rm -rf conftest*
15566   eval "ac_cv_header_$ac_safe=yes"
15567 else
15568   echo "$ac_err" >&5
15569   echo "configure: failed program was:" >&5
15570   cat conftest.$ac_ext >&5
15571   rm -rf conftest*
15572   eval "ac_cv_header_$ac_safe=no"
15573 fi
15574 rm -f conftest*
15575 fi
15576 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15577   echo "$ac_t""yes" 1>&6
15578     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15579   cat >> confdefs.h <<EOF
15580 #define $ac_tr_hdr 1
15581 EOF
15582  
15583 else
15584   echo "$ac_t""no" 1>&6
15585 fi
15586 done
15587
15588
15589         if test $ac_cv_header_readline_readline_h = yes ; then
15590                 save_LIBS="$LIBS"
15591                 LIBS="$TERMCAP_LIBS $LIBS"
15592                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15593 echo "configure:15594: checking for readline in -lreadline" >&5
15594 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15595 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15596   echo $ac_n "(cached) $ac_c" 1>&6
15597 else
15598   ac_save_LIBS="$LIBS"
15599 LIBS="-lreadline  $LIBS"
15600 cat > conftest.$ac_ext <<EOF
15601 #line 15602 "configure"
15602 #include "confdefs.h"
15603 /* Override any gcc2 internal prototype to avoid an error.  */
15604 /* We use char because int might match the return type of a gcc2
15605     builtin and then its argument prototype would still apply.  */
15606 char readline();
15607
15608 int main() {
15609 readline()
15610 ; return 0; }
15611 EOF
15612 if { (eval echo configure:15613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15613   rm -rf conftest*
15614   eval "ac_cv_lib_$ac_lib_var=yes"
15615 else
15616   echo "configure: failed program was:" >&5
15617   cat conftest.$ac_ext >&5
15618   rm -rf conftest*
15619   eval "ac_cv_lib_$ac_lib_var=no"
15620 fi
15621 rm -f conftest*
15622 LIBS="$ac_save_LIBS"
15623
15624 fi
15625 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15626   echo "$ac_t""yes" 1>&6
15627   have_readline=yes
15628 else
15629   echo "$ac_t""no" 1>&6
15630 have_readline=no
15631 fi
15632
15633                 LIBS="$save_LIBS"
15634                         
15635                 if test $have_readline = yes ; then
15636                         ol_with_readline=found
15637                         ol_link_readline=yes
15638
15639                         READLINE_LIBS="-lreadline"
15640                 fi
15641         fi
15642 fi
15643
15644 if test $ol_link_readline = yes ; then
15645         cat >> confdefs.h <<\EOF
15646 #define HAVE_READLINE 1
15647 EOF
15648
15649 fi
15650
15651
15652 if test $ol_enable_crypt != no ; then
15653         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15654 echo "configure:15655: checking for crypt" >&5
15655 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15656   echo $ac_n "(cached) $ac_c" 1>&6
15657 else
15658   cat > conftest.$ac_ext <<EOF
15659 #line 15660 "configure"
15660 #include "confdefs.h"
15661 /* System header to define __stub macros and hopefully few prototypes,
15662     which can conflict with char crypt(); below.  */
15663 #include <assert.h>
15664 /* Override any gcc2 internal prototype to avoid an error.  */
15665 /* We use char because int might match the return type of a gcc2
15666     builtin and then its argument prototype would still apply.  */
15667 char crypt();
15668 char (*f)();
15669
15670 int main() {
15671
15672 /* The GNU C library defines this for functions which it implements
15673     to always fail with ENOSYS.  Some functions are actually named
15674     something starting with __ and the normal name is an alias.  */
15675 #if defined (__stub_crypt) || defined (__stub___crypt)
15676 choke me
15677 #else
15678 f = crypt;
15679 #endif
15680
15681 ; return 0; }
15682 EOF
15683 if { (eval echo configure:15684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15684   rm -rf conftest*
15685   eval "ac_cv_func_crypt=yes"
15686 else
15687   echo "configure: failed program was:" >&5
15688   cat conftest.$ac_ext >&5
15689   rm -rf conftest*
15690   eval "ac_cv_func_crypt=no"
15691 fi
15692 rm -f conftest*
15693 fi
15694
15695 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15696   echo "$ac_t""yes" 1>&6
15697   have_crypt=yes
15698 else
15699   echo "$ac_t""no" 1>&6
15700
15701                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15702 echo "configure:15703: checking for crypt in -lcrypt" >&5
15703 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15704 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15705   echo $ac_n "(cached) $ac_c" 1>&6
15706 else
15707   ac_save_LIBS="$LIBS"
15708 LIBS="-lcrypt  $LIBS"
15709 cat > conftest.$ac_ext <<EOF
15710 #line 15711 "configure"
15711 #include "confdefs.h"
15712 /* Override any gcc2 internal prototype to avoid an error.  */
15713 /* We use char because int might match the return type of a gcc2
15714     builtin and then its argument prototype would still apply.  */
15715 char crypt();
15716
15717 int main() {
15718 crypt()
15719 ; return 0; }
15720 EOF
15721 if { (eval echo configure:15722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15722   rm -rf conftest*
15723   eval "ac_cv_lib_$ac_lib_var=yes"
15724 else
15725   echo "configure: failed program was:" >&5
15726   cat conftest.$ac_ext >&5
15727   rm -rf conftest*
15728   eval "ac_cv_lib_$ac_lib_var=no"
15729 fi
15730 rm -f conftest*
15731 LIBS="$ac_save_LIBS"
15732
15733 fi
15734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15735   echo "$ac_t""yes" 1>&6
15736   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15737                         have_crypt=yes
15738 else
15739   echo "$ac_t""no" 1>&6
15740 have_crypt=no
15741 fi
15742
15743 fi
15744
15745
15746         if test $have_crypt = yes ; then
15747                 cat >> confdefs.h <<\EOF
15748 #define HAVE_CRYPT 1
15749 EOF
15750
15751         else
15752                 echo "configure: warning: could not find crypt" 1>&2
15753                 if test $ol_enable_crypt = yes ; then
15754                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15755                 fi
15756
15757                 echo "configure: warning: disabling crypt support" 1>&2
15758                 ol_enable_crypt=no
15759         fi
15760 fi
15761
15762 if test $ol_enable_proctitle != no ; then
15763         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15764 echo "configure:15765: checking for setproctitle" >&5
15765 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15766   echo $ac_n "(cached) $ac_c" 1>&6
15767 else
15768   cat > conftest.$ac_ext <<EOF
15769 #line 15770 "configure"
15770 #include "confdefs.h"
15771 /* System header to define __stub macros and hopefully few prototypes,
15772     which can conflict with char setproctitle(); below.  */
15773 #include <assert.h>
15774 /* Override any gcc2 internal prototype to avoid an error.  */
15775 /* We use char because int might match the return type of a gcc2
15776     builtin and then its argument prototype would still apply.  */
15777 char setproctitle();
15778 char (*f)();
15779
15780 int main() {
15781
15782 /* The GNU C library defines this for functions which it implements
15783     to always fail with ENOSYS.  Some functions are actually named
15784     something starting with __ and the normal name is an alias.  */
15785 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15786 choke me
15787 #else
15788 f = setproctitle;
15789 #endif
15790
15791 ; return 0; }
15792 EOF
15793 if { (eval echo configure:15794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15794   rm -rf conftest*
15795   eval "ac_cv_func_setproctitle=yes"
15796 else
15797   echo "configure: failed program was:" >&5
15798   cat conftest.$ac_ext >&5
15799   rm -rf conftest*
15800   eval "ac_cv_func_setproctitle=no"
15801 fi
15802 rm -f conftest*
15803 fi
15804
15805 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15806   echo "$ac_t""yes" 1>&6
15807   have_setproctitle=yes
15808 else
15809   echo "$ac_t""no" 1>&6
15810
15811                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15812 echo "configure:15813: checking for setproctitle in -lutil" >&5
15813 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15814 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15815   echo $ac_n "(cached) $ac_c" 1>&6
15816 else
15817   ac_save_LIBS="$LIBS"
15818 LIBS="-lutil  $LIBS"
15819 cat > conftest.$ac_ext <<EOF
15820 #line 15821 "configure"
15821 #include "confdefs.h"
15822 /* Override any gcc2 internal prototype to avoid an error.  */
15823 /* We use char because int might match the return type of a gcc2
15824     builtin and then its argument prototype would still apply.  */
15825 char setproctitle();
15826
15827 int main() {
15828 setproctitle()
15829 ; return 0; }
15830 EOF
15831 if { (eval echo configure:15832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15832   rm -rf conftest*
15833   eval "ac_cv_lib_$ac_lib_var=yes"
15834 else
15835   echo "configure: failed program was:" >&5
15836   cat conftest.$ac_ext >&5
15837   rm -rf conftest*
15838   eval "ac_cv_lib_$ac_lib_var=no"
15839 fi
15840 rm -f conftest*
15841 LIBS="$ac_save_LIBS"
15842
15843 fi
15844 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15845   echo "$ac_t""yes" 1>&6
15846   have_setproctitle=yes
15847                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15848 else
15849   echo "$ac_t""no" 1>&6
15850 have_setproctitle=no
15851                         LIBOBJS="$LIBOBJS setproctitle.o"
15852                         LIBSRCS="$LIBSRCS setproctitle.c"
15853 fi
15854
15855 fi
15856
15857
15858         if test $have_setproctitle = yes ; then
15859                 cat >> confdefs.h <<\EOF
15860 #define HAVE_SETPROCTITLE 1
15861 EOF
15862
15863         fi
15864 fi
15865
15866 if test $ol_enable_slp != no ; then
15867         for ac_hdr in slp.h 
15868 do
15869 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15870 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15871 echo "configure:15872: checking for $ac_hdr" >&5
15872 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15873   echo $ac_n "(cached) $ac_c" 1>&6
15874 else
15875   cat > conftest.$ac_ext <<EOF
15876 #line 15877 "configure"
15877 #include "confdefs.h"
15878 #include <$ac_hdr>
15879 EOF
15880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15881 { (eval echo configure:15882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15883 if test -z "$ac_err"; then
15884   rm -rf conftest*
15885   eval "ac_cv_header_$ac_safe=yes"
15886 else
15887   echo "$ac_err" >&5
15888   echo "configure: failed program was:" >&5
15889   cat conftest.$ac_ext >&5
15890   rm -rf conftest*
15891   eval "ac_cv_header_$ac_safe=no"
15892 fi
15893 rm -f conftest*
15894 fi
15895 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15896   echo "$ac_t""yes" 1>&6
15897     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15898   cat >> confdefs.h <<EOF
15899 #define $ac_tr_hdr 1
15900 EOF
15901  
15902 else
15903   echo "$ac_t""no" 1>&6
15904 fi
15905 done
15906
15907
15908         if test $ac_cv_header_slp_h = yes ; then
15909                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15910 echo "configure:15911: checking for SLPOpen in -lslp" >&5
15911 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15912 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15913   echo $ac_n "(cached) $ac_c" 1>&6
15914 else
15915   ac_save_LIBS="$LIBS"
15916 LIBS="-lslp  $LIBS"
15917 cat > conftest.$ac_ext <<EOF
15918 #line 15919 "configure"
15919 #include "confdefs.h"
15920 /* Override any gcc2 internal prototype to avoid an error.  */
15921 /* We use char because int might match the return type of a gcc2
15922     builtin and then its argument prototype would still apply.  */
15923 char SLPOpen();
15924
15925 int main() {
15926 SLPOpen()
15927 ; return 0; }
15928 EOF
15929 if { (eval echo configure:15930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15930   rm -rf conftest*
15931   eval "ac_cv_lib_$ac_lib_var=yes"
15932 else
15933   echo "configure: failed program was:" >&5
15934   cat conftest.$ac_ext >&5
15935   rm -rf conftest*
15936   eval "ac_cv_lib_$ac_lib_var=no"
15937 fi
15938 rm -f conftest*
15939 LIBS="$ac_save_LIBS"
15940
15941 fi
15942 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15943   echo "$ac_t""yes" 1>&6
15944   have_slp=yes
15945 else
15946   echo "$ac_t""no" 1>&6
15947 have_slp=no
15948 fi
15949
15950                 if test $have_slp = yes ; then
15951                         cat >> confdefs.h <<\EOF
15952 #define HAVE_SLP 1
15953 EOF
15954
15955                         SLAPD_SLP_LIBS=-lslp
15956                 fi
15957
15958         elif test $ol_enable_slp = yes ; then
15959                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15960         fi
15961 fi
15962
15963 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15964 echo "configure:15965: checking for ANSI C header files" >&5
15965 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15966   echo $ac_n "(cached) $ac_c" 1>&6
15967 else
15968   cat > conftest.$ac_ext <<EOF
15969 #line 15970 "configure"
15970 #include "confdefs.h"
15971 #include <stdlib.h>
15972 #include <stdarg.h>
15973 #include <string.h>
15974 #include <float.h>
15975 EOF
15976 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15977 { (eval echo configure:15978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15978 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15979 if test -z "$ac_err"; then
15980   rm -rf conftest*
15981   ac_cv_header_stdc=yes
15982 else
15983   echo "$ac_err" >&5
15984   echo "configure: failed program was:" >&5
15985   cat conftest.$ac_ext >&5
15986   rm -rf conftest*
15987   ac_cv_header_stdc=no
15988 fi
15989 rm -f conftest*
15990
15991 if test $ac_cv_header_stdc = yes; then
15992   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15993 cat > conftest.$ac_ext <<EOF
15994 #line 15995 "configure"
15995 #include "confdefs.h"
15996 #include <string.h>
15997 EOF
15998 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15999   egrep "memchr" >/dev/null 2>&1; then
16000   :
16001 else
16002   rm -rf conftest*
16003   ac_cv_header_stdc=no
16004 fi
16005 rm -f conftest*
16006
16007 fi
16008
16009 if test $ac_cv_header_stdc = yes; then
16010   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16011 cat > conftest.$ac_ext <<EOF
16012 #line 16013 "configure"
16013 #include "confdefs.h"
16014 #include <stdlib.h>
16015 EOF
16016 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16017   egrep "free" >/dev/null 2>&1; then
16018   :
16019 else
16020   rm -rf conftest*
16021   ac_cv_header_stdc=no
16022 fi
16023 rm -f conftest*
16024
16025 fi
16026
16027 if test $ac_cv_header_stdc = yes; then
16028   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16029 if test "$cross_compiling" = yes; then
16030   :
16031 else
16032   cat > conftest.$ac_ext <<EOF
16033 #line 16034 "configure"
16034 #include "confdefs.h"
16035 #include <ctype.h>
16036 #if ((' ' & 0x0FF) == 0x020)
16037 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16038 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16039 #else
16040 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16041  || ('j' <= (c) && (c) <= 'r') \
16042  || ('s' <= (c) && (c) <= 'z'))
16043 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16044 #endif
16045 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16046 int main () { int i; for (i = 0; i < 256; i++)
16047 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
16048 exit (0); }
16049
16050 EOF
16051 if { (eval echo configure:16052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16052 then
16053   :
16054 else
16055   echo "configure: failed program was:" >&5
16056   cat conftest.$ac_ext >&5
16057   rm -fr conftest*
16058   ac_cv_header_stdc=no
16059 fi
16060 rm -fr conftest*
16061 fi
16062
16063 fi
16064 fi
16065
16066 echo "$ac_t""$ac_cv_header_stdc" 1>&6
16067 if test $ac_cv_header_stdc = yes; then
16068   cat >> confdefs.h <<\EOF
16069 #define STDC_HEADERS 1
16070 EOF
16071
16072 fi
16073
16074 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
16075 echo "configure:16076: checking for mode_t" >&5
16076 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
16077   echo $ac_n "(cached) $ac_c" 1>&6
16078 else
16079   cat > conftest.$ac_ext <<EOF
16080 #line 16081 "configure"
16081 #include "confdefs.h"
16082 #include <sys/types.h>
16083 #if STDC_HEADERS
16084 #include <stdlib.h>
16085 #include <stddef.h>
16086 #endif
16087
16088 EOF
16089 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16090   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16091   rm -rf conftest*
16092   eval "ac_cv_type_mode_t=yes"
16093 else
16094   rm -rf conftest*
16095   eval "ac_cv_type_mode_t=no"
16096 fi
16097 rm -f conftest*
16098
16099 fi
16100 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
16101   echo "$ac_t""yes" 1>&6
16102 else
16103   echo "$ac_t""no" 1>&6
16104   cat >> confdefs.h <<EOF
16105 #define mode_t int
16106 EOF
16107
16108 fi
16109
16110 echo $ac_n "checking for off_t""... $ac_c" 1>&6
16111 echo "configure:16112: checking for off_t" >&5
16112 if eval "test \"\${ac_cv_type_off_t+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 #if STDC_HEADERS
16120 #include <stdlib.h>
16121 #include <stddef.h>
16122 #endif
16123
16124 EOF
16125 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16126   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16127   rm -rf conftest*
16128   eval "ac_cv_type_off_t=yes"
16129 else
16130   rm -rf conftest*
16131   eval "ac_cv_type_off_t=no"
16132 fi
16133 rm -f conftest*
16134
16135 fi
16136 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
16137   echo "$ac_t""yes" 1>&6
16138 else
16139   echo "$ac_t""no" 1>&6
16140   cat >> confdefs.h <<EOF
16141 #define off_t long
16142 EOF
16143
16144 fi
16145
16146 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
16147 echo "configure:16148: checking for pid_t" >&5
16148 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
16149   echo $ac_n "(cached) $ac_c" 1>&6
16150 else
16151   cat > conftest.$ac_ext <<EOF
16152 #line 16153 "configure"
16153 #include "confdefs.h"
16154 #include <sys/types.h>
16155 #if STDC_HEADERS
16156 #include <stdlib.h>
16157 #include <stddef.h>
16158 #endif
16159
16160 EOF
16161 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16162   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16163   rm -rf conftest*
16164   eval "ac_cv_type_pid_t=yes"
16165 else
16166   rm -rf conftest*
16167   eval "ac_cv_type_pid_t=no"
16168 fi
16169 rm -f conftest*
16170
16171 fi
16172 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
16173   echo "$ac_t""yes" 1>&6
16174 else
16175   echo "$ac_t""no" 1>&6
16176   cat >> confdefs.h <<EOF
16177 #define pid_t int
16178 EOF
16179
16180 fi
16181
16182 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
16183 echo "configure:16184: checking for ptrdiff_t" >&5
16184 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
16185   echo $ac_n "(cached) $ac_c" 1>&6
16186 else
16187   cat > conftest.$ac_ext <<EOF
16188 #line 16189 "configure"
16189 #include "confdefs.h"
16190 #include <stddef.h>
16191 int main() {
16192 ptrdiff_t p
16193 ; return 0; }
16194 EOF
16195 if { (eval echo configure:16196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16196   rm -rf conftest*
16197   am_cv_type_ptrdiff_t=yes
16198 else
16199   echo "configure: failed program was:" >&5
16200   cat conftest.$ac_ext >&5
16201   rm -rf conftest*
16202   am_cv_type_ptrdiff_t=no
16203 fi
16204 rm -f conftest*
16205 fi
16206
16207 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
16208    if test $am_cv_type_ptrdiff_t = yes; then
16209      cat >> confdefs.h <<\EOF
16210 #define HAVE_PTRDIFF_T 1
16211 EOF
16212
16213    fi
16214
16215 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
16216 echo "configure:16217: checking return type of signal handlers" >&5
16217 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
16218   echo $ac_n "(cached) $ac_c" 1>&6
16219 else
16220   cat > conftest.$ac_ext <<EOF
16221 #line 16222 "configure"
16222 #include "confdefs.h"
16223 #include <sys/types.h>
16224 #include <signal.h>
16225 #ifdef signal
16226 #undef signal
16227 #endif
16228 #ifdef __cplusplus
16229 extern "C" void (*signal (int, void (*)(int)))(int);
16230 #else
16231 void (*signal ()) ();
16232 #endif
16233
16234 int main() {
16235 int i;
16236 ; return 0; }
16237 EOF
16238 if { (eval echo configure:16239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16239   rm -rf conftest*
16240   ac_cv_type_signal=void
16241 else
16242   echo "configure: failed program was:" >&5
16243   cat conftest.$ac_ext >&5
16244   rm -rf conftest*
16245   ac_cv_type_signal=int
16246 fi
16247 rm -f conftest*
16248 fi
16249
16250 echo "$ac_t""$ac_cv_type_signal" 1>&6
16251 cat >> confdefs.h <<EOF
16252 #define RETSIGTYPE $ac_cv_type_signal
16253 EOF
16254
16255
16256 echo $ac_n "checking for size_t""... $ac_c" 1>&6
16257 echo "configure:16258: checking for size_t" >&5
16258 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
16259   echo $ac_n "(cached) $ac_c" 1>&6
16260 else
16261   cat > conftest.$ac_ext <<EOF
16262 #line 16263 "configure"
16263 #include "confdefs.h"
16264 #include <sys/types.h>
16265 #if STDC_HEADERS
16266 #include <stdlib.h>
16267 #include <stddef.h>
16268 #endif
16269
16270 EOF
16271 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16272   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16273   rm -rf conftest*
16274   eval "ac_cv_type_size_t=yes"
16275 else
16276   rm -rf conftest*
16277   eval "ac_cv_type_size_t=no"
16278 fi
16279 rm -f conftest*
16280
16281 fi
16282 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
16283   echo "$ac_t""yes" 1>&6
16284 else
16285   echo "$ac_t""no" 1>&6
16286   cat >> confdefs.h <<EOF
16287 #define size_t unsigned
16288 EOF
16289
16290 fi
16291
16292
16293 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
16294 echo "configure:16295: checking for ssize_t" >&5
16295 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
16296   echo $ac_n "(cached) $ac_c" 1>&6
16297 else
16298   cat > conftest.$ac_ext <<EOF
16299 #line 16300 "configure"
16300 #include "confdefs.h"
16301 #include <sys/types.h>
16302 #if STDC_HEADERS
16303 #include <stdlib.h>
16304 #include <stddef.h>
16305 #endif
16306
16307 EOF
16308 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16309   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16310   rm -rf conftest*
16311   eval "ac_cv_type_ssize_t=yes"
16312 else
16313   rm -rf conftest*
16314   eval "ac_cv_type_ssize_t=no"
16315 fi
16316 rm -f conftest*
16317
16318 fi
16319 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
16320   echo "$ac_t""yes" 1>&6
16321 else
16322   echo "$ac_t""no" 1>&6
16323   cat >> confdefs.h <<EOF
16324 #define ssize_t signed int
16325 EOF
16326
16327 fi
16328
16329 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16330 echo "configure:16331: checking for caddr_t" >&5
16331 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16332   echo $ac_n "(cached) $ac_c" 1>&6
16333 else
16334   cat > conftest.$ac_ext <<EOF
16335 #line 16336 "configure"
16336 #include "confdefs.h"
16337 #include <sys/types.h>
16338 #if STDC_HEADERS
16339 #include <stdlib.h>
16340 #include <stddef.h>
16341 #endif
16342
16343 EOF
16344 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16345   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16346   rm -rf conftest*
16347   eval "ac_cv_type_caddr_t=yes"
16348 else
16349   rm -rf conftest*
16350   eval "ac_cv_type_caddr_t=no"
16351 fi
16352 rm -f conftest*
16353
16354 fi
16355 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16356   echo "$ac_t""yes" 1>&6
16357 else
16358   echo "$ac_t""no" 1>&6
16359   cat >> confdefs.h <<EOF
16360 #define caddr_t char *
16361 EOF
16362
16363 fi
16364
16365
16366 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16367 echo "configure:16368: checking for socklen_t" >&5
16368 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16369   echo $ac_n "(cached) $ac_c" 1>&6
16370 else
16371   cat > conftest.$ac_ext <<EOF
16372 #line 16373 "configure"
16373 #include "confdefs.h"
16374
16375 #ifdef HAVE_SYS_TYPES_H
16376 #include <sys/types.h>
16377 #endif
16378 #ifdef HAVE_SYS_SOCKET_H
16379 #include <sys/socket.h>
16380 #endif
16381
16382 int main() {
16383 socklen_t len;
16384 ; return 0; }
16385 EOF
16386 if { (eval echo configure:16387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16387   rm -rf conftest*
16388   ol_cv_type_socklen_t=yes
16389 else
16390   echo "configure: failed program was:" >&5
16391   cat conftest.$ac_ext >&5
16392   rm -rf conftest*
16393   ol_cv_type_socklen_t=no
16394 fi
16395 rm -f conftest*
16396 fi
16397
16398 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16399   if test $ol_cv_type_socklen_t = no; then
16400     cat >> confdefs.h <<\EOF
16401 #define socklen_t int
16402 EOF
16403
16404   fi
16405  
16406 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16407 echo "configure:16408: checking for member st_blksize in aggregate type struct stat" >&5
16408 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16409   echo $ac_n "(cached) $ac_c" 1>&6
16410 else
16411   cat > conftest.$ac_ext <<EOF
16412 #line 16413 "configure"
16413 #include "confdefs.h"
16414 #include <sys/types.h>
16415 #include <sys/stat.h>
16416 int main() {
16417 struct stat foo; foo.st_blksize;
16418 ; return 0; }
16419 EOF
16420 if { (eval echo configure:16421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16421   rm -rf conftest*
16422   ac_cv_c_struct_member_st_blksize=yes
16423 else
16424   echo "configure: failed program was:" >&5
16425   cat conftest.$ac_ext >&5
16426   rm -rf conftest*
16427   ac_cv_c_struct_member_st_blksize=no
16428 fi
16429 rm -f conftest*
16430 fi
16431
16432 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16433 st_blksize="$ac_cv_c_struct_member_st_blksize"
16434 if test $ac_cv_c_struct_member_st_blksize = yes; then
16435   cat >> confdefs.h <<\EOF
16436 #define HAVE_ST_BLKSIZE 1
16437 EOF
16438
16439 fi
16440
16441 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16442 echo "configure:16443: checking whether time.h and sys/time.h may both be included" >&5
16443 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16444   echo $ac_n "(cached) $ac_c" 1>&6
16445 else
16446   cat > conftest.$ac_ext <<EOF
16447 #line 16448 "configure"
16448 #include "confdefs.h"
16449 #include <sys/types.h>
16450 #include <sys/time.h>
16451 #include <time.h>
16452 int main() {
16453 struct tm *tp;
16454 ; return 0; }
16455 EOF
16456 if { (eval echo configure:16457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16457   rm -rf conftest*
16458   ac_cv_header_time=yes
16459 else
16460   echo "configure: failed program was:" >&5
16461   cat conftest.$ac_ext >&5
16462   rm -rf conftest*
16463   ac_cv_header_time=no
16464 fi
16465 rm -f conftest*
16466 fi
16467
16468 echo "$ac_t""$ac_cv_header_time" 1>&6
16469 if test $ac_cv_header_time = yes; then
16470   cat >> confdefs.h <<\EOF
16471 #define TIME_WITH_SYS_TIME 1
16472 EOF
16473
16474 fi
16475
16476 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16477 echo "configure:16478: checking whether struct tm is in sys/time.h or time.h" >&5
16478 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16479   echo $ac_n "(cached) $ac_c" 1>&6
16480 else
16481   cat > conftest.$ac_ext <<EOF
16482 #line 16483 "configure"
16483 #include "confdefs.h"
16484 #include <sys/types.h>
16485 #include <time.h>
16486 int main() {
16487 struct tm *tp; tp->tm_sec;
16488 ; return 0; }
16489 EOF
16490 if { (eval echo configure:16491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16491   rm -rf conftest*
16492   ac_cv_struct_tm=time.h
16493 else
16494   echo "configure: failed program was:" >&5
16495   cat conftest.$ac_ext >&5
16496   rm -rf conftest*
16497   ac_cv_struct_tm=sys/time.h
16498 fi
16499 rm -f conftest*
16500 fi
16501
16502 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16503 if test $ac_cv_struct_tm = sys/time.h; then
16504   cat >> confdefs.h <<\EOF
16505 #define TM_IN_SYS_TIME 1
16506 EOF
16507
16508 fi
16509
16510 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16511 echo "configure:16512: checking for uid_t in sys/types.h" >&5
16512 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16513   echo $ac_n "(cached) $ac_c" 1>&6
16514 else
16515   cat > conftest.$ac_ext <<EOF
16516 #line 16517 "configure"
16517 #include "confdefs.h"
16518 #include <sys/types.h>
16519 EOF
16520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16521   egrep "uid_t" >/dev/null 2>&1; then
16522   rm -rf conftest*
16523   ac_cv_type_uid_t=yes
16524 else
16525   rm -rf conftest*
16526   ac_cv_type_uid_t=no
16527 fi
16528 rm -f conftest*
16529
16530 fi
16531
16532 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16533 if test $ac_cv_type_uid_t = no; then
16534   cat >> confdefs.h <<\EOF
16535 #define uid_t int
16536 EOF
16537
16538   cat >> confdefs.h <<\EOF
16539 #define gid_t int
16540 EOF
16541
16542 fi
16543
16544 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16545 echo "configure:16546: checking for sig_atomic_t" >&5
16546 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16547   echo $ac_n "(cached) $ac_c" 1>&6
16548 else
16549   cat > conftest.$ac_ext <<EOF
16550 #line 16551 "configure"
16551 #include "confdefs.h"
16552 #include <signal.h>
16553 int main() {
16554 sig_atomic_t atomic;
16555 ; return 0; }
16556 EOF
16557 if { (eval echo configure:16558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16558   rm -rf conftest*
16559   ol_cv_type_sig_atomic_t=yes
16560 else
16561   echo "configure: failed program was:" >&5
16562   cat conftest.$ac_ext >&5
16563   rm -rf conftest*
16564   ol_cv_type_sig_atomic_t=no
16565 fi
16566 rm -f conftest*
16567 fi
16568
16569 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16570   if test $ol_cv_type_sig_atomic_t = no; then
16571     cat >> confdefs.h <<\EOF
16572 #define sig_atomic_t int
16573 EOF
16574
16575   fi
16576  
16577
16578
16579 # test for pw_gecos in struct passwd
16580 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16581 echo "configure:16582: checking struct passwd for pw_gecos" >&5
16582 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16583   echo $ac_n "(cached) $ac_c" 1>&6
16584 else
16585   
16586         cat > conftest.$ac_ext <<EOF
16587 #line 16588 "configure"
16588 #include "confdefs.h"
16589 #include <pwd.h>
16590 int main() {
16591
16592         struct passwd pwd;
16593         pwd.pw_gecos = pwd.pw_name;
16594
16595 ; return 0; }
16596 EOF
16597 if { (eval echo configure:16598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16598   rm -rf conftest*
16599   ol_cv_struct_passwd_pw_gecos=yes
16600 else
16601   echo "configure: failed program was:" >&5
16602   cat conftest.$ac_ext >&5
16603   rm -rf conftest*
16604   ol_cv_struct_passwd_pw_gecos=no
16605 fi
16606 rm -f conftest*
16607 fi
16608
16609 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16610 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16611         cat >> confdefs.h <<\EOF
16612 #define HAVE_PW_GECOS 1
16613 EOF
16614
16615 fi
16616
16617 # test for pw_passwd in struct passwd
16618 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16619 echo "configure:16620: checking struct passwd for pw_passwd" >&5
16620 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16621   echo $ac_n "(cached) $ac_c" 1>&6
16622 else
16623   
16624         cat > conftest.$ac_ext <<EOF
16625 #line 16626 "configure"
16626 #include "confdefs.h"
16627 #include <pwd.h>
16628 int main() {
16629
16630         struct passwd pwd;
16631         pwd.pw_passwd = pwd.pw_name;
16632
16633 ; return 0; }
16634 EOF
16635 if { (eval echo configure:16636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16636   rm -rf conftest*
16637   ol_cv_struct_passwd_pw_passwd=yes
16638 else
16639   echo "configure: failed program was:" >&5
16640   cat conftest.$ac_ext >&5
16641   rm -rf conftest*
16642   ol_cv_struct_passwd_pw_passwd=no
16643 fi
16644 rm -f conftest*
16645 fi
16646
16647 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16648 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16649         cat >> confdefs.h <<\EOF
16650 #define HAVE_PW_PASSWD 1
16651 EOF
16652
16653 fi
16654
16655
16656 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16657 echo "configure:16658: checking if toupper() requires islower()" >&5
16658 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16659   echo $ac_n "(cached) $ac_c" 1>&6
16660 else
16661   
16662         if test "$cross_compiling" = yes; then
16663   ol_cv_c_upper_lower=safe
16664 else
16665   cat > conftest.$ac_ext <<EOF
16666 #line 16667 "configure"
16667 #include "confdefs.h"
16668
16669 #include <ctype.h>
16670 main()
16671 {
16672         if ('C' == toupper('C'))
16673                 exit(0);
16674         else
16675                 exit(1);
16676 }
16677 EOF
16678 if { (eval echo configure:16679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16679 then
16680   ol_cv_c_upper_lower=no
16681 else
16682   echo "configure: failed program was:" >&5
16683   cat conftest.$ac_ext >&5
16684   rm -fr conftest*
16685   ol_cv_c_upper_lower=yes
16686 fi
16687 rm -fr conftest*
16688 fi
16689
16690 fi
16691
16692 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16693 if test $ol_cv_c_upper_lower != no ; then
16694         cat >> confdefs.h <<\EOF
16695 #define C_UPPER_LOWER 1
16696 EOF
16697
16698 fi
16699
16700 echo $ac_n "checking for working const""... $ac_c" 1>&6
16701 echo "configure:16702: checking for working const" >&5
16702 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16703   echo $ac_n "(cached) $ac_c" 1>&6
16704 else
16705   cat > conftest.$ac_ext <<EOF
16706 #line 16707 "configure"
16707 #include "confdefs.h"
16708
16709 int main() {
16710
16711 /* Ultrix mips cc rejects this.  */
16712 typedef int charset[2]; const charset x;
16713 /* SunOS 4.1.1 cc rejects this.  */
16714 char const *const *ccp;
16715 char **p;
16716 /* NEC SVR4.0.2 mips cc rejects this.  */
16717 struct point {int x, y;};
16718 static struct point const zero = {0,0};
16719 /* AIX XL C 1.02.0.0 rejects this.
16720    It does not let you subtract one const X* pointer from another in an arm
16721    of an if-expression whose if-part is not a constant expression */
16722 const char *g = "string";
16723 ccp = &g + (g ? g-g : 0);
16724 /* HPUX 7.0 cc rejects these. */
16725 ++ccp;
16726 p = (char**) ccp;
16727 ccp = (char const *const *) p;
16728 { /* SCO 3.2v4 cc rejects this.  */
16729   char *t;
16730   char const *s = 0 ? (char *) 0 : (char const *) 0;
16731
16732   *t++ = 0;
16733 }
16734 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16735   int x[] = {25, 17};
16736   const int *foo = &x[0];
16737   ++foo;
16738 }
16739 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16740   typedef const int *iptr;
16741   iptr p = 0;
16742   ++p;
16743 }
16744 { /* AIX XL C 1.02.0.0 rejects this saying
16745      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16746   struct s { int j; const int *ap[3]; };
16747   struct s *b; b->j = 5;
16748 }
16749 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16750   const int foo = 10;
16751 }
16752
16753 ; return 0; }
16754 EOF
16755 if { (eval echo configure:16756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16756   rm -rf conftest*
16757   ac_cv_c_const=yes
16758 else
16759   echo "configure: failed program was:" >&5
16760   cat conftest.$ac_ext >&5
16761   rm -rf conftest*
16762   ac_cv_c_const=no
16763 fi
16764 rm -f conftest*
16765 fi
16766
16767 echo "$ac_t""$ac_cv_c_const" 1>&6
16768 if test $ac_cv_c_const = no; then
16769   cat >> confdefs.h <<\EOF
16770 #define const 
16771 EOF
16772
16773 fi
16774
16775 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16776 echo "configure:16777: checking if compiler understands volatile" >&5
16777 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16778   echo $ac_n "(cached) $ac_c" 1>&6
16779 else
16780   cat > conftest.$ac_ext <<EOF
16781 #line 16782 "configure"
16782 #include "confdefs.h"
16783 int x, y, z;
16784 int main() {
16785 volatile int a; int * volatile b = x ? &y : &z;
16786       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16787       *b = 0;
16788 ; return 0; }
16789 EOF
16790 if { (eval echo configure:16791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16791   rm -rf conftest*
16792   ol_cv_c_volatile=yes
16793 else
16794   echo "configure: failed program was:" >&5
16795   cat conftest.$ac_ext >&5
16796   rm -rf conftest*
16797   ol_cv_c_volatile=no
16798 fi
16799 rm -f conftest*
16800 fi
16801
16802 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16803   if test $ol_cv_c_volatile = yes; then
16804     : 
16805   else
16806     cat >> confdefs.h <<\EOF
16807 #define volatile 
16808 EOF
16809
16810   fi
16811  
16812
16813 if test $cross_compiling = yes ; then
16814         cat >> confdefs.h <<\EOF
16815 #define CROSS_COMPILING 1
16816 EOF
16817
16818 else
16819         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16820 echo "configure:16821: checking whether byte ordering is bigendian" >&5
16821 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16822   echo $ac_n "(cached) $ac_c" 1>&6
16823 else
16824   ac_cv_c_bigendian=unknown
16825 # See if sys/param.h defines the BYTE_ORDER macro.
16826 cat > conftest.$ac_ext <<EOF
16827 #line 16828 "configure"
16828 #include "confdefs.h"
16829 #include <sys/types.h>
16830 #include <sys/param.h>
16831 int main() {
16832
16833 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16834  bogus endian macros
16835 #endif
16836 ; return 0; }
16837 EOF
16838 if { (eval echo configure:16839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16839   rm -rf conftest*
16840   # It does; now see whether it defined to BIG_ENDIAN or not.
16841 cat > conftest.$ac_ext <<EOF
16842 #line 16843 "configure"
16843 #include "confdefs.h"
16844 #include <sys/types.h>
16845 #include <sys/param.h>
16846 int main() {
16847
16848 #if BYTE_ORDER != BIG_ENDIAN
16849  not big endian
16850 #endif
16851 ; return 0; }
16852 EOF
16853 if { (eval echo configure:16854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16854   rm -rf conftest*
16855   ac_cv_c_bigendian=yes
16856 else
16857   echo "configure: failed program was:" >&5
16858   cat conftest.$ac_ext >&5
16859   rm -rf conftest*
16860   ac_cv_c_bigendian=no
16861 fi
16862 rm -f conftest*
16863 else
16864   echo "configure: failed program was:" >&5
16865   cat conftest.$ac_ext >&5
16866 fi
16867 rm -f conftest*
16868 if test $ac_cv_c_bigendian = unknown; then
16869 if test "$cross_compiling" = yes; then
16870     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16871 else
16872   cat > conftest.$ac_ext <<EOF
16873 #line 16874 "configure"
16874 #include "confdefs.h"
16875 main () {
16876   /* Are we little or big endian?  From Harbison&Steele.  */
16877   union
16878   {
16879     long l;
16880     char c[sizeof (long)];
16881   } u;
16882   u.l = 1;
16883   exit (u.c[sizeof (long) - 1] == 1);
16884 }
16885 EOF
16886 if { (eval echo configure:16887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16887 then
16888   ac_cv_c_bigendian=no
16889 else
16890   echo "configure: failed program was:" >&5
16891   cat conftest.$ac_ext >&5
16892   rm -fr conftest*
16893   ac_cv_c_bigendian=yes
16894 fi
16895 rm -fr conftest*
16896 fi
16897
16898 fi
16899 fi
16900
16901 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16902 if test $ac_cv_c_bigendian = yes; then
16903   cat >> confdefs.h <<\EOF
16904 #define WORDS_BIGENDIAN 1
16905 EOF
16906
16907 fi
16908
16909 fi
16910
16911 echo $ac_n "checking size of short""... $ac_c" 1>&6
16912 echo "configure:16913: checking size of short" >&5 
16913 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16914   echo $ac_n "(cached) $ac_c" 1>&6
16915 else
16916   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16917   cat > conftest.$ac_ext <<EOF
16918 #line 16919 "configure"
16919 #include "confdefs.h"
16920 #include "confdefs.h" 
16921 #include <sys/types.h> 
16922  
16923
16924 int main() {
16925 switch (0) case 0: case (sizeof (short) == $ac_size):;
16926 ; return 0; }
16927 EOF
16928 if { (eval echo configure:16929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16929   rm -rf conftest*
16930   ac_cv_sizeof_short=$ac_size
16931 else
16932   echo "configure: failed program was:" >&5
16933   cat conftest.$ac_ext >&5
16934 fi
16935 rm -f conftest* 
16936   if test x$ac_cv_sizeof_short != x ; then break; fi 
16937 done 
16938
16939 fi
16940  
16941 if test x$ac_cv_sizeof_short = x ; then 
16942   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16943 fi 
16944 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16945 cat >> confdefs.h <<EOF
16946 #define SIZEOF_SHORT $ac_cv_sizeof_short
16947 EOF
16948  
16949  
16950 echo $ac_n "checking size of int""... $ac_c" 1>&6
16951 echo "configure:16952: checking size of int" >&5 
16952 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16953   echo $ac_n "(cached) $ac_c" 1>&6
16954 else
16955   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16956   cat > conftest.$ac_ext <<EOF
16957 #line 16958 "configure"
16958 #include "confdefs.h"
16959 #include "confdefs.h" 
16960 #include <sys/types.h> 
16961  
16962
16963 int main() {
16964 switch (0) case 0: case (sizeof (int) == $ac_size):;
16965 ; return 0; }
16966 EOF
16967 if { (eval echo configure:16968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16968   rm -rf conftest*
16969   ac_cv_sizeof_int=$ac_size
16970 else
16971   echo "configure: failed program was:" >&5
16972   cat conftest.$ac_ext >&5
16973 fi
16974 rm -f conftest* 
16975   if test x$ac_cv_sizeof_int != x ; then break; fi 
16976 done 
16977
16978 fi
16979  
16980 if test x$ac_cv_sizeof_int = x ; then 
16981   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16982 fi 
16983 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16984 cat >> confdefs.h <<EOF
16985 #define SIZEOF_INT $ac_cv_sizeof_int
16986 EOF
16987  
16988  
16989 echo $ac_n "checking size of long""... $ac_c" 1>&6
16990 echo "configure:16991: checking size of long" >&5 
16991 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16992   echo $ac_n "(cached) $ac_c" 1>&6
16993 else
16994   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16995   cat > conftest.$ac_ext <<EOF
16996 #line 16997 "configure"
16997 #include "confdefs.h"
16998 #include "confdefs.h" 
16999 #include <sys/types.h> 
17000  
17001
17002 int main() {
17003 switch (0) case 0: case (sizeof (long) == $ac_size):;
17004 ; return 0; }
17005 EOF
17006 if { (eval echo configure:17007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17007   rm -rf conftest*
17008   ac_cv_sizeof_long=$ac_size
17009 else
17010   echo "configure: failed program was:" >&5
17011   cat conftest.$ac_ext >&5
17012 fi
17013 rm -f conftest* 
17014   if test x$ac_cv_sizeof_long != x ; then break; fi 
17015 done 
17016
17017 fi
17018  
17019 if test x$ac_cv_sizeof_long = x ; then 
17020   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
17021 fi 
17022 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
17023 cat >> confdefs.h <<EOF
17024 #define SIZEOF_LONG $ac_cv_sizeof_long
17025 EOF
17026  
17027
17028
17029 if test "$ac_cv_sizeof_int" -lt 4 ; then
17030         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
17031
17032         cat >> confdefs.h <<\EOF
17033 #define LBER_INT_T long
17034 EOF
17035
17036 else
17037         cat >> confdefs.h <<\EOF
17038 #define LBER_INT_T int
17039 EOF
17040
17041 fi
17042
17043 cat >> confdefs.h <<\EOF
17044 #define LBER_LEN_T long
17045 EOF
17046
17047 cat >> confdefs.h <<\EOF
17048 #define LBER_SOCKET_T int
17049 EOF
17050
17051 cat >> confdefs.h <<\EOF
17052 #define LBER_TAG_T long
17053 EOF
17054
17055
17056 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
17057 echo "configure:17058: checking for 8-bit clean memcmp" >&5
17058 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
17059   echo $ac_n "(cached) $ac_c" 1>&6
17060 else
17061   if test "$cross_compiling" = yes; then
17062   ac_cv_func_memcmp_clean=no
17063 else
17064   cat > conftest.$ac_ext <<EOF
17065 #line 17066 "configure"
17066 #include "confdefs.h"
17067
17068 main()
17069 {
17070   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
17071   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
17072 }
17073
17074 EOF
17075 if { (eval echo configure:17076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
17076 then
17077   ac_cv_func_memcmp_clean=yes
17078 else
17079   echo "configure: failed program was:" >&5
17080   cat conftest.$ac_ext >&5
17081   rm -fr conftest*
17082   ac_cv_func_memcmp_clean=no
17083 fi
17084 rm -fr conftest*
17085 fi
17086
17087 fi
17088
17089 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
17090 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
17091
17092 echo $ac_n "checking for strftime""... $ac_c" 1>&6
17093 echo "configure:17094: checking for strftime" >&5
17094 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
17095   echo $ac_n "(cached) $ac_c" 1>&6
17096 else
17097   cat > conftest.$ac_ext <<EOF
17098 #line 17099 "configure"
17099 #include "confdefs.h"
17100 /* System header to define __stub macros and hopefully few prototypes,
17101     which can conflict with char strftime(); below.  */
17102 #include <assert.h>
17103 /* Override any gcc2 internal prototype to avoid an error.  */
17104 /* We use char because int might match the return type of a gcc2
17105     builtin and then its argument prototype would still apply.  */
17106 char strftime();
17107 char (*f)();
17108
17109 int main() {
17110
17111 /* The GNU C library defines this for functions which it implements
17112     to always fail with ENOSYS.  Some functions are actually named
17113     something starting with __ and the normal name is an alias.  */
17114 #if defined (__stub_strftime) || defined (__stub___strftime)
17115 choke me
17116 #else
17117 f = strftime;
17118 #endif
17119
17120 ; return 0; }
17121 EOF
17122 if { (eval echo configure:17123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17123   rm -rf conftest*
17124   eval "ac_cv_func_strftime=yes"
17125 else
17126   echo "configure: failed program was:" >&5
17127   cat conftest.$ac_ext >&5
17128   rm -rf conftest*
17129   eval "ac_cv_func_strftime=no"
17130 fi
17131 rm -f conftest*
17132 fi
17133
17134 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
17135   echo "$ac_t""yes" 1>&6
17136   cat >> confdefs.h <<\EOF
17137 #define HAVE_STRFTIME 1
17138 EOF
17139
17140 else
17141   echo "$ac_t""no" 1>&6
17142 # strftime is in -lintl on SCO UNIX.
17143 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
17144 echo "configure:17145: checking for strftime in -lintl" >&5
17145 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
17146 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
17147   echo $ac_n "(cached) $ac_c" 1>&6
17148 else
17149   ac_save_LIBS="$LIBS"
17150 LIBS="-lintl  $LIBS"
17151 cat > conftest.$ac_ext <<EOF
17152 #line 17153 "configure"
17153 #include "confdefs.h"
17154 /* Override any gcc2 internal prototype to avoid an error.  */
17155 /* We use char because int might match the return type of a gcc2
17156     builtin and then its argument prototype would still apply.  */
17157 char strftime();
17158
17159 int main() {
17160 strftime()
17161 ; return 0; }
17162 EOF
17163 if { (eval echo configure:17164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17164   rm -rf conftest*
17165   eval "ac_cv_lib_$ac_lib_var=yes"
17166 else
17167   echo "configure: failed program was:" >&5
17168   cat conftest.$ac_ext >&5
17169   rm -rf conftest*
17170   eval "ac_cv_lib_$ac_lib_var=no"
17171 fi
17172 rm -f conftest*
17173 LIBS="$ac_save_LIBS"
17174
17175 fi
17176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
17177   echo "$ac_t""yes" 1>&6
17178   cat >> confdefs.h <<\EOF
17179 #define HAVE_STRFTIME 1
17180 EOF
17181
17182 LIBS="-lintl $LIBS"
17183 else
17184   echo "$ac_t""no" 1>&6
17185 fi
17186
17187 fi
17188
17189
17190 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
17191 echo "configure:17192: checking for inet_aton()" >&5
17192 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
17193   echo $ac_n "(cached) $ac_c" 1>&6
17194 else
17195   cat > conftest.$ac_ext <<EOF
17196 #line 17197 "configure"
17197 #include "confdefs.h"
17198
17199 #ifdef HAVE_SYS_TYPES_H
17200 #       include <sys/types.h>
17201 #endif
17202 #ifdef HAVE_SYS_SOCKET_H
17203 #       include <sys/socket.h>
17204 #       ifdef HAVE_SYS_SELECT_H
17205 #               include <sys/select.h>
17206 #       endif
17207 #       include <netinet/in.h>
17208 #       ifdef HAVE_ARPA_INET_H
17209 #               include <arpa/inet.h>
17210 #       endif
17211 #endif
17212
17213 int main() {
17214 struct in_addr in;
17215 int rc = inet_aton( "255.255.255.255", &in );
17216 ; return 0; }
17217 EOF
17218 if { (eval echo configure:17219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17219   rm -rf conftest*
17220   ol_cv_func_inet_aton=yes
17221 else
17222   echo "configure: failed program was:" >&5
17223   cat conftest.$ac_ext >&5
17224   rm -rf conftest*
17225   ol_cv_func_inet_aton=no
17226 fi
17227 rm -f conftest*
17228 fi
17229
17230 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
17231   if test $ol_cv_func_inet_aton != no; then
17232     cat >> confdefs.h <<\EOF
17233 #define HAVE_INET_ATON 1
17234 EOF
17235
17236   fi
17237  
17238
17239 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
17240 echo "configure:17241: checking for _spawnlp" >&5
17241 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
17242   echo $ac_n "(cached) $ac_c" 1>&6
17243 else
17244   cat > conftest.$ac_ext <<EOF
17245 #line 17246 "configure"
17246 #include "confdefs.h"
17247 /* System header to define __stub macros and hopefully few prototypes,
17248     which can conflict with char _spawnlp(); below.  */
17249 #include <assert.h>
17250 /* Override any gcc2 internal prototype to avoid an error.  */
17251 /* We use char because int might match the return type of a gcc2
17252     builtin and then its argument prototype would still apply.  */
17253 char _spawnlp();
17254 char (*f)();
17255
17256 int main() {
17257
17258 /* The GNU C library defines this for functions which it implements
17259     to always fail with ENOSYS.  Some functions are actually named
17260     something starting with __ and the normal name is an alias.  */
17261 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
17262 choke me
17263 #else
17264 f = _spawnlp;
17265 #endif
17266
17267 ; return 0; }
17268 EOF
17269 if { (eval echo configure:17270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17270   rm -rf conftest*
17271   eval "ac_cv_func__spawnlp=yes"
17272 else
17273   echo "configure: failed program was:" >&5
17274   cat conftest.$ac_ext >&5
17275   rm -rf conftest*
17276   eval "ac_cv_func__spawnlp=no"
17277 fi
17278 rm -f conftest*
17279 fi
17280
17281 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
17282   echo "$ac_t""yes" 1>&6
17283   cat >> confdefs.h <<\EOF
17284 #define HAVE_SPAWNLP 1
17285 EOF
17286
17287 else
17288   echo "$ac_t""no" 1>&6
17289 fi
17290
17291
17292 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
17293 echo "configure:17294: checking for _snprintf" >&5
17294 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
17295   echo $ac_n "(cached) $ac_c" 1>&6
17296 else
17297   cat > conftest.$ac_ext <<EOF
17298 #line 17299 "configure"
17299 #include "confdefs.h"
17300 /* System header to define __stub macros and hopefully few prototypes,
17301     which can conflict with char _snprintf(); below.  */
17302 #include <assert.h>
17303 /* Override any gcc2 internal prototype to avoid an error.  */
17304 /* We use char because int might match the return type of a gcc2
17305     builtin and then its argument prototype would still apply.  */
17306 char _snprintf();
17307 char (*f)();
17308
17309 int main() {
17310
17311 /* The GNU C library defines this for functions which it implements
17312     to always fail with ENOSYS.  Some functions are actually named
17313     something starting with __ and the normal name is an alias.  */
17314 #if defined (__stub__snprintf) || defined (__stub____snprintf)
17315 choke me
17316 #else
17317 f = _snprintf;
17318 #endif
17319
17320 ; return 0; }
17321 EOF
17322 if { (eval echo configure:17323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17323   rm -rf conftest*
17324   eval "ac_cv_func__snprintf=yes"
17325 else
17326   echo "configure: failed program was:" >&5
17327   cat conftest.$ac_ext >&5
17328   rm -rf conftest*
17329   eval "ac_cv_func__snprintf=no"
17330 fi
17331 rm -f conftest*
17332 fi
17333
17334 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17335   echo "$ac_t""yes" 1>&6
17336   ac_cv_func_snprintf=yes
17337         cat >> confdefs.h <<\EOF
17338 #define snprintf _snprintf
17339 EOF
17340
17341
17342 else
17343   echo "$ac_t""no" 1>&6
17344 fi
17345
17346
17347 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17348 echo "configure:17349: checking for _vsnprintf" >&5
17349 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17350   echo $ac_n "(cached) $ac_c" 1>&6
17351 else
17352   cat > conftest.$ac_ext <<EOF
17353 #line 17354 "configure"
17354 #include "confdefs.h"
17355 /* System header to define __stub macros and hopefully few prototypes,
17356     which can conflict with char _vsnprintf(); below.  */
17357 #include <assert.h>
17358 /* Override any gcc2 internal prototype to avoid an error.  */
17359 /* We use char because int might match the return type of a gcc2
17360     builtin and then its argument prototype would still apply.  */
17361 char _vsnprintf();
17362 char (*f)();
17363
17364 int main() {
17365
17366 /* The GNU C library defines this for functions which it implements
17367     to always fail with ENOSYS.  Some functions are actually named
17368     something starting with __ and the normal name is an alias.  */
17369 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17370 choke me
17371 #else
17372 f = _vsnprintf;
17373 #endif
17374
17375 ; return 0; }
17376 EOF
17377 if { (eval echo configure:17378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17378   rm -rf conftest*
17379   eval "ac_cv_func__vsnprintf=yes"
17380 else
17381   echo "configure: failed program was:" >&5
17382   cat conftest.$ac_ext >&5
17383   rm -rf conftest*
17384   eval "ac_cv_func__vsnprintf=no"
17385 fi
17386 rm -f conftest*
17387 fi
17388
17389 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17390   echo "$ac_t""yes" 1>&6
17391   ac_cv_func_vsnprintf=yes
17392         cat >> confdefs.h <<\EOF
17393 #define vsnprintf _vsnprintf
17394 EOF
17395
17396
17397 else
17398   echo "$ac_t""no" 1>&6
17399 fi
17400
17401
17402 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17403 echo "configure:17404: checking for vprintf" >&5
17404 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17405   echo $ac_n "(cached) $ac_c" 1>&6
17406 else
17407   cat > conftest.$ac_ext <<EOF
17408 #line 17409 "configure"
17409 #include "confdefs.h"
17410 /* System header to define __stub macros and hopefully few prototypes,
17411     which can conflict with char vprintf(); below.  */
17412 #include <assert.h>
17413 /* Override any gcc2 internal prototype to avoid an error.  */
17414 /* We use char because int might match the return type of a gcc2
17415     builtin and then its argument prototype would still apply.  */
17416 char vprintf();
17417 char (*f)();
17418
17419 int main() {
17420
17421 /* The GNU C library defines this for functions which it implements
17422     to always fail with ENOSYS.  Some functions are actually named
17423     something starting with __ and the normal name is an alias.  */
17424 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17425 choke me
17426 #else
17427 f = vprintf;
17428 #endif
17429
17430 ; return 0; }
17431 EOF
17432 if { (eval echo configure:17433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17433   rm -rf conftest*
17434   eval "ac_cv_func_vprintf=yes"
17435 else
17436   echo "configure: failed program was:" >&5
17437   cat conftest.$ac_ext >&5
17438   rm -rf conftest*
17439   eval "ac_cv_func_vprintf=no"
17440 fi
17441 rm -f conftest*
17442 fi
17443
17444 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17445   echo "$ac_t""yes" 1>&6
17446   cat >> confdefs.h <<\EOF
17447 #define HAVE_VPRINTF 1
17448 EOF
17449
17450 else
17451   echo "$ac_t""no" 1>&6
17452 fi
17453
17454 if test "$ac_cv_func_vprintf" != yes; then
17455 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17456 echo "configure:17457: checking for _doprnt" >&5
17457 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17458   echo $ac_n "(cached) $ac_c" 1>&6
17459 else
17460   cat > conftest.$ac_ext <<EOF
17461 #line 17462 "configure"
17462 #include "confdefs.h"
17463 /* System header to define __stub macros and hopefully few prototypes,
17464     which can conflict with char _doprnt(); below.  */
17465 #include <assert.h>
17466 /* Override any gcc2 internal prototype to avoid an error.  */
17467 /* We use char because int might match the return type of a gcc2
17468     builtin and then its argument prototype would still apply.  */
17469 char _doprnt();
17470 char (*f)();
17471
17472 int main() {
17473
17474 /* The GNU C library defines this for functions which it implements
17475     to always fail with ENOSYS.  Some functions are actually named
17476     something starting with __ and the normal name is an alias.  */
17477 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17478 choke me
17479 #else
17480 f = _doprnt;
17481 #endif
17482
17483 ; return 0; }
17484 EOF
17485 if { (eval echo configure:17486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17486   rm -rf conftest*
17487   eval "ac_cv_func__doprnt=yes"
17488 else
17489   echo "configure: failed program was:" >&5
17490   cat conftest.$ac_ext >&5
17491   rm -rf conftest*
17492   eval "ac_cv_func__doprnt=no"
17493 fi
17494 rm -f conftest*
17495 fi
17496
17497 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17498   echo "$ac_t""yes" 1>&6
17499   cat >> confdefs.h <<\EOF
17500 #define HAVE_DOPRNT 1
17501 EOF
17502
17503 else
17504   echo "$ac_t""no" 1>&6
17505 fi
17506
17507 fi
17508
17509
17510 if test $ac_cv_func_vprintf = yes ; then
17511                 for ac_func in vsnprintf vsprintf
17512 do
17513 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17514 echo "configure:17515: checking for $ac_func" >&5
17515 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17516   echo $ac_n "(cached) $ac_c" 1>&6
17517 else
17518   cat > conftest.$ac_ext <<EOF
17519 #line 17520 "configure"
17520 #include "confdefs.h"
17521 /* System header to define __stub macros and hopefully few prototypes,
17522     which can conflict with char $ac_func(); below.  */
17523 #include <assert.h>
17524 /* Override any gcc2 internal prototype to avoid an error.  */
17525 /* We use char because int might match the return type of a gcc2
17526     builtin and then its argument prototype would still apply.  */
17527 char $ac_func();
17528 char (*f)();
17529
17530 int main() {
17531
17532 /* The GNU C library defines this for functions which it implements
17533     to always fail with ENOSYS.  Some functions are actually named
17534     something starting with __ and the normal name is an alias.  */
17535 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17536 choke me
17537 #else
17538 f = $ac_func;
17539 #endif
17540
17541 ; return 0; }
17542 EOF
17543 if { (eval echo configure:17544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17544   rm -rf conftest*
17545   eval "ac_cv_func_$ac_func=yes"
17546 else
17547   echo "configure: failed program was:" >&5
17548   cat conftest.$ac_ext >&5
17549   rm -rf conftest*
17550   eval "ac_cv_func_$ac_func=no"
17551 fi
17552 rm -f conftest*
17553 fi
17554
17555 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17556   echo "$ac_t""yes" 1>&6
17557     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17558   cat >> confdefs.h <<EOF
17559 #define $ac_tr_func 1
17560 EOF
17561  
17562 else
17563   echo "$ac_t""no" 1>&6
17564 fi
17565 done
17566
17567 fi
17568
17569 for ac_func in \
17570         bcopy                   \
17571         closesocket             \
17572         chroot                  \
17573         endgrent                \
17574         endpwent                \
17575         fcntl                   \
17576         flock                   \
17577         getdtablesize   \
17578         getgrgid                \
17579         gethostname             \
17580         getpass                 \
17581         getpassphrase   \
17582         getpwuid                \
17583         getpwnam                \
17584         getspnam                \
17585         gettimeofday    \
17586         initgroups              \
17587         lockf                   \
17588         memcpy                  \
17589         memmove                 \
17590         mkstemp                 \
17591         mktemp                  \
17592         pipe                    \
17593         read                    \
17594         recv                    \
17595         recvfrom                \
17596         setpwfile               \
17597         setgid                  \
17598         setegid                 \
17599         setsid                  \
17600         setuid                  \
17601         seteuid                 \
17602         sigaction               \
17603         signal                  \
17604         sigset                  \
17605         strdup                  \
17606         strerror                \
17607         strpbrk                 \
17608         strrchr                 \
17609         strsep                  \
17610         strstr                  \
17611         strtol                  \
17612         strtoul                 \
17613         strspn                  \
17614         sysconf                 \
17615         usleep                  \
17616         waitpid                 \
17617         wait4                   \
17618         write                   \
17619         send                    \
17620         sendto                  \
17621
17622 do
17623 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17624 echo "configure:17625: checking for $ac_func" >&5
17625 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17626   echo $ac_n "(cached) $ac_c" 1>&6
17627 else
17628   cat > conftest.$ac_ext <<EOF
17629 #line 17630 "configure"
17630 #include "confdefs.h"
17631 /* System header to define __stub macros and hopefully few prototypes,
17632     which can conflict with char $ac_func(); below.  */
17633 #include <assert.h>
17634 /* Override any gcc2 internal prototype to avoid an error.  */
17635 /* We use char because int might match the return type of a gcc2
17636     builtin and then its argument prototype would still apply.  */
17637 char $ac_func();
17638 char (*f)();
17639
17640 int main() {
17641
17642 /* The GNU C library defines this for functions which it implements
17643     to always fail with ENOSYS.  Some functions are actually named
17644     something starting with __ and the normal name is an alias.  */
17645 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17646 choke me
17647 #else
17648 f = $ac_func;
17649 #endif
17650
17651 ; return 0; }
17652 EOF
17653 if { (eval echo configure:17654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17654   rm -rf conftest*
17655   eval "ac_cv_func_$ac_func=yes"
17656 else
17657   echo "configure: failed program was:" >&5
17658   cat conftest.$ac_ext >&5
17659   rm -rf conftest*
17660   eval "ac_cv_func_$ac_func=no"
17661 fi
17662 rm -f conftest*
17663 fi
17664
17665 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17666   echo "$ac_t""yes" 1>&6
17667     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17668   cat >> confdefs.h <<EOF
17669 #define $ac_tr_func 1
17670 EOF
17671  
17672 else
17673   echo "$ac_t""no" 1>&6
17674 fi
17675 done
17676
17677
17678 for ac_func in getopt
17679 do
17680 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17681 echo "configure:17682: checking for $ac_func" >&5
17682 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17683   echo $ac_n "(cached) $ac_c" 1>&6
17684 else
17685   cat > conftest.$ac_ext <<EOF
17686 #line 17687 "configure"
17687 #include "confdefs.h"
17688 /* System header to define __stub macros and hopefully few prototypes,
17689     which can conflict with char $ac_func(); below.  */
17690 #include <assert.h>
17691 /* Override any gcc2 internal prototype to avoid an error.  */
17692 /* We use char because int might match the return type of a gcc2
17693     builtin and then its argument prototype would still apply.  */
17694 char $ac_func();
17695 char (*f)();
17696
17697 int main() {
17698
17699 /* The GNU C library defines this for functions which it implements
17700     to always fail with ENOSYS.  Some functions are actually named
17701     something starting with __ and the normal name is an alias.  */
17702 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17703 choke me
17704 #else
17705 f = $ac_func;
17706 #endif
17707
17708 ; return 0; }
17709 EOF
17710 if { (eval echo configure:17711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17711   rm -rf conftest*
17712   eval "ac_cv_func_$ac_func=yes"
17713 else
17714   echo "configure: failed program was:" >&5
17715   cat conftest.$ac_ext >&5
17716   rm -rf conftest*
17717   eval "ac_cv_func_$ac_func=no"
17718 fi
17719 rm -f conftest*
17720 fi
17721
17722 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17723   echo "$ac_t""yes" 1>&6
17724     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17725   cat >> confdefs.h <<EOF
17726 #define $ac_tr_func 1
17727 EOF
17728  
17729 else
17730   echo "$ac_t""no" 1>&6
17731 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17732 fi
17733 done
17734
17735
17736
17737 if test "$ac_cv_func_getopt" != yes; then
17738         LIBSRCS="$LIBSRCS getopt.c"
17739 fi
17740
17741 # Check Configuration
17742 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17743 echo "configure:17744: checking declaration of sys_errlist" >&5
17744 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17745   echo $ac_n "(cached) $ac_c" 1>&6
17746 else
17747   
17748         cat > conftest.$ac_ext <<EOF
17749 #line 17750 "configure"
17750 #include "confdefs.h"
17751
17752 #include <stdio.h>
17753 #include <sys/types.h>
17754 #include <errno.h>
17755 #ifdef WINNT
17756 #include <stdlib.h>
17757 #endif 
17758 int main() {
17759 char *c = (char *) *sys_errlist
17760 ; return 0; }
17761 EOF
17762 if { (eval echo configure:17763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17763   rm -rf conftest*
17764   ol_cv_dcl_sys_errlist=yes
17765         ol_cv_have_sys_errlist=yes
17766 else
17767   echo "configure: failed program was:" >&5
17768   cat conftest.$ac_ext >&5
17769   rm -rf conftest*
17770   ol_cv_dcl_sys_errlist=no
17771 fi
17772 rm -f conftest*
17773 fi
17774
17775 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17776 #
17777 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17778 if test $ol_cv_dcl_sys_errlist = no ; then
17779         cat >> confdefs.h <<\EOF
17780 #define DECL_SYS_ERRLIST 1
17781 EOF
17782
17783
17784         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17785 echo "configure:17786: checking existence of sys_errlist" >&5
17786 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17787   echo $ac_n "(cached) $ac_c" 1>&6
17788 else
17789   
17790                 cat > conftest.$ac_ext <<EOF
17791 #line 17792 "configure"
17792 #include "confdefs.h"
17793 #include <errno.h>
17794 int main() {
17795 char *c = (char *) *sys_errlist
17796 ; return 0; }
17797 EOF
17798 if { (eval echo configure:17799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17799   rm -rf conftest*
17800   ol_cv_have_sys_errlist=yes
17801 else
17802   echo "configure: failed program was:" >&5
17803   cat conftest.$ac_ext >&5
17804   rm -rf conftest*
17805   ol_cv_have_sys_errlist=no
17806 fi
17807 rm -f conftest*
17808 fi
17809
17810 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17811 fi
17812 if test $ol_cv_have_sys_errlist = yes ; then
17813         cat >> confdefs.h <<\EOF
17814 #define HAVE_SYS_ERRLIST 1
17815 EOF
17816
17817 fi
17818
17819
17820
17821 if test "$ol_enable_debug" != no ; then
17822         cat >> confdefs.h <<\EOF
17823 #define LDAP_DEBUG 1
17824 EOF
17825
17826 fi
17827 if test "$ol_enable_syslog" = yes ; then
17828         cat >> confdefs.h <<\EOF
17829 #define LDAP_SYSLOG 1
17830 EOF
17831
17832 fi
17833 if test "$ol_enable_cache" = no ; then
17834         cat >> confdefs.h <<\EOF
17835 #define LDAP_NOCACHE 1
17836 EOF
17837
17838 fi
17839 if test "$ol_link_kbind" != no ; then
17840         cat >> confdefs.h <<\EOF
17841 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17842 EOF
17843
17844 fi
17845 if test "$ol_enable_proctitle" != no ; then
17846         cat >> confdefs.h <<\EOF
17847 #define LDAP_PROCTITLE 1
17848 EOF
17849
17850 fi
17851 if test "$ol_enable_referrals" != no ; then
17852         cat >> confdefs.h <<\EOF
17853 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17854 EOF
17855
17856 fi
17857 if test "$ol_enable_local" != no; then
17858         cat >> confdefs.h <<\EOF
17859 #define LDAP_PF_LOCAL 1
17860 EOF
17861
17862 fi
17863 if test "$ol_link_ipv6" != no; then
17864         cat >> confdefs.h <<\EOF
17865 #define LDAP_PF_INET6 1
17866 EOF
17867
17868 fi
17869 if test "$ol_enable_cleartext" != no ; then
17870         cat >> confdefs.h <<\EOF
17871 #define SLAPD_CLEARTEXT 1
17872 EOF
17873
17874 fi
17875 if test "$ol_enable_crypt" != no ; then
17876         cat >> confdefs.h <<\EOF
17877 #define SLAPD_CRYPT 1
17878 EOF
17879
17880 fi
17881 if test "$ol_link_kpasswd" != no ; then
17882         cat >> confdefs.h <<\EOF
17883 #define SLAPD_KPASSWD 1
17884 EOF
17885
17886 fi
17887 if test "$ol_link_spasswd" != no ; then
17888         cat >> confdefs.h <<\EOF
17889 #define SLAPD_SPASSWD 1
17890 EOF
17891
17892 fi
17893 if test "$ol_enable_phonetic" != no ; then
17894         cat >> confdefs.h <<\EOF
17895 #define SLAPD_PHONETIC 1
17896 EOF
17897
17898 fi
17899 if test "$ol_enable_rlookups" != no ; then
17900         cat >> confdefs.h <<\EOF
17901 #define SLAPD_RLOOKUPS 1
17902 EOF
17903
17904 fi
17905 if test "$ol_enable_aci" != no ; then
17906         cat >> confdefs.h <<\EOF
17907 #define SLAPD_ACI_ENABLED 1
17908 EOF
17909
17910 fi
17911
17912 if test "$ol_link_modules" != no ; then
17913         cat >> confdefs.h <<\EOF
17914 #define SLAPD_MODULES 1
17915 EOF
17916
17917         BUILD_SLAPD=yes
17918         SLAPD_MODULES_LDFLAGS="-dlopen self"
17919 fi
17920
17921 if test "$ol_enable_bdb" != no ; then
17922         cat >> confdefs.h <<\EOF
17923 #define SLAPD_BDB 1
17924 EOF
17925
17926         BUILD_SLAPD=yes
17927         BUILD_BDB=yes
17928         if test "$ol_with_bdb_module" != static ; then
17929                 cat >> confdefs.h <<\EOF
17930 #define SLAPD_BDB_DYNAMIC 1
17931 EOF
17932
17933                 BUILD_BDB=mod
17934                 BUILD_BDB_DYNAMIC=shared
17935                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17936                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-bdb"
17937         else
17938                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-bdb"
17939         fi
17940 fi
17941
17942 if test "$ol_link_dnssrv" != no ; then
17943         cat >> confdefs.h <<\EOF
17944 #define SLAPD_DNSSRV 1
17945 EOF
17946
17947         BUILD_SLAPD=yes
17948         BUILD_DNSSRV=yes
17949         if test "$ol_with_dnssrv_module" != static ; then
17950                 cat >> confdefs.h <<\EOF
17951 #define SLAPD_DNSSRV_DYNAMIC 1
17952 EOF
17953
17954                 BUILD_DNSSRV=mod
17955                 BUILD_DNSSRV_DYNAMIC=shared
17956                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17957                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-dnssrv"
17958         else
17959                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-dnssrv"
17960         fi
17961 fi
17962
17963 if test "$ol_enable_ldap" != no ; then
17964         cat >> confdefs.h <<\EOF
17965 #define SLAPD_LDAP 1
17966 EOF
17967
17968         BUILD_SLAPD=yes
17969         BUILD_LDAP=yes
17970         if test "$ol_with_ldap_module" != static ; then
17971                 cat >> confdefs.h <<\EOF
17972 #define SLAPD_LDAP_DYNAMIC 1
17973 EOF
17974
17975                 BUILD_LDAP=mod
17976                 BUILD_LDAP_DYNAMIC=shared
17977                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17978                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldap"
17979         else
17980                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldap"
17981         fi
17982 fi
17983
17984 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17985         cat >> confdefs.h <<\EOF
17986 #define SLAPD_LDBM 1
17987 EOF
17988
17989         BUILD_SLAPD=yes
17990         BUILD_LDBM=yes
17991         LDBM_LIB="-lldbm"
17992         if test "$ol_with_ldbm_module" != static ; then
17993                 cat >> confdefs.h <<\EOF
17994 #define SLAPD_LDBM_DYNAMIC 1
17995 EOF
17996
17997                 BUILD_LDBM=mod
17998                 BUILD_LDBM_DYNAMIC=shared
17999                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
18000                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-ldbm"
18001         else
18002                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-ldbm"
18003         fi
18004 fi
18005
18006 if test "$ol_enable_meta" != no ; then
18007         if test "$ol_enable_ldap" = no ; then
18008                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
18009         fi
18010         if test "$ol_enable_rewrite" = no ; then
18011                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
18012         fi
18013         cat >> confdefs.h <<\EOF
18014 #define SLAPD_META 1
18015 EOF
18016
18017         BUILD_SLAPD=yes
18018         BUILD_META=yes
18019         if test "$ol_with_meta_module" != static ; then
18020                 cat >> confdefs.h <<\EOF
18021 #define SLAPD_META_DYNAMIC 1
18022 EOF
18023
18024                 BUILD_META=mod
18025                 BUILD_META_DYNAMIC=shared
18026                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
18027                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-meta"
18028         else
18029                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-meta"
18030         fi
18031 fi
18032
18033 if test "$ol_enable_monitor" != no ; then
18034         cat >> confdefs.h <<\EOF
18035 #define SLAPD_MONITOR 1
18036 EOF
18037
18038         BUILD_SLAPD=yes
18039         BUILD_MONITOR=yes
18040         if test "$ol_with_monitor_module" != static ; then
18041                 cat >> confdefs.h <<\EOF
18042 #define SLAPD_MONITOR_DYNAMIC 1
18043 EOF
18044
18045                 BUILD_MONITOR=mod
18046                 BUILD_MONITOR_DYNAMIC=shared
18047                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
18048                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-monitor"
18049         else
18050                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-monitor"
18051         fi
18052 fi
18053
18054 if test "$ol_enable_passwd" != no ; then
18055         cat >> confdefs.h <<\EOF
18056 #define SLAPD_PASSWD 1
18057 EOF
18058
18059         BUILD_SLAPD=yes
18060         BUILD_PASSWD=yes
18061         if test "$ol_with_passwd_module" != static ; then
18062                 cat >> confdefs.h <<\EOF
18063 #define SLAPD_PASSWD_DYNAMIC 1
18064 EOF
18065
18066                 BUILD_PASSWD=mod
18067                 BUILD_PASSWD_DYNAMIC=shared
18068                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
18069                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-passwd"
18070         else
18071                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-passwd"
18072         fi
18073 fi
18074
18075 if test "$ol_link_perl" != no ; then
18076         cat >> confdefs.h <<\EOF
18077 #define SLAPD_PERL 1
18078 EOF
18079
18080         BUILD_SLAPD=yes
18081         BUILD_PERL=yes
18082         if test "$ol_with_perl_module" != static ; then
18083                 cat >> confdefs.h <<\EOF
18084 #define SLAPD_PERL_DYNAMIC 1
18085 EOF
18086
18087                 BUILD_PERL=mod
18088                 BUILD_PERL_DYNAMIC=shared
18089                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
18090                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-perl"
18091         else
18092                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-perl"
18093         fi
18094 fi
18095
18096 if test "$ol_enable_shell" != no ; then
18097         cat >> confdefs.h <<\EOF
18098 #define SLAPD_SHELL 1
18099 EOF
18100
18101         BUILD_SLAPD=yes
18102         BUILD_SHELL=yes
18103         if test "$ol_with_shell_module" != static ; then
18104                 cat >> confdefs.h <<\EOF
18105 #define SLAPD_SHELL_DYNAMIC 1
18106 EOF
18107
18108                 BUILD_SHELL=mod
18109                 BUILD_SHELL_DYNAMIC=shared
18110                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
18111                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-shell"
18112         else
18113                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-shell"
18114         fi
18115 fi
18116
18117 if test "$ol_enable_tcl" != no ; then
18118         cat >> confdefs.h <<\EOF
18119 #define SLAPD_TCL 1
18120 EOF
18121
18122         BUILD_SLAPD=yes
18123         BUILD_TCL=yes
18124         if test "$ol_with_tcl_module" != static; then
18125                 cat >> confdefs.h <<\EOF
18126 #define SLAPD_TCL_DYNAMIC 1
18127 EOF
18128
18129                 BUILD_TCL=mod
18130                 BUILD_TCL_DYNAMIC=shared
18131                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
18132                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-tcl"
18133         else
18134                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-tcl"
18135         fi
18136 fi
18137
18138 if test "$ol_link_sql" != no ; then
18139         cat >> confdefs.h <<\EOF
18140 #define SLAPD_SQL 1
18141 EOF
18142
18143         BUILD_SLAPD=yes
18144         BUILD_SQL=yes
18145         if test "$ol_with_sql_module" != static; then
18146                 cat >> confdefs.h <<\EOF
18147 #define SLAPD_SQL_DYNAMIC 1
18148 EOF
18149
18150                 BUILD_SQL=mod
18151                 BUILD_SQL_DYNAMIC=shared
18152                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
18153                 SLAPD_DYNAMIC_BACKENDS="$SLAPD_DYNAMIC_BACKENDS back-sql"
18154         else
18155                 SLAPD_STATIC_BACKENDS="$SLAPD_STATIC_BACKENDS back-sql"
18156         fi
18157 fi
18158
18159 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
18160         $BUILD_SLAPD = yes ; then
18161         BUILD_SLURPD=yes
18162 fi
18163
18164 if test "$ol_enable_rewrite" != no ; then
18165         cat >> confdefs.h <<\EOF
18166 #define ENABLE_REWRITE 1
18167 EOF
18168
18169         BUILD_REWRITE=yes
18170         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
18171 fi
18172
18173
18174
18175 if test "$ac_cv_mingw32" = yes ; then
18176         PLAT=NT
18177         SLAPD_MODULES_LDFLAGS=
18178         SLAPD_MODULES_LIST=
18179 else
18180         PLAT=UNIX
18181 fi
18182
18183
18184
18185
18186
18187
18188   
18189   
18190   
18191   
18192   
18193   
18194   
18195   
18196   
18197   
18198   
18199   
18200   
18201   
18202   
18203   
18204   
18205   
18206   
18207   
18208   
18209   
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251 trap '' 1 2 15
18252
18253 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
18254
18255 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18256 # Let make expand exec_prefix.
18257 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18258
18259 # Any assignment to VPATH causes Sun make to only execute
18260 # the first set of double-colon rules, so remove it if not needed.
18261 # If there is a colon in the path, we need to keep it.
18262 if test "x$srcdir" = x.; then
18263   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
18264 fi
18265
18266 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
18267
18268 DEFS=-DHAVE_CONFIG_H
18269
18270 # Without the "./", some shells look in PATH for config.status.
18271 : ${CONFIG_STATUS=./config.status}
18272
18273 echo creating $CONFIG_STATUS
18274 rm -f $CONFIG_STATUS
18275 cat > $CONFIG_STATUS <<EOF
18276 #! /bin/sh
18277 # Generated automatically by configure.
18278 # Run this file to recreate the current configuration.
18279 # This directory was configured as follows,
18280 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18281 #
18282 # $0 $ac_configure_args
18283 #
18284 # Compiler output produced by configure, useful for debugging
18285 # configure, is in ./config.log if it exists.
18286
18287 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
18288 for ac_option
18289 do
18290   case "\$ac_option" in
18291   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18292     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
18293     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
18294   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
18295     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
18296     exit 0 ;;
18297   -help | --help | --hel | --he | --h)
18298     echo "\$ac_cs_usage"; exit 0 ;;
18299   *) echo "\$ac_cs_usage"; exit 1 ;;
18300   esac
18301 done
18302
18303 ac_given_srcdir=$srcdir
18304 ac_given_INSTALL="$INSTALL"
18305
18306 trap 'rm -fr `echo "\
18307 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18308 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18309 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18310 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18311 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18312 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18313 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18314 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18315 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18316 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18317 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18318 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18319 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18320 include/Makefile:build/top.mk:include/Makefile.in \
18321 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18322 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18323 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18324 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18325 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18326 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18327 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18328 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18329 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18330 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18331 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18332 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18333 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18334 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18335 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18336 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18337 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18338 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18339 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18340 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18341 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18342 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18343 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18344 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18345 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18346 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18347 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18348 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18349  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18350 EOF
18351 cat >> $CONFIG_STATUS <<EOF
18352
18353 # Protect against being on the right side of a sed subst in config.status.
18354 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18355  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18356 $ac_vpsub
18357 $extrasub
18358 s%@SHELL@%$SHELL%g
18359 s%@CFLAGS@%$CFLAGS%g
18360 s%@CPPFLAGS@%$CPPFLAGS%g
18361 s%@CXXFLAGS@%$CXXFLAGS%g
18362 s%@FFLAGS@%$FFLAGS%g
18363 s%@DEFS@%$DEFS%g
18364 s%@LDFLAGS@%$LDFLAGS%g
18365 s%@LIBS@%$LIBS%g
18366 s%@exec_prefix@%$exec_prefix%g
18367 s%@prefix@%$prefix%g
18368 s%@program_transform_name@%$program_transform_name%g
18369 s%@bindir@%$bindir%g
18370 s%@sbindir@%$sbindir%g
18371 s%@libexecdir@%$libexecdir%g
18372 s%@datadir@%$datadir%g
18373 s%@sysconfdir@%$sysconfdir%g
18374 s%@sharedstatedir@%$sharedstatedir%g
18375 s%@localstatedir@%$localstatedir%g
18376 s%@libdir@%$libdir%g
18377 s%@includedir@%$includedir%g
18378 s%@oldincludedir@%$oldincludedir%g
18379 s%@infodir@%$infodir%g
18380 s%@mandir@%$mandir%g
18381 s%@host@%$host%g
18382 s%@host_alias@%$host_alias%g
18383 s%@host_cpu@%$host_cpu%g
18384 s%@host_vendor@%$host_vendor%g
18385 s%@host_os@%$host_os%g
18386 s%@target@%$target%g
18387 s%@target_alias@%$target_alias%g
18388 s%@target_cpu@%$target_cpu%g
18389 s%@target_vendor@%$target_vendor%g
18390 s%@target_os@%$target_os%g
18391 s%@build@%$build%g
18392 s%@build_alias@%$build_alias%g
18393 s%@build_cpu@%$build_cpu%g
18394 s%@build_vendor@%$build_vendor%g
18395 s%@build_os@%$build_os%g
18396 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18397 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18398 s%@INSTALL_DATA@%$INSTALL_DATA%g
18399 s%@PACKAGE@%$PACKAGE%g
18400 s%@VERSION@%$VERSION%g
18401 s%@ACLOCAL@%$ACLOCAL%g
18402 s%@AUTOCONF@%$AUTOCONF%g
18403 s%@AUTOMAKE@%$AUTOMAKE%g
18404 s%@AUTOHEADER@%$AUTOHEADER%g
18405 s%@MAKEINFO@%$MAKEINFO%g
18406 s%@install_sh@%$install_sh%g
18407 s%@AMTAR@%$AMTAR%g
18408 s%@AWK@%$AWK%g
18409 s%@AMTARFLAGS@%$AMTARFLAGS%g
18410 s%@SET_MAKE@%$SET_MAKE%g
18411 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18412 s%@top_builddir@%$top_builddir%g
18413 s%@ldap_subdir@%$ldap_subdir%g
18414 s%@CC@%$CC%g
18415 s%@AR@%$AR%g
18416 s%@RANLIB@%$RANLIB%g
18417 s%@LN_S@%$LN_S%g
18418 s%@DLLTOOL@%$DLLTOOL%g
18419 s%@AS@%$AS%g
18420 s%@OBJDUMP@%$OBJDUMP%g
18421 s%@LIBTOOL@%$LIBTOOL%g
18422 s%@LN_H@%$LN_H%g
18423 s%@SENDMAIL@%$SENDMAIL%g
18424 s%@EDITOR@%$EDITOR%g
18425 s%@FINGER@%$FINGER%g
18426 s%@PERLBIN@%$PERLBIN%g
18427 s%@CPP@%$CPP%g
18428 s%@EXEEXT@%$EXEEXT%g
18429 s%@OBJEXT@%$OBJEXT%g
18430 s%@OL_MKDEP@%$OL_MKDEP%g
18431 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18432 s%@LIBOBJS@%$LIBOBJS%g
18433 s%@LIBSRCS@%$LIBSRCS%g
18434 s%@PLAT@%$PLAT%g
18435 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
18436 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18437 s%@BUILD_BDB@%$BUILD_BDB%g
18438 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18439 s%@BUILD_LDAP@%$BUILD_LDAP%g
18440 s%@BUILD_LDBM@%$BUILD_LDBM%g
18441 s%@BUILD_META@%$BUILD_META%g
18442 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18443 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18444 s%@BUILD_PERL@%$BUILD_PERL%g
18445 s%@BUILD_SHELL@%$BUILD_SHELL%g
18446 s%@BUILD_SQL@%$BUILD_SQL%g
18447 s%@BUILD_TCL@%$BUILD_TCL%g
18448 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18449 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18450 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18451 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18452 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18453 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18454 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18455 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18456 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18457 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18458 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18459 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18460 s%@LDBM_LIB@%$LDBM_LIB%g
18461 s%@LDAP_LIBS@%$LDAP_LIBS%g
18462 s%@LDIF_LIBS@%$LDIF_LIBS%g
18463 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18464 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18465 s%@LDBM_LIBS@%$LDBM_LIBS%g
18466 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18467 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18468 s%@WRAP_LIBS@%$WRAP_LIBS%g
18469 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18470 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18471 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18472 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18473 s%@SLAPD_STATIC_BACKENDS@%$SLAPD_STATIC_BACKENDS%g
18474 s%@SLAPD_DYNAMIC_BACKENDS@%$SLAPD_DYNAMIC_BACKENDS%g
18475 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18476 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18477 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18478 s%@KRB4_LIBS@%$KRB4_LIBS%g
18479 s%@KRB5_LIBS@%$KRB5_LIBS%g
18480 s%@READLINE_LIBS@%$READLINE_LIBS%g
18481 s%@SASL_LIBS@%$SASL_LIBS%g
18482 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18483 s%@TLS_LIBS@%$TLS_LIBS%g
18484 s%@MODULES_LIBS@%$MODULES_LIBS%g
18485 s%@AUTH_LIBS@%$AUTH_LIBS%g
18486 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18487 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18488 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18489 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18490
18491 CEOF
18492 EOF
18493
18494 cat >> $CONFIG_STATUS <<\EOF
18495
18496 # Split the substitutions into bite-sized pieces for seds with
18497 # small command number limits, like on Digital OSF/1 and HP-UX.
18498 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18499 ac_file=1 # Number of current file.
18500 ac_beg=1 # First line for current file.
18501 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18502 ac_more_lines=:
18503 ac_sed_cmds=""
18504 while $ac_more_lines; do
18505   if test $ac_beg -gt 1; then
18506     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18507   else
18508     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18509   fi
18510   if test ! -s conftest.s$ac_file; then
18511     ac_more_lines=false
18512     rm -f conftest.s$ac_file
18513   else
18514     if test -z "$ac_sed_cmds"; then
18515       ac_sed_cmds="sed -f conftest.s$ac_file"
18516     else
18517       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18518     fi
18519     ac_file=`expr $ac_file + 1`
18520     ac_beg=$ac_end
18521     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18522   fi
18523 done
18524 if test -z "$ac_sed_cmds"; then
18525   ac_sed_cmds=cat
18526 fi
18527 EOF
18528
18529 cat >> $CONFIG_STATUS <<EOF
18530
18531 CONFIG_FILES=\${CONFIG_FILES-"\
18532 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18533 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18534 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18535 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18536 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18537 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18538 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18539 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18540 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18541 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18542 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18543 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18544 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18545 include/Makefile:build/top.mk:include/Makefile.in \
18546 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18547 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18548 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18549 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18550 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18551 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18552 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18553 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18554 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18555 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk \
18556 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18557 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18558 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18559 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18560 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18561 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18562 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18563 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18564 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18565 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18566 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18567 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18568 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18569 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18570 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18571 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18572 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18573 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18574 "}
18575 EOF
18576 cat >> $CONFIG_STATUS <<\EOF
18577 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18578   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18579   case "$ac_file" in
18580   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18581        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18582   *) ac_file_in="${ac_file}.in" ;;
18583   esac
18584
18585   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18586
18587   # Remove last slash and all that follows it.  Not all systems have dirname.
18588   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18589   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18590     # The file is in a subdirectory.
18591     test ! -d "$ac_dir" && mkdir "$ac_dir"
18592     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18593     # A "../" for each directory in $ac_dir_suffix.
18594     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18595   else
18596     ac_dir_suffix= ac_dots=
18597   fi
18598
18599   case "$ac_given_srcdir" in
18600   .)  srcdir=.
18601       if test -z "$ac_dots"; then top_srcdir=.
18602       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18603   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18604   *) # Relative path.
18605     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18606     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18607   esac
18608
18609   case "$ac_given_INSTALL" in
18610   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18611   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18612   esac
18613
18614   echo creating "$ac_file"
18615   rm -f "$ac_file"
18616   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18617   case "$ac_file" in
18618   *[Mm]akefile*) ac_comsub="1i\\
18619 # $configure_input" ;;
18620   *) ac_comsub= ;;
18621   esac
18622
18623   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18624   sed -e "$ac_comsub
18625 s%@configure_input@%$configure_input%g
18626 s%@srcdir@%$srcdir%g
18627 s%@top_srcdir@%$top_srcdir%g
18628 s%@INSTALL@%$INSTALL%g
18629 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18630 fi; done
18631 rm -f conftest.s*
18632
18633 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18634 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18635 #
18636 # ac_d sets the value in "#define NAME VALUE" lines.
18637 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18638 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18639 ac_dC='\3'
18640 ac_dD='%g'
18641 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18642 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18643 ac_uB='\([      ]\)%\1#\2define\3'
18644 ac_uC=' '
18645 ac_uD='\4%g'
18646 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18647 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18648 ac_eB='$%\1#\2define\3'
18649 ac_eC=' '
18650 ac_eD='%g'
18651
18652 if test "${CONFIG_HEADERS+set}" != set; then
18653 EOF
18654 cat >> $CONFIG_STATUS <<EOF
18655   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18656 EOF
18657 cat >> $CONFIG_STATUS <<\EOF
18658 fi
18659 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18660   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18661   case "$ac_file" in
18662   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18663        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18664   *) ac_file_in="${ac_file}.in" ;;
18665   esac
18666
18667   echo creating $ac_file
18668
18669   rm -f conftest.frag conftest.in conftest.out
18670   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18671   cat $ac_file_inputs > conftest.in
18672
18673 EOF
18674
18675 # Transform confdefs.h into a sed script conftest.vals that substitutes
18676 # the proper values into config.h.in to produce config.h.  And first:
18677 # Protect against being on the right side of a sed subst in config.status.
18678 # Protect against being in an unquoted here document in config.status.
18679 rm -f conftest.vals
18680 cat > conftest.hdr <<\EOF
18681 s/[\\&%]/\\&/g
18682 s%[\\$`]%\\&%g
18683 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18684 s%ac_d%ac_u%gp
18685 s%ac_u%ac_e%gp
18686 EOF
18687 sed -n -f conftest.hdr confdefs.h > conftest.vals
18688 rm -f conftest.hdr
18689
18690 # This sed command replaces #undef with comments.  This is necessary, for
18691 # example, in the case of _POSIX_SOURCE, which is predefined and required
18692 # on some systems where configure will not decide to define it.
18693 cat >> conftest.vals <<\EOF
18694 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18695 EOF
18696
18697 # Break up conftest.vals because some shells have a limit on
18698 # the size of here documents, and old seds have small limits too.
18699
18700 rm -f conftest.tail
18701 while :
18702 do
18703   ac_lines=`grep -c . conftest.vals`
18704   # grep -c gives empty output for an empty file on some AIX systems.
18705   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18706   # Write a limited-size here document to conftest.frag.
18707   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18708   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18709   echo 'CEOF
18710   sed -f conftest.frag conftest.in > conftest.out
18711   rm -f conftest.in
18712   mv conftest.out conftest.in
18713 ' >> $CONFIG_STATUS
18714   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18715   rm -f conftest.vals
18716   mv conftest.tail conftest.vals
18717 done
18718 rm -f conftest.vals
18719
18720 cat >> $CONFIG_STATUS <<\EOF
18721   rm -f conftest.frag conftest.h
18722   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18723   cat conftest.in >> conftest.h
18724   rm -f conftest.in
18725   if cmp -s $ac_file conftest.h 2>/dev/null; then
18726     echo "$ac_file is unchanged"
18727     rm -f conftest.h
18728   else
18729     # Remove last slash and all that follows it.  Not all systems have dirname.
18730       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18731       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18732       # The file is in a subdirectory.
18733       test ! -d "$ac_dir" && mkdir "$ac_dir"
18734     fi
18735     rm -f $ac_file
18736     mv conftest.h $ac_file
18737   fi
18738 fi; done
18739
18740 EOF
18741 cat >> $CONFIG_STATUS <<EOF
18742
18743 EOF
18744 cat >> $CONFIG_STATUS <<\EOF
18745
18746 date > stamp-h
18747 echo Please \"make depend\" to build dependencies
18748
18749 exit 0
18750 EOF
18751 chmod +x $CONFIG_STATUS
18752 rm -fr confdefs* $ac_clean_files
18753 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18754