]> git.sur5r.net Git - openldap/blob - configure
autoconf for hyc
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.381 2001/12/07 03:03:25 hyc Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-rewrite        enable rewrite [no]"
48 ac_help="$ac_help
49   --enable-x-compile      enable cross compiling [no]"
50 ac_help="$ac_help
51   --with-cyrus-sasl       with Cyrus SASL support [auto]"
52 ac_help="$ac_help
53   --with-fetch            with fetch URL support [auto]"
54 ac_help="$ac_help
55   --with-kerberos         with Kerberos support [auto]"
56 ac_help="$ac_help
57   --with-readline         with readline support [auto]"
58 ac_help="$ac_help
59   --with-threads          with threads [auto]"
60 ac_help="$ac_help
61   --with-tls              with TLS/SSL support [auto]"
62 ac_help="$ac_help
63   --with-yielding-select  with implicitly yielding select [auto]"
64 ac_help="$ac_help
65 SLAPD (Standalone LDAP Daemon) Options:"
66 ac_help="$ac_help
67   --enable-slapd          enable building slapd [yes]"
68 ac_help="$ac_help
69     --enable-aci          enable per-object ACIs (experimental) [no]"
70 ac_help="$ac_help
71     --enable-cleartext    enable cleartext passwords [yes]"
72 ac_help="$ac_help
73     --enable-crypt        enable crypt(3) passwords [no]"
74 ac_help="$ac_help
75     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
76 ac_help="$ac_help
77     --enable-kpasswd      enable Kerberos password verification [no]"
78 ac_help="$ac_help
79     --enable-lmpasswd     enable LAN Manager passwords [no]"
80 ac_help="$ac_help
81     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
82 ac_help="$ac_help
83     --enable-modules      enable dynamic module support [no]"
84 ac_help="$ac_help
85     --enable-phonetic     enable phonetic/soundex [no]"
86 ac_help="$ac_help
87     --enable-rlookups     enable reverse lookups [no]"
88 ac_help="$ac_help
89     --enable-slp          enable SLPv2 support [no]"
90 ac_help="$ac_help
91     --enable-wrappers     enable tcp wrapper support [no]"
92 ac_help="$ac_help
93     --enable-bdb          enable Berkeley DB backend [no]"
94 ac_help="$ac_help
95     --with-bdb-module     module type [static]"
96 ac_help="$ac_help
97     --enable-dnssrv       enable dnssrv backend [no]"
98 ac_help="$ac_help
99     --with-dnssrv-module  module type [static]"
100 ac_help="$ac_help
101     --enable-ldap         enable ldap backend [no]"
102 ac_help="$ac_help
103     --with-ldap-module    module type [static]"
104 ac_help="$ac_help
105     --enable-ldbm         enable ldbm backend [yes]"
106 ac_help="$ac_help
107     --with-ldbm-api       with LDBM API [auto]"
108 ac_help="$ac_help
109     --with-ldbm-module    module type [static]"
110 ac_help="$ac_help
111     --with-ldbm-type      use LDBM type [auto]"
112 ac_help="$ac_help
113     --enable-meta         enable metadirectory backend [no]"
114 ac_help="$ac_help
115     --with-meta-module    module type [static]"
116 ac_help="$ac_help
117     --enable-monitor      enable monitor backend [no]"
118 ac_help="$ac_help
119     --with-monitor-module module type [static]"
120 ac_help="$ac_help
121     --enable-passwd       enable passwd backend [no]"
122 ac_help="$ac_help
123     --with-passwd-module  module type [static]"
124 ac_help="$ac_help
125     --enable-perl         enable perl backend [no]"
126 ac_help="$ac_help
127     --with-perl-module    module type [static]"
128 ac_help="$ac_help
129     --enable-shell        enable shell backend [no]"
130 ac_help="$ac_help
131     --with-shell-module   module type [static]"
132 ac_help="$ac_help
133     --enable-sql          enable sql backend [no]"
134 ac_help="$ac_help
135     --with-sql-module     module type [static]"
136 ac_help="$ac_help
137     --enable-tcl          enable tcl backend [no]"
138 ac_help="$ac_help
139     --with-tcl-module     module type [static]"
140 ac_help="$ac_help
141 SLURPD (Replication Daemon) Options:"
142 ac_help="$ac_help
143   --enable-slurpd         enable building slurpd [auto]"
144 ac_help="$ac_help
145 Library Generation & Linking Options"
146 ac_help="$ac_help
147   --enable-static[=PKGS]  build static libraries [default=yes]"
148 ac_help="$ac_help
149   --enable-shared[=PKGS]  build shared libraries [default=yes]"
150 ac_help="$ac_help
151   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
152 ac_help="$ac_help
153   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
154 ac_help="$ac_help
155   --disable-libtool-lock  avoid locking (might break parallel builds)"
156
157 # Initialize some variables set by options.
158 # The variables have the same names as the options, with
159 # dashes changed to underlines.
160 build=NONE
161 cache_file=./config.cache
162 exec_prefix=NONE
163 host=NONE
164 no_create=
165 nonopt=NONE
166 no_recursion=
167 prefix=NONE
168 program_prefix=NONE
169 program_suffix=NONE
170 program_transform_name=s,x,x,
171 silent=
172 site=
173 srcdir=
174 target=NONE
175 verbose=
176 x_includes=NONE
177 x_libraries=NONE
178 bindir='${exec_prefix}/bin'
179 sbindir='${exec_prefix}/sbin'
180 libexecdir='${exec_prefix}/libexec'
181 datadir='${prefix}/share'
182 sysconfdir='${prefix}/etc'
183 sharedstatedir='${prefix}/com'
184 localstatedir='${prefix}/var'
185 libdir='${exec_prefix}/lib'
186 includedir='${prefix}/include'
187 oldincludedir='/usr/include'
188 infodir='${prefix}/info'
189 mandir='${prefix}/man'
190
191 # Initialize some other variables.
192 subdirs=
193 MFLAGS= MAKEFLAGS=
194 SHELL=${CONFIG_SHELL-/bin/sh}
195 # Maximum number of lines to put in a shell here document.
196 ac_max_here_lines=12
197
198 ac_prev=
199 for ac_option
200 do
201
202   # If the previous option needs an argument, assign it.
203   if test -n "$ac_prev"; then
204     eval "$ac_prev=\$ac_option"
205     ac_prev=
206     continue
207   fi
208
209   case "$ac_option" in
210   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
211   *) ac_optarg= ;;
212   esac
213
214   # Accept the important Cygnus configure options, so we can diagnose typos.
215
216   case "$ac_option" in
217
218   -bindir | --bindir | --bindi | --bind | --bin | --bi)
219     ac_prev=bindir ;;
220   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
221     bindir="$ac_optarg" ;;
222
223   -build | --build | --buil | --bui | --bu)
224     ac_prev=build ;;
225   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
226     build="$ac_optarg" ;;
227
228   -cache-file | --cache-file | --cache-fil | --cache-fi \
229   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
230     ac_prev=cache_file ;;
231   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
232   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
233     cache_file="$ac_optarg" ;;
234
235   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
236     ac_prev=datadir ;;
237   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
238   | --da=*)
239     datadir="$ac_optarg" ;;
240
241   -disable-* | --disable-*)
242     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
243     # Reject names that are not valid shell variable names.
244     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
245       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
246     fi
247     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
248     eval "enable_${ac_feature}=no" ;;
249
250   -enable-* | --enable-*)
251     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
252     # Reject names that are not valid shell variable names.
253     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
254       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
255     fi
256     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
257     case "$ac_option" in
258       *=*) ;;
259       *) ac_optarg=yes ;;
260     esac
261     eval "enable_${ac_feature}='$ac_optarg'" ;;
262
263   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
264   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
265   | --exec | --exe | --ex)
266     ac_prev=exec_prefix ;;
267   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
268   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
269   | --exec=* | --exe=* | --ex=*)
270     exec_prefix="$ac_optarg" ;;
271
272   -gas | --gas | --ga | --g)
273     # Obsolete; use --with-gas.
274     with_gas=yes ;;
275
276   -help | --help | --hel | --he)
277     # Omit some internal or obsolete options to make the list less imposing.
278     # This message is too long to be a string in the A/UX 3.1 sh.
279     cat << EOF
280 Usage: configure [options] [host]
281 Options: [defaults in brackets after descriptions]
282 Configuration:
283   --cache-file=FILE       cache test results in FILE
284   --help                  print this message
285   --no-create             do not create output files
286   --quiet, --silent       do not print \`checking...' messages
287   --version               print the version of autoconf that created configure
288 Directory and file names:
289   --prefix=PREFIX         install architecture-independent files in PREFIX
290                           [$ac_default_prefix]
291   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
292                           [same as prefix]
293   --bindir=DIR            user executables in DIR [EPREFIX/bin]
294   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
295   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
296   --datadir=DIR           read-only architecture-independent data in DIR
297                           [PREFIX/share]
298   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
299   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
300                           [PREFIX/com]
301   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
302   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
303   --includedir=DIR        C header files in DIR [PREFIX/include]
304   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
305   --infodir=DIR           info documentation in DIR [PREFIX/info]
306   --mandir=DIR            man documentation in DIR [PREFIX/man]
307   --srcdir=DIR            find the sources in DIR [configure dir or ..]
308   --program-prefix=PREFIX prepend PREFIX to installed program names
309   --program-suffix=SUFFIX append SUFFIX to installed program names
310   --program-transform-name=PROGRAM
311                           run sed PROGRAM on installed program names
312 EOF
313     cat << EOF
314 Host type:
315   --build=BUILD           configure for building on BUILD [BUILD=HOST]
316   --host=HOST             configure for HOST [guessed]
317   --target=TARGET         configure for TARGET [TARGET=HOST]
318 Features and packages:
319   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
320   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
321   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
322   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
323   --x-includes=DIR        X include files are in DIR
324   --x-libraries=DIR       X library files are in DIR
325 EOF
326     if test -n "$ac_help"; then
327       echo "--enable and --with options recognized:$ac_help"
328     fi
329     exit 0 ;;
330
331   -host | --host | --hos | --ho)
332     ac_prev=host ;;
333   -host=* | --host=* | --hos=* | --ho=*)
334     host="$ac_optarg" ;;
335
336   -includedir | --includedir | --includedi | --included | --include \
337   | --includ | --inclu | --incl | --inc)
338     ac_prev=includedir ;;
339   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
340   | --includ=* | --inclu=* | --incl=* | --inc=*)
341     includedir="$ac_optarg" ;;
342
343   -infodir | --infodir | --infodi | --infod | --info | --inf)
344     ac_prev=infodir ;;
345   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
346     infodir="$ac_optarg" ;;
347
348   -libdir | --libdir | --libdi | --libd)
349     ac_prev=libdir ;;
350   -libdir=* | --libdir=* | --libdi=* | --libd=*)
351     libdir="$ac_optarg" ;;
352
353   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
354   | --libexe | --libex | --libe)
355     ac_prev=libexecdir ;;
356   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
357   | --libexe=* | --libex=* | --libe=*)
358     libexecdir="$ac_optarg" ;;
359
360   -localstatedir | --localstatedir | --localstatedi | --localstated \
361   | --localstate | --localstat | --localsta | --localst \
362   | --locals | --local | --loca | --loc | --lo)
363     ac_prev=localstatedir ;;
364   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
365   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
366   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
367     localstatedir="$ac_optarg" ;;
368
369   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
370     ac_prev=mandir ;;
371   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
372     mandir="$ac_optarg" ;;
373
374   -nfp | --nfp | --nf)
375     # Obsolete; use --without-fp.
376     with_fp=no ;;
377
378   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
379   | --no-cr | --no-c)
380     no_create=yes ;;
381
382   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
383   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
384     no_recursion=yes ;;
385
386   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
387   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
388   | --oldin | --oldi | --old | --ol | --o)
389     ac_prev=oldincludedir ;;
390   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
391   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
392   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
393     oldincludedir="$ac_optarg" ;;
394
395   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
396     ac_prev=prefix ;;
397   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
398     prefix="$ac_optarg" ;;
399
400   -program-prefix | --program-prefix | --program-prefi | --program-pref \
401   | --program-pre | --program-pr | --program-p)
402     ac_prev=program_prefix ;;
403   -program-prefix=* | --program-prefix=* | --program-prefi=* \
404   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
405     program_prefix="$ac_optarg" ;;
406
407   -program-suffix | --program-suffix | --program-suffi | --program-suff \
408   | --program-suf | --program-su | --program-s)
409     ac_prev=program_suffix ;;
410   -program-suffix=* | --program-suffix=* | --program-suffi=* \
411   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
412     program_suffix="$ac_optarg" ;;
413
414   -program-transform-name | --program-transform-name \
415   | --program-transform-nam | --program-transform-na \
416   | --program-transform-n | --program-transform- \
417   | --program-transform | --program-transfor \
418   | --program-transfo | --program-transf \
419   | --program-trans | --program-tran \
420   | --progr-tra | --program-tr | --program-t)
421     ac_prev=program_transform_name ;;
422   -program-transform-name=* | --program-transform-name=* \
423   | --program-transform-nam=* | --program-transform-na=* \
424   | --program-transform-n=* | --program-transform-=* \
425   | --program-transform=* | --program-transfor=* \
426   | --program-transfo=* | --program-transf=* \
427   | --program-trans=* | --program-tran=* \
428   | --progr-tra=* | --program-tr=* | --program-t=*)
429     program_transform_name="$ac_optarg" ;;
430
431   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
432   | -silent | --silent | --silen | --sile | --sil)
433     silent=yes ;;
434
435   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
436     ac_prev=sbindir ;;
437   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
438   | --sbi=* | --sb=*)
439     sbindir="$ac_optarg" ;;
440
441   -sharedstatedir | --sharedstatedir | --sharedstatedi \
442   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
443   | --sharedst | --shareds | --shared | --share | --shar \
444   | --sha | --sh)
445     ac_prev=sharedstatedir ;;
446   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
447   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
448   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
449   | --sha=* | --sh=*)
450     sharedstatedir="$ac_optarg" ;;
451
452   -site | --site | --sit)
453     ac_prev=site ;;
454   -site=* | --site=* | --sit=*)
455     site="$ac_optarg" ;;
456
457   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
458     ac_prev=srcdir ;;
459   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
460     srcdir="$ac_optarg" ;;
461
462   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
463   | --syscon | --sysco | --sysc | --sys | --sy)
464     ac_prev=sysconfdir ;;
465   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
466   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
467     sysconfdir="$ac_optarg" ;;
468
469   -target | --target | --targe | --targ | --tar | --ta | --t)
470     ac_prev=target ;;
471   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
472     target="$ac_optarg" ;;
473
474   -v | -verbose | --verbose | --verbos | --verbo | --verb)
475     verbose=yes ;;
476
477   -version | --version | --versio | --versi | --vers)
478     echo "configure generated by autoconf version 2.13.1"
479     exit 0 ;;
480
481   -with-* | --with-*)
482     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
483     # Reject names that are not valid shell variable names.
484     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
485       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
486     fi
487     ac_package=`echo $ac_package| sed 's/-/_/g'`
488     case "$ac_option" in
489       *=*) ;;
490       *) ac_optarg=yes ;;
491     esac
492     eval "with_${ac_package}='$ac_optarg'" ;;
493
494   -without-* | --without-*)
495     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
496     # Reject names that are not valid shell variable names.
497     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
498       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
499     fi
500     ac_package=`echo $ac_package| sed 's/-/_/g'`
501     eval "with_${ac_package}=no" ;;
502
503   --x)
504     # Obsolete; use --with-x.
505     with_x=yes ;;
506
507   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
508   | --x-incl | --x-inc | --x-in | --x-i)
509     ac_prev=x_includes ;;
510   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
511   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
512     x_includes="$ac_optarg" ;;
513
514   -x-libraries | --x-libraries | --x-librarie | --x-librari \
515   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
516     ac_prev=x_libraries ;;
517   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
518   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
519     x_libraries="$ac_optarg" ;;
520
521   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
522     ;;
523
524   *)
525     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
526       echo "configure: warning: $ac_option: invalid host type" 1>&2
527     fi
528     if test "x$nonopt" != xNONE; then
529       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
530     fi
531     nonopt="$ac_option"
532     ;;
533
534   esac
535 done
536
537 if test -n "$ac_prev"; then
538   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
539 fi
540
541 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
542
543 # File descriptor usage:
544 # 0 standard input
545 # 1 file creation
546 # 2 errors and warnings
547 # 3 some systems may open it to /dev/tty
548 # 4 used on the Kubota Titan
549 # 6 checking for... messages and results
550 # 5 compiler messages saved in config.log
551 if test "$silent" = yes; then
552   exec 6>/dev/null
553 else
554   exec 6>&1
555 fi
556 exec 5>./config.log
557
558 echo "\
559 This file contains any messages produced by compilers while
560 running configure, to aid debugging if configure makes a mistake.
561 " 1>&5
562
563 # Strip out --no-create and --no-recursion so they do not pile up.
564 # Also quote any args containing shell metacharacters.
565 ac_configure_args=
566 for ac_arg
567 do
568   case "$ac_arg" in
569   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
570   | --no-cr | --no-c) ;;
571   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
572   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
573   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
574   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
575   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
576   esac
577 done
578
579 # NLS nuisances.
580 # Only set these to C if already set.  These must not be set unconditionally
581 # because not all systems understand e.g. LANG=C (notably SCO).
582 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
583 # Non-C LC_CTYPE values break the ctype check.
584 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
585 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
586 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
587 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
588
589 # confdefs.h avoids OS command line length limits that DEFS can exceed.
590 rm -rf conftest* confdefs.h
591 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
592 echo > confdefs.h
593
594 # A filename unique to this package, relative to the directory that
595 # configure is in, which we can look for to find out if srcdir is correct.
596 ac_unique_file=build/version.sh
597
598 # Find the source files, if location was not specified.
599 if test -z "$srcdir"; then
600   ac_srcdir_defaulted=yes
601   # Try the directory containing this script, then its parent.
602   ac_prog=$0
603   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
604   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
605   srcdir=$ac_confdir
606   if test ! -r $srcdir/$ac_unique_file; then
607     srcdir=..
608   fi
609 else
610   ac_srcdir_defaulted=no
611 fi
612 if test ! -r $srcdir/$ac_unique_file; then
613   if test "$ac_srcdir_defaulted" = yes; then
614     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
615   else
616     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
617   fi
618 fi
619 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
620
621 # Prefer explicitly selected file to automatically selected ones.
622 if test -z "$CONFIG_SITE"; then
623   if test "x$prefix" != xNONE; then
624     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
625   else
626     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
627   fi
628 fi
629 for ac_site_file in $CONFIG_SITE; do
630   if test -r "$ac_site_file"; then
631     echo "loading site script $ac_site_file"
632     . "$ac_site_file"
633   fi
634 done
635
636
637 ac_ext=c
638 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
639 ac_cpp='$CPP $CPPFLAGS'
640 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
641 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
642 cross_compiling=$ac_cv_prog_cc_cross
643
644 ac_exeext=
645 ac_objext=o
646 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
647   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
648   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
649     ac_n= ac_c='
650 ' ac_t='        '
651   else
652     ac_n=-n ac_c= ac_t=
653   fi
654 else
655   ac_n= ac_c='\c' ac_t=
656 fi
657
658
659 # set unset (borrowed from autoconf 2.49c)
660 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
661   ol_unset=unset
662 else
663   ol_unset=false
664 fi
665 # unset CDPATH
666 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
667
668 ac_aux_dir=
669 for ac_dir in build $srcdir/build; do
670   if test -f $ac_dir/install-sh; then
671     ac_aux_dir=$ac_dir
672     ac_install_sh="$ac_aux_dir/install-sh -c"
673     break
674   elif test -f $ac_dir/install.sh; then
675     ac_aux_dir=$ac_dir
676     ac_install_sh="$ac_aux_dir/install.sh -c"
677     break
678   elif test -f $ac_dir/shtool; then
679     ac_aux_dir=$ac_dir
680     ac_install_sh="$ac_aux_dir/shtool install -c"
681     break
682   fi
683 done
684 if test -z "$ac_aux_dir"; then
685   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
686 fi
687 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
688 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
689 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
690
691 eval `$ac_aux_dir/version.sh`
692 if test -z "$OL_STRING"; then
693         { echo "configure: error: could not determine version" 1>&2; exit 1; }
694 fi
695
696 echo "Configuring $OL_STRING ..."
697
698
699 echo $ac_n "checking host system type""... $ac_c" 1>&6
700 echo "configure:701: checking host system type" >&5
701 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
702
703 # Make sure we can run config.sub.
704   if $ac_config_sub sun4 >/dev/null 2>&1; then :
705     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
706   fi
707
708   ac_cv_host_alias=$host
709   case "$ac_cv_host_alias" in
710   NONE)
711     case $nonopt in
712     NONE)
713       if ac_cv_host_alias=`$ac_config_guess`; then :
714       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
715       fi ;;
716     *) ac_cv_host_alias=$nonopt ;;
717     esac ;;
718   esac
719
720   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
721   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
722   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
723   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
724 else
725   echo $ac_n "(cached) $ac_c" 1>&6
726 fi
727
728 echo "$ac_t""$ac_cv_host" 1>&6
729
730 host=$ac_cv_host
731 host_alias=$ac_cv_host_alias
732 host_cpu=$ac_cv_host_cpu
733 host_vendor=$ac_cv_host_vendor
734 host_os=$ac_cv_host_os
735
736
737
738
739
740 echo $ac_n "checking target system type""... $ac_c" 1>&6
741 echo "configure:742: checking target system type" >&5
742 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
743
744 # Make sure we can run config.sub.
745   if $ac_config_sub sun4 >/dev/null 2>&1; then :
746     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
747   fi
748
749   ac_cv_target_alias=$target
750   case "$ac_cv_target_alias" in
751   NONE)
752     case $nonopt in
753     NONE)
754       ac_cv_target_alias=$host_alias ;;
755
756     *) ac_cv_target_alias=$nonopt ;;
757     esac ;;
758   esac
759
760   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
761   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
762   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
763   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
764 else
765   echo $ac_n "(cached) $ac_c" 1>&6
766 fi
767
768 echo "$ac_t""$ac_cv_target" 1>&6
769
770 target=$ac_cv_target
771 target_alias=$ac_cv_target_alias
772 target_cpu=$ac_cv_target_cpu
773 target_vendor=$ac_cv_target_vendor
774 target_os=$ac_cv_target_os
775
776
777
778
779
780 echo $ac_n "checking build system type""... $ac_c" 1>&6
781 echo "configure:782: checking build system type" >&5
782 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
783
784 # Make sure we can run config.sub.
785   if $ac_config_sub sun4 >/dev/null 2>&1; then :
786     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
787   fi
788
789   ac_cv_build_alias=$build
790   case "$ac_cv_build_alias" in
791   NONE)
792     case $nonopt in
793     NONE)
794       ac_cv_build_alias=$host_alias ;;
795
796     *) ac_cv_build_alias=$nonopt ;;
797     esac ;;
798   esac
799
800   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
801   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
802   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
803   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
804 else
805   echo $ac_n "(cached) $ac_c" 1>&6
806 fi
807
808 echo "$ac_t""$ac_cv_build" 1>&6
809
810 build=$ac_cv_build
811 build_alias=$ac_cv_build_alias
812 build_cpu=$ac_cv_build_cpu
813 build_vendor=$ac_cv_build_vendor
814 build_os=$ac_cv_build_os
815
816
817
818
819
820 # Do some error checking and defaulting for the host and target type.
821 # The inputs are:
822 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
823 #
824 # The rules are:
825 # 1. You are not allowed to specify --host, --target, and nonopt at the
826 #    same time.
827 # 2. Host defaults to nonopt.
828 # 3. If nonopt is not specified, then host defaults to the current host,
829 #    as determined by config.guess.
830 # 4. Target and build default to nonopt.
831 # 5. If nonopt is not specified, then target and build default to host.
832
833 # The aliases save the names the user supplied, while $host etc.
834 # will get canonicalized.
835 case $host---$target---$nonopt in
836 NONE---*---* | *---NONE---* | *---*---NONE) ;;
837 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
838 esac
839
840 test "$host_alias" != "$target_alias" &&
841   test "$program_prefix$program_suffix$program_transform_name" = \
842     NONENONEs,x,x, &&
843   program_prefix=${target_alias}-
844
845
846 # Find a good install program.  We prefer a C program (faster),
847 # so one script is as good as another.  But avoid the broken or
848 # incompatible versions:
849 # SysV /etc/install, /usr/sbin/install
850 # SunOS /usr/etc/install
851 # IRIX /sbin/install
852 # AIX /bin/install
853 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
854 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
855 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
856 # ./install, which can be erroneously created by make from ./install.sh.
857 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
858 echo "configure:859: checking for a BSD compatible install" >&5
859 if test -z "$INSTALL"; then
860 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
861   echo $ac_n "(cached) $ac_c" 1>&6
862 else
863     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
864   for ac_dir in $PATH; do
865     # Account for people who put trailing slashes in PATH elements.
866     case "$ac_dir/" in
867     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
868     *)
869       # OSF1 and SCO ODT 3.0 have their own names for install.
870       # Don't use installbsd from OSF since it installs stuff as root
871       # by default.
872       for ac_prog in ginstall scoinst install; do
873         if test -f $ac_dir/$ac_prog; then
874           if test $ac_prog = install &&
875             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
876             # AIX install.  It has an incompatible calling convention.
877             :
878           elif test $ac_prog = install &&
879             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
880             # program-specific install script used by HP pwplus--don't use.
881             :
882           else
883             ac_cv_path_install="$ac_dir/$ac_prog -c"
884             break 2
885           fi
886         fi
887       done
888       ;;
889     esac
890   done
891   IFS="$ac_save_IFS"
892
893 fi
894   if test "${ac_cv_path_install+set}" = set; then
895     INSTALL="$ac_cv_path_install"
896   else
897     # As a last resort, use the slow shell script.  We don't cache a
898     # path for INSTALL within a source directory, because that will
899     # break other packages using the cache if that directory is
900     # removed, or if the path is relative.
901     INSTALL="$ac_install_sh"
902   fi
903 fi
904 echo "$ac_t""$INSTALL" 1>&6
905
906 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
907 # It thinks the first close brace ends the variable substitution.
908 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
909
910 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
911
912 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
913
914 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
915 echo "configure:916: checking whether build environment is sane" >&5
916 # Just in case
917 sleep 1
918 echo timestamp > conftestfile
919 # Do `set' in a subshell so we don't clobber the current shell's
920 # arguments.  Must try -L first in case configure is actually a
921 # symlink; some systems play weird games with the mod time of symlinks
922 # (eg FreeBSD returns the mod time of the symlink's containing
923 # directory).
924 if (
925    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
926    if test "$*" = "X"; then
927       # -L didn't work.
928       set X `ls -t $srcdir/configure conftestfile`
929    fi
930    if test "$*" != "X $srcdir/configure conftestfile" \
931       && test "$*" != "X conftestfile $srcdir/configure"; then
932
933       # If neither matched, then we have a broken ls.  This can happen
934       # if, for instance, CONFIG_SHELL is bash and it inherits a
935       # broken ls alias from the environment.  This has actually
936       # happened.  Such a system could not be considered "sane".
937       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
938 alias in your environment" 1>&2; exit 1; }
939    fi
940
941    test "$2" = conftestfile
942    )
943 then
944    # Ok.
945    :
946 else
947    { echo "configure: error: newly created file is older than distributed files!
948 Check your system clock" 1>&2; exit 1; }
949 fi
950 rm -f conftest*
951 echo "$ac_t""yes" 1>&6
952 if test "$program_transform_name" = s,x,x,; then
953   program_transform_name=
954 else
955   # Double any \ or $.  echo might interpret backslashes.
956   cat <<\EOF_SED > conftestsed
957 s,\\,\\\\,g; s,\$,$$,g
958 EOF_SED
959   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
960   rm -f conftestsed
961 fi
962 test "$program_prefix" != NONE &&
963   program_transform_name="s,^,${program_prefix},;$program_transform_name"
964 # Use a double $ so make ignores it.
965 test "$program_suffix" != NONE &&
966   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
967
968 # sed with no file args requires a program.
969 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
970
971 for ac_prog in mawk gawk nawk awk
972 do
973 # Extract the first word of "$ac_prog", so it can be a program name with args.
974 set dummy $ac_prog; ac_word=$2
975 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
976 echo "configure:977: checking for $ac_word" >&5
977 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
978   echo $ac_n "(cached) $ac_c" 1>&6
979 else
980   if test -n "$AWK"; then
981   ac_cv_prog_AWK="$AWK" # Let the user override the test.
982 else
983   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
984   ac_dummy="$PATH"
985   for ac_dir in $ac_dummy; do
986     test -z "$ac_dir" && ac_dir=.
987     if test -f $ac_dir/$ac_word; then
988       ac_cv_prog_AWK="$ac_prog"
989       break
990     fi
991   done
992   IFS="$ac_save_ifs"
993 fi
994 fi
995 AWK="$ac_cv_prog_AWK"
996 if test -n "$AWK"; then
997   echo "$ac_t""$AWK" 1>&6
998 else
999   echo "$ac_t""no" 1>&6
1000 fi
1001
1002 test -n "$AWK" && break
1003 done
1004
1005 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether ${MAKE-make} sets \${MAKE}" >&5
1007 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1008 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1009   echo $ac_n "(cached) $ac_c" 1>&6
1010 else
1011   cat > conftestmake <<\EOF
1012 all:
1013         @echo 'ac_maketemp="${MAKE}"'
1014 EOF
1015 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1016 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1017 if test -n "$ac_maketemp"; then
1018   eval ac_cv_prog_make_${ac_make}_set=yes
1019 else
1020   eval ac_cv_prog_make_${ac_make}_set=no
1021 fi
1022 rm -f conftestmake
1023 fi
1024 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1025   echo "$ac_t""yes" 1>&6
1026   SET_MAKE=
1027 else
1028   echo "$ac_t""no" 1>&6
1029   SET_MAKE="MAKE=${MAKE-make}"
1030 fi
1031
1032
1033
1034 PACKAGE=$OL_PACKAGE
1035
1036 VERSION=$OL_VERSION
1037
1038 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1039   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1040 fi
1041
1042
1043
1044 missing_dir=`cd $ac_aux_dir && pwd`
1045 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working aclocal" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1051    ACLOCAL=aclocal
1052    echo "$ac_t""found" 1>&6
1053 else
1054    ACLOCAL="$missing_dir/missing aclocal"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoconf" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOCONF=autoconf
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOCONF="$missing_dir/missing autoconf"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working automake" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (automake --version) < /dev/null > /dev/null 2>&1; then
1077    AUTOMAKE=automake
1078    echo "$ac_t""found" 1>&6
1079 else
1080    AUTOMAKE="$missing_dir/missing automake"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1085 echo "configure:1086: checking for working autoheader" >&5
1086 # Run test in a subshell; some versions of sh will print an error if
1087 # an executable is not found, even if stderr is redirected.
1088 # Redirect stdin to placate older versions of autoconf.  Sigh.
1089 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1090    AUTOHEADER=autoheader
1091    echo "$ac_t""found" 1>&6
1092 else
1093    AUTOHEADER="$missing_dir/missing autoheader"
1094    echo "$ac_t""missing" 1>&6
1095 fi
1096
1097 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1098 echo "configure:1099: checking for working makeinfo" >&5
1099 # Run test in a subshell; some versions of sh will print an error if
1100 # an executable is not found, even if stderr is redirected.
1101 # Redirect stdin to placate older versions of autoconf.  Sigh.
1102 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1103    MAKEINFO=makeinfo
1104    echo "$ac_t""found" 1>&6
1105 else
1106    MAKEINFO="$missing_dir/missing makeinfo"
1107    echo "$ac_t""missing" 1>&6
1108 fi
1109
1110 install_sh="$missing_dir/install-sh"
1111 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1112
1113 for ac_prog in gnutar gtar tar
1114 do
1115 # Extract the first word of "$ac_prog", so it can be a program name with args.
1116 set dummy $ac_prog; ac_word=$2
1117 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1118 echo "configure:1119: checking for $ac_word" >&5
1119 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1120   echo $ac_n "(cached) $ac_c" 1>&6
1121 else
1122   if test -n "$AMTAR"; then
1123   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1124 else
1125   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1126   ac_dummy="$PATH"
1127   for ac_dir in $ac_dummy; do
1128     test -z "$ac_dir" && ac_dir=.
1129     if test -f $ac_dir/$ac_word; then
1130       ac_cv_prog_AMTAR="$ac_prog"
1131       break
1132     fi
1133   done
1134   IFS="$ac_save_ifs"
1135 fi
1136 fi
1137 AMTAR="$ac_cv_prog_AMTAR"
1138 if test -n "$AMTAR"; then
1139   echo "$ac_t""$AMTAR" 1>&6
1140 else
1141   echo "$ac_t""no" 1>&6
1142 fi
1143
1144 test -n "$AMTAR" && break
1145 done
1146
1147
1148 AMTARFLAGS=
1149 if test -n "$AMTAR"; then
1150   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1151         AMTARFLAGS=o
1152   fi
1153 fi
1154
1155 cat >> confdefs.h <<EOF
1156 #define OPENLDAP_PACKAGE "$PACKAGE"
1157 EOF
1158
1159 cat >> confdefs.h <<EOF
1160 #define OPENLDAP_VERSION "$VERSION"
1161 EOF
1162
1163
1164 cat >> confdefs.h <<EOF
1165 #define LDAP_VENDOR_VERSION $OL_API_INC
1166 EOF
1167
1168 cat >> confdefs.h <<EOF
1169 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1170 EOF
1171
1172 cat >> confdefs.h <<EOF
1173 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1174 EOF
1175
1176 cat >> confdefs.h <<EOF
1177 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1178 EOF
1179
1180
1181 OPENLDAP_LIBVERSION=$OL_API_LIB
1182
1183
1184
1185 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1186 echo "configure:1187: checking configure arguments" >&5
1187
1188
1189 top_builddir=`pwd`
1190
1191 ldap_subdir="/openldap"
1192
1193 # Check whether --with-subdir or --without-subdir was given.
1194 if test "${with_subdir+set}" = set; then
1195   withval="$with_subdir"
1196   case "$withval" in
1197         no) ldap_subdir=""
1198                 ;;
1199         yes)
1200                 ;;
1201         /*|\\*)
1202                 ldap_subdir="$withval"
1203                 ;;
1204         *)
1205                 ldap_subdir="/$withval"
1206                 ;;
1207 esac
1208
1209 fi
1210
1211
1212 # OpenLDAP --enable-debug
1213         # Check whether --enable-debug or --disable-debug was given.
1214 if test "${enable_debug+set}" = set; then
1215   enableval="$enable_debug"
1216   
1217         ol_arg=invalid
1218         for ol_val in auto yes no ; do
1219                 if test "$enableval" = "$ol_val" ; then
1220                         ol_arg="$ol_val"
1221                 fi
1222         done
1223         if test "$ol_arg" = "invalid" ; then
1224                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1225         fi
1226         ol_enable_debug="$ol_arg"
1227
1228 else
1229         ol_enable_debug="yes"
1230 fi
1231 # end --enable-debug
1232 # OpenLDAP --enable-syslog
1233         # Check whether --enable-syslog or --disable-syslog was given.
1234 if test "${enable_syslog+set}" = set; then
1235   enableval="$enable_syslog"
1236   
1237         ol_arg=invalid
1238         for ol_val in auto yes no ; do
1239                 if test "$enableval" = "$ol_val" ; then
1240                         ol_arg="$ol_val"
1241                 fi
1242         done
1243         if test "$ol_arg" = "invalid" ; then
1244                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1245         fi
1246         ol_enable_syslog="$ol_arg"
1247
1248 else
1249         ol_enable_syslog="auto"
1250 fi
1251 # end --enable-syslog
1252 # OpenLDAP --enable-proctitle
1253         # Check whether --enable-proctitle or --disable-proctitle was given.
1254 if test "${enable_proctitle+set}" = set; then
1255   enableval="$enable_proctitle"
1256   
1257         ol_arg=invalid
1258         for ol_val in auto yes no ; do
1259                 if test "$enableval" = "$ol_val" ; then
1260                         ol_arg="$ol_val"
1261                 fi
1262         done
1263         if test "$ol_arg" = "invalid" ; then
1264                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1265         fi
1266         ol_enable_proctitle="$ol_arg"
1267
1268 else
1269         ol_enable_proctitle="yes"
1270 fi
1271 # end --enable-proctitle
1272 # OpenLDAP --enable-cache
1273         # Check whether --enable-cache or --disable-cache was given.
1274 if test "${enable_cache+set}" = set; then
1275   enableval="$enable_cache"
1276   
1277         ol_arg=invalid
1278         for ol_val in auto yes no ; do
1279                 if test "$enableval" = "$ol_val" ; then
1280                         ol_arg="$ol_val"
1281                 fi
1282         done
1283         if test "$ol_arg" = "invalid" ; then
1284                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1285         fi
1286         ol_enable_cache="$ol_arg"
1287
1288 else
1289         ol_enable_cache="no"
1290 fi
1291 # end --enable-cache
1292 # OpenLDAP --enable-referrals
1293         # Check whether --enable-referrals or --disable-referrals was given.
1294 if test "${enable_referrals+set}" = set; then
1295   enableval="$enable_referrals"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1305         fi
1306         ol_enable_referrals="$ol_arg"
1307
1308 else
1309         ol_enable_referrals="no"
1310 fi
1311 # end --enable-referrals
1312 # OpenLDAP --enable-kbind
1313         # Check whether --enable-kbind or --disable-kbind was given.
1314 if test "${enable_kbind+set}" = set; then
1315   enableval="$enable_kbind"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1325         fi
1326         ol_enable_kbind="$ol_arg"
1327
1328 else
1329         ol_enable_kbind="no"
1330 fi
1331 # end --enable-kbind
1332 # OpenLDAP --enable-ipv6
1333         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1334 if test "${enable_ipv6+set}" = set; then
1335   enableval="$enable_ipv6"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto yes no ; do
1339                 if test "$enableval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1345         fi
1346         ol_enable_ipv6="$ol_arg"
1347
1348 else
1349         ol_enable_ipv6="auto"
1350 fi
1351 # end --enable-ipv6
1352 # OpenLDAP --enable-local
1353         # Check whether --enable-local or --disable-local was given.
1354 if test "${enable_local+set}" = set; then
1355   enableval="$enable_local"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no ; do
1359                 if test "$enableval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1365         fi
1366         ol_enable_local="$ol_arg"
1367
1368 else
1369         ol_enable_local="auto"
1370 fi
1371 # end --enable-local
1372 # OpenLDAP --enable-rewrite
1373         # Check whether --enable-rewrite or --disable-rewrite was given.
1374 if test "${enable_rewrite+set}" = set; then
1375   enableval="$enable_rewrite"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto yes no ; do
1379                 if test "$enableval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1385         fi
1386         ol_enable_rewrite="$ol_arg"
1387
1388 else
1389         ol_enable_rewrite="no"
1390 fi
1391 # end --enable-rewrite
1392 # OpenLDAP --enable-x_compile
1393         # Check whether --enable-x_compile or --disable-x_compile was given.
1394 if test "${enable_x_compile+set}" = set; then
1395   enableval="$enable_x_compile"
1396   
1397         ol_arg=invalid
1398         for ol_val in yes no ; do
1399                 if test "$enableval" = "$ol_val" ; then
1400                         ol_arg="$ol_val"
1401                 fi
1402         done
1403         if test "$ol_arg" = "invalid" ; then
1404                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1405         fi
1406         ol_enable_x_compile="$ol_arg"
1407
1408 else
1409         ol_enable_x_compile="no"
1410 fi
1411 # end --enable-x_compile
1412
1413
1414 # OpenLDAP --with-cyrus_sasl
1415         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1416 if test "${with_cyrus_sasl+set}" = set; then
1417   withval="$with_cyrus_sasl"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto yes no  ; do
1421                 if test "$withval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1427         fi
1428         ol_with_cyrus_sasl="$ol_arg"
1429
1430 else
1431         ol_with_cyrus_sasl="auto"
1432 fi
1433 # end --with-cyrus_sasl
1434
1435 # OpenLDAP --with-fetch
1436         # Check whether --with-fetch or --without-fetch was given.
1437 if test "${with_fetch+set}" = set; then
1438   withval="$with_fetch"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1448         fi
1449         ol_with_fetch="$ol_arg"
1450
1451 else
1452         ol_with_fetch="auto"
1453 fi
1454 # end --with-fetch
1455
1456 # OpenLDAP --with-kerberos
1457         # Check whether --with-kerberos or --without-kerberos was given.
1458 if test "${with_kerberos+set}" = set; then
1459   withval="$with_kerberos"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1469         fi
1470         ol_with_kerberos="$ol_arg"
1471
1472 else
1473         ol_with_kerberos="auto"
1474 fi
1475 # end --with-kerberos
1476
1477 # OpenLDAP --with-readline
1478         # Check whether --with-readline or --without-readline was given.
1479 if test "${with_readline+set}" = set; then
1480   withval="$with_readline"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto yes no  ; do
1484                 if test "$withval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1490         fi
1491         ol_with_readline="$ol_arg"
1492
1493 else
1494         ol_with_readline="auto"
1495 fi
1496 # end --with-readline
1497
1498 # OpenLDAP --with-threads
1499         # Check whether --with-threads or --without-threads was given.
1500 if test "${with_threads+set}" = set; then
1501   withval="$with_threads"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1505                 if test "$withval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1511         fi
1512         ol_with_threads="$ol_arg"
1513
1514 else
1515         ol_with_threads="auto"
1516 fi
1517 # end --with-threads
1518
1519 # OpenLDAP --with-tls
1520         # Check whether --with-tls or --without-tls was given.
1521 if test "${with_tls+set}" = set; then
1522   withval="$with_tls"
1523   
1524         ol_arg=invalid
1525         for ol_val in auto ssleay openssl yes no  ; do
1526                 if test "$withval" = "$ol_val" ; then
1527                         ol_arg="$ol_val"
1528                 fi
1529         done
1530         if test "$ol_arg" = "invalid" ; then
1531                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1532         fi
1533         ol_with_tls="$ol_arg"
1534
1535 else
1536         ol_with_tls="auto"
1537 fi
1538 # end --with-tls
1539
1540 # OpenLDAP --with-yielding_select
1541         # Check whether --with-yielding_select or --without-yielding_select was given.
1542 if test "${with_yielding_select+set}" = set; then
1543   withval="$with_yielding_select"
1544   
1545         ol_arg=invalid
1546         for ol_val in auto yes no manual  ; do
1547                 if test "$withval" = "$ol_val" ; then
1548                         ol_arg="$ol_val"
1549                 fi
1550         done
1551         if test "$ol_arg" = "invalid" ; then
1552                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1553         fi
1554         ol_with_yielding_select="$ol_arg"
1555
1556 else
1557         ol_with_yielding_select="auto"
1558 fi
1559 # end --with-yielding_select
1560
1561
1562
1563 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1564 if test "${with_xxslapdoptions+set}" = set; then
1565   withval="$with_xxslapdoptions"
1566   :
1567 fi
1568
1569 # OpenLDAP --enable-slapd
1570         # Check whether --enable-slapd or --disable-slapd was given.
1571 if test "${enable_slapd+set}" = set; then
1572   enableval="$enable_slapd"
1573   
1574         ol_arg=invalid
1575         for ol_val in auto yes no ; do
1576                 if test "$enableval" = "$ol_val" ; then
1577                         ol_arg="$ol_val"
1578                 fi
1579         done
1580         if test "$ol_arg" = "invalid" ; then
1581                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1582         fi
1583         ol_enable_slapd="$ol_arg"
1584
1585 else
1586         ol_enable_slapd="yes"
1587 fi
1588 # end --enable-slapd
1589 # OpenLDAP --enable-aci
1590         # Check whether --enable-aci or --disable-aci was given.
1591 if test "${enable_aci+set}" = set; then
1592   enableval="$enable_aci"
1593   
1594         ol_arg=invalid
1595         for ol_val in auto yes no ; do
1596                 if test "$enableval" = "$ol_val" ; then
1597                         ol_arg="$ol_val"
1598                 fi
1599         done
1600         if test "$ol_arg" = "invalid" ; then
1601                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1602         fi
1603         ol_enable_aci="$ol_arg"
1604
1605 else
1606         ol_enable_aci="no"
1607 fi
1608 # end --enable-aci
1609 # OpenLDAP --enable-cleartext
1610         # Check whether --enable-cleartext or --disable-cleartext was given.
1611 if test "${enable_cleartext+set}" = set; then
1612   enableval="$enable_cleartext"
1613   
1614         ol_arg=invalid
1615         for ol_val in auto yes no ; do
1616                 if test "$enableval" = "$ol_val" ; then
1617                         ol_arg="$ol_val"
1618                 fi
1619         done
1620         if test "$ol_arg" = "invalid" ; then
1621                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1622         fi
1623         ol_enable_cleartext="$ol_arg"
1624
1625 else
1626         ol_enable_cleartext="yes"
1627 fi
1628 # end --enable-cleartext
1629 # OpenLDAP --enable-crypt
1630         # Check whether --enable-crypt or --disable-crypt was given.
1631 if test "${enable_crypt+set}" = set; then
1632   enableval="$enable_crypt"
1633   
1634         ol_arg=invalid
1635         for ol_val in auto yes no ; do
1636                 if test "$enableval" = "$ol_val" ; then
1637                         ol_arg="$ol_val"
1638                 fi
1639         done
1640         if test "$ol_arg" = "invalid" ; then
1641                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1642         fi
1643         ol_enable_crypt="$ol_arg"
1644
1645 else
1646         ol_enable_crypt="no"
1647 fi
1648 # end --enable-crypt
1649 # OpenLDAP --enable-dynamic
1650         # Check whether --enable-dynamic or --disable-dynamic was given.
1651 if test "${enable_dynamic+set}" = set; then
1652   enableval="$enable_dynamic"
1653   
1654         ol_arg=invalid
1655         for ol_val in auto yes no ; do
1656                 if test "$enableval" = "$ol_val" ; then
1657                         ol_arg="$ol_val"
1658                 fi
1659         done
1660         if test "$ol_arg" = "invalid" ; then
1661                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1662         fi
1663         ol_enable_dynamic="$ol_arg"
1664
1665 else
1666         ol_enable_dynamic="no"
1667 fi
1668 # end --enable-dynamic
1669 # OpenLDAP --enable-kpasswd
1670         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1671 if test "${enable_kpasswd+set}" = set; then
1672   enableval="$enable_kpasswd"
1673   
1674         ol_arg=invalid
1675         for ol_val in auto yes no ; do
1676                 if test "$enableval" = "$ol_val" ; then
1677                         ol_arg="$ol_val"
1678                 fi
1679         done
1680         if test "$ol_arg" = "invalid" ; then
1681                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1682         fi
1683         ol_enable_kpasswd="$ol_arg"
1684
1685 else
1686         ol_enable_kpasswd="no"
1687 fi
1688 # end --enable-kpasswd
1689 # OpenLDAP --enable-lmpasswd
1690         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1691 if test "${enable_lmpasswd+set}" = set; then
1692   enableval="$enable_lmpasswd"
1693   
1694         ol_arg=invalid
1695         for ol_val in auto yes no ; do
1696                 if test "$enableval" = "$ol_val" ; then
1697                         ol_arg="$ol_val"
1698                 fi
1699         done
1700         if test "$ol_arg" = "invalid" ; then
1701                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1702         fi
1703         ol_enable_lmpasswd="$ol_arg"
1704
1705 else
1706         ol_enable_lmpasswd="no"
1707 fi
1708 # end --enable-lmpasswd
1709 # OpenLDAP --enable-spasswd
1710         # Check whether --enable-spasswd or --disable-spasswd was given.
1711 if test "${enable_spasswd+set}" = set; then
1712   enableval="$enable_spasswd"
1713   
1714         ol_arg=invalid
1715         for ol_val in auto yes no ; do
1716                 if test "$enableval" = "$ol_val" ; then
1717                         ol_arg="$ol_val"
1718                 fi
1719         done
1720         if test "$ol_arg" = "invalid" ; then
1721                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1722         fi
1723         ol_enable_spasswd="$ol_arg"
1724
1725 else
1726         ol_enable_spasswd="no"
1727 fi
1728 # end --enable-spasswd
1729 # OpenLDAP --enable-modules
1730         # Check whether --enable-modules or --disable-modules was given.
1731 if test "${enable_modules+set}" = set; then
1732   enableval="$enable_modules"
1733   
1734         ol_arg=invalid
1735         for ol_val in auto yes no ; do
1736                 if test "$enableval" = "$ol_val" ; then
1737                         ol_arg="$ol_val"
1738                 fi
1739         done
1740         if test "$ol_arg" = "invalid" ; then
1741                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1742         fi
1743         ol_enable_modules="$ol_arg"
1744
1745 else
1746         ol_enable_modules="no"
1747 fi
1748 # end --enable-modules
1749 # OpenLDAP --enable-phonetic
1750         # Check whether --enable-phonetic or --disable-phonetic was given.
1751 if test "${enable_phonetic+set}" = set; then
1752   enableval="$enable_phonetic"
1753   
1754         ol_arg=invalid
1755         for ol_val in auto yes no ; do
1756                 if test "$enableval" = "$ol_val" ; then
1757                         ol_arg="$ol_val"
1758                 fi
1759         done
1760         if test "$ol_arg" = "invalid" ; then
1761                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1762         fi
1763         ol_enable_phonetic="$ol_arg"
1764
1765 else
1766         ol_enable_phonetic="no"
1767 fi
1768 # end --enable-phonetic
1769 # OpenLDAP --enable-rlookups
1770         # Check whether --enable-rlookups or --disable-rlookups was given.
1771 if test "${enable_rlookups+set}" = set; then
1772   enableval="$enable_rlookups"
1773   
1774         ol_arg=invalid
1775         for ol_val in auto yes no ; do
1776                 if test "$enableval" = "$ol_val" ; then
1777                         ol_arg="$ol_val"
1778                 fi
1779         done
1780         if test "$ol_arg" = "invalid" ; then
1781                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1782         fi
1783         ol_enable_rlookups="$ol_arg"
1784
1785 else
1786         ol_enable_rlookups="no"
1787 fi
1788 # end --enable-rlookups
1789 # OpenLDAP --enable-slp
1790         # Check whether --enable-slp or --disable-slp was given.
1791 if test "${enable_slp+set}" = set; then
1792   enableval="$enable_slp"
1793   
1794         ol_arg=invalid
1795         for ol_val in auto yes no ; do
1796                 if test "$enableval" = "$ol_val" ; then
1797                         ol_arg="$ol_val"
1798                 fi
1799         done
1800         if test "$ol_arg" = "invalid" ; then
1801                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1802         fi
1803         ol_enable_slp="$ol_arg"
1804
1805 else
1806         ol_enable_slp="no"
1807 fi
1808 # end --enable-slp
1809 # OpenLDAP --enable-wrappers
1810         # Check whether --enable-wrappers or --disable-wrappers was given.
1811 if test "${enable_wrappers+set}" = set; then
1812   enableval="$enable_wrappers"
1813   
1814         ol_arg=invalid
1815         for ol_val in auto yes no ; do
1816                 if test "$enableval" = "$ol_val" ; then
1817                         ol_arg="$ol_val"
1818                 fi
1819         done
1820         if test "$ol_arg" = "invalid" ; then
1821                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1822         fi
1823         ol_enable_wrappers="$ol_arg"
1824
1825 else
1826         ol_enable_wrappers="no"
1827 fi
1828 # end --enable-wrappers
1829
1830 # OpenLDAP --enable-bdb
1831         # Check whether --enable-bdb or --disable-bdb was given.
1832 if test "${enable_bdb+set}" = set; then
1833   enableval="$enable_bdb"
1834   
1835         ol_arg=invalid
1836         for ol_val in auto yes no ; do
1837                 if test "$enableval" = "$ol_val" ; then
1838                         ol_arg="$ol_val"
1839                 fi
1840         done
1841         if test "$ol_arg" = "invalid" ; then
1842                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1843         fi
1844         ol_enable_bdb="$ol_arg"
1845
1846 else
1847         ol_enable_bdb="no"
1848 fi
1849 # end --enable-bdb
1850 # OpenLDAP --with-bdb_module
1851         # Check whether --with-bdb_module or --without-bdb_module was given.
1852 if test "${with_bdb_module+set}" = set; then
1853   withval="$with_bdb_module"
1854   
1855         ol_arg=invalid
1856         for ol_val in static dynamic ; do
1857                 if test "$withval" = "$ol_val" ; then
1858                         ol_arg="$ol_val"
1859                 fi
1860         done
1861         if test "$ol_arg" = "invalid" ; then
1862                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1863         fi
1864         ol_with_bdb_module="$ol_arg"
1865
1866 else
1867         ol_with_bdb_module="static"
1868 fi
1869 # end --with-bdb_module
1870
1871 # OpenLDAP --enable-dnssrv
1872         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1873 if test "${enable_dnssrv+set}" = set; then
1874   enableval="$enable_dnssrv"
1875   
1876         ol_arg=invalid
1877         for ol_val in auto yes no ; do
1878                 if test "$enableval" = "$ol_val" ; then
1879                         ol_arg="$ol_val"
1880                 fi
1881         done
1882         if test "$ol_arg" = "invalid" ; then
1883                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1884         fi
1885         ol_enable_dnssrv="$ol_arg"
1886
1887 else
1888         ol_enable_dnssrv="no"
1889 fi
1890 # end --enable-dnssrv
1891 # OpenLDAP --with-dnssrv_module
1892         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1893 if test "${with_dnssrv_module+set}" = set; then
1894   withval="$with_dnssrv_module"
1895   
1896         ol_arg=invalid
1897         for ol_val in static dynamic ; do
1898                 if test "$withval" = "$ol_val" ; then
1899                         ol_arg="$ol_val"
1900                 fi
1901         done
1902         if test "$ol_arg" = "invalid" ; then
1903                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1904         fi
1905         ol_with_dnssrv_module="$ol_arg"
1906
1907 else
1908         ol_with_dnssrv_module="static"
1909 fi
1910 # end --with-dnssrv_module
1911
1912 # OpenLDAP --enable-ldap
1913         # Check whether --enable-ldap or --disable-ldap was given.
1914 if test "${enable_ldap+set}" = set; then
1915   enableval="$enable_ldap"
1916   
1917         ol_arg=invalid
1918         for ol_val in auto yes no ; do
1919                 if test "$enableval" = "$ol_val" ; then
1920                         ol_arg="$ol_val"
1921                 fi
1922         done
1923         if test "$ol_arg" = "invalid" ; then
1924                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1925         fi
1926         ol_enable_ldap="$ol_arg"
1927
1928 else
1929         ol_enable_ldap="no"
1930 fi
1931 # end --enable-ldap
1932 # OpenLDAP --with-ldap_module
1933         # Check whether --with-ldap_module or --without-ldap_module was given.
1934 if test "${with_ldap_module+set}" = set; then
1935   withval="$with_ldap_module"
1936   
1937         ol_arg=invalid
1938         for ol_val in static dynamic ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1945         fi
1946         ol_with_ldap_module="$ol_arg"
1947
1948 else
1949         ol_with_ldap_module="static"
1950 fi
1951 # end --with-ldap_module
1952
1953 # OpenLDAP --enable-ldbm
1954         # Check whether --enable-ldbm or --disable-ldbm was given.
1955 if test "${enable_ldbm+set}" = set; then
1956   enableval="$enable_ldbm"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1966         fi
1967         ol_enable_ldbm="$ol_arg"
1968
1969 else
1970         ol_enable_ldbm="yes"
1971 fi
1972 # end --enable-ldbm
1973 # OpenLDAP --with-ldbm_api
1974         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1975 if test "${with_ldbm_api+set}" = set; then
1976   withval="$with_ldbm_api"
1977   
1978         ol_arg=invalid
1979         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1986         fi
1987         ol_with_ldbm_api="$ol_arg"
1988
1989 else
1990         ol_with_ldbm_api="auto"
1991 fi
1992 # end --with-ldbm_api
1993
1994 # OpenLDAP --with-ldbm_module
1995         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1996 if test "${with_ldbm_module+set}" = set; then
1997   withval="$with_ldbm_module"
1998   
1999         ol_arg=invalid
2000         for ol_val in static dynamic ; do
2001                 if test "$withval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2007         fi
2008         ol_with_ldbm_module="$ol_arg"
2009
2010 else
2011         ol_with_ldbm_module="static"
2012 fi
2013 # end --with-ldbm_module
2014
2015 # OpenLDAP --with-ldbm_type
2016         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2017 if test "${with_ldbm_type+set}" = set; then
2018   withval="$with_ldbm_type"
2019   
2020         ol_arg=invalid
2021         for ol_val in auto btree hash ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2028         fi
2029         ol_with_ldbm_type="$ol_arg"
2030
2031 else
2032         ol_with_ldbm_type="auto"
2033 fi
2034 # end --with-ldbm_type
2035
2036 # OpenLDAP --enable-meta
2037         # Check whether --enable-meta or --disable-meta was given.
2038 if test "${enable_meta+set}" = set; then
2039   enableval="$enable_meta"
2040   
2041         ol_arg=invalid
2042         for ol_val in auto yes no ; do
2043                 if test "$enableval" = "$ol_val" ; then
2044                         ol_arg="$ol_val"
2045                 fi
2046         done
2047         if test "$ol_arg" = "invalid" ; then
2048                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2049         fi
2050         ol_enable_meta="$ol_arg"
2051
2052 else
2053         ol_enable_meta="no"
2054 fi
2055 # end --enable-meta
2056 # OpenLDAP --with-meta_module
2057         # Check whether --with-meta_module or --without-meta_module was given.
2058 if test "${with_meta_module+set}" = set; then
2059   withval="$with_meta_module"
2060   
2061         ol_arg=invalid
2062         for ol_val in static dynamic ; do
2063                 if test "$withval" = "$ol_val" ; then
2064                         ol_arg="$ol_val"
2065                 fi
2066         done
2067         if test "$ol_arg" = "invalid" ; then
2068                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2069         fi
2070         ol_with_meta_module="$ol_arg"
2071
2072 else
2073         ol_with_meta_module="static"
2074 fi
2075 # end --with-meta_module
2076
2077 # OpenLDAP --enable-monitor
2078         # Check whether --enable-monitor or --disable-monitor was given.
2079 if test "${enable_monitor+set}" = set; then
2080   enableval="$enable_monitor"
2081   
2082         ol_arg=invalid
2083         for ol_val in auto yes no ; do
2084                 if test "$enableval" = "$ol_val" ; then
2085                         ol_arg="$ol_val"
2086                 fi
2087         done
2088         if test "$ol_arg" = "invalid" ; then
2089                 { echo "configure: error: bad value $enableval for --enable-monitor" 1>&2; exit 1; }
2090         fi
2091         ol_enable_monitor="$ol_arg"
2092
2093 else
2094         ol_enable_monitor="no"
2095 fi
2096 # end --enable-monitor
2097 # OpenLDAP --with-monitor_module
2098         # Check whether --with-monitor_module or --without-monitor_module was given.
2099 if test "${with_monitor_module+set}" = set; then
2100   withval="$with_monitor_module"
2101   
2102         ol_arg=invalid
2103         for ol_val in static dynamic ; do
2104                 if test "$withval" = "$ol_val" ; then
2105                         ol_arg="$ol_val"
2106                 fi
2107         done
2108         if test "$ol_arg" = "invalid" ; then
2109                 { echo "configure: error: bad value $withval for --with-monitor_module" 1>&2; exit 1; }
2110         fi
2111         ol_with_monitor_module="$ol_arg"
2112
2113 else
2114         ol_with_monitor_module="static"
2115 fi
2116 # end --with-monitor_module
2117
2118 # OpenLDAP --enable-passwd
2119         # Check whether --enable-passwd or --disable-passwd was given.
2120 if test "${enable_passwd+set}" = set; then
2121   enableval="$enable_passwd"
2122   
2123         ol_arg=invalid
2124         for ol_val in auto yes no ; do
2125                 if test "$enableval" = "$ol_val" ; then
2126                         ol_arg="$ol_val"
2127                 fi
2128         done
2129         if test "$ol_arg" = "invalid" ; then
2130                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2131         fi
2132         ol_enable_passwd="$ol_arg"
2133
2134 else
2135         ol_enable_passwd="no"
2136 fi
2137 # end --enable-passwd
2138 # OpenLDAP --with-passwd_module
2139         # Check whether --with-passwd_module or --without-passwd_module was given.
2140 if test "${with_passwd_module+set}" = set; then
2141   withval="$with_passwd_module"
2142   
2143         ol_arg=invalid
2144         for ol_val in static dynamic ; do
2145                 if test "$withval" = "$ol_val" ; then
2146                         ol_arg="$ol_val"
2147                 fi
2148         done
2149         if test "$ol_arg" = "invalid" ; then
2150                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2151         fi
2152         ol_with_passwd_module="$ol_arg"
2153
2154 else
2155         ol_with_passwd_module="static"
2156 fi
2157 # end --with-passwd_module
2158
2159 # OpenLDAP --enable-perl
2160         # Check whether --enable-perl or --disable-perl was given.
2161 if test "${enable_perl+set}" = set; then
2162   enableval="$enable_perl"
2163   
2164         ol_arg=invalid
2165         for ol_val in auto yes no ; do
2166                 if test "$enableval" = "$ol_val" ; then
2167                         ol_arg="$ol_val"
2168                 fi
2169         done
2170         if test "$ol_arg" = "invalid" ; then
2171                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2172         fi
2173         ol_enable_perl="$ol_arg"
2174
2175 else
2176         ol_enable_perl="no"
2177 fi
2178 # end --enable-perl
2179 # OpenLDAP --with-perl_module
2180         # Check whether --with-perl_module or --without-perl_module was given.
2181 if test "${with_perl_module+set}" = set; then
2182   withval="$with_perl_module"
2183   
2184         ol_arg=invalid
2185         for ol_val in static dynamic ; do
2186                 if test "$withval" = "$ol_val" ; then
2187                         ol_arg="$ol_val"
2188                 fi
2189         done
2190         if test "$ol_arg" = "invalid" ; then
2191                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2192         fi
2193         ol_with_perl_module="$ol_arg"
2194
2195 else
2196         ol_with_perl_module="static"
2197 fi
2198 # end --with-perl_module
2199
2200 # OpenLDAP --enable-shell
2201         # Check whether --enable-shell or --disable-shell was given.
2202 if test "${enable_shell+set}" = set; then
2203   enableval="$enable_shell"
2204   
2205         ol_arg=invalid
2206         for ol_val in auto yes no ; do
2207                 if test "$enableval" = "$ol_val" ; then
2208                         ol_arg="$ol_val"
2209                 fi
2210         done
2211         if test "$ol_arg" = "invalid" ; then
2212                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2213         fi
2214         ol_enable_shell="$ol_arg"
2215
2216 else
2217         ol_enable_shell="no"
2218 fi
2219 # end --enable-shell
2220 # OpenLDAP --with-shell_module
2221         # Check whether --with-shell_module or --without-shell_module was given.
2222 if test "${with_shell_module+set}" = set; then
2223   withval="$with_shell_module"
2224   
2225         ol_arg=invalid
2226         for ol_val in static dynamic ; do
2227                 if test "$withval" = "$ol_val" ; then
2228                         ol_arg="$ol_val"
2229                 fi
2230         done
2231         if test "$ol_arg" = "invalid" ; then
2232                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2233         fi
2234         ol_with_shell_module="$ol_arg"
2235
2236 else
2237         ol_with_shell_module="static"
2238 fi
2239 # end --with-shell_module
2240
2241 # OpenLDAP --enable-sql
2242         # Check whether --enable-sql or --disable-sql was given.
2243 if test "${enable_sql+set}" = set; then
2244   enableval="$enable_sql"
2245   
2246         ol_arg=invalid
2247         for ol_val in auto yes no ; do
2248                 if test "$enableval" = "$ol_val" ; then
2249                         ol_arg="$ol_val"
2250                 fi
2251         done
2252         if test "$ol_arg" = "invalid" ; then
2253                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2254         fi
2255         ol_enable_sql="$ol_arg"
2256
2257 else
2258         ol_enable_sql="no"
2259 fi
2260 # end --enable-sql
2261 # OpenLDAP --with-sql_module
2262         # Check whether --with-sql_module or --without-sql_module was given.
2263 if test "${with_sql_module+set}" = set; then
2264   withval="$with_sql_module"
2265   
2266         ol_arg=invalid
2267         for ol_val in static dynamic ; do
2268                 if test "$withval" = "$ol_val" ; then
2269                         ol_arg="$ol_val"
2270                 fi
2271         done
2272         if test "$ol_arg" = "invalid" ; then
2273                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2274         fi
2275         ol_with_sql_module="$ol_arg"
2276
2277 else
2278         ol_with_sql_module="static"
2279 fi
2280 # end --with-sql_module
2281
2282 # OpenLDAP --enable-tcl
2283         # Check whether --enable-tcl or --disable-tcl was given.
2284 if test "${enable_tcl+set}" = set; then
2285   enableval="$enable_tcl"
2286   
2287         ol_arg=invalid
2288         for ol_val in auto yes no ; do
2289                 if test "$enableval" = "$ol_val" ; then
2290                         ol_arg="$ol_val"
2291                 fi
2292         done
2293         if test "$ol_arg" = "invalid" ; then
2294                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2295         fi
2296         ol_enable_tcl="$ol_arg"
2297
2298 else
2299         ol_enable_tcl="no"
2300 fi
2301 # end --enable-tcl
2302 # OpenLDAP --with-tcl_module
2303         # Check whether --with-tcl_module or --without-tcl_module was given.
2304 if test "${with_tcl_module+set}" = set; then
2305   withval="$with_tcl_module"
2306   
2307         ol_arg=invalid
2308         for ol_val in static dynamic ; do
2309                 if test "$withval" = "$ol_val" ; then
2310                         ol_arg="$ol_val"
2311                 fi
2312         done
2313         if test "$ol_arg" = "invalid" ; then
2314                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2315         fi
2316         ol_with_tcl_module="$ol_arg"
2317
2318 else
2319         ol_with_tcl_module="static"
2320 fi
2321 # end --with-tcl_module
2322
2323
2324 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2325 if test "${with_xxslurpdoptions+set}" = set; then
2326   withval="$with_xxslurpdoptions"
2327   :
2328 fi
2329
2330 # OpenLDAP --enable-slurpd
2331         # Check whether --enable-slurpd or --disable-slurpd was given.
2332 if test "${enable_slurpd+set}" = set; then
2333   enableval="$enable_slurpd"
2334   
2335         ol_arg=invalid
2336         for ol_val in auto yes no ; do
2337                 if test "$enableval" = "$ol_val" ; then
2338                         ol_arg="$ol_val"
2339                 fi
2340         done
2341         if test "$ol_arg" = "invalid" ; then
2342                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2343         fi
2344         ol_enable_slurpd="$ol_arg"
2345
2346 else
2347         ol_enable_slurpd="auto"
2348 fi
2349 # end --enable-slurpd
2350
2351 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2352 if test "${with_xxliboptions+set}" = set; then
2353   withval="$with_xxliboptions"
2354   :
2355 fi
2356
2357 # Check whether --enable-static or --disable-static was given.
2358 if test "${enable_static+set}" = set; then
2359   enableval="$enable_static"
2360   p=${PACKAGE-default}
2361 case "$enableval" in
2362 yes) enable_static=yes ;;
2363 no) enable_static=no ;;
2364 *)
2365   enable_static=no
2366   # Look at the argument we got.  We use all the common list separators.
2367   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2368   for pkg in $enableval; do
2369     if test "X$pkg" = "X$p"; then
2370       enable_static=yes
2371     fi
2372   done
2373   IFS="$ac_save_ifs"
2374   ;;
2375 esac
2376 else
2377   enable_static=yes
2378 fi
2379
2380 # Check whether --enable-shared or --disable-shared was given.
2381 if test "${enable_shared+set}" = set; then
2382   enableval="$enable_shared"
2383   p=${PACKAGE-default}
2384 case "$enableval" in
2385 yes) enable_shared=yes ;;
2386 no) enable_shared=no ;;
2387 *)
2388   enable_shared=no
2389   # Look at the argument we got.  We use all the common list separators.
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2391   for pkg in $enableval; do
2392     if test "X$pkg" = "X$p"; then
2393       enable_shared=yes
2394     fi
2395   done
2396   IFS="$ac_save_ifs"
2397   ;;
2398 esac
2399 else
2400   enable_shared=yes
2401 fi
2402
2403
2404
2405 # validate options
2406 if test $ol_enable_slapd = no ; then
2407                 if test $ol_enable_bdb = yes ; then
2408                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2409         fi
2410         if test $ol_enable_dnssrv = yes ; then
2411                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2412         fi
2413         if test $ol_enable_ldap = yes ; then
2414                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2415         fi
2416         if test $ol_enable_ldbm = yes ; then
2417                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2418         fi
2419         if test $ol_enable_meta = yes ; then
2420                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2421         fi
2422         if test $ol_enable_monitor = yes ; then
2423                 echo "configure: warning: slapd disabled, ignoring --enable-monitor argument" 1>&2
2424         fi
2425         if test $ol_enable_passwd = yes ; then
2426                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2427         fi
2428         if test $ol_enable_perl = yes ; then
2429                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2430         fi
2431         if test $ol_enable_shell = yes ; then
2432                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2433         fi
2434         if test $ol_enable_tcl = yes ; then
2435                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2436         fi
2437         if test $ol_enable_sql = yes ; then
2438                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2439         fi
2440         if test $ol_enable_modules = yes ; then
2441                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2442         fi
2443         if test $ol_enable_wrappers = yes ; then
2444                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2445         fi
2446         if test $ol_enable_phonetic = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2448         fi
2449         if test $ol_enable_rlookups = yes ; then
2450                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2451         fi
2452         if test $ol_enable_aci = yes ; then
2453                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2454         fi
2455         if test $ol_with_ldbm_api != auto ; then
2456                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2457         fi
2458         if test $ol_with_ldbm_type != auto ; then
2459                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2460         fi
2461         if test $ol_with_bdb_module != static ; then
2462                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2463         fi
2464         if test $ol_with_dnssrv_module != static ; then
2465                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2466         fi
2467         if test $ol_with_ldap_module != static ; then
2468                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2469         fi
2470         if test $ol_with_ldbm_module != static ; then
2471                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2472         fi
2473         if test $ol_with_meta_module != static ; then
2474                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2475         fi
2476         if test $ol_with_monitor_module != static ; then
2477                 echo "configure: warning: slapd disabled, ignoring --with-monitor-module argument" 1>&2
2478         fi
2479         if test $ol_with_passwd_module != static ; then
2480                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2481         fi
2482         if test $ol_with_perl_module != static ; then
2483                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2484         fi
2485         if test $ol_with_shell_module != static ; then
2486                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2487         fi
2488         if test $ol_with_tcl_module != static ; then
2489                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2490         fi
2491         if test $ol_with_sql_module != static ; then
2492                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2493         fi
2494         if test $ol_enable_slurpd = yes ; then
2495                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2496         fi
2497         if test $ol_enable_rewrite = yes ; then
2498                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2499         fi
2500
2501         # force settings to no
2502         ol_enable_bdb=no
2503         ol_enable_dnssrv=no
2504         ol_enable_ldap=no
2505         ol_enable_ldbm=no
2506         ol_enable_meta=no
2507         ol_enable_monitor=no
2508         ol_enable_passwd=no
2509         ol_enable_perl=no
2510         ol_enable_shell=no
2511         ol_enable_tcl=no
2512         ol_enable_sql=no
2513
2514         ol_enable_modules=no
2515         ol_enable_phonetic=no
2516         ol_enable_rlookups=no
2517         ol_enable_aci=no
2518         ol_enable_wrappers=no
2519         ol_enable_dynamic=no
2520
2521         ol_with_ldbm_api=no
2522         ol_with_ldbm_type=no
2523
2524         ol_with_bdb_module=static
2525         ol_with_dnssrv_module=static
2526         ol_with_ldap_module=static
2527         ol_with_ldbm_module=static
2528         ol_with_meta_module=static
2529         ol_with_monitor_module=static
2530         ol_with_passwd_module=static
2531         ol_with_perl_module=static
2532         ol_with_shell_module=static
2533         ol_with_tcl_module=static
2534         ol_with_sql_module=static
2535
2536         ol_enable_slurpd=no
2537
2538         ol_enable_rewrite=no
2539
2540 elif test $ol_enable_ldbm = no ; then
2541         
2542         if test $ol_with_ldbm_api != auto ; then
2543                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2544         fi
2545
2546         if test $ol_with_ldbm_type != auto ; then
2547                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2548         fi
2549
2550         if test $ol_with_ldbm_module != static ; then
2551                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2552         fi
2553
2554         if test $ol_enable_modules != yes -a \
2555                 $ol_enable_bdb = no -a \
2556                 $ol_enable_dnssrv = no -a \
2557                 $ol_enable_ldap = no -a \
2558                 $ol_enable_meta = no -a \
2559                 $ol_enable_monitor = no -a \
2560                 $ol_enable_passwd = no -a \
2561                 $ol_enable_perl = no -a \
2562                 $ol_enable_shell = no -a \
2563                 $ol_enable_sql = no -a \
2564                 $ol_enable_tcl = no ; then
2565
2566                 if test $ol_enable_slapd = yes ; then
2567                         { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2568                 else
2569                         echo "configure: warning: skipping slapd, no backend specified" 1>&2
2570                         ol_enable_slapd=no
2571                 fi
2572         fi
2573
2574         ol_with_ldbm_api=no
2575         ol_with_ldbm_type=no
2576         ol_with_ldbm_module=static
2577
2578         if test $ol_enable_bdb != no ; then
2579                 ol_with_ldbm_api=berkeley
2580         fi
2581
2582 else
2583                 if test $ol_with_ldbm_api = gdbm -a \
2584                 $ol_with_ldbm_type = btree ; then
2585                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2586         fi
2587         if test $ol_with_ldbm_api = mdbm -a \
2588                 $ol_with_ldbm_type = btree ; then
2589                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2590         fi
2591         if test $ol_with_ldbm_api = ndbm -a \
2592                 $ol_with_ldbm_type = btree ; then
2593                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2594         fi
2595
2596         if test $ol_enable_bdb = yes ; then
2597                 if test $ol_with_ldbm_api = auto ; then
2598                         ol_with_ldbm_api=berkeley
2599                 elif test $ol_with_ldbm_api != berkeley ; then
2600                         { echo "configure: error: LDBM API not compatible with BDB" 1>&2; exit 1; }
2601                 fi
2602
2603         elif test $ol_enable_bdb = auto ; then
2604                 if test $ol_with_ldbm_api != berkeley \
2605                         -o $ol_with_ldbm_api != auto ; then
2606                         echo "configure: warning: LDBM API not compatible with BDB, disabling BDB" 1>&2
2607                         ol_enable_bdb=no
2608                 fi
2609         fi
2610 fi
2611
2612 if test $ol_enable_slurpd = yes ; then
2613                 if test $ol_with_threads = no ; then
2614                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2615         fi
2616 fi
2617
2618 if test $ol_enable_lmpasswd = yes ; then
2619         if test $ol_with_tls = no ; then
2620                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2621         fi
2622 fi
2623
2624 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2625         if test $ol_with_kerberos = no ; then
2626                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2627         elif test $ol_with_kerberos = auto ; then
2628                 ol_with_kerberos=yes
2629         fi
2630
2631 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2632         if test $ol_with_kerberos = auto ; then
2633                 ol_with_kerberos=no
2634         elif test $ol_with_kerberos != no ; then
2635                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2636                 ol_with_kerberos=no
2637         fi
2638 fi
2639
2640 if test $ol_enable_spasswd = yes ; then
2641         if test $ol_with_cyrus_sasl = no ; then
2642                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2643         fi
2644         ol_with_cyrus_sasl=yes
2645 fi
2646
2647 echo "$ac_t""done" 1>&6
2648
2649 LDAP_LIBS=
2650 LDIF_LIBS=
2651 LDBM_LIB=
2652 LDBM_LIBS=
2653 LTHREAD_LIBS=
2654 LUTIL_LIBS=
2655
2656 SLAPD_LIBS=
2657 SLURPD_LIBS=
2658
2659 BUILD_SLAPD=no
2660 BUILD_SLURPD=no
2661
2662 BUILD_THREAD=no
2663
2664 BUILD_BDB=no
2665 BUILD_DNSSRV=no
2666 BUILD_LDAP=no
2667 BUILD_LDBM=no
2668 BUILD_META=no
2669 BUILD_MONITOR=no
2670 BUILD_PASSWD=no
2671 BUILD_PERL=no
2672 BUILD_SHELL=no
2673 BUILD_SQL=no
2674 BUILD_TCL=no
2675
2676 BUILD_BDB_DYNAMIC=static
2677 BUILD_DNSSRV_DYNAMIC=static
2678 BUILD_LDAP_DYNAMIC=static
2679 BUILD_LDBM_DYNAMIC=static
2680 BUILD_META_DYNAMIC=static
2681 BUILD_MONITOR_DYNAMIC=static
2682 BUILD_PASSWD_DYNAMIC=static
2683 BUILD_PERL_DYNAMIC=static
2684 BUILD_SHELL_DYNAMIC=static
2685 BUILD_TCL_DYNAMIC=static
2686 BUILD_SQL_DYNAMIC=static
2687
2688 SLAPD_MODULES_LDFLAGS=
2689 SLAPD_MODULES_CPPFLAGS=
2690 SLAPD_MODULES_LIST=
2691
2692 SLAPD_PERL_LDFLAGS=
2693 MOD_PERL_LDFLAGS=
2694 PERL_CPPFLAGS=
2695
2696 SLAPD_SQL_LDFLAGS=
2697 SLAPD_SQL_LIBS=
2698 SLAPD_SQL_INCLUDES=
2699
2700 MOD_TCL_LIB=
2701 KRB4_LIBS=
2702 KRB5_LIBS=
2703 READLINE_LIBS=
2704 SASL_LIBS=
2705 TERMCAP_LIBS=
2706 TLS_LIBS=
2707 MODULES_LIBS=
2708 AUTH_LIBS=
2709
2710 SLAPD_SLP_LIBS=
2711
2712
2713
2714 cat >> confdefs.h <<\EOF
2715 #define HAVE_MKVERSION 1
2716 EOF
2717
2718
2719
2720
2721 ol_aix_threads=no
2722 case "$target" in
2723 *-*-aix*)       if test -z "$CC" ; then
2724                 case "$ol_with_threads" in
2725                 auto | yes |  posix) ol_aix_threads=yes ;;
2726                 esac
2727         fi
2728 ;;
2729 esac
2730
2731 if test $ol_aix_threads = yes ; then
2732         if test -z "${CC}" ; then
2733                 for ac_prog in cc_r xlc_r cc
2734 do
2735 # Extract the first word of "$ac_prog", so it can be a program name with args.
2736 set dummy $ac_prog; ac_word=$2
2737 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2738 echo "configure:2739: checking for $ac_word" >&5
2739 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2740   echo $ac_n "(cached) $ac_c" 1>&6
2741 else
2742   if test -n "$CC"; then
2743   ac_cv_prog_CC="$CC" # Let the user override the test.
2744 else
2745   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2746   ac_dummy="$PATH"
2747   for ac_dir in $ac_dummy; do
2748     test -z "$ac_dir" && ac_dir=.
2749     if test -f $ac_dir/$ac_word; then
2750       ac_cv_prog_CC="$ac_prog"
2751       break
2752     fi
2753   done
2754   IFS="$ac_save_ifs"
2755 fi
2756 fi
2757 CC="$ac_cv_prog_CC"
2758 if test -n "$CC"; then
2759   echo "$ac_t""$CC" 1>&6
2760 else
2761   echo "$ac_t""no" 1>&6
2762 fi
2763
2764 test -n "$CC" && break
2765 done
2766
2767
2768                 if test "$CC" = cc ; then
2769                                                 if test $ol_with_threads != auto ; then
2770                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2771                         else
2772                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2773                         fi
2774                         ol_with_threads=no
2775                 fi
2776         fi
2777
2778         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2779                 ol_with_threads=posix
2780                 ol_cv_pthread_create=yes
2781         fi
2782 fi
2783
2784 if test -z "${CC}"; then
2785         for ac_prog in cc
2786 do
2787 # Extract the first word of "$ac_prog", so it can be a program name with args.
2788 set dummy $ac_prog; ac_word=$2
2789 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2790 echo "configure:2791: checking for $ac_word" >&5
2791 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2792   echo $ac_n "(cached) $ac_c" 1>&6
2793 else
2794   if test -n "$CC"; then
2795   ac_cv_prog_CC="$CC" # Let the user override the test.
2796 else
2797   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2798   ac_dummy="$PATH"
2799   for ac_dir in $ac_dummy; do
2800     test -z "$ac_dir" && ac_dir=.
2801     if test -f $ac_dir/$ac_word; then
2802       ac_cv_prog_CC="$ac_prog"
2803       break
2804     fi
2805   done
2806   IFS="$ac_save_ifs"
2807 fi
2808 fi
2809 CC="$ac_cv_prog_CC"
2810 if test -n "$CC"; then
2811   echo "$ac_t""$CC" 1>&6
2812 else
2813   echo "$ac_t""no" 1>&6
2814 fi
2815
2816 test -n "$CC" && break
2817 done
2818
2819 fi
2820
2821
2822 for ac_prog in ar gar
2823 do
2824 # Extract the first word of "$ac_prog", so it can be a program name with args.
2825 set dummy $ac_prog; ac_word=$2
2826 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2827 echo "configure:2828: checking for $ac_word" >&5
2828 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2829   echo $ac_n "(cached) $ac_c" 1>&6
2830 else
2831   if test -n "$AR"; then
2832   ac_cv_prog_AR="$AR" # Let the user override the test.
2833 else
2834   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2835   ac_dummy="$PATH"
2836   for ac_dir in $ac_dummy; do
2837     test -z "$ac_dir" && ac_dir=.
2838     if test -f $ac_dir/$ac_word; then
2839       ac_cv_prog_AR="$ac_prog"
2840       break
2841     fi
2842   done
2843   IFS="$ac_save_ifs"
2844 fi
2845 fi
2846 AR="$ac_cv_prog_AR"
2847 if test -n "$AR"; then
2848   echo "$ac_t""$AR" 1>&6
2849 else
2850   echo "$ac_t""no" 1>&6
2851 fi
2852
2853 test -n "$AR" && break
2854 done
2855 test -n "$AR" || AR="ar"
2856
2857
2858
2859
2860 # Check whether --enable-fast-install or --disable-fast-install was given.
2861 if test "${enable_fast_install+set}" = set; then
2862   enableval="$enable_fast_install"
2863   p=${PACKAGE-default}
2864 case "$enableval" in
2865 yes) enable_fast_install=yes ;;
2866 no) enable_fast_install=no ;;
2867 *)
2868   enable_fast_install=no
2869   # Look at the argument we got.  We use all the common list separators.
2870   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2871   for pkg in $enableval; do
2872     if test "X$pkg" = "X$p"; then
2873       enable_fast_install=yes
2874     fi
2875   done
2876   IFS="$ac_save_ifs"
2877   ;;
2878 esac
2879 else
2880   enable_fast_install=yes
2881 fi
2882
2883 # Extract the first word of "ranlib", so it can be a program name with args.
2884 set dummy ranlib; ac_word=$2
2885 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2886 echo "configure:2887: checking for $ac_word" >&5
2887 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2888   echo $ac_n "(cached) $ac_c" 1>&6
2889 else
2890   if test -n "$RANLIB"; then
2891   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2892 else
2893   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2894   ac_dummy="$PATH"
2895   for ac_dir in $ac_dummy; do
2896     test -z "$ac_dir" && ac_dir=.
2897     if test -f $ac_dir/$ac_word; then
2898       ac_cv_prog_RANLIB="ranlib"
2899       break
2900     fi
2901   done
2902   IFS="$ac_save_ifs"
2903   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2904 fi
2905 fi
2906 RANLIB="$ac_cv_prog_RANLIB"
2907 if test -n "$RANLIB"; then
2908   echo "$ac_t""$RANLIB" 1>&6
2909 else
2910   echo "$ac_t""no" 1>&6
2911 fi
2912
2913 # Extract the first word of "gcc", so it can be a program name with args.
2914 set dummy gcc; ac_word=$2
2915 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2916 echo "configure:2917: checking for $ac_word" >&5
2917 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2918   echo $ac_n "(cached) $ac_c" 1>&6
2919 else
2920   if test -n "$CC"; then
2921   ac_cv_prog_CC="$CC" # Let the user override the test.
2922 else
2923   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2924   ac_dummy="$PATH"
2925   for ac_dir in $ac_dummy; do
2926     test -z "$ac_dir" && ac_dir=.
2927     if test -f $ac_dir/$ac_word; then
2928       ac_cv_prog_CC="gcc"
2929       break
2930     fi
2931   done
2932   IFS="$ac_save_ifs"
2933 fi
2934 fi
2935 CC="$ac_cv_prog_CC"
2936 if test -n "$CC"; then
2937   echo "$ac_t""$CC" 1>&6
2938 else
2939   echo "$ac_t""no" 1>&6
2940 fi
2941
2942 if test -z "$CC"; then
2943   # Extract the first word of "cc", so it can be a program name with args.
2944 set dummy cc; ac_word=$2
2945 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2946 echo "configure:2947: checking for $ac_word" >&5
2947 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2948   echo $ac_n "(cached) $ac_c" 1>&6
2949 else
2950   if test -n "$CC"; then
2951   ac_cv_prog_CC="$CC" # Let the user override the test.
2952 else
2953   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2954   ac_prog_rejected=no
2955   ac_dummy="$PATH"
2956   for ac_dir in $ac_dummy; do
2957     test -z "$ac_dir" && ac_dir=.
2958     if test -f $ac_dir/$ac_word; then
2959       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2960         ac_prog_rejected=yes
2961         continue
2962       fi
2963       ac_cv_prog_CC="cc"
2964       break
2965     fi
2966   done
2967   IFS="$ac_save_ifs"
2968 if test $ac_prog_rejected = yes; then
2969   # We found a bogon in the path, so make sure we never use it.
2970   set dummy $ac_cv_prog_CC
2971   shift
2972   if test $# -gt 0; then
2973     # We chose a different compiler from the bogus one.
2974     # However, it has the same basename, so the bogon will be chosen
2975     # first if we set CC to just the basename; use the full file name.
2976     shift
2977     set dummy "$ac_dir/$ac_word" "$@"
2978     shift
2979     ac_cv_prog_CC="$@"
2980   fi
2981 fi
2982 fi
2983 fi
2984 CC="$ac_cv_prog_CC"
2985 if test -n "$CC"; then
2986   echo "$ac_t""$CC" 1>&6
2987 else
2988   echo "$ac_t""no" 1>&6
2989 fi
2990
2991   if test -z "$CC"; then
2992     case "`uname -s`" in
2993     *win32* | *WIN32* | *CYGWIN*)
2994       # Extract the first word of "cl", so it can be a program name with args.
2995 set dummy cl; ac_word=$2
2996 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2997 echo "configure:2998: checking for $ac_word" >&5
2998 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2999   echo $ac_n "(cached) $ac_c" 1>&6
3000 else
3001   if test -n "$CC"; then
3002   ac_cv_prog_CC="$CC" # Let the user override the test.
3003 else
3004   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3005   ac_dummy="$PATH"
3006   for ac_dir in $ac_dummy; do
3007     test -z "$ac_dir" && ac_dir=.
3008     if test -f $ac_dir/$ac_word; then
3009       ac_cv_prog_CC="cl"
3010       break
3011     fi
3012   done
3013   IFS="$ac_save_ifs"
3014 fi
3015 fi
3016 CC="$ac_cv_prog_CC"
3017 if test -n "$CC"; then
3018   echo "$ac_t""$CC" 1>&6
3019 else
3020   echo "$ac_t""no" 1>&6
3021 fi
3022  ;;
3023     esac
3024   fi
3025   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
3026 fi
3027
3028 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3029 echo "configure:3030: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
3030
3031 ac_ext=c
3032 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3033 ac_cpp='$CPP $CPPFLAGS'
3034 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3035 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3036 cross_compiling=$ac_cv_prog_cc_cross
3037
3038 cat > conftest.$ac_ext << EOF
3039
3040 #line 3041 "configure"
3041 #include "confdefs.h"
3042
3043 main(){return(0);}
3044 EOF
3045 if { (eval echo configure:3046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3046   ac_cv_prog_cc_works=yes
3047   # If we can't run a trivial program, we are probably using a cross compiler.
3048   if (./conftest; exit) 2>/dev/null; then
3049     ac_cv_prog_cc_cross=no
3050   else
3051     ac_cv_prog_cc_cross=yes
3052   fi
3053 else
3054   echo "configure: failed program was:" >&5
3055   cat conftest.$ac_ext >&5
3056   ac_cv_prog_cc_works=no
3057 fi
3058 rm -fr conftest*
3059 ac_ext=c
3060 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3061 ac_cpp='$CPP $CPPFLAGS'
3062 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3063 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3064 cross_compiling=$ac_cv_prog_cc_cross
3065
3066 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3067 if test $ac_cv_prog_cc_works = no; then
3068   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3069 fi
3070 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3071 echo "configure:3072: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3072 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3073 cross_compiling=$ac_cv_prog_cc_cross
3074
3075 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3076 echo "configure:3077: checking whether we are using GNU C" >&5
3077 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3078   echo $ac_n "(cached) $ac_c" 1>&6
3079 else
3080   cat > conftest.c <<EOF
3081 #ifdef __GNUC__
3082   yes;
3083 #endif
3084 EOF
3085 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3086   ac_cv_prog_gcc=yes
3087 else
3088   ac_cv_prog_gcc=no
3089 fi
3090 fi
3091
3092 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3093
3094 if test $ac_cv_prog_gcc = yes; then
3095   GCC=yes
3096 else
3097   GCC=
3098 fi
3099
3100 ac_test_CFLAGS="${CFLAGS+set}"
3101 ac_save_CFLAGS="$CFLAGS"
3102 CFLAGS=
3103 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3104 echo "configure:3105: checking whether ${CC-cc} accepts -g" >&5
3105 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3106   echo $ac_n "(cached) $ac_c" 1>&6
3107 else
3108   echo 'void f(){}' > conftest.c
3109 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3110   ac_cv_prog_cc_g=yes
3111 else
3112   ac_cv_prog_cc_g=no
3113 fi
3114 rm -f conftest*
3115
3116 fi
3117
3118 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3119 if test "$ac_test_CFLAGS" = set; then
3120   CFLAGS="$ac_save_CFLAGS"
3121 elif test $ac_cv_prog_cc_g = yes; then
3122   if test "$GCC" = yes; then
3123     CFLAGS="-g -O2"
3124   else
3125     CFLAGS="-g"
3126   fi
3127 else
3128   if test "$GCC" = yes; then
3129     CFLAGS="-O2"
3130   else
3131     CFLAGS=
3132   fi
3133 fi
3134
3135 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3136 if test "${with_gnu_ld+set}" = set; then
3137   withval="$with_gnu_ld"
3138   test "$withval" = no || with_gnu_ld=yes
3139 else
3140   with_gnu_ld=no
3141 fi
3142
3143 ac_prog=ld
3144 if test "$ac_cv_prog_gcc" = yes; then
3145   # Check if gcc -print-prog-name=ld gives a path.
3146   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3147 echo "configure:3148: checking for ld used by GCC" >&5
3148   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3149   case "$ac_prog" in
3150     # Accept absolute paths.
3151     [\\/]* | [A-Za-z]:[\\/]*)
3152       re_direlt='/[^/][^/]*/\.\./'
3153       # Canonicalize the path of ld
3154       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3155       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3156         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3157       done
3158       test -z "$LD" && LD="$ac_prog"
3159       ;;
3160   "")
3161     # If it fails, then pretend we aren't using GCC.
3162     ac_prog=ld
3163     ;;
3164   *)
3165     # If it is relative, then search for the first ld in PATH.
3166     with_gnu_ld=unknown
3167     ;;
3168   esac
3169 elif test "$with_gnu_ld" = yes; then
3170   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3171 echo "configure:3172: checking for GNU ld" >&5
3172 else
3173   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3174 echo "configure:3175: checking for non-GNU ld" >&5
3175 fi
3176 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3177   echo $ac_n "(cached) $ac_c" 1>&6
3178 else
3179   if test -z "$LD"; then
3180   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3181   for ac_dir in $PATH; do
3182     test -z "$ac_dir" && ac_dir=.
3183     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3184       ac_cv_path_LD="$ac_dir/$ac_prog"
3185       # Check to see if the program is GNU ld.  I'd rather use --version,
3186       # but apparently some GNU ld's only accept -v.
3187       # Break only if it was the GNU/non-GNU ld that we prefer.
3188       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3189         test "$with_gnu_ld" != no && break
3190       else
3191         test "$with_gnu_ld" != yes && break
3192       fi
3193     fi
3194   done
3195   IFS="$ac_save_ifs"
3196 else
3197   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3198 fi
3199 fi
3200
3201 LD="$ac_cv_path_LD"
3202 if test -n "$LD"; then
3203   echo "$ac_t""$LD" 1>&6
3204 else
3205   echo "$ac_t""no" 1>&6
3206 fi
3207 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3208 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3209 echo "configure:3210: checking if the linker ($LD) is GNU ld" >&5
3210 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3211   echo $ac_n "(cached) $ac_c" 1>&6
3212 else
3213   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3214 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3215   ac_cv_prog_gnu_ld=yes
3216 else
3217   ac_cv_prog_gnu_ld=no
3218 fi
3219 fi
3220
3221 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3222
3223
3224 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3225 echo "configure:3226: checking for BSD-compatible nm" >&5
3226 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3227   echo $ac_n "(cached) $ac_c" 1>&6
3228 else
3229   if test -n "$NM"; then
3230   # Let the user override the test.
3231   ac_cv_path_NM="$NM"
3232 else
3233   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3234   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3235     test -z "$ac_dir" && ac_dir=.
3236     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3237       # Check to see if the nm accepts a BSD-compat flag.
3238       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3239       #   nm: unknown option "B" ignored
3240       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3241         ac_cv_path_NM="$ac_dir/nm -B"
3242         break
3243       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3244         ac_cv_path_NM="$ac_dir/nm -p"
3245         break
3246       else
3247         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3248         continue # so that we can try to find one that supports BSD flags
3249       fi
3250     fi
3251   done
3252   IFS="$ac_save_ifs"
3253   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3254 fi
3255 fi
3256
3257 NM="$ac_cv_path_NM"
3258 echo "$ac_t""$NM" 1>&6
3259
3260 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3261 echo "configure:3262: checking whether ln -s works" >&5
3262 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3263   echo $ac_n "(cached) $ac_c" 1>&6
3264 else
3265   rm -f conftestdata
3266 if ln -s X conftestdata 2>/dev/null
3267 then
3268   rm -f conftestdata
3269   ac_cv_prog_LN_S="ln -s"
3270 else
3271   ac_cv_prog_LN_S=ln
3272 fi
3273 fi
3274 LN_S="$ac_cv_prog_LN_S"
3275 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3276   echo "$ac_t""yes" 1>&6
3277 else
3278   echo "$ac_t""no" 1>&6
3279 fi
3280
3281 if test $host != $build; then
3282   ac_tool_prefix=${host_alias}-
3283 else
3284   ac_tool_prefix=
3285 fi
3286
3287
3288 case "$target" in
3289 NONE) lt_target="$host" ;;
3290 *) lt_target="$target" ;;
3291 esac
3292
3293 # Check for any special flags to pass to ltconfig.
3294 libtool_flags="--cache-file=$cache_file"
3295 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3296 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3297 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3298 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3299 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3300 libtool_flags="$libtool_flags --enable-dlopen"
3301 libtool_flags="$libtool_flags --enable-win32-dll"
3302 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3303 if test "${enable_libtool_lock+set}" = set; then
3304   enableval="$enable_libtool_lock"
3305   :
3306 fi
3307
3308 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3309 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3310
3311 # Some flags need to be propagated to the compiler or linker for good
3312 # libtool support.
3313 case "$lt_target" in
3314 *-*-irix6*)
3315   # Find out which ABI we are using.
3316   echo '#line 3317 "configure"' > conftest.$ac_ext
3317   if { (eval echo configure:3318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3318     case "`/usr/bin/file conftest.o`" in
3319     *32-bit*)
3320       LD="${LD-ld} -32"
3321       ;;
3322     *N32*)
3323       LD="${LD-ld} -n32"
3324       ;;
3325     *64-bit*)
3326       LD="${LD-ld} -64"
3327       ;;
3328     esac
3329   fi
3330   rm -rf conftest*
3331   ;;
3332
3333 *-*-sco3.2v5*)
3334   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3335   SAVE_CFLAGS="$CFLAGS"
3336   CFLAGS="$CFLAGS -belf"
3337   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3338 echo "configure:3339: checking whether the C compiler needs -belf" >&5
3339 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3340   echo $ac_n "(cached) $ac_c" 1>&6
3341 else
3342   cat > conftest.$ac_ext <<EOF
3343 #line 3344 "configure"
3344 #include "confdefs.h"
3345
3346 int main() {
3347
3348 ; return 0; }
3349 EOF
3350 if { (eval echo configure:3351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3351   rm -rf conftest*
3352   lt_cv_cc_needs_belf=yes
3353 else
3354   echo "configure: failed program was:" >&5
3355   cat conftest.$ac_ext >&5
3356   rm -rf conftest*
3357   lt_cv_cc_needs_belf=no
3358 fi
3359 rm -f conftest*
3360 fi
3361
3362 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3363   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3364     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3365     CFLAGS="$SAVE_CFLAGS"
3366   fi
3367   ;;
3368
3369 *-*-cygwin* | *-*-mingw*)
3370   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3371 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3372 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3373 echo "configure:3374: checking for $ac_word" >&5
3374 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3375   echo $ac_n "(cached) $ac_c" 1>&6
3376 else
3377   if test -n "$DLLTOOL"; then
3378   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3379 else
3380   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3381   ac_dummy="$PATH"
3382   for ac_dir in $ac_dummy; do
3383     test -z "$ac_dir" && ac_dir=.
3384     if test -f $ac_dir/$ac_word; then
3385       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3386       break
3387     fi
3388   done
3389   IFS="$ac_save_ifs"
3390 fi
3391 fi
3392 DLLTOOL="$ac_cv_prog_DLLTOOL"
3393 if test -n "$DLLTOOL"; then
3394   echo "$ac_t""$DLLTOOL" 1>&6
3395 else
3396   echo "$ac_t""no" 1>&6
3397 fi
3398
3399
3400 if test -z "$ac_cv_prog_DLLTOOL"; then
3401 if test -n "$ac_tool_prefix"; then
3402   # Extract the first word of "dlltool", so it can be a program name with args.
3403 set dummy dlltool; ac_word=$2
3404 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3405 echo "configure:3406: checking for $ac_word" >&5
3406 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3407   echo $ac_n "(cached) $ac_c" 1>&6
3408 else
3409   if test -n "$DLLTOOL"; then
3410   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3411 else
3412   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3413   ac_dummy="$PATH"
3414   for ac_dir in $ac_dummy; do
3415     test -z "$ac_dir" && ac_dir=.
3416     if test -f $ac_dir/$ac_word; then
3417       ac_cv_prog_DLLTOOL="dlltool"
3418       break
3419     fi
3420   done
3421   IFS="$ac_save_ifs"
3422   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3423 fi
3424 fi
3425 DLLTOOL="$ac_cv_prog_DLLTOOL"
3426 if test -n "$DLLTOOL"; then
3427   echo "$ac_t""$DLLTOOL" 1>&6
3428 else
3429   echo "$ac_t""no" 1>&6
3430 fi
3431
3432 else
3433   DLLTOOL="false"
3434 fi
3435 fi
3436
3437   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3438 set dummy ${ac_tool_prefix}as; ac_word=$2
3439 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3440 echo "configure:3441: checking for $ac_word" >&5
3441 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3442   echo $ac_n "(cached) $ac_c" 1>&6
3443 else
3444   if test -n "$AS"; then
3445   ac_cv_prog_AS="$AS" # Let the user override the test.
3446 else
3447   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3448   ac_dummy="$PATH"
3449   for ac_dir in $ac_dummy; do
3450     test -z "$ac_dir" && ac_dir=.
3451     if test -f $ac_dir/$ac_word; then
3452       ac_cv_prog_AS="${ac_tool_prefix}as"
3453       break
3454     fi
3455   done
3456   IFS="$ac_save_ifs"
3457 fi
3458 fi
3459 AS="$ac_cv_prog_AS"
3460 if test -n "$AS"; then
3461   echo "$ac_t""$AS" 1>&6
3462 else
3463   echo "$ac_t""no" 1>&6
3464 fi
3465
3466
3467 if test -z "$ac_cv_prog_AS"; then
3468 if test -n "$ac_tool_prefix"; then
3469   # Extract the first word of "as", so it can be a program name with args.
3470 set dummy as; ac_word=$2
3471 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3472 echo "configure:3473: checking for $ac_word" >&5
3473 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3474   echo $ac_n "(cached) $ac_c" 1>&6
3475 else
3476   if test -n "$AS"; then
3477   ac_cv_prog_AS="$AS" # Let the user override the test.
3478 else
3479   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3480   ac_dummy="$PATH"
3481   for ac_dir in $ac_dummy; do
3482     test -z "$ac_dir" && ac_dir=.
3483     if test -f $ac_dir/$ac_word; then
3484       ac_cv_prog_AS="as"
3485       break
3486     fi
3487   done
3488   IFS="$ac_save_ifs"
3489   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3490 fi
3491 fi
3492 AS="$ac_cv_prog_AS"
3493 if test -n "$AS"; then
3494   echo "$ac_t""$AS" 1>&6
3495 else
3496   echo "$ac_t""no" 1>&6
3497 fi
3498
3499 else
3500   AS="false"
3501 fi
3502 fi
3503
3504   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3505 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3506 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3507 echo "configure:3508: checking for $ac_word" >&5
3508 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3509   echo $ac_n "(cached) $ac_c" 1>&6
3510 else
3511   if test -n "$OBJDUMP"; then
3512   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3513 else
3514   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3515   ac_dummy="$PATH"
3516   for ac_dir in $ac_dummy; do
3517     test -z "$ac_dir" && ac_dir=.
3518     if test -f $ac_dir/$ac_word; then
3519       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3520       break
3521     fi
3522   done
3523   IFS="$ac_save_ifs"
3524 fi
3525 fi
3526 OBJDUMP="$ac_cv_prog_OBJDUMP"
3527 if test -n "$OBJDUMP"; then
3528   echo "$ac_t""$OBJDUMP" 1>&6
3529 else
3530   echo "$ac_t""no" 1>&6
3531 fi
3532
3533
3534 if test -z "$ac_cv_prog_OBJDUMP"; then
3535 if test -n "$ac_tool_prefix"; then
3536   # Extract the first word of "objdump", so it can be a program name with args.
3537 set dummy objdump; ac_word=$2
3538 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3539 echo "configure:3540: checking for $ac_word" >&5
3540 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3541   echo $ac_n "(cached) $ac_c" 1>&6
3542 else
3543   if test -n "$OBJDUMP"; then
3544   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3545 else
3546   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3547   ac_dummy="$PATH"
3548   for ac_dir in $ac_dummy; do
3549     test -z "$ac_dir" && ac_dir=.
3550     if test -f $ac_dir/$ac_word; then
3551       ac_cv_prog_OBJDUMP="objdump"
3552       break
3553     fi
3554   done
3555   IFS="$ac_save_ifs"
3556   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3557 fi
3558 fi
3559 OBJDUMP="$ac_cv_prog_OBJDUMP"
3560 if test -n "$OBJDUMP"; then
3561   echo "$ac_t""$OBJDUMP" 1>&6
3562 else
3563   echo "$ac_t""no" 1>&6
3564 fi
3565
3566 else
3567   OBJDUMP="false"
3568 fi
3569 fi
3570
3571   ;;
3572
3573 esac
3574
3575
3576 # Save cache, so that ltconfig can load it
3577
3578
3579 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3580 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3581 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3582 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3583 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3584 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3585 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3586 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3587
3588 # Reload cache, that may have been modified by ltconfig
3589
3590
3591 # This can be used to rebuild libtool when needed
3592 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3593
3594 # Always use our own libtool.
3595 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3596
3597 # Redirect the config.log output again, so that the ltconfig log is not
3598 # clobbered by the next message.
3599 exec 5>>./config.log
3600
3601
3602 for ac_prog in mawk gawk nawk awk
3603 do
3604 # Extract the first word of "$ac_prog", so it can be a program name with args.
3605 set dummy $ac_prog; ac_word=$2
3606 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3607 echo "configure:3608: checking for $ac_word" >&5
3608 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3609   echo $ac_n "(cached) $ac_c" 1>&6
3610 else
3611   if test -n "$AWK"; then
3612   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3613 else
3614   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3615   ac_dummy="$PATH"
3616   for ac_dir in $ac_dummy; do
3617     test -z "$ac_dir" && ac_dir=.
3618     if test -f $ac_dir/$ac_word; then
3619       ac_cv_prog_AWK="$ac_prog"
3620       break
3621     fi
3622   done
3623   IFS="$ac_save_ifs"
3624 fi
3625 fi
3626 AWK="$ac_cv_prog_AWK"
3627 if test -n "$AWK"; then
3628   echo "$ac_t""$AWK" 1>&6
3629 else
3630   echo "$ac_t""no" 1>&6
3631 fi
3632
3633 test -n "$AWK" && break
3634 done
3635
3636 # test for ln hardlink support
3637 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3638 echo "configure:3639: checking whether ln works" >&5
3639 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3640   echo $ac_n "(cached) $ac_c" 1>&6
3641 else
3642   rm -f conftest.src conftest.dst
3643 echo "conftest" > conftest.src
3644 if ln conftest.src conftest.dst 2>/dev/null
3645 then
3646   ol_cv_prog_LN_H="ln"
3647 else
3648   ol_cv_prog_LN_H="cp"
3649 fi
3650 rm -f conftest.src conftest.dst
3651
3652 fi
3653 LN_H="$ol_cv_prog_LN_H"
3654 if test "$ol_cv_prog_LN_H" = "ln"; then
3655         echo "$ac_t""yes" 1>&6
3656 else
3657         echo "$ac_t""no" 1>&6
3658 fi
3659
3660 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3661 echo "configure:3662: checking whether ln -s works" >&5
3662 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3663   echo $ac_n "(cached) $ac_c" 1>&6
3664 else
3665   rm -f conftestdata
3666 if ln -s X conftestdata 2>/dev/null
3667 then
3668   rm -f conftestdata
3669   ac_cv_prog_LN_S="ln -s"
3670 else
3671   ac_cv_prog_LN_S=ln
3672 fi
3673 fi
3674 LN_S="$ac_cv_prog_LN_S"
3675 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3676   echo "$ac_t""yes" 1>&6
3677 else
3678   echo "$ac_t""no" 1>&6
3679 fi
3680
3681
3682 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3683         LN_S="$LN_H"
3684 fi
3685
3686 # Extract the first word of "sendmail", so it can be a program name with args.
3687 set dummy sendmail; ac_word=$2
3688 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3689 echo "configure:3690: checking for $ac_word" >&5
3690 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3691   echo $ac_n "(cached) $ac_c" 1>&6
3692 else
3693   case "$SENDMAIL" in
3694   /*)
3695   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3696   ;;
3697   ?:/*)
3698   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3699   ;;
3700   *)
3701   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3702   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3703   for ac_dir in $ac_dummy; do 
3704     test -z "$ac_dir" && ac_dir=.
3705     if test -f $ac_dir/$ac_word; then
3706       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3707       break
3708     fi
3709   done
3710   IFS="$ac_save_ifs"
3711   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3712   ;;
3713 esac
3714 fi
3715 SENDMAIL="$ac_cv_path_SENDMAIL"
3716 if test -n "$SENDMAIL"; then
3717   echo "$ac_t""$SENDMAIL" 1>&6
3718 else
3719   echo "$ac_t""no" 1>&6
3720 fi
3721
3722 # Extract the first word of "vi", so it can be a program name with args.
3723 set dummy vi; ac_word=$2
3724 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3725 echo "configure:3726: checking for $ac_word" >&5
3726 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3727   echo $ac_n "(cached) $ac_c" 1>&6
3728 else
3729   case "$EDITOR" in
3730   /*)
3731   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3732   ;;
3733   ?:/*)
3734   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3735   ;;
3736   *)
3737   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3738   ac_dummy="$PATH:/usr/ucb"
3739   for ac_dir in $ac_dummy; do 
3740     test -z "$ac_dir" && ac_dir=.
3741     if test -f $ac_dir/$ac_word; then
3742       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3743       break
3744     fi
3745   done
3746   IFS="$ac_save_ifs"
3747   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3748   ;;
3749 esac
3750 fi
3751 EDITOR="$ac_cv_path_EDITOR"
3752 if test -n "$EDITOR"; then
3753   echo "$ac_t""$EDITOR" 1>&6
3754 else
3755   echo "$ac_t""no" 1>&6
3756 fi
3757
3758 # Extract the first word of "finger", so it can be a program name with args.
3759 set dummy finger; ac_word=$2
3760 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3761 echo "configure:3762: checking for $ac_word" >&5
3762 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3763   echo $ac_n "(cached) $ac_c" 1>&6
3764 else
3765   case "$FINGER" in
3766   /*)
3767   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3768   ;;
3769   ?:/*)
3770   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3771   ;;
3772   *)
3773   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3774   ac_dummy="$PATH:/usr/ucb"
3775   for ac_dir in $ac_dummy; do 
3776     test -z "$ac_dir" && ac_dir=.
3777     if test -f $ac_dir/$ac_word; then
3778       ac_cv_path_FINGER="$ac_dir/$ac_word"
3779       break
3780     fi
3781   done
3782   IFS="$ac_save_ifs"
3783   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3784   ;;
3785 esac
3786 fi
3787 FINGER="$ac_cv_path_FINGER"
3788 if test -n "$FINGER"; then
3789   echo "$ac_t""$FINGER" 1>&6
3790 else
3791   echo "$ac_t""no" 1>&6
3792 fi
3793
3794
3795 ol_link_perl=no
3796 if test $ol_enable_perl != no ; then
3797         # Extract the first word of "perl", so it can be a program name with args.
3798 set dummy perl; ac_word=$2
3799 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3800 echo "configure:3801: checking for $ac_word" >&5
3801 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3802   echo $ac_n "(cached) $ac_c" 1>&6
3803 else
3804   case "$PERLBIN" in
3805   /*)
3806   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3807   ;;
3808   ?:/*)
3809   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3810   ;;
3811   *)
3812   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3813   ac_dummy="$PATH"
3814   for ac_dir in $ac_dummy; do 
3815     test -z "$ac_dir" && ac_dir=.
3816     if test -f $ac_dir/$ac_word; then
3817       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3818       break
3819     fi
3820   done
3821   IFS="$ac_save_ifs"
3822   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3823   ;;
3824 esac
3825 fi
3826 PERLBIN="$ac_cv_path_PERLBIN"
3827 if test -n "$PERLBIN"; then
3828   echo "$ac_t""$PERLBIN" 1>&6
3829 else
3830   echo "$ac_t""no" 1>&6
3831 fi
3832
3833
3834         if test "no$PERLBIN" = "no" ; then
3835                 if test $ol_enable_perl = yes ; then
3836                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3837                 fi
3838
3839         else
3840                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3841                 if test x"$ol_with_perl_module" = "xstatic" ; then
3842                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3843                 else
3844                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3845                 fi
3846                                 ol_link_perl=yes
3847         fi
3848 fi
3849
3850 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3851 echo "configure:3852: checking how to run the C preprocessor" >&5
3852 # On Suns, sometimes $CPP names a directory.
3853 if test -n "$CPP" && test -d "$CPP"; then
3854   CPP=
3855 fi
3856 if test -z "$CPP"; then
3857 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3858   echo $ac_n "(cached) $ac_c" 1>&6
3859 else
3860     # This must be in double quotes, not single quotes, because CPP may get
3861   # substituted into the Makefile and "${CC-cc}" will confuse make.
3862   CPP="${CC-cc} -E"
3863   # On the NeXT, cc -E runs the code through the compiler's parser,
3864   # not just through cpp.
3865   cat > conftest.$ac_ext <<EOF
3866 #line 3867 "configure"
3867 #include "confdefs.h"
3868 #include <assert.h>
3869 Syntax Error
3870 EOF
3871 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3872 { (eval echo configure:3873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3873 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3874 if test -z "$ac_err"; then
3875   :
3876 else
3877   echo "$ac_err" >&5
3878   echo "configure: failed program was:" >&5
3879   cat conftest.$ac_ext >&5
3880   rm -rf conftest*
3881   CPP="${CC-cc} -E -traditional-cpp"
3882   cat > conftest.$ac_ext <<EOF
3883 #line 3884 "configure"
3884 #include "confdefs.h"
3885 #include <assert.h>
3886 Syntax Error
3887 EOF
3888 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3889 { (eval echo configure:3890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3890 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3891 if test -z "$ac_err"; then
3892   :
3893 else
3894   echo "$ac_err" >&5
3895   echo "configure: failed program was:" >&5
3896   cat conftest.$ac_ext >&5
3897   rm -rf conftest*
3898   CPP="${CC-cc} -nologo -E"
3899   cat > conftest.$ac_ext <<EOF
3900 #line 3901 "configure"
3901 #include "confdefs.h"
3902 #include <assert.h>
3903 Syntax Error
3904 EOF
3905 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3906 { (eval echo configure:3907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3907 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3908 if test -z "$ac_err"; then
3909   :
3910 else
3911   echo "$ac_err" >&5
3912   echo "configure: failed program was:" >&5
3913   cat conftest.$ac_ext >&5
3914   rm -rf conftest*
3915   CPP=/lib/cpp
3916 fi
3917 rm -f conftest*
3918 fi
3919 rm -f conftest*
3920 fi
3921 rm -f conftest*
3922   ac_cv_prog_CPP="$CPP"
3923 fi
3924   CPP="$ac_cv_prog_CPP"
3925 else
3926   ac_cv_prog_CPP="$CPP"
3927 fi
3928 echo "$ac_t""$CPP" 1>&6
3929
3930
3931 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3932         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3933
3934 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3935         echo "configure: warning: programs compiled here do run here..." 1>&2
3936         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3937
3938 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3939         echo "configure: warning: programs compiled here do not run here..." 1>&2
3940         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3941 fi
3942
3943 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3944 echo "configure:3945: checking for AIX" >&5
3945 cat > conftest.$ac_ext <<EOF
3946 #line 3947 "configure"
3947 #include "confdefs.h"
3948 #ifdef _AIX
3949   yes
3950 #endif
3951
3952 EOF
3953 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3954   egrep "yes" >/dev/null 2>&1; then
3955   rm -rf conftest*
3956   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3957 #define _ALL_SOURCE 1
3958 EOF
3959
3960 else
3961   rm -rf conftest*
3962   echo "$ac_t""no" 1>&6
3963 fi
3964 rm -f conftest*
3965
3966
3967 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3968 echo "configure:3969: checking for POSIXized ISC" >&5
3969 if test -d /etc/conf/kconfig.d &&
3970   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3971 then
3972   echo "$ac_t""yes" 1>&6
3973   ISC=yes # If later tests want to check for ISC.
3974   cat >> confdefs.h <<\EOF
3975 #define _POSIX_SOURCE 1
3976 EOF
3977
3978   if test "$GCC" = yes; then
3979     CC="$CC -posix"
3980   else
3981     CC="$CC -Xp"
3982   fi
3983 else
3984   echo "$ac_t""no" 1>&6
3985   ISC=
3986 fi
3987
3988 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3989 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3990 echo "configure:3991: checking for minix/config.h" >&5
3991 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3992   echo $ac_n "(cached) $ac_c" 1>&6
3993 else
3994   cat > conftest.$ac_ext <<EOF
3995 #line 3996 "configure"
3996 #include "confdefs.h"
3997 #include <minix/config.h>
3998 EOF
3999 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4000 { (eval echo configure:4001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4001 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4002 if test -z "$ac_err"; then
4003   rm -rf conftest*
4004   eval "ac_cv_header_$ac_safe=yes"
4005 else
4006   echo "$ac_err" >&5
4007   echo "configure: failed program was:" >&5
4008   cat conftest.$ac_ext >&5
4009   rm -rf conftest*
4010   eval "ac_cv_header_$ac_safe=no"
4011 fi
4012 rm -f conftest*
4013 fi
4014 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4015   echo "$ac_t""yes" 1>&6
4016   MINIX=yes
4017 else
4018   echo "$ac_t""no" 1>&6
4019 MINIX=
4020 fi
4021
4022 if test "$MINIX" = yes; then
4023   cat >> confdefs.h <<\EOF
4024 #define _POSIX_SOURCE 1
4025 EOF
4026
4027   cat >> confdefs.h <<\EOF
4028 #define _POSIX_1_SOURCE 2
4029 EOF
4030
4031   cat >> confdefs.h <<\EOF
4032 #define _MINIX 1
4033 EOF
4034
4035 fi
4036
4037
4038 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
4039 echo "configure:4040: checking for Cygwin environment" >&5
4040 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4041   echo $ac_n "(cached) $ac_c" 1>&6
4042 else
4043   cat > conftest.$ac_ext <<EOF
4044 #line 4045 "configure"
4045 #include "confdefs.h"
4046
4047 int main() {
4048
4049 #ifndef __CYGWIN__
4050 #define __CYGWIN__ __CYGWIN32__
4051 #endif
4052 return __CYGWIN__;
4053 ; return 0; }
4054 EOF
4055 if { (eval echo configure:4056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4056   rm -rf conftest*
4057   ac_cv_cygwin=yes
4058 else
4059   echo "configure: failed program was:" >&5
4060   cat conftest.$ac_ext >&5
4061   rm -rf conftest*
4062   ac_cv_cygwin=no
4063 fi
4064 rm -f conftest*
4065 fi
4066
4067 echo "$ac_t""$ac_cv_cygwin" 1>&6
4068 CYGWIN=
4069 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4070 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4071 echo "configure:4072: checking for mingw32 environment" >&5
4072 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4073   echo $ac_n "(cached) $ac_c" 1>&6
4074 else
4075   cat > conftest.$ac_ext <<EOF
4076 #line 4077 "configure"
4077 #include "confdefs.h"
4078
4079 int main() {
4080 return __MINGW32__;
4081 ; return 0; }
4082 EOF
4083 if { (eval echo configure:4084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4084   rm -rf conftest*
4085   ac_cv_mingw32=yes
4086 else
4087   echo "configure: failed program was:" >&5
4088   cat conftest.$ac_ext >&5
4089   rm -rf conftest*
4090   ac_cv_mingw32=no
4091 fi
4092 rm -f conftest*
4093 fi
4094
4095 echo "$ac_t""$ac_cv_mingw32" 1>&6
4096 MINGW32=
4097 test "$ac_cv_mingw32" = yes && MINGW32=yes
4098 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4099 echo "configure:4100: checking for EMX OS/2 environment" >&5
4100 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4101   echo $ac_n "(cached) $ac_c" 1>&6
4102 else
4103   cat > conftest.$ac_ext <<EOF
4104 #line 4105 "configure"
4105 #include "confdefs.h"
4106
4107 int main() {
4108 return __EMX__;
4109 ; return 0; }
4110 EOF
4111 if { (eval echo configure:4112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4112   rm -rf conftest*
4113   ac_cv_emxos2=yes
4114 else
4115   echo "configure: failed program was:" >&5
4116   cat conftest.$ac_ext >&5
4117   rm -rf conftest*
4118   ac_cv_emxos2=no
4119 fi
4120 rm -f conftest*
4121 fi
4122
4123 echo "$ac_t""$ac_cv_emxos2" 1>&6
4124 EMXOS2=
4125 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4126
4127
4128
4129 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4130 echo "configure:4131: checking for executable suffix" >&5
4131 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4132   echo $ac_n "(cached) $ac_c" 1>&6
4133 else
4134   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4135   ac_cv_exeext=.exe
4136 else
4137   rm -f conftest*
4138   echo 'int main () { return 0; }' > conftest.$ac_ext
4139   ac_cv_exeext=
4140   if { (eval echo configure:4141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4141     for file in conftest.*; do
4142       case $file in
4143       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4144       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4145       esac
4146     done
4147   else
4148     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4149   fi
4150   rm -f conftest*
4151   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4152 fi
4153 fi
4154
4155 EXEEXT=""
4156 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4157 echo "$ac_t""${ac_cv_exeext}" 1>&6
4158 ac_exeext=$EXEEXT
4159
4160 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4161 echo "configure:4162: checking for object suffix" >&5
4162 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4163   echo $ac_n "(cached) $ac_c" 1>&6
4164 else
4165   rm -f conftest*
4166 echo 'int i = 1;' > conftest.$ac_ext
4167 if { (eval echo configure:4168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4168   for ac_file in conftest.*; do
4169     case $ac_file in
4170     *.c) ;;
4171     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4172     esac
4173   done
4174 else
4175   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4176 fi
4177 rm -f conftest*
4178 fi
4179
4180 echo "$ac_t""$ac_cv_objext" 1>&6
4181 OBJEXT=$ac_cv_objext
4182 ac_objext=$ac_cv_objext
4183
4184
4185 cat >> confdefs.h <<EOF
4186 #define EXEEXT "${EXEEXT}"
4187 EOF
4188
4189
4190 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4191 echo "configure:4192: checking for be_app in -lbe" >&5
4192 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4193 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4194   echo $ac_n "(cached) $ac_c" 1>&6
4195 else
4196   ac_save_LIBS="$LIBS"
4197 LIBS="-lbe -lroot -lnet $LIBS"
4198 cat > conftest.$ac_ext <<EOF
4199 #line 4200 "configure"
4200 #include "confdefs.h"
4201 /* Override any gcc2 internal prototype to avoid an error.  */
4202 /* We use char because int might match the return type of a gcc2
4203     builtin and then its argument prototype would still apply.  */
4204 char be_app();
4205
4206 int main() {
4207 be_app()
4208 ; return 0; }
4209 EOF
4210 if { (eval echo configure:4211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4211   rm -rf conftest*
4212   eval "ac_cv_lib_$ac_lib_var=yes"
4213 else
4214   echo "configure: failed program was:" >&5
4215   cat conftest.$ac_ext >&5
4216   rm -rf conftest*
4217   eval "ac_cv_lib_$ac_lib_var=no"
4218 fi
4219 rm -f conftest*
4220 LIBS="$ac_save_LIBS"
4221
4222 fi
4223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4224   echo "$ac_t""yes" 1>&6
4225   LIBS="$LIBS -lbe -lroot -lnet"
4226 else
4227   echo "$ac_t""no" 1>&6
4228 :
4229 fi
4230
4231
4232
4233
4234
4235 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4236 echo "configure:4237: checking for ${CC-cc} option to accept ANSI C" >&5
4237 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4238   echo $ac_n "(cached) $ac_c" 1>&6
4239 else
4240   am_cv_prog_cc_stdc=no
4241 ac_save_CC="$CC"
4242 # Don't try gcc -ansi; that turns off useful extensions and
4243 # breaks some systems' header files.
4244 # AIX                   -qlanglvl=ansi
4245 # Ultrix and OSF/1      -std1
4246 # HP-UX 10.20 and later -Ae
4247 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4248 # SVR4                  -Xc -D__EXTENSIONS__
4249 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4250 do
4251   CC="$ac_save_CC $ac_arg"
4252   cat > conftest.$ac_ext <<EOF
4253 #line 4254 "configure"
4254 #include "confdefs.h"
4255 #include <stdarg.h>
4256 #include <stdio.h>
4257 #include <sys/types.h>
4258 #include <sys/stat.h>
4259 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4260 struct buf { int x; };
4261 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4262 static char *e (p, i)
4263      char **p;
4264      int i;
4265 {
4266   return p[i];
4267 }
4268 static char *f (char * (*g) (char **, int), char **p, ...)
4269 {
4270   char *s;
4271   va_list v;
4272   va_start (v,p);
4273   s = g (p, va_arg (v,int));
4274   va_end (v);
4275   return s;
4276 }
4277 int test (int i, double x);
4278 struct s1 {int (*f) (int a);};
4279 struct s2 {int (*f) (double a);};
4280 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4281 int argc;
4282 char **argv;
4283
4284 int main() {
4285
4286 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4287
4288 ; return 0; }
4289 EOF
4290 if { (eval echo configure:4291: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4291   rm -rf conftest*
4292   am_cv_prog_cc_stdc="$ac_arg"; break
4293 else
4294   echo "configure: failed program was:" >&5
4295   cat conftest.$ac_ext >&5
4296 fi
4297 rm -f conftest*
4298 done
4299 CC="$ac_save_CC"
4300
4301 fi
4302
4303 if test -z "$am_cv_prog_cc_stdc"; then
4304   echo "$ac_t""none needed" 1>&6
4305 else
4306   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4307 fi
4308 case "x$am_cv_prog_cc_stdc" in
4309   x|xno) ;;
4310   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4311 esac
4312
4313 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4314         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4315 fi
4316
4317 # test for make depend flag
4318 OL_MKDEP=
4319 OL_MKDEP_FLAGS=
4320 if test -z "${MKDEP}"; then
4321         OL_MKDEP="${CC-cc}"
4322         if test -z "${MKDEP_FLAGS}"; then
4323                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4324 echo "configure:4325: checking for ${OL_MKDEP} depend flag" >&5
4325 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4326   echo $ac_n "(cached) $ac_c" 1>&6
4327 else
4328   
4329                         ol_cv_mkdep=no
4330                         for flag in "-M" "-xM"; do
4331                                 cat > conftest.c <<EOF
4332  noCode;
4333 EOF
4334                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4335                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4336                                 then
4337                                         if test ! -f conftest."${ac_object}" ; then
4338                                                 ol_cv_mkdep=$flag
4339                                                 OL_MKDEP_FLAGS="$flag"
4340                                                 break
4341                                         fi
4342                                 fi
4343                         done
4344                         rm -f conftest*
4345                 
4346 fi
4347
4348 echo "$ac_t""$ol_cv_mkdep" 1>&6
4349         else
4350                 cc_cv_mkdep=yes
4351                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4352         fi
4353 else
4354         cc_cv_mkdep=yes
4355         OL_MKDEP="${MKDEP}"
4356         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4357 fi
4358
4359
4360
4361 if test "${ol_cv_mkdep}" = no ; then
4362         # this will soon become an error
4363         echo "configure: warning: do not know how to generate dependencies" 1>&2
4364 fi
4365
4366 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4367 echo "configure:4368: checking for afopen in -ls" >&5
4368 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4369 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4370   echo $ac_n "(cached) $ac_c" 1>&6
4371 else
4372   ac_save_LIBS="$LIBS"
4373 LIBS="-ls  $LIBS"
4374 cat > conftest.$ac_ext <<EOF
4375 #line 4376 "configure"
4376 #include "confdefs.h"
4377 /* Override any gcc2 internal prototype to avoid an error.  */
4378 /* We use char because int might match the return type of a gcc2
4379     builtin and then its argument prototype would still apply.  */
4380 char afopen();
4381
4382 int main() {
4383 afopen()
4384 ; return 0; }
4385 EOF
4386 if { (eval echo configure:4387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4387   rm -rf conftest*
4388   eval "ac_cv_lib_$ac_lib_var=yes"
4389 else
4390   echo "configure: failed program was:" >&5
4391   cat conftest.$ac_ext >&5
4392   rm -rf conftest*
4393   eval "ac_cv_lib_$ac_lib_var=no"
4394 fi
4395 rm -f conftest*
4396 LIBS="$ac_save_LIBS"
4397
4398 fi
4399 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4400   echo "$ac_t""yes" 1>&6
4401   
4402         AUTH_LIBS=-ls
4403         cat >> confdefs.h <<\EOF
4404 #define HAVE_AIX_SECURITY 1
4405 EOF
4406
4407
4408 else
4409   echo "$ac_t""no" 1>&6
4410 fi
4411
4412
4413
4414 ol_link_modules=no
4415 if test $ol_enable_modules != no ; then
4416         for ac_hdr in ltdl.h
4417 do
4418 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4419 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4420 echo "configure:4421: checking for $ac_hdr" >&5
4421 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4422   echo $ac_n "(cached) $ac_c" 1>&6
4423 else
4424   cat > conftest.$ac_ext <<EOF
4425 #line 4426 "configure"
4426 #include "confdefs.h"
4427 #include <$ac_hdr>
4428 EOF
4429 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4430 { (eval echo configure:4431: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4431 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4432 if test -z "$ac_err"; then
4433   rm -rf conftest*
4434   eval "ac_cv_header_$ac_safe=yes"
4435 else
4436   echo "$ac_err" >&5
4437   echo "configure: failed program was:" >&5
4438   cat conftest.$ac_ext >&5
4439   rm -rf conftest*
4440   eval "ac_cv_header_$ac_safe=no"
4441 fi
4442 rm -f conftest*
4443 fi
4444 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4445   echo "$ac_t""yes" 1>&6
4446     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4447   cat >> confdefs.h <<EOF
4448 #define $ac_tr_hdr 1
4449 EOF
4450  
4451 else
4452   echo "$ac_t""no" 1>&6
4453 fi
4454 done
4455
4456
4457         if test $ac_cv_header_ltdl_h = no ; then
4458                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4459         fi
4460
4461         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4462 echo "configure:4463: checking for lt_dlinit in -lltdl" >&5
4463 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4464 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4465   echo $ac_n "(cached) $ac_c" 1>&6
4466 else
4467   ac_save_LIBS="$LIBS"
4468 LIBS="-lltdl  $LIBS"
4469 cat > conftest.$ac_ext <<EOF
4470 #line 4471 "configure"
4471 #include "confdefs.h"
4472 /* Override any gcc2 internal prototype to avoid an error.  */
4473 /* We use char because int might match the return type of a gcc2
4474     builtin and then its argument prototype would still apply.  */
4475 char lt_dlinit();
4476
4477 int main() {
4478 lt_dlinit()
4479 ; return 0; }
4480 EOF
4481 if { (eval echo configure:4482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4482   rm -rf conftest*
4483   eval "ac_cv_lib_$ac_lib_var=yes"
4484 else
4485   echo "configure: failed program was:" >&5
4486   cat conftest.$ac_ext >&5
4487   rm -rf conftest*
4488   eval "ac_cv_lib_$ac_lib_var=no"
4489 fi
4490 rm -f conftest*
4491 LIBS="$ac_save_LIBS"
4492
4493 fi
4494 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4495   echo "$ac_t""yes" 1>&6
4496   
4497             MODULES_LIBS=-lltdl
4498             cat >> confdefs.h <<\EOF
4499 #define HAVE_LIBLTDL 1
4500 EOF
4501
4502         
4503 else
4504   echo "$ac_t""no" 1>&6
4505 fi
4506
4507
4508         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4509                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4510         fi
4511         ol_link_modules=yes
4512 else
4513         ol_with_bdb_module=static
4514         ol_with_dnssrv_module=static
4515         ol_with_ldap_module=static
4516         ol_with_ldbm_module=static
4517         ol_with_meta_module=static
4518         ol_with_monitor_module=static
4519         ol_with_passwd_module=static
4520         ol_with_perl_module=static
4521         ol_with_shell_module=static
4522         ol_with_tcl_module=static
4523         ol_with_sql_module=static
4524 fi
4525
4526 # test for EBCDIC
4527 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4528 echo "configure:4529: checking for EBCDIC" >&5
4529 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4530   echo $ac_n "(cached) $ac_c" 1>&6
4531 else
4532   
4533         cat > conftest.$ac_ext <<EOF
4534 #line 4535 "configure"
4535 #include "confdefs.h"
4536
4537 #if !('M' == 0xd4)
4538 #include <__ASCII__/generate_error.h>
4539 #endif
4540
4541 EOF
4542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4543 { (eval echo configure:4544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4545 if test -z "$ac_err"; then
4546   rm -rf conftest*
4547   ol_cv_cpp_ebcdic=yes
4548 else
4549   echo "$ac_err" >&5
4550   echo "configure: failed program was:" >&5
4551   cat conftest.$ac_ext >&5
4552   rm -rf conftest*
4553   ol_cv_cpp_ebcdic=no
4554 fi
4555 rm -f conftest*
4556 fi
4557
4558 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4559 if test $ol_cv_cpp_ebcdic = yes ; then
4560         cat >> confdefs.h <<\EOF
4561 #define HAVE_EBCDIC 1
4562 EOF
4563
4564 fi
4565
4566 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4567 echo "configure:4568: checking for ANSI C header files" >&5
4568 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4569   echo $ac_n "(cached) $ac_c" 1>&6
4570 else
4571   cat > conftest.$ac_ext <<EOF
4572 #line 4573 "configure"
4573 #include "confdefs.h"
4574 #include <stdlib.h>
4575 #include <stdarg.h>
4576 #include <string.h>
4577 #include <float.h>
4578 EOF
4579 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4580 { (eval echo configure:4581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4581 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4582 if test -z "$ac_err"; then
4583   rm -rf conftest*
4584   ol_cv_header_stdc=yes
4585 else
4586   echo "$ac_err" >&5
4587   echo "configure: failed program was:" >&5
4588   cat conftest.$ac_ext >&5
4589   rm -rf conftest*
4590   ol_cv_header_stdc=no
4591 fi
4592 rm -f conftest*
4593
4594 if test $ol_cv_header_stdc = yes; then
4595   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4596 cat > conftest.$ac_ext <<EOF
4597 #line 4598 "configure"
4598 #include "confdefs.h"
4599 #include <string.h>
4600 EOF
4601 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4602   egrep "memchr" >/dev/null 2>&1; then
4603   :
4604 else
4605   rm -rf conftest*
4606   ol_cv_header_stdc=no
4607 fi
4608 rm -f conftest*
4609
4610 fi
4611
4612 if test $ol_cv_header_stdc = yes; then
4613   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4614 cat > conftest.$ac_ext <<EOF
4615 #line 4616 "configure"
4616 #include "confdefs.h"
4617 #include <stdlib.h>
4618 EOF
4619 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4620   egrep "free" >/dev/null 2>&1; then
4621   :
4622 else
4623   rm -rf conftest*
4624   ol_cv_header_stdc=no
4625 fi
4626 rm -f conftest*
4627
4628 fi
4629
4630 if test $ol_cv_header_stdc = yes; then
4631   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4632 if test "$cross_compiling" = yes; then
4633   :
4634 else
4635   cat > conftest.$ac_ext <<EOF
4636 #line 4637 "configure"
4637 #include "confdefs.h"
4638 #include <ctype.h>
4639 #ifndef HAVE_EBCDIC
4640 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4641 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4642 #else
4643 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4644                 || ('j' <= (c) && (c) <= 'r') \
4645                 || ('s' <= (c) && (c) <= 'z'))
4646 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4647 #endif
4648 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4649 int main () { int i; for (i = 0; i < 256; i++)
4650 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4651 exit (0); }
4652
4653 EOF
4654 if { (eval echo configure:4655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4655 then
4656   :
4657 else
4658   echo "configure: failed program was:" >&5
4659   cat conftest.$ac_ext >&5
4660   rm -fr conftest*
4661   ol_cv_header_stdc=no
4662 fi
4663 rm -fr conftest*
4664 fi
4665
4666 fi
4667 fi
4668
4669 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4670 if test $ol_cv_header_stdc = yes; then
4671   cat >> confdefs.h <<\EOF
4672 #define STDC_HEADERS 1
4673 EOF
4674
4675 fi
4676 ac_cv_header_stdc=disable
4677
4678
4679 if test $ol_cv_header_stdc != yes; then
4680         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4681 fi
4682
4683 ac_header_dirent=no
4684 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4685 do
4686 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4687 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4688 echo "configure:4689: checking for $ac_hdr that defines DIR" >&5
4689 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4690   echo $ac_n "(cached) $ac_c" 1>&6
4691 else
4692   cat > conftest.$ac_ext <<EOF
4693 #line 4694 "configure"
4694 #include "confdefs.h"
4695 #include <sys/types.h>
4696 #include <$ac_hdr>
4697 int main() {
4698 DIR *dirp = 0;
4699 ; return 0; }
4700 EOF
4701 if { (eval echo configure:4702: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4702   rm -rf conftest*
4703   eval "ac_cv_header_dirent_$ac_safe=yes"
4704 else
4705   echo "configure: failed program was:" >&5
4706   cat conftest.$ac_ext >&5
4707   rm -rf conftest*
4708   eval "ac_cv_header_dirent_$ac_safe=no"
4709 fi
4710 rm -f conftest*
4711 fi
4712 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4713   echo "$ac_t""yes" 1>&6
4714     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4715   cat >> confdefs.h <<EOF
4716 #define $ac_tr_hdr 1
4717 EOF
4718  ac_header_dirent=$ac_hdr; break
4719 else
4720   echo "$ac_t""no" 1>&6
4721 fi
4722 done
4723 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4724 if test $ac_header_dirent = dirent.h; then
4725 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4726 echo "configure:4727: checking for opendir in -ldir" >&5
4727 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4728 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4729   echo $ac_n "(cached) $ac_c" 1>&6
4730 else
4731   ac_save_LIBS="$LIBS"
4732 LIBS="-ldir  $LIBS"
4733 cat > conftest.$ac_ext <<EOF
4734 #line 4735 "configure"
4735 #include "confdefs.h"
4736 /* Override any gcc2 internal prototype to avoid an error.  */
4737 /* We use char because int might match the return type of a gcc2
4738     builtin and then its argument prototype would still apply.  */
4739 char opendir();
4740
4741 int main() {
4742 opendir()
4743 ; return 0; }
4744 EOF
4745 if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4746   rm -rf conftest*
4747   eval "ac_cv_lib_$ac_lib_var=yes"
4748 else
4749   echo "configure: failed program was:" >&5
4750   cat conftest.$ac_ext >&5
4751   rm -rf conftest*
4752   eval "ac_cv_lib_$ac_lib_var=no"
4753 fi
4754 rm -f conftest*
4755 LIBS="$ac_save_LIBS"
4756
4757 fi
4758 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4759   echo "$ac_t""yes" 1>&6
4760   LIBS="$LIBS -ldir"
4761 else
4762   echo "$ac_t""no" 1>&6
4763 fi
4764
4765 else
4766 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4767 echo "configure:4768: checking for opendir in -lx" >&5
4768 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4769 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4770   echo $ac_n "(cached) $ac_c" 1>&6
4771 else
4772   ac_save_LIBS="$LIBS"
4773 LIBS="-lx  $LIBS"
4774 cat > conftest.$ac_ext <<EOF
4775 #line 4776 "configure"
4776 #include "confdefs.h"
4777 /* Override any gcc2 internal prototype to avoid an error.  */
4778 /* We use char because int might match the return type of a gcc2
4779     builtin and then its argument prototype would still apply.  */
4780 char opendir();
4781
4782 int main() {
4783 opendir()
4784 ; return 0; }
4785 EOF
4786 if { (eval echo configure:4787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4787   rm -rf conftest*
4788   eval "ac_cv_lib_$ac_lib_var=yes"
4789 else
4790   echo "configure: failed program was:" >&5
4791   cat conftest.$ac_ext >&5
4792   rm -rf conftest*
4793   eval "ac_cv_lib_$ac_lib_var=no"
4794 fi
4795 rm -f conftest*
4796 LIBS="$ac_save_LIBS"
4797
4798 fi
4799 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4800   echo "$ac_t""yes" 1>&6
4801   LIBS="$LIBS -lx"
4802 else
4803   echo "$ac_t""no" 1>&6
4804 fi
4805
4806 fi
4807
4808 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4809 echo "configure:4810: checking for sys/wait.h that is POSIX.1 compatible" >&5
4810 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4811   echo $ac_n "(cached) $ac_c" 1>&6
4812 else
4813   cat > conftest.$ac_ext <<EOF
4814 #line 4815 "configure"
4815 #include "confdefs.h"
4816 #include <sys/types.h>
4817 #include <sys/wait.h>
4818 #ifndef WEXITSTATUS
4819 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4820 #endif
4821 #ifndef WIFEXITED
4822 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4823 #endif
4824 int main() {
4825 int s;
4826 wait (&s);
4827 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4828 ; return 0; }
4829 EOF
4830 if { (eval echo configure:4831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4831   rm -rf conftest*
4832   ac_cv_header_sys_wait_h=yes
4833 else
4834   echo "configure: failed program was:" >&5
4835   cat conftest.$ac_ext >&5
4836   rm -rf conftest*
4837   ac_cv_header_sys_wait_h=no
4838 fi
4839 rm -f conftest*
4840 fi
4841
4842 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4843 if test $ac_cv_header_sys_wait_h = yes; then
4844   cat >> confdefs.h <<\EOF
4845 #define HAVE_SYS_WAIT_H 1
4846 EOF
4847
4848 fi
4849
4850 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4851 echo "configure:4852: checking POSIX termios" >&5
4852 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4853   echo $ac_n "(cached) $ac_c" 1>&6
4854 else
4855   cat > conftest.$ac_ext <<EOF
4856 #line 4857 "configure"
4857 #include "confdefs.h"
4858 #include <sys/types.h>
4859 #include <unistd.h>
4860 #include <termios.h>
4861 int main() {
4862 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4863    tcgetattr(0, 0);
4864 ; return 0; }
4865 EOF
4866 if { (eval echo configure:4867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4867   rm -rf conftest*
4868   am_cv_sys_posix_termios=yes
4869 else
4870   echo "configure: failed program was:" >&5
4871   cat conftest.$ac_ext >&5
4872   rm -rf conftest*
4873   am_cv_sys_posix_termios=no
4874 fi
4875 rm -f conftest*
4876 fi
4877
4878 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4879
4880
4881  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4882 echo "configure:4883: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4883 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4884   echo $ac_n "(cached) $ac_c" 1>&6
4885 else
4886   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4887
4888   gwinsz_in_termios_h=no
4889   if test $am_cv_sys_posix_termios = yes; then
4890     cat > conftest.$ac_ext <<EOF
4891 #line 4892 "configure"
4892 #include "confdefs.h"
4893 #include <sys/types.h>
4894 #     include <termios.h>
4895 #     ifdef TIOCGWINSZ
4896         yes
4897 #     endif
4898     
4899 EOF
4900 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4901   egrep "yes" >/dev/null 2>&1; then
4902   rm -rf conftest*
4903   gwinsz_in_termios_h=yes
4904 fi
4905 rm -f conftest*
4906
4907   fi
4908
4909   if test $gwinsz_in_termios_h = no; then
4910     cat > conftest.$ac_ext <<EOF
4911 #line 4912 "configure"
4912 #include "confdefs.h"
4913 #include <sys/types.h>
4914 #     include <sys/ioctl.h>
4915 #     ifdef TIOCGWINSZ
4916         yes
4917 #     endif
4918     
4919 EOF
4920 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4921   egrep "yes" >/dev/null 2>&1; then
4922   rm -rf conftest*
4923   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4924 fi
4925 rm -f conftest*
4926
4927   fi
4928   
4929 fi
4930
4931 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4932   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4933     cat >> confdefs.h <<\EOF
4934 #define GWINSZ_IN_SYS_IOCTL 1
4935 EOF
4936
4937   fi
4938
4939 if test $am_cv_sys_posix_termios = yes ; then
4940         cat >> confdefs.h <<\EOF
4941 #define HAVE_POSIX_TERMIOS 1
4942 EOF
4943
4944 fi
4945
4946 for ac_hdr in \
4947         arpa/inet.h             \
4948         arpa/nameser.h  \
4949         assert.h                \
4950         conio.h                 \
4951         crypt.h                 \
4952         direct.h                \
4953         errno.h                 \
4954         fcntl.h                 \
4955         filio.h                 \
4956         getopt.h                \
4957         grp.h                   \
4958         io.h                    \
4959         libutil.h               \
4960         limits.h                \
4961         locale.h                \
4962         netinet/tcp.h   \
4963         malloc.h                \
4964         memory.h                \
4965         psap.h                  \
4966         pwd.h                   \
4967         process.h               \
4968         resolv.h                \
4969         sgtty.h                 \
4970         shadow.h                \
4971         stddef.h                \
4972         string.h                \
4973         strings.h               \
4974         sysexits.h              \
4975         sys/file.h              \
4976         sys/filio.h             \
4977         sys/errno.h             \
4978         sys/ioctl.h             \
4979         sys/param.h             \
4980         sys/queue.h             \
4981         sys/resource.h  \
4982         sys/select.h    \
4983         sys/socket.h    \
4984         sys/syslog.h    \
4985         sys/time.h              \
4986         sys/types.h             \
4987         syslog.h                \
4988         termios.h               \
4989         unistd.h                \
4990         winsock.h               \
4991         winsock2.h              \
4992
4993 do
4994 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4995 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4996 echo "configure:4997: checking for $ac_hdr" >&5
4997 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4998   echo $ac_n "(cached) $ac_c" 1>&6
4999 else
5000   cat > conftest.$ac_ext <<EOF
5001 #line 5002 "configure"
5002 #include "confdefs.h"
5003 #include <$ac_hdr>
5004 EOF
5005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5006 { (eval echo configure:5007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5007 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5008 if test -z "$ac_err"; then
5009   rm -rf conftest*
5010   eval "ac_cv_header_$ac_safe=yes"
5011 else
5012   echo "$ac_err" >&5
5013   echo "configure: failed program was:" >&5
5014   cat conftest.$ac_ext >&5
5015   rm -rf conftest*
5016   eval "ac_cv_header_$ac_safe=no"
5017 fi
5018 rm -f conftest*
5019 fi
5020 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5021   echo "$ac_t""yes" 1>&6
5022     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5023   cat >> confdefs.h <<EOF
5024 #define $ac_tr_hdr 1
5025 EOF
5026  
5027 else
5028   echo "$ac_t""no" 1>&6
5029 fi
5030 done
5031
5032
5033
5034
5035 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
5036 echo "configure:5037: checking for dlopen" >&5
5037 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5038   echo $ac_n "(cached) $ac_c" 1>&6
5039 else
5040   cat > conftest.$ac_ext <<EOF
5041 #line 5042 "configure"
5042 #include "confdefs.h"
5043 /* System header to define __stub macros and hopefully few prototypes,
5044     which can conflict with char dlopen(); below.  */
5045 #include <assert.h>
5046 /* Override any gcc2 internal prototype to avoid an error.  */
5047 /* We use char because int might match the return type of a gcc2
5048     builtin and then its argument prototype would still apply.  */
5049 char dlopen();
5050 char (*f)();
5051
5052 int main() {
5053
5054 /* The GNU C library defines this for functions which it implements
5055     to always fail with ENOSYS.  Some functions are actually named
5056     something starting with __ and the normal name is an alias.  */
5057 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5058 choke me
5059 #else
5060 f = dlopen;
5061 #endif
5062
5063 ; return 0; }
5064 EOF
5065 if { (eval echo configure:5066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5066   rm -rf conftest*
5067   eval "ac_cv_func_dlopen=yes"
5068 else
5069   echo "configure: failed program was:" >&5
5070   cat conftest.$ac_ext >&5
5071   rm -rf conftest*
5072   eval "ac_cv_func_dlopen=no"
5073 fi
5074 rm -f conftest*
5075 fi
5076
5077 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5078   echo "$ac_t""yes" 1>&6
5079   :
5080 else
5081   echo "$ac_t""no" 1>&6
5082 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5083 echo "configure:5084: checking for dlopen in -ldl" >&5
5084 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5085 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5086   echo $ac_n "(cached) $ac_c" 1>&6
5087 else
5088   ac_save_LIBS="$LIBS"
5089 LIBS="-ldl  $LIBS"
5090 cat > conftest.$ac_ext <<EOF
5091 #line 5092 "configure"
5092 #include "confdefs.h"
5093 /* Override any gcc2 internal prototype to avoid an error.  */
5094 /* We use char because int might match the return type of a gcc2
5095     builtin and then its argument prototype would still apply.  */
5096 char dlopen();
5097
5098 int main() {
5099 dlopen()
5100 ; return 0; }
5101 EOF
5102 if { (eval echo configure:5103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5103   rm -rf conftest*
5104   eval "ac_cv_lib_$ac_lib_var=yes"
5105 else
5106   echo "configure: failed program was:" >&5
5107   cat conftest.$ac_ext >&5
5108   rm -rf conftest*
5109   eval "ac_cv_lib_$ac_lib_var=no"
5110 fi
5111 rm -f conftest*
5112 LIBS="$ac_save_LIBS"
5113
5114 fi
5115 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5116   echo "$ac_t""yes" 1>&6
5117     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5118     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5119   cat >> confdefs.h <<EOF
5120 #define $ac_tr_lib 1
5121 EOF
5122
5123   LIBS="-ldl $LIBS"
5124
5125 else
5126   echo "$ac_t""no" 1>&6
5127 fi
5128
5129 fi
5130
5131
5132 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5133 echo "configure:5134: checking for sigset in -lV3" >&5
5134 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5135 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5136   echo $ac_n "(cached) $ac_c" 1>&6
5137 else
5138   ac_save_LIBS="$LIBS"
5139 LIBS="-lV3  $LIBS"
5140 cat > conftest.$ac_ext <<EOF
5141 #line 5142 "configure"
5142 #include "confdefs.h"
5143 /* Override any gcc2 internal prototype to avoid an error.  */
5144 /* We use char because int might match the return type of a gcc2
5145     builtin and then its argument prototype would still apply.  */
5146 char sigset();
5147
5148 int main() {
5149 sigset()
5150 ; return 0; }
5151 EOF
5152 if { (eval echo configure:5153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5153   rm -rf conftest*
5154   eval "ac_cv_lib_$ac_lib_var=yes"
5155 else
5156   echo "configure: failed program was:" >&5
5157   cat conftest.$ac_ext >&5
5158   rm -rf conftest*
5159   eval "ac_cv_lib_$ac_lib_var=no"
5160 fi
5161 rm -f conftest*
5162 LIBS="$ac_save_LIBS"
5163
5164 fi
5165 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5166   echo "$ac_t""yes" 1>&6
5167     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5168     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5169   cat >> confdefs.h <<EOF
5170 #define $ac_tr_lib 1
5171 EOF
5172
5173   LIBS="-lV3 $LIBS"
5174
5175 else
5176   echo "$ac_t""no" 1>&6
5177 fi
5178
5179
5180 echo $ac_n "checking for winsock""... $ac_c" 1>&6
5181 echo "configure:5182: checking for winsock" >&5
5182 save_LIBS="$LIBS"
5183 for curlib in ws2_32 wsock32; do
5184         LIBS="$LIBS -l$curlib"
5185         cat > conftest.$ac_ext <<EOF
5186 #line 5187 "configure"
5187 #include "confdefs.h"
5188
5189                         char socket@12();
5190                         char select@20();
5191                         char closesocket@4();
5192                         char gethostname@8();
5193                     
5194 int main() {
5195
5196                         socket@12();
5197                         select@20();
5198                         closesocket@4();
5199                         gethostname@8();
5200                     
5201 ; return 0; }
5202 EOF
5203 if { (eval echo configure:5204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5204   rm -rf conftest*
5205   have_winsock=yes
5206 else
5207   echo "configure: failed program was:" >&5
5208   cat conftest.$ac_ext >&5
5209   rm -rf conftest*
5210   have_winsock=no
5211 fi
5212 rm -f conftest*
5213
5214         if test $have_winsock = yes; then
5215                 cat >> confdefs.h <<\EOF
5216 #define HAVE_WINSOCK 1
5217 EOF
5218
5219                 ac_cv_func_socket=yes
5220                 ac_cv_func_select=yes
5221                 ac_cv_func_closesocket=yes
5222                 ac_cv_func_gethostname=yes
5223                 if test $curlib = ws2_32; then
5224                         have_winsock=winsock2
5225                         cat >> confdefs.h <<\EOF
5226 #define HAVE_WINSOCK2 1
5227 EOF
5228
5229                 fi
5230                 break
5231         fi
5232         LIBS="$save_LIBS"
5233 done
5234 echo "$ac_t""$have_winsock" 1>&6
5235
5236
5237 echo $ac_n "checking for socket""... $ac_c" 1>&6
5238 echo "configure:5239: checking for socket" >&5
5239 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5240   echo $ac_n "(cached) $ac_c" 1>&6
5241 else
5242   cat > conftest.$ac_ext <<EOF
5243 #line 5244 "configure"
5244 #include "confdefs.h"
5245 /* System header to define __stub macros and hopefully few prototypes,
5246     which can conflict with char socket(); below.  */
5247 #include <assert.h>
5248 /* Override any gcc2 internal prototype to avoid an error.  */
5249 /* We use char because int might match the return type of a gcc2
5250     builtin and then its argument prototype would still apply.  */
5251 char socket();
5252 char (*f)();
5253
5254 int main() {
5255
5256 /* The GNU C library defines this for functions which it implements
5257     to always fail with ENOSYS.  Some functions are actually named
5258     something starting with __ and the normal name is an alias.  */
5259 #if defined (__stub_socket) || defined (__stub___socket)
5260 choke me
5261 #else
5262 f = socket;
5263 #endif
5264
5265 ; return 0; }
5266 EOF
5267 if { (eval echo configure:5268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5268   rm -rf conftest*
5269   eval "ac_cv_func_socket=yes"
5270 else
5271   echo "configure: failed program was:" >&5
5272   cat conftest.$ac_ext >&5
5273   rm -rf conftest*
5274   eval "ac_cv_func_socket=no"
5275 fi
5276 rm -f conftest*
5277 fi
5278
5279 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5280   echo "$ac_t""yes" 1>&6
5281   :
5282 else
5283   echo "$ac_t""no" 1>&6
5284         
5285         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5286 echo "configure:5287: checking for main in -lsocket" >&5
5287 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5288 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5289   echo $ac_n "(cached) $ac_c" 1>&6
5290 else
5291   ac_save_LIBS="$LIBS"
5292 LIBS="-lsocket  $LIBS"
5293 cat > conftest.$ac_ext <<EOF
5294 #line 5295 "configure"
5295 #include "confdefs.h"
5296
5297 int main() {
5298 main()
5299 ; return 0; }
5300 EOF
5301 if { (eval echo configure:5302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5302   rm -rf conftest*
5303   eval "ac_cv_lib_$ac_lib_var=yes"
5304 else
5305   echo "configure: failed program was:" >&5
5306   cat conftest.$ac_ext >&5
5307   rm -rf conftest*
5308   eval "ac_cv_lib_$ac_lib_var=no"
5309 fi
5310 rm -f conftest*
5311 LIBS="$ac_save_LIBS"
5312
5313 fi
5314 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5315   echo "$ac_t""yes" 1>&6
5316     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5317     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5318   cat >> confdefs.h <<EOF
5319 #define $ac_tr_lib 1
5320 EOF
5321
5322   LIBS="-lsocket $LIBS"
5323
5324 else
5325   echo "$ac_t""no" 1>&6
5326 fi
5327
5328         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5329 echo "configure:5330: checking for main in -lnet" >&5
5330 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5331 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5332   echo $ac_n "(cached) $ac_c" 1>&6
5333 else
5334   ac_save_LIBS="$LIBS"
5335 LIBS="-lnet  $LIBS"
5336 cat > conftest.$ac_ext <<EOF
5337 #line 5338 "configure"
5338 #include "confdefs.h"
5339
5340 int main() {
5341 main()
5342 ; return 0; }
5343 EOF
5344 if { (eval echo configure:5345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5345   rm -rf conftest*
5346   eval "ac_cv_lib_$ac_lib_var=yes"
5347 else
5348   echo "configure: failed program was:" >&5
5349   cat conftest.$ac_ext >&5
5350   rm -rf conftest*
5351   eval "ac_cv_lib_$ac_lib_var=no"
5352 fi
5353 rm -f conftest*
5354 LIBS="$ac_save_LIBS"
5355
5356 fi
5357 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5358   echo "$ac_t""yes" 1>&6
5359     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5360     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5361   cat >> confdefs.h <<EOF
5362 #define $ac_tr_lib 1
5363 EOF
5364
5365   LIBS="-lnet $LIBS"
5366
5367 else
5368   echo "$ac_t""no" 1>&6
5369 fi
5370
5371         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5372 echo "configure:5373: checking for main in -lnsl_s" >&5
5373 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5374 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5375   echo $ac_n "(cached) $ac_c" 1>&6
5376 else
5377   ac_save_LIBS="$LIBS"
5378 LIBS="-lnsl_s  $LIBS"
5379 cat > conftest.$ac_ext <<EOF
5380 #line 5381 "configure"
5381 #include "confdefs.h"
5382
5383 int main() {
5384 main()
5385 ; return 0; }
5386 EOF
5387 if { (eval echo configure:5388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5388   rm -rf conftest*
5389   eval "ac_cv_lib_$ac_lib_var=yes"
5390 else
5391   echo "configure: failed program was:" >&5
5392   cat conftest.$ac_ext >&5
5393   rm -rf conftest*
5394   eval "ac_cv_lib_$ac_lib_var=no"
5395 fi
5396 rm -f conftest*
5397 LIBS="$ac_save_LIBS"
5398
5399 fi
5400 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5401   echo "$ac_t""yes" 1>&6
5402     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5403     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5404   cat >> confdefs.h <<EOF
5405 #define $ac_tr_lib 1
5406 EOF
5407
5408   LIBS="-lnsl_s $LIBS"
5409
5410 else
5411   echo "$ac_t""no" 1>&6
5412 fi
5413
5414         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5415 echo "configure:5416: checking for main in -lnsl" >&5
5416 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5417 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5418   echo $ac_n "(cached) $ac_c" 1>&6
5419 else
5420   ac_save_LIBS="$LIBS"
5421 LIBS="-lnsl  $LIBS"
5422 cat > conftest.$ac_ext <<EOF
5423 #line 5424 "configure"
5424 #include "confdefs.h"
5425
5426 int main() {
5427 main()
5428 ; return 0; }
5429 EOF
5430 if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5431   rm -rf conftest*
5432   eval "ac_cv_lib_$ac_lib_var=yes"
5433 else
5434   echo "configure: failed program was:" >&5
5435   cat conftest.$ac_ext >&5
5436   rm -rf conftest*
5437   eval "ac_cv_lib_$ac_lib_var=no"
5438 fi
5439 rm -f conftest*
5440 LIBS="$ac_save_LIBS"
5441
5442 fi
5443 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5444   echo "$ac_t""yes" 1>&6
5445     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5446     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5447   cat >> confdefs.h <<EOF
5448 #define $ac_tr_lib 1
5449 EOF
5450
5451   LIBS="-lnsl $LIBS"
5452
5453 else
5454   echo "$ac_t""no" 1>&6
5455 fi
5456
5457         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5458 echo "configure:5459: checking for socket in -linet" >&5
5459 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5460 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5461   echo $ac_n "(cached) $ac_c" 1>&6
5462 else
5463   ac_save_LIBS="$LIBS"
5464 LIBS="-linet  $LIBS"
5465 cat > conftest.$ac_ext <<EOF
5466 #line 5467 "configure"
5467 #include "confdefs.h"
5468 /* Override any gcc2 internal prototype to avoid an error.  */
5469 /* We use char because int might match the return type of a gcc2
5470     builtin and then its argument prototype would still apply.  */
5471 char socket();
5472
5473 int main() {
5474 socket()
5475 ; return 0; }
5476 EOF
5477 if { (eval echo configure:5478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5478   rm -rf conftest*
5479   eval "ac_cv_lib_$ac_lib_var=yes"
5480 else
5481   echo "configure: failed program was:" >&5
5482   cat conftest.$ac_ext >&5
5483   rm -rf conftest*
5484   eval "ac_cv_lib_$ac_lib_var=no"
5485 fi
5486 rm -f conftest*
5487 LIBS="$ac_save_LIBS"
5488
5489 fi
5490 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5491   echo "$ac_t""yes" 1>&6
5492     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5493     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5494   cat >> confdefs.h <<EOF
5495 #define $ac_tr_lib 1
5496 EOF
5497
5498   LIBS="-linet $LIBS"
5499
5500 else
5501   echo "$ac_t""no" 1>&6
5502 fi
5503
5504         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5505 echo "configure:5506: checking for main in -lgen" >&5
5506 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5507 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5508   echo $ac_n "(cached) $ac_c" 1>&6
5509 else
5510   ac_save_LIBS="$LIBS"
5511 LIBS="-lgen  $LIBS"
5512 cat > conftest.$ac_ext <<EOF
5513 #line 5514 "configure"
5514 #include "confdefs.h"
5515
5516 int main() {
5517 main()
5518 ; return 0; }
5519 EOF
5520 if { (eval echo configure:5521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5521   rm -rf conftest*
5522   eval "ac_cv_lib_$ac_lib_var=yes"
5523 else
5524   echo "configure: failed program was:" >&5
5525   cat conftest.$ac_ext >&5
5526   rm -rf conftest*
5527   eval "ac_cv_lib_$ac_lib_var=no"
5528 fi
5529 rm -f conftest*
5530 LIBS="$ac_save_LIBS"
5531
5532 fi
5533 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5534   echo "$ac_t""yes" 1>&6
5535     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5536     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5537   cat >> confdefs.h <<EOF
5538 #define $ac_tr_lib 1
5539 EOF
5540
5541   LIBS="-lgen $LIBS"
5542
5543 else
5544   echo "$ac_t""no" 1>&6
5545 fi
5546
5547
5548 fi
5549
5550
5551 echo $ac_n "checking for select""... $ac_c" 1>&6
5552 echo "configure:5553: checking for select" >&5
5553 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5554   echo $ac_n "(cached) $ac_c" 1>&6
5555 else
5556   cat > conftest.$ac_ext <<EOF
5557 #line 5558 "configure"
5558 #include "confdefs.h"
5559 /* System header to define __stub macros and hopefully few prototypes,
5560     which can conflict with char select(); below.  */
5561 #include <assert.h>
5562 /* Override any gcc2 internal prototype to avoid an error.  */
5563 /* We use char because int might match the return type of a gcc2
5564     builtin and then its argument prototype would still apply.  */
5565 char select();
5566 char (*f)();
5567
5568 int main() {
5569
5570 /* The GNU C library defines this for functions which it implements
5571     to always fail with ENOSYS.  Some functions are actually named
5572     something starting with __ and the normal name is an alias.  */
5573 #if defined (__stub_select) || defined (__stub___select)
5574 choke me
5575 #else
5576 f = select;
5577 #endif
5578
5579 ; return 0; }
5580 EOF
5581 if { (eval echo configure:5582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5582   rm -rf conftest*
5583   eval "ac_cv_func_select=yes"
5584 else
5585   echo "configure: failed program was:" >&5
5586   cat conftest.$ac_ext >&5
5587   rm -rf conftest*
5588   eval "ac_cv_func_select=no"
5589 fi
5590 rm -f conftest*
5591 fi
5592
5593 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5594   echo "$ac_t""yes" 1>&6
5595   :
5596 else
5597   echo "$ac_t""no" 1>&6
5598 { echo "configure: error: select() required." 1>&2; exit 1; }
5599 fi
5600
5601
5602 if test "${ac_cv_header_winsock_h}" != yes; then
5603                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5604 echo "configure:5605: checking types of arguments for select()" >&5
5605  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5606   echo $ac_n "(cached) $ac_c" 1>&6
5607 else
5608    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5609   echo $ac_n "(cached) $ac_c" 1>&6
5610 else
5611     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5612   echo $ac_n "(cached) $ac_c" 1>&6
5613 else
5614      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5615      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5616       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5617        cat > conftest.$ac_ext <<EOF
5618 #line 5619 "configure"
5619 #include "confdefs.h"
5620 #ifdef HAVE_SYS_TYPES_H
5621 #include <sys/types.h>
5622 #endif
5623 #ifdef HAVE_SYS_TIME_H
5624 #include <sys/time.h>
5625 #endif
5626 #ifdef HAVE_SYS_SELECT_H
5627 #include <sys/select.h>
5628 #endif
5629 #ifdef HAVE_SYS_SOCKET_H
5630 #include <sys/socket.h>
5631 #endif
5632 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);
5633 int main() {
5634
5635 ; return 0; }
5636 EOF
5637 if { (eval echo configure:5638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5638   rm -rf conftest*
5639           ac_not_found=no ; break 3
5640 else
5641   echo "configure: failed program was:" >&5
5642   cat conftest.$ac_ext >&5
5643   rm -rf conftest*
5644   ac_not_found=yes
5645 fi
5646 rm -f conftest*
5647       done
5648      done
5649     done
5650    
5651 fi
5652   
5653 fi
5654  
5655 fi
5656  if test "$ac_not_found" = yes; then
5657   ac_cv_func_select_arg1=int 
5658   ac_cv_func_select_arg234='int *' 
5659   ac_cv_func_select_arg5='struct timeval *'
5660  fi
5661  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5662  cat >> confdefs.h <<EOF
5663 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5664 EOF
5665
5666  cat >> confdefs.h <<EOF
5667 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5668 EOF
5669
5670  cat >> confdefs.h <<EOF
5671 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5672 EOF
5673
5674
5675 fi
5676
5677
5678 for ac_hdr in regex.h 
5679 do
5680 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5681 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5682 echo "configure:5683: checking for $ac_hdr" >&5
5683 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5684   echo $ac_n "(cached) $ac_c" 1>&6
5685 else
5686   cat > conftest.$ac_ext <<EOF
5687 #line 5688 "configure"
5688 #include "confdefs.h"
5689 #include <$ac_hdr>
5690 EOF
5691 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5692 { (eval echo configure:5693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5693 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5694 if test -z "$ac_err"; then
5695   rm -rf conftest*
5696   eval "ac_cv_header_$ac_safe=yes"
5697 else
5698   echo "$ac_err" >&5
5699   echo "configure: failed program was:" >&5
5700   cat conftest.$ac_ext >&5
5701   rm -rf conftest*
5702   eval "ac_cv_header_$ac_safe=no"
5703 fi
5704 rm -f conftest*
5705 fi
5706 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5707   echo "$ac_t""yes" 1>&6
5708     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5709   cat >> confdefs.h <<EOF
5710 #define $ac_tr_hdr 1
5711 EOF
5712  
5713 else
5714   echo "$ac_t""no" 1>&6
5715 fi
5716 done
5717
5718 if test "$ac_cv_header_regex_h" != yes ; then
5719         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5720 fi
5721
5722 echo $ac_n "checking for library containing regfree""... $ac_c" 1>&6
5723 echo "configure:5724: checking for library containing regfree" >&5
5724 if eval "test \"\${ac_cv_search_regfree+set}\" = set"; then
5725   echo $ac_n "(cached) $ac_c" 1>&6
5726 else
5727   ac_func_search_save_LIBS="$LIBS"
5728 ac_cv_search_regfree="no"
5729 cat > conftest.$ac_ext <<EOF
5730 #line 5731 "configure"
5731 #include "confdefs.h"
5732 /* Override any gcc2 internal prototype to avoid an error.  */
5733 /* We use char because int might match the return type of a gcc2
5734     builtin and then its argument prototype would still apply.  */
5735 char regfree();
5736
5737 int main() {
5738 regfree()
5739 ; return 0; }
5740 EOF
5741 if { (eval echo configure:5742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5742   rm -rf conftest*
5743   ac_cv_search_regfree="none required"
5744 else
5745   echo "configure: failed program was:" >&5
5746   cat conftest.$ac_ext >&5
5747 fi
5748 rm -f conftest*
5749 test "$ac_cv_search_regfree" = "no" && for ac_lib in regex gnuregex; do
5750 LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
5751 cat > conftest.$ac_ext <<EOF
5752 #line 5753 "configure"
5753 #include "confdefs.h"
5754 /* Override any gcc2 internal prototype to avoid an error.  */
5755 /* We use char because int might match the return type of a gcc2
5756     builtin and then its argument prototype would still apply.  */
5757 char regfree();
5758
5759 int main() {
5760 regfree()
5761 ; return 0; }
5762 EOF
5763 if { (eval echo configure:5764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5764   rm -rf conftest*
5765   ac_cv_search_regfree="-l$ac_lib"
5766 break
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770 fi
5771 rm -f conftest*
5772 done
5773 LIBS="$ac_func_search_save_LIBS"
5774 fi
5775
5776 echo "$ac_t""$ac_cv_search_regfree" 1>&6
5777 if test "$ac_cv_search_regfree" != "no"; then
5778   test "$ac_cv_search_regfree" = "none required" || LIBS="$ac_cv_search_regfree $LIBS"
5779   :
5780 else :
5781   { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5782 fi
5783
5784
5785 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5786 echo "configure:5787: checking for compatible POSIX regex" >&5
5787 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5788   echo $ac_n "(cached) $ac_c" 1>&6
5789 else
5790   
5791         if test "$cross_compiling" = yes; then
5792   ol_cv_c_posix_regex=cross
5793 else
5794   cat > conftest.$ac_ext <<EOF
5795 #line 5796 "configure"
5796 #include "confdefs.h"
5797
5798 #include <sys/types.h>
5799 #include <regex.h>
5800 static char *pattern, *string;
5801 main()
5802 {
5803         int rc;
5804         regex_t re;
5805
5806         pattern = "^A";
5807
5808         if(regcomp(&re, pattern, 0)) {
5809                 return -1;
5810         }
5811         
5812         string = "ALL MATCH";
5813         
5814         rc = regexec(&re, string, 0, (void*)0, 0);
5815
5816         regfree(&re);
5817
5818         return rc;
5819 }
5820 EOF
5821 if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5822 then
5823   ol_cv_c_posix_regex=yes
5824 else
5825   echo "configure: failed program was:" >&5
5826   cat conftest.$ac_ext >&5
5827   rm -fr conftest*
5828   ol_cv_c_posix_regex=no
5829 fi
5830 rm -fr conftest*
5831 fi
5832
5833 fi
5834
5835 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5836
5837 if test "$ol_cv_c_posix_regex" = no ; then
5838         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5839 fi
5840
5841 ol_link_dnssrv=no
5842 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5843 echo "configure:5844: checking for res_query" >&5
5844 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5845   echo $ac_n "(cached) $ac_c" 1>&6
5846 else
5847   cat > conftest.$ac_ext <<EOF
5848 #line 5849 "configure"
5849 #include "confdefs.h"
5850 /* System header to define __stub macros and hopefully few prototypes,
5851     which can conflict with char res_query(); below.  */
5852 #include <assert.h>
5853 /* Override any gcc2 internal prototype to avoid an error.  */
5854 /* We use char because int might match the return type of a gcc2
5855     builtin and then its argument prototype would still apply.  */
5856 char res_query();
5857 char (*f)();
5858
5859 int main() {
5860
5861 /* The GNU C library defines this for functions which it implements
5862     to always fail with ENOSYS.  Some functions are actually named
5863     something starting with __ and the normal name is an alias.  */
5864 #if defined (__stub_res_query) || defined (__stub___res_query)
5865 choke me
5866 #else
5867 f = res_query;
5868 #endif
5869
5870 ; return 0; }
5871 EOF
5872 if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5873   rm -rf conftest*
5874   eval "ac_cv_func_res_query=yes"
5875 else
5876   echo "configure: failed program was:" >&5
5877   cat conftest.$ac_ext >&5
5878   rm -rf conftest*
5879   eval "ac_cv_func_res_query=no"
5880 fi
5881 rm -f conftest*
5882 fi
5883
5884 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5885   echo "$ac_t""yes" 1>&6
5886   :
5887 else
5888   echo "$ac_t""no" 1>&6
5889 fi
5890
5891 if test $ac_cv_func_res_query = no ; then 
5892         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5893 echo "configure:5894: checking for __res_query" >&5
5894 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5895   echo $ac_n "(cached) $ac_c" 1>&6
5896 else
5897   cat > conftest.$ac_ext <<EOF
5898 #line 5899 "configure"
5899 #include "confdefs.h"
5900 /* System header to define __stub macros and hopefully few prototypes,
5901     which can conflict with char __res_query(); below.  */
5902 #include <assert.h>
5903 /* Override any gcc2 internal prototype to avoid an error.  */
5904 /* We use char because int might match the return type of a gcc2
5905     builtin and then its argument prototype would still apply.  */
5906 char __res_query();
5907 char (*f)();
5908
5909 int main() {
5910
5911 /* The GNU C library defines this for functions which it implements
5912     to always fail with ENOSYS.  Some functions are actually named
5913     something starting with __ and the normal name is an alias.  */
5914 #if defined (__stub___res_query) || defined (__stub_____res_query)
5915 choke me
5916 #else
5917 f = __res_query;
5918 #endif
5919
5920 ; return 0; }
5921 EOF
5922 if { (eval echo configure:5923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5923   rm -rf conftest*
5924   eval "ac_cv_func___res_query=yes"
5925 else
5926   echo "configure: failed program was:" >&5
5927   cat conftest.$ac_ext >&5
5928   rm -rf conftest*
5929   eval "ac_cv_func___res_query=no"
5930 fi
5931 rm -f conftest*
5932 fi
5933
5934 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5935   echo "$ac_t""yes" 1>&6
5936   :
5937 else
5938   echo "$ac_t""no" 1>&6
5939 fi
5940
5941         ac_cv_func_res_query=$ac_cv_func___res_query
5942 fi
5943
5944 if test $ac_cv_func_res_query = no ; then 
5945         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5946 echo "configure:5947: checking for res_query in -lbind" >&5
5947 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5948 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5949   echo $ac_n "(cached) $ac_c" 1>&6
5950 else
5951   ac_save_LIBS="$LIBS"
5952 LIBS="-lbind  $LIBS"
5953 cat > conftest.$ac_ext <<EOF
5954 #line 5955 "configure"
5955 #include "confdefs.h"
5956 /* Override any gcc2 internal prototype to avoid an error.  */
5957 /* We use char because int might match the return type of a gcc2
5958     builtin and then its argument prototype would still apply.  */
5959 char res_query();
5960
5961 int main() {
5962 res_query()
5963 ; return 0; }
5964 EOF
5965 if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5966   rm -rf conftest*
5967   eval "ac_cv_lib_$ac_lib_var=yes"
5968 else
5969   echo "configure: failed program was:" >&5
5970   cat conftest.$ac_ext >&5
5971   rm -rf conftest*
5972   eval "ac_cv_lib_$ac_lib_var=no"
5973 fi
5974 rm -f conftest*
5975 LIBS="$ac_save_LIBS"
5976
5977 fi
5978 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5979   echo "$ac_t""yes" 1>&6
5980     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5981     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5982   cat >> confdefs.h <<EOF
5983 #define $ac_tr_lib 1
5984 EOF
5985
5986   LIBS="-lbind $LIBS"
5987
5988 else
5989   echo "$ac_t""no" 1>&6
5990 fi
5991
5992         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5993 fi
5994
5995 if test $ac_cv_func_res_query = no ; then 
5996         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5997 echo "configure:5998: checking for __res_query in -lbind" >&5
5998 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5999 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6000   echo $ac_n "(cached) $ac_c" 1>&6
6001 else
6002   ac_save_LIBS="$LIBS"
6003 LIBS="-lbind  $LIBS"
6004 cat > conftest.$ac_ext <<EOF
6005 #line 6006 "configure"
6006 #include "confdefs.h"
6007 /* Override any gcc2 internal prototype to avoid an error.  */
6008 /* We use char because int might match the return type of a gcc2
6009     builtin and then its argument prototype would still apply.  */
6010 char __res_query();
6011
6012 int main() {
6013 __res_query()
6014 ; return 0; }
6015 EOF
6016 if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6017   rm -rf conftest*
6018   eval "ac_cv_lib_$ac_lib_var=yes"
6019 else
6020   echo "configure: failed program was:" >&5
6021   cat conftest.$ac_ext >&5
6022   rm -rf conftest*
6023   eval "ac_cv_lib_$ac_lib_var=no"
6024 fi
6025 rm -f conftest*
6026 LIBS="$ac_save_LIBS"
6027
6028 fi
6029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6030   echo "$ac_t""yes" 1>&6
6031     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6032     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6033   cat >> confdefs.h <<EOF
6034 #define $ac_tr_lib 1
6035 EOF
6036
6037   LIBS="-lbind $LIBS"
6038
6039 else
6040   echo "$ac_t""no" 1>&6
6041 fi
6042
6043         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
6044 fi
6045
6046 if test $ac_cv_func_res_query = no ; then 
6047         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
6048 echo "configure:6049: checking for res_query in -lresolv" >&5
6049 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
6050 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6051   echo $ac_n "(cached) $ac_c" 1>&6
6052 else
6053   ac_save_LIBS="$LIBS"
6054 LIBS="-lresolv  $LIBS"
6055 cat > conftest.$ac_ext <<EOF
6056 #line 6057 "configure"
6057 #include "confdefs.h"
6058 /* Override any gcc2 internal prototype to avoid an error.  */
6059 /* We use char because int might match the return type of a gcc2
6060     builtin and then its argument prototype would still apply.  */
6061 char res_query();
6062
6063 int main() {
6064 res_query()
6065 ; return 0; }
6066 EOF
6067 if { (eval echo configure:6068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6068   rm -rf conftest*
6069   eval "ac_cv_lib_$ac_lib_var=yes"
6070 else
6071   echo "configure: failed program was:" >&5
6072   cat conftest.$ac_ext >&5
6073   rm -rf conftest*
6074   eval "ac_cv_lib_$ac_lib_var=no"
6075 fi
6076 rm -f conftest*
6077 LIBS="$ac_save_LIBS"
6078
6079 fi
6080 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6081   echo "$ac_t""yes" 1>&6
6082     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6083     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6084   cat >> confdefs.h <<EOF
6085 #define $ac_tr_lib 1
6086 EOF
6087
6088   LIBS="-lresolv $LIBS"
6089
6090 else
6091   echo "$ac_t""no" 1>&6
6092 fi
6093
6094         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6095 fi
6096
6097 if test $ac_cv_func_res_query = no ; then 
6098         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
6099 echo "configure:6100: checking for __res_query in -lresolv" >&5
6100 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
6101 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6102   echo $ac_n "(cached) $ac_c" 1>&6
6103 else
6104   ac_save_LIBS="$LIBS"
6105 LIBS="-lresolv  $LIBS"
6106 cat > conftest.$ac_ext <<EOF
6107 #line 6108 "configure"
6108 #include "confdefs.h"
6109 /* Override any gcc2 internal prototype to avoid an error.  */
6110 /* We use char because int might match the return type of a gcc2
6111     builtin and then its argument prototype would still apply.  */
6112 char __res_query();
6113
6114 int main() {
6115 __res_query()
6116 ; return 0; }
6117 EOF
6118 if { (eval echo configure:6119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6119   rm -rf conftest*
6120   eval "ac_cv_lib_$ac_lib_var=yes"
6121 else
6122   echo "configure: failed program was:" >&5
6123   cat conftest.$ac_ext >&5
6124   rm -rf conftest*
6125   eval "ac_cv_lib_$ac_lib_var=no"
6126 fi
6127 rm -f conftest*
6128 LIBS="$ac_save_LIBS"
6129
6130 fi
6131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6132   echo "$ac_t""yes" 1>&6
6133     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6134     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6135   cat >> confdefs.h <<EOF
6136 #define $ac_tr_lib 1
6137 EOF
6138
6139   LIBS="-lresolv $LIBS"
6140
6141 else
6142   echo "$ac_t""no" 1>&6
6143 fi
6144
6145         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
6146 fi
6147
6148 if test "$ac_cv_func_res_query" = yes ; then
6149         cat >> confdefs.h <<\EOF
6150 #define HAVE_RES_QUERY 1
6151 EOF
6152
6153
6154         if test $ol_enable_dnssrv != no ; then
6155                 ol_link_dnssrv=yes
6156         fi
6157 fi
6158
6159 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6160         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6161 fi
6162
6163 for ac_func in getaddrinfo inet_ntop 
6164 do
6165 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6166 echo "configure:6167: checking for $ac_func" >&5
6167 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6168   echo $ac_n "(cached) $ac_c" 1>&6
6169 else
6170   cat > conftest.$ac_ext <<EOF
6171 #line 6172 "configure"
6172 #include "confdefs.h"
6173 /* System header to define __stub macros and hopefully few prototypes,
6174     which can conflict with char $ac_func(); below.  */
6175 #include <assert.h>
6176 /* Override any gcc2 internal prototype to avoid an error.  */
6177 /* We use char because int might match the return type of a gcc2
6178     builtin and then its argument prototype would still apply.  */
6179 char $ac_func();
6180 char (*f)();
6181
6182 int main() {
6183
6184 /* The GNU C library defines this for functions which it implements
6185     to always fail with ENOSYS.  Some functions are actually named
6186     something starting with __ and the normal name is an alias.  */
6187 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6188 choke me
6189 #else
6190 f = $ac_func;
6191 #endif
6192
6193 ; return 0; }
6194 EOF
6195 if { (eval echo configure:6196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6196   rm -rf conftest*
6197   eval "ac_cv_func_$ac_func=yes"
6198 else
6199   echo "configure: failed program was:" >&5
6200   cat conftest.$ac_ext >&5
6201   rm -rf conftest*
6202   eval "ac_cv_func_$ac_func=no"
6203 fi
6204 rm -f conftest*
6205 fi
6206
6207 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6208   echo "$ac_t""yes" 1>&6
6209     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6210   cat >> confdefs.h <<EOF
6211 #define $ac_tr_func 1
6212 EOF
6213  
6214 else
6215   echo "$ac_t""no" 1>&6
6216 fi
6217 done
6218
6219
6220 ol_link_ipv6=no
6221 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6222         if test $ol_enable_ipv6 = yes ; then
6223                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6224         fi
6225 else
6226         for ac_func in gai_strerror 
6227 do
6228 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6229 echo "configure:6230: checking for $ac_func" >&5
6230 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6231   echo $ac_n "(cached) $ac_c" 1>&6
6232 else
6233   cat > conftest.$ac_ext <<EOF
6234 #line 6235 "configure"
6235 #include "confdefs.h"
6236 /* System header to define __stub macros and hopefully few prototypes,
6237     which can conflict with char $ac_func(); below.  */
6238 #include <assert.h>
6239 /* Override any gcc2 internal prototype to avoid an error.  */
6240 /* We use char because int might match the return type of a gcc2
6241     builtin and then its argument prototype would still apply.  */
6242 char $ac_func();
6243 char (*f)();
6244
6245 int main() {
6246
6247 /* The GNU C library defines this for functions which it implements
6248     to always fail with ENOSYS.  Some functions are actually named
6249     something starting with __ and the normal name is an alias.  */
6250 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6251 choke me
6252 #else
6253 f = $ac_func;
6254 #endif
6255
6256 ; return 0; }
6257 EOF
6258 if { (eval echo configure:6259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6259   rm -rf conftest*
6260   eval "ac_cv_func_$ac_func=yes"
6261 else
6262   echo "configure: failed program was:" >&5
6263   cat conftest.$ac_ext >&5
6264   rm -rf conftest*
6265   eval "ac_cv_func_$ac_func=no"
6266 fi
6267 rm -f conftest*
6268 fi
6269
6270 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6271   echo "$ac_t""yes" 1>&6
6272     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6273   cat >> confdefs.h <<EOF
6274 #define $ac_tr_func 1
6275 EOF
6276  
6277 else
6278   echo "$ac_t""no" 1>&6
6279 fi
6280 done
6281
6282
6283         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6284 echo "configure:6285: checking INET6_ADDRSTRLEN" >&5
6285 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6286   echo $ac_n "(cached) $ac_c" 1>&6
6287 else
6288   
6289                 cat > conftest.$ac_ext <<EOF
6290 #line 6291 "configure"
6291 #include "confdefs.h"
6292
6293 #                       include <netinet/in.h>
6294 #                       ifdef INET6_ADDRSTRLEN
6295                                 __has_inet6_addrstrlen__;
6296 #                       endif
6297                 
6298 EOF
6299 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6300   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6301   rm -rf conftest*
6302   ol_cv_inet6_addrstrlen=yes
6303 else
6304   rm -rf conftest*
6305   ol_cv_inet6_addrstrlen=no
6306 fi
6307 rm -f conftest*
6308
6309 fi
6310
6311 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6312
6313         if test $ol_cv_inet6_addrstrlen = yes ; then
6314                 ol_link_ipv6=yes
6315         elif test $ol_enable_ipv6 = yes ; then
6316                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6317         fi
6318 fi
6319
6320 if test $ol_enable_local != no ; then
6321         for ac_hdr in sys/un.h 
6322 do
6323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6325 echo "configure:6326: checking for $ac_hdr" >&5
6326 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6327   echo $ac_n "(cached) $ac_c" 1>&6
6328 else
6329   cat > conftest.$ac_ext <<EOF
6330 #line 6331 "configure"
6331 #include "confdefs.h"
6332 #include <$ac_hdr>
6333 EOF
6334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6335 { (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6337 if test -z "$ac_err"; then
6338   rm -rf conftest*
6339   eval "ac_cv_header_$ac_safe=yes"
6340 else
6341   echo "$ac_err" >&5
6342   echo "configure: failed program was:" >&5
6343   cat conftest.$ac_ext >&5
6344   rm -rf conftest*
6345   eval "ac_cv_header_$ac_safe=no"
6346 fi
6347 rm -f conftest*
6348 fi
6349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6350   echo "$ac_t""yes" 1>&6
6351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6352   cat >> confdefs.h <<EOF
6353 #define $ac_tr_hdr 1
6354 EOF
6355  
6356 else
6357   echo "$ac_t""no" 1>&6
6358 fi
6359 done
6360
6361
6362         if test $ol_enable_local = auto ; then
6363                 ol_enable_local=$ac_cv_header_sys_un_h
6364         elif test $ac_cv_header_sys_un_h = no ; then
6365                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6366         fi
6367 fi
6368
6369 ol_link_kbind=no
6370 ol_link_kpasswd=no
6371 ol_link_krb5=no
6372 ol_link_krb4=no
6373
6374 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6375         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6376         -o $ol_with_kerberos = k425 ; then
6377
6378         for ac_hdr in krb5.h
6379 do
6380 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6381 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6382 echo "configure:6383: checking for $ac_hdr" >&5
6383 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6384   echo $ac_n "(cached) $ac_c" 1>&6
6385 else
6386   cat > conftest.$ac_ext <<EOF
6387 #line 6388 "configure"
6388 #include "confdefs.h"
6389 #include <$ac_hdr>
6390 EOF
6391 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6392 { (eval echo configure:6393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6393 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6394 if test -z "$ac_err"; then
6395   rm -rf conftest*
6396   eval "ac_cv_header_$ac_safe=yes"
6397 else
6398   echo "$ac_err" >&5
6399   echo "configure: failed program was:" >&5
6400   cat conftest.$ac_ext >&5
6401   rm -rf conftest*
6402   eval "ac_cv_header_$ac_safe=no"
6403 fi
6404 rm -f conftest*
6405 fi
6406 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6407   echo "$ac_t""yes" 1>&6
6408     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6409   cat >> confdefs.h <<EOF
6410 #define $ac_tr_hdr 1
6411 EOF
6412  
6413 else
6414   echo "$ac_t""no" 1>&6
6415 fi
6416 done
6417
6418
6419         if test $ac_cv_header_krb5_h = yes ; then
6420                                 for ac_hdr in heim_err.h
6421 do
6422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6424 echo "configure:6425: checking for $ac_hdr" >&5
6425 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6426   echo $ac_n "(cached) $ac_c" 1>&6
6427 else
6428   cat > conftest.$ac_ext <<EOF
6429 #line 6430 "configure"
6430 #include "confdefs.h"
6431 #include <$ac_hdr>
6432 EOF
6433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6434 { (eval echo configure:6435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6436 if test -z "$ac_err"; then
6437   rm -rf conftest*
6438   eval "ac_cv_header_$ac_safe=yes"
6439 else
6440   echo "$ac_err" >&5
6441   echo "configure: failed program was:" >&5
6442   cat conftest.$ac_ext >&5
6443   rm -rf conftest*
6444   eval "ac_cv_header_$ac_safe=no"
6445 fi
6446 rm -f conftest*
6447 fi
6448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6449   echo "$ac_t""yes" 1>&6
6450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6451   cat >> confdefs.h <<EOF
6452 #define $ac_tr_hdr 1
6453 EOF
6454  
6455 else
6456   echo "$ac_t""no" 1>&6
6457 fi
6458 done
6459
6460                 if test $ac_cv_header_heim_err_h = yes ; then
6461                         krb5_impl=heimdal
6462                 else
6463                         krb5_impl=mit
6464                 fi
6465
6466                 if test $krb5_impl = mit; then
6467                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6468 echo "configure:6469: checking for main in -lk5crypto" >&5
6469 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6470 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6471   echo $ac_n "(cached) $ac_c" 1>&6
6472 else
6473   ac_save_LIBS="$LIBS"
6474 LIBS="-lk5crypto  $LIBS"
6475 cat > conftest.$ac_ext <<EOF
6476 #line 6477 "configure"
6477 #include "confdefs.h"
6478
6479 int main() {
6480 main()
6481 ; return 0; }
6482 EOF
6483 if { (eval echo configure:6484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6484   rm -rf conftest*
6485   eval "ac_cv_lib_$ac_lib_var=yes"
6486 else
6487   echo "configure: failed program was:" >&5
6488   cat conftest.$ac_ext >&5
6489   rm -rf conftest*
6490   eval "ac_cv_lib_$ac_lib_var=no"
6491 fi
6492 rm -f conftest*
6493 LIBS="$ac_save_LIBS"
6494
6495 fi
6496 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6497   echo "$ac_t""yes" 1>&6
6498   krb5crypto=k5crypto
6499 else
6500   echo "$ac_t""no" 1>&6
6501 krb5crypto=crypto
6502 fi
6503
6504
6505                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6506 echo "configure:6507: checking for main in -lkrb5" >&5
6507 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6508 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6509   echo $ac_n "(cached) $ac_c" 1>&6
6510 else
6511   ac_save_LIBS="$LIBS"
6512 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6513 cat > conftest.$ac_ext <<EOF
6514 #line 6515 "configure"
6515 #include "confdefs.h"
6516
6517 int main() {
6518 main()
6519 ; return 0; }
6520 EOF
6521 if { (eval echo configure:6522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6522   rm -rf conftest*
6523   eval "ac_cv_lib_$ac_lib_var=yes"
6524 else
6525   echo "configure: failed program was:" >&5
6526   cat conftest.$ac_ext >&5
6527   rm -rf conftest*
6528   eval "ac_cv_lib_$ac_lib_var=no"
6529 fi
6530 rm -f conftest*
6531 LIBS="$ac_save_LIBS"
6532
6533 fi
6534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6535   echo "$ac_t""yes" 1>&6
6536   have_krb5=yes
6537                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6538 else
6539   echo "$ac_t""no" 1>&6
6540 have_krb5=no
6541 fi
6542
6543
6544                 elif test $krb5_impl = heimdal; then
6545                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6546 echo "configure:6547: checking for main in -lkrb5" >&5
6547 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6548 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6549   echo $ac_n "(cached) $ac_c" 1>&6
6550 else
6551   ac_save_LIBS="$LIBS"
6552 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6553 cat > conftest.$ac_ext <<EOF
6554 #line 6555 "configure"
6555 #include "confdefs.h"
6556
6557 int main() {
6558 main()
6559 ; return 0; }
6560 EOF
6561 if { (eval echo configure:6562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6562   rm -rf conftest*
6563   eval "ac_cv_lib_$ac_lib_var=yes"
6564 else
6565   echo "configure: failed program was:" >&5
6566   cat conftest.$ac_ext >&5
6567   rm -rf conftest*
6568   eval "ac_cv_lib_$ac_lib_var=no"
6569 fi
6570 rm -f conftest*
6571 LIBS="$ac_save_LIBS"
6572
6573 fi
6574 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6575   echo "$ac_t""yes" 1>&6
6576   have_krb5=yes
6577                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6578 else
6579   echo "$ac_t""no" 1>&6
6580 have_krb5=no
6581 fi
6582
6583
6584                         cat >> confdefs.h <<\EOF
6585 #define HAVE_HEIMDAL_KERBEROS 1
6586 EOF
6587
6588
6589                 else
6590                         have_krb5=no
6591                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6592                 fi
6593
6594                 if test $have_krb5 = yes ; then
6595                         ol_link_krb5=yes
6596
6597                         cat >> confdefs.h <<\EOF
6598 #define HAVE_KRB5 1
6599 EOF
6600
6601
6602                         if test $ol_enable_kpasswd != no ; then
6603                                 ol_link_kpasswd=yes;
6604                         fi
6605
6606                         if test $ol_with_kerberos = k5only ; then
6607                                 ol_with_kerberos=found
6608                         fi
6609
6610                 elif test $ol_with_kerberos != auto ; then
6611                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6612                 fi
6613
6614         fi
6615 fi
6616
6617 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6618         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6619
6620         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6621 do
6622 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6623 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6624 echo "configure:6625: checking for $ac_hdr" >&5
6625 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6626   echo $ac_n "(cached) $ac_c" 1>&6
6627 else
6628   cat > conftest.$ac_ext <<EOF
6629 #line 6630 "configure"
6630 #include "confdefs.h"
6631 #include <$ac_hdr>
6632 EOF
6633 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6634 { (eval echo configure:6635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6635 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6636 if test -z "$ac_err"; then
6637   rm -rf conftest*
6638   eval "ac_cv_header_$ac_safe=yes"
6639 else
6640   echo "$ac_err" >&5
6641   echo "configure: failed program was:" >&5
6642   cat conftest.$ac_ext >&5
6643   rm -rf conftest*
6644   eval "ac_cv_header_$ac_safe=no"
6645 fi
6646 rm -f conftest*
6647 fi
6648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6649   echo "$ac_t""yes" 1>&6
6650     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6651   cat >> confdefs.h <<EOF
6652 #define $ac_tr_hdr 1
6653 EOF
6654  
6655 else
6656   echo "$ac_t""no" 1>&6
6657 fi
6658 done
6659
6660
6661         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6662                 if test $krb5_impl = mit; then
6663                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6664 echo "configure:6665: checking for main in -lkrb4" >&5
6665 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6666 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6667   echo $ac_n "(cached) $ac_c" 1>&6
6668 else
6669   ac_save_LIBS="$LIBS"
6670 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6671 cat > conftest.$ac_ext <<EOF
6672 #line 6673 "configure"
6673 #include "confdefs.h"
6674
6675 int main() {
6676 main()
6677 ; return 0; }
6678 EOF
6679 if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6680   rm -rf conftest*
6681   eval "ac_cv_lib_$ac_lib_var=yes"
6682 else
6683   echo "configure: failed program was:" >&5
6684   cat conftest.$ac_ext >&5
6685   rm -rf conftest*
6686   eval "ac_cv_lib_$ac_lib_var=no"
6687 fi
6688 rm -f conftest*
6689 LIBS="$ac_save_LIBS"
6690
6691 fi
6692 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6693   echo "$ac_t""yes" 1>&6
6694   have_k425=yes
6695                                 KRB4_LIBS="-lkrb4 -ldes425"
6696 else
6697   echo "$ac_t""no" 1>&6
6698 have_k425=no
6699 fi
6700
6701
6702                 elif test $krb5_impl = heimdal; then
6703                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6704 echo "configure:6705: checking for main in -lkrb4" >&5
6705 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6706 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6707   echo $ac_n "(cached) $ac_c" 1>&6
6708 else
6709   ac_save_LIBS="$LIBS"
6710 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6711 cat > conftest.$ac_ext <<EOF
6712 #line 6713 "configure"
6713 #include "confdefs.h"
6714
6715 int main() {
6716 main()
6717 ; return 0; }
6718 EOF
6719 if { (eval echo configure:6720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6720   rm -rf conftest*
6721   eval "ac_cv_lib_$ac_lib_var=yes"
6722 else
6723   echo "configure: failed program was:" >&5
6724   cat conftest.$ac_ext >&5
6725   rm -rf conftest*
6726   eval "ac_cv_lib_$ac_lib_var=no"
6727 fi
6728 rm -f conftest*
6729 LIBS="$ac_save_LIBS"
6730
6731 fi
6732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6733   echo "$ac_t""yes" 1>&6
6734   have_k425=yes
6735                                 KRB4_LIBS="-lkrb4"
6736 else
6737   echo "$ac_t""no" 1>&6
6738 have_k425=no
6739 fi
6740
6741
6742                 else
6743                         have_425=no
6744                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6745                 fi
6746
6747                 if test $have_k425 = yes ; then
6748                         ol_with_kerberos=found
6749                         ol_link_krb4=yes
6750
6751                         cat >> confdefs.h <<\EOF
6752 #define HAVE_KRB425 1
6753 EOF
6754
6755                         cat >> confdefs.h <<\EOF
6756 #define HAVE_KRB4 1
6757 EOF
6758
6759
6760                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6761 echo "configure:6762: checking for des_debug in Kerberos libraries" >&5
6762 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6763   echo $ac_n "(cached) $ac_c" 1>&6
6764 else
6765   
6766                                                                 save_LIBS="$LIBS"
6767                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6768                                 cat > conftest.$ac_ext <<EOF
6769 #line 6770 "configure"
6770 #include "confdefs.h"
6771
6772 #include <kerberosIV/krb.h>
6773 #include <kerberosIV/des.h>
6774 extern int des_debug;
6775
6776 int main() {
6777
6778 des_debug = 1;
6779
6780 ; return 0; }
6781 EOF
6782 if { (eval echo configure:6783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6783   rm -rf conftest*
6784   ol_cv_var_des_debug=yes
6785 else
6786   echo "configure: failed program was:" >&5
6787   cat conftest.$ac_ext >&5
6788   rm -rf conftest*
6789   ol_cv_var_des_debug=no
6790 fi
6791 rm -f conftest*
6792                                                                 LIBS="$save_LIBS"
6793                         
6794 fi
6795
6796 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6797
6798                         if test $ol_cv_var_des_debug = yes ; then
6799                                 cat >> confdefs.h <<\EOF
6800 #define HAVE_DES_DEBUG 1
6801 EOF
6802
6803                         fi
6804
6805                         LIBS="$save_LIBS"
6806                 fi
6807         fi
6808 fi
6809
6810 if test $ol_link_krb5 = yes ; then
6811         ol_with_kerberos=found
6812 fi
6813
6814 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6815         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6816
6817         for ac_hdr in krb.h des.h krb-archaeology.h 
6818 do
6819 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6820 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6821 echo "configure:6822: checking for $ac_hdr" >&5
6822 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6823   echo $ac_n "(cached) $ac_c" 1>&6
6824 else
6825   cat > conftest.$ac_ext <<EOF
6826 #line 6827 "configure"
6827 #include "confdefs.h"
6828 #include <$ac_hdr>
6829 EOF
6830 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6831 { (eval echo configure:6832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6832 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6833 if test -z "$ac_err"; then
6834   rm -rf conftest*
6835   eval "ac_cv_header_$ac_safe=yes"
6836 else
6837   echo "$ac_err" >&5
6838   echo "configure: failed program was:" >&5
6839   cat conftest.$ac_ext >&5
6840   rm -rf conftest*
6841   eval "ac_cv_header_$ac_safe=no"
6842 fi
6843 rm -f conftest*
6844 fi
6845 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6846   echo "$ac_t""yes" 1>&6
6847     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6848   cat >> confdefs.h <<EOF
6849 #define $ac_tr_hdr 1
6850 EOF
6851  
6852 else
6853   echo "$ac_t""no" 1>&6
6854 fi
6855 done
6856
6857
6858         if test $ac_cv_header_krb_h = yes ; then
6859                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6860 echo "configure:6861: checking for main in -lkrb" >&5
6861 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6862 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6863   echo $ac_n "(cached) $ac_c" 1>&6
6864 else
6865   ac_save_LIBS="$LIBS"
6866 LIBS="-lkrb -ldes $LIBS"
6867 cat > conftest.$ac_ext <<EOF
6868 #line 6869 "configure"
6869 #include "confdefs.h"
6870
6871 int main() {
6872 main()
6873 ; return 0; }
6874 EOF
6875 if { (eval echo configure:6876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6876   rm -rf conftest*
6877   eval "ac_cv_lib_$ac_lib_var=yes"
6878 else
6879   echo "configure: failed program was:" >&5
6880   cat conftest.$ac_ext >&5
6881   rm -rf conftest*
6882   eval "ac_cv_lib_$ac_lib_var=no"
6883 fi
6884 rm -f conftest*
6885 LIBS="$ac_save_LIBS"
6886
6887 fi
6888 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6889   echo "$ac_t""yes" 1>&6
6890   have_k4=yes
6891 else
6892   echo "$ac_t""no" 1>&6
6893 have_k4=no
6894 fi
6895
6896
6897                 if test $have_k4 = yes ; then
6898                         ol_with_kerberos=found
6899                         ol_link_krb4=yes
6900
6901                         cat >> confdefs.h <<\EOF
6902 #define HAVE_KRB4 1
6903 EOF
6904
6905
6906                         KRB4_LIBS="-lkrb -ldes"
6907
6908                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6909                                 cat >> confdefs.h <<\EOF
6910 #define HAVE_KTH_KERBEROS 1
6911 EOF
6912
6913                         fi
6914                 fi
6915         fi
6916 fi
6917
6918 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6919         ol_link_kpasswd=yes
6920 fi
6921
6922 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6923         ol_link_kbind=yes
6924
6925 elif test $ol_enable_kbind = yes ; then
6926         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6927 fi
6928
6929 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6930         cat >> confdefs.h <<\EOF
6931 #define HAVE_KERBEROS 1
6932 EOF
6933
6934
6935 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6936         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6937 fi
6938
6939 ol_link_tls=no
6940 if test $ol_with_tls != no ; then
6941         for ac_hdr in openssl/ssl.h ssl.h
6942 do
6943 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6944 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6945 echo "configure:6946: checking for $ac_hdr" >&5
6946 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6947   echo $ac_n "(cached) $ac_c" 1>&6
6948 else
6949   cat > conftest.$ac_ext <<EOF
6950 #line 6951 "configure"
6951 #include "confdefs.h"
6952 #include <$ac_hdr>
6953 EOF
6954 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6955 { (eval echo configure:6956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6956 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6957 if test -z "$ac_err"; then
6958   rm -rf conftest*
6959   eval "ac_cv_header_$ac_safe=yes"
6960 else
6961   echo "$ac_err" >&5
6962   echo "configure: failed program was:" >&5
6963   cat conftest.$ac_ext >&5
6964   rm -rf conftest*
6965   eval "ac_cv_header_$ac_safe=no"
6966 fi
6967 rm -f conftest*
6968 fi
6969 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6970   echo "$ac_t""yes" 1>&6
6971     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6972   cat >> confdefs.h <<EOF
6973 #define $ac_tr_hdr 1
6974 EOF
6975  
6976 else
6977   echo "$ac_t""no" 1>&6
6978 fi
6979 done
6980
6981         
6982         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6983                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6984 echo "configure:6985: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6985 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6986 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6987   echo $ac_n "(cached) $ac_c" 1>&6
6988 else
6989   ac_save_LIBS="$LIBS"
6990 LIBS="-lssl -lcrypto $LIBS"
6991 cat > conftest.$ac_ext <<EOF
6992 #line 6993 "configure"
6993 #include "confdefs.h"
6994 /* Override any gcc2 internal prototype to avoid an error.  */
6995 /* We use char because int might match the return type of a gcc2
6996     builtin and then its argument prototype would still apply.  */
6997 char SSLeay_add_ssl_algorithms();
6998
6999 int main() {
7000 SSLeay_add_ssl_algorithms()
7001 ; return 0; }
7002 EOF
7003 if { (eval echo configure:7004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7004   rm -rf conftest*
7005   eval "ac_cv_lib_$ac_lib_var=yes"
7006 else
7007   echo "configure: failed program was:" >&5
7008   cat conftest.$ac_ext >&5
7009   rm -rf conftest*
7010   eval "ac_cv_lib_$ac_lib_var=no"
7011 fi
7012 rm -f conftest*
7013 LIBS="$ac_save_LIBS"
7014
7015 fi
7016 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7017   echo "$ac_t""yes" 1>&6
7018   have_ssleay=yes
7019                         need_rsaref=no
7020 else
7021   echo "$ac_t""no" 1>&6
7022 have_ssleay=no
7023 fi
7024
7025                         
7026                 if test $have_ssleay = no ; then
7027                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
7028 echo "configure:7029: checking for SSL_library_init in -lssl" >&5
7029 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
7030 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7031   echo $ac_n "(cached) $ac_c" 1>&6
7032 else
7033   ac_save_LIBS="$LIBS"
7034 LIBS="-lssl -lcrypto $LIBS"
7035 cat > conftest.$ac_ext <<EOF
7036 #line 7037 "configure"
7037 #include "confdefs.h"
7038 /* Override any gcc2 internal prototype to avoid an error.  */
7039 /* We use char because int might match the return type of a gcc2
7040     builtin and then its argument prototype would still apply.  */
7041 char SSL_library_init();
7042
7043 int main() {
7044 SSL_library_init()
7045 ; return 0; }
7046 EOF
7047 if { (eval echo configure:7048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7048   rm -rf conftest*
7049   eval "ac_cv_lib_$ac_lib_var=yes"
7050 else
7051   echo "configure: failed program was:" >&5
7052   cat conftest.$ac_ext >&5
7053   rm -rf conftest*
7054   eval "ac_cv_lib_$ac_lib_var=no"
7055 fi
7056 rm -f conftest*
7057 LIBS="$ac_save_LIBS"
7058
7059 fi
7060 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7061   echo "$ac_t""yes" 1>&6
7062   have_ssleay=yes
7063                                 need_rsaref=no
7064 else
7065   echo "$ac_t""no" 1>&6
7066 have_ssleay=no
7067 fi
7068
7069                 fi
7070
7071                 if test $have_ssleay = no ; then
7072                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
7073 echo "configure:7074: checking for ssl3_accept in -lssl" >&5
7074 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
7075 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7076   echo $ac_n "(cached) $ac_c" 1>&6
7077 else
7078   ac_save_LIBS="$LIBS"
7079 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
7080 cat > conftest.$ac_ext <<EOF
7081 #line 7082 "configure"
7082 #include "confdefs.h"
7083 /* Override any gcc2 internal prototype to avoid an error.  */
7084 /* We use char because int might match the return type of a gcc2
7085     builtin and then its argument prototype would still apply.  */
7086 char ssl3_accept();
7087
7088 int main() {
7089 ssl3_accept()
7090 ; return 0; }
7091 EOF
7092 if { (eval echo configure:7093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7093   rm -rf conftest*
7094   eval "ac_cv_lib_$ac_lib_var=yes"
7095 else
7096   echo "configure: failed program was:" >&5
7097   cat conftest.$ac_ext >&5
7098   rm -rf conftest*
7099   eval "ac_cv_lib_$ac_lib_var=no"
7100 fi
7101 rm -f conftest*
7102 LIBS="$ac_save_LIBS"
7103
7104 fi
7105 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7106   echo "$ac_t""yes" 1>&6
7107   have_ssleay=yes
7108                                 need_rsaref=yes
7109 else
7110   echo "$ac_t""no" 1>&6
7111 have_ssleay=no
7112 fi
7113
7114                 fi
7115
7116                 if test $have_ssleay = yes ; then
7117                         ol_with_tls=found
7118                         ol_link_tls=yes
7119
7120                         cat >> confdefs.h <<\EOF
7121 #define HAVE_SSLEAY 1
7122 EOF
7123
7124
7125                         if test $need_rsaref = yes; then
7126                                 cat >> confdefs.h <<\EOF
7127 #define HAVE_RSAREF 1
7128 EOF
7129
7130
7131                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7132                         else
7133                                 TLS_LIBS="-lssl -lcrypto"
7134                         fi
7135                 fi
7136         fi
7137
7138 else
7139         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7140 fi
7141
7142 if test $ol_link_tls = yes ; then
7143         cat >> confdefs.h <<\EOF
7144 #define HAVE_TLS 1
7145 EOF
7146
7147
7148 elif test $ol_with_tls = auto ; then
7149         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7150         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7151
7152 elif test $ol_with_tls != no ; then
7153         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7154 fi
7155
7156 if test $ol_enable_lmpasswd != no; then
7157         if test $ol_link_tls != yes ; then
7158                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7159         fi
7160
7161         cat >> confdefs.h <<\EOF
7162 #define SLAPD_LMHASH 1
7163 EOF
7164
7165 fi
7166
7167 for ac_func in \
7168         ctime_r                 \
7169         gethostbyname_r gethostbyaddr_r \
7170
7171 do
7172 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7173 echo "configure:7174: checking for $ac_func" >&5
7174 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7175   echo $ac_n "(cached) $ac_c" 1>&6
7176 else
7177   cat > conftest.$ac_ext <<EOF
7178 #line 7179 "configure"
7179 #include "confdefs.h"
7180 /* System header to define __stub macros and hopefully few prototypes,
7181     which can conflict with char $ac_func(); below.  */
7182 #include <assert.h>
7183 /* Override any gcc2 internal prototype to avoid an error.  */
7184 /* We use char because int might match the return type of a gcc2
7185     builtin and then its argument prototype would still apply.  */
7186 char $ac_func();
7187 char (*f)();
7188
7189 int main() {
7190
7191 /* The GNU C library defines this for functions which it implements
7192     to always fail with ENOSYS.  Some functions are actually named
7193     something starting with __ and the normal name is an alias.  */
7194 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7195 choke me
7196 #else
7197 f = $ac_func;
7198 #endif
7199
7200 ; return 0; }
7201 EOF
7202 if { (eval echo configure:7203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7203   rm -rf conftest*
7204   eval "ac_cv_func_$ac_func=yes"
7205 else
7206   echo "configure: failed program was:" >&5
7207   cat conftest.$ac_ext >&5
7208   rm -rf conftest*
7209   eval "ac_cv_func_$ac_func=no"
7210 fi
7211 rm -f conftest*
7212 fi
7213
7214 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7215   echo "$ac_t""yes" 1>&6
7216     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7217   cat >> confdefs.h <<EOF
7218 #define $ac_tr_func 1
7219 EOF
7220  
7221 else
7222   echo "$ac_t""no" 1>&6
7223 fi
7224 done
7225
7226
7227 if test "$ac_cv_func_ctime_r" = no ; then
7228         ol_cv_func_ctime_r_nargs=0
7229 else
7230         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7231 echo "configure:7232: checking number of arguments of ctime_r" >&5
7232 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7233   echo $ac_n "(cached) $ac_c" 1>&6
7234 else
7235   cat > conftest.$ac_ext <<EOF
7236 #line 7237 "configure"
7237 #include "confdefs.h"
7238 #include <time.h>
7239 int main() {
7240 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7241 ; return 0; }
7242 EOF
7243 if { (eval echo configure:7244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7244   rm -rf conftest*
7245   ol_cv_func_ctime_r_nargs3=yes
7246 else
7247   echo "configure: failed program was:" >&5
7248   cat conftest.$ac_ext >&5
7249   rm -rf conftest*
7250   ol_cv_func_ctime_r_nargs3=no
7251 fi
7252 rm -f conftest*
7253
7254         cat > conftest.$ac_ext <<EOF
7255 #line 7256 "configure"
7256 #include "confdefs.h"
7257 #include <time.h>
7258 int main() {
7259 time_t ti; char *buffer; ctime_r(&ti,buffer);
7260 ; return 0; }
7261 EOF
7262 if { (eval echo configure:7263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7263   rm -rf conftest*
7264   ol_cv_func_ctime_r_nargs2=yes
7265 else
7266   echo "configure: failed program was:" >&5
7267   cat conftest.$ac_ext >&5
7268   rm -rf conftest*
7269   ol_cv_func_ctime_r_nargs2=no
7270 fi
7271 rm -f conftest*
7272
7273         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7274                 $ol_cv_func_ctime_r_nargs2 = no ; then
7275
7276                 ol_cv_func_ctime_r_nargs=3
7277
7278         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7279                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7280
7281                 ol_cv_func_ctime_r_nargs=2
7282
7283         else
7284                 ol_cv_func_ctime_r_nargs=0
7285         fi
7286   
7287 fi
7288
7289 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7290
7291   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7292         cat >> confdefs.h <<EOF
7293 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7294 EOF
7295
7296   fi
7297
7298 fi
7299
7300 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7301         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7302 echo "configure:7303: checking number of arguments of gethostbyname_r" >&5
7303 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7304   echo $ac_n "(cached) $ac_c" 1>&6
7305 else
7306   cat > conftest.$ac_ext <<EOF
7307 #line 7308 "configure"
7308 #include "confdefs.h"
7309 #include <sys/types.h>
7310 #include <sys/socket.h>
7311 #include <netinet/in.h>
7312 #include <netdb.h>
7313 #define BUFSIZE (sizeof(struct hostent)+10)
7314 int main() {
7315 struct hostent hent; char buffer[BUFSIZE];
7316                 int bufsize=BUFSIZE;int h_errno;
7317                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7318                         buffer, bufsize, &h_errno);
7319 ; return 0; }
7320 EOF
7321 if { (eval echo configure:7322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7322   rm -rf conftest*
7323   ol_cv_func_gethostbyname_r_nargs5=yes
7324 else
7325   echo "configure: failed program was:" >&5
7326   cat conftest.$ac_ext >&5
7327   rm -rf conftest*
7328   ol_cv_func_gethostbyname_r_nargs5=no
7329 fi
7330 rm -f conftest*
7331
7332         cat > conftest.$ac_ext <<EOF
7333 #line 7334 "configure"
7334 #include "confdefs.h"
7335 #include <sys/types.h>
7336 #include <sys/socket.h>
7337 #include <netinet/in.h>
7338 #include <netdb.h>
7339 #define BUFSIZE (sizeof(struct hostent)+10)
7340 int main() {
7341 struct hostent hent;struct hostent *rhent;
7342                 char buffer[BUFSIZE];
7343                 int bufsize=BUFSIZE;int h_errno;
7344                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7345                         &rhent, &h_errno);
7346 ; return 0; }
7347 EOF
7348 if { (eval echo configure:7349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7349   rm -rf conftest*
7350   ol_cv_func_gethostbyname_r_nargs6=yes
7351 else
7352   echo "configure: failed program was:" >&5
7353   cat conftest.$ac_ext >&5
7354   rm -rf conftest*
7355   ol_cv_func_gethostbyname_r_nargs6=no
7356 fi
7357 rm -f conftest*
7358
7359         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7360                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7361
7362                 ol_cv_func_gethostbyname_r_nargs=5
7363
7364         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7365                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7366
7367                 ol_cv_func_gethostbyname_r_nargs=6
7368
7369         else
7370                 ol_cv_func_gethostbyname_r_nargs=0
7371         fi
7372   
7373 fi
7374
7375 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7376   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7377         cat >> confdefs.h <<EOF
7378 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7379 EOF
7380
7381   fi
7382
7383 else
7384         ol_cv_func_gethostbyname_r_nargs=0
7385 fi
7386  
7387 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7388         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7389 echo "configure:7390: checking number of arguments of gethostbyaddr_r" >&5
7390 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7391   echo $ac_n "(cached) $ac_c" 1>&6
7392 else
7393   cat > conftest.$ac_ext <<EOF
7394 #line 7395 "configure"
7395 #include "confdefs.h"
7396 #include <sys/types.h>
7397 #include <sys/socket.h>
7398 #include <netinet/in.h>
7399 #include <netdb.h>
7400 #define BUFSIZE (sizeof(struct hostent)+10)
7401 int main() {
7402 struct hostent hent; char buffer[BUFSIZE]; 
7403             struct in_addr add;
7404             size_t alen=sizeof(struct in_addr);
7405             int bufsize=BUFSIZE;int h_errno;
7406                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7407                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7408 ; return 0; }
7409 EOF
7410 if { (eval echo configure:7411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7411   rm -rf conftest*
7412   ol_cv_func_gethostbyaddr_r_nargs7=yes
7413 else
7414   echo "configure: failed program was:" >&5
7415   cat conftest.$ac_ext >&5
7416   rm -rf conftest*
7417   ol_cv_func_gethostbyaddr_r_nargs7=no
7418 fi
7419 rm -f conftest*
7420
7421         cat > conftest.$ac_ext <<EOF
7422 #line 7423 "configure"
7423 #include "confdefs.h"
7424 #include <sys/types.h>
7425 #include <sys/socket.h>
7426 #include <netinet/in.h>
7427 #include <netdb.h>
7428 #define BUFSIZE (sizeof(struct hostent)+10)
7429 int main() {
7430 struct hostent hent;
7431                 struct hostent *rhent; char buffer[BUFSIZE]; 
7432                 struct in_addr add;
7433                 size_t alen=sizeof(struct in_addr);
7434                 int bufsize=BUFSIZE;int h_errno;
7435                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7436                         alen, AF_INET, &hent, buffer, bufsize, 
7437                         &rhent, &h_errno);
7438 ; return 0; }
7439 EOF
7440 if { (eval echo configure:7441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7441   rm -rf conftest*
7442   ol_cv_func_gethostbyaddr_r_nargs8=yes
7443 else
7444   echo "configure: failed program was:" >&5
7445   cat conftest.$ac_ext >&5
7446   rm -rf conftest*
7447   ol_cv_func_gethostbyaddr_r_nargs8=no
7448 fi
7449 rm -f conftest*
7450
7451         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7452                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7453
7454                 ol_cv_func_gethostbyaddr_r_nargs=7
7455
7456         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7457                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7458
7459                 ol_cv_func_gethostbyaddr_r_nargs=8
7460
7461         else
7462                 ol_cv_func_gethostbyaddr_r_nargs=0
7463         fi
7464   
7465 fi
7466
7467 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7468   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7469     cat >> confdefs.h <<EOF
7470 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7471 EOF
7472
7473   fi
7474
7475 else
7476         ol_cv_func_gethostbyaddr_r_nargs=0
7477 fi
7478
7479 if test "$ac_cv_func_ctime_r" = yes \
7480         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7481         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7482         -a "$ac_cv_func_gethostbyname_r" = yes \
7483         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7484         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7485         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7486         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7487         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7488         ; then
7489  
7490         cat >> confdefs.h <<\EOF
7491 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7492 EOF
7493
7494 fi
7495
7496 ol_link_threads=no
7497
7498 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7499         -o $ol_with_threads = nt ; then
7500
7501         
7502         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7503 echo "configure:7504: checking for _beginthread" >&5
7504 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7505   echo $ac_n "(cached) $ac_c" 1>&6
7506 else
7507   cat > conftest.$ac_ext <<EOF
7508 #line 7509 "configure"
7509 #include "confdefs.h"
7510 /* System header to define __stub macros and hopefully few prototypes,
7511     which can conflict with char _beginthread(); below.  */
7512 #include <assert.h>
7513 /* Override any gcc2 internal prototype to avoid an error.  */
7514 /* We use char because int might match the return type of a gcc2
7515     builtin and then its argument prototype would still apply.  */
7516 char _beginthread();
7517 char (*f)();
7518
7519 int main() {
7520
7521 /* The GNU C library defines this for functions which it implements
7522     to always fail with ENOSYS.  Some functions are actually named
7523     something starting with __ and the normal name is an alias.  */
7524 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7525 choke me
7526 #else
7527 f = _beginthread;
7528 #endif
7529
7530 ; return 0; }
7531 EOF
7532 if { (eval echo configure:7533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7533   rm -rf conftest*
7534   eval "ac_cv_func__beginthread=yes"
7535 else
7536   echo "configure: failed program was:" >&5
7537   cat conftest.$ac_ext >&5
7538   rm -rf conftest*
7539   eval "ac_cv_func__beginthread=no"
7540 fi
7541 rm -f conftest*
7542 fi
7543
7544 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7545   echo "$ac_t""yes" 1>&6
7546   :
7547 else
7548   echo "$ac_t""no" 1>&6
7549 fi
7550
7551
7552         if test $ac_cv_func__beginthread = yes ; then
7553                 cat >> confdefs.h <<\EOF
7554 #define HAVE_NT_THREADS 1
7555 EOF
7556
7557                 ol_cv_nt_threads=yes
7558         fi
7559
7560
7561         if test "$ol_cv_nt_threads" = yes ; then
7562         ol_link_threads=nt
7563         ol_with_threads=found
7564         ol_with_yielding_select=yes
7565
7566                 cat >> confdefs.h <<\EOF
7567 #define HAVE_NT_SERVICE_MANAGER 1
7568 EOF
7569
7570                 cat >> confdefs.h <<\EOF
7571 #define HAVE_NT_EVENT_LOG 1
7572 EOF
7573
7574         fi
7575
7576         if test $ol_with_threads = nt ; then
7577                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7578         fi
7579 fi
7580
7581 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7582         -o $ol_with_threads = posix ; then
7583
7584         for ac_hdr in pthread.h
7585 do
7586 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7587 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7588 echo "configure:7589: checking for $ac_hdr" >&5
7589 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7590   echo $ac_n "(cached) $ac_c" 1>&6
7591 else
7592   cat > conftest.$ac_ext <<EOF
7593 #line 7594 "configure"
7594 #include "confdefs.h"
7595 #include <$ac_hdr>
7596 EOF
7597 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7598 { (eval echo configure:7599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7599 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7600 if test -z "$ac_err"; then
7601   rm -rf conftest*
7602   eval "ac_cv_header_$ac_safe=yes"
7603 else
7604   echo "$ac_err" >&5
7605   echo "configure: failed program was:" >&5
7606   cat conftest.$ac_ext >&5
7607   rm -rf conftest*
7608   eval "ac_cv_header_$ac_safe=no"
7609 fi
7610 rm -f conftest*
7611 fi
7612 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7613   echo "$ac_t""yes" 1>&6
7614     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7615   cat >> confdefs.h <<EOF
7616 #define $ac_tr_hdr 1
7617 EOF
7618  
7619 else
7620   echo "$ac_t""no" 1>&6
7621 fi
7622 done
7623
7624
7625         if test $ac_cv_header_pthread_h = yes ; then
7626                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7627 echo "configure:7628: checking POSIX thread version" >&5
7628 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7629   echo $ac_n "(cached) $ac_c" 1>&6
7630 else
7631   
7632         cat > conftest.$ac_ext <<EOF
7633 #line 7634 "configure"
7634 #include "confdefs.h"
7635
7636 #               include <pthread.h>
7637                 /* this check could be improved */
7638 #               ifdef PTHREAD_ONCE_INIT
7639                         pthread_version_final;
7640 #               endif
7641         
7642 EOF
7643 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7644   egrep "pthread_version_final" >/dev/null 2>&1; then
7645   rm -rf conftest*
7646   ol_pthread_final=yes
7647 else
7648   rm -rf conftest*
7649   ol_pthread_final=no
7650 fi
7651 rm -f conftest*
7652
7653
7654         cat > conftest.$ac_ext <<EOF
7655 #line 7656 "configure"
7656 #include "confdefs.h"
7657
7658 #               include <pthread.h>
7659                 /* this check could be improved */
7660 #               ifdef pthread_once_init
7661                         pthread_version_draft4;
7662 #               endif
7663         
7664 EOF
7665 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7666   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7667   rm -rf conftest*
7668   ol_pthread_draft4=yes
7669 else
7670   rm -rf conftest*
7671   ol_pthread_draft4=no
7672 fi
7673 rm -f conftest*
7674
7675
7676         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7677                 ol_cv_pthread_version=final
7678         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7679                 ol_cv_pthread_version=draft4
7680         else
7681                 ol_cv_pthread_version=unknown
7682         fi
7683
7684 fi
7685
7686 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7687
7688
7689                 if test $ol_cv_pthread_version = final ; then
7690                         cat >> confdefs.h <<\EOF
7691 #define HAVE_PTHREADS_FINAL 1
7692 EOF
7693
7694                 elif test $ol_cv_pthread_version = draft4 ; then
7695                         cat >> confdefs.h <<\EOF
7696 #define HAVE_PTHREADS_D4 1
7697 EOF
7698
7699                 else
7700                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7701                 fi
7702
7703                 # consider threads found
7704                 ol_with_threads=found
7705
7706                 
7707         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7708 echo "configure:7709: checking for LinuxThreads pthread.h" >&5
7709 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7710   echo $ac_n "(cached) $ac_c" 1>&6
7711 else
7712   cat > conftest.$ac_ext <<EOF
7713 #line 7714 "configure"
7714 #include "confdefs.h"
7715 #include <pthread.h>
7716 EOF
7717 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7718   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7719   rm -rf conftest*
7720   ol_cv_header_linux_threads=yes
7721 else
7722   rm -rf conftest*
7723   ol_cv_header_linux_threads=no
7724 fi
7725 rm -f conftest*
7726
7727                 
7728 fi
7729
7730 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7731         if test $ol_cv_header_linux_threads = yes; then
7732                 cat >> confdefs.h <<\EOF
7733 #define HAVE_LINUX_THREADS 1
7734 EOF
7735
7736         fi
7737
7738                 
7739         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7740 echo "configure:7741: checking for GNU Pth pthread.h" >&5
7741 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7742   echo $ac_n "(cached) $ac_c" 1>&6
7743 else
7744   cat > conftest.$ac_ext <<EOF
7745 #line 7746 "configure"
7746 #include "confdefs.h"
7747 #include <pthread.h>
7748 #ifdef _POSIX_THREAD_IS_GNU_PTH
7749         __gnu_pth__;
7750 #endif
7751
7752 EOF
7753 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7754   egrep "__gnu_pth__" >/dev/null 2>&1; then
7755   rm -rf conftest*
7756   ol_cv_header_gnu_pth_pthread_h=yes
7757 else
7758   rm -rf conftest*
7759   ol_cv_header_gnu_pth_pthread_h=no
7760 fi
7761 rm -f conftest*
7762
7763                 
7764 fi
7765
7766 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7767
7768
7769                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7770                         for ac_hdr in sched.h
7771 do
7772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7774 echo "configure:7775: checking for $ac_hdr" >&5
7775 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7776   echo $ac_n "(cached) $ac_c" 1>&6
7777 else
7778   cat > conftest.$ac_ext <<EOF
7779 #line 7780 "configure"
7780 #include "confdefs.h"
7781 #include <$ac_hdr>
7782 EOF
7783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7784 { (eval echo configure:7785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7786 if test -z "$ac_err"; then
7787   rm -rf conftest*
7788   eval "ac_cv_header_$ac_safe=yes"
7789 else
7790   echo "$ac_err" >&5
7791   echo "configure: failed program was:" >&5
7792   cat conftest.$ac_ext >&5
7793   rm -rf conftest*
7794   eval "ac_cv_header_$ac_safe=no"
7795 fi
7796 rm -f conftest*
7797 fi
7798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7799   echo "$ac_t""yes" 1>&6
7800     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7801   cat >> confdefs.h <<EOF
7802 #define $ac_tr_hdr 1
7803 EOF
7804  
7805 else
7806   echo "$ac_t""no" 1>&6
7807 fi
7808 done
7809
7810                 fi
7811
7812                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7813                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7814 echo "configure:7815: checking for pthread_create in default libraries" >&5
7815 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7816   echo $ac_n "(cached) $ac_c" 1>&6
7817 else
7818   
7819                 if test "$cross_compiling" = yes; then
7820   cat > conftest.$ac_ext <<EOF
7821 #line 7822 "configure"
7822 #include "confdefs.h"
7823 /* pthread test headers */
7824 #include <pthread.h>
7825 #ifndef NULL
7826 #define NULL (void*)0
7827 #endif
7828
7829 static void *task(p)
7830         void *p;
7831 {
7832         return (void *) (p == NULL);
7833 }
7834
7835 int main() {
7836
7837         /* pthread test function */
7838         pthread_t t;
7839         int status;
7840         int detach = 1;
7841
7842 #ifdef HAVE_PTHREADS_FINAL
7843         /* Final pthreads */
7844         pthread_attr_t attr;
7845
7846         status = pthread_attr_init(&attr);
7847         if( status ) return status;
7848
7849 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7850         if( !detach ) {
7851 #if defined( PTHREAD_CREATE_JOINABLE )
7852                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7853 #else
7854                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7855 #endif
7856
7857 #ifdef PTHREAD_CREATE_DETACHED
7858         } else {
7859                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7860 #endif
7861         }
7862         if( status ) return status;
7863 #endif
7864
7865         status = pthread_create( &t, &attr, task, NULL );
7866         if( status ) return status;
7867
7868 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7869         if( detach ) {
7870                 /* give thread a chance to complete */
7871                 /* it should remain joinable and hence detachable */
7872                 sleep( 1 );
7873
7874                 status = pthread_detach( t );
7875                 if( status ) return status;
7876         }
7877 #endif
7878
7879 #else
7880         /* Draft 4 pthreads */
7881         status = pthread_create( &t, pthread_attr_default, task, NULL );
7882         if( status ) return status;
7883
7884         if( detach ) {
7885                 /* give thread a chance to complete */
7886                 /* it should remain joinable and hence detachable */
7887                 sleep( 1 );
7888
7889                 status = pthread_detach( &t );
7890                 if( status ) return status;
7891         }
7892 #endif
7893
7894 #ifdef HAVE_LINUX_THREADS
7895         pthread_kill_other_threads_np();
7896 #endif
7897
7898         return 0;
7899
7900 ; return 0; }
7901 EOF
7902 if { (eval echo configure:7903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7903   rm -rf conftest*
7904   ol_cv_pthread_create=yes
7905 else
7906   echo "configure: failed program was:" >&5
7907   cat conftest.$ac_ext >&5
7908   rm -rf conftest*
7909   ol_cv_pthread_create=no
7910 fi
7911 rm -f conftest*
7912 else
7913   cat > conftest.$ac_ext <<EOF
7914 #line 7915 "configure"
7915 #include "confdefs.h"
7916 /* pthread test headers */
7917 #include <pthread.h>
7918 #ifndef NULL
7919 #define NULL (void*)0
7920 #endif
7921
7922 static void *task(p)
7923         void *p;
7924 {
7925         return (void *) (p == NULL);
7926 }
7927
7928
7929 int main(argc, argv)
7930         int argc;
7931         char **argv;
7932 {
7933
7934         /* pthread test function */
7935         pthread_t t;
7936         int status;
7937         int detach = 1;
7938
7939 #ifdef HAVE_PTHREADS_FINAL
7940         /* Final pthreads */
7941         pthread_attr_t attr;
7942
7943         status = pthread_attr_init(&attr);
7944         if( status ) return status;
7945
7946 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7947         if( !detach ) {
7948 #if defined( PTHREAD_CREATE_JOINABLE )
7949                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7950 #else
7951                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7952 #endif
7953
7954 #ifdef PTHREAD_CREATE_DETACHED
7955         } else {
7956                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7957 #endif
7958         }
7959         if( status ) return status;
7960 #endif
7961
7962         status = pthread_create( &t, &attr, task, NULL );
7963         if( status ) return status;
7964
7965 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7966         if( detach ) {
7967                 /* give thread a chance to complete */
7968                 /* it should remain joinable and hence detachable */
7969                 sleep( 1 );
7970
7971                 status = pthread_detach( t );
7972                 if( status ) return status;
7973         }
7974 #endif
7975
7976 #else
7977         /* Draft 4 pthreads */
7978         status = pthread_create( &t, pthread_attr_default, task, NULL );
7979         if( status ) return status;
7980
7981         if( detach ) {
7982                 /* give thread a chance to complete */
7983                 /* it should remain joinable and hence detachable */
7984                 sleep( 1 );
7985
7986                 status = pthread_detach( &t );
7987                 if( status ) return status;
7988         }
7989 #endif
7990
7991 #ifdef HAVE_LINUX_THREADS
7992         pthread_kill_other_threads_np();
7993 #endif
7994
7995         return 0;
7996
7997 }
7998
7999 EOF
8000 if { (eval echo configure:8001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8001 then
8002   ol_cv_pthread_create=yes
8003 else
8004   echo "configure: failed program was:" >&5
8005   cat conftest.$ac_ext >&5
8006   rm -fr conftest*
8007   ol_cv_pthread_create=no
8008 fi
8009 rm -fr conftest*
8010 fi
8011
8012 fi
8013
8014 echo "$ac_t""$ol_cv_pthread_create" 1>&6
8015
8016                 if test $ol_cv_pthread_create != no ; then
8017                         ol_link_threads=posix
8018                         ol_link_pthreads=""
8019                 fi
8020                 
8021                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
8022 if test "$ol_link_threads" = no ; then
8023         # try -kthread
8024         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
8025 echo "configure:8026: checking for pthread link with -kthread" >&5
8026 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
8027   echo $ac_n "(cached) $ac_c" 1>&6
8028 else
8029   
8030                 # save the flags
8031                 ol_LIBS="$LIBS"
8032                 LIBS="-kthread $LIBS"
8033
8034                 if test "$cross_compiling" = yes; then
8035   cat > conftest.$ac_ext <<EOF
8036 #line 8037 "configure"
8037 #include "confdefs.h"
8038 /* pthread test headers */
8039 #include <pthread.h>
8040 #ifndef NULL
8041 #define NULL (void*)0
8042 #endif
8043
8044 static void *task(p)
8045         void *p;
8046 {
8047         return (void *) (p == NULL);
8048 }
8049
8050 int main() {
8051
8052         /* pthread test function */
8053         pthread_t t;
8054         int status;
8055         int detach = 1;
8056
8057 #ifdef HAVE_PTHREADS_FINAL
8058         /* Final pthreads */
8059         pthread_attr_t attr;
8060
8061         status = pthread_attr_init(&attr);
8062         if( status ) return status;
8063
8064 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8065         if( !detach ) {
8066 #if defined( PTHREAD_CREATE_JOINABLE )
8067                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8068 #else
8069                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8070 #endif
8071
8072 #ifdef PTHREAD_CREATE_DETACHED
8073         } else {
8074                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8075 #endif
8076         }
8077         if( status ) return status;
8078 #endif
8079
8080         status = pthread_create( &t, &attr, task, NULL );
8081         if( status ) return status;
8082
8083 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8084         if( detach ) {
8085                 /* give thread a chance to complete */
8086                 /* it should remain joinable and hence detachable */
8087                 sleep( 1 );
8088
8089                 status = pthread_detach( t );
8090                 if( status ) return status;
8091         }
8092 #endif
8093
8094 #else
8095         /* Draft 4 pthreads */
8096         status = pthread_create( &t, pthread_attr_default, task, NULL );
8097         if( status ) return status;
8098
8099         if( detach ) {
8100                 /* give thread a chance to complete */
8101                 /* it should remain joinable and hence detachable */
8102                 sleep( 1 );
8103
8104                 status = pthread_detach( &t );
8105                 if( status ) return status;
8106         }
8107 #endif
8108
8109 #ifdef HAVE_LINUX_THREADS
8110         pthread_kill_other_threads_np();
8111 #endif
8112
8113         return 0;
8114
8115 ; return 0; }
8116 EOF
8117 if { (eval echo configure:8118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8118   rm -rf conftest*
8119   ol_cv_pthread_kthread=yes
8120 else
8121   echo "configure: failed program was:" >&5
8122   cat conftest.$ac_ext >&5
8123   rm -rf conftest*
8124   ol_cv_pthread_kthread=no
8125 fi
8126 rm -f conftest*
8127 else
8128   cat > conftest.$ac_ext <<EOF
8129 #line 8130 "configure"
8130 #include "confdefs.h"
8131 /* pthread test headers */
8132 #include <pthread.h>
8133 #ifndef NULL
8134 #define NULL (void*)0
8135 #endif
8136
8137 static void *task(p)
8138         void *p;
8139 {
8140         return (void *) (p == NULL);
8141 }
8142
8143
8144 int main(argc, argv)
8145         int argc;
8146         char **argv;
8147 {
8148
8149         /* pthread test function */
8150         pthread_t t;
8151         int status;
8152         int detach = 1;
8153
8154 #ifdef HAVE_PTHREADS_FINAL
8155         /* Final pthreads */
8156         pthread_attr_t attr;
8157
8158         status = pthread_attr_init(&attr);
8159         if( status ) return status;
8160
8161 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8162         if( !detach ) {
8163 #if defined( PTHREAD_CREATE_JOINABLE )
8164                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8165 #else
8166                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8167 #endif
8168
8169 #ifdef PTHREAD_CREATE_DETACHED
8170         } else {
8171                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8172 #endif
8173         }
8174         if( status ) return status;
8175 #endif
8176
8177         status = pthread_create( &t, &attr, task, NULL );
8178         if( status ) return status;
8179
8180 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8181         if( detach ) {
8182                 /* give thread a chance to complete */
8183                 /* it should remain joinable and hence detachable */
8184                 sleep( 1 );
8185
8186                 status = pthread_detach( t );
8187                 if( status ) return status;
8188         }
8189 #endif
8190
8191 #else
8192         /* Draft 4 pthreads */
8193         status = pthread_create( &t, pthread_attr_default, task, NULL );
8194         if( status ) return status;
8195
8196         if( detach ) {
8197                 /* give thread a chance to complete */
8198                 /* it should remain joinable and hence detachable */
8199                 sleep( 1 );
8200
8201                 status = pthread_detach( &t );
8202                 if( status ) return status;
8203         }
8204 #endif
8205
8206 #ifdef HAVE_LINUX_THREADS
8207         pthread_kill_other_threads_np();
8208 #endif
8209
8210         return 0;
8211
8212 }
8213
8214 EOF
8215 if { (eval echo configure:8216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8216 then
8217   ol_cv_pthread_kthread=yes
8218 else
8219   echo "configure: failed program was:" >&5
8220   cat conftest.$ac_ext >&5
8221   rm -fr conftest*
8222   ol_cv_pthread_kthread=no
8223 fi
8224 rm -fr conftest*
8225 fi
8226
8227
8228                 # restore the LIBS
8229                 LIBS="$ol_LIBS"
8230         
8231 fi
8232
8233 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8234
8235         if test $ol_cv_pthread_kthread = yes ; then
8236                 ol_link_pthreads="-kthread"
8237                 ol_link_threads=posix
8238         fi
8239 fi
8240
8241                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8242 if test "$ol_link_threads" = no ; then
8243         # try -pthread
8244         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8245 echo "configure:8246: checking for pthread link with -pthread" >&5
8246 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8247   echo $ac_n "(cached) $ac_c" 1>&6
8248 else
8249   
8250                 # save the flags
8251                 ol_LIBS="$LIBS"
8252                 LIBS="-pthread $LIBS"
8253
8254                 if test "$cross_compiling" = yes; then
8255   cat > conftest.$ac_ext <<EOF
8256 #line 8257 "configure"
8257 #include "confdefs.h"
8258 /* pthread test headers */
8259 #include <pthread.h>
8260 #ifndef NULL
8261 #define NULL (void*)0
8262 #endif
8263
8264 static void *task(p)
8265         void *p;
8266 {
8267         return (void *) (p == NULL);
8268 }
8269
8270 int main() {
8271
8272         /* pthread test function */
8273         pthread_t t;
8274         int status;
8275         int detach = 1;
8276
8277 #ifdef HAVE_PTHREADS_FINAL
8278         /* Final pthreads */
8279         pthread_attr_t attr;
8280
8281         status = pthread_attr_init(&attr);
8282         if( status ) return status;
8283
8284 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8285         if( !detach ) {
8286 #if defined( PTHREAD_CREATE_JOINABLE )
8287                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8288 #else
8289                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8290 #endif
8291
8292 #ifdef PTHREAD_CREATE_DETACHED
8293         } else {
8294                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8295 #endif
8296         }
8297         if( status ) return status;
8298 #endif
8299
8300         status = pthread_create( &t, &attr, task, NULL );
8301         if( status ) return status;
8302
8303 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8304         if( detach ) {
8305                 /* give thread a chance to complete */
8306                 /* it should remain joinable and hence detachable */
8307                 sleep( 1 );
8308
8309                 status = pthread_detach( t );
8310                 if( status ) return status;
8311         }
8312 #endif
8313
8314 #else
8315         /* Draft 4 pthreads */
8316         status = pthread_create( &t, pthread_attr_default, task, NULL );
8317         if( status ) return status;
8318
8319         if( detach ) {
8320                 /* give thread a chance to complete */
8321                 /* it should remain joinable and hence detachable */
8322                 sleep( 1 );
8323
8324                 status = pthread_detach( &t );
8325                 if( status ) return status;
8326         }
8327 #endif
8328
8329 #ifdef HAVE_LINUX_THREADS
8330         pthread_kill_other_threads_np();
8331 #endif
8332
8333         return 0;
8334
8335 ; return 0; }
8336 EOF
8337 if { (eval echo configure:8338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8338   rm -rf conftest*
8339   ol_cv_pthread_pthread=yes
8340 else
8341   echo "configure: failed program was:" >&5
8342   cat conftest.$ac_ext >&5
8343   rm -rf conftest*
8344   ol_cv_pthread_pthread=no
8345 fi
8346 rm -f conftest*
8347 else
8348   cat > conftest.$ac_ext <<EOF
8349 #line 8350 "configure"
8350 #include "confdefs.h"
8351 /* pthread test headers */
8352 #include <pthread.h>
8353 #ifndef NULL
8354 #define NULL (void*)0
8355 #endif
8356
8357 static void *task(p)
8358         void *p;
8359 {
8360         return (void *) (p == NULL);
8361 }
8362
8363
8364 int main(argc, argv)
8365         int argc;
8366         char **argv;
8367 {
8368
8369         /* pthread test function */
8370         pthread_t t;
8371         int status;
8372         int detach = 1;
8373
8374 #ifdef HAVE_PTHREADS_FINAL
8375         /* Final pthreads */
8376         pthread_attr_t attr;
8377
8378         status = pthread_attr_init(&attr);
8379         if( status ) return status;
8380
8381 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8382         if( !detach ) {
8383 #if defined( PTHREAD_CREATE_JOINABLE )
8384                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8385 #else
8386                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8387 #endif
8388
8389 #ifdef PTHREAD_CREATE_DETACHED
8390         } else {
8391                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8392 #endif
8393         }
8394         if( status ) return status;
8395 #endif
8396
8397         status = pthread_create( &t, &attr, task, NULL );
8398         if( status ) return status;
8399
8400 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8401         if( detach ) {
8402                 /* give thread a chance to complete */
8403                 /* it should remain joinable and hence detachable */
8404                 sleep( 1 );
8405
8406                 status = pthread_detach( t );
8407                 if( status ) return status;
8408         }
8409 #endif
8410
8411 #else
8412         /* Draft 4 pthreads */
8413         status = pthread_create( &t, pthread_attr_default, task, NULL );
8414         if( status ) return status;
8415
8416         if( detach ) {
8417                 /* give thread a chance to complete */
8418                 /* it should remain joinable and hence detachable */
8419                 sleep( 1 );
8420
8421                 status = pthread_detach( &t );
8422                 if( status ) return status;
8423         }
8424 #endif
8425
8426 #ifdef HAVE_LINUX_THREADS
8427         pthread_kill_other_threads_np();
8428 #endif
8429
8430         return 0;
8431
8432 }
8433
8434 EOF
8435 if { (eval echo configure:8436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8436 then
8437   ol_cv_pthread_pthread=yes
8438 else
8439   echo "configure: failed program was:" >&5
8440   cat conftest.$ac_ext >&5
8441   rm -fr conftest*
8442   ol_cv_pthread_pthread=no
8443 fi
8444 rm -fr conftest*
8445 fi
8446
8447
8448                 # restore the LIBS
8449                 LIBS="$ol_LIBS"
8450         
8451 fi
8452
8453 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8454
8455         if test $ol_cv_pthread_pthread = yes ; then
8456                 ol_link_pthreads="-pthread"
8457                 ol_link_threads=posix
8458         fi
8459 fi
8460
8461                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8462 if test "$ol_link_threads" = no ; then
8463         # try -pthreads
8464         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8465 echo "configure:8466: checking for pthread link with -pthreads" >&5
8466 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8467   echo $ac_n "(cached) $ac_c" 1>&6
8468 else
8469   
8470                 # save the flags
8471                 ol_LIBS="$LIBS"
8472                 LIBS="-pthreads $LIBS"
8473
8474                 if test "$cross_compiling" = yes; then
8475   cat > conftest.$ac_ext <<EOF
8476 #line 8477 "configure"
8477 #include "confdefs.h"
8478 /* pthread test headers */
8479 #include <pthread.h>
8480 #ifndef NULL
8481 #define NULL (void*)0
8482 #endif
8483
8484 static void *task(p)
8485         void *p;
8486 {
8487         return (void *) (p == NULL);
8488 }
8489
8490 int main() {
8491
8492         /* pthread test function */
8493         pthread_t t;
8494         int status;
8495         int detach = 1;
8496
8497 #ifdef HAVE_PTHREADS_FINAL
8498         /* Final pthreads */
8499         pthread_attr_t attr;
8500
8501         status = pthread_attr_init(&attr);
8502         if( status ) return status;
8503
8504 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8505         if( !detach ) {
8506 #if defined( PTHREAD_CREATE_JOINABLE )
8507                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8508 #else
8509                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8510 #endif
8511
8512 #ifdef PTHREAD_CREATE_DETACHED
8513         } else {
8514                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8515 #endif
8516         }
8517         if( status ) return status;
8518 #endif
8519
8520         status = pthread_create( &t, &attr, task, NULL );
8521         if( status ) return status;
8522
8523 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8524         if( detach ) {
8525                 /* give thread a chance to complete */
8526                 /* it should remain joinable and hence detachable */
8527                 sleep( 1 );
8528
8529                 status = pthread_detach( t );
8530                 if( status ) return status;
8531         }
8532 #endif
8533
8534 #else
8535         /* Draft 4 pthreads */
8536         status = pthread_create( &t, pthread_attr_default, task, NULL );
8537         if( status ) return status;
8538
8539         if( detach ) {
8540                 /* give thread a chance to complete */
8541                 /* it should remain joinable and hence detachable */
8542                 sleep( 1 );
8543
8544                 status = pthread_detach( &t );
8545                 if( status ) return status;
8546         }
8547 #endif
8548
8549 #ifdef HAVE_LINUX_THREADS
8550         pthread_kill_other_threads_np();
8551 #endif
8552
8553         return 0;
8554
8555 ; return 0; }
8556 EOF
8557 if { (eval echo configure:8558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8558   rm -rf conftest*
8559   ol_cv_pthread_pthreads=yes
8560 else
8561   echo "configure: failed program was:" >&5
8562   cat conftest.$ac_ext >&5
8563   rm -rf conftest*
8564   ol_cv_pthread_pthreads=no
8565 fi
8566 rm -f conftest*
8567 else
8568   cat > conftest.$ac_ext <<EOF
8569 #line 8570 "configure"
8570 #include "confdefs.h"
8571 /* pthread test headers */
8572 #include <pthread.h>
8573 #ifndef NULL
8574 #define NULL (void*)0
8575 #endif
8576
8577 static void *task(p)
8578         void *p;
8579 {
8580         return (void *) (p == NULL);
8581 }
8582
8583
8584 int main(argc, argv)
8585         int argc;
8586         char **argv;
8587 {
8588
8589         /* pthread test function */
8590         pthread_t t;
8591         int status;
8592         int detach = 1;
8593
8594 #ifdef HAVE_PTHREADS_FINAL
8595         /* Final pthreads */
8596         pthread_attr_t attr;
8597
8598         status = pthread_attr_init(&attr);
8599         if( status ) return status;
8600
8601 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8602         if( !detach ) {
8603 #if defined( PTHREAD_CREATE_JOINABLE )
8604                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8605 #else
8606                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8607 #endif
8608
8609 #ifdef PTHREAD_CREATE_DETACHED
8610         } else {
8611                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8612 #endif
8613         }
8614         if( status ) return status;
8615 #endif
8616
8617         status = pthread_create( &t, &attr, task, NULL );
8618         if( status ) return status;
8619
8620 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8621         if( detach ) {
8622                 /* give thread a chance to complete */
8623                 /* it should remain joinable and hence detachable */
8624                 sleep( 1 );
8625
8626                 status = pthread_detach( t );
8627                 if( status ) return status;
8628         }
8629 #endif
8630
8631 #else
8632         /* Draft 4 pthreads */
8633         status = pthread_create( &t, pthread_attr_default, task, NULL );
8634         if( status ) return status;
8635
8636         if( detach ) {
8637                 /* give thread a chance to complete */
8638                 /* it should remain joinable and hence detachable */
8639                 sleep( 1 );
8640
8641                 status = pthread_detach( &t );
8642                 if( status ) return status;
8643         }
8644 #endif
8645
8646 #ifdef HAVE_LINUX_THREADS
8647         pthread_kill_other_threads_np();
8648 #endif
8649
8650         return 0;
8651
8652 }
8653
8654 EOF
8655 if { (eval echo configure:8656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8656 then
8657   ol_cv_pthread_pthreads=yes
8658 else
8659   echo "configure: failed program was:" >&5
8660   cat conftest.$ac_ext >&5
8661   rm -fr conftest*
8662   ol_cv_pthread_pthreads=no
8663 fi
8664 rm -fr conftest*
8665 fi
8666
8667
8668                 # restore the LIBS
8669                 LIBS="$ol_LIBS"
8670         
8671 fi
8672
8673 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8674
8675         if test $ol_cv_pthread_pthreads = yes ; then
8676                 ol_link_pthreads="-pthreads"
8677                 ol_link_threads=posix
8678         fi
8679 fi
8680
8681                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8682 if test "$ol_link_threads" = no ; then
8683         # try -mthreads
8684         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8685 echo "configure:8686: checking for pthread link with -mthreads" >&5
8686 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8687   echo $ac_n "(cached) $ac_c" 1>&6
8688 else
8689   
8690                 # save the flags
8691                 ol_LIBS="$LIBS"
8692                 LIBS="-mthreads $LIBS"
8693
8694                 if test "$cross_compiling" = yes; then
8695   cat > conftest.$ac_ext <<EOF
8696 #line 8697 "configure"
8697 #include "confdefs.h"
8698 /* pthread test headers */
8699 #include <pthread.h>
8700 #ifndef NULL
8701 #define NULL (void*)0
8702 #endif
8703
8704 static void *task(p)
8705         void *p;
8706 {
8707         return (void *) (p == NULL);
8708 }
8709
8710 int main() {
8711
8712         /* pthread test function */
8713         pthread_t t;
8714         int status;
8715         int detach = 1;
8716
8717 #ifdef HAVE_PTHREADS_FINAL
8718         /* Final pthreads */
8719         pthread_attr_t attr;
8720
8721         status = pthread_attr_init(&attr);
8722         if( status ) return status;
8723
8724 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8725         if( !detach ) {
8726 #if defined( PTHREAD_CREATE_JOINABLE )
8727                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8728 #else
8729                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8730 #endif
8731
8732 #ifdef PTHREAD_CREATE_DETACHED
8733         } else {
8734                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8735 #endif
8736         }
8737         if( status ) return status;
8738 #endif
8739
8740         status = pthread_create( &t, &attr, task, NULL );
8741         if( status ) return status;
8742
8743 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8744         if( detach ) {
8745                 /* give thread a chance to complete */
8746                 /* it should remain joinable and hence detachable */
8747                 sleep( 1 );
8748
8749                 status = pthread_detach( t );
8750                 if( status ) return status;
8751         }
8752 #endif
8753
8754 #else
8755         /* Draft 4 pthreads */
8756         status = pthread_create( &t, pthread_attr_default, task, NULL );
8757         if( status ) return status;
8758
8759         if( detach ) {
8760                 /* give thread a chance to complete */
8761                 /* it should remain joinable and hence detachable */
8762                 sleep( 1 );
8763
8764                 status = pthread_detach( &t );
8765                 if( status ) return status;
8766         }
8767 #endif
8768
8769 #ifdef HAVE_LINUX_THREADS
8770         pthread_kill_other_threads_np();
8771 #endif
8772
8773         return 0;
8774
8775 ; return 0; }
8776 EOF
8777 if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8778   rm -rf conftest*
8779   ol_cv_pthread_mthreads=yes
8780 else
8781   echo "configure: failed program was:" >&5
8782   cat conftest.$ac_ext >&5
8783   rm -rf conftest*
8784   ol_cv_pthread_mthreads=no
8785 fi
8786 rm -f conftest*
8787 else
8788   cat > conftest.$ac_ext <<EOF
8789 #line 8790 "configure"
8790 #include "confdefs.h"
8791 /* pthread test headers */
8792 #include <pthread.h>
8793 #ifndef NULL
8794 #define NULL (void*)0
8795 #endif
8796
8797 static void *task(p)
8798         void *p;
8799 {
8800         return (void *) (p == NULL);
8801 }
8802
8803
8804 int main(argc, argv)
8805         int argc;
8806         char **argv;
8807 {
8808
8809         /* pthread test function */
8810         pthread_t t;
8811         int status;
8812         int detach = 1;
8813
8814 #ifdef HAVE_PTHREADS_FINAL
8815         /* Final pthreads */
8816         pthread_attr_t attr;
8817
8818         status = pthread_attr_init(&attr);
8819         if( status ) return status;
8820
8821 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8822         if( !detach ) {
8823 #if defined( PTHREAD_CREATE_JOINABLE )
8824                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8825 #else
8826                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8827 #endif
8828
8829 #ifdef PTHREAD_CREATE_DETACHED
8830         } else {
8831                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8832 #endif
8833         }
8834         if( status ) return status;
8835 #endif
8836
8837         status = pthread_create( &t, &attr, task, NULL );
8838         if( status ) return status;
8839
8840 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8841         if( detach ) {
8842                 /* give thread a chance to complete */
8843                 /* it should remain joinable and hence detachable */
8844                 sleep( 1 );
8845
8846                 status = pthread_detach( t );
8847                 if( status ) return status;
8848         }
8849 #endif
8850
8851 #else
8852         /* Draft 4 pthreads */
8853         status = pthread_create( &t, pthread_attr_default, task, NULL );
8854         if( status ) return status;
8855
8856         if( detach ) {
8857                 /* give thread a chance to complete */
8858                 /* it should remain joinable and hence detachable */
8859                 sleep( 1 );
8860
8861                 status = pthread_detach( &t );
8862                 if( status ) return status;
8863         }
8864 #endif
8865
8866 #ifdef HAVE_LINUX_THREADS
8867         pthread_kill_other_threads_np();
8868 #endif
8869
8870         return 0;
8871
8872 }
8873
8874 EOF
8875 if { (eval echo configure:8876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8876 then
8877   ol_cv_pthread_mthreads=yes
8878 else
8879   echo "configure: failed program was:" >&5
8880   cat conftest.$ac_ext >&5
8881   rm -fr conftest*
8882   ol_cv_pthread_mthreads=no
8883 fi
8884 rm -fr conftest*
8885 fi
8886
8887
8888                 # restore the LIBS
8889                 LIBS="$ol_LIBS"
8890         
8891 fi
8892
8893 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8894
8895         if test $ol_cv_pthread_mthreads = yes ; then
8896                 ol_link_pthreads="-mthreads"
8897                 ol_link_threads=posix
8898         fi
8899 fi
8900
8901                 # Pthread try link: -thread (ol_cv_pthread_thread)
8902 if test "$ol_link_threads" = no ; then
8903         # try -thread
8904         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8905 echo "configure:8906: checking for pthread link with -thread" >&5
8906 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8907   echo $ac_n "(cached) $ac_c" 1>&6
8908 else
8909   
8910                 # save the flags
8911                 ol_LIBS="$LIBS"
8912                 LIBS="-thread $LIBS"
8913
8914                 if test "$cross_compiling" = yes; then
8915   cat > conftest.$ac_ext <<EOF
8916 #line 8917 "configure"
8917 #include "confdefs.h"
8918 /* pthread test headers */
8919 #include <pthread.h>
8920 #ifndef NULL
8921 #define NULL (void*)0
8922 #endif
8923
8924 static void *task(p)
8925         void *p;
8926 {
8927         return (void *) (p == NULL);
8928 }
8929
8930 int main() {
8931
8932         /* pthread test function */
8933         pthread_t t;
8934         int status;
8935         int detach = 1;
8936
8937 #ifdef HAVE_PTHREADS_FINAL
8938         /* Final pthreads */
8939         pthread_attr_t attr;
8940
8941         status = pthread_attr_init(&attr);
8942         if( status ) return status;
8943
8944 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8945         if( !detach ) {
8946 #if defined( PTHREAD_CREATE_JOINABLE )
8947                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8948 #else
8949                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8950 #endif
8951
8952 #ifdef PTHREAD_CREATE_DETACHED
8953         } else {
8954                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8955 #endif
8956         }
8957         if( status ) return status;
8958 #endif
8959
8960         status = pthread_create( &t, &attr, task, NULL );
8961         if( status ) return status;
8962
8963 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8964         if( detach ) {
8965                 /* give thread a chance to complete */
8966                 /* it should remain joinable and hence detachable */
8967                 sleep( 1 );
8968
8969                 status = pthread_detach( t );
8970                 if( status ) return status;
8971         }
8972 #endif
8973
8974 #else
8975         /* Draft 4 pthreads */
8976         status = pthread_create( &t, pthread_attr_default, task, NULL );
8977         if( status ) return status;
8978
8979         if( detach ) {
8980                 /* give thread a chance to complete */
8981                 /* it should remain joinable and hence detachable */
8982                 sleep( 1 );
8983
8984                 status = pthread_detach( &t );
8985                 if( status ) return status;
8986         }
8987 #endif
8988
8989 #ifdef HAVE_LINUX_THREADS
8990         pthread_kill_other_threads_np();
8991 #endif
8992
8993         return 0;
8994
8995 ; return 0; }
8996 EOF
8997 if { (eval echo configure:8998: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8998   rm -rf conftest*
8999   ol_cv_pthread_thread=yes
9000 else
9001   echo "configure: failed program was:" >&5
9002   cat conftest.$ac_ext >&5
9003   rm -rf conftest*
9004   ol_cv_pthread_thread=no
9005 fi
9006 rm -f conftest*
9007 else
9008   cat > conftest.$ac_ext <<EOF
9009 #line 9010 "configure"
9010 #include "confdefs.h"
9011 /* pthread test headers */
9012 #include <pthread.h>
9013 #ifndef NULL
9014 #define NULL (void*)0
9015 #endif
9016
9017 static void *task(p)
9018         void *p;
9019 {
9020         return (void *) (p == NULL);
9021 }
9022
9023
9024 int main(argc, argv)
9025         int argc;
9026         char **argv;
9027 {
9028
9029         /* pthread test function */
9030         pthread_t t;
9031         int status;
9032         int detach = 1;
9033
9034 #ifdef HAVE_PTHREADS_FINAL
9035         /* Final pthreads */
9036         pthread_attr_t attr;
9037
9038         status = pthread_attr_init(&attr);
9039         if( status ) return status;
9040
9041 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9042         if( !detach ) {
9043 #if defined( PTHREAD_CREATE_JOINABLE )
9044                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9045 #else
9046                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9047 #endif
9048
9049 #ifdef PTHREAD_CREATE_DETACHED
9050         } else {
9051                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9052 #endif
9053         }
9054         if( status ) return status;
9055 #endif
9056
9057         status = pthread_create( &t, &attr, task, NULL );
9058         if( status ) return status;
9059
9060 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9061         if( detach ) {
9062                 /* give thread a chance to complete */
9063                 /* it should remain joinable and hence detachable */
9064                 sleep( 1 );
9065
9066                 status = pthread_detach( t );
9067                 if( status ) return status;
9068         }
9069 #endif
9070
9071 #else
9072         /* Draft 4 pthreads */
9073         status = pthread_create( &t, pthread_attr_default, task, NULL );
9074         if( status ) return status;
9075
9076         if( detach ) {
9077                 /* give thread a chance to complete */
9078                 /* it should remain joinable and hence detachable */
9079                 sleep( 1 );
9080
9081                 status = pthread_detach( &t );
9082                 if( status ) return status;
9083         }
9084 #endif
9085
9086 #ifdef HAVE_LINUX_THREADS
9087         pthread_kill_other_threads_np();
9088 #endif
9089
9090         return 0;
9091
9092 }
9093
9094 EOF
9095 if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9096 then
9097   ol_cv_pthread_thread=yes
9098 else
9099   echo "configure: failed program was:" >&5
9100   cat conftest.$ac_ext >&5
9101   rm -fr conftest*
9102   ol_cv_pthread_thread=no
9103 fi
9104 rm -fr conftest*
9105 fi
9106
9107
9108                 # restore the LIBS
9109                 LIBS="$ol_LIBS"
9110         
9111 fi
9112
9113 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9114
9115         if test $ol_cv_pthread_thread = yes ; then
9116                 ol_link_pthreads="-thread"
9117                 ol_link_threads=posix
9118         fi
9119 fi
9120
9121
9122                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9123 if test "$ol_link_threads" = no ; then
9124         # try -lpthread -lmach -lexc -lc_r
9125         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9126 echo "configure:9127: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9127 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9128   echo $ac_n "(cached) $ac_c" 1>&6
9129 else
9130   
9131                 # save the flags
9132                 ol_LIBS="$LIBS"
9133                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9134
9135                 if test "$cross_compiling" = yes; then
9136   cat > conftest.$ac_ext <<EOF
9137 #line 9138 "configure"
9138 #include "confdefs.h"
9139 /* pthread test headers */
9140 #include <pthread.h>
9141 #ifndef NULL
9142 #define NULL (void*)0
9143 #endif
9144
9145 static void *task(p)
9146         void *p;
9147 {
9148         return (void *) (p == NULL);
9149 }
9150
9151 int main() {
9152
9153         /* pthread test function */
9154         pthread_t t;
9155         int status;
9156         int detach = 1;
9157
9158 #ifdef HAVE_PTHREADS_FINAL
9159         /* Final pthreads */
9160         pthread_attr_t attr;
9161
9162         status = pthread_attr_init(&attr);
9163         if( status ) return status;
9164
9165 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9166         if( !detach ) {
9167 #if defined( PTHREAD_CREATE_JOINABLE )
9168                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9169 #else
9170                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9171 #endif
9172
9173 #ifdef PTHREAD_CREATE_DETACHED
9174         } else {
9175                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9176 #endif
9177         }
9178         if( status ) return status;
9179 #endif
9180
9181         status = pthread_create( &t, &attr, task, NULL );
9182         if( status ) return status;
9183
9184 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9185         if( detach ) {
9186                 /* give thread a chance to complete */
9187                 /* it should remain joinable and hence detachable */
9188                 sleep( 1 );
9189
9190                 status = pthread_detach( t );
9191                 if( status ) return status;
9192         }
9193 #endif
9194
9195 #else
9196         /* Draft 4 pthreads */
9197         status = pthread_create( &t, pthread_attr_default, task, NULL );
9198         if( status ) return status;
9199
9200         if( detach ) {
9201                 /* give thread a chance to complete */
9202                 /* it should remain joinable and hence detachable */
9203                 sleep( 1 );
9204
9205                 status = pthread_detach( &t );
9206                 if( status ) return status;
9207         }
9208 #endif
9209
9210 #ifdef HAVE_LINUX_THREADS
9211         pthread_kill_other_threads_np();
9212 #endif
9213
9214         return 0;
9215
9216 ; return 0; }
9217 EOF
9218 if { (eval echo configure:9219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9219   rm -rf conftest*
9220   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9221 else
9222   echo "configure: failed program was:" >&5
9223   cat conftest.$ac_ext >&5
9224   rm -rf conftest*
9225   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9226 fi
9227 rm -f conftest*
9228 else
9229   cat > conftest.$ac_ext <<EOF
9230 #line 9231 "configure"
9231 #include "confdefs.h"
9232 /* pthread test headers */
9233 #include <pthread.h>
9234 #ifndef NULL
9235 #define NULL (void*)0
9236 #endif
9237
9238 static void *task(p)
9239         void *p;
9240 {
9241         return (void *) (p == NULL);
9242 }
9243
9244
9245 int main(argc, argv)
9246         int argc;
9247         char **argv;
9248 {
9249
9250         /* pthread test function */
9251         pthread_t t;
9252         int status;
9253         int detach = 1;
9254
9255 #ifdef HAVE_PTHREADS_FINAL
9256         /* Final pthreads */
9257         pthread_attr_t attr;
9258
9259         status = pthread_attr_init(&attr);
9260         if( status ) return status;
9261
9262 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9263         if( !detach ) {
9264 #if defined( PTHREAD_CREATE_JOINABLE )
9265                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9266 #else
9267                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9268 #endif
9269
9270 #ifdef PTHREAD_CREATE_DETACHED
9271         } else {
9272                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9273 #endif
9274         }
9275         if( status ) return status;
9276 #endif
9277
9278         status = pthread_create( &t, &attr, task, NULL );
9279         if( status ) return status;
9280
9281 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9282         if( detach ) {
9283                 /* give thread a chance to complete */
9284                 /* it should remain joinable and hence detachable */
9285                 sleep( 1 );
9286
9287                 status = pthread_detach( t );
9288                 if( status ) return status;
9289         }
9290 #endif
9291
9292 #else
9293         /* Draft 4 pthreads */
9294         status = pthread_create( &t, pthread_attr_default, task, NULL );
9295         if( status ) return status;
9296
9297         if( detach ) {
9298                 /* give thread a chance to complete */
9299                 /* it should remain joinable and hence detachable */
9300                 sleep( 1 );
9301
9302                 status = pthread_detach( &t );
9303                 if( status ) return status;
9304         }
9305 #endif
9306
9307 #ifdef HAVE_LINUX_THREADS
9308         pthread_kill_other_threads_np();
9309 #endif
9310
9311         return 0;
9312
9313 }
9314
9315 EOF
9316 if { (eval echo configure:9317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9317 then
9318   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9319 else
9320   echo "configure: failed program was:" >&5
9321   cat conftest.$ac_ext >&5
9322   rm -fr conftest*
9323   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9324 fi
9325 rm -fr conftest*
9326 fi
9327
9328
9329                 # restore the LIBS
9330                 LIBS="$ol_LIBS"
9331         
9332 fi
9333
9334 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9335
9336         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9337                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9338                 ol_link_threads=posix
9339         fi
9340 fi
9341
9342                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9343 if test "$ol_link_threads" = no ; then
9344         # try -lpthread -lmach -lexc
9345         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9346 echo "configure:9347: checking for pthread link with -lpthread -lmach -lexc" >&5
9347 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9348   echo $ac_n "(cached) $ac_c" 1>&6
9349 else
9350   
9351                 # save the flags
9352                 ol_LIBS="$LIBS"
9353                 LIBS="-lpthread -lmach -lexc $LIBS"
9354
9355                 if test "$cross_compiling" = yes; then
9356   cat > conftest.$ac_ext <<EOF
9357 #line 9358 "configure"
9358 #include "confdefs.h"
9359 /* pthread test headers */
9360 #include <pthread.h>
9361 #ifndef NULL
9362 #define NULL (void*)0
9363 #endif
9364
9365 static void *task(p)
9366         void *p;
9367 {
9368         return (void *) (p == NULL);
9369 }
9370
9371 int main() {
9372
9373         /* pthread test function */
9374         pthread_t t;
9375         int status;
9376         int detach = 1;
9377
9378 #ifdef HAVE_PTHREADS_FINAL
9379         /* Final pthreads */
9380         pthread_attr_t attr;
9381
9382         status = pthread_attr_init(&attr);
9383         if( status ) return status;
9384
9385 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9386         if( !detach ) {
9387 #if defined( PTHREAD_CREATE_JOINABLE )
9388                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9389 #else
9390                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9391 #endif
9392
9393 #ifdef PTHREAD_CREATE_DETACHED
9394         } else {
9395                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9396 #endif
9397         }
9398         if( status ) return status;
9399 #endif
9400
9401         status = pthread_create( &t, &attr, task, NULL );
9402         if( status ) return status;
9403
9404 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9405         if( detach ) {
9406                 /* give thread a chance to complete */
9407                 /* it should remain joinable and hence detachable */
9408                 sleep( 1 );
9409
9410                 status = pthread_detach( t );
9411                 if( status ) return status;
9412         }
9413 #endif
9414
9415 #else
9416         /* Draft 4 pthreads */
9417         status = pthread_create( &t, pthread_attr_default, task, NULL );
9418         if( status ) return status;
9419
9420         if( detach ) {
9421                 /* give thread a chance to complete */
9422                 /* it should remain joinable and hence detachable */
9423                 sleep( 1 );
9424
9425                 status = pthread_detach( &t );
9426                 if( status ) return status;
9427         }
9428 #endif
9429
9430 #ifdef HAVE_LINUX_THREADS
9431         pthread_kill_other_threads_np();
9432 #endif
9433
9434         return 0;
9435
9436 ; return 0; }
9437 EOF
9438 if { (eval echo configure:9439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9439   rm -rf conftest*
9440   ol_cv_pthread_lpthread_lmach_lexc=yes
9441 else
9442   echo "configure: failed program was:" >&5
9443   cat conftest.$ac_ext >&5
9444   rm -rf conftest*
9445   ol_cv_pthread_lpthread_lmach_lexc=no
9446 fi
9447 rm -f conftest*
9448 else
9449   cat > conftest.$ac_ext <<EOF
9450 #line 9451 "configure"
9451 #include "confdefs.h"
9452 /* pthread test headers */
9453 #include <pthread.h>
9454 #ifndef NULL
9455 #define NULL (void*)0
9456 #endif
9457
9458 static void *task(p)
9459         void *p;
9460 {
9461         return (void *) (p == NULL);
9462 }
9463
9464
9465 int main(argc, argv)
9466         int argc;
9467         char **argv;
9468 {
9469
9470         /* pthread test function */
9471         pthread_t t;
9472         int status;
9473         int detach = 1;
9474
9475 #ifdef HAVE_PTHREADS_FINAL
9476         /* Final pthreads */
9477         pthread_attr_t attr;
9478
9479         status = pthread_attr_init(&attr);
9480         if( status ) return status;
9481
9482 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9483         if( !detach ) {
9484 #if defined( PTHREAD_CREATE_JOINABLE )
9485                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9486 #else
9487                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9488 #endif
9489
9490 #ifdef PTHREAD_CREATE_DETACHED
9491         } else {
9492                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9493 #endif
9494         }
9495         if( status ) return status;
9496 #endif
9497
9498         status = pthread_create( &t, &attr, task, NULL );
9499         if( status ) return status;
9500
9501 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9502         if( detach ) {
9503                 /* give thread a chance to complete */
9504                 /* it should remain joinable and hence detachable */
9505                 sleep( 1 );
9506
9507                 status = pthread_detach( t );
9508                 if( status ) return status;
9509         }
9510 #endif
9511
9512 #else
9513         /* Draft 4 pthreads */
9514         status = pthread_create( &t, pthread_attr_default, task, NULL );
9515         if( status ) return status;
9516
9517         if( detach ) {
9518                 /* give thread a chance to complete */
9519                 /* it should remain joinable and hence detachable */
9520                 sleep( 1 );
9521
9522                 status = pthread_detach( &t );
9523                 if( status ) return status;
9524         }
9525 #endif
9526
9527 #ifdef HAVE_LINUX_THREADS
9528         pthread_kill_other_threads_np();
9529 #endif
9530
9531         return 0;
9532
9533 }
9534
9535 EOF
9536 if { (eval echo configure:9537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9537 then
9538   ol_cv_pthread_lpthread_lmach_lexc=yes
9539 else
9540   echo "configure: failed program was:" >&5
9541   cat conftest.$ac_ext >&5
9542   rm -fr conftest*
9543   ol_cv_pthread_lpthread_lmach_lexc=no
9544 fi
9545 rm -fr conftest*
9546 fi
9547
9548
9549                 # restore the LIBS
9550                 LIBS="$ol_LIBS"
9551         
9552 fi
9553
9554 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9555
9556         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9557                 ol_link_pthreads="-lpthread -lmach -lexc"
9558                 ol_link_threads=posix
9559         fi
9560 fi
9561
9562
9563                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9564 if test "$ol_link_threads" = no ; then
9565         # try -lpthread -Wl,-woff,85
9566         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9567 echo "configure:9568: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9568 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9569   echo $ac_n "(cached) $ac_c" 1>&6
9570 else
9571   
9572                 # save the flags
9573                 ol_LIBS="$LIBS"
9574                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9575
9576                 if test "$cross_compiling" = yes; then
9577   cat > conftest.$ac_ext <<EOF
9578 #line 9579 "configure"
9579 #include "confdefs.h"
9580 /* pthread test headers */
9581 #include <pthread.h>
9582 #ifndef NULL
9583 #define NULL (void*)0
9584 #endif
9585
9586 static void *task(p)
9587         void *p;
9588 {
9589         return (void *) (p == NULL);
9590 }
9591
9592 int main() {
9593
9594         /* pthread test function */
9595         pthread_t t;
9596         int status;
9597         int detach = 1;
9598
9599 #ifdef HAVE_PTHREADS_FINAL
9600         /* Final pthreads */
9601         pthread_attr_t attr;
9602
9603         status = pthread_attr_init(&attr);
9604         if( status ) return status;
9605
9606 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9607         if( !detach ) {
9608 #if defined( PTHREAD_CREATE_JOINABLE )
9609                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9610 #else
9611                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9612 #endif
9613
9614 #ifdef PTHREAD_CREATE_DETACHED
9615         } else {
9616                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9617 #endif
9618         }
9619         if( status ) return status;
9620 #endif
9621
9622         status = pthread_create( &t, &attr, task, NULL );
9623         if( status ) return status;
9624
9625 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9626         if( detach ) {
9627                 /* give thread a chance to complete */
9628                 /* it should remain joinable and hence detachable */
9629                 sleep( 1 );
9630
9631                 status = pthread_detach( t );
9632                 if( status ) return status;
9633         }
9634 #endif
9635
9636 #else
9637         /* Draft 4 pthreads */
9638         status = pthread_create( &t, pthread_attr_default, task, NULL );
9639         if( status ) return status;
9640
9641         if( detach ) {
9642                 /* give thread a chance to complete */
9643                 /* it should remain joinable and hence detachable */
9644                 sleep( 1 );
9645
9646                 status = pthread_detach( &t );
9647                 if( status ) return status;
9648         }
9649 #endif
9650
9651 #ifdef HAVE_LINUX_THREADS
9652         pthread_kill_other_threads_np();
9653 #endif
9654
9655         return 0;
9656
9657 ; return 0; }
9658 EOF
9659 if { (eval echo configure:9660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9660   rm -rf conftest*
9661   ol_cv_pthread_lib_lpthread_woff=yes
9662 else
9663   echo "configure: failed program was:" >&5
9664   cat conftest.$ac_ext >&5
9665   rm -rf conftest*
9666   ol_cv_pthread_lib_lpthread_woff=no
9667 fi
9668 rm -f conftest*
9669 else
9670   cat > conftest.$ac_ext <<EOF
9671 #line 9672 "configure"
9672 #include "confdefs.h"
9673 /* pthread test headers */
9674 #include <pthread.h>
9675 #ifndef NULL
9676 #define NULL (void*)0
9677 #endif
9678
9679 static void *task(p)
9680         void *p;
9681 {
9682         return (void *) (p == NULL);
9683 }
9684
9685
9686 int main(argc, argv)
9687         int argc;
9688         char **argv;
9689 {
9690
9691         /* pthread test function */
9692         pthread_t t;
9693         int status;
9694         int detach = 1;
9695
9696 #ifdef HAVE_PTHREADS_FINAL
9697         /* Final pthreads */
9698         pthread_attr_t attr;
9699
9700         status = pthread_attr_init(&attr);
9701         if( status ) return status;
9702
9703 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9704         if( !detach ) {
9705 #if defined( PTHREAD_CREATE_JOINABLE )
9706                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9707 #else
9708                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9709 #endif
9710
9711 #ifdef PTHREAD_CREATE_DETACHED
9712         } else {
9713                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9714 #endif
9715         }
9716         if( status ) return status;
9717 #endif
9718
9719         status = pthread_create( &t, &attr, task, NULL );
9720         if( status ) return status;
9721
9722 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9723         if( detach ) {
9724                 /* give thread a chance to complete */
9725                 /* it should remain joinable and hence detachable */
9726                 sleep( 1 );
9727
9728                 status = pthread_detach( t );
9729                 if( status ) return status;
9730         }
9731 #endif
9732
9733 #else
9734         /* Draft 4 pthreads */
9735         status = pthread_create( &t, pthread_attr_default, task, NULL );
9736         if( status ) return status;
9737
9738         if( detach ) {
9739                 /* give thread a chance to complete */
9740                 /* it should remain joinable and hence detachable */
9741                 sleep( 1 );
9742
9743                 status = pthread_detach( &t );
9744                 if( status ) return status;
9745         }
9746 #endif
9747
9748 #ifdef HAVE_LINUX_THREADS
9749         pthread_kill_other_threads_np();
9750 #endif
9751
9752         return 0;
9753
9754 }
9755
9756 EOF
9757 if { (eval echo configure:9758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9758 then
9759   ol_cv_pthread_lib_lpthread_woff=yes
9760 else
9761   echo "configure: failed program was:" >&5
9762   cat conftest.$ac_ext >&5
9763   rm -fr conftest*
9764   ol_cv_pthread_lib_lpthread_woff=no
9765 fi
9766 rm -fr conftest*
9767 fi
9768
9769
9770                 # restore the LIBS
9771                 LIBS="$ol_LIBS"
9772         
9773 fi
9774
9775 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9776
9777         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9778                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9779                 ol_link_threads=posix
9780         fi
9781 fi
9782
9783
9784                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9785 if test "$ol_link_threads" = no ; then
9786         # try -lpthread
9787         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9788 echo "configure:9789: checking for pthread link with -lpthread" >&5
9789 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9790   echo $ac_n "(cached) $ac_c" 1>&6
9791 else
9792   
9793                 # save the flags
9794                 ol_LIBS="$LIBS"
9795                 LIBS="-lpthread $LIBS"
9796
9797                 if test "$cross_compiling" = yes; then
9798   cat > conftest.$ac_ext <<EOF
9799 #line 9800 "configure"
9800 #include "confdefs.h"
9801 /* pthread test headers */
9802 #include <pthread.h>
9803 #ifndef NULL
9804 #define NULL (void*)0
9805 #endif
9806
9807 static void *task(p)
9808         void *p;
9809 {
9810         return (void *) (p == NULL);
9811 }
9812
9813 int main() {
9814
9815         /* pthread test function */
9816         pthread_t t;
9817         int status;
9818         int detach = 1;
9819
9820 #ifdef HAVE_PTHREADS_FINAL
9821         /* Final pthreads */
9822         pthread_attr_t attr;
9823
9824         status = pthread_attr_init(&attr);
9825         if( status ) return status;
9826
9827 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9828         if( !detach ) {
9829 #if defined( PTHREAD_CREATE_JOINABLE )
9830                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9831 #else
9832                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9833 #endif
9834
9835 #ifdef PTHREAD_CREATE_DETACHED
9836         } else {
9837                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9838 #endif
9839         }
9840         if( status ) return status;
9841 #endif
9842
9843         status = pthread_create( &t, &attr, task, NULL );
9844         if( status ) return status;
9845
9846 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9847         if( detach ) {
9848                 /* give thread a chance to complete */
9849                 /* it should remain joinable and hence detachable */
9850                 sleep( 1 );
9851
9852                 status = pthread_detach( t );
9853                 if( status ) return status;
9854         }
9855 #endif
9856
9857 #else
9858         /* Draft 4 pthreads */
9859         status = pthread_create( &t, pthread_attr_default, task, NULL );
9860         if( status ) return status;
9861
9862         if( detach ) {
9863                 /* give thread a chance to complete */
9864                 /* it should remain joinable and hence detachable */
9865                 sleep( 1 );
9866
9867                 status = pthread_detach( &t );
9868                 if( status ) return status;
9869         }
9870 #endif
9871
9872 #ifdef HAVE_LINUX_THREADS
9873         pthread_kill_other_threads_np();
9874 #endif
9875
9876         return 0;
9877
9878 ; return 0; }
9879 EOF
9880 if { (eval echo configure:9881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9881   rm -rf conftest*
9882   ol_cv_pthread_lpthread=yes
9883 else
9884   echo "configure: failed program was:" >&5
9885   cat conftest.$ac_ext >&5
9886   rm -rf conftest*
9887   ol_cv_pthread_lpthread=no
9888 fi
9889 rm -f conftest*
9890 else
9891   cat > conftest.$ac_ext <<EOF
9892 #line 9893 "configure"
9893 #include "confdefs.h"
9894 /* pthread test headers */
9895 #include <pthread.h>
9896 #ifndef NULL
9897 #define NULL (void*)0
9898 #endif
9899
9900 static void *task(p)
9901         void *p;
9902 {
9903         return (void *) (p == NULL);
9904 }
9905
9906
9907 int main(argc, argv)
9908         int argc;
9909         char **argv;
9910 {
9911
9912         /* pthread test function */
9913         pthread_t t;
9914         int status;
9915         int detach = 1;
9916
9917 #ifdef HAVE_PTHREADS_FINAL
9918         /* Final pthreads */
9919         pthread_attr_t attr;
9920
9921         status = pthread_attr_init(&attr);
9922         if( status ) return status;
9923
9924 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9925         if( !detach ) {
9926 #if defined( PTHREAD_CREATE_JOINABLE )
9927                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9928 #else
9929                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9930 #endif
9931
9932 #ifdef PTHREAD_CREATE_DETACHED
9933         } else {
9934                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9935 #endif
9936         }
9937         if( status ) return status;
9938 #endif
9939
9940         status = pthread_create( &t, &attr, task, NULL );
9941         if( status ) return status;
9942
9943 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9944         if( detach ) {
9945                 /* give thread a chance to complete */
9946                 /* it should remain joinable and hence detachable */
9947                 sleep( 1 );
9948
9949                 status = pthread_detach( t );
9950                 if( status ) return status;
9951         }
9952 #endif
9953
9954 #else
9955         /* Draft 4 pthreads */
9956         status = pthread_create( &t, pthread_attr_default, task, NULL );
9957         if( status ) return status;
9958
9959         if( detach ) {
9960                 /* give thread a chance to complete */
9961                 /* it should remain joinable and hence detachable */
9962                 sleep( 1 );
9963
9964                 status = pthread_detach( &t );
9965                 if( status ) return status;
9966         }
9967 #endif
9968
9969 #ifdef HAVE_LINUX_THREADS
9970         pthread_kill_other_threads_np();
9971 #endif
9972
9973         return 0;
9974
9975 }
9976
9977 EOF
9978 if { (eval echo configure:9979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9979 then
9980   ol_cv_pthread_lpthread=yes
9981 else
9982   echo "configure: failed program was:" >&5
9983   cat conftest.$ac_ext >&5
9984   rm -fr conftest*
9985   ol_cv_pthread_lpthread=no
9986 fi
9987 rm -fr conftest*
9988 fi
9989
9990
9991                 # restore the LIBS
9992                 LIBS="$ol_LIBS"
9993         
9994 fi
9995
9996 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9997
9998         if test $ol_cv_pthread_lpthread = yes ; then
9999                 ol_link_pthreads="-lpthread"
10000                 ol_link_threads=posix
10001         fi
10002 fi
10003
10004                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
10005 if test "$ol_link_threads" = no ; then
10006         # try -lc_r
10007         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
10008 echo "configure:10009: checking for pthread link with -lc_r" >&5
10009 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
10010   echo $ac_n "(cached) $ac_c" 1>&6
10011 else
10012   
10013                 # save the flags
10014                 ol_LIBS="$LIBS"
10015                 LIBS="-lc_r $LIBS"
10016
10017                 if test "$cross_compiling" = yes; then
10018   cat > conftest.$ac_ext <<EOF
10019 #line 10020 "configure"
10020 #include "confdefs.h"
10021 /* pthread test headers */
10022 #include <pthread.h>
10023 #ifndef NULL
10024 #define NULL (void*)0
10025 #endif
10026
10027 static void *task(p)
10028         void *p;
10029 {
10030         return (void *) (p == NULL);
10031 }
10032
10033 int main() {
10034
10035         /* pthread test function */
10036         pthread_t t;
10037         int status;
10038         int detach = 1;
10039
10040 #ifdef HAVE_PTHREADS_FINAL
10041         /* Final pthreads */
10042         pthread_attr_t attr;
10043
10044         status = pthread_attr_init(&attr);
10045         if( status ) return status;
10046
10047 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10048         if( !detach ) {
10049 #if defined( PTHREAD_CREATE_JOINABLE )
10050                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10051 #else
10052                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10053 #endif
10054
10055 #ifdef PTHREAD_CREATE_DETACHED
10056         } else {
10057                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10058 #endif
10059         }
10060         if( status ) return status;
10061 #endif
10062
10063         status = pthread_create( &t, &attr, task, NULL );
10064         if( status ) return status;
10065
10066 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10067         if( detach ) {
10068                 /* give thread a chance to complete */
10069                 /* it should remain joinable and hence detachable */
10070                 sleep( 1 );
10071
10072                 status = pthread_detach( t );
10073                 if( status ) return status;
10074         }
10075 #endif
10076
10077 #else
10078         /* Draft 4 pthreads */
10079         status = pthread_create( &t, pthread_attr_default, task, NULL );
10080         if( status ) return status;
10081
10082         if( detach ) {
10083                 /* give thread a chance to complete */
10084                 /* it should remain joinable and hence detachable */
10085                 sleep( 1 );
10086
10087                 status = pthread_detach( &t );
10088                 if( status ) return status;
10089         }
10090 #endif
10091
10092 #ifdef HAVE_LINUX_THREADS
10093         pthread_kill_other_threads_np();
10094 #endif
10095
10096         return 0;
10097
10098 ; return 0; }
10099 EOF
10100 if { (eval echo configure:10101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10101   rm -rf conftest*
10102   ol_cv_pthread_lc_r=yes
10103 else
10104   echo "configure: failed program was:" >&5
10105   cat conftest.$ac_ext >&5
10106   rm -rf conftest*
10107   ol_cv_pthread_lc_r=no
10108 fi
10109 rm -f conftest*
10110 else
10111   cat > conftest.$ac_ext <<EOF
10112 #line 10113 "configure"
10113 #include "confdefs.h"
10114 /* pthread test headers */
10115 #include <pthread.h>
10116 #ifndef NULL
10117 #define NULL (void*)0
10118 #endif
10119
10120 static void *task(p)
10121         void *p;
10122 {
10123         return (void *) (p == NULL);
10124 }
10125
10126
10127 int main(argc, argv)
10128         int argc;
10129         char **argv;
10130 {
10131
10132         /* pthread test function */
10133         pthread_t t;
10134         int status;
10135         int detach = 1;
10136
10137 #ifdef HAVE_PTHREADS_FINAL
10138         /* Final pthreads */
10139         pthread_attr_t attr;
10140
10141         status = pthread_attr_init(&attr);
10142         if( status ) return status;
10143
10144 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10145         if( !detach ) {
10146 #if defined( PTHREAD_CREATE_JOINABLE )
10147                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10148 #else
10149                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10150 #endif
10151
10152 #ifdef PTHREAD_CREATE_DETACHED
10153         } else {
10154                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10155 #endif
10156         }
10157         if( status ) return status;
10158 #endif
10159
10160         status = pthread_create( &t, &attr, task, NULL );
10161         if( status ) return status;
10162
10163 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10164         if( detach ) {
10165                 /* give thread a chance to complete */
10166                 /* it should remain joinable and hence detachable */
10167                 sleep( 1 );
10168
10169                 status = pthread_detach( t );
10170                 if( status ) return status;
10171         }
10172 #endif
10173
10174 #else
10175         /* Draft 4 pthreads */
10176         status = pthread_create( &t, pthread_attr_default, task, NULL );
10177         if( status ) return status;
10178
10179         if( detach ) {
10180                 /* give thread a chance to complete */
10181                 /* it should remain joinable and hence detachable */
10182                 sleep( 1 );
10183
10184                 status = pthread_detach( &t );
10185                 if( status ) return status;
10186         }
10187 #endif
10188
10189 #ifdef HAVE_LINUX_THREADS
10190         pthread_kill_other_threads_np();
10191 #endif
10192
10193         return 0;
10194
10195 }
10196
10197 EOF
10198 if { (eval echo configure:10199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10199 then
10200   ol_cv_pthread_lc_r=yes
10201 else
10202   echo "configure: failed program was:" >&5
10203   cat conftest.$ac_ext >&5
10204   rm -fr conftest*
10205   ol_cv_pthread_lc_r=no
10206 fi
10207 rm -fr conftest*
10208 fi
10209
10210
10211                 # restore the LIBS
10212                 LIBS="$ol_LIBS"
10213         
10214 fi
10215
10216 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10217
10218         if test $ol_cv_pthread_lc_r = yes ; then
10219                 ol_link_pthreads="-lc_r"
10220                 ol_link_threads=posix
10221         fi
10222 fi
10223
10224
10225                 # Pthread try link: -threads (ol_cv_pthread_threads)
10226 if test "$ol_link_threads" = no ; then
10227         # try -threads
10228         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10229 echo "configure:10230: checking for pthread link with -threads" >&5
10230 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10231   echo $ac_n "(cached) $ac_c" 1>&6
10232 else
10233   
10234                 # save the flags
10235                 ol_LIBS="$LIBS"
10236                 LIBS="-threads $LIBS"
10237
10238                 if test "$cross_compiling" = yes; then
10239   cat > conftest.$ac_ext <<EOF
10240 #line 10241 "configure"
10241 #include "confdefs.h"
10242 /* pthread test headers */
10243 #include <pthread.h>
10244 #ifndef NULL
10245 #define NULL (void*)0
10246 #endif
10247
10248 static void *task(p)
10249         void *p;
10250 {
10251         return (void *) (p == NULL);
10252 }
10253
10254 int main() {
10255
10256         /* pthread test function */
10257         pthread_t t;
10258         int status;
10259         int detach = 1;
10260
10261 #ifdef HAVE_PTHREADS_FINAL
10262         /* Final pthreads */
10263         pthread_attr_t attr;
10264
10265         status = pthread_attr_init(&attr);
10266         if( status ) return status;
10267
10268 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10269         if( !detach ) {
10270 #if defined( PTHREAD_CREATE_JOINABLE )
10271                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10272 #else
10273                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10274 #endif
10275
10276 #ifdef PTHREAD_CREATE_DETACHED
10277         } else {
10278                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10279 #endif
10280         }
10281         if( status ) return status;
10282 #endif
10283
10284         status = pthread_create( &t, &attr, task, NULL );
10285         if( status ) return status;
10286
10287 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10288         if( detach ) {
10289                 /* give thread a chance to complete */
10290                 /* it should remain joinable and hence detachable */
10291                 sleep( 1 );
10292
10293                 status = pthread_detach( t );
10294                 if( status ) return status;
10295         }
10296 #endif
10297
10298 #else
10299         /* Draft 4 pthreads */
10300         status = pthread_create( &t, pthread_attr_default, task, NULL );
10301         if( status ) return status;
10302
10303         if( detach ) {
10304                 /* give thread a chance to complete */
10305                 /* it should remain joinable and hence detachable */
10306                 sleep( 1 );
10307
10308                 status = pthread_detach( &t );
10309                 if( status ) return status;
10310         }
10311 #endif
10312
10313 #ifdef HAVE_LINUX_THREADS
10314         pthread_kill_other_threads_np();
10315 #endif
10316
10317         return 0;
10318
10319 ; return 0; }
10320 EOF
10321 if { (eval echo configure:10322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10322   rm -rf conftest*
10323   ol_cv_pthread_threads=yes
10324 else
10325   echo "configure: failed program was:" >&5
10326   cat conftest.$ac_ext >&5
10327   rm -rf conftest*
10328   ol_cv_pthread_threads=no
10329 fi
10330 rm -f conftest*
10331 else
10332   cat > conftest.$ac_ext <<EOF
10333 #line 10334 "configure"
10334 #include "confdefs.h"
10335 /* pthread test headers */
10336 #include <pthread.h>
10337 #ifndef NULL
10338 #define NULL (void*)0
10339 #endif
10340
10341 static void *task(p)
10342         void *p;
10343 {
10344         return (void *) (p == NULL);
10345 }
10346
10347
10348 int main(argc, argv)
10349         int argc;
10350         char **argv;
10351 {
10352
10353         /* pthread test function */
10354         pthread_t t;
10355         int status;
10356         int detach = 1;
10357
10358 #ifdef HAVE_PTHREADS_FINAL
10359         /* Final pthreads */
10360         pthread_attr_t attr;
10361
10362         status = pthread_attr_init(&attr);
10363         if( status ) return status;
10364
10365 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10366         if( !detach ) {
10367 #if defined( PTHREAD_CREATE_JOINABLE )
10368                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10369 #else
10370                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10371 #endif
10372
10373 #ifdef PTHREAD_CREATE_DETACHED
10374         } else {
10375                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10376 #endif
10377         }
10378         if( status ) return status;
10379 #endif
10380
10381         status = pthread_create( &t, &attr, task, NULL );
10382         if( status ) return status;
10383
10384 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10385         if( detach ) {
10386                 /* give thread a chance to complete */
10387                 /* it should remain joinable and hence detachable */
10388                 sleep( 1 );
10389
10390                 status = pthread_detach( t );
10391                 if( status ) return status;
10392         }
10393 #endif
10394
10395 #else
10396         /* Draft 4 pthreads */
10397         status = pthread_create( &t, pthread_attr_default, task, NULL );
10398         if( status ) return status;
10399
10400         if( detach ) {
10401                 /* give thread a chance to complete */
10402                 /* it should remain joinable and hence detachable */
10403                 sleep( 1 );
10404
10405                 status = pthread_detach( &t );
10406                 if( status ) return status;
10407         }
10408 #endif
10409
10410 #ifdef HAVE_LINUX_THREADS
10411         pthread_kill_other_threads_np();
10412 #endif
10413
10414         return 0;
10415
10416 }
10417
10418 EOF
10419 if { (eval echo configure:10420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10420 then
10421   ol_cv_pthread_threads=yes
10422 else
10423   echo "configure: failed program was:" >&5
10424   cat conftest.$ac_ext >&5
10425   rm -fr conftest*
10426   ol_cv_pthread_threads=no
10427 fi
10428 rm -fr conftest*
10429 fi
10430
10431
10432                 # restore the LIBS
10433                 LIBS="$ol_LIBS"
10434         
10435 fi
10436
10437 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10438
10439         if test $ol_cv_pthread_threads = yes ; then
10440                 ol_link_pthreads="-threads"
10441                 ol_link_threads=posix
10442         fi
10443 fi
10444
10445
10446                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10447 if test "$ol_link_threads" = no ; then
10448         # try -lpthreads -lmach -lexc -lc_r
10449         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10450 echo "configure:10451: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10451 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10452   echo $ac_n "(cached) $ac_c" 1>&6
10453 else
10454   
10455                 # save the flags
10456                 ol_LIBS="$LIBS"
10457                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10458
10459                 if test "$cross_compiling" = yes; then
10460   cat > conftest.$ac_ext <<EOF
10461 #line 10462 "configure"
10462 #include "confdefs.h"
10463 /* pthread test headers */
10464 #include <pthread.h>
10465 #ifndef NULL
10466 #define NULL (void*)0
10467 #endif
10468
10469 static void *task(p)
10470         void *p;
10471 {
10472         return (void *) (p == NULL);
10473 }
10474
10475 int main() {
10476
10477         /* pthread test function */
10478         pthread_t t;
10479         int status;
10480         int detach = 1;
10481
10482 #ifdef HAVE_PTHREADS_FINAL
10483         /* Final pthreads */
10484         pthread_attr_t attr;
10485
10486         status = pthread_attr_init(&attr);
10487         if( status ) return status;
10488
10489 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10490         if( !detach ) {
10491 #if defined( PTHREAD_CREATE_JOINABLE )
10492                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10493 #else
10494                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10495 #endif
10496
10497 #ifdef PTHREAD_CREATE_DETACHED
10498         } else {
10499                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10500 #endif
10501         }
10502         if( status ) return status;
10503 #endif
10504
10505         status = pthread_create( &t, &attr, task, NULL );
10506         if( status ) return status;
10507
10508 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10509         if( detach ) {
10510                 /* give thread a chance to complete */
10511                 /* it should remain joinable and hence detachable */
10512                 sleep( 1 );
10513
10514                 status = pthread_detach( t );
10515                 if( status ) return status;
10516         }
10517 #endif
10518
10519 #else
10520         /* Draft 4 pthreads */
10521         status = pthread_create( &t, pthread_attr_default, task, NULL );
10522         if( status ) return status;
10523
10524         if( detach ) {
10525                 /* give thread a chance to complete */
10526                 /* it should remain joinable and hence detachable */
10527                 sleep( 1 );
10528
10529                 status = pthread_detach( &t );
10530                 if( status ) return status;
10531         }
10532 #endif
10533
10534 #ifdef HAVE_LINUX_THREADS
10535         pthread_kill_other_threads_np();
10536 #endif
10537
10538         return 0;
10539
10540 ; return 0; }
10541 EOF
10542 if { (eval echo configure:10543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10543   rm -rf conftest*
10544   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10545 else
10546   echo "configure: failed program was:" >&5
10547   cat conftest.$ac_ext >&5
10548   rm -rf conftest*
10549   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10550 fi
10551 rm -f conftest*
10552 else
10553   cat > conftest.$ac_ext <<EOF
10554 #line 10555 "configure"
10555 #include "confdefs.h"
10556 /* pthread test headers */
10557 #include <pthread.h>
10558 #ifndef NULL
10559 #define NULL (void*)0
10560 #endif
10561
10562 static void *task(p)
10563         void *p;
10564 {
10565         return (void *) (p == NULL);
10566 }
10567
10568
10569 int main(argc, argv)
10570         int argc;
10571         char **argv;
10572 {
10573
10574         /* pthread test function */
10575         pthread_t t;
10576         int status;
10577         int detach = 1;
10578
10579 #ifdef HAVE_PTHREADS_FINAL
10580         /* Final pthreads */
10581         pthread_attr_t attr;
10582
10583         status = pthread_attr_init(&attr);
10584         if( status ) return status;
10585
10586 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10587         if( !detach ) {
10588 #if defined( PTHREAD_CREATE_JOINABLE )
10589                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10590 #else
10591                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10592 #endif
10593
10594 #ifdef PTHREAD_CREATE_DETACHED
10595         } else {
10596                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10597 #endif
10598         }
10599         if( status ) return status;
10600 #endif
10601
10602         status = pthread_create( &t, &attr, task, NULL );
10603         if( status ) return status;
10604
10605 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10606         if( detach ) {
10607                 /* give thread a chance to complete */
10608                 /* it should remain joinable and hence detachable */
10609                 sleep( 1 );
10610
10611                 status = pthread_detach( t );
10612                 if( status ) return status;
10613         }
10614 #endif
10615
10616 #else
10617         /* Draft 4 pthreads */
10618         status = pthread_create( &t, pthread_attr_default, task, NULL );
10619         if( status ) return status;
10620
10621         if( detach ) {
10622                 /* give thread a chance to complete */
10623                 /* it should remain joinable and hence detachable */
10624                 sleep( 1 );
10625
10626                 status = pthread_detach( &t );
10627                 if( status ) return status;
10628         }
10629 #endif
10630
10631 #ifdef HAVE_LINUX_THREADS
10632         pthread_kill_other_threads_np();
10633 #endif
10634
10635         return 0;
10636
10637 }
10638
10639 EOF
10640 if { (eval echo configure:10641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10641 then
10642   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10643 else
10644   echo "configure: failed program was:" >&5
10645   cat conftest.$ac_ext >&5
10646   rm -fr conftest*
10647   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10648 fi
10649 rm -fr conftest*
10650 fi
10651
10652
10653                 # restore the LIBS
10654                 LIBS="$ol_LIBS"
10655         
10656 fi
10657
10658 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10659
10660         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10661                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10662                 ol_link_threads=posix
10663         fi
10664 fi
10665
10666                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10667 if test "$ol_link_threads" = no ; then
10668         # try -lpthreads -lmach -lexc
10669         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10670 echo "configure:10671: checking for pthread link with -lpthreads -lmach -lexc" >&5
10671 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10672   echo $ac_n "(cached) $ac_c" 1>&6
10673 else
10674   
10675                 # save the flags
10676                 ol_LIBS="$LIBS"
10677                 LIBS="-lpthreads -lmach -lexc $LIBS"
10678
10679                 if test "$cross_compiling" = yes; then
10680   cat > conftest.$ac_ext <<EOF
10681 #line 10682 "configure"
10682 #include "confdefs.h"
10683 /* pthread test headers */
10684 #include <pthread.h>
10685 #ifndef NULL
10686 #define NULL (void*)0
10687 #endif
10688
10689 static void *task(p)
10690         void *p;
10691 {
10692         return (void *) (p == NULL);
10693 }
10694
10695 int main() {
10696
10697         /* pthread test function */
10698         pthread_t t;
10699         int status;
10700         int detach = 1;
10701
10702 #ifdef HAVE_PTHREADS_FINAL
10703         /* Final pthreads */
10704         pthread_attr_t attr;
10705
10706         status = pthread_attr_init(&attr);
10707         if( status ) return status;
10708
10709 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10710         if( !detach ) {
10711 #if defined( PTHREAD_CREATE_JOINABLE )
10712                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10713 #else
10714                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10715 #endif
10716
10717 #ifdef PTHREAD_CREATE_DETACHED
10718         } else {
10719                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10720 #endif
10721         }
10722         if( status ) return status;
10723 #endif
10724
10725         status = pthread_create( &t, &attr, task, NULL );
10726         if( status ) return status;
10727
10728 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10729         if( detach ) {
10730                 /* give thread a chance to complete */
10731                 /* it should remain joinable and hence detachable */
10732                 sleep( 1 );
10733
10734                 status = pthread_detach( t );
10735                 if( status ) return status;
10736         }
10737 #endif
10738
10739 #else
10740         /* Draft 4 pthreads */
10741         status = pthread_create( &t, pthread_attr_default, task, NULL );
10742         if( status ) return status;
10743
10744         if( detach ) {
10745                 /* give thread a chance to complete */
10746                 /* it should remain joinable and hence detachable */
10747                 sleep( 1 );
10748
10749                 status = pthread_detach( &t );
10750                 if( status ) return status;
10751         }
10752 #endif
10753
10754 #ifdef HAVE_LINUX_THREADS
10755         pthread_kill_other_threads_np();
10756 #endif
10757
10758         return 0;
10759
10760 ; return 0; }
10761 EOF
10762 if { (eval echo configure:10763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10763   rm -rf conftest*
10764   ol_cv_pthread_lpthreads_lmach_lexc=yes
10765 else
10766   echo "configure: failed program was:" >&5
10767   cat conftest.$ac_ext >&5
10768   rm -rf conftest*
10769   ol_cv_pthread_lpthreads_lmach_lexc=no
10770 fi
10771 rm -f conftest*
10772 else
10773   cat > conftest.$ac_ext <<EOF
10774 #line 10775 "configure"
10775 #include "confdefs.h"
10776 /* pthread test headers */
10777 #include <pthread.h>
10778 #ifndef NULL
10779 #define NULL (void*)0
10780 #endif
10781
10782 static void *task(p)
10783         void *p;
10784 {
10785         return (void *) (p == NULL);
10786 }
10787
10788
10789 int main(argc, argv)
10790         int argc;
10791         char **argv;
10792 {
10793
10794         /* pthread test function */
10795         pthread_t t;
10796         int status;
10797         int detach = 1;
10798
10799 #ifdef HAVE_PTHREADS_FINAL
10800         /* Final pthreads */
10801         pthread_attr_t attr;
10802
10803         status = pthread_attr_init(&attr);
10804         if( status ) return status;
10805
10806 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10807         if( !detach ) {
10808 #if defined( PTHREAD_CREATE_JOINABLE )
10809                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10810 #else
10811                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10812 #endif
10813
10814 #ifdef PTHREAD_CREATE_DETACHED
10815         } else {
10816                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10817 #endif
10818         }
10819         if( status ) return status;
10820 #endif
10821
10822         status = pthread_create( &t, &attr, task, NULL );
10823         if( status ) return status;
10824
10825 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10826         if( detach ) {
10827                 /* give thread a chance to complete */
10828                 /* it should remain joinable and hence detachable */
10829                 sleep( 1 );
10830
10831                 status = pthread_detach( t );
10832                 if( status ) return status;
10833         }
10834 #endif
10835
10836 #else
10837         /* Draft 4 pthreads */
10838         status = pthread_create( &t, pthread_attr_default, task, NULL );
10839         if( status ) return status;
10840
10841         if( detach ) {
10842                 /* give thread a chance to complete */
10843                 /* it should remain joinable and hence detachable */
10844                 sleep( 1 );
10845
10846                 status = pthread_detach( &t );
10847                 if( status ) return status;
10848         }
10849 #endif
10850
10851 #ifdef HAVE_LINUX_THREADS
10852         pthread_kill_other_threads_np();
10853 #endif
10854
10855         return 0;
10856
10857 }
10858
10859 EOF
10860 if { (eval echo configure:10861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10861 then
10862   ol_cv_pthread_lpthreads_lmach_lexc=yes
10863 else
10864   echo "configure: failed program was:" >&5
10865   cat conftest.$ac_ext >&5
10866   rm -fr conftest*
10867   ol_cv_pthread_lpthreads_lmach_lexc=no
10868 fi
10869 rm -fr conftest*
10870 fi
10871
10872
10873                 # restore the LIBS
10874                 LIBS="$ol_LIBS"
10875         
10876 fi
10877
10878 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10879
10880         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10881                 ol_link_pthreads="-lpthreads -lmach -lexc"
10882                 ol_link_threads=posix
10883         fi
10884 fi
10885
10886                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10887 if test "$ol_link_threads" = no ; then
10888         # try -lpthreads -lexc
10889         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10890 echo "configure:10891: checking for pthread link with -lpthreads -lexc" >&5
10891 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10892   echo $ac_n "(cached) $ac_c" 1>&6
10893 else
10894   
10895                 # save the flags
10896                 ol_LIBS="$LIBS"
10897                 LIBS="-lpthreads -lexc $LIBS"
10898
10899                 if test "$cross_compiling" = yes; then
10900   cat > conftest.$ac_ext <<EOF
10901 #line 10902 "configure"
10902 #include "confdefs.h"
10903 /* pthread test headers */
10904 #include <pthread.h>
10905 #ifndef NULL
10906 #define NULL (void*)0
10907 #endif
10908
10909 static void *task(p)
10910         void *p;
10911 {
10912         return (void *) (p == NULL);
10913 }
10914
10915 int main() {
10916
10917         /* pthread test function */
10918         pthread_t t;
10919         int status;
10920         int detach = 1;
10921
10922 #ifdef HAVE_PTHREADS_FINAL
10923         /* Final pthreads */
10924         pthread_attr_t attr;
10925
10926         status = pthread_attr_init(&attr);
10927         if( status ) return status;
10928
10929 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10930         if( !detach ) {
10931 #if defined( PTHREAD_CREATE_JOINABLE )
10932                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10933 #else
10934                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10935 #endif
10936
10937 #ifdef PTHREAD_CREATE_DETACHED
10938         } else {
10939                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10940 #endif
10941         }
10942         if( status ) return status;
10943 #endif
10944
10945         status = pthread_create( &t, &attr, task, NULL );
10946         if( status ) return status;
10947
10948 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10949         if( detach ) {
10950                 /* give thread a chance to complete */
10951                 /* it should remain joinable and hence detachable */
10952                 sleep( 1 );
10953
10954                 status = pthread_detach( t );
10955                 if( status ) return status;
10956         }
10957 #endif
10958
10959 #else
10960         /* Draft 4 pthreads */
10961         status = pthread_create( &t, pthread_attr_default, task, NULL );
10962         if( status ) return status;
10963
10964         if( detach ) {
10965                 /* give thread a chance to complete */
10966                 /* it should remain joinable and hence detachable */
10967                 sleep( 1 );
10968
10969                 status = pthread_detach( &t );
10970                 if( status ) return status;
10971         }
10972 #endif
10973
10974 #ifdef HAVE_LINUX_THREADS
10975         pthread_kill_other_threads_np();
10976 #endif
10977
10978         return 0;
10979
10980 ; return 0; }
10981 EOF
10982 if { (eval echo configure:10983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10983   rm -rf conftest*
10984   ol_cv_pthread_lpthreads_lexc=yes
10985 else
10986   echo "configure: failed program was:" >&5
10987   cat conftest.$ac_ext >&5
10988   rm -rf conftest*
10989   ol_cv_pthread_lpthreads_lexc=no
10990 fi
10991 rm -f conftest*
10992 else
10993   cat > conftest.$ac_ext <<EOF
10994 #line 10995 "configure"
10995 #include "confdefs.h"
10996 /* pthread test headers */
10997 #include <pthread.h>
10998 #ifndef NULL
10999 #define NULL (void*)0
11000 #endif
11001
11002 static void *task(p)
11003         void *p;
11004 {
11005         return (void *) (p == NULL);
11006 }
11007
11008
11009 int main(argc, argv)
11010         int argc;
11011         char **argv;
11012 {
11013
11014         /* pthread test function */
11015         pthread_t t;
11016         int status;
11017         int detach = 1;
11018
11019 #ifdef HAVE_PTHREADS_FINAL
11020         /* Final pthreads */
11021         pthread_attr_t attr;
11022
11023         status = pthread_attr_init(&attr);
11024         if( status ) return status;
11025
11026 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11027         if( !detach ) {
11028 #if defined( PTHREAD_CREATE_JOINABLE )
11029                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11030 #else
11031                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11032 #endif
11033
11034 #ifdef PTHREAD_CREATE_DETACHED
11035         } else {
11036                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11037 #endif
11038         }
11039         if( status ) return status;
11040 #endif
11041
11042         status = pthread_create( &t, &attr, task, NULL );
11043         if( status ) return status;
11044
11045 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11046         if( detach ) {
11047                 /* give thread a chance to complete */
11048                 /* it should remain joinable and hence detachable */
11049                 sleep( 1 );
11050
11051                 status = pthread_detach( t );
11052                 if( status ) return status;
11053         }
11054 #endif
11055
11056 #else
11057         /* Draft 4 pthreads */
11058         status = pthread_create( &t, pthread_attr_default, task, NULL );
11059         if( status ) return status;
11060
11061         if( detach ) {
11062                 /* give thread a chance to complete */
11063                 /* it should remain joinable and hence detachable */
11064                 sleep( 1 );
11065
11066                 status = pthread_detach( &t );
11067                 if( status ) return status;
11068         }
11069 #endif
11070
11071 #ifdef HAVE_LINUX_THREADS
11072         pthread_kill_other_threads_np();
11073 #endif
11074
11075         return 0;
11076
11077 }
11078
11079 EOF
11080 if { (eval echo configure:11081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11081 then
11082   ol_cv_pthread_lpthreads_lexc=yes
11083 else
11084   echo "configure: failed program was:" >&5
11085   cat conftest.$ac_ext >&5
11086   rm -fr conftest*
11087   ol_cv_pthread_lpthreads_lexc=no
11088 fi
11089 rm -fr conftest*
11090 fi
11091
11092
11093                 # restore the LIBS
11094                 LIBS="$ol_LIBS"
11095         
11096 fi
11097
11098 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
11099
11100         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
11101                 ol_link_pthreads="-lpthreads -lexc"
11102                 ol_link_threads=posix
11103         fi
11104 fi
11105
11106
11107                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
11108 if test "$ol_link_threads" = no ; then
11109         # try -lpthreads
11110         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
11111 echo "configure:11112: checking for pthread link with -lpthreads" >&5
11112 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11113   echo $ac_n "(cached) $ac_c" 1>&6
11114 else
11115   
11116                 # save the flags
11117                 ol_LIBS="$LIBS"
11118                 LIBS="-lpthreads $LIBS"
11119
11120                 if test "$cross_compiling" = yes; then
11121   cat > conftest.$ac_ext <<EOF
11122 #line 11123 "configure"
11123 #include "confdefs.h"
11124 /* pthread test headers */
11125 #include <pthread.h>
11126 #ifndef NULL
11127 #define NULL (void*)0
11128 #endif
11129
11130 static void *task(p)
11131         void *p;
11132 {
11133         return (void *) (p == NULL);
11134 }
11135
11136 int main() {
11137
11138         /* pthread test function */
11139         pthread_t t;
11140         int status;
11141         int detach = 1;
11142
11143 #ifdef HAVE_PTHREADS_FINAL
11144         /* Final pthreads */
11145         pthread_attr_t attr;
11146
11147         status = pthread_attr_init(&attr);
11148         if( status ) return status;
11149
11150 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11151         if( !detach ) {
11152 #if defined( PTHREAD_CREATE_JOINABLE )
11153                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11154 #else
11155                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11156 #endif
11157
11158 #ifdef PTHREAD_CREATE_DETACHED
11159         } else {
11160                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11161 #endif
11162         }
11163         if( status ) return status;
11164 #endif
11165
11166         status = pthread_create( &t, &attr, task, NULL );
11167         if( status ) return status;
11168
11169 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11170         if( detach ) {
11171                 /* give thread a chance to complete */
11172                 /* it should remain joinable and hence detachable */
11173                 sleep( 1 );
11174
11175                 status = pthread_detach( t );
11176                 if( status ) return status;
11177         }
11178 #endif
11179
11180 #else
11181         /* Draft 4 pthreads */
11182         status = pthread_create( &t, pthread_attr_default, task, NULL );
11183         if( status ) return status;
11184
11185         if( detach ) {
11186                 /* give thread a chance to complete */
11187                 /* it should remain joinable and hence detachable */
11188                 sleep( 1 );
11189
11190                 status = pthread_detach( &t );
11191                 if( status ) return status;
11192         }
11193 #endif
11194
11195 #ifdef HAVE_LINUX_THREADS
11196         pthread_kill_other_threads_np();
11197 #endif
11198
11199         return 0;
11200
11201 ; return 0; }
11202 EOF
11203 if { (eval echo configure:11204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11204   rm -rf conftest*
11205   ol_cv_pthread_lib_lpthreads=yes
11206 else
11207   echo "configure: failed program was:" >&5
11208   cat conftest.$ac_ext >&5
11209   rm -rf conftest*
11210   ol_cv_pthread_lib_lpthreads=no
11211 fi
11212 rm -f conftest*
11213 else
11214   cat > conftest.$ac_ext <<EOF
11215 #line 11216 "configure"
11216 #include "confdefs.h"
11217 /* pthread test headers */
11218 #include <pthread.h>
11219 #ifndef NULL
11220 #define NULL (void*)0
11221 #endif
11222
11223 static void *task(p)
11224         void *p;
11225 {
11226         return (void *) (p == NULL);
11227 }
11228
11229
11230 int main(argc, argv)
11231         int argc;
11232         char **argv;
11233 {
11234
11235         /* pthread test function */
11236         pthread_t t;
11237         int status;
11238         int detach = 1;
11239
11240 #ifdef HAVE_PTHREADS_FINAL
11241         /* Final pthreads */
11242         pthread_attr_t attr;
11243
11244         status = pthread_attr_init(&attr);
11245         if( status ) return status;
11246
11247 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11248         if( !detach ) {
11249 #if defined( PTHREAD_CREATE_JOINABLE )
11250                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11251 #else
11252                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11253 #endif
11254
11255 #ifdef PTHREAD_CREATE_DETACHED
11256         } else {
11257                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11258 #endif
11259         }
11260         if( status ) return status;
11261 #endif
11262
11263         status = pthread_create( &t, &attr, task, NULL );
11264         if( status ) return status;
11265
11266 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11267         if( detach ) {
11268                 /* give thread a chance to complete */
11269                 /* it should remain joinable and hence detachable */
11270                 sleep( 1 );
11271
11272                 status = pthread_detach( t );
11273                 if( status ) return status;
11274         }
11275 #endif
11276
11277 #else
11278         /* Draft 4 pthreads */
11279         status = pthread_create( &t, pthread_attr_default, task, NULL );
11280         if( status ) return status;
11281
11282         if( detach ) {
11283                 /* give thread a chance to complete */
11284                 /* it should remain joinable and hence detachable */
11285                 sleep( 1 );
11286
11287                 status = pthread_detach( &t );
11288                 if( status ) return status;
11289         }
11290 #endif
11291
11292 #ifdef HAVE_LINUX_THREADS
11293         pthread_kill_other_threads_np();
11294 #endif
11295
11296         return 0;
11297
11298 }
11299
11300 EOF
11301 if { (eval echo configure:11302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11302 then
11303   ol_cv_pthread_lib_lpthreads=yes
11304 else
11305   echo "configure: failed program was:" >&5
11306   cat conftest.$ac_ext >&5
11307   rm -fr conftest*
11308   ol_cv_pthread_lib_lpthreads=no
11309 fi
11310 rm -fr conftest*
11311 fi
11312
11313
11314                 # restore the LIBS
11315                 LIBS="$ol_LIBS"
11316         
11317 fi
11318
11319 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11320
11321         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11322                 ol_link_pthreads="-lpthreads"
11323                 ol_link_threads=posix
11324         fi
11325 fi
11326
11327
11328                 if test $ol_link_threads != no ; then
11329                         cat >> confdefs.h <<\EOF
11330 #define HAVE_PTHREADS 1
11331 EOF
11332
11333
11334                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11335
11336                                                 save_CPPFLAGS="$CPPFLAGS"
11337                         save_LIBS="$LIBS"
11338                         LIBS="$LTHREAD_LIBS $LIBS"
11339
11340                                                                                                 for ac_func in sched_yield pthread_yield
11341 do
11342 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11343 echo "configure:11344: checking for $ac_func" >&5
11344 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11345   echo $ac_n "(cached) $ac_c" 1>&6
11346 else
11347   cat > conftest.$ac_ext <<EOF
11348 #line 11349 "configure"
11349 #include "confdefs.h"
11350 /* System header to define __stub macros and hopefully few prototypes,
11351     which can conflict with char $ac_func(); below.  */
11352 #include <assert.h>
11353 /* Override any gcc2 internal prototype to avoid an error.  */
11354 /* We use char because int might match the return type of a gcc2
11355     builtin and then its argument prototype would still apply.  */
11356 char $ac_func();
11357 char (*f)();
11358
11359 int main() {
11360
11361 /* The GNU C library defines this for functions which it implements
11362     to always fail with ENOSYS.  Some functions are actually named
11363     something starting with __ and the normal name is an alias.  */
11364 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11365 choke me
11366 #else
11367 f = $ac_func;
11368 #endif
11369
11370 ; return 0; }
11371 EOF
11372 if { (eval echo configure:11373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11373   rm -rf conftest*
11374   eval "ac_cv_func_$ac_func=yes"
11375 else
11376   echo "configure: failed program was:" >&5
11377   cat conftest.$ac_ext >&5
11378   rm -rf conftest*
11379   eval "ac_cv_func_$ac_func=no"
11380 fi
11381 rm -f conftest*
11382 fi
11383
11384 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11385   echo "$ac_t""yes" 1>&6
11386     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11387   cat >> confdefs.h <<EOF
11388 #define $ac_tr_func 1
11389 EOF
11390  
11391 else
11392   echo "$ac_t""no" 1>&6
11393 fi
11394 done
11395
11396
11397                         if test $ac_cv_func_sched_yield = no -a \
11398                                 $ac_cv_func_pthread_yield = no ; then
11399                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11400 echo "configure:11401: checking for sched_yield in -lrt" >&5
11401 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11402 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11403   echo $ac_n "(cached) $ac_c" 1>&6
11404 else
11405   ac_save_LIBS="$LIBS"
11406 LIBS="-lrt  $LIBS"
11407 cat > conftest.$ac_ext <<EOF
11408 #line 11409 "configure"
11409 #include "confdefs.h"
11410 /* Override any gcc2 internal prototype to avoid an error.  */
11411 /* We use char because int might match the return type of a gcc2
11412     builtin and then its argument prototype would still apply.  */
11413 char sched_yield();
11414
11415 int main() {
11416 sched_yield()
11417 ; return 0; }
11418 EOF
11419 if { (eval echo configure:11420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11420   rm -rf conftest*
11421   eval "ac_cv_lib_$ac_lib_var=yes"
11422 else
11423   echo "configure: failed program was:" >&5
11424   cat conftest.$ac_ext >&5
11425   rm -rf conftest*
11426   eval "ac_cv_lib_$ac_lib_var=no"
11427 fi
11428 rm -f conftest*
11429 LIBS="$ac_save_LIBS"
11430
11431 fi
11432 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11433   echo "$ac_t""yes" 1>&6
11434   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11435                                         cat >> confdefs.h <<\EOF
11436 #define HAVE_SCHED_YIELD 1
11437 EOF
11438
11439                                         ac_cv_func_sched_yield=yes
11440 else
11441   echo "$ac_t""no" 1>&6
11442 ac_cv_func_sched_yield=no
11443 fi
11444
11445                         fi
11446                         if test $ac_cv_func_sched_yield = no -a \
11447                                 $ac_cv_func_pthread_yield = no ; then
11448                                                                                                 for ac_func in thr_yield
11449 do
11450 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11451 echo "configure:11452: checking for $ac_func" >&5
11452 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11453   echo $ac_n "(cached) $ac_c" 1>&6
11454 else
11455   cat > conftest.$ac_ext <<EOF
11456 #line 11457 "configure"
11457 #include "confdefs.h"
11458 /* System header to define __stub macros and hopefully few prototypes,
11459     which can conflict with char $ac_func(); below.  */
11460 #include <assert.h>
11461 /* Override any gcc2 internal prototype to avoid an error.  */
11462 /* We use char because int might match the return type of a gcc2
11463     builtin and then its argument prototype would still apply.  */
11464 char $ac_func();
11465 char (*f)();
11466
11467 int main() {
11468
11469 /* The GNU C library defines this for functions which it implements
11470     to always fail with ENOSYS.  Some functions are actually named
11471     something starting with __ and the normal name is an alias.  */
11472 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11473 choke me
11474 #else
11475 f = $ac_func;
11476 #endif
11477
11478 ; return 0; }
11479 EOF
11480 if { (eval echo configure:11481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11481   rm -rf conftest*
11482   eval "ac_cv_func_$ac_func=yes"
11483 else
11484   echo "configure: failed program was:" >&5
11485   cat conftest.$ac_ext >&5
11486   rm -rf conftest*
11487   eval "ac_cv_func_$ac_func=no"
11488 fi
11489 rm -f conftest*
11490 fi
11491
11492 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11493   echo "$ac_t""yes" 1>&6
11494     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11495   cat >> confdefs.h <<EOF
11496 #define $ac_tr_func 1
11497 EOF
11498  
11499 else
11500   echo "$ac_t""no" 1>&6
11501 fi
11502 done
11503
11504                         fi
11505                         if test $ac_cv_func_sched_yield = no -a \
11506                                 $ac_cv_func_pthread_yield = no -a \
11507                                 "$ac_cv_func_thr_yield" = no ; then
11508                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11509                         fi
11510
11511                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11512 do
11513 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11514 echo "configure:11515: checking for $ac_func" >&5
11515 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11516   echo $ac_n "(cached) $ac_c" 1>&6
11517 else
11518   cat > conftest.$ac_ext <<EOF
11519 #line 11520 "configure"
11520 #include "confdefs.h"
11521 /* System header to define __stub macros and hopefully few prototypes,
11522     which can conflict with char $ac_func(); below.  */
11523 #include <assert.h>
11524 /* Override any gcc2 internal prototype to avoid an error.  */
11525 /* We use char because int might match the return type of a gcc2
11526     builtin and then its argument prototype would still apply.  */
11527 char $ac_func();
11528 char (*f)();
11529
11530 int main() {
11531
11532 /* The GNU C library defines this for functions which it implements
11533     to always fail with ENOSYS.  Some functions are actually named
11534     something starting with __ and the normal name is an alias.  */
11535 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11536 choke me
11537 #else
11538 f = $ac_func;
11539 #endif
11540
11541 ; return 0; }
11542 EOF
11543 if { (eval echo configure:11544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11544   rm -rf conftest*
11545   eval "ac_cv_func_$ac_func=yes"
11546 else
11547   echo "configure: failed program was:" >&5
11548   cat conftest.$ac_ext >&5
11549   rm -rf conftest*
11550   eval "ac_cv_func_$ac_func=no"
11551 fi
11552 rm -f conftest*
11553 fi
11554
11555 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11556   echo "$ac_t""yes" 1>&6
11557     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11558   cat >> confdefs.h <<EOF
11559 #define $ac_tr_func 1
11560 EOF
11561  
11562 else
11563   echo "$ac_t""no" 1>&6
11564 fi
11565 done
11566
11567
11568                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11569 echo "configure:11570: checking for pthread_detach with <pthread.h>" >&5
11570 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11571   echo $ac_n "(cached) $ac_c" 1>&6
11572 else
11573   
11574                                                                 cat > conftest.$ac_ext <<EOF
11575 #line 11576 "configure"
11576 #include "confdefs.h"
11577
11578 #include <pthread.h>
11579 #ifndef NULL
11580 #define NULL (void*)0
11581 #endif
11582
11583 int main() {
11584 pthread_detach(NULL);
11585 ; return 0; }
11586 EOF
11587 if { (eval echo configure:11588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11588   rm -rf conftest*
11589   ol_cv_func_pthread_detach=yes
11590 else
11591   echo "configure: failed program was:" >&5
11592   cat conftest.$ac_ext >&5
11593   rm -rf conftest*
11594   ol_cv_func_pthread_detach=no
11595 fi
11596 rm -f conftest*
11597                         
11598 fi
11599
11600 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11601
11602                         if test $ol_cv_func_pthread_detach = no ; then
11603                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11604                         fi
11605
11606                         cat >> confdefs.h <<\EOF
11607 #define HAVE_PTHREAD_DETACH 1
11608 EOF
11609
11610
11611                                                 for ac_func in \
11612                                 pthread_setconcurrency \
11613                                 pthread_getconcurrency \
11614                                 thr_setconcurrency \
11615                                 thr_getconcurrency \
11616                         
11617 do
11618 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11619 echo "configure:11620: checking for $ac_func" >&5
11620 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11621   echo $ac_n "(cached) $ac_c" 1>&6
11622 else
11623   cat > conftest.$ac_ext <<EOF
11624 #line 11625 "configure"
11625 #include "confdefs.h"
11626 /* System header to define __stub macros and hopefully few prototypes,
11627     which can conflict with char $ac_func(); below.  */
11628 #include <assert.h>
11629 /* Override any gcc2 internal prototype to avoid an error.  */
11630 /* We use char because int might match the return type of a gcc2
11631     builtin and then its argument prototype would still apply.  */
11632 char $ac_func();
11633 char (*f)();
11634
11635 int main() {
11636
11637 /* The GNU C library defines this for functions which it implements
11638     to always fail with ENOSYS.  Some functions are actually named
11639     something starting with __ and the normal name is an alias.  */
11640 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11641 choke me
11642 #else
11643 f = $ac_func;
11644 #endif
11645
11646 ; return 0; }
11647 EOF
11648 if { (eval echo configure:11649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11649   rm -rf conftest*
11650   eval "ac_cv_func_$ac_func=yes"
11651 else
11652   echo "configure: failed program was:" >&5
11653   cat conftest.$ac_ext >&5
11654   rm -rf conftest*
11655   eval "ac_cv_func_$ac_func=no"
11656 fi
11657 rm -f conftest*
11658 fi
11659
11660 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11661   echo "$ac_t""yes" 1>&6
11662     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11663   cat >> confdefs.h <<EOF
11664 #define $ac_tr_func 1
11665 EOF
11666  
11667 else
11668   echo "$ac_t""no" 1>&6
11669 fi
11670 done
11671
11672
11673                         
11674         for ac_func in pthread_kill_other_threads_np
11675 do
11676 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11677 echo "configure:11678: checking for $ac_func" >&5
11678 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11679   echo $ac_n "(cached) $ac_c" 1>&6
11680 else
11681   cat > conftest.$ac_ext <<EOF
11682 #line 11683 "configure"
11683 #include "confdefs.h"
11684 /* System header to define __stub macros and hopefully few prototypes,
11685     which can conflict with char $ac_func(); below.  */
11686 #include <assert.h>
11687 /* Override any gcc2 internal prototype to avoid an error.  */
11688 /* We use char because int might match the return type of a gcc2
11689     builtin and then its argument prototype would still apply.  */
11690 char $ac_func();
11691 char (*f)();
11692
11693 int main() {
11694
11695 /* The GNU C library defines this for functions which it implements
11696     to always fail with ENOSYS.  Some functions are actually named
11697     something starting with __ and the normal name is an alias.  */
11698 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11699 choke me
11700 #else
11701 f = $ac_func;
11702 #endif
11703
11704 ; return 0; }
11705 EOF
11706 if { (eval echo configure:11707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11707   rm -rf conftest*
11708   eval "ac_cv_func_$ac_func=yes"
11709 else
11710   echo "configure: failed program was:" >&5
11711   cat conftest.$ac_ext >&5
11712   rm -rf conftest*
11713   eval "ac_cv_func_$ac_func=no"
11714 fi
11715 rm -f conftest*
11716 fi
11717
11718 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11719   echo "$ac_t""yes" 1>&6
11720     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11721   cat >> confdefs.h <<EOF
11722 #define $ac_tr_func 1
11723 EOF
11724  
11725 else
11726   echo "$ac_t""no" 1>&6
11727 fi
11728 done
11729
11730         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11731 echo "configure:11732: checking for LinuxThreads implementation" >&5
11732 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11733   echo $ac_n "(cached) $ac_c" 1>&6
11734 else
11735   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11736 fi
11737
11738 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11739
11740                         
11741         
11742         
11743         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11744 echo "configure:11745: checking for LinuxThreads consistency" >&5
11745 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11746   echo $ac_n "(cached) $ac_c" 1>&6
11747 else
11748   
11749                 if test $ol_cv_header_linux_threads = yes -a \
11750                         $ol_cv_sys_linux_threads = yes; then
11751                         ol_cv_linux_threads=yes
11752                 elif test $ol_cv_header_linux_threads = no -a \
11753                         $ol_cv_sys_linux_threads = no; then
11754                         ol_cv_linux_threads=no
11755                 else
11756                         ol_cv_linux_threads=error
11757                 fi
11758         
11759 fi
11760
11761 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11762
11763
11764                         if test $ol_cv_linux_threads = error; then
11765                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11766                         fi
11767
11768                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11769 echo "configure:11770: checking if pthread_create() works" >&5
11770 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11771   echo $ac_n "(cached) $ac_c" 1>&6
11772 else
11773   
11774                         if test "$cross_compiling" = yes; then
11775                                 ol_cv_pthread_create_works=yes
11776 else
11777   cat > conftest.$ac_ext <<EOF
11778 #line 11779 "configure"
11779 #include "confdefs.h"
11780 /* pthread test headers */
11781 #include <pthread.h>
11782 #ifndef NULL
11783 #define NULL (void*)0
11784 #endif
11785
11786 static void *task(p)
11787         void *p;
11788 {
11789         return (void *) (p == NULL);
11790 }
11791
11792
11793 int main(argc, argv)
11794         int argc;
11795         char **argv;
11796 {
11797
11798         /* pthread test function */
11799         pthread_t t;
11800         int status;
11801         int detach = 1;
11802
11803 #ifdef HAVE_PTHREADS_FINAL
11804         /* Final pthreads */
11805         pthread_attr_t attr;
11806
11807         status = pthread_attr_init(&attr);
11808         if( status ) return status;
11809
11810 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11811         if( !detach ) {
11812 #if defined( PTHREAD_CREATE_JOINABLE )
11813                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11814 #else
11815                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11816 #endif
11817
11818 #ifdef PTHREAD_CREATE_DETACHED
11819         } else {
11820                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11821 #endif
11822         }
11823         if( status ) return status;
11824 #endif
11825
11826         status = pthread_create( &t, &attr, task, NULL );
11827         if( status ) return status;
11828
11829 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11830         if( detach ) {
11831                 /* give thread a chance to complete */
11832                 /* it should remain joinable and hence detachable */
11833                 sleep( 1 );
11834
11835                 status = pthread_detach( t );
11836                 if( status ) return status;
11837         }
11838 #endif
11839
11840 #else
11841         /* Draft 4 pthreads */
11842         status = pthread_create( &t, pthread_attr_default, task, NULL );
11843         if( status ) return status;
11844
11845         if( detach ) {
11846                 /* give thread a chance to complete */
11847                 /* it should remain joinable and hence detachable */
11848                 sleep( 1 );
11849
11850                 status = pthread_detach( &t );
11851                 if( status ) return status;
11852         }
11853 #endif
11854
11855 #ifdef HAVE_LINUX_THREADS
11856         pthread_kill_other_threads_np();
11857 #endif
11858
11859         return 0;
11860
11861 }
11862
11863 EOF
11864 if { (eval echo configure:11865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11865 then
11866   ol_cv_pthread_create_works=yes
11867 else
11868   echo "configure: failed program was:" >&5
11869   cat conftest.$ac_ext >&5
11870   rm -fr conftest*
11871   ol_cv_pthread_create_works=no
11872 fi
11873 rm -fr conftest*
11874 fi
11875
11876 fi
11877
11878 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11879
11880                         if test $ol_cv_pthread_create_works = no ; then
11881                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11882                         fi
11883
11884                                                 if test $ol_with_yielding_select = auto ; then
11885                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11886 echo "configure:11887: checking if select yields when using pthreads" >&5
11887 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11888   echo $ac_n "(cached) $ac_c" 1>&6
11889 else
11890   
11891                                 if test "$cross_compiling" = yes; then
11892   ol_cv_pthread_select_yields=cross
11893 else
11894   cat > conftest.$ac_ext <<EOF
11895 #line 11896 "configure"
11896 #include "confdefs.h"
11897
11898 #include <sys/types.h>
11899 #include <sys/time.h>
11900 #include <unistd.h>
11901 #include <pthread.h>
11902 #ifndef NULL
11903 #define NULL (void*) 0
11904 #endif
11905
11906 static int fildes[2];
11907
11908 static void *task(p)
11909         void *p;
11910 {
11911         int i;
11912         struct timeval tv;
11913
11914         fd_set rfds;
11915
11916         tv.tv_sec=10;
11917         tv.tv_usec=0;
11918
11919         FD_ZERO(&rfds);
11920         FD_SET(fildes[0], &rfds);
11921
11922         /* we're not interested in any fds */
11923         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11924
11925         if(i < 0) {
11926                 perror("select");
11927                 exit(10);
11928         }
11929
11930         exit(0); /* if we exit here, the select blocked the whole process */
11931 }
11932
11933 int main(argc, argv)
11934         int argc;
11935         char **argv;
11936 {
11937         pthread_t t;
11938
11939         /* create a pipe to select */
11940         if(pipe(&fildes[0])) {
11941                 perror("select");
11942                 exit(1);
11943         }
11944
11945 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11946         (void) pthread_setconcurrency(2);
11947 #else
11948 #ifdef HAVE_THR_SETCONCURRENCY
11949         /* Set Solaris LWP concurrency to 2 */
11950         thr_setconcurrency(2);
11951 #endif
11952 #endif
11953
11954 #if HAVE_PTHREADS_D4
11955         pthread_create(&t, pthread_attr_default, task, NULL);
11956 #else
11957         pthread_create(&t, NULL, task, NULL);
11958 #endif
11959
11960 #if HAVE_SCHED_YIELD
11961         sched_yield();  /* make sure task runs first */
11962 #else
11963 #ifdef HAVE_PTHREAD_YIELD
11964         pthread_yield();        /* make sure task runs first */
11965 #endif
11966 #endif
11967
11968         exit(2);
11969 }
11970 EOF
11971 if { (eval echo configure:11972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11972 then
11973   ol_cv_pthread_select_yields=no
11974 else
11975   echo "configure: failed program was:" >&5
11976   cat conftest.$ac_ext >&5
11977   rm -fr conftest*
11978   ol_cv_pthread_select_yields=yes
11979 fi
11980 rm -fr conftest*
11981 fi
11982
11983 fi
11984
11985 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11986
11987                                 if test $ol_cv_pthread_select_yields = cross ; then
11988                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11989                                 fi
11990
11991                                 if test $ol_cv_pthread_select_yields = yes ; then
11992                                         ol_with_yielding_select=yes
11993                                 fi
11994                         fi
11995
11996                                                 CPPFLAGS="$save_CPPFLAGS"
11997                         LIBS="$save_LIBS"
11998                 else
11999                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
12000                 fi
12001         fi
12002
12003         if test $ol_with_threads = posix ; then
12004                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
12005         fi
12006 fi
12007
12008 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12009         -o $ol_with_threads = mach ; then
12010
12011                 for ac_hdr in mach/cthreads.h cthread.h
12012 do
12013 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12014 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12015 echo "configure:12016: checking for $ac_hdr" >&5
12016 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12017   echo $ac_n "(cached) $ac_c" 1>&6
12018 else
12019   cat > conftest.$ac_ext <<EOF
12020 #line 12021 "configure"
12021 #include "confdefs.h"
12022 #include <$ac_hdr>
12023 EOF
12024 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12025 { (eval echo configure:12026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12026 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12027 if test -z "$ac_err"; then
12028   rm -rf conftest*
12029   eval "ac_cv_header_$ac_safe=yes"
12030 else
12031   echo "$ac_err" >&5
12032   echo "configure: failed program was:" >&5
12033   cat conftest.$ac_ext >&5
12034   rm -rf conftest*
12035   eval "ac_cv_header_$ac_safe=no"
12036 fi
12037 rm -f conftest*
12038 fi
12039 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12040   echo "$ac_t""yes" 1>&6
12041     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12042   cat >> confdefs.h <<EOF
12043 #define $ac_tr_hdr 1
12044 EOF
12045  
12046 else
12047   echo "$ac_t""no" 1>&6
12048 fi
12049 done
12050
12051         if test $ac_cv_header_mach_cthreads_h = yes ; then
12052                 ol_with_threads=found
12053
12054                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12055 echo "configure:12056: checking for cthread_fork" >&5
12056 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12057   echo $ac_n "(cached) $ac_c" 1>&6
12058 else
12059   cat > conftest.$ac_ext <<EOF
12060 #line 12061 "configure"
12061 #include "confdefs.h"
12062 /* System header to define __stub macros and hopefully few prototypes,
12063     which can conflict with char cthread_fork(); below.  */
12064 #include <assert.h>
12065 /* Override any gcc2 internal prototype to avoid an error.  */
12066 /* We use char because int might match the return type of a gcc2
12067     builtin and then its argument prototype would still apply.  */
12068 char cthread_fork();
12069 char (*f)();
12070
12071 int main() {
12072
12073 /* The GNU C library defines this for functions which it implements
12074     to always fail with ENOSYS.  Some functions are actually named
12075     something starting with __ and the normal name is an alias.  */
12076 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12077 choke me
12078 #else
12079 f = cthread_fork;
12080 #endif
12081
12082 ; return 0; }
12083 EOF
12084 if { (eval echo configure:12085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12085   rm -rf conftest*
12086   eval "ac_cv_func_cthread_fork=yes"
12087 else
12088   echo "configure: failed program was:" >&5
12089   cat conftest.$ac_ext >&5
12090   rm -rf conftest*
12091   eval "ac_cv_func_cthread_fork=no"
12092 fi
12093 rm -f conftest*
12094 fi
12095
12096 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12097   echo "$ac_t""yes" 1>&6
12098   ol_link_threads=yes
12099 else
12100   echo "$ac_t""no" 1>&6
12101 fi
12102
12103
12104                 if test $ol_link_threads = no ; then
12105                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
12106 echo "configure:12107: checking for cthread_fork with -all_load" >&5
12107 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
12108   echo $ac_n "(cached) $ac_c" 1>&6
12109 else
12110   
12111                                                                 save_LIBS="$LIBS"
12112                                 LIBS="-all_load $LIBS"
12113                                 cat > conftest.$ac_ext <<EOF
12114 #line 12115 "configure"
12115 #include "confdefs.h"
12116 #include <mach/cthreads.h>
12117 int main() {
12118
12119                                         cthread_fork((void *)0, (void *)0);
12120                                         
12121 ; return 0; }
12122 EOF
12123 if { (eval echo configure:12124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12124   rm -rf conftest*
12125   ol_cv_cthread_all_load=yes
12126 else
12127   echo "configure: failed program was:" >&5
12128   cat conftest.$ac_ext >&5
12129   rm -rf conftest*
12130   ol_cv_cthread_all_load=no
12131 fi
12132 rm -f conftest*
12133                                                                 LIBS="$save_LIBS"
12134                         
12135 fi
12136
12137 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12138
12139                         if test $ol_cv_cthread_all_load = yes ; then
12140                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12141                                 ol_link_threads=mach
12142                         fi
12143                 fi
12144
12145     elif test $ac_cv_header_cthreads_h = yes ; then
12146                                 
12147                 ol_with_threads=found
12148  
12149                                 save_LIBS="$LIBS"
12150                 LIBS="$LIBS -lthreads"
12151                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12152 echo "configure:12153: checking for cthread_fork" >&5
12153 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12154   echo $ac_n "(cached) $ac_c" 1>&6
12155 else
12156   cat > conftest.$ac_ext <<EOF
12157 #line 12158 "configure"
12158 #include "confdefs.h"
12159 /* System header to define __stub macros and hopefully few prototypes,
12160     which can conflict with char cthread_fork(); below.  */
12161 #include <assert.h>
12162 /* Override any gcc2 internal prototype to avoid an error.  */
12163 /* We use char because int might match the return type of a gcc2
12164     builtin and then its argument prototype would still apply.  */
12165 char cthread_fork();
12166 char (*f)();
12167
12168 int main() {
12169
12170 /* The GNU C library defines this for functions which it implements
12171     to always fail with ENOSYS.  Some functions are actually named
12172     something starting with __ and the normal name is an alias.  */
12173 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12174 choke me
12175 #else
12176 f = cthread_fork;
12177 #endif
12178
12179 ; return 0; }
12180 EOF
12181 if { (eval echo configure:12182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12182   rm -rf conftest*
12183   eval "ac_cv_func_cthread_fork=yes"
12184 else
12185   echo "configure: failed program was:" >&5
12186   cat conftest.$ac_ext >&5
12187   rm -rf conftest*
12188   eval "ac_cv_func_cthread_fork=no"
12189 fi
12190 rm -f conftest*
12191 fi
12192
12193 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12194   echo "$ac_t""yes" 1>&6
12195   ol_link_threads=yes
12196 else
12197   echo "$ac_t""no" 1>&6
12198 fi
12199
12200                 LIBS="$save_LIBS"
12201
12202                 if test $ol_link_threads = yes ; then
12203                         LTHREAD_LIBS="-lthreads"
12204                         ol_link_threads=mach
12205                 else
12206                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12207                 fi
12208
12209         elif test $ol_with_threads = mach ; then
12210                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12211         fi
12212
12213         if test $ol_link_threads = mach ; then
12214                 cat >> confdefs.h <<\EOF
12215 #define HAVE_MACH_CTHREADS 1
12216 EOF
12217
12218         elif test $ol_with_threads = found ; then
12219                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12220         fi
12221 fi
12222
12223 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12224         -o $ol_with_threads = pth ; then
12225
12226         for ac_hdr in pth.h
12227 do
12228 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12229 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12230 echo "configure:12231: checking for $ac_hdr" >&5
12231 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12232   echo $ac_n "(cached) $ac_c" 1>&6
12233 else
12234   cat > conftest.$ac_ext <<EOF
12235 #line 12236 "configure"
12236 #include "confdefs.h"
12237 #include <$ac_hdr>
12238 EOF
12239 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12240 { (eval echo configure:12241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12241 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12242 if test -z "$ac_err"; then
12243   rm -rf conftest*
12244   eval "ac_cv_header_$ac_safe=yes"
12245 else
12246   echo "$ac_err" >&5
12247   echo "configure: failed program was:" >&5
12248   cat conftest.$ac_ext >&5
12249   rm -rf conftest*
12250   eval "ac_cv_header_$ac_safe=no"
12251 fi
12252 rm -f conftest*
12253 fi
12254 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12255   echo "$ac_t""yes" 1>&6
12256     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12257   cat >> confdefs.h <<EOF
12258 #define $ac_tr_hdr 1
12259 EOF
12260  
12261 else
12262   echo "$ac_t""no" 1>&6
12263 fi
12264 done
12265
12266
12267         if test $ac_cv_header_pth_h = yes ; then
12268                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12269 echo "configure:12270: checking for pth_version in -lpth" >&5
12270 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12271 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12272   echo $ac_n "(cached) $ac_c" 1>&6
12273 else
12274   ac_save_LIBS="$LIBS"
12275 LIBS="-lpth  $LIBS"
12276 cat > conftest.$ac_ext <<EOF
12277 #line 12278 "configure"
12278 #include "confdefs.h"
12279 /* Override any gcc2 internal prototype to avoid an error.  */
12280 /* We use char because int might match the return type of a gcc2
12281     builtin and then its argument prototype would still apply.  */
12282 char pth_version();
12283
12284 int main() {
12285 pth_version()
12286 ; return 0; }
12287 EOF
12288 if { (eval echo configure:12289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12289   rm -rf conftest*
12290   eval "ac_cv_lib_$ac_lib_var=yes"
12291 else
12292   echo "configure: failed program was:" >&5
12293   cat conftest.$ac_ext >&5
12294   rm -rf conftest*
12295   eval "ac_cv_lib_$ac_lib_var=no"
12296 fi
12297 rm -f conftest*
12298 LIBS="$ac_save_LIBS"
12299
12300 fi
12301 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12302   echo "$ac_t""yes" 1>&6
12303   have_pth=yes
12304 else
12305   echo "$ac_t""no" 1>&6
12306 have_pth=no
12307 fi
12308
12309
12310                 if test $have_pth = yes ; then
12311                         cat >> confdefs.h <<\EOF
12312 #define HAVE_GNU_PTH 1
12313 EOF
12314
12315                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12316                         ol_link_threads=pth
12317
12318                         if test $ol_with_yielding_select = auto ; then
12319                                 ol_with_yielding_select=yes
12320                         fi
12321                 fi
12322         fi
12323 fi
12324
12325 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12326         -o $ol_with_threads = lwp ; then
12327
12328                 for ac_hdr in thread.h synch.h
12329 do
12330 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12331 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12332 echo "configure:12333: checking for $ac_hdr" >&5
12333 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12334   echo $ac_n "(cached) $ac_c" 1>&6
12335 else
12336   cat > conftest.$ac_ext <<EOF
12337 #line 12338 "configure"
12338 #include "confdefs.h"
12339 #include <$ac_hdr>
12340 EOF
12341 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12342 { (eval echo configure:12343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12343 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12344 if test -z "$ac_err"; then
12345   rm -rf conftest*
12346   eval "ac_cv_header_$ac_safe=yes"
12347 else
12348   echo "$ac_err" >&5
12349   echo "configure: failed program was:" >&5
12350   cat conftest.$ac_ext >&5
12351   rm -rf conftest*
12352   eval "ac_cv_header_$ac_safe=no"
12353 fi
12354 rm -f conftest*
12355 fi
12356 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12357   echo "$ac_t""yes" 1>&6
12358     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12359   cat >> confdefs.h <<EOF
12360 #define $ac_tr_hdr 1
12361 EOF
12362  
12363 else
12364   echo "$ac_t""no" 1>&6
12365 fi
12366 done
12367
12368         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12369                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12370 echo "configure:12371: checking for thr_create in -lthread" >&5
12371 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12373   echo $ac_n "(cached) $ac_c" 1>&6
12374 else
12375   ac_save_LIBS="$LIBS"
12376 LIBS="-lthread  $LIBS"
12377 cat > conftest.$ac_ext <<EOF
12378 #line 12379 "configure"
12379 #include "confdefs.h"
12380 /* Override any gcc2 internal prototype to avoid an error.  */
12381 /* We use char because int might match the return type of a gcc2
12382     builtin and then its argument prototype would still apply.  */
12383 char thr_create();
12384
12385 int main() {
12386 thr_create()
12387 ; return 0; }
12388 EOF
12389 if { (eval echo configure:12390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12390   rm -rf conftest*
12391   eval "ac_cv_lib_$ac_lib_var=yes"
12392 else
12393   echo "configure: failed program was:" >&5
12394   cat conftest.$ac_ext >&5
12395   rm -rf conftest*
12396   eval "ac_cv_lib_$ac_lib_var=no"
12397 fi
12398 rm -f conftest*
12399 LIBS="$ac_save_LIBS"
12400
12401 fi
12402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12403   echo "$ac_t""yes" 1>&6
12404   have_thr=yes
12405 else
12406   echo "$ac_t""no" 1>&6
12407 have_thr=no
12408 fi
12409
12410
12411                 if test $have_thr = yes ; then
12412                         cat >> confdefs.h <<\EOF
12413 #define HAVE_THR 1
12414 EOF
12415
12416                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12417                         ol_link_threads=thr
12418
12419                         if test $ol_with_yielding_select = auto ; then
12420                                 ol_with_yielding_select=yes
12421                         fi
12422
12423                                                 for ac_func in \
12424                                 thr_setconcurrency \
12425                                 thr_getconcurrency \
12426                         
12427 do
12428 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12429 echo "configure:12430: checking for $ac_func" >&5
12430 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12431   echo $ac_n "(cached) $ac_c" 1>&6
12432 else
12433   cat > conftest.$ac_ext <<EOF
12434 #line 12435 "configure"
12435 #include "confdefs.h"
12436 /* System header to define __stub macros and hopefully few prototypes,
12437     which can conflict with char $ac_func(); below.  */
12438 #include <assert.h>
12439 /* Override any gcc2 internal prototype to avoid an error.  */
12440 /* We use char because int might match the return type of a gcc2
12441     builtin and then its argument prototype would still apply.  */
12442 char $ac_func();
12443 char (*f)();
12444
12445 int main() {
12446
12447 /* The GNU C library defines this for functions which it implements
12448     to always fail with ENOSYS.  Some functions are actually named
12449     something starting with __ and the normal name is an alias.  */
12450 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12451 choke me
12452 #else
12453 f = $ac_func;
12454 #endif
12455
12456 ; return 0; }
12457 EOF
12458 if { (eval echo configure:12459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12459   rm -rf conftest*
12460   eval "ac_cv_func_$ac_func=yes"
12461 else
12462   echo "configure: failed program was:" >&5
12463   cat conftest.$ac_ext >&5
12464   rm -rf conftest*
12465   eval "ac_cv_func_$ac_func=no"
12466 fi
12467 rm -f conftest*
12468 fi
12469
12470 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12471   echo "$ac_t""yes" 1>&6
12472     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12473   cat >> confdefs.h <<EOF
12474 #define $ac_tr_func 1
12475 EOF
12476  
12477 else
12478   echo "$ac_t""no" 1>&6
12479 fi
12480 done
12481
12482                 fi
12483         fi
12484
12485                 for ac_hdr in lwp/lwp.h
12486 do
12487 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12488 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12489 echo "configure:12490: checking for $ac_hdr" >&5
12490 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12491   echo $ac_n "(cached) $ac_c" 1>&6
12492 else
12493   cat > conftest.$ac_ext <<EOF
12494 #line 12495 "configure"
12495 #include "confdefs.h"
12496 #include <$ac_hdr>
12497 EOF
12498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12499 { (eval echo configure:12500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12501 if test -z "$ac_err"; then
12502   rm -rf conftest*
12503   eval "ac_cv_header_$ac_safe=yes"
12504 else
12505   echo "$ac_err" >&5
12506   echo "configure: failed program was:" >&5
12507   cat conftest.$ac_ext >&5
12508   rm -rf conftest*
12509   eval "ac_cv_header_$ac_safe=no"
12510 fi
12511 rm -f conftest*
12512 fi
12513 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12514   echo "$ac_t""yes" 1>&6
12515     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12516   cat >> confdefs.h <<EOF
12517 #define $ac_tr_hdr 1
12518 EOF
12519  
12520 else
12521   echo "$ac_t""no" 1>&6
12522 fi
12523 done
12524
12525         if test $ac_cv_header_lwp_lwp_h = yes ; then
12526                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12527 echo "configure:12528: checking for lwp_create in -llwp" >&5
12528 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12529 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12530   echo $ac_n "(cached) $ac_c" 1>&6
12531 else
12532   ac_save_LIBS="$LIBS"
12533 LIBS="-llwp  $LIBS"
12534 cat > conftest.$ac_ext <<EOF
12535 #line 12536 "configure"
12536 #include "confdefs.h"
12537 /* Override any gcc2 internal prototype to avoid an error.  */
12538 /* We use char because int might match the return type of a gcc2
12539     builtin and then its argument prototype would still apply.  */
12540 char lwp_create();
12541
12542 int main() {
12543 lwp_create()
12544 ; return 0; }
12545 EOF
12546 if { (eval echo configure:12547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12547   rm -rf conftest*
12548   eval "ac_cv_lib_$ac_lib_var=yes"
12549 else
12550   echo "configure: failed program was:" >&5
12551   cat conftest.$ac_ext >&5
12552   rm -rf conftest*
12553   eval "ac_cv_lib_$ac_lib_var=no"
12554 fi
12555 rm -f conftest*
12556 LIBS="$ac_save_LIBS"
12557
12558 fi
12559 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12560   echo "$ac_t""yes" 1>&6
12561   have_lwp=yes
12562 else
12563   echo "$ac_t""no" 1>&6
12564 have_lwp=no
12565 fi
12566
12567
12568                 if test $have_lwp = yes ; then
12569                         cat >> confdefs.h <<\EOF
12570 #define HAVE_LWP 1
12571 EOF
12572
12573                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12574                         ol_link_threads=lwp
12575
12576                         if test $ol_with_yielding_select = auto ; then
12577                                 ol_with_yielding_select=no
12578                         fi
12579                 fi
12580         fi
12581 fi
12582
12583 if test $ol_with_yielding_select = yes ; then
12584         cat >> confdefs.h <<\EOF
12585 #define HAVE_YIELDING_SELECT 1
12586 EOF
12587
12588 fi
12589
12590 if test $ol_with_threads = manual ; then
12591                 ol_link_threads=yes
12592
12593         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12594
12595         for ac_hdr in pthread.h sched.h
12596 do
12597 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12598 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12599 echo "configure:12600: checking for $ac_hdr" >&5
12600 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12601   echo $ac_n "(cached) $ac_c" 1>&6
12602 else
12603   cat > conftest.$ac_ext <<EOF
12604 #line 12605 "configure"
12605 #include "confdefs.h"
12606 #include <$ac_hdr>
12607 EOF
12608 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12609 { (eval echo configure:12610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12610 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12611 if test -z "$ac_err"; then
12612   rm -rf conftest*
12613   eval "ac_cv_header_$ac_safe=yes"
12614 else
12615   echo "$ac_err" >&5
12616   echo "configure: failed program was:" >&5
12617   cat conftest.$ac_ext >&5
12618   rm -rf conftest*
12619   eval "ac_cv_header_$ac_safe=no"
12620 fi
12621 rm -f conftest*
12622 fi
12623 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12624   echo "$ac_t""yes" 1>&6
12625     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12626   cat >> confdefs.h <<EOF
12627 #define $ac_tr_hdr 1
12628 EOF
12629  
12630 else
12631   echo "$ac_t""no" 1>&6
12632 fi
12633 done
12634
12635         for ac_func in sched_yield pthread_yield
12636 do
12637 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12638 echo "configure:12639: checking for $ac_func" >&5
12639 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12640   echo $ac_n "(cached) $ac_c" 1>&6
12641 else
12642   cat > conftest.$ac_ext <<EOF
12643 #line 12644 "configure"
12644 #include "confdefs.h"
12645 /* System header to define __stub macros and hopefully few prototypes,
12646     which can conflict with char $ac_func(); below.  */
12647 #include <assert.h>
12648 /* Override any gcc2 internal prototype to avoid an error.  */
12649 /* We use char because int might match the return type of a gcc2
12650     builtin and then its argument prototype would still apply.  */
12651 char $ac_func();
12652 char (*f)();
12653
12654 int main() {
12655
12656 /* The GNU C library defines this for functions which it implements
12657     to always fail with ENOSYS.  Some functions are actually named
12658     something starting with __ and the normal name is an alias.  */
12659 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12660 choke me
12661 #else
12662 f = $ac_func;
12663 #endif
12664
12665 ; return 0; }
12666 EOF
12667 if { (eval echo configure:12668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12668   rm -rf conftest*
12669   eval "ac_cv_func_$ac_func=yes"
12670 else
12671   echo "configure: failed program was:" >&5
12672   cat conftest.$ac_ext >&5
12673   rm -rf conftest*
12674   eval "ac_cv_func_$ac_func=no"
12675 fi
12676 rm -f conftest*
12677 fi
12678
12679 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12680   echo "$ac_t""yes" 1>&6
12681     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12682   cat >> confdefs.h <<EOF
12683 #define $ac_tr_func 1
12684 EOF
12685  
12686 else
12687   echo "$ac_t""no" 1>&6
12688 fi
12689 done
12690
12691         
12692         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12693 echo "configure:12694: checking for LinuxThreads pthread.h" >&5
12694 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12695   echo $ac_n "(cached) $ac_c" 1>&6
12696 else
12697   cat > conftest.$ac_ext <<EOF
12698 #line 12699 "configure"
12699 #include "confdefs.h"
12700 #include <pthread.h>
12701 EOF
12702 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12703   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12704   rm -rf conftest*
12705   ol_cv_header_linux_threads=yes
12706 else
12707   rm -rf conftest*
12708   ol_cv_header_linux_threads=no
12709 fi
12710 rm -f conftest*
12711
12712                 
12713 fi
12714
12715 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12716         if test $ol_cv_header_linux_threads = yes; then
12717                 cat >> confdefs.h <<\EOF
12718 #define HAVE_LINUX_THREADS 1
12719 EOF
12720
12721         fi
12722
12723
12724         for ac_hdr in mach/cthreads.h
12725 do
12726 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12727 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12728 echo "configure:12729: checking for $ac_hdr" >&5
12729 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12730   echo $ac_n "(cached) $ac_c" 1>&6
12731 else
12732   cat > conftest.$ac_ext <<EOF
12733 #line 12734 "configure"
12734 #include "confdefs.h"
12735 #include <$ac_hdr>
12736 EOF
12737 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12738 { (eval echo configure:12739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12739 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12740 if test -z "$ac_err"; then
12741   rm -rf conftest*
12742   eval "ac_cv_header_$ac_safe=yes"
12743 else
12744   echo "$ac_err" >&5
12745   echo "configure: failed program was:" >&5
12746   cat conftest.$ac_ext >&5
12747   rm -rf conftest*
12748   eval "ac_cv_header_$ac_safe=no"
12749 fi
12750 rm -f conftest*
12751 fi
12752 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12753   echo "$ac_t""yes" 1>&6
12754     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12755   cat >> confdefs.h <<EOF
12756 #define $ac_tr_hdr 1
12757 EOF
12758  
12759 else
12760   echo "$ac_t""no" 1>&6
12761 fi
12762 done
12763
12764         for ac_hdr in lwp/lwp.h
12765 do
12766 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12767 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12768 echo "configure:12769: checking for $ac_hdr" >&5
12769 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12770   echo $ac_n "(cached) $ac_c" 1>&6
12771 else
12772   cat > conftest.$ac_ext <<EOF
12773 #line 12774 "configure"
12774 #include "confdefs.h"
12775 #include <$ac_hdr>
12776 EOF
12777 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12778 { (eval echo configure:12779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12779 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12780 if test -z "$ac_err"; then
12781   rm -rf conftest*
12782   eval "ac_cv_header_$ac_safe=yes"
12783 else
12784   echo "$ac_err" >&5
12785   echo "configure: failed program was:" >&5
12786   cat conftest.$ac_ext >&5
12787   rm -rf conftest*
12788   eval "ac_cv_header_$ac_safe=no"
12789 fi
12790 rm -f conftest*
12791 fi
12792 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12793   echo "$ac_t""yes" 1>&6
12794     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12795   cat >> confdefs.h <<EOF
12796 #define $ac_tr_hdr 1
12797 EOF
12798  
12799 else
12800   echo "$ac_t""no" 1>&6
12801 fi
12802 done
12803
12804         for ac_hdr in thread.h synch.h
12805 do
12806 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12807 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12808 echo "configure:12809: checking for $ac_hdr" >&5
12809 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12810   echo $ac_n "(cached) $ac_c" 1>&6
12811 else
12812   cat > conftest.$ac_ext <<EOF
12813 #line 12814 "configure"
12814 #include "confdefs.h"
12815 #include <$ac_hdr>
12816 EOF
12817 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12818 { (eval echo configure:12819: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12819 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12820 if test -z "$ac_err"; then
12821   rm -rf conftest*
12822   eval "ac_cv_header_$ac_safe=yes"
12823 else
12824   echo "$ac_err" >&5
12825   echo "configure: failed program was:" >&5
12826   cat conftest.$ac_ext >&5
12827   rm -rf conftest*
12828   eval "ac_cv_header_$ac_safe=no"
12829 fi
12830 rm -f conftest*
12831 fi
12832 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12833   echo "$ac_t""yes" 1>&6
12834     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12835   cat >> confdefs.h <<EOF
12836 #define $ac_tr_hdr 1
12837 EOF
12838  
12839 else
12840   echo "$ac_t""no" 1>&6
12841 fi
12842 done
12843
12844 fi
12845
12846 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12847                         cat >> confdefs.h <<\EOF
12848 #define REENTRANT 1
12849 EOF
12850
12851         cat >> confdefs.h <<\EOF
12852 #define _REENTRANT 1
12853 EOF
12854
12855         cat >> confdefs.h <<\EOF
12856 #define THREAD_SAFE 1
12857 EOF
12858
12859         cat >> confdefs.h <<\EOF
12860 #define _THREAD_SAFE 1
12861 EOF
12862
12863         cat >> confdefs.h <<\EOF
12864 #define THREADSAFE 1
12865 EOF
12866
12867         cat >> confdefs.h <<\EOF
12868 #define _THREADSAFE 1
12869 EOF
12870
12871         cat >> confdefs.h <<\EOF
12872 #define _SGI_MP_SOURCE 1
12873 EOF
12874
12875
12876                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12877 echo "configure:12878: checking for thread specific errno" >&5
12878 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12879   echo $ac_n "(cached) $ac_c" 1>&6
12880 else
12881   
12882                 cat > conftest.$ac_ext <<EOF
12883 #line 12884 "configure"
12884 #include "confdefs.h"
12885 #include <errno.h>
12886 int main() {
12887 errno = 0;
12888 ; return 0; }
12889 EOF
12890 if { (eval echo configure:12891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12891   rm -rf conftest*
12892   ol_cv_errno_thread_specific=yes
12893 else
12894   echo "configure: failed program was:" >&5
12895   cat conftest.$ac_ext >&5
12896   rm -rf conftest*
12897   ol_cv_errno_thread_specific=no
12898 fi
12899 rm -f conftest*
12900         
12901 fi
12902
12903 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12904
12905                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12906 echo "configure:12907: checking for thread specific h_errno" >&5
12907 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12908   echo $ac_n "(cached) $ac_c" 1>&6
12909 else
12910   
12911                 cat > conftest.$ac_ext <<EOF
12912 #line 12913 "configure"
12913 #include "confdefs.h"
12914 #include <netdb.h>
12915 int main() {
12916 h_errno = 0;
12917 ; return 0; }
12918 EOF
12919 if { (eval echo configure:12920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12920   rm -rf conftest*
12921   ol_cv_h_errno_thread_specific=yes
12922 else
12923   echo "configure: failed program was:" >&5
12924   cat conftest.$ac_ext >&5
12925   rm -rf conftest*
12926   ol_cv_h_errno_thread_specific=no
12927 fi
12928 rm -f conftest*
12929         
12930 fi
12931
12932 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12933
12934         if test $ol_cv_errno_thread_specific != yes \
12935                 -o $ol_cv_h_errno_thread_specific != yes ; then
12936                 LIBS="$LTHREAD_LIBS $LIBS"
12937                 LTHREAD_LIBS=""
12938         fi
12939
12940 fi  
12941
12942 if test $ol_link_threads = no ; then
12943         if test $ol_with_threads = yes ; then
12944                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12945         fi
12946
12947         if test $ol_with_threads = auto ; then
12948                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12949                 ol_with_threads=no
12950         fi
12951
12952         cat >> confdefs.h <<\EOF
12953 #define NO_THREADS 1
12954 EOF
12955
12956         LTHREAD_LIBS=""
12957 fi
12958
12959 if test $ol_link_threads != no ; then
12960         cat >> confdefs.h <<\EOF
12961 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12962 EOF
12963
12964 fi
12965
12966 ol_link_ldbm=no 
12967
12968 if test $ol_with_ldbm_api = auto \
12969         -o $ol_with_ldbm_api = berkeley \
12970         -o $ol_with_ldbm_api = bcompat ; then
12971
12972         if test $ol_with_ldbm_api = bcompat; then \
12973                 ol_cv_berkeley_db=no
12974 for ac_hdr in db_185.h db.h
12975 do
12976 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12977 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12978 echo "configure:12979: checking for $ac_hdr" >&5
12979 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12980   echo $ac_n "(cached) $ac_c" 1>&6
12981 else
12982   cat > conftest.$ac_ext <<EOF
12983 #line 12984 "configure"
12984 #include "confdefs.h"
12985 #include <$ac_hdr>
12986 EOF
12987 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12988 { (eval echo configure:12989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12989 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12990 if test -z "$ac_err"; then
12991   rm -rf conftest*
12992   eval "ac_cv_header_$ac_safe=yes"
12993 else
12994   echo "$ac_err" >&5
12995   echo "configure: failed program was:" >&5
12996   cat conftest.$ac_ext >&5
12997   rm -rf conftest*
12998   eval "ac_cv_header_$ac_safe=no"
12999 fi
13000 rm -f conftest*
13001 fi
13002 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13003   echo "$ac_t""yes" 1>&6
13004     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13005   cat >> confdefs.h <<EOF
13006 #define $ac_tr_hdr 1
13007 EOF
13008  
13009 else
13010   echo "$ac_t""no" 1>&6
13011 fi
13012 done
13013
13014 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
13015         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
13016 echo "configure:13017: checking if Berkeley DB header compatibility" >&5
13017 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
13018   echo $ac_n "(cached) $ac_c" 1>&6
13019 else
13020   
13021                 cat > conftest.$ac_ext <<EOF
13022 #line 13023 "configure"
13023 #include "confdefs.h"
13024
13025 #if HAVE_DB_185_H
13026 #       include <db_185.h>
13027 #else
13028 #       include <db.h>
13029 #endif
13030
13031  /* this check could be improved */
13032 #ifndef DB_VERSION_MAJOR
13033 #       define DB_VERSION_MAJOR 1
13034 #endif
13035
13036 #if DB_VERSION_MAJOR == 1 
13037         __db_version_1
13038 #endif
13039
13040 EOF
13041 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13042   egrep "__db_version_1" >/dev/null 2>&1; then
13043   rm -rf conftest*
13044   ol_cv_header_db1=yes
13045 else
13046   rm -rf conftest*
13047   ol_cv_header_db1=no
13048 fi
13049 rm -f conftest*
13050
13051 fi
13052
13053 echo "$ac_t""$ol_cv_header_db1" 1>&6
13054
13055         if test $ol_cv_header_db1 = yes ; then
13056                 ol_cv_lib_db=no
13057 if test $ol_cv_lib_db = no ; then
13058         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13059 echo "configure:13060: checking for Berkeley DB link (default)" >&5
13060 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13061   echo $ac_n "(cached) $ac_c" 1>&6
13062 else
13063   
13064         ol_DB_LIB=
13065         ol_LIBS=$LIBS
13066         LIBS="$ol_DB_LIB $LIBS"
13067
13068         cat > conftest.$ac_ext <<EOF
13069 #line 13070 "configure"
13070 #include "confdefs.h"
13071
13072 #ifdef HAVE_DB_185_H
13073 # include <db_185.h>
13074 #else
13075 # include <db.h>
13076 #endif
13077
13078 #ifndef DB_VERSION_MAJOR
13079 # define DB_VERSION_MAJOR 1
13080 #endif
13081
13082 #ifndef NULL
13083 #define NULL ((void*)0)
13084 #endif
13085
13086 int main() {
13087
13088 #if DB_VERSION_MAJOR > 1
13089         {
13090                 char *version;
13091                 int major, minor, patch;
13092
13093                 version = db_version( &major, &minor, &patch );
13094
13095                 if( major != DB_VERSION_MAJOR ||
13096                         minor < DB_VERSION_MINOR )
13097                 {
13098                         printf("Berkeley DB version mismatch\n"
13099                                 "\texpected: %s\n\tgot: %s\n",
13100                                 DB_VERSION_STRING, version);
13101                         return 1;
13102                 }
13103         }
13104 #endif
13105
13106 #if DB_VERSION_MAJOR > 2
13107         db_env_create( NULL, 0 );
13108 #elif DB_VERSION_MAJOR > 1
13109         db_appexit( NULL );
13110 #else
13111         (void) dbopen( NULL, 0, 0, 0, NULL);
13112 #endif
13113
13114 ; return 0; }
13115 EOF
13116 if { (eval echo configure:13117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13117   rm -rf conftest*
13118   ol_cv_db_none=yes
13119 else
13120   echo "configure: failed program was:" >&5
13121   cat conftest.$ac_ext >&5
13122   rm -rf conftest*
13123   ol_cv_db_none=no
13124 fi
13125 rm -f conftest*
13126
13127         LIBS="$ol_LIBS"
13128
13129 fi
13130
13131 echo "$ac_t""$ol_cv_db_none" 1>&6
13132
13133         if test $ol_cv_db_none = yes ; then
13134                 ol_cv_lib_db=yes
13135         fi
13136 fi
13137
13138 if test $ol_cv_lib_db = no ; then
13139         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13140 echo "configure:13141: checking for Berkeley DB link (-ldb)" >&5
13141 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13142   echo $ac_n "(cached) $ac_c" 1>&6
13143 else
13144   
13145         ol_DB_LIB=-ldb
13146         ol_LIBS=$LIBS
13147         LIBS="$ol_DB_LIB $LIBS"
13148
13149         cat > conftest.$ac_ext <<EOF
13150 #line 13151 "configure"
13151 #include "confdefs.h"
13152
13153 #ifdef HAVE_DB_185_H
13154 # include <db_185.h>
13155 #else
13156 # include <db.h>
13157 #endif
13158
13159 #ifndef DB_VERSION_MAJOR
13160 # define DB_VERSION_MAJOR 1
13161 #endif
13162
13163 #ifndef NULL
13164 #define NULL ((void*)0)
13165 #endif
13166
13167 int main() {
13168
13169 #if DB_VERSION_MAJOR > 1
13170         {
13171                 char *version;
13172                 int major, minor, patch;
13173
13174                 version = db_version( &major, &minor, &patch );
13175
13176                 if( major != DB_VERSION_MAJOR ||
13177                         minor < DB_VERSION_MINOR )
13178                 {
13179                         printf("Berkeley DB version mismatch\n"
13180                                 "\texpected: %s\n\tgot: %s\n",
13181                                 DB_VERSION_STRING, version);
13182                         return 1;
13183                 }
13184         }
13185 #endif
13186
13187 #if DB_VERSION_MAJOR > 2
13188         db_env_create( NULL, 0 );
13189 #elif DB_VERSION_MAJOR > 1
13190         db_appexit( NULL );
13191 #else
13192         (void) dbopen( NULL, 0, 0, 0, NULL);
13193 #endif
13194
13195 ; return 0; }
13196 EOF
13197 if { (eval echo configure:13198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13198   rm -rf conftest*
13199   ol_cv_db_db=yes
13200 else
13201   echo "configure: failed program was:" >&5
13202   cat conftest.$ac_ext >&5
13203   rm -rf conftest*
13204   ol_cv_db_db=no
13205 fi
13206 rm -f conftest*
13207
13208         LIBS="$ol_LIBS"
13209
13210 fi
13211
13212 echo "$ac_t""$ol_cv_db_db" 1>&6
13213
13214         if test $ol_cv_db_db = yes ; then
13215                 ol_cv_lib_db=-ldb
13216         fi
13217 fi
13218
13219 if test $ol_cv_lib_db = no ; then
13220         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13221 echo "configure:13222: checking for Berkeley DB link (-ldb3)" >&5
13222 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13223   echo $ac_n "(cached) $ac_c" 1>&6
13224 else
13225   
13226         ol_DB_LIB=-ldb3
13227         ol_LIBS=$LIBS
13228         LIBS="$ol_DB_LIB $LIBS"
13229
13230         cat > conftest.$ac_ext <<EOF
13231 #line 13232 "configure"
13232 #include "confdefs.h"
13233
13234 #ifdef HAVE_DB_185_H
13235 # include <db_185.h>
13236 #else
13237 # include <db.h>
13238 #endif
13239
13240 #ifndef DB_VERSION_MAJOR
13241 # define DB_VERSION_MAJOR 1
13242 #endif
13243
13244 #ifndef NULL
13245 #define NULL ((void*)0)
13246 #endif
13247
13248 int main() {
13249
13250 #if DB_VERSION_MAJOR > 1
13251         {
13252                 char *version;
13253                 int major, minor, patch;
13254
13255                 version = db_version( &major, &minor, &patch );
13256
13257                 if( major != DB_VERSION_MAJOR ||
13258                         minor < DB_VERSION_MINOR )
13259                 {
13260                         printf("Berkeley DB version mismatch\n"
13261                                 "\texpected: %s\n\tgot: %s\n",
13262                                 DB_VERSION_STRING, version);
13263                         return 1;
13264                 }
13265         }
13266 #endif
13267
13268 #if DB_VERSION_MAJOR > 2
13269         db_env_create( NULL, 0 );
13270 #elif DB_VERSION_MAJOR > 1
13271         db_appexit( NULL );
13272 #else
13273         (void) dbopen( NULL, 0, 0, 0, NULL);
13274 #endif
13275
13276 ; return 0; }
13277 EOF
13278 if { (eval echo configure:13279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13279   rm -rf conftest*
13280   ol_cv_db_db3=yes
13281 else
13282   echo "configure: failed program was:" >&5
13283   cat conftest.$ac_ext >&5
13284   rm -rf conftest*
13285   ol_cv_db_db3=no
13286 fi
13287 rm -f conftest*
13288
13289         LIBS="$ol_LIBS"
13290
13291 fi
13292
13293 echo "$ac_t""$ol_cv_db_db3" 1>&6
13294
13295         if test $ol_cv_db_db3 = yes ; then
13296                 ol_cv_lib_db=-ldb3
13297         fi
13298 fi
13299
13300 if test $ol_cv_lib_db = no ; then
13301         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13302 echo "configure:13303: checking for Berkeley DB link (-ldb2)" >&5
13303 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13304   echo $ac_n "(cached) $ac_c" 1>&6
13305 else
13306   
13307         ol_DB_LIB=-ldb2
13308         ol_LIBS=$LIBS
13309         LIBS="$ol_DB_LIB $LIBS"
13310
13311         cat > conftest.$ac_ext <<EOF
13312 #line 13313 "configure"
13313 #include "confdefs.h"
13314
13315 #ifdef HAVE_DB_185_H
13316 # include <db_185.h>
13317 #else
13318 # include <db.h>
13319 #endif
13320
13321 #ifndef DB_VERSION_MAJOR
13322 # define DB_VERSION_MAJOR 1
13323 #endif
13324
13325 #ifndef NULL
13326 #define NULL ((void*)0)
13327 #endif
13328
13329 int main() {
13330
13331 #if DB_VERSION_MAJOR > 1
13332         {
13333                 char *version;
13334                 int major, minor, patch;
13335
13336                 version = db_version( &major, &minor, &patch );
13337
13338                 if( major != DB_VERSION_MAJOR ||
13339                         minor < DB_VERSION_MINOR )
13340                 {
13341                         printf("Berkeley DB version mismatch\n"
13342                                 "\texpected: %s\n\tgot: %s\n",
13343                                 DB_VERSION_STRING, version);
13344                         return 1;
13345                 }
13346         }
13347 #endif
13348
13349 #if DB_VERSION_MAJOR > 2
13350         db_env_create( NULL, 0 );
13351 #elif DB_VERSION_MAJOR > 1
13352         db_appexit( NULL );
13353 #else
13354         (void) dbopen( NULL, 0, 0, 0, NULL);
13355 #endif
13356
13357 ; return 0; }
13358 EOF
13359 if { (eval echo configure:13360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13360   rm -rf conftest*
13361   ol_cv_db_db2=yes
13362 else
13363   echo "configure: failed program was:" >&5
13364   cat conftest.$ac_ext >&5
13365   rm -rf conftest*
13366   ol_cv_db_db2=no
13367 fi
13368 rm -f conftest*
13369
13370         LIBS="$ol_LIBS"
13371
13372 fi
13373
13374 echo "$ac_t""$ol_cv_db_db2" 1>&6
13375
13376         if test $ol_cv_db_db2 = yes ; then
13377                 ol_cv_lib_db=-ldb2
13378         fi
13379 fi
13380
13381 if test $ol_cv_lib_db = no ; then
13382         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13383 echo "configure:13384: checking for Berkeley DB link (-ldb1)" >&5
13384 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13385   echo $ac_n "(cached) $ac_c" 1>&6
13386 else
13387   
13388         ol_DB_LIB=-ldb1
13389         ol_LIBS=$LIBS
13390         LIBS="$ol_DB_LIB $LIBS"
13391
13392         cat > conftest.$ac_ext <<EOF
13393 #line 13394 "configure"
13394 #include "confdefs.h"
13395
13396 #ifdef HAVE_DB_185_H
13397 # include <db_185.h>
13398 #else
13399 # include <db.h>
13400 #endif
13401
13402 #ifndef DB_VERSION_MAJOR
13403 # define DB_VERSION_MAJOR 1
13404 #endif
13405
13406 #ifndef NULL
13407 #define NULL ((void*)0)
13408 #endif
13409
13410 int main() {
13411
13412 #if DB_VERSION_MAJOR > 1
13413         {
13414                 char *version;
13415                 int major, minor, patch;
13416
13417                 version = db_version( &major, &minor, &patch );
13418
13419                 if( major != DB_VERSION_MAJOR ||
13420                         minor < DB_VERSION_MINOR )
13421                 {
13422                         printf("Berkeley DB version mismatch\n"
13423                                 "\texpected: %s\n\tgot: %s\n",
13424                                 DB_VERSION_STRING, version);
13425                         return 1;
13426                 }
13427         }
13428 #endif
13429
13430 #if DB_VERSION_MAJOR > 2
13431         db_env_create( NULL, 0 );
13432 #elif DB_VERSION_MAJOR > 1
13433         db_appexit( NULL );
13434 #else
13435         (void) dbopen( NULL, 0, 0, 0, NULL);
13436 #endif
13437
13438 ; return 0; }
13439 EOF
13440 if { (eval echo configure:13441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13441   rm -rf conftest*
13442   ol_cv_db_db1=yes
13443 else
13444   echo "configure: failed program was:" >&5
13445   cat conftest.$ac_ext >&5
13446   rm -rf conftest*
13447   ol_cv_db_db1=no
13448 fi
13449 rm -f conftest*
13450
13451         LIBS="$ol_LIBS"
13452
13453 fi
13454
13455 echo "$ac_t""$ol_cv_db_db1" 1>&6
13456
13457         if test $ol_cv_db_db1 = yes ; then
13458                 ol_cv_lib_db=-ldb1
13459         fi
13460 fi
13461
13462
13463                 if test "$ol_cv_lib_db" != no ; then
13464                         ol_cv_berkeley_db=yes
13465                 fi
13466         fi
13467 fi
13468
13469         else
13470                 ol_cv_berkeley_db=no
13471 for ac_hdr in db.h
13472 do
13473 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13474 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13475 echo "configure:13476: checking for $ac_hdr" >&5
13476 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13477   echo $ac_n "(cached) $ac_c" 1>&6
13478 else
13479   cat > conftest.$ac_ext <<EOF
13480 #line 13481 "configure"
13481 #include "confdefs.h"
13482 #include <$ac_hdr>
13483 EOF
13484 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13485 { (eval echo configure:13486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13486 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13487 if test -z "$ac_err"; then
13488   rm -rf conftest*
13489   eval "ac_cv_header_$ac_safe=yes"
13490 else
13491   echo "$ac_err" >&5
13492   echo "configure: failed program was:" >&5
13493   cat conftest.$ac_ext >&5
13494   rm -rf conftest*
13495   eval "ac_cv_header_$ac_safe=no"
13496 fi
13497 rm -f conftest*
13498 fi
13499 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13500   echo "$ac_t""yes" 1>&6
13501     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13502   cat >> confdefs.h <<EOF
13503 #define $ac_tr_hdr 1
13504 EOF
13505  
13506 else
13507   echo "$ac_t""no" 1>&6
13508 fi
13509 done
13510
13511 if test $ac_cv_header_db_h = yes; then
13512         ol_cv_lib_db=no
13513 if test $ol_cv_lib_db = no ; then
13514         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13515 echo "configure:13516: checking for Berkeley DB link (default)" >&5
13516 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13517   echo $ac_n "(cached) $ac_c" 1>&6
13518 else
13519   
13520         ol_DB_LIB=
13521         ol_LIBS=$LIBS
13522         LIBS="$ol_DB_LIB $LIBS"
13523
13524         cat > conftest.$ac_ext <<EOF
13525 #line 13526 "configure"
13526 #include "confdefs.h"
13527
13528 #ifdef HAVE_DB_185_H
13529 # include <db_185.h>
13530 #else
13531 # include <db.h>
13532 #endif
13533
13534 #ifndef DB_VERSION_MAJOR
13535 # define DB_VERSION_MAJOR 1
13536 #endif
13537
13538 #ifndef NULL
13539 #define NULL ((void*)0)
13540 #endif
13541
13542 int main() {
13543
13544 #if DB_VERSION_MAJOR > 1
13545         {
13546                 char *version;
13547                 int major, minor, patch;
13548
13549                 version = db_version( &major, &minor, &patch );
13550
13551                 if( major != DB_VERSION_MAJOR ||
13552                         minor < DB_VERSION_MINOR )
13553                 {
13554                         printf("Berkeley DB version mismatch\n"
13555                                 "\texpected: %s\n\tgot: %s\n",
13556                                 DB_VERSION_STRING, version);
13557                         return 1;
13558                 }
13559         }
13560 #endif
13561
13562 #if DB_VERSION_MAJOR > 2
13563         db_env_create( NULL, 0 );
13564 #elif DB_VERSION_MAJOR > 1
13565         db_appexit( NULL );
13566 #else
13567         (void) dbopen( NULL, 0, 0, 0, NULL);
13568 #endif
13569
13570 ; return 0; }
13571 EOF
13572 if { (eval echo configure:13573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13573   rm -rf conftest*
13574   ol_cv_db_none=yes
13575 else
13576   echo "configure: failed program was:" >&5
13577   cat conftest.$ac_ext >&5
13578   rm -rf conftest*
13579   ol_cv_db_none=no
13580 fi
13581 rm -f conftest*
13582
13583         LIBS="$ol_LIBS"
13584
13585 fi
13586
13587 echo "$ac_t""$ol_cv_db_none" 1>&6
13588
13589         if test $ol_cv_db_none = yes ; then
13590                 ol_cv_lib_db=yes
13591         fi
13592 fi
13593
13594 if test $ol_cv_lib_db = no ; then
13595         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13596 echo "configure:13597: checking for Berkeley DB link (-ldb)" >&5
13597 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13598   echo $ac_n "(cached) $ac_c" 1>&6
13599 else
13600   
13601         ol_DB_LIB=-ldb
13602         ol_LIBS=$LIBS
13603         LIBS="$ol_DB_LIB $LIBS"
13604
13605         cat > conftest.$ac_ext <<EOF
13606 #line 13607 "configure"
13607 #include "confdefs.h"
13608
13609 #ifdef HAVE_DB_185_H
13610 # include <db_185.h>
13611 #else
13612 # include <db.h>
13613 #endif
13614
13615 #ifndef DB_VERSION_MAJOR
13616 # define DB_VERSION_MAJOR 1
13617 #endif
13618
13619 #ifndef NULL
13620 #define NULL ((void*)0)
13621 #endif
13622
13623 int main() {
13624
13625 #if DB_VERSION_MAJOR > 1
13626         {
13627                 char *version;
13628                 int major, minor, patch;
13629
13630                 version = db_version( &major, &minor, &patch );
13631
13632                 if( major != DB_VERSION_MAJOR ||
13633                         minor < DB_VERSION_MINOR )
13634                 {
13635                         printf("Berkeley DB version mismatch\n"
13636                                 "\texpected: %s\n\tgot: %s\n",
13637                                 DB_VERSION_STRING, version);
13638                         return 1;
13639                 }
13640         }
13641 #endif
13642
13643 #if DB_VERSION_MAJOR > 2
13644         db_env_create( NULL, 0 );
13645 #elif DB_VERSION_MAJOR > 1
13646         db_appexit( NULL );
13647 #else
13648         (void) dbopen( NULL, 0, 0, 0, NULL);
13649 #endif
13650
13651 ; return 0; }
13652 EOF
13653 if { (eval echo configure:13654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13654   rm -rf conftest*
13655   ol_cv_db_db=yes
13656 else
13657   echo "configure: failed program was:" >&5
13658   cat conftest.$ac_ext >&5
13659   rm -rf conftest*
13660   ol_cv_db_db=no
13661 fi
13662 rm -f conftest*
13663
13664         LIBS="$ol_LIBS"
13665
13666 fi
13667
13668 echo "$ac_t""$ol_cv_db_db" 1>&6
13669
13670         if test $ol_cv_db_db = yes ; then
13671                 ol_cv_lib_db=-ldb
13672         fi
13673 fi
13674
13675 if test $ol_cv_lib_db = no ; then
13676         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13677 echo "configure:13678: checking for Berkeley DB link (-ldb3)" >&5
13678 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13679   echo $ac_n "(cached) $ac_c" 1>&6
13680 else
13681   
13682         ol_DB_LIB=-ldb3
13683         ol_LIBS=$LIBS
13684         LIBS="$ol_DB_LIB $LIBS"
13685
13686         cat > conftest.$ac_ext <<EOF
13687 #line 13688 "configure"
13688 #include "confdefs.h"
13689
13690 #ifdef HAVE_DB_185_H
13691 # include <db_185.h>
13692 #else
13693 # include <db.h>
13694 #endif
13695
13696 #ifndef DB_VERSION_MAJOR
13697 # define DB_VERSION_MAJOR 1
13698 #endif
13699
13700 #ifndef NULL
13701 #define NULL ((void*)0)
13702 #endif
13703
13704 int main() {
13705
13706 #if DB_VERSION_MAJOR > 1
13707         {
13708                 char *version;
13709                 int major, minor, patch;
13710
13711                 version = db_version( &major, &minor, &patch );
13712
13713                 if( major != DB_VERSION_MAJOR ||
13714                         minor < DB_VERSION_MINOR )
13715                 {
13716                         printf("Berkeley DB version mismatch\n"
13717                                 "\texpected: %s\n\tgot: %s\n",
13718                                 DB_VERSION_STRING, version);
13719                         return 1;
13720                 }
13721         }
13722 #endif
13723
13724 #if DB_VERSION_MAJOR > 2
13725         db_env_create( NULL, 0 );
13726 #elif DB_VERSION_MAJOR > 1
13727         db_appexit( NULL );
13728 #else
13729         (void) dbopen( NULL, 0, 0, 0, NULL);
13730 #endif
13731
13732 ; return 0; }
13733 EOF
13734 if { (eval echo configure:13735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13735   rm -rf conftest*
13736   ol_cv_db_db3=yes
13737 else
13738   echo "configure: failed program was:" >&5
13739   cat conftest.$ac_ext >&5
13740   rm -rf conftest*
13741   ol_cv_db_db3=no
13742 fi
13743 rm -f conftest*
13744
13745         LIBS="$ol_LIBS"
13746
13747 fi
13748
13749 echo "$ac_t""$ol_cv_db_db3" 1>&6
13750
13751         if test $ol_cv_db_db3 = yes ; then
13752                 ol_cv_lib_db=-ldb3
13753         fi
13754 fi
13755
13756 if test $ol_cv_lib_db = no ; then
13757         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13758 echo "configure:13759: checking for Berkeley DB link (-ldb2)" >&5
13759 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13760   echo $ac_n "(cached) $ac_c" 1>&6
13761 else
13762   
13763         ol_DB_LIB=-ldb2
13764         ol_LIBS=$LIBS
13765         LIBS="$ol_DB_LIB $LIBS"
13766
13767         cat > conftest.$ac_ext <<EOF
13768 #line 13769 "configure"
13769 #include "confdefs.h"
13770
13771 #ifdef HAVE_DB_185_H
13772 # include <db_185.h>
13773 #else
13774 # include <db.h>
13775 #endif
13776
13777 #ifndef DB_VERSION_MAJOR
13778 # define DB_VERSION_MAJOR 1
13779 #endif
13780
13781 #ifndef NULL
13782 #define NULL ((void*)0)
13783 #endif
13784
13785 int main() {
13786
13787 #if DB_VERSION_MAJOR > 1
13788         {
13789                 char *version;
13790                 int major, minor, patch;
13791
13792                 version = db_version( &major, &minor, &patch );
13793
13794                 if( major != DB_VERSION_MAJOR ||
13795                         minor < DB_VERSION_MINOR )
13796                 {
13797                         printf("Berkeley DB version mismatch\n"
13798                                 "\texpected: %s\n\tgot: %s\n",
13799                                 DB_VERSION_STRING, version);
13800                         return 1;
13801                 }
13802         }
13803 #endif
13804
13805 #if DB_VERSION_MAJOR > 2
13806         db_env_create( NULL, 0 );
13807 #elif DB_VERSION_MAJOR > 1
13808         db_appexit( NULL );
13809 #else
13810         (void) dbopen( NULL, 0, 0, 0, NULL);
13811 #endif
13812
13813 ; return 0; }
13814 EOF
13815 if { (eval echo configure:13816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13816   rm -rf conftest*
13817   ol_cv_db_db2=yes
13818 else
13819   echo "configure: failed program was:" >&5
13820   cat conftest.$ac_ext >&5
13821   rm -rf conftest*
13822   ol_cv_db_db2=no
13823 fi
13824 rm -f conftest*
13825
13826         LIBS="$ol_LIBS"
13827
13828 fi
13829
13830 echo "$ac_t""$ol_cv_db_db2" 1>&6
13831
13832         if test $ol_cv_db_db2 = yes ; then
13833                 ol_cv_lib_db=-ldb2
13834         fi
13835 fi
13836
13837 if test $ol_cv_lib_db = no ; then
13838         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13839 echo "configure:13840: checking for Berkeley DB link (-ldb1)" >&5
13840 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13841   echo $ac_n "(cached) $ac_c" 1>&6
13842 else
13843   
13844         ol_DB_LIB=-ldb1
13845         ol_LIBS=$LIBS
13846         LIBS="$ol_DB_LIB $LIBS"
13847
13848         cat > conftest.$ac_ext <<EOF
13849 #line 13850 "configure"
13850 #include "confdefs.h"
13851
13852 #ifdef HAVE_DB_185_H
13853 # include <db_185.h>
13854 #else
13855 # include <db.h>
13856 #endif
13857
13858 #ifndef DB_VERSION_MAJOR
13859 # define DB_VERSION_MAJOR 1
13860 #endif
13861
13862 #ifndef NULL
13863 #define NULL ((void*)0)
13864 #endif
13865
13866 int main() {
13867
13868 #if DB_VERSION_MAJOR > 1
13869         {
13870                 char *version;
13871                 int major, minor, patch;
13872
13873                 version = db_version( &major, &minor, &patch );
13874
13875                 if( major != DB_VERSION_MAJOR ||
13876                         minor < DB_VERSION_MINOR )
13877                 {
13878                         printf("Berkeley DB version mismatch\n"
13879                                 "\texpected: %s\n\tgot: %s\n",
13880                                 DB_VERSION_STRING, version);
13881                         return 1;
13882                 }
13883         }
13884 #endif
13885
13886 #if DB_VERSION_MAJOR > 2
13887         db_env_create( NULL, 0 );
13888 #elif DB_VERSION_MAJOR > 1
13889         db_appexit( NULL );
13890 #else
13891         (void) dbopen( NULL, 0, 0, 0, NULL);
13892 #endif
13893
13894 ; return 0; }
13895 EOF
13896 if { (eval echo configure:13897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13897   rm -rf conftest*
13898   ol_cv_db_db1=yes
13899 else
13900   echo "configure: failed program was:" >&5
13901   cat conftest.$ac_ext >&5
13902   rm -rf conftest*
13903   ol_cv_db_db1=no
13904 fi
13905 rm -f conftest*
13906
13907         LIBS="$ol_LIBS"
13908
13909 fi
13910
13911 echo "$ac_t""$ol_cv_db_db1" 1>&6
13912
13913         if test $ol_cv_db_db1 = yes ; then
13914                 ol_cv_lib_db=-ldb1
13915         fi
13916 fi
13917
13918
13919         if test "$ol_cv_lib_db" != no ; then
13920                 ol_cv_berkeley_db=yes
13921                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13922 echo "configure:13923: checking for Berkeley DB thread support" >&5
13923 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13924   echo $ac_n "(cached) $ac_c" 1>&6
13925 else
13926   
13927         ol_LIBS="$LIBS"
13928         if test $ol_cv_lib_db != yes ; then
13929                 LIBS="$ol_cv_lib_db"
13930         fi
13931
13932         if test "$cross_compiling" = yes; then
13933   ol_cv_berkeley_db_thread=cross
13934 else
13935   cat > conftest.$ac_ext <<EOF
13936 #line 13937 "configure"
13937 #include "confdefs.h"
13938
13939 #ifdef HAVE_DB_185_H
13940         choke me;
13941 #else
13942 #include <db.h>
13943 #endif
13944 #ifndef NULL
13945 #define NULL ((void *)0)
13946 #endif
13947 main()
13948 {
13949         int rc;
13950         u_int32_t flags = DB_CREATE |
13951 #ifdef DB_PRIVATE
13952                 DB_PRIVATE |
13953 #endif
13954                 DB_THREAD;
13955
13956 #if DB_VERSION_MAJOR > 2
13957         DB_ENV *env = NULL;
13958
13959         rc = db_env_create( &env, 0 );
13960
13961         flags |= DB_INIT_MPOOL;
13962 #ifdef DB_MPOOL_PRIVATE
13963         flags |= DB_MPOOL_PRIVATE;
13964 #endif
13965
13966         if( rc ) {
13967                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13968                 return rc;
13969         }
13970
13971 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13972         rc = env->open( env, NULL, flags, 0 );
13973 #else
13974         rc = env->open( env, NULL, NULL, flags, 0 );
13975 #endif
13976
13977         if ( rc == 0 ) {
13978                 rc = env->close( env, 0 );
13979         }
13980
13981         if( rc ) {
13982                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13983                 return rc;
13984         }
13985
13986 #else
13987         DB_ENV env;
13988         memset( &env, '\0', sizeof(env) );
13989
13990         rc = db_appinit( NULL, NULL, &env, flags );
13991
13992         if( rc == 0 ) {
13993                 db_appexit( &env );
13994         }
13995
13996         unlink("__db_mpool.share");
13997         unlink("__db_lock.share");
13998 #endif
13999
14000         return rc;
14001 }
14002 EOF
14003 if { (eval echo configure:14004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14004 then
14005   ol_cv_berkeley_db_thread=yes
14006 else
14007   echo "configure: failed program was:" >&5
14008   cat conftest.$ac_ext >&5
14009   rm -fr conftest*
14010   ol_cv_berkeley_db_thread=no
14011 fi
14012 rm -fr conftest*
14013 fi
14014
14015
14016         LIBS="$ol_LIBS"
14017
14018         if test $ol_cv_berkeley_db_thread != no ; then
14019                 cat >> confdefs.h <<\EOF
14020 #define HAVE_BERKELEY_DB_THREAD 1
14021 EOF
14022
14023         fi
14024
14025 fi
14026
14027 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
14028         fi
14029 fi
14030
14031         fi
14032
14033         if test $ol_cv_berkeley_db != no ; then
14034                 cat >> confdefs.h <<\EOF
14035 #define HAVE_BERKELEY_DB 1
14036 EOF
14037
14038
14039                 ol_link_ldbm=berkeley
14040                 ol_with_ldbm_api=berkeley
14041
14042                 if test $ol_with_ldbm_type = hash ; then
14043                         cat >> confdefs.h <<\EOF
14044 #define LDBM_USE_DBHASH 1
14045 EOF
14046
14047                 else
14048                         cat >> confdefs.h <<\EOF
14049 #define LDBM_USE_DBBTREE 1
14050 EOF
14051
14052                 fi
14053
14054                                                 if test $ol_cv_lib_db != yes ; then
14055                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
14056                 fi
14057         fi
14058 fi
14059
14060 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
14061         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
14062 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
14063         ol_enable_bdb=yes
14064 fi
14065
14066 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
14067         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
14068         ol_with_ldbm_api=none
14069 fi
14070
14071 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
14072         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
14073 echo "configure:14074: checking for MDBM library" >&5
14074 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
14075   echo $ac_n "(cached) $ac_c" 1>&6
14076 else
14077         ol_LIBS="$LIBS"
14078         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
14079 echo "configure:14080: checking for mdbm_set_chain" >&5
14080 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
14081   echo $ac_n "(cached) $ac_c" 1>&6
14082 else
14083   cat > conftest.$ac_ext <<EOF
14084 #line 14085 "configure"
14085 #include "confdefs.h"
14086 /* System header to define __stub macros and hopefully few prototypes,
14087     which can conflict with char mdbm_set_chain(); below.  */
14088 #include <assert.h>
14089 /* Override any gcc2 internal prototype to avoid an error.  */
14090 /* We use char because int might match the return type of a gcc2
14091     builtin and then its argument prototype would still apply.  */
14092 char mdbm_set_chain();
14093 char (*f)();
14094
14095 int main() {
14096
14097 /* The GNU C library defines this for functions which it implements
14098     to always fail with ENOSYS.  Some functions are actually named
14099     something starting with __ and the normal name is an alias.  */
14100 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
14101 choke me
14102 #else
14103 f = mdbm_set_chain;
14104 #endif
14105
14106 ; return 0; }
14107 EOF
14108 if { (eval echo configure:14109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14109   rm -rf conftest*
14110   eval "ac_cv_func_mdbm_set_chain=yes"
14111 else
14112   echo "configure: failed program was:" >&5
14113   cat conftest.$ac_ext >&5
14114   rm -rf conftest*
14115   eval "ac_cv_func_mdbm_set_chain=no"
14116 fi
14117 rm -f conftest*
14118 fi
14119
14120 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
14121   echo "$ac_t""yes" 1>&6
14122   ol_cv_lib_mdbm=yes
14123 else
14124   echo "$ac_t""no" 1>&6
14125
14126                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
14127 echo "configure:14128: checking for mdbm_set_chain in -lmdbm" >&5
14128 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
14129 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14130   echo $ac_n "(cached) $ac_c" 1>&6
14131 else
14132   ac_save_LIBS="$LIBS"
14133 LIBS="-lmdbm  $LIBS"
14134 cat > conftest.$ac_ext <<EOF
14135 #line 14136 "configure"
14136 #include "confdefs.h"
14137 /* Override any gcc2 internal prototype to avoid an error.  */
14138 /* We use char because int might match the return type of a gcc2
14139     builtin and then its argument prototype would still apply.  */
14140 char mdbm_set_chain();
14141
14142 int main() {
14143 mdbm_set_chain()
14144 ; return 0; }
14145 EOF
14146 if { (eval echo configure:14147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14147   rm -rf conftest*
14148   eval "ac_cv_lib_$ac_lib_var=yes"
14149 else
14150   echo "configure: failed program was:" >&5
14151   cat conftest.$ac_ext >&5
14152   rm -rf conftest*
14153   eval "ac_cv_lib_$ac_lib_var=no"
14154 fi
14155 rm -f conftest*
14156 LIBS="$ac_save_LIBS"
14157
14158 fi
14159 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14160   echo "$ac_t""yes" 1>&6
14161   ol_cv_lib_mdbm=-lmdbm
14162 else
14163   echo "$ac_t""no" 1>&6
14164 ol_cv_lib_mdbm=no
14165 fi
14166
14167         
14168 fi
14169
14170         LIBS="$ol_LIBS"
14171
14172 fi
14173
14174 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14175
14176
14177  for ac_hdr in mdbm.h
14178 do
14179 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14180 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14181 echo "configure:14182: checking for $ac_hdr" >&5
14182 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14183   echo $ac_n "(cached) $ac_c" 1>&6
14184 else
14185   cat > conftest.$ac_ext <<EOF
14186 #line 14187 "configure"
14187 #include "confdefs.h"
14188 #include <$ac_hdr>
14189 EOF
14190 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14191 { (eval echo configure:14192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14192 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14193 if test -z "$ac_err"; then
14194   rm -rf conftest*
14195   eval "ac_cv_header_$ac_safe=yes"
14196 else
14197   echo "$ac_err" >&5
14198   echo "configure: failed program was:" >&5
14199   cat conftest.$ac_ext >&5
14200   rm -rf conftest*
14201   eval "ac_cv_header_$ac_safe=no"
14202 fi
14203 rm -f conftest*
14204 fi
14205 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14206   echo "$ac_t""yes" 1>&6
14207     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14208   cat >> confdefs.h <<EOF
14209 #define $ac_tr_hdr 1
14210 EOF
14211  
14212 else
14213   echo "$ac_t""no" 1>&6
14214 fi
14215 done
14216
14217  echo $ac_n "checking for db""... $ac_c" 1>&6
14218 echo "configure:14219: checking for db" >&5
14219 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14220   echo $ac_n "(cached) $ac_c" 1>&6
14221 else
14222   
14223         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14224                 ol_cv_mdbm=no
14225         else
14226                 ol_cv_mdbm=yes
14227         fi
14228
14229 fi
14230
14231 echo "$ac_t""$ol_cv_mdbm" 1>&6
14232  if test $ol_cv_mdbm = yes ; then
14233         cat >> confdefs.h <<\EOF
14234 #define HAVE_MDBM 1
14235 EOF
14236
14237  fi
14238
14239
14240         if test $ol_cv_mdbm = yes ; then
14241                 ol_link_ldbm=mdbm
14242                 ol_with_ldbm_api=mdbm
14243                 if test $ol_cv_lib_mdbm != yes ; then
14244                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14245                 fi
14246         fi
14247 fi
14248
14249 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14250         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14251 echo "configure:14252: checking for GDBM library" >&5
14252 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14253   echo $ac_n "(cached) $ac_c" 1>&6
14254 else
14255         ol_LIBS="$LIBS"
14256         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14257 echo "configure:14258: checking for gdbm_open" >&5
14258 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14259   echo $ac_n "(cached) $ac_c" 1>&6
14260 else
14261   cat > conftest.$ac_ext <<EOF
14262 #line 14263 "configure"
14263 #include "confdefs.h"
14264 /* System header to define __stub macros and hopefully few prototypes,
14265     which can conflict with char gdbm_open(); below.  */
14266 #include <assert.h>
14267 /* Override any gcc2 internal prototype to avoid an error.  */
14268 /* We use char because int might match the return type of a gcc2
14269     builtin and then its argument prototype would still apply.  */
14270 char gdbm_open();
14271 char (*f)();
14272
14273 int main() {
14274
14275 /* The GNU C library defines this for functions which it implements
14276     to always fail with ENOSYS.  Some functions are actually named
14277     something starting with __ and the normal name is an alias.  */
14278 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14279 choke me
14280 #else
14281 f = gdbm_open;
14282 #endif
14283
14284 ; return 0; }
14285 EOF
14286 if { (eval echo configure:14287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14287   rm -rf conftest*
14288   eval "ac_cv_func_gdbm_open=yes"
14289 else
14290   echo "configure: failed program was:" >&5
14291   cat conftest.$ac_ext >&5
14292   rm -rf conftest*
14293   eval "ac_cv_func_gdbm_open=no"
14294 fi
14295 rm -f conftest*
14296 fi
14297
14298 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14299   echo "$ac_t""yes" 1>&6
14300   ol_cv_lib_gdbm=yes
14301 else
14302   echo "$ac_t""no" 1>&6
14303
14304                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14305 echo "configure:14306: checking for gdbm_open in -lgdbm" >&5
14306 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14307 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14308   echo $ac_n "(cached) $ac_c" 1>&6
14309 else
14310   ac_save_LIBS="$LIBS"
14311 LIBS="-lgdbm  $LIBS"
14312 cat > conftest.$ac_ext <<EOF
14313 #line 14314 "configure"
14314 #include "confdefs.h"
14315 /* Override any gcc2 internal prototype to avoid an error.  */
14316 /* We use char because int might match the return type of a gcc2
14317     builtin and then its argument prototype would still apply.  */
14318 char gdbm_open();
14319
14320 int main() {
14321 gdbm_open()
14322 ; return 0; }
14323 EOF
14324 if { (eval echo configure:14325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14325   rm -rf conftest*
14326   eval "ac_cv_lib_$ac_lib_var=yes"
14327 else
14328   echo "configure: failed program was:" >&5
14329   cat conftest.$ac_ext >&5
14330   rm -rf conftest*
14331   eval "ac_cv_lib_$ac_lib_var=no"
14332 fi
14333 rm -f conftest*
14334 LIBS="$ac_save_LIBS"
14335
14336 fi
14337 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14338   echo "$ac_t""yes" 1>&6
14339   ol_cv_lib_gdbm=-lgdbm
14340 else
14341   echo "$ac_t""no" 1>&6
14342 ol_cv_lib_gdbm=no
14343 fi
14344
14345         
14346 fi
14347
14348         LIBS="$ol_LIBS"
14349
14350 fi
14351
14352 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14353
14354
14355  for ac_hdr in gdbm.h
14356 do
14357 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14358 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14359 echo "configure:14360: checking for $ac_hdr" >&5
14360 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14361   echo $ac_n "(cached) $ac_c" 1>&6
14362 else
14363   cat > conftest.$ac_ext <<EOF
14364 #line 14365 "configure"
14365 #include "confdefs.h"
14366 #include <$ac_hdr>
14367 EOF
14368 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14369 { (eval echo configure:14370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14370 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14371 if test -z "$ac_err"; then
14372   rm -rf conftest*
14373   eval "ac_cv_header_$ac_safe=yes"
14374 else
14375   echo "$ac_err" >&5
14376   echo "configure: failed program was:" >&5
14377   cat conftest.$ac_ext >&5
14378   rm -rf conftest*
14379   eval "ac_cv_header_$ac_safe=no"
14380 fi
14381 rm -f conftest*
14382 fi
14383 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14384   echo "$ac_t""yes" 1>&6
14385     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14386   cat >> confdefs.h <<EOF
14387 #define $ac_tr_hdr 1
14388 EOF
14389  
14390 else
14391   echo "$ac_t""no" 1>&6
14392 fi
14393 done
14394
14395  echo $ac_n "checking for db""... $ac_c" 1>&6
14396 echo "configure:14397: checking for db" >&5
14397 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14398   echo $ac_n "(cached) $ac_c" 1>&6
14399 else
14400   
14401         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14402                 ol_cv_gdbm=no
14403         else
14404                 ol_cv_gdbm=yes
14405         fi
14406
14407 fi
14408
14409 echo "$ac_t""$ol_cv_gdbm" 1>&6
14410  if test $ol_cv_gdbm = yes ; then
14411         cat >> confdefs.h <<\EOF
14412 #define HAVE_GDBM 1
14413 EOF
14414
14415  fi
14416
14417
14418         if test $ol_cv_gdbm = yes ; then
14419                 ol_link_ldbm=gdbm
14420                 ol_with_ldbm_api=gdbm
14421
14422                 if test $ol_cv_lib_gdbm != yes ; then
14423                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14424                 fi
14425         fi
14426 fi
14427
14428 if test $ol_with_ldbm_api = ndbm ; then
14429         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14430 echo "configure:14431: checking for NDBM library" >&5
14431 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14432   echo $ac_n "(cached) $ac_c" 1>&6
14433 else
14434         ol_LIBS="$LIBS"
14435         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14436 echo "configure:14437: checking for dbm_open" >&5
14437 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14438   echo $ac_n "(cached) $ac_c" 1>&6
14439 else
14440   cat > conftest.$ac_ext <<EOF
14441 #line 14442 "configure"
14442 #include "confdefs.h"
14443 /* System header to define __stub macros and hopefully few prototypes,
14444     which can conflict with char dbm_open(); below.  */
14445 #include <assert.h>
14446 /* Override any gcc2 internal prototype to avoid an error.  */
14447 /* We use char because int might match the return type of a gcc2
14448     builtin and then its argument prototype would still apply.  */
14449 char dbm_open();
14450 char (*f)();
14451
14452 int main() {
14453
14454 /* The GNU C library defines this for functions which it implements
14455     to always fail with ENOSYS.  Some functions are actually named
14456     something starting with __ and the normal name is an alias.  */
14457 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14458 choke me
14459 #else
14460 f = dbm_open;
14461 #endif
14462
14463 ; return 0; }
14464 EOF
14465 if { (eval echo configure:14466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14466   rm -rf conftest*
14467   eval "ac_cv_func_dbm_open=yes"
14468 else
14469   echo "configure: failed program was:" >&5
14470   cat conftest.$ac_ext >&5
14471   rm -rf conftest*
14472   eval "ac_cv_func_dbm_open=no"
14473 fi
14474 rm -f conftest*
14475 fi
14476
14477 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14478   echo "$ac_t""yes" 1>&6
14479   ol_cv_lib_ndbm=yes
14480 else
14481   echo "$ac_t""no" 1>&6
14482
14483                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14484 echo "configure:14485: checking for dbm_open in -lndbm" >&5
14485 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14486 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14487   echo $ac_n "(cached) $ac_c" 1>&6
14488 else
14489   ac_save_LIBS="$LIBS"
14490 LIBS="-lndbm  $LIBS"
14491 cat > conftest.$ac_ext <<EOF
14492 #line 14493 "configure"
14493 #include "confdefs.h"
14494 /* Override any gcc2 internal prototype to avoid an error.  */
14495 /* We use char because int might match the return type of a gcc2
14496     builtin and then its argument prototype would still apply.  */
14497 char dbm_open();
14498
14499 int main() {
14500 dbm_open()
14501 ; return 0; }
14502 EOF
14503 if { (eval echo configure:14504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14504   rm -rf conftest*
14505   eval "ac_cv_lib_$ac_lib_var=yes"
14506 else
14507   echo "configure: failed program was:" >&5
14508   cat conftest.$ac_ext >&5
14509   rm -rf conftest*
14510   eval "ac_cv_lib_$ac_lib_var=no"
14511 fi
14512 rm -f conftest*
14513 LIBS="$ac_save_LIBS"
14514
14515 fi
14516 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14517   echo "$ac_t""yes" 1>&6
14518   ol_cv_lib_ndbm=-lndbm
14519 else
14520   echo "$ac_t""no" 1>&6
14521
14522                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14523 echo "configure:14524: checking for dbm_open in -ldbm" >&5
14524 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14525 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14526   echo $ac_n "(cached) $ac_c" 1>&6
14527 else
14528   ac_save_LIBS="$LIBS"
14529 LIBS="-ldbm  $LIBS"
14530 cat > conftest.$ac_ext <<EOF
14531 #line 14532 "configure"
14532 #include "confdefs.h"
14533 /* Override any gcc2 internal prototype to avoid an error.  */
14534 /* We use char because int might match the return type of a gcc2
14535     builtin and then its argument prototype would still apply.  */
14536 char dbm_open();
14537
14538 int main() {
14539 dbm_open()
14540 ; return 0; }
14541 EOF
14542 if { (eval echo configure:14543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14543   rm -rf conftest*
14544   eval "ac_cv_lib_$ac_lib_var=yes"
14545 else
14546   echo "configure: failed program was:" >&5
14547   cat conftest.$ac_ext >&5
14548   rm -rf conftest*
14549   eval "ac_cv_lib_$ac_lib_var=no"
14550 fi
14551 rm -f conftest*
14552 LIBS="$ac_save_LIBS"
14553
14554 fi
14555 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14556   echo "$ac_t""yes" 1>&6
14557   ol_cv_lib_ndbm=-ldbm
14558 else
14559   echo "$ac_t""no" 1>&6
14560 ol_cv_lib_ndbm=no
14561 fi
14562                 
14563 fi
14564
14565         
14566 fi
14567
14568         LIBS="$ol_LIBS"
14569
14570 fi
14571
14572 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14573
14574
14575  for ac_hdr in ndbm.h
14576 do
14577 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14578 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14579 echo "configure:14580: checking for $ac_hdr" >&5
14580 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14581   echo $ac_n "(cached) $ac_c" 1>&6
14582 else
14583   cat > conftest.$ac_ext <<EOF
14584 #line 14585 "configure"
14585 #include "confdefs.h"
14586 #include <$ac_hdr>
14587 EOF
14588 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14589 { (eval echo configure:14590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14590 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14591 if test -z "$ac_err"; then
14592   rm -rf conftest*
14593   eval "ac_cv_header_$ac_safe=yes"
14594 else
14595   echo "$ac_err" >&5
14596   echo "configure: failed program was:" >&5
14597   cat conftest.$ac_ext >&5
14598   rm -rf conftest*
14599   eval "ac_cv_header_$ac_safe=no"
14600 fi
14601 rm -f conftest*
14602 fi
14603 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14604   echo "$ac_t""yes" 1>&6
14605     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14606   cat >> confdefs.h <<EOF
14607 #define $ac_tr_hdr 1
14608 EOF
14609  
14610 else
14611   echo "$ac_t""no" 1>&6
14612 fi
14613 done
14614
14615  echo $ac_n "checking for db""... $ac_c" 1>&6
14616 echo "configure:14617: checking for db" >&5
14617 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14618   echo $ac_n "(cached) $ac_c" 1>&6
14619 else
14620   
14621         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14622                 ol_cv_ndbm=no
14623         else
14624                 ol_cv_ndbm=yes
14625         fi
14626
14627 fi
14628
14629 echo "$ac_t""$ol_cv_ndbm" 1>&6
14630  if test $ol_cv_ndbm = yes ; then
14631         cat >> confdefs.h <<\EOF
14632 #define HAVE_NDBM 1
14633 EOF
14634
14635  fi
14636
14637
14638         if test $ol_cv_ndbm = yes ; then
14639                 ol_link_ldbm=ndbm
14640                 ol_with_ldbm_api=ndbm
14641
14642                 if test $ol_cv_lib_ndbm != yes ; then
14643                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14644                 fi
14645         fi
14646 fi
14647
14648 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14649         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14650         if test $ol_enable_ldbm = yes ; then
14651                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14652         fi
14653
14654         echo "configure: warning: disabling LDBM" 1>&2
14655         ol_enable_ldbm=no
14656 fi
14657
14658 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14659         BUILD_LIBS_DYNAMIC=shared
14660         cat >> confdefs.h <<\EOF
14661 #define LDAP_LIBS_DYNAMIC 1
14662 EOF
14663
14664 else
14665         BUILD_LIBS_DYNAMIC=static
14666 fi
14667
14668 if test $ol_enable_wrappers != no ; then
14669         for ac_hdr in tcpd.h
14670 do
14671 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14672 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14673 echo "configure:14674: checking for $ac_hdr" >&5
14674 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14675   echo $ac_n "(cached) $ac_c" 1>&6
14676 else
14677   cat > conftest.$ac_ext <<EOF
14678 #line 14679 "configure"
14679 #include "confdefs.h"
14680 #include <$ac_hdr>
14681 EOF
14682 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14683 { (eval echo configure:14684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14684 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14685 if test -z "$ac_err"; then
14686   rm -rf conftest*
14687   eval "ac_cv_header_$ac_safe=yes"
14688 else
14689   echo "$ac_err" >&5
14690   echo "configure: failed program was:" >&5
14691   cat conftest.$ac_ext >&5
14692   rm -rf conftest*
14693   eval "ac_cv_header_$ac_safe=no"
14694 fi
14695 rm -f conftest*
14696 fi
14697 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14698   echo "$ac_t""yes" 1>&6
14699     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14700   cat >> confdefs.h <<EOF
14701 #define $ac_tr_hdr 1
14702 EOF
14703  
14704 else
14705   echo "$ac_t""no" 1>&6
14706 fi
14707 done
14708
14709
14710         if test $ac_cv_header_tcpd_h != yes ; then
14711                 have_wrappers=no
14712         else
14713                 cat > conftest.$ac_ext <<EOF
14714 #line 14715 "configure"
14715 #include "confdefs.h"
14716
14717 int allow_severity = 0;
14718 int deny_severity  = 0;
14719                 
14720 int main() {
14721 hosts_access()
14722 ; return 0; }
14723 EOF
14724 if { (eval echo configure:14725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14725   rm -rf conftest*
14726   have_wrappers=yes
14727 else
14728   echo "configure: failed program was:" >&5
14729   cat conftest.$ac_ext >&5
14730   rm -rf conftest*
14731   have_wrappers=no
14732 fi
14733 rm -f conftest*
14734         fi
14735
14736         if test $have_wrappers = yes ; then
14737                 cat >> confdefs.h <<\EOF
14738 #define HAVE_TCPD 1
14739 EOF
14740
14741                 WRAP_LIBS="-lwrap"
14742
14743                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14744 echo "configure:14745: checking for main in -lnsl" >&5
14745 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14746 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14747   echo $ac_n "(cached) $ac_c" 1>&6
14748 else
14749   ac_save_LIBS="$LIBS"
14750 LIBS="-lnsl  $LIBS"
14751 cat > conftest.$ac_ext <<EOF
14752 #line 14753 "configure"
14753 #include "confdefs.h"
14754
14755 int main() {
14756 main()
14757 ; return 0; }
14758 EOF
14759 if { (eval echo configure:14760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14760   rm -rf conftest*
14761   eval "ac_cv_lib_$ac_lib_var=yes"
14762 else
14763   echo "configure: failed program was:" >&5
14764   cat conftest.$ac_ext >&5
14765   rm -rf conftest*
14766   eval "ac_cv_lib_$ac_lib_var=no"
14767 fi
14768 rm -f conftest*
14769 LIBS="$ac_save_LIBS"
14770
14771 fi
14772 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14773   echo "$ac_t""yes" 1>&6
14774     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14775     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14776   cat >> confdefs.h <<EOF
14777 #define $ac_tr_lib 1
14778 EOF
14779
14780   LIBS="-lnsl $LIBS"
14781
14782 else
14783   echo "$ac_t""no" 1>&6
14784 fi
14785
14786         else
14787                 echo "configure: warning: could not find -lwrap" 1>&2
14788                 if test $ol_enable_wrappers = yes ; then
14789                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14790                 fi
14791
14792                 echo "configure: warning: disabling wrappers support" 1>&2
14793                 ol_enable_wrappers=no
14794                 WRAP_LIBS=""
14795         fi
14796 fi
14797
14798 if test $ol_enable_syslog != no ; then
14799         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14800 echo "configure:14801: checking for openlog" >&5
14801 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14802   echo $ac_n "(cached) $ac_c" 1>&6
14803 else
14804   cat > conftest.$ac_ext <<EOF
14805 #line 14806 "configure"
14806 #include "confdefs.h"
14807 /* System header to define __stub macros and hopefully few prototypes,
14808     which can conflict with char openlog(); below.  */
14809 #include <assert.h>
14810 /* Override any gcc2 internal prototype to avoid an error.  */
14811 /* We use char because int might match the return type of a gcc2
14812     builtin and then its argument prototype would still apply.  */
14813 char openlog();
14814 char (*f)();
14815
14816 int main() {
14817
14818 /* The GNU C library defines this for functions which it implements
14819     to always fail with ENOSYS.  Some functions are actually named
14820     something starting with __ and the normal name is an alias.  */
14821 #if defined (__stub_openlog) || defined (__stub___openlog)
14822 choke me
14823 #else
14824 f = openlog;
14825 #endif
14826
14827 ; return 0; }
14828 EOF
14829 if { (eval echo configure:14830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14830   rm -rf conftest*
14831   eval "ac_cv_func_openlog=yes"
14832 else
14833   echo "configure: failed program was:" >&5
14834   cat conftest.$ac_ext >&5
14835   rm -rf conftest*
14836   eval "ac_cv_func_openlog=no"
14837 fi
14838 rm -f conftest*
14839 fi
14840
14841 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14842   echo "$ac_t""yes" 1>&6
14843   :
14844 else
14845   echo "$ac_t""no" 1>&6
14846 fi
14847
14848         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14849                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14850         fi
14851         ol_enable_syslog=$ac_cv_func_openlog
14852 fi
14853
14854
14855 ol_link_sql=no
14856 if test $ol_enable_sql != no ; then
14857         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14858 echo "configure:14859: checking for SQLDriverConnect in -liodbc" >&5
14859 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14860 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14861   echo $ac_n "(cached) $ac_c" 1>&6
14862 else
14863   ac_save_LIBS="$LIBS"
14864 LIBS="-liodbc  $LIBS"
14865 cat > conftest.$ac_ext <<EOF
14866 #line 14867 "configure"
14867 #include "confdefs.h"
14868 /* Override any gcc2 internal prototype to avoid an error.  */
14869 /* We use char because int might match the return type of a gcc2
14870     builtin and then its argument prototype would still apply.  */
14871 char SQLDriverConnect();
14872
14873 int main() {
14874 SQLDriverConnect()
14875 ; return 0; }
14876 EOF
14877 if { (eval echo configure:14878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14878   rm -rf conftest*
14879   eval "ac_cv_lib_$ac_lib_var=yes"
14880 else
14881   echo "configure: failed program was:" >&5
14882   cat conftest.$ac_ext >&5
14883   rm -rf conftest*
14884   eval "ac_cv_lib_$ac_lib_var=no"
14885 fi
14886 rm -f conftest*
14887 LIBS="$ac_save_LIBS"
14888
14889 fi
14890 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14891   echo "$ac_t""yes" 1>&6
14892   have_iodbc=yes
14893 else
14894   echo "$ac_t""no" 1>&6
14895 have_iodbc=no
14896 fi
14897
14898         if test $have_iodbc = yes ; then
14899                 ol_link_sql="-liodbc"
14900         else
14901                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14902 echo "configure:14903: checking for SQLDriverConnect in -lodbc" >&5
14903 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14904 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14905   echo $ac_n "(cached) $ac_c" 1>&6
14906 else
14907   ac_save_LIBS="$LIBS"
14908 LIBS="-lodbc  $LIBS"
14909 cat > conftest.$ac_ext <<EOF
14910 #line 14911 "configure"
14911 #include "confdefs.h"
14912 /* Override any gcc2 internal prototype to avoid an error.  */
14913 /* We use char because int might match the return type of a gcc2
14914     builtin and then its argument prototype would still apply.  */
14915 char SQLDriverConnect();
14916
14917 int main() {
14918 SQLDriverConnect()
14919 ; return 0; }
14920 EOF
14921 if { (eval echo configure:14922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14922   rm -rf conftest*
14923   eval "ac_cv_lib_$ac_lib_var=yes"
14924 else
14925   echo "configure: failed program was:" >&5
14926   cat conftest.$ac_ext >&5
14927   rm -rf conftest*
14928   eval "ac_cv_lib_$ac_lib_var=no"
14929 fi
14930 rm -f conftest*
14931 LIBS="$ac_save_LIBS"
14932
14933 fi
14934 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14935   echo "$ac_t""yes" 1>&6
14936   have_odbc=yes
14937 else
14938   echo "$ac_t""no" 1>&6
14939 have_odbc=no
14940 fi
14941
14942                 if test $have_odbc = yes ; then
14943                         ol_link_sql="-lodbc"
14944                 fi
14945         fi
14946
14947         if test $ol_link_sql != no ; then
14948                 SLAPD_SQL_LIBS="$ol_link_sql"
14949
14950         elif test $ol_enable_sql != auto ; then
14951                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14952         fi
14953 fi
14954
14955 if test $ol_enable_tcl != no ; then
14956         for ac_hdr in tcl.h
14957 do
14958 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14959 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14960 echo "configure:14961: checking for $ac_hdr" >&5
14961 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14962   echo $ac_n "(cached) $ac_c" 1>&6
14963 else
14964   cat > conftest.$ac_ext <<EOF
14965 #line 14966 "configure"
14966 #include "confdefs.h"
14967 #include <$ac_hdr>
14968 EOF
14969 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14970 { (eval echo configure:14971: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14971 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14972 if test -z "$ac_err"; then
14973   rm -rf conftest*
14974   eval "ac_cv_header_$ac_safe=yes"
14975 else
14976   echo "$ac_err" >&5
14977   echo "configure: failed program was:" >&5
14978   cat conftest.$ac_ext >&5
14979   rm -rf conftest*
14980   eval "ac_cv_header_$ac_safe=no"
14981 fi
14982 rm -f conftest*
14983 fi
14984 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14985   echo "$ac_t""yes" 1>&6
14986     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14987   cat >> confdefs.h <<EOF
14988 #define $ac_tr_hdr 1
14989 EOF
14990  
14991 else
14992   echo "$ac_t""no" 1>&6
14993 fi
14994 done
14995
14996
14997         if test $ac_cv_header_tcl_h != yes ; then
14998                 have_tcl=no
14999         else
15000                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
15001                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
15002 echo "configure:15003: checking for main in -l$lib" >&5
15003 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
15004 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15005   echo $ac_n "(cached) $ac_c" 1>&6
15006 else
15007   ac_save_LIBS="$LIBS"
15008 LIBS="-l$lib  $LIBS"
15009 cat > conftest.$ac_ext <<EOF
15010 #line 15011 "configure"
15011 #include "confdefs.h"
15012
15013 int main() {
15014 main()
15015 ; return 0; }
15016 EOF
15017 if { (eval echo configure:15018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15018   rm -rf conftest*
15019   eval "ac_cv_lib_$ac_lib_var=yes"
15020 else
15021   echo "configure: failed program was:" >&5
15022   cat conftest.$ac_ext >&5
15023   rm -rf conftest*
15024   eval "ac_cv_lib_$ac_lib_var=no"
15025 fi
15026 rm -f conftest*
15027 LIBS="$ac_save_LIBS"
15028
15029 fi
15030 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15031   echo "$ac_t""yes" 1>&6
15032   have_tcl=yes
15033                            if test x"$ol_with_tcl_module" = "xstatic" ; then
15034                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
15035                            else
15036                                MOD_TCL_LIB="-l${lib}"
15037                            fi;break
15038 else
15039   echo "$ac_t""no" 1>&6
15040 have_tcl=no
15041 fi
15042
15043                 done
15044         fi
15045
15046         if test $have_tcl != yes ; then
15047                 echo "configure: warning: could not find -ltcl" 1>&2
15048                 if test $ol_enable_tcl = yes ; then
15049                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
15050                 fi
15051
15052                 ol_enable_tcl=no
15053         fi
15054 fi
15055
15056 ol_link_termcap=no
15057 for ac_hdr in termcap.h ncurses.h
15058 do
15059 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15060 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15061 echo "configure:15062: checking for $ac_hdr" >&5
15062 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15063   echo $ac_n "(cached) $ac_c" 1>&6
15064 else
15065   cat > conftest.$ac_ext <<EOF
15066 #line 15067 "configure"
15067 #include "confdefs.h"
15068 #include <$ac_hdr>
15069 EOF
15070 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15071 { (eval echo configure:15072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15072 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15073 if test -z "$ac_err"; then
15074   rm -rf conftest*
15075   eval "ac_cv_header_$ac_safe=yes"
15076 else
15077   echo "$ac_err" >&5
15078   echo "configure: failed program was:" >&5
15079   cat conftest.$ac_ext >&5
15080   rm -rf conftest*
15081   eval "ac_cv_header_$ac_safe=no"
15082 fi
15083 rm -f conftest*
15084 fi
15085 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15086   echo "$ac_t""yes" 1>&6
15087     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15088   cat >> confdefs.h <<EOF
15089 #define $ac_tr_hdr 1
15090 EOF
15091  
15092 else
15093   echo "$ac_t""no" 1>&6
15094 fi
15095 done
15096
15097
15098 if test $ol_link_termcap = no ; then
15099         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
15100 echo "configure:15101: checking for tputs in -ltermcap" >&5
15101 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
15102 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15103   echo $ac_n "(cached) $ac_c" 1>&6
15104 else
15105   ac_save_LIBS="$LIBS"
15106 LIBS="-ltermcap  $LIBS"
15107 cat > conftest.$ac_ext <<EOF
15108 #line 15109 "configure"
15109 #include "confdefs.h"
15110 /* Override any gcc2 internal prototype to avoid an error.  */
15111 /* We use char because int might match the return type of a gcc2
15112     builtin and then its argument prototype would still apply.  */
15113 char tputs();
15114
15115 int main() {
15116 tputs()
15117 ; return 0; }
15118 EOF
15119 if { (eval echo configure:15120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15120   rm -rf conftest*
15121   eval "ac_cv_lib_$ac_lib_var=yes"
15122 else
15123   echo "configure: failed program was:" >&5
15124   cat conftest.$ac_ext >&5
15125   rm -rf conftest*
15126   eval "ac_cv_lib_$ac_lib_var=no"
15127 fi
15128 rm -f conftest*
15129 LIBS="$ac_save_LIBS"
15130
15131 fi
15132 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15133   echo "$ac_t""yes" 1>&6
15134   have_termcap=yes
15135 else
15136   echo "$ac_t""no" 1>&6
15137 have_termcap=no
15138 fi
15139
15140         if test $have_termcap = yes ; then
15141                 cat >> confdefs.h <<\EOF
15142 #define HAVE_TERMCAP 1
15143 EOF
15144
15145                 ol_link_termcap=yes
15146                 TERMCAP_LIBS=-ltermcap
15147         fi
15148 fi
15149
15150 if test $ol_link_termcap = no ; then
15151         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
15152 echo "configure:15153: checking for initscr in -lncurses" >&5
15153 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
15154 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15155   echo $ac_n "(cached) $ac_c" 1>&6
15156 else
15157   ac_save_LIBS="$LIBS"
15158 LIBS="-lncurses  $LIBS"
15159 cat > conftest.$ac_ext <<EOF
15160 #line 15161 "configure"
15161 #include "confdefs.h"
15162 /* Override any gcc2 internal prototype to avoid an error.  */
15163 /* We use char because int might match the return type of a gcc2
15164     builtin and then its argument prototype would still apply.  */
15165 char initscr();
15166
15167 int main() {
15168 initscr()
15169 ; return 0; }
15170 EOF
15171 if { (eval echo configure:15172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15172   rm -rf conftest*
15173   eval "ac_cv_lib_$ac_lib_var=yes"
15174 else
15175   echo "configure: failed program was:" >&5
15176   cat conftest.$ac_ext >&5
15177   rm -rf conftest*
15178   eval "ac_cv_lib_$ac_lib_var=no"
15179 fi
15180 rm -f conftest*
15181 LIBS="$ac_save_LIBS"
15182
15183 fi
15184 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15185   echo "$ac_t""yes" 1>&6
15186   have_ncurses=yes
15187 else
15188   echo "$ac_t""no" 1>&6
15189 have_ncurses=no
15190 fi
15191
15192         if test $have_ncurses = yes ; then
15193                 cat >> confdefs.h <<\EOF
15194 #define HAVE_NCURSES 1
15195 EOF
15196
15197                 ol_link_termcap=yes
15198                 TERMCAP_LIBS=-lncurses
15199         fi
15200 fi
15201
15202 if test $ol_link_termcap = no ; then
15203         cat >> confdefs.h <<\EOF
15204 #define NO_TERMCAP 1
15205 EOF
15206
15207         TERMCAP_LIBS=
15208 fi
15209
15210 ol_link_sasl=no
15211 ol_link_spasswd=no
15212 if test $ol_with_cyrus_sasl != no ; then
15213         for ac_hdr in sasl.h
15214 do
15215 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15216 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15217 echo "configure:15218: checking for $ac_hdr" >&5
15218 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15219   echo $ac_n "(cached) $ac_c" 1>&6
15220 else
15221   cat > conftest.$ac_ext <<EOF
15222 #line 15223 "configure"
15223 #include "confdefs.h"
15224 #include <$ac_hdr>
15225 EOF
15226 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15227 { (eval echo configure:15228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15228 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15229 if test -z "$ac_err"; then
15230   rm -rf conftest*
15231   eval "ac_cv_header_$ac_safe=yes"
15232 else
15233   echo "$ac_err" >&5
15234   echo "configure: failed program was:" >&5
15235   cat conftest.$ac_ext >&5
15236   rm -rf conftest*
15237   eval "ac_cv_header_$ac_safe=no"
15238 fi
15239 rm -f conftest*
15240 fi
15241 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15242   echo "$ac_t""yes" 1>&6
15243     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15244   cat >> confdefs.h <<EOF
15245 #define $ac_tr_hdr 1
15246 EOF
15247  
15248 else
15249   echo "$ac_t""no" 1>&6
15250 fi
15251 done
15252
15253
15254         if test $ac_cv_header_sasl_h = yes ; then
15255                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15256 echo "configure:15257: checking for sasl_client_init in -lsasl" >&5
15257 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15259   echo $ac_n "(cached) $ac_c" 1>&6
15260 else
15261   ac_save_LIBS="$LIBS"
15262 LIBS="-lsasl  $LIBS"
15263 cat > conftest.$ac_ext <<EOF
15264 #line 15265 "configure"
15265 #include "confdefs.h"
15266 /* Override any gcc2 internal prototype to avoid an error.  */
15267 /* We use char because int might match the return type of a gcc2
15268     builtin and then its argument prototype would still apply.  */
15269 char sasl_client_init();
15270
15271 int main() {
15272 sasl_client_init()
15273 ; return 0; }
15274 EOF
15275 if { (eval echo configure:15276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15276   rm -rf conftest*
15277   eval "ac_cv_lib_$ac_lib_var=yes"
15278 else
15279   echo "configure: failed program was:" >&5
15280   cat conftest.$ac_ext >&5
15281   rm -rf conftest*
15282   eval "ac_cv_lib_$ac_lib_var=no"
15283 fi
15284 rm -f conftest*
15285 LIBS="$ac_save_LIBS"
15286
15287 fi
15288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15289   echo "$ac_t""yes" 1>&6
15290   have_cyrus_sasl=yes
15291 else
15292   echo "$ac_t""no" 1>&6
15293 have_cyrus_sasl=no
15294 fi
15295
15296
15297                 if test $have_cyrus_sasl != no ; then
15298                         SASL_LIBS="-lsasl"
15299                         cat >> confdefs.h <<\EOF
15300 #define HAVE_CYRUS_SASL 1
15301 EOF
15302
15303                         ol_link_sasl=yes
15304                 fi
15305         fi
15306
15307         if test $ol_link_sasl = no ; then
15308                 if test $ol_with_cyrus_sasl != auto ; then
15309                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15310                 else
15311                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15312                         echo "configure: warning: SASL authentication not supported!" 1>&2
15313                         if test $ol_link_tls = no ; then
15314                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15315                         fi
15316                 fi
15317
15318         elif test $ol_enable_spasswd != no ; then
15319                 ol_link_spasswd=yes
15320         fi
15321
15322 else
15323         echo "configure: warning: SASL authentication not supported!" 1>&2
15324         if test $ol_link_tls = no ; then
15325                 echo "configure: warning: Strong authentication not supported!" 1>&2
15326         fi
15327 fi
15328
15329 if test $cross_compiling != yes -a $ac_cv_mingw32 != yes ; then
15330         dev=no
15331         if test -r /dev/urandom ; then
15332                 dev="/dev/urandom";
15333         elif test -r /idev/urandom ; then
15334                 dev="/idev/urandom";
15335         elif test -r /dev/srandom ; then
15336                 dev="/dev/srandom";
15337         elif test -r /dev/random ; then
15338                 dev="/dev/random";
15339         elif test -r /idev/random ; then
15340                 dev="/idev/random";
15341         fi
15342
15343         if test $dev != no ; then
15344                 cat >> confdefs.h <<EOF
15345 #define URANDOM_DEVICE "$dev"
15346 EOF
15347
15348         fi
15349 fi
15350
15351 ol_link_fetch=no
15352 if test $ol_with_fetch != no ; then
15353         ol_LIBS=$LIBS
15354 LIBS="-lfetch -lcom_err $LIBS"
15355 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15356 echo "configure:15357: checking fetch(3) library" >&5
15357 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15358   echo $ac_n "(cached) $ac_c" 1>&6
15359 else
15360   
15361         cat > conftest.$ac_ext <<EOF
15362 #line 15363 "configure"
15363 #include "confdefs.h"
15364
15365 #include <sys/param.h>
15366 #include <stdio.h>
15367 #include <fetch.h>
15368 int main() {
15369 struct url *u = fetchParseURL("file:///"); 
15370 ; return 0; }
15371 EOF
15372 if { (eval echo configure:15373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15373   rm -rf conftest*
15374   ol_cv_lib_fetch=yes
15375 else
15376   echo "configure: failed program was:" >&5
15377   cat conftest.$ac_ext >&5
15378   rm -rf conftest*
15379   ol_cv_lib_fetch=no
15380 fi
15381 rm -f conftest*
15382 fi
15383
15384 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15385 LIBS=$ol_LIBS
15386 if test $ol_cv_lib_fetch != no ; then
15387         ol_link_fetch="-lfetch -lcom_err"
15388         cat >> confdefs.h <<\EOF
15389 #define HAVE_FETCH 1
15390 EOF
15391
15392 fi
15393
15394
15395         if test $ol_cv_lib_fetch != no ; then
15396                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15397                 ol_link_fetch=freebsd
15398
15399         elif test $ol_with_fetch != auto ; then
15400                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15401         fi 
15402 fi
15403
15404 ol_link_readline=no
15405 if test $ol_with_readline != no ; then
15406         for ac_hdr in readline/readline.h readline/history.h
15407 do
15408 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15409 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15410 echo "configure:15411: checking for $ac_hdr" >&5
15411 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15412   echo $ac_n "(cached) $ac_c" 1>&6
15413 else
15414   cat > conftest.$ac_ext <<EOF
15415 #line 15416 "configure"
15416 #include "confdefs.h"
15417 #include <$ac_hdr>
15418 EOF
15419 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15420 { (eval echo configure:15421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15421 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15422 if test -z "$ac_err"; then
15423   rm -rf conftest*
15424   eval "ac_cv_header_$ac_safe=yes"
15425 else
15426   echo "$ac_err" >&5
15427   echo "configure: failed program was:" >&5
15428   cat conftest.$ac_ext >&5
15429   rm -rf conftest*
15430   eval "ac_cv_header_$ac_safe=no"
15431 fi
15432 rm -f conftest*
15433 fi
15434 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15435   echo "$ac_t""yes" 1>&6
15436     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15437   cat >> confdefs.h <<EOF
15438 #define $ac_tr_hdr 1
15439 EOF
15440  
15441 else
15442   echo "$ac_t""no" 1>&6
15443 fi
15444 done
15445
15446
15447         if test $ac_cv_header_readline_readline_h = yes ; then
15448                 save_LIBS="$LIBS"
15449                 LIBS="$TERMCAP_LIBS $LIBS"
15450                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15451 echo "configure:15452: checking for readline in -lreadline" >&5
15452 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15453 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15454   echo $ac_n "(cached) $ac_c" 1>&6
15455 else
15456   ac_save_LIBS="$LIBS"
15457 LIBS="-lreadline  $LIBS"
15458 cat > conftest.$ac_ext <<EOF
15459 #line 15460 "configure"
15460 #include "confdefs.h"
15461 /* Override any gcc2 internal prototype to avoid an error.  */
15462 /* We use char because int might match the return type of a gcc2
15463     builtin and then its argument prototype would still apply.  */
15464 char readline();
15465
15466 int main() {
15467 readline()
15468 ; return 0; }
15469 EOF
15470 if { (eval echo configure:15471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15471   rm -rf conftest*
15472   eval "ac_cv_lib_$ac_lib_var=yes"
15473 else
15474   echo "configure: failed program was:" >&5
15475   cat conftest.$ac_ext >&5
15476   rm -rf conftest*
15477   eval "ac_cv_lib_$ac_lib_var=no"
15478 fi
15479 rm -f conftest*
15480 LIBS="$ac_save_LIBS"
15481
15482 fi
15483 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15484   echo "$ac_t""yes" 1>&6
15485   have_readline=yes
15486 else
15487   echo "$ac_t""no" 1>&6
15488 have_readline=no
15489 fi
15490
15491                 LIBS="$save_LIBS"
15492                         
15493                 if test $have_readline = yes ; then
15494                         ol_with_readline=found
15495                         ol_link_readline=yes
15496
15497                         READLINE_LIBS="-lreadline"
15498                 fi
15499         fi
15500 fi
15501
15502 if test $ol_link_readline = yes ; then
15503         cat >> confdefs.h <<\EOF
15504 #define HAVE_READLINE 1
15505 EOF
15506
15507 fi
15508
15509
15510 if test $ol_enable_crypt != no ; then
15511         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15512 echo "configure:15513: checking for crypt" >&5
15513 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15514   echo $ac_n "(cached) $ac_c" 1>&6
15515 else
15516   cat > conftest.$ac_ext <<EOF
15517 #line 15518 "configure"
15518 #include "confdefs.h"
15519 /* System header to define __stub macros and hopefully few prototypes,
15520     which can conflict with char crypt(); below.  */
15521 #include <assert.h>
15522 /* Override any gcc2 internal prototype to avoid an error.  */
15523 /* We use char because int might match the return type of a gcc2
15524     builtin and then its argument prototype would still apply.  */
15525 char crypt();
15526 char (*f)();
15527
15528 int main() {
15529
15530 /* The GNU C library defines this for functions which it implements
15531     to always fail with ENOSYS.  Some functions are actually named
15532     something starting with __ and the normal name is an alias.  */
15533 #if defined (__stub_crypt) || defined (__stub___crypt)
15534 choke me
15535 #else
15536 f = crypt;
15537 #endif
15538
15539 ; return 0; }
15540 EOF
15541 if { (eval echo configure:15542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15542   rm -rf conftest*
15543   eval "ac_cv_func_crypt=yes"
15544 else
15545   echo "configure: failed program was:" >&5
15546   cat conftest.$ac_ext >&5
15547   rm -rf conftest*
15548   eval "ac_cv_func_crypt=no"
15549 fi
15550 rm -f conftest*
15551 fi
15552
15553 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15554   echo "$ac_t""yes" 1>&6
15555   have_crypt=yes
15556 else
15557   echo "$ac_t""no" 1>&6
15558
15559                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15560 echo "configure:15561: checking for crypt in -lcrypt" >&5
15561 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15562 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15563   echo $ac_n "(cached) $ac_c" 1>&6
15564 else
15565   ac_save_LIBS="$LIBS"
15566 LIBS="-lcrypt  $LIBS"
15567 cat > conftest.$ac_ext <<EOF
15568 #line 15569 "configure"
15569 #include "confdefs.h"
15570 /* Override any gcc2 internal prototype to avoid an error.  */
15571 /* We use char because int might match the return type of a gcc2
15572     builtin and then its argument prototype would still apply.  */
15573 char crypt();
15574
15575 int main() {
15576 crypt()
15577 ; return 0; }
15578 EOF
15579 if { (eval echo configure:15580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15580   rm -rf conftest*
15581   eval "ac_cv_lib_$ac_lib_var=yes"
15582 else
15583   echo "configure: failed program was:" >&5
15584   cat conftest.$ac_ext >&5
15585   rm -rf conftest*
15586   eval "ac_cv_lib_$ac_lib_var=no"
15587 fi
15588 rm -f conftest*
15589 LIBS="$ac_save_LIBS"
15590
15591 fi
15592 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15593   echo "$ac_t""yes" 1>&6
15594   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15595                         have_crypt=yes
15596 else
15597   echo "$ac_t""no" 1>&6
15598 have_crypt=no
15599 fi
15600
15601 fi
15602
15603
15604         if test $have_crypt = yes ; then
15605                 cat >> confdefs.h <<\EOF
15606 #define HAVE_CRYPT 1
15607 EOF
15608
15609         else
15610                 echo "configure: warning: could not find crypt" 1>&2
15611                 if test $ol_enable_crypt = yes ; then
15612                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15613                 fi
15614
15615                 echo "configure: warning: disabling crypt support" 1>&2
15616                 ol_enable_crypt=no
15617         fi
15618 fi
15619
15620 if test $ol_enable_proctitle != no ; then
15621         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15622 echo "configure:15623: checking for setproctitle" >&5
15623 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15624   echo $ac_n "(cached) $ac_c" 1>&6
15625 else
15626   cat > conftest.$ac_ext <<EOF
15627 #line 15628 "configure"
15628 #include "confdefs.h"
15629 /* System header to define __stub macros and hopefully few prototypes,
15630     which can conflict with char setproctitle(); below.  */
15631 #include <assert.h>
15632 /* Override any gcc2 internal prototype to avoid an error.  */
15633 /* We use char because int might match the return type of a gcc2
15634     builtin and then its argument prototype would still apply.  */
15635 char setproctitle();
15636 char (*f)();
15637
15638 int main() {
15639
15640 /* The GNU C library defines this for functions which it implements
15641     to always fail with ENOSYS.  Some functions are actually named
15642     something starting with __ and the normal name is an alias.  */
15643 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15644 choke me
15645 #else
15646 f = setproctitle;
15647 #endif
15648
15649 ; return 0; }
15650 EOF
15651 if { (eval echo configure:15652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15652   rm -rf conftest*
15653   eval "ac_cv_func_setproctitle=yes"
15654 else
15655   echo "configure: failed program was:" >&5
15656   cat conftest.$ac_ext >&5
15657   rm -rf conftest*
15658   eval "ac_cv_func_setproctitle=no"
15659 fi
15660 rm -f conftest*
15661 fi
15662
15663 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15664   echo "$ac_t""yes" 1>&6
15665   have_setproctitle=yes
15666 else
15667   echo "$ac_t""no" 1>&6
15668
15669                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15670 echo "configure:15671: checking for setproctitle in -lutil" >&5
15671 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15672 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15673   echo $ac_n "(cached) $ac_c" 1>&6
15674 else
15675   ac_save_LIBS="$LIBS"
15676 LIBS="-lutil  $LIBS"
15677 cat > conftest.$ac_ext <<EOF
15678 #line 15679 "configure"
15679 #include "confdefs.h"
15680 /* Override any gcc2 internal prototype to avoid an error.  */
15681 /* We use char because int might match the return type of a gcc2
15682     builtin and then its argument prototype would still apply.  */
15683 char setproctitle();
15684
15685 int main() {
15686 setproctitle()
15687 ; return 0; }
15688 EOF
15689 if { (eval echo configure:15690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15690   rm -rf conftest*
15691   eval "ac_cv_lib_$ac_lib_var=yes"
15692 else
15693   echo "configure: failed program was:" >&5
15694   cat conftest.$ac_ext >&5
15695   rm -rf conftest*
15696   eval "ac_cv_lib_$ac_lib_var=no"
15697 fi
15698 rm -f conftest*
15699 LIBS="$ac_save_LIBS"
15700
15701 fi
15702 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15703   echo "$ac_t""yes" 1>&6
15704   have_setproctitle=yes
15705                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15706 else
15707   echo "$ac_t""no" 1>&6
15708 have_setproctitle=no
15709                         LIBOBJS="$LIBOBJS setproctitle.o"
15710                         LIBSRCS="$LIBSRCS setproctitle.c"
15711 fi
15712
15713 fi
15714
15715
15716         if test $have_setproctitle = yes ; then
15717                 cat >> confdefs.h <<\EOF
15718 #define HAVE_SETPROCTITLE 1
15719 EOF
15720
15721         fi
15722 fi
15723
15724 if test $ol_enable_slp != no ; then
15725         for ac_hdr in slp.h 
15726 do
15727 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15728 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15729 echo "configure:15730: checking for $ac_hdr" >&5
15730 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15731   echo $ac_n "(cached) $ac_c" 1>&6
15732 else
15733   cat > conftest.$ac_ext <<EOF
15734 #line 15735 "configure"
15735 #include "confdefs.h"
15736 #include <$ac_hdr>
15737 EOF
15738 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15739 { (eval echo configure:15740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15740 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15741 if test -z "$ac_err"; then
15742   rm -rf conftest*
15743   eval "ac_cv_header_$ac_safe=yes"
15744 else
15745   echo "$ac_err" >&5
15746   echo "configure: failed program was:" >&5
15747   cat conftest.$ac_ext >&5
15748   rm -rf conftest*
15749   eval "ac_cv_header_$ac_safe=no"
15750 fi
15751 rm -f conftest*
15752 fi
15753 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15754   echo "$ac_t""yes" 1>&6
15755     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15756   cat >> confdefs.h <<EOF
15757 #define $ac_tr_hdr 1
15758 EOF
15759  
15760 else
15761   echo "$ac_t""no" 1>&6
15762 fi
15763 done
15764
15765
15766         if test $ac_cv_header_slp_h = yes ; then
15767                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15768 echo "configure:15769: checking for SLPOpen in -lslp" >&5
15769 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15770 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15771   echo $ac_n "(cached) $ac_c" 1>&6
15772 else
15773   ac_save_LIBS="$LIBS"
15774 LIBS="-lslp  $LIBS"
15775 cat > conftest.$ac_ext <<EOF
15776 #line 15777 "configure"
15777 #include "confdefs.h"
15778 /* Override any gcc2 internal prototype to avoid an error.  */
15779 /* We use char because int might match the return type of a gcc2
15780     builtin and then its argument prototype would still apply.  */
15781 char SLPOpen();
15782
15783 int main() {
15784 SLPOpen()
15785 ; return 0; }
15786 EOF
15787 if { (eval echo configure:15788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15788   rm -rf conftest*
15789   eval "ac_cv_lib_$ac_lib_var=yes"
15790 else
15791   echo "configure: failed program was:" >&5
15792   cat conftest.$ac_ext >&5
15793   rm -rf conftest*
15794   eval "ac_cv_lib_$ac_lib_var=no"
15795 fi
15796 rm -f conftest*
15797 LIBS="$ac_save_LIBS"
15798
15799 fi
15800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15801   echo "$ac_t""yes" 1>&6
15802   have_slp=yes
15803 else
15804   echo "$ac_t""no" 1>&6
15805 have_slp=no
15806 fi
15807
15808                 if test $have_slp = yes ; then
15809                         cat >> confdefs.h <<\EOF
15810 #define HAVE_SLP 1
15811 EOF
15812
15813                         SLAPD_SLP_LIBS=-lslp
15814                 fi
15815
15816         elif test $ol_enable_slp = yes ; then
15817                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15818         fi
15819 fi
15820
15821 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15822 echo "configure:15823: checking for ANSI C header files" >&5
15823 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15824   echo $ac_n "(cached) $ac_c" 1>&6
15825 else
15826   cat > conftest.$ac_ext <<EOF
15827 #line 15828 "configure"
15828 #include "confdefs.h"
15829 #include <stdlib.h>
15830 #include <stdarg.h>
15831 #include <string.h>
15832 #include <float.h>
15833 EOF
15834 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15835 { (eval echo configure:15836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15836 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15837 if test -z "$ac_err"; then
15838   rm -rf conftest*
15839   ac_cv_header_stdc=yes
15840 else
15841   echo "$ac_err" >&5
15842   echo "configure: failed program was:" >&5
15843   cat conftest.$ac_ext >&5
15844   rm -rf conftest*
15845   ac_cv_header_stdc=no
15846 fi
15847 rm -f conftest*
15848
15849 if test $ac_cv_header_stdc = yes; then
15850   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15851 cat > conftest.$ac_ext <<EOF
15852 #line 15853 "configure"
15853 #include "confdefs.h"
15854 #include <string.h>
15855 EOF
15856 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15857   egrep "memchr" >/dev/null 2>&1; then
15858   :
15859 else
15860   rm -rf conftest*
15861   ac_cv_header_stdc=no
15862 fi
15863 rm -f conftest*
15864
15865 fi
15866
15867 if test $ac_cv_header_stdc = yes; then
15868   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15869 cat > conftest.$ac_ext <<EOF
15870 #line 15871 "configure"
15871 #include "confdefs.h"
15872 #include <stdlib.h>
15873 EOF
15874 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15875   egrep "free" >/dev/null 2>&1; then
15876   :
15877 else
15878   rm -rf conftest*
15879   ac_cv_header_stdc=no
15880 fi
15881 rm -f conftest*
15882
15883 fi
15884
15885 if test $ac_cv_header_stdc = yes; then
15886   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15887 if test "$cross_compiling" = yes; then
15888   :
15889 else
15890   cat > conftest.$ac_ext <<EOF
15891 #line 15892 "configure"
15892 #include "confdefs.h"
15893 #include <ctype.h>
15894 #if ((' ' & 0x0FF) == 0x020)
15895 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15896 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15897 #else
15898 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15899  || ('j' <= (c) && (c) <= 'r') \
15900  || ('s' <= (c) && (c) <= 'z'))
15901 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15902 #endif
15903 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15904 int main () { int i; for (i = 0; i < 256; i++)
15905 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15906 exit (0); }
15907
15908 EOF
15909 if { (eval echo configure:15910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15910 then
15911   :
15912 else
15913   echo "configure: failed program was:" >&5
15914   cat conftest.$ac_ext >&5
15915   rm -fr conftest*
15916   ac_cv_header_stdc=no
15917 fi
15918 rm -fr conftest*
15919 fi
15920
15921 fi
15922 fi
15923
15924 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15925 if test $ac_cv_header_stdc = yes; then
15926   cat >> confdefs.h <<\EOF
15927 #define STDC_HEADERS 1
15928 EOF
15929
15930 fi
15931
15932 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15933 echo "configure:15934: checking for mode_t" >&5
15934 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15935   echo $ac_n "(cached) $ac_c" 1>&6
15936 else
15937   cat > conftest.$ac_ext <<EOF
15938 #line 15939 "configure"
15939 #include "confdefs.h"
15940 #include <sys/types.h>
15941 #if STDC_HEADERS
15942 #include <stdlib.h>
15943 #include <stddef.h>
15944 #endif
15945
15946 EOF
15947 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15948   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15949   rm -rf conftest*
15950   eval "ac_cv_type_mode_t=yes"
15951 else
15952   rm -rf conftest*
15953   eval "ac_cv_type_mode_t=no"
15954 fi
15955 rm -f conftest*
15956
15957 fi
15958 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15959   echo "$ac_t""yes" 1>&6
15960 else
15961   echo "$ac_t""no" 1>&6
15962   cat >> confdefs.h <<EOF
15963 #define mode_t int
15964 EOF
15965
15966 fi
15967
15968 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15969 echo "configure:15970: checking for off_t" >&5
15970 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15971   echo $ac_n "(cached) $ac_c" 1>&6
15972 else
15973   cat > conftest.$ac_ext <<EOF
15974 #line 15975 "configure"
15975 #include "confdefs.h"
15976 #include <sys/types.h>
15977 #if STDC_HEADERS
15978 #include <stdlib.h>
15979 #include <stddef.h>
15980 #endif
15981
15982 EOF
15983 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15984   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15985   rm -rf conftest*
15986   eval "ac_cv_type_off_t=yes"
15987 else
15988   rm -rf conftest*
15989   eval "ac_cv_type_off_t=no"
15990 fi
15991 rm -f conftest*
15992
15993 fi
15994 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15995   echo "$ac_t""yes" 1>&6
15996 else
15997   echo "$ac_t""no" 1>&6
15998   cat >> confdefs.h <<EOF
15999 #define off_t long
16000 EOF
16001
16002 fi
16003
16004 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
16005 echo "configure:16006: checking for pid_t" >&5
16006 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
16007   echo $ac_n "(cached) $ac_c" 1>&6
16008 else
16009   cat > conftest.$ac_ext <<EOF
16010 #line 16011 "configure"
16011 #include "confdefs.h"
16012 #include <sys/types.h>
16013 #if STDC_HEADERS
16014 #include <stdlib.h>
16015 #include <stddef.h>
16016 #endif
16017
16018 EOF
16019 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16020   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16021   rm -rf conftest*
16022   eval "ac_cv_type_pid_t=yes"
16023 else
16024   rm -rf conftest*
16025   eval "ac_cv_type_pid_t=no"
16026 fi
16027 rm -f conftest*
16028
16029 fi
16030 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
16031   echo "$ac_t""yes" 1>&6
16032 else
16033   echo "$ac_t""no" 1>&6
16034   cat >> confdefs.h <<EOF
16035 #define pid_t int
16036 EOF
16037
16038 fi
16039
16040 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
16041 echo "configure:16042: checking for ptrdiff_t" >&5
16042 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
16043   echo $ac_n "(cached) $ac_c" 1>&6
16044 else
16045   cat > conftest.$ac_ext <<EOF
16046 #line 16047 "configure"
16047 #include "confdefs.h"
16048 #include <stddef.h>
16049 int main() {
16050 ptrdiff_t p
16051 ; return 0; }
16052 EOF
16053 if { (eval echo configure:16054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16054   rm -rf conftest*
16055   am_cv_type_ptrdiff_t=yes
16056 else
16057   echo "configure: failed program was:" >&5
16058   cat conftest.$ac_ext >&5
16059   rm -rf conftest*
16060   am_cv_type_ptrdiff_t=no
16061 fi
16062 rm -f conftest*
16063 fi
16064
16065 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
16066    if test $am_cv_type_ptrdiff_t = yes; then
16067      cat >> confdefs.h <<\EOF
16068 #define HAVE_PTRDIFF_T 1
16069 EOF
16070
16071    fi
16072
16073 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
16074 echo "configure:16075: checking return type of signal handlers" >&5
16075 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
16076   echo $ac_n "(cached) $ac_c" 1>&6
16077 else
16078   cat > conftest.$ac_ext <<EOF
16079 #line 16080 "configure"
16080 #include "confdefs.h"
16081 #include <sys/types.h>
16082 #include <signal.h>
16083 #ifdef signal
16084 #undef signal
16085 #endif
16086 #ifdef __cplusplus
16087 extern "C" void (*signal (int, void (*)(int)))(int);
16088 #else
16089 void (*signal ()) ();
16090 #endif
16091
16092 int main() {
16093 int i;
16094 ; return 0; }
16095 EOF
16096 if { (eval echo configure:16097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16097   rm -rf conftest*
16098   ac_cv_type_signal=void
16099 else
16100   echo "configure: failed program was:" >&5
16101   cat conftest.$ac_ext >&5
16102   rm -rf conftest*
16103   ac_cv_type_signal=int
16104 fi
16105 rm -f conftest*
16106 fi
16107
16108 echo "$ac_t""$ac_cv_type_signal" 1>&6
16109 cat >> confdefs.h <<EOF
16110 #define RETSIGTYPE $ac_cv_type_signal
16111 EOF
16112
16113
16114 echo $ac_n "checking for size_t""... $ac_c" 1>&6
16115 echo "configure:16116: checking for size_t" >&5
16116 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
16117   echo $ac_n "(cached) $ac_c" 1>&6
16118 else
16119   cat > conftest.$ac_ext <<EOF
16120 #line 16121 "configure"
16121 #include "confdefs.h"
16122 #include <sys/types.h>
16123 #if STDC_HEADERS
16124 #include <stdlib.h>
16125 #include <stddef.h>
16126 #endif
16127
16128 EOF
16129 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16130   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16131   rm -rf conftest*
16132   eval "ac_cv_type_size_t=yes"
16133 else
16134   rm -rf conftest*
16135   eval "ac_cv_type_size_t=no"
16136 fi
16137 rm -f conftest*
16138
16139 fi
16140 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
16141   echo "$ac_t""yes" 1>&6
16142 else
16143   echo "$ac_t""no" 1>&6
16144   cat >> confdefs.h <<EOF
16145 #define size_t unsigned
16146 EOF
16147
16148 fi
16149
16150
16151 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
16152 echo "configure:16153: checking for ssize_t" >&5
16153 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
16154   echo $ac_n "(cached) $ac_c" 1>&6
16155 else
16156   cat > conftest.$ac_ext <<EOF
16157 #line 16158 "configure"
16158 #include "confdefs.h"
16159 #include <sys/types.h>
16160 #if STDC_HEADERS
16161 #include <stdlib.h>
16162 #include <stddef.h>
16163 #endif
16164
16165 EOF
16166 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16167   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16168   rm -rf conftest*
16169   eval "ac_cv_type_ssize_t=yes"
16170 else
16171   rm -rf conftest*
16172   eval "ac_cv_type_ssize_t=no"
16173 fi
16174 rm -f conftest*
16175
16176 fi
16177 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
16178   echo "$ac_t""yes" 1>&6
16179 else
16180   echo "$ac_t""no" 1>&6
16181   cat >> confdefs.h <<EOF
16182 #define ssize_t signed int
16183 EOF
16184
16185 fi
16186
16187 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16188 echo "configure:16189: checking for caddr_t" >&5
16189 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16190   echo $ac_n "(cached) $ac_c" 1>&6
16191 else
16192   cat > conftest.$ac_ext <<EOF
16193 #line 16194 "configure"
16194 #include "confdefs.h"
16195 #include <sys/types.h>
16196 #if STDC_HEADERS
16197 #include <stdlib.h>
16198 #include <stddef.h>
16199 #endif
16200
16201 EOF
16202 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16203   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16204   rm -rf conftest*
16205   eval "ac_cv_type_caddr_t=yes"
16206 else
16207   rm -rf conftest*
16208   eval "ac_cv_type_caddr_t=no"
16209 fi
16210 rm -f conftest*
16211
16212 fi
16213 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16214   echo "$ac_t""yes" 1>&6
16215 else
16216   echo "$ac_t""no" 1>&6
16217   cat >> confdefs.h <<EOF
16218 #define caddr_t char *
16219 EOF
16220
16221 fi
16222
16223
16224 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16225 echo "configure:16226: checking for socklen_t" >&5
16226 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16227   echo $ac_n "(cached) $ac_c" 1>&6
16228 else
16229   cat > conftest.$ac_ext <<EOF
16230 #line 16231 "configure"
16231 #include "confdefs.h"
16232
16233 #ifdef HAVE_SYS_TYPES_H
16234 #include <sys/types.h>
16235 #endif
16236 #ifdef HAVE_SYS_SOCKET_H
16237 #include <sys/socket.h>
16238 #endif
16239
16240 int main() {
16241 socklen_t len;
16242 ; return 0; }
16243 EOF
16244 if { (eval echo configure:16245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16245   rm -rf conftest*
16246   ol_cv_type_socklen_t=yes
16247 else
16248   echo "configure: failed program was:" >&5
16249   cat conftest.$ac_ext >&5
16250   rm -rf conftest*
16251   ol_cv_type_socklen_t=no
16252 fi
16253 rm -f conftest*
16254 fi
16255
16256 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16257   if test $ol_cv_type_socklen_t = no; then
16258     cat >> confdefs.h <<\EOF
16259 #define socklen_t int
16260 EOF
16261
16262   fi
16263  
16264 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16265 echo "configure:16266: checking for member st_blksize in aggregate type struct stat" >&5
16266 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16267   echo $ac_n "(cached) $ac_c" 1>&6
16268 else
16269   cat > conftest.$ac_ext <<EOF
16270 #line 16271 "configure"
16271 #include "confdefs.h"
16272 #include <sys/types.h>
16273 #include <sys/stat.h>
16274 int main() {
16275 struct stat foo; foo.st_blksize;
16276 ; return 0; }
16277 EOF
16278 if { (eval echo configure:16279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16279   rm -rf conftest*
16280   ac_cv_c_struct_member_st_blksize=yes
16281 else
16282   echo "configure: failed program was:" >&5
16283   cat conftest.$ac_ext >&5
16284   rm -rf conftest*
16285   ac_cv_c_struct_member_st_blksize=no
16286 fi
16287 rm -f conftest*
16288 fi
16289
16290 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16291 st_blksize="$ac_cv_c_struct_member_st_blksize"
16292 if test $ac_cv_c_struct_member_st_blksize = yes; then
16293   cat >> confdefs.h <<\EOF
16294 #define HAVE_ST_BLKSIZE 1
16295 EOF
16296
16297 fi
16298
16299 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16300 echo "configure:16301: checking whether time.h and sys/time.h may both be included" >&5
16301 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16302   echo $ac_n "(cached) $ac_c" 1>&6
16303 else
16304   cat > conftest.$ac_ext <<EOF
16305 #line 16306 "configure"
16306 #include "confdefs.h"
16307 #include <sys/types.h>
16308 #include <sys/time.h>
16309 #include <time.h>
16310 int main() {
16311 struct tm *tp;
16312 ; return 0; }
16313 EOF
16314 if { (eval echo configure:16315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16315   rm -rf conftest*
16316   ac_cv_header_time=yes
16317 else
16318   echo "configure: failed program was:" >&5
16319   cat conftest.$ac_ext >&5
16320   rm -rf conftest*
16321   ac_cv_header_time=no
16322 fi
16323 rm -f conftest*
16324 fi
16325
16326 echo "$ac_t""$ac_cv_header_time" 1>&6
16327 if test $ac_cv_header_time = yes; then
16328   cat >> confdefs.h <<\EOF
16329 #define TIME_WITH_SYS_TIME 1
16330 EOF
16331
16332 fi
16333
16334 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16335 echo "configure:16336: checking whether struct tm is in sys/time.h or time.h" >&5
16336 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16337   echo $ac_n "(cached) $ac_c" 1>&6
16338 else
16339   cat > conftest.$ac_ext <<EOF
16340 #line 16341 "configure"
16341 #include "confdefs.h"
16342 #include <sys/types.h>
16343 #include <time.h>
16344 int main() {
16345 struct tm *tp; tp->tm_sec;
16346 ; return 0; }
16347 EOF
16348 if { (eval echo configure:16349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16349   rm -rf conftest*
16350   ac_cv_struct_tm=time.h
16351 else
16352   echo "configure: failed program was:" >&5
16353   cat conftest.$ac_ext >&5
16354   rm -rf conftest*
16355   ac_cv_struct_tm=sys/time.h
16356 fi
16357 rm -f conftest*
16358 fi
16359
16360 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16361 if test $ac_cv_struct_tm = sys/time.h; then
16362   cat >> confdefs.h <<\EOF
16363 #define TM_IN_SYS_TIME 1
16364 EOF
16365
16366 fi
16367
16368 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16369 echo "configure:16370: checking for uid_t in sys/types.h" >&5
16370 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16371   echo $ac_n "(cached) $ac_c" 1>&6
16372 else
16373   cat > conftest.$ac_ext <<EOF
16374 #line 16375 "configure"
16375 #include "confdefs.h"
16376 #include <sys/types.h>
16377 EOF
16378 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16379   egrep "uid_t" >/dev/null 2>&1; then
16380   rm -rf conftest*
16381   ac_cv_type_uid_t=yes
16382 else
16383   rm -rf conftest*
16384   ac_cv_type_uid_t=no
16385 fi
16386 rm -f conftest*
16387
16388 fi
16389
16390 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16391 if test $ac_cv_type_uid_t = no; then
16392   cat >> confdefs.h <<\EOF
16393 #define uid_t int
16394 EOF
16395
16396   cat >> confdefs.h <<\EOF
16397 #define gid_t int
16398 EOF
16399
16400 fi
16401
16402 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16403 echo "configure:16404: checking for sig_atomic_t" >&5
16404 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16405   echo $ac_n "(cached) $ac_c" 1>&6
16406 else
16407   cat > conftest.$ac_ext <<EOF
16408 #line 16409 "configure"
16409 #include "confdefs.h"
16410 #include <signal.h>
16411 int main() {
16412 sig_atomic_t atomic;
16413 ; return 0; }
16414 EOF
16415 if { (eval echo configure:16416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16416   rm -rf conftest*
16417   ol_cv_type_sig_atomic_t=yes
16418 else
16419   echo "configure: failed program was:" >&5
16420   cat conftest.$ac_ext >&5
16421   rm -rf conftest*
16422   ol_cv_type_sig_atomic_t=no
16423 fi
16424 rm -f conftest*
16425 fi
16426
16427 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16428   if test $ol_cv_type_sig_atomic_t = no; then
16429     cat >> confdefs.h <<\EOF
16430 #define sig_atomic_t int
16431 EOF
16432
16433   fi
16434  
16435
16436
16437 # test for pw_gecos in struct passwd
16438 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16439 echo "configure:16440: checking struct passwd for pw_gecos" >&5
16440 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16441   echo $ac_n "(cached) $ac_c" 1>&6
16442 else
16443   
16444         cat > conftest.$ac_ext <<EOF
16445 #line 16446 "configure"
16446 #include "confdefs.h"
16447 #include <pwd.h>
16448 int main() {
16449
16450         struct passwd pwd;
16451         pwd.pw_gecos = pwd.pw_name;
16452
16453 ; return 0; }
16454 EOF
16455 if { (eval echo configure:16456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16456   rm -rf conftest*
16457   ol_cv_struct_passwd_pw_gecos=yes
16458 else
16459   echo "configure: failed program was:" >&5
16460   cat conftest.$ac_ext >&5
16461   rm -rf conftest*
16462   ol_cv_struct_passwd_pw_gecos=no
16463 fi
16464 rm -f conftest*
16465 fi
16466
16467 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16468 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16469         cat >> confdefs.h <<\EOF
16470 #define HAVE_PW_GECOS 1
16471 EOF
16472
16473 fi
16474
16475 # test for pw_passwd in struct passwd
16476 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16477 echo "configure:16478: checking struct passwd for pw_passwd" >&5
16478 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16479   echo $ac_n "(cached) $ac_c" 1>&6
16480 else
16481   
16482         cat > conftest.$ac_ext <<EOF
16483 #line 16484 "configure"
16484 #include "confdefs.h"
16485 #include <pwd.h>
16486 int main() {
16487
16488         struct passwd pwd;
16489         pwd.pw_passwd = pwd.pw_name;
16490
16491 ; return 0; }
16492 EOF
16493 if { (eval echo configure:16494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16494   rm -rf conftest*
16495   ol_cv_struct_passwd_pw_passwd=yes
16496 else
16497   echo "configure: failed program was:" >&5
16498   cat conftest.$ac_ext >&5
16499   rm -rf conftest*
16500   ol_cv_struct_passwd_pw_passwd=no
16501 fi
16502 rm -f conftest*
16503 fi
16504
16505 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16506 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16507         cat >> confdefs.h <<\EOF
16508 #define HAVE_PW_PASSWD 1
16509 EOF
16510
16511 fi
16512
16513
16514 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16515 echo "configure:16516: checking if toupper() requires islower()" >&5
16516 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16517   echo $ac_n "(cached) $ac_c" 1>&6
16518 else
16519   
16520         if test "$cross_compiling" = yes; then
16521   ol_cv_c_upper_lower=safe
16522 else
16523   cat > conftest.$ac_ext <<EOF
16524 #line 16525 "configure"
16525 #include "confdefs.h"
16526
16527 #include <ctype.h>
16528 main()
16529 {
16530         if ('C' == toupper('C'))
16531                 exit(0);
16532         else
16533                 exit(1);
16534 }
16535 EOF
16536 if { (eval echo configure:16537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16537 then
16538   ol_cv_c_upper_lower=no
16539 else
16540   echo "configure: failed program was:" >&5
16541   cat conftest.$ac_ext >&5
16542   rm -fr conftest*
16543   ol_cv_c_upper_lower=yes
16544 fi
16545 rm -fr conftest*
16546 fi
16547
16548 fi
16549
16550 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16551 if test $ol_cv_c_upper_lower != no ; then
16552         cat >> confdefs.h <<\EOF
16553 #define C_UPPER_LOWER 1
16554 EOF
16555
16556 fi
16557
16558 echo $ac_n "checking for working const""... $ac_c" 1>&6
16559 echo "configure:16560: checking for working const" >&5
16560 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16561   echo $ac_n "(cached) $ac_c" 1>&6
16562 else
16563   cat > conftest.$ac_ext <<EOF
16564 #line 16565 "configure"
16565 #include "confdefs.h"
16566
16567 int main() {
16568
16569 /* Ultrix mips cc rejects this.  */
16570 typedef int charset[2]; const charset x;
16571 /* SunOS 4.1.1 cc rejects this.  */
16572 char const *const *ccp;
16573 char **p;
16574 /* NEC SVR4.0.2 mips cc rejects this.  */
16575 struct point {int x, y;};
16576 static struct point const zero = {0,0};
16577 /* AIX XL C 1.02.0.0 rejects this.
16578    It does not let you subtract one const X* pointer from another in an arm
16579    of an if-expression whose if-part is not a constant expression */
16580 const char *g = "string";
16581 ccp = &g + (g ? g-g : 0);
16582 /* HPUX 7.0 cc rejects these. */
16583 ++ccp;
16584 p = (char**) ccp;
16585 ccp = (char const *const *) p;
16586 { /* SCO 3.2v4 cc rejects this.  */
16587   char *t;
16588   char const *s = 0 ? (char *) 0 : (char const *) 0;
16589
16590   *t++ = 0;
16591 }
16592 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16593   int x[] = {25, 17};
16594   const int *foo = &x[0];
16595   ++foo;
16596 }
16597 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16598   typedef const int *iptr;
16599   iptr p = 0;
16600   ++p;
16601 }
16602 { /* AIX XL C 1.02.0.0 rejects this saying
16603      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16604   struct s { int j; const int *ap[3]; };
16605   struct s *b; b->j = 5;
16606 }
16607 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16608   const int foo = 10;
16609 }
16610
16611 ; return 0; }
16612 EOF
16613 if { (eval echo configure:16614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16614   rm -rf conftest*
16615   ac_cv_c_const=yes
16616 else
16617   echo "configure: failed program was:" >&5
16618   cat conftest.$ac_ext >&5
16619   rm -rf conftest*
16620   ac_cv_c_const=no
16621 fi
16622 rm -f conftest*
16623 fi
16624
16625 echo "$ac_t""$ac_cv_c_const" 1>&6
16626 if test $ac_cv_c_const = no; then
16627   cat >> confdefs.h <<\EOF
16628 #define const 
16629 EOF
16630
16631 fi
16632
16633 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16634 echo "configure:16635: checking if compiler understands volatile" >&5
16635 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16636   echo $ac_n "(cached) $ac_c" 1>&6
16637 else
16638   cat > conftest.$ac_ext <<EOF
16639 #line 16640 "configure"
16640 #include "confdefs.h"
16641 int x, y, z;
16642 int main() {
16643 volatile int a; int * volatile b = x ? &y : &z;
16644       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16645       *b = 0;
16646 ; return 0; }
16647 EOF
16648 if { (eval echo configure:16649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16649   rm -rf conftest*
16650   ol_cv_c_volatile=yes
16651 else
16652   echo "configure: failed program was:" >&5
16653   cat conftest.$ac_ext >&5
16654   rm -rf conftest*
16655   ol_cv_c_volatile=no
16656 fi
16657 rm -f conftest*
16658 fi
16659
16660 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16661   if test $ol_cv_c_volatile = yes; then
16662     : 
16663   else
16664     cat >> confdefs.h <<\EOF
16665 #define volatile 
16666 EOF
16667
16668   fi
16669  
16670
16671 if test $cross_compiling = yes ; then
16672         cat >> confdefs.h <<\EOF
16673 #define CROSS_COMPILING 1
16674 EOF
16675
16676 else
16677         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16678 echo "configure:16679: checking whether byte ordering is bigendian" >&5
16679 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16680   echo $ac_n "(cached) $ac_c" 1>&6
16681 else
16682   ac_cv_c_bigendian=unknown
16683 # See if sys/param.h defines the BYTE_ORDER macro.
16684 cat > conftest.$ac_ext <<EOF
16685 #line 16686 "configure"
16686 #include "confdefs.h"
16687 #include <sys/types.h>
16688 #include <sys/param.h>
16689 int main() {
16690
16691 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16692  bogus endian macros
16693 #endif
16694 ; return 0; }
16695 EOF
16696 if { (eval echo configure:16697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16697   rm -rf conftest*
16698   # It does; now see whether it defined to BIG_ENDIAN or not.
16699 cat > conftest.$ac_ext <<EOF
16700 #line 16701 "configure"
16701 #include "confdefs.h"
16702 #include <sys/types.h>
16703 #include <sys/param.h>
16704 int main() {
16705
16706 #if BYTE_ORDER != BIG_ENDIAN
16707  not big endian
16708 #endif
16709 ; return 0; }
16710 EOF
16711 if { (eval echo configure:16712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16712   rm -rf conftest*
16713   ac_cv_c_bigendian=yes
16714 else
16715   echo "configure: failed program was:" >&5
16716   cat conftest.$ac_ext >&5
16717   rm -rf conftest*
16718   ac_cv_c_bigendian=no
16719 fi
16720 rm -f conftest*
16721 else
16722   echo "configure: failed program was:" >&5
16723   cat conftest.$ac_ext >&5
16724 fi
16725 rm -f conftest*
16726 if test $ac_cv_c_bigendian = unknown; then
16727 if test "$cross_compiling" = yes; then
16728     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16729 else
16730   cat > conftest.$ac_ext <<EOF
16731 #line 16732 "configure"
16732 #include "confdefs.h"
16733 main () {
16734   /* Are we little or big endian?  From Harbison&Steele.  */
16735   union
16736   {
16737     long l;
16738     char c[sizeof (long)];
16739   } u;
16740   u.l = 1;
16741   exit (u.c[sizeof (long) - 1] == 1);
16742 }
16743 EOF
16744 if { (eval echo configure:16745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16745 then
16746   ac_cv_c_bigendian=no
16747 else
16748   echo "configure: failed program was:" >&5
16749   cat conftest.$ac_ext >&5
16750   rm -fr conftest*
16751   ac_cv_c_bigendian=yes
16752 fi
16753 rm -fr conftest*
16754 fi
16755
16756 fi
16757 fi
16758
16759 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16760 if test $ac_cv_c_bigendian = yes; then
16761   cat >> confdefs.h <<\EOF
16762 #define WORDS_BIGENDIAN 1
16763 EOF
16764
16765 fi
16766
16767 fi
16768
16769 echo $ac_n "checking size of short""... $ac_c" 1>&6
16770 echo "configure:16771: checking size of short" >&5 
16771 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16772   echo $ac_n "(cached) $ac_c" 1>&6
16773 else
16774   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16775   cat > conftest.$ac_ext <<EOF
16776 #line 16777 "configure"
16777 #include "confdefs.h"
16778 #include "confdefs.h" 
16779 #include <sys/types.h> 
16780  
16781
16782 int main() {
16783 switch (0) case 0: case (sizeof (short) == $ac_size):;
16784 ; return 0; }
16785 EOF
16786 if { (eval echo configure:16787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16787   rm -rf conftest*
16788   ac_cv_sizeof_short=$ac_size
16789 else
16790   echo "configure: failed program was:" >&5
16791   cat conftest.$ac_ext >&5
16792 fi
16793 rm -f conftest* 
16794   if test x$ac_cv_sizeof_short != x ; then break; fi 
16795 done 
16796
16797 fi
16798  
16799 if test x$ac_cv_sizeof_short = x ; then 
16800   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16801 fi 
16802 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16803 cat >> confdefs.h <<EOF
16804 #define SIZEOF_SHORT $ac_cv_sizeof_short
16805 EOF
16806  
16807  
16808 echo $ac_n "checking size of int""... $ac_c" 1>&6
16809 echo "configure:16810: checking size of int" >&5 
16810 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16811   echo $ac_n "(cached) $ac_c" 1>&6
16812 else
16813   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16814   cat > conftest.$ac_ext <<EOF
16815 #line 16816 "configure"
16816 #include "confdefs.h"
16817 #include "confdefs.h" 
16818 #include <sys/types.h> 
16819  
16820
16821 int main() {
16822 switch (0) case 0: case (sizeof (int) == $ac_size):;
16823 ; return 0; }
16824 EOF
16825 if { (eval echo configure:16826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16826   rm -rf conftest*
16827   ac_cv_sizeof_int=$ac_size
16828 else
16829   echo "configure: failed program was:" >&5
16830   cat conftest.$ac_ext >&5
16831 fi
16832 rm -f conftest* 
16833   if test x$ac_cv_sizeof_int != x ; then break; fi 
16834 done 
16835
16836 fi
16837  
16838 if test x$ac_cv_sizeof_int = x ; then 
16839   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16840 fi 
16841 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16842 cat >> confdefs.h <<EOF
16843 #define SIZEOF_INT $ac_cv_sizeof_int
16844 EOF
16845  
16846  
16847 echo $ac_n "checking size of long""... $ac_c" 1>&6
16848 echo "configure:16849: checking size of long" >&5 
16849 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16850   echo $ac_n "(cached) $ac_c" 1>&6
16851 else
16852   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16853   cat > conftest.$ac_ext <<EOF
16854 #line 16855 "configure"
16855 #include "confdefs.h"
16856 #include "confdefs.h" 
16857 #include <sys/types.h> 
16858  
16859
16860 int main() {
16861 switch (0) case 0: case (sizeof (long) == $ac_size):;
16862 ; return 0; }
16863 EOF
16864 if { (eval echo configure:16865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16865   rm -rf conftest*
16866   ac_cv_sizeof_long=$ac_size
16867 else
16868   echo "configure: failed program was:" >&5
16869   cat conftest.$ac_ext >&5
16870 fi
16871 rm -f conftest* 
16872   if test x$ac_cv_sizeof_long != x ; then break; fi 
16873 done 
16874
16875 fi
16876  
16877 if test x$ac_cv_sizeof_long = x ; then 
16878   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16879 fi 
16880 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16881 cat >> confdefs.h <<EOF
16882 #define SIZEOF_LONG $ac_cv_sizeof_long
16883 EOF
16884  
16885
16886
16887 if test "$ac_cv_sizeof_int" -lt 4 ; then
16888         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16889
16890         cat >> confdefs.h <<\EOF
16891 #define LBER_INT_T long
16892 EOF
16893
16894 else
16895         cat >> confdefs.h <<\EOF
16896 #define LBER_INT_T int
16897 EOF
16898
16899 fi
16900
16901 cat >> confdefs.h <<\EOF
16902 #define LBER_LEN_T long
16903 EOF
16904
16905 cat >> confdefs.h <<\EOF
16906 #define LBER_SOCKET_T int
16907 EOF
16908
16909 cat >> confdefs.h <<\EOF
16910 #define LBER_TAG_T long
16911 EOF
16912
16913
16914 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16915 echo "configure:16916: checking for 8-bit clean memcmp" >&5
16916 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16917   echo $ac_n "(cached) $ac_c" 1>&6
16918 else
16919   if test "$cross_compiling" = yes; then
16920   ac_cv_func_memcmp_clean=no
16921 else
16922   cat > conftest.$ac_ext <<EOF
16923 #line 16924 "configure"
16924 #include "confdefs.h"
16925
16926 main()
16927 {
16928   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16929   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16930 }
16931
16932 EOF
16933 if { (eval echo configure:16934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16934 then
16935   ac_cv_func_memcmp_clean=yes
16936 else
16937   echo "configure: failed program was:" >&5
16938   cat conftest.$ac_ext >&5
16939   rm -fr conftest*
16940   ac_cv_func_memcmp_clean=no
16941 fi
16942 rm -fr conftest*
16943 fi
16944
16945 fi
16946
16947 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16948 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16949
16950 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16951 echo "configure:16952: checking for strftime" >&5
16952 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16953   echo $ac_n "(cached) $ac_c" 1>&6
16954 else
16955   cat > conftest.$ac_ext <<EOF
16956 #line 16957 "configure"
16957 #include "confdefs.h"
16958 /* System header to define __stub macros and hopefully few prototypes,
16959     which can conflict with char strftime(); below.  */
16960 #include <assert.h>
16961 /* Override any gcc2 internal prototype to avoid an error.  */
16962 /* We use char because int might match the return type of a gcc2
16963     builtin and then its argument prototype would still apply.  */
16964 char strftime();
16965 char (*f)();
16966
16967 int main() {
16968
16969 /* The GNU C library defines this for functions which it implements
16970     to always fail with ENOSYS.  Some functions are actually named
16971     something starting with __ and the normal name is an alias.  */
16972 #if defined (__stub_strftime) || defined (__stub___strftime)
16973 choke me
16974 #else
16975 f = strftime;
16976 #endif
16977
16978 ; return 0; }
16979 EOF
16980 if { (eval echo configure:16981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16981   rm -rf conftest*
16982   eval "ac_cv_func_strftime=yes"
16983 else
16984   echo "configure: failed program was:" >&5
16985   cat conftest.$ac_ext >&5
16986   rm -rf conftest*
16987   eval "ac_cv_func_strftime=no"
16988 fi
16989 rm -f conftest*
16990 fi
16991
16992 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16993   echo "$ac_t""yes" 1>&6
16994   cat >> confdefs.h <<\EOF
16995 #define HAVE_STRFTIME 1
16996 EOF
16997
16998 else
16999   echo "$ac_t""no" 1>&6
17000 # strftime is in -lintl on SCO UNIX.
17001 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
17002 echo "configure:17003: checking for strftime in -lintl" >&5
17003 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
17004 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
17005   echo $ac_n "(cached) $ac_c" 1>&6
17006 else
17007   ac_save_LIBS="$LIBS"
17008 LIBS="-lintl  $LIBS"
17009 cat > conftest.$ac_ext <<EOF
17010 #line 17011 "configure"
17011 #include "confdefs.h"
17012 /* Override any gcc2 internal prototype to avoid an error.  */
17013 /* We use char because int might match the return type of a gcc2
17014     builtin and then its argument prototype would still apply.  */
17015 char strftime();
17016
17017 int main() {
17018 strftime()
17019 ; return 0; }
17020 EOF
17021 if { (eval echo configure:17022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17022   rm -rf conftest*
17023   eval "ac_cv_lib_$ac_lib_var=yes"
17024 else
17025   echo "configure: failed program was:" >&5
17026   cat conftest.$ac_ext >&5
17027   rm -rf conftest*
17028   eval "ac_cv_lib_$ac_lib_var=no"
17029 fi
17030 rm -f conftest*
17031 LIBS="$ac_save_LIBS"
17032
17033 fi
17034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
17035   echo "$ac_t""yes" 1>&6
17036   cat >> confdefs.h <<\EOF
17037 #define HAVE_STRFTIME 1
17038 EOF
17039
17040 LIBS="-lintl $LIBS"
17041 else
17042   echo "$ac_t""no" 1>&6
17043 fi
17044
17045 fi
17046
17047
17048 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
17049 echo "configure:17050: checking for inet_aton()" >&5
17050 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
17051   echo $ac_n "(cached) $ac_c" 1>&6
17052 else
17053   cat > conftest.$ac_ext <<EOF
17054 #line 17055 "configure"
17055 #include "confdefs.h"
17056
17057 #ifdef HAVE_SYS_TYPES_H
17058 #       include <sys/types.h>
17059 #endif
17060 #ifdef HAVE_SYS_SOCKET_H
17061 #       include <sys/socket.h>
17062 #       ifdef HAVE_SYS_SELECT_H
17063 #               include <sys/select.h>
17064 #       endif
17065 #       include <netinet/in.h>
17066 #       ifdef HAVE_ARPA_INET_H
17067 #               include <arpa/inet.h>
17068 #       endif
17069 #endif
17070
17071 int main() {
17072 struct in_addr in;
17073 int rc = inet_aton( "255.255.255.255", &in );
17074 ; return 0; }
17075 EOF
17076 if { (eval echo configure:17077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17077   rm -rf conftest*
17078   ol_cv_func_inet_aton=yes
17079 else
17080   echo "configure: failed program was:" >&5
17081   cat conftest.$ac_ext >&5
17082   rm -rf conftest*
17083   ol_cv_func_inet_aton=no
17084 fi
17085 rm -f conftest*
17086 fi
17087
17088 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
17089   if test $ol_cv_func_inet_aton != no; then
17090     cat >> confdefs.h <<\EOF
17091 #define HAVE_INET_ATON 1
17092 EOF
17093
17094   fi
17095  
17096
17097 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
17098 echo "configure:17099: checking for _spawnlp" >&5
17099 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
17100   echo $ac_n "(cached) $ac_c" 1>&6
17101 else
17102   cat > conftest.$ac_ext <<EOF
17103 #line 17104 "configure"
17104 #include "confdefs.h"
17105 /* System header to define __stub macros and hopefully few prototypes,
17106     which can conflict with char _spawnlp(); below.  */
17107 #include <assert.h>
17108 /* Override any gcc2 internal prototype to avoid an error.  */
17109 /* We use char because int might match the return type of a gcc2
17110     builtin and then its argument prototype would still apply.  */
17111 char _spawnlp();
17112 char (*f)();
17113
17114 int main() {
17115
17116 /* The GNU C library defines this for functions which it implements
17117     to always fail with ENOSYS.  Some functions are actually named
17118     something starting with __ and the normal name is an alias.  */
17119 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
17120 choke me
17121 #else
17122 f = _spawnlp;
17123 #endif
17124
17125 ; return 0; }
17126 EOF
17127 if { (eval echo configure:17128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17128   rm -rf conftest*
17129   eval "ac_cv_func__spawnlp=yes"
17130 else
17131   echo "configure: failed program was:" >&5
17132   cat conftest.$ac_ext >&5
17133   rm -rf conftest*
17134   eval "ac_cv_func__spawnlp=no"
17135 fi
17136 rm -f conftest*
17137 fi
17138
17139 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
17140   echo "$ac_t""yes" 1>&6
17141   cat >> confdefs.h <<\EOF
17142 #define HAVE_SPAWNLP 1
17143 EOF
17144
17145 else
17146   echo "$ac_t""no" 1>&6
17147 fi
17148
17149
17150 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
17151 echo "configure:17152: checking for _snprintf" >&5
17152 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
17153   echo $ac_n "(cached) $ac_c" 1>&6
17154 else
17155   cat > conftest.$ac_ext <<EOF
17156 #line 17157 "configure"
17157 #include "confdefs.h"
17158 /* System header to define __stub macros and hopefully few prototypes,
17159     which can conflict with char _snprintf(); below.  */
17160 #include <assert.h>
17161 /* Override any gcc2 internal prototype to avoid an error.  */
17162 /* We use char because int might match the return type of a gcc2
17163     builtin and then its argument prototype would still apply.  */
17164 char _snprintf();
17165 char (*f)();
17166
17167 int main() {
17168
17169 /* The GNU C library defines this for functions which it implements
17170     to always fail with ENOSYS.  Some functions are actually named
17171     something starting with __ and the normal name is an alias.  */
17172 #if defined (__stub__snprintf) || defined (__stub____snprintf)
17173 choke me
17174 #else
17175 f = _snprintf;
17176 #endif
17177
17178 ; return 0; }
17179 EOF
17180 if { (eval echo configure:17181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17181   rm -rf conftest*
17182   eval "ac_cv_func__snprintf=yes"
17183 else
17184   echo "configure: failed program was:" >&5
17185   cat conftest.$ac_ext >&5
17186   rm -rf conftest*
17187   eval "ac_cv_func__snprintf=no"
17188 fi
17189 rm -f conftest*
17190 fi
17191
17192 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17193   echo "$ac_t""yes" 1>&6
17194   ac_cv_func_snprintf=yes
17195         cat >> confdefs.h <<\EOF
17196 #define snprintf _snprintf
17197 EOF
17198
17199
17200 else
17201   echo "$ac_t""no" 1>&6
17202 fi
17203
17204
17205 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17206 echo "configure:17207: checking for _vsnprintf" >&5
17207 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17208   echo $ac_n "(cached) $ac_c" 1>&6
17209 else
17210   cat > conftest.$ac_ext <<EOF
17211 #line 17212 "configure"
17212 #include "confdefs.h"
17213 /* System header to define __stub macros and hopefully few prototypes,
17214     which can conflict with char _vsnprintf(); below.  */
17215 #include <assert.h>
17216 /* Override any gcc2 internal prototype to avoid an error.  */
17217 /* We use char because int might match the return type of a gcc2
17218     builtin and then its argument prototype would still apply.  */
17219 char _vsnprintf();
17220 char (*f)();
17221
17222 int main() {
17223
17224 /* The GNU C library defines this for functions which it implements
17225     to always fail with ENOSYS.  Some functions are actually named
17226     something starting with __ and the normal name is an alias.  */
17227 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17228 choke me
17229 #else
17230 f = _vsnprintf;
17231 #endif
17232
17233 ; return 0; }
17234 EOF
17235 if { (eval echo configure:17236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17236   rm -rf conftest*
17237   eval "ac_cv_func__vsnprintf=yes"
17238 else
17239   echo "configure: failed program was:" >&5
17240   cat conftest.$ac_ext >&5
17241   rm -rf conftest*
17242   eval "ac_cv_func__vsnprintf=no"
17243 fi
17244 rm -f conftest*
17245 fi
17246
17247 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17248   echo "$ac_t""yes" 1>&6
17249   ac_cv_func_vsnprintf=yes
17250         cat >> confdefs.h <<\EOF
17251 #define vsnprintf _vsnprintf
17252 EOF
17253
17254
17255 else
17256   echo "$ac_t""no" 1>&6
17257 fi
17258
17259
17260 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17261 echo "configure:17262: checking for vprintf" >&5
17262 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17263   echo $ac_n "(cached) $ac_c" 1>&6
17264 else
17265   cat > conftest.$ac_ext <<EOF
17266 #line 17267 "configure"
17267 #include "confdefs.h"
17268 /* System header to define __stub macros and hopefully few prototypes,
17269     which can conflict with char vprintf(); below.  */
17270 #include <assert.h>
17271 /* Override any gcc2 internal prototype to avoid an error.  */
17272 /* We use char because int might match the return type of a gcc2
17273     builtin and then its argument prototype would still apply.  */
17274 char vprintf();
17275 char (*f)();
17276
17277 int main() {
17278
17279 /* The GNU C library defines this for functions which it implements
17280     to always fail with ENOSYS.  Some functions are actually named
17281     something starting with __ and the normal name is an alias.  */
17282 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17283 choke me
17284 #else
17285 f = vprintf;
17286 #endif
17287
17288 ; return 0; }
17289 EOF
17290 if { (eval echo configure:17291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17291   rm -rf conftest*
17292   eval "ac_cv_func_vprintf=yes"
17293 else
17294   echo "configure: failed program was:" >&5
17295   cat conftest.$ac_ext >&5
17296   rm -rf conftest*
17297   eval "ac_cv_func_vprintf=no"
17298 fi
17299 rm -f conftest*
17300 fi
17301
17302 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17303   echo "$ac_t""yes" 1>&6
17304   cat >> confdefs.h <<\EOF
17305 #define HAVE_VPRINTF 1
17306 EOF
17307
17308 else
17309   echo "$ac_t""no" 1>&6
17310 fi
17311
17312 if test "$ac_cv_func_vprintf" != yes; then
17313 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17314 echo "configure:17315: checking for _doprnt" >&5
17315 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17316   echo $ac_n "(cached) $ac_c" 1>&6
17317 else
17318   cat > conftest.$ac_ext <<EOF
17319 #line 17320 "configure"
17320 #include "confdefs.h"
17321 /* System header to define __stub macros and hopefully few prototypes,
17322     which can conflict with char _doprnt(); below.  */
17323 #include <assert.h>
17324 /* Override any gcc2 internal prototype to avoid an error.  */
17325 /* We use char because int might match the return type of a gcc2
17326     builtin and then its argument prototype would still apply.  */
17327 char _doprnt();
17328 char (*f)();
17329
17330 int main() {
17331
17332 /* The GNU C library defines this for functions which it implements
17333     to always fail with ENOSYS.  Some functions are actually named
17334     something starting with __ and the normal name is an alias.  */
17335 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17336 choke me
17337 #else
17338 f = _doprnt;
17339 #endif
17340
17341 ; return 0; }
17342 EOF
17343 if { (eval echo configure:17344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17344   rm -rf conftest*
17345   eval "ac_cv_func__doprnt=yes"
17346 else
17347   echo "configure: failed program was:" >&5
17348   cat conftest.$ac_ext >&5
17349   rm -rf conftest*
17350   eval "ac_cv_func__doprnt=no"
17351 fi
17352 rm -f conftest*
17353 fi
17354
17355 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17356   echo "$ac_t""yes" 1>&6
17357   cat >> confdefs.h <<\EOF
17358 #define HAVE_DOPRNT 1
17359 EOF
17360
17361 else
17362   echo "$ac_t""no" 1>&6
17363 fi
17364
17365 fi
17366
17367
17368 if test $ac_cv_func_vprintf = yes ; then
17369                 for ac_func in vsnprintf vsprintf
17370 do
17371 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17372 echo "configure:17373: checking for $ac_func" >&5
17373 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17374   echo $ac_n "(cached) $ac_c" 1>&6
17375 else
17376   cat > conftest.$ac_ext <<EOF
17377 #line 17378 "configure"
17378 #include "confdefs.h"
17379 /* System header to define __stub macros and hopefully few prototypes,
17380     which can conflict with char $ac_func(); below.  */
17381 #include <assert.h>
17382 /* Override any gcc2 internal prototype to avoid an error.  */
17383 /* We use char because int might match the return type of a gcc2
17384     builtin and then its argument prototype would still apply.  */
17385 char $ac_func();
17386 char (*f)();
17387
17388 int main() {
17389
17390 /* The GNU C library defines this for functions which it implements
17391     to always fail with ENOSYS.  Some functions are actually named
17392     something starting with __ and the normal name is an alias.  */
17393 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17394 choke me
17395 #else
17396 f = $ac_func;
17397 #endif
17398
17399 ; return 0; }
17400 EOF
17401 if { (eval echo configure:17402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17402   rm -rf conftest*
17403   eval "ac_cv_func_$ac_func=yes"
17404 else
17405   echo "configure: failed program was:" >&5
17406   cat conftest.$ac_ext >&5
17407   rm -rf conftest*
17408   eval "ac_cv_func_$ac_func=no"
17409 fi
17410 rm -f conftest*
17411 fi
17412
17413 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17414   echo "$ac_t""yes" 1>&6
17415     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17416   cat >> confdefs.h <<EOF
17417 #define $ac_tr_func 1
17418 EOF
17419  
17420 else
17421   echo "$ac_t""no" 1>&6
17422 fi
17423 done
17424
17425 fi
17426
17427 for ac_func in \
17428         bcopy                   \
17429         closesocket             \
17430         chroot                  \
17431         endgrent                \
17432         endpwent                \
17433         fcntl                   \
17434         flock                   \
17435         getdtablesize   \
17436         getgrgid                \
17437         gethostname             \
17438         getpass                 \
17439         getpassphrase   \
17440         getpwuid                \
17441         getpwnam                \
17442         getspnam                \
17443         gettimeofday    \
17444         initgroups              \
17445         lockf                   \
17446         memcpy                  \
17447         memmove                 \
17448         pipe                    \
17449         read                    \
17450         recv                    \
17451         recvfrom                \
17452         setpwfile               \
17453         setgid                  \
17454         setegid                 \
17455         setsid                  \
17456         setuid                  \
17457         seteuid                 \
17458         sigaction               \
17459         signal                  \
17460         sigset                  \
17461         strdup                  \
17462         strerror                \
17463         strpbrk                 \
17464         strrchr                 \
17465         strsep                  \
17466         strstr                  \
17467         strtol                  \
17468         strtoul                 \
17469         strspn                  \
17470         sysconf                 \
17471         usleep                  \
17472         waitpid                 \
17473         wait4                   \
17474         write                   \
17475         send                    \
17476         sendto                  \
17477
17478 do
17479 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17480 echo "configure:17481: checking for $ac_func" >&5
17481 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17482   echo $ac_n "(cached) $ac_c" 1>&6
17483 else
17484   cat > conftest.$ac_ext <<EOF
17485 #line 17486 "configure"
17486 #include "confdefs.h"
17487 /* System header to define __stub macros and hopefully few prototypes,
17488     which can conflict with char $ac_func(); below.  */
17489 #include <assert.h>
17490 /* Override any gcc2 internal prototype to avoid an error.  */
17491 /* We use char because int might match the return type of a gcc2
17492     builtin and then its argument prototype would still apply.  */
17493 char $ac_func();
17494 char (*f)();
17495
17496 int main() {
17497
17498 /* The GNU C library defines this for functions which it implements
17499     to always fail with ENOSYS.  Some functions are actually named
17500     something starting with __ and the normal name is an alias.  */
17501 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17502 choke me
17503 #else
17504 f = $ac_func;
17505 #endif
17506
17507 ; return 0; }
17508 EOF
17509 if { (eval echo configure:17510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17510   rm -rf conftest*
17511   eval "ac_cv_func_$ac_func=yes"
17512 else
17513   echo "configure: failed program was:" >&5
17514   cat conftest.$ac_ext >&5
17515   rm -rf conftest*
17516   eval "ac_cv_func_$ac_func=no"
17517 fi
17518 rm -f conftest*
17519 fi
17520
17521 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17522   echo "$ac_t""yes" 1>&6
17523     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17524   cat >> confdefs.h <<EOF
17525 #define $ac_tr_func 1
17526 EOF
17527  
17528 else
17529   echo "$ac_t""no" 1>&6
17530 fi
17531 done
17532
17533
17534 for ac_func in getopt
17535 do
17536 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17537 echo "configure:17538: checking for $ac_func" >&5
17538 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17539   echo $ac_n "(cached) $ac_c" 1>&6
17540 else
17541   cat > conftest.$ac_ext <<EOF
17542 #line 17543 "configure"
17543 #include "confdefs.h"
17544 /* System header to define __stub macros and hopefully few prototypes,
17545     which can conflict with char $ac_func(); below.  */
17546 #include <assert.h>
17547 /* Override any gcc2 internal prototype to avoid an error.  */
17548 /* We use char because int might match the return type of a gcc2
17549     builtin and then its argument prototype would still apply.  */
17550 char $ac_func();
17551 char (*f)();
17552
17553 int main() {
17554
17555 /* The GNU C library defines this for functions which it implements
17556     to always fail with ENOSYS.  Some functions are actually named
17557     something starting with __ and the normal name is an alias.  */
17558 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17559 choke me
17560 #else
17561 f = $ac_func;
17562 #endif
17563
17564 ; return 0; }
17565 EOF
17566 if { (eval echo configure:17567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17567   rm -rf conftest*
17568   eval "ac_cv_func_$ac_func=yes"
17569 else
17570   echo "configure: failed program was:" >&5
17571   cat conftest.$ac_ext >&5
17572   rm -rf conftest*
17573   eval "ac_cv_func_$ac_func=no"
17574 fi
17575 rm -f conftest*
17576 fi
17577
17578 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17579   echo "$ac_t""yes" 1>&6
17580     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17581   cat >> confdefs.h <<EOF
17582 #define $ac_tr_func 1
17583 EOF
17584  
17585 else
17586   echo "$ac_t""no" 1>&6
17587 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17588 fi
17589 done
17590
17591
17592
17593 if test "$ac_cv_func_getopt" != yes; then
17594     LIBSRCS="$LIBSRCS getopt.c"
17595 fi
17596
17597 # Check Configuration
17598 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17599 echo "configure:17600: checking declaration of sys_errlist" >&5
17600 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17601   echo $ac_n "(cached) $ac_c" 1>&6
17602 else
17603   
17604         cat > conftest.$ac_ext <<EOF
17605 #line 17606 "configure"
17606 #include "confdefs.h"
17607
17608 #include <stdio.h>
17609 #include <sys/types.h>
17610 #include <errno.h>
17611 #ifdef WINNT
17612 #include <stdlib.h>
17613 #endif 
17614 int main() {
17615 char *c = (char *) *sys_errlist
17616 ; return 0; }
17617 EOF
17618 if { (eval echo configure:17619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17619   rm -rf conftest*
17620   ol_cv_dcl_sys_errlist=yes
17621         ol_cv_have_sys_errlist=yes
17622 else
17623   echo "configure: failed program was:" >&5
17624   cat conftest.$ac_ext >&5
17625   rm -rf conftest*
17626   ol_cv_dcl_sys_errlist=no
17627 fi
17628 rm -f conftest*
17629 fi
17630
17631 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17632 #
17633 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17634 if test $ol_cv_dcl_sys_errlist = no ; then
17635         cat >> confdefs.h <<\EOF
17636 #define DECL_SYS_ERRLIST 1
17637 EOF
17638
17639
17640         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17641 echo "configure:17642: checking existence of sys_errlist" >&5
17642 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17643   echo $ac_n "(cached) $ac_c" 1>&6
17644 else
17645   
17646                 cat > conftest.$ac_ext <<EOF
17647 #line 17648 "configure"
17648 #include "confdefs.h"
17649 #include <errno.h>
17650 int main() {
17651 char *c = (char *) *sys_errlist
17652 ; return 0; }
17653 EOF
17654 if { (eval echo configure:17655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17655   rm -rf conftest*
17656   ol_cv_have_sys_errlist=yes
17657 else
17658   echo "configure: failed program was:" >&5
17659   cat conftest.$ac_ext >&5
17660   rm -rf conftest*
17661   ol_cv_have_sys_errlist=no
17662 fi
17663 rm -f conftest*
17664 fi
17665
17666 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17667 fi
17668 if test $ol_cv_have_sys_errlist = yes ; then
17669         cat >> confdefs.h <<\EOF
17670 #define HAVE_SYS_ERRLIST 1
17671 EOF
17672
17673 fi
17674
17675
17676
17677 if test "$ol_enable_debug" != no ; then
17678         cat >> confdefs.h <<\EOF
17679 #define LDAP_DEBUG 1
17680 EOF
17681
17682 fi
17683 if test "$ol_enable_syslog" = yes ; then
17684         cat >> confdefs.h <<\EOF
17685 #define LDAP_SYSLOG 1
17686 EOF
17687
17688 fi
17689 if test "$ol_enable_cache" = no ; then
17690         cat >> confdefs.h <<\EOF
17691 #define LDAP_NOCACHE 1
17692 EOF
17693
17694 fi
17695 if test "$ol_link_kbind" != no ; then
17696         cat >> confdefs.h <<\EOF
17697 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17698 EOF
17699
17700 fi
17701 if test "$ol_enable_proctitle" != no ; then
17702         cat >> confdefs.h <<\EOF
17703 #define LDAP_PROCTITLE 1
17704 EOF
17705
17706 fi
17707 if test "$ol_enable_referrals" != no ; then
17708         cat >> confdefs.h <<\EOF
17709 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17710 EOF
17711
17712 fi
17713 if test "$ol_enable_local" != no; then
17714         cat >> confdefs.h <<\EOF
17715 #define LDAP_PF_LOCAL 1
17716 EOF
17717
17718 fi
17719 if test "$ol_link_ipv6" != no; then
17720         cat >> confdefs.h <<\EOF
17721 #define LDAP_PF_INET6 1
17722 EOF
17723
17724 fi
17725 if test "$ol_enable_cleartext" != no ; then
17726         cat >> confdefs.h <<\EOF
17727 #define SLAPD_CLEARTEXT 1
17728 EOF
17729
17730 fi
17731 if test "$ol_enable_crypt" != no ; then
17732         cat >> confdefs.h <<\EOF
17733 #define SLAPD_CRYPT 1
17734 EOF
17735
17736 fi
17737 if test "$ol_link_kpasswd" != no ; then
17738         cat >> confdefs.h <<\EOF
17739 #define SLAPD_KPASSWD 1
17740 EOF
17741
17742 fi
17743 if test "$ol_link_spasswd" != no ; then
17744         cat >> confdefs.h <<\EOF
17745 #define SLAPD_SPASSWD 1
17746 EOF
17747
17748 fi
17749 if test "$ol_enable_phonetic" != no ; then
17750         cat >> confdefs.h <<\EOF
17751 #define SLAPD_PHONETIC 1
17752 EOF
17753
17754 fi
17755 if test "$ol_enable_rlookups" != no ; then
17756         cat >> confdefs.h <<\EOF
17757 #define SLAPD_RLOOKUPS 1
17758 EOF
17759
17760 fi
17761 if test "$ol_enable_aci" != no ; then
17762         cat >> confdefs.h <<\EOF
17763 #define SLAPD_ACI_ENABLED 1
17764 EOF
17765
17766 fi
17767
17768 if test "$ol_link_modules" != no ; then
17769         cat >> confdefs.h <<\EOF
17770 #define SLAPD_MODULES 1
17771 EOF
17772
17773         BUILD_SLAPD=yes
17774         SLAPD_MODULES_LDFLAGS="-dlopen self"
17775 fi
17776
17777 if test "$ol_enable_bdb" != no ; then
17778         cat >> confdefs.h <<\EOF
17779 #define SLAPD_BDB 1
17780 EOF
17781
17782         BUILD_SLAPD=yes
17783         BUILD_BDB=yes
17784         if test "$ol_with_bdb_module" != static ; then
17785                 cat >> confdefs.h <<\EOF
17786 #define SLAPD_BDB_DYNAMIC 1
17787 EOF
17788
17789                 BUILD_BDB=mod
17790                 BUILD_BDB_DYNAMIC=shared
17791                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17792         fi
17793 fi
17794
17795 if test "$ol_link_dnssrv" != no ; then
17796         cat >> confdefs.h <<\EOF
17797 #define SLAPD_DNSSRV 1
17798 EOF
17799
17800         BUILD_SLAPD=yes
17801         BUILD_DNSSRV=yes
17802         if test "$ol_with_dnssrv_module" != static ; then
17803                 cat >> confdefs.h <<\EOF
17804 #define SLAPD_DNSSRV_DYNAMIC 1
17805 EOF
17806
17807                 BUILD_DNSSRV=mod
17808                 BUILD_DNSSRV_DYNAMIC=shared
17809                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17810         fi
17811 fi
17812
17813 if test "$ol_enable_ldap" != no ; then
17814         cat >> confdefs.h <<\EOF
17815 #define SLAPD_LDAP 1
17816 EOF
17817
17818         BUILD_SLAPD=yes
17819         BUILD_LDAP=yes
17820         if test "$ol_with_ldap_module" != static ; then
17821                 cat >> confdefs.h <<\EOF
17822 #define SLAPD_LDAP_DYNAMIC 1
17823 EOF
17824
17825                 BUILD_LDAP=mod
17826                 BUILD_LDAP_DYNAMIC=shared
17827                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17828         fi
17829 fi
17830
17831 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17832         cat >> confdefs.h <<\EOF
17833 #define SLAPD_LDBM 1
17834 EOF
17835
17836         BUILD_SLAPD=yes
17837         BUILD_LDBM=yes
17838         LDBM_LIB="-lldbm"
17839         if test "$ol_with_ldbm_module" != static ; then
17840                 cat >> confdefs.h <<\EOF
17841 #define SLAPD_LDBM_DYNAMIC 1
17842 EOF
17843
17844                 BUILD_LDBM=mod
17845                 BUILD_LDBM_DYNAMIC=shared
17846                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17847         fi
17848 fi
17849
17850 if test "$ol_enable_meta" != no ; then
17851         if test "$ol_enable_ldap" = no ; then
17852                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17853         fi
17854         if test "$ol_enable_rewrite" = no ; then
17855                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17856         fi
17857         cat >> confdefs.h <<\EOF
17858 #define SLAPD_META 1
17859 EOF
17860
17861         BUILD_SLAPD=yes
17862         BUILD_META=yes
17863         if test "$ol_with_meta_module" != static ; then
17864                 cat >> confdefs.h <<\EOF
17865 #define SLAPD_META_DYNAMIC 1
17866 EOF
17867
17868                 BUILD_META=mod
17869                 BUILD_META_DYNAMIC=shared
17870                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17871         fi
17872 fi
17873
17874 if test "$ol_enable_monitor" != no ; then
17875         cat >> confdefs.h <<\EOF
17876 #define SLAPD_MONITOR 1
17877 EOF
17878
17879         BUILD_SLAPD=yes
17880         BUILD_MONITOR=yes
17881         if test "$ol_with_monitor_module" != static ; then
17882                 cat >> confdefs.h <<\EOF
17883 #define SLAPD_MONITOR_DYNAMIC 1
17884 EOF
17885
17886                 BUILD_MONITOR=mod
17887                 BUILD_MONITOR_DYNAMIC=shared
17888                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17889         fi
17890 fi
17891
17892 if test "$ol_enable_passwd" != no ; then
17893         cat >> confdefs.h <<\EOF
17894 #define SLAPD_PASSWD 1
17895 EOF
17896
17897         BUILD_SLAPD=yes
17898         BUILD_PASSWD=yes
17899         if test "$ol_with_passwd_module" != static ; then
17900                 cat >> confdefs.h <<\EOF
17901 #define SLAPD_PASSWD_DYNAMIC 1
17902 EOF
17903
17904                 BUILD_PASSWD=mod
17905                 BUILD_PASSWD_DYNAMIC=shared
17906                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17907         fi
17908 fi
17909
17910 if test "$ol_link_perl" != no ; then
17911         cat >> confdefs.h <<\EOF
17912 #define SLAPD_PERL 1
17913 EOF
17914
17915         BUILD_SLAPD=yes
17916         BUILD_PERL=yes
17917         if test "$ol_with_perl_module" != static ; then
17918                 cat >> confdefs.h <<\EOF
17919 #define SLAPD_PERL_DYNAMIC 1
17920 EOF
17921
17922                 BUILD_PERL=mod
17923                 BUILD_PERL_DYNAMIC=shared
17924                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17925         fi
17926 fi
17927
17928 if test "$ol_enable_shell" != no ; then
17929         cat >> confdefs.h <<\EOF
17930 #define SLAPD_SHELL 1
17931 EOF
17932
17933         BUILD_SLAPD=yes
17934         BUILD_SHELL=yes
17935         if test "$ol_with_shell_module" != static ; then
17936                 cat >> confdefs.h <<\EOF
17937 #define SLAPD_SHELL_DYNAMIC 1
17938 EOF
17939
17940                 BUILD_SHELL=mod
17941                 BUILD_SHELL_DYNAMIC=shared
17942                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17943         fi
17944 fi
17945
17946 if test "$ol_enable_tcl" != no ; then
17947         cat >> confdefs.h <<\EOF
17948 #define SLAPD_TCL 1
17949 EOF
17950
17951         BUILD_SLAPD=yes
17952         BUILD_TCL=yes
17953         if test "$ol_with_tcl_module" != static; then
17954                 cat >> confdefs.h <<\EOF
17955 #define SLAPD_TCL_DYNAMIC 1
17956 EOF
17957
17958                 BUILD_TCL=mod
17959                 BUILD_TCL_DYNAMIC=shared
17960                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17961         fi
17962 fi
17963
17964 if test "$ol_link_sql" != no ; then
17965         cat >> confdefs.h <<\EOF
17966 #define SLAPD_SQL 1
17967 EOF
17968
17969         BUILD_SLAPD=yes
17970         BUILD_SQL=yes
17971         if test "$ol_with_sql_module" != static; then
17972                 cat >> confdefs.h <<\EOF
17973 #define SLAPD_SQL_DYNAMIC 1
17974 EOF
17975
17976                 BUILD_SQL=mod
17977                 BUILD_SQL_DYNAMIC=shared
17978                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17979         fi
17980 fi
17981
17982 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17983         $BUILD_SLAPD = yes ; then
17984         BUILD_SLURPD=yes
17985 fi
17986
17987 if test "$ol_enable_rewrite" != no ; then
17988         cat >> confdefs.h <<\EOF
17989 #define ENABLE_REWRITE 1
17990 EOF
17991
17992         BUILD_REWRITE=yes
17993         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17994 fi
17995
17996
17997
17998 if test "$ac_cv_mingw32" = yes ; then
17999     PLAT=NT
18000     SLAPD_MODULES_LDFLAGS=
18001     SLAPD_MODULES_LIST=
18002 else
18003     PLAT=UNIX
18004 fi
18005
18006
18007
18008
18009
18010
18011   
18012   
18013   
18014   
18015   
18016   
18017   
18018   
18019   
18020   
18021   
18022   
18023   
18024   
18025   
18026   
18027   
18028   
18029   
18030   
18031   
18032   
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071 trap '' 1 2 15
18072
18073 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
18074
18075 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18076 # Let make expand exec_prefix.
18077 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18078
18079 # Any assignment to VPATH causes Sun make to only execute
18080 # the first set of double-colon rules, so remove it if not needed.
18081 # If there is a colon in the path, we need to keep it.
18082 if test "x$srcdir" = x.; then
18083   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
18084 fi
18085
18086 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
18087
18088 DEFS=-DHAVE_CONFIG_H
18089
18090 # Without the "./", some shells look in PATH for config.status.
18091 : ${CONFIG_STATUS=./config.status}
18092
18093 echo creating $CONFIG_STATUS
18094 rm -f $CONFIG_STATUS
18095 cat > $CONFIG_STATUS <<EOF
18096 #! /bin/sh
18097 # Generated automatically by configure.
18098 # Run this file to recreate the current configuration.
18099 # This directory was configured as follows,
18100 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18101 #
18102 # $0 $ac_configure_args
18103 #
18104 # Compiler output produced by configure, useful for debugging
18105 # configure, is in ./config.log if it exists.
18106
18107 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
18108 for ac_option
18109 do
18110   case "\$ac_option" in
18111   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18112     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
18113     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
18114   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
18115     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
18116     exit 0 ;;
18117   -help | --help | --hel | --he | --h)
18118     echo "\$ac_cs_usage"; exit 0 ;;
18119   *) echo "\$ac_cs_usage"; exit 1 ;;
18120   esac
18121 done
18122
18123 ac_given_srcdir=$srcdir
18124 ac_given_INSTALL="$INSTALL"
18125
18126 trap 'rm -fr `echo "\
18127 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18128 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18129 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18130 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18131 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18132 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18133 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18134 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18135 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18136 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18137 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18138 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18139 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18140 include/Makefile:build/top.mk:include/Makefile.in \
18141 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18142 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18143 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18144 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18145 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18146 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18147 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18148 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18149 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18150 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18151 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18152 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18153 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18154 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18155 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18156 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18157 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18158 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18159 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18160 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18161 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18162 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18163 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18164 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18165 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18166 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18167 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18168 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18169  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18170 EOF
18171 cat >> $CONFIG_STATUS <<EOF
18172
18173 # Protect against being on the right side of a sed subst in config.status.
18174 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18175  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18176 $ac_vpsub
18177 $extrasub
18178 s%@SHELL@%$SHELL%g
18179 s%@CFLAGS@%$CFLAGS%g
18180 s%@CPPFLAGS@%$CPPFLAGS%g
18181 s%@CXXFLAGS@%$CXXFLAGS%g
18182 s%@FFLAGS@%$FFLAGS%g
18183 s%@DEFS@%$DEFS%g
18184 s%@LDFLAGS@%$LDFLAGS%g
18185 s%@LIBS@%$LIBS%g
18186 s%@exec_prefix@%$exec_prefix%g
18187 s%@prefix@%$prefix%g
18188 s%@program_transform_name@%$program_transform_name%g
18189 s%@bindir@%$bindir%g
18190 s%@sbindir@%$sbindir%g
18191 s%@libexecdir@%$libexecdir%g
18192 s%@datadir@%$datadir%g
18193 s%@sysconfdir@%$sysconfdir%g
18194 s%@sharedstatedir@%$sharedstatedir%g
18195 s%@localstatedir@%$localstatedir%g
18196 s%@libdir@%$libdir%g
18197 s%@includedir@%$includedir%g
18198 s%@oldincludedir@%$oldincludedir%g
18199 s%@infodir@%$infodir%g
18200 s%@mandir@%$mandir%g
18201 s%@host@%$host%g
18202 s%@host_alias@%$host_alias%g
18203 s%@host_cpu@%$host_cpu%g
18204 s%@host_vendor@%$host_vendor%g
18205 s%@host_os@%$host_os%g
18206 s%@target@%$target%g
18207 s%@target_alias@%$target_alias%g
18208 s%@target_cpu@%$target_cpu%g
18209 s%@target_vendor@%$target_vendor%g
18210 s%@target_os@%$target_os%g
18211 s%@build@%$build%g
18212 s%@build_alias@%$build_alias%g
18213 s%@build_cpu@%$build_cpu%g
18214 s%@build_vendor@%$build_vendor%g
18215 s%@build_os@%$build_os%g
18216 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18217 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18218 s%@INSTALL_DATA@%$INSTALL_DATA%g
18219 s%@PACKAGE@%$PACKAGE%g
18220 s%@VERSION@%$VERSION%g
18221 s%@ACLOCAL@%$ACLOCAL%g
18222 s%@AUTOCONF@%$AUTOCONF%g
18223 s%@AUTOMAKE@%$AUTOMAKE%g
18224 s%@AUTOHEADER@%$AUTOHEADER%g
18225 s%@MAKEINFO@%$MAKEINFO%g
18226 s%@install_sh@%$install_sh%g
18227 s%@AMTAR@%$AMTAR%g
18228 s%@AWK@%$AWK%g
18229 s%@AMTARFLAGS@%$AMTARFLAGS%g
18230 s%@SET_MAKE@%$SET_MAKE%g
18231 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18232 s%@top_builddir@%$top_builddir%g
18233 s%@ldap_subdir@%$ldap_subdir%g
18234 s%@CC@%$CC%g
18235 s%@AR@%$AR%g
18236 s%@RANLIB@%$RANLIB%g
18237 s%@LN_S@%$LN_S%g
18238 s%@DLLTOOL@%$DLLTOOL%g
18239 s%@AS@%$AS%g
18240 s%@OBJDUMP@%$OBJDUMP%g
18241 s%@LIBTOOL@%$LIBTOOL%g
18242 s%@LN_H@%$LN_H%g
18243 s%@SENDMAIL@%$SENDMAIL%g
18244 s%@EDITOR@%$EDITOR%g
18245 s%@FINGER@%$FINGER%g
18246 s%@PERLBIN@%$PERLBIN%g
18247 s%@CPP@%$CPP%g
18248 s%@EXEEXT@%$EXEEXT%g
18249 s%@OBJEXT@%$OBJEXT%g
18250 s%@OL_MKDEP@%$OL_MKDEP%g
18251 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18252 s%@LIBOBJS@%$LIBOBJS%g
18253 s%@LIBSRCS@%$LIBSRCS%g
18254 s%@PLAT@%$PLAT%g
18255 s%@BUILD_LIBS_DYNAMIC@%$BUILD_LIBS_DYNAMIC%g
18256 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18257 s%@BUILD_BDB@%$BUILD_BDB%g
18258 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18259 s%@BUILD_LDAP@%$BUILD_LDAP%g
18260 s%@BUILD_LDBM@%$BUILD_LDBM%g
18261 s%@BUILD_META@%$BUILD_META%g
18262 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18263 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18264 s%@BUILD_PERL@%$BUILD_PERL%g
18265 s%@BUILD_SHELL@%$BUILD_SHELL%g
18266 s%@BUILD_SQL@%$BUILD_SQL%g
18267 s%@BUILD_TCL@%$BUILD_TCL%g
18268 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18269 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18270 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18271 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18272 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18273 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18274 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18275 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18276 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18277 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18278 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18279 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18280 s%@LDBM_LIB@%$LDBM_LIB%g
18281 s%@LDAP_LIBS@%$LDAP_LIBS%g
18282 s%@LDIF_LIBS@%$LDIF_LIBS%g
18283 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18284 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18285 s%@LDBM_LIBS@%$LDBM_LIBS%g
18286 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18287 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18288 s%@WRAP_LIBS@%$WRAP_LIBS%g
18289 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18290 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18291 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18292 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18293 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18294 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18295 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18296 s%@KRB4_LIBS@%$KRB4_LIBS%g
18297 s%@KRB5_LIBS@%$KRB5_LIBS%g
18298 s%@READLINE_LIBS@%$READLINE_LIBS%g
18299 s%@SASL_LIBS@%$SASL_LIBS%g
18300 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18301 s%@TLS_LIBS@%$TLS_LIBS%g
18302 s%@MODULES_LIBS@%$MODULES_LIBS%g
18303 s%@AUTH_LIBS@%$AUTH_LIBS%g
18304 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18305 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18306 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18307 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18308
18309 CEOF
18310 EOF
18311
18312 cat >> $CONFIG_STATUS <<\EOF
18313
18314 # Split the substitutions into bite-sized pieces for seds with
18315 # small command number limits, like on Digital OSF/1 and HP-UX.
18316 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18317 ac_file=1 # Number of current file.
18318 ac_beg=1 # First line for current file.
18319 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18320 ac_more_lines=:
18321 ac_sed_cmds=""
18322 while $ac_more_lines; do
18323   if test $ac_beg -gt 1; then
18324     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18325   else
18326     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18327   fi
18328   if test ! -s conftest.s$ac_file; then
18329     ac_more_lines=false
18330     rm -f conftest.s$ac_file
18331   else
18332     if test -z "$ac_sed_cmds"; then
18333       ac_sed_cmds="sed -f conftest.s$ac_file"
18334     else
18335       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18336     fi
18337     ac_file=`expr $ac_file + 1`
18338     ac_beg=$ac_end
18339     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18340   fi
18341 done
18342 if test -z "$ac_sed_cmds"; then
18343   ac_sed_cmds=cat
18344 fi
18345 EOF
18346
18347 cat >> $CONFIG_STATUS <<EOF
18348
18349 CONFIG_FILES=\${CONFIG_FILES-"\
18350 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18351 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18352 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18353 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18354 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18355 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18356 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18357 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18358 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18359 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18360 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18361 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18362 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18363 include/Makefile:build/top.mk:include/Makefile.in \
18364 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18365 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18366 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18367 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18368 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18369 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18370 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18371 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18372 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18373 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18374 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18375 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18376 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18377 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18378 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18379 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18380 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18381 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18382 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18383 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18384 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18385 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18386 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18387 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18388 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18389 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18390 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18391 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18392 "}
18393 EOF
18394 cat >> $CONFIG_STATUS <<\EOF
18395 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18396   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18397   case "$ac_file" in
18398   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18399        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18400   *) ac_file_in="${ac_file}.in" ;;
18401   esac
18402
18403   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18404
18405   # Remove last slash and all that follows it.  Not all systems have dirname.
18406   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18407   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18408     # The file is in a subdirectory.
18409     test ! -d "$ac_dir" && mkdir "$ac_dir"
18410     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18411     # A "../" for each directory in $ac_dir_suffix.
18412     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18413   else
18414     ac_dir_suffix= ac_dots=
18415   fi
18416
18417   case "$ac_given_srcdir" in
18418   .)  srcdir=.
18419       if test -z "$ac_dots"; then top_srcdir=.
18420       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18421   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18422   *) # Relative path.
18423     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18424     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18425   esac
18426
18427   case "$ac_given_INSTALL" in
18428   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18429   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18430   esac
18431
18432   echo creating "$ac_file"
18433   rm -f "$ac_file"
18434   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18435   case "$ac_file" in
18436   *[Mm]akefile*) ac_comsub="1i\\
18437 # $configure_input" ;;
18438   *) ac_comsub= ;;
18439   esac
18440
18441   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18442   sed -e "$ac_comsub
18443 s%@configure_input@%$configure_input%g
18444 s%@srcdir@%$srcdir%g
18445 s%@top_srcdir@%$top_srcdir%g
18446 s%@INSTALL@%$INSTALL%g
18447 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18448 fi; done
18449 rm -f conftest.s*
18450
18451 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18452 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18453 #
18454 # ac_d sets the value in "#define NAME VALUE" lines.
18455 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18456 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18457 ac_dC='\3'
18458 ac_dD='%g'
18459 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18460 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18461 ac_uB='\([      ]\)%\1#\2define\3'
18462 ac_uC=' '
18463 ac_uD='\4%g'
18464 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18465 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18466 ac_eB='$%\1#\2define\3'
18467 ac_eC=' '
18468 ac_eD='%g'
18469
18470 if test "${CONFIG_HEADERS+set}" != set; then
18471 EOF
18472 cat >> $CONFIG_STATUS <<EOF
18473   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18474 EOF
18475 cat >> $CONFIG_STATUS <<\EOF
18476 fi
18477 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18478   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18479   case "$ac_file" in
18480   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18481        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18482   *) ac_file_in="${ac_file}.in" ;;
18483   esac
18484
18485   echo creating $ac_file
18486
18487   rm -f conftest.frag conftest.in conftest.out
18488   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18489   cat $ac_file_inputs > conftest.in
18490
18491 EOF
18492
18493 # Transform confdefs.h into a sed script conftest.vals that substitutes
18494 # the proper values into config.h.in to produce config.h.  And first:
18495 # Protect against being on the right side of a sed subst in config.status.
18496 # Protect against being in an unquoted here document in config.status.
18497 rm -f conftest.vals
18498 cat > conftest.hdr <<\EOF
18499 s/[\\&%]/\\&/g
18500 s%[\\$`]%\\&%g
18501 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18502 s%ac_d%ac_u%gp
18503 s%ac_u%ac_e%gp
18504 EOF
18505 sed -n -f conftest.hdr confdefs.h > conftest.vals
18506 rm -f conftest.hdr
18507
18508 # This sed command replaces #undef with comments.  This is necessary, for
18509 # example, in the case of _POSIX_SOURCE, which is predefined and required
18510 # on some systems where configure will not decide to define it.
18511 cat >> conftest.vals <<\EOF
18512 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18513 EOF
18514
18515 # Break up conftest.vals because some shells have a limit on
18516 # the size of here documents, and old seds have small limits too.
18517
18518 rm -f conftest.tail
18519 while :
18520 do
18521   ac_lines=`grep -c . conftest.vals`
18522   # grep -c gives empty output for an empty file on some AIX systems.
18523   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18524   # Write a limited-size here document to conftest.frag.
18525   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18526   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18527   echo 'CEOF
18528   sed -f conftest.frag conftest.in > conftest.out
18529   rm -f conftest.in
18530   mv conftest.out conftest.in
18531 ' >> $CONFIG_STATUS
18532   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18533   rm -f conftest.vals
18534   mv conftest.tail conftest.vals
18535 done
18536 rm -f conftest.vals
18537
18538 cat >> $CONFIG_STATUS <<\EOF
18539   rm -f conftest.frag conftest.h
18540   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18541   cat conftest.in >> conftest.h
18542   rm -f conftest.in
18543   if cmp -s $ac_file conftest.h 2>/dev/null; then
18544     echo "$ac_file is unchanged"
18545     rm -f conftest.h
18546   else
18547     # Remove last slash and all that follows it.  Not all systems have dirname.
18548       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18549       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18550       # The file is in a subdirectory.
18551       test ! -d "$ac_dir" && mkdir "$ac_dir"
18552     fi
18553     rm -f $ac_file
18554     mv conftest.h $ac_file
18555   fi
18556 fi; done
18557
18558 EOF
18559 cat >> $CONFIG_STATUS <<EOF
18560
18561 EOF
18562 cat >> $CONFIG_STATUS <<\EOF
18563
18564 date > stamp-h
18565 echo Please \"make depend\" to build dependencies
18566
18567 exit 0
18568 EOF
18569 chmod +x $CONFIG_STATUS
18570 rm -fr confdefs* $ac_clean_files
18571 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18572