]> git.sur5r.net Git - openldap/blob - configure
Add BSD Queue (and list) management
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.379 2001/12/04 17:21:43 kurt Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.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
4992 do
4993 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4994 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4995 echo "configure:4996: checking for $ac_hdr" >&5
4996 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4997   echo $ac_n "(cached) $ac_c" 1>&6
4998 else
4999   cat > conftest.$ac_ext <<EOF
5000 #line 5001 "configure"
5001 #include "confdefs.h"
5002 #include <$ac_hdr>
5003 EOF
5004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5005 { (eval echo configure:5006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5007 if test -z "$ac_err"; then
5008   rm -rf conftest*
5009   eval "ac_cv_header_$ac_safe=yes"
5010 else
5011   echo "$ac_err" >&5
5012   echo "configure: failed program was:" >&5
5013   cat conftest.$ac_ext >&5
5014   rm -rf conftest*
5015   eval "ac_cv_header_$ac_safe=no"
5016 fi
5017 rm -f conftest*
5018 fi
5019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5020   echo "$ac_t""yes" 1>&6
5021     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5022   cat >> confdefs.h <<EOF
5023 #define $ac_tr_hdr 1
5024 EOF
5025  
5026 else
5027   echo "$ac_t""no" 1>&6
5028 fi
5029 done
5030
5031
5032
5033
5034 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
5035 echo "configure:5036: checking for dlopen" >&5
5036 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
5037   echo $ac_n "(cached) $ac_c" 1>&6
5038 else
5039   cat > conftest.$ac_ext <<EOF
5040 #line 5041 "configure"
5041 #include "confdefs.h"
5042 /* System header to define __stub macros and hopefully few prototypes,
5043     which can conflict with char dlopen(); below.  */
5044 #include <assert.h>
5045 /* Override any gcc2 internal prototype to avoid an error.  */
5046 /* We use char because int might match the return type of a gcc2
5047     builtin and then its argument prototype would still apply.  */
5048 char dlopen();
5049 char (*f)();
5050
5051 int main() {
5052
5053 /* The GNU C library defines this for functions which it implements
5054     to always fail with ENOSYS.  Some functions are actually named
5055     something starting with __ and the normal name is an alias.  */
5056 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5057 choke me
5058 #else
5059 f = dlopen;
5060 #endif
5061
5062 ; return 0; }
5063 EOF
5064 if { (eval echo configure:5065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5065   rm -rf conftest*
5066   eval "ac_cv_func_dlopen=yes"
5067 else
5068   echo "configure: failed program was:" >&5
5069   cat conftest.$ac_ext >&5
5070   rm -rf conftest*
5071   eval "ac_cv_func_dlopen=no"
5072 fi
5073 rm -f conftest*
5074 fi
5075
5076 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5077   echo "$ac_t""yes" 1>&6
5078   :
5079 else
5080   echo "$ac_t""no" 1>&6
5081 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5082 echo "configure:5083: checking for dlopen in -ldl" >&5
5083 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5084 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5085   echo $ac_n "(cached) $ac_c" 1>&6
5086 else
5087   ac_save_LIBS="$LIBS"
5088 LIBS="-ldl  $LIBS"
5089 cat > conftest.$ac_ext <<EOF
5090 #line 5091 "configure"
5091 #include "confdefs.h"
5092 /* Override any gcc2 internal prototype to avoid an error.  */
5093 /* We use char because int might match the return type of a gcc2
5094     builtin and then its argument prototype would still apply.  */
5095 char dlopen();
5096
5097 int main() {
5098 dlopen()
5099 ; return 0; }
5100 EOF
5101 if { (eval echo configure:5102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5102   rm -rf conftest*
5103   eval "ac_cv_lib_$ac_lib_var=yes"
5104 else
5105   echo "configure: failed program was:" >&5
5106   cat conftest.$ac_ext >&5
5107   rm -rf conftest*
5108   eval "ac_cv_lib_$ac_lib_var=no"
5109 fi
5110 rm -f conftest*
5111 LIBS="$ac_save_LIBS"
5112
5113 fi
5114 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5115   echo "$ac_t""yes" 1>&6
5116     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5117     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5118   cat >> confdefs.h <<EOF
5119 #define $ac_tr_lib 1
5120 EOF
5121
5122   LIBS="-ldl $LIBS"
5123
5124 else
5125   echo "$ac_t""no" 1>&6
5126 fi
5127
5128 fi
5129
5130
5131 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5132 echo "configure:5133: checking for sigset in -lV3" >&5
5133 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5134 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5135   echo $ac_n "(cached) $ac_c" 1>&6
5136 else
5137   ac_save_LIBS="$LIBS"
5138 LIBS="-lV3  $LIBS"
5139 cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142 /* Override any gcc2 internal prototype to avoid an error.  */
5143 /* We use char because int might match the return type of a gcc2
5144     builtin and then its argument prototype would still apply.  */
5145 char sigset();
5146
5147 int main() {
5148 sigset()
5149 ; return 0; }
5150 EOF
5151 if { (eval echo configure:5152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5152   rm -rf conftest*
5153   eval "ac_cv_lib_$ac_lib_var=yes"
5154 else
5155   echo "configure: failed program was:" >&5
5156   cat conftest.$ac_ext >&5
5157   rm -rf conftest*
5158   eval "ac_cv_lib_$ac_lib_var=no"
5159 fi
5160 rm -f conftest*
5161 LIBS="$ac_save_LIBS"
5162
5163 fi
5164 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5165   echo "$ac_t""yes" 1>&6
5166     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5167     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5168   cat >> confdefs.h <<EOF
5169 #define $ac_tr_lib 1
5170 EOF
5171
5172   LIBS="-lV3 $LIBS"
5173
5174 else
5175   echo "$ac_t""no" 1>&6
5176 fi
5177
5178
5179 if test $ac_cv_header_winsock_h = yes; then
5180         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5181 echo "configure:5182: checking for winsock" >&5
5182 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
5183   echo $ac_n "(cached) $ac_c" 1>&6
5184 else
5185   cat > conftest.$ac_ext <<EOF
5186 #line 5187 "configure"
5187 #include "confdefs.h"
5188 #include <winsock.h>
5189 int main() {
5190
5191                         socket(0,0,0);
5192                         select(0,NULL,NULL,NULL,NULL);
5193                         closesocket(0);
5194                         gethostname(NULL,0);
5195         
5196 ; return 0; }
5197 EOF
5198 if { (eval echo configure:5199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5199   rm -rf conftest*
5200   ol_cv_winsock=yes
5201 else
5202   echo "configure: failed program was:" >&5
5203   cat conftest.$ac_ext >&5
5204   rm -rf conftest*
5205   ol_cv_winsock=no
5206 fi
5207 rm -f conftest*
5208 fi
5209
5210 echo "$ac_t""$ol_cv_winsock" 1>&6
5211
5212         if test $ol_cv_winsock = yes ; then
5213                 cat >> confdefs.h <<\EOF
5214 #define HAVE_WINSOCK 1
5215 EOF
5216
5217                 ac_cv_func_socket=yes
5218                 ac_cv_func_select=yes
5219                 ac_cv_func_closesocket=yes
5220                 ac_cv_func_gethostname=yes
5221         fi
5222 fi
5223
5224
5225 echo $ac_n "checking for socket""... $ac_c" 1>&6
5226 echo "configure:5227: checking for socket" >&5
5227 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5228   echo $ac_n "(cached) $ac_c" 1>&6
5229 else
5230   cat > conftest.$ac_ext <<EOF
5231 #line 5232 "configure"
5232 #include "confdefs.h"
5233 /* System header to define __stub macros and hopefully few prototypes,
5234     which can conflict with char socket(); below.  */
5235 #include <assert.h>
5236 /* Override any gcc2 internal prototype to avoid an error.  */
5237 /* We use char because int might match the return type of a gcc2
5238     builtin and then its argument prototype would still apply.  */
5239 char socket();
5240 char (*f)();
5241
5242 int main() {
5243
5244 /* The GNU C library defines this for functions which it implements
5245     to always fail with ENOSYS.  Some functions are actually named
5246     something starting with __ and the normal name is an alias.  */
5247 #if defined (__stub_socket) || defined (__stub___socket)
5248 choke me
5249 #else
5250 f = socket;
5251 #endif
5252
5253 ; return 0; }
5254 EOF
5255 if { (eval echo configure:5256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5256   rm -rf conftest*
5257   eval "ac_cv_func_socket=yes"
5258 else
5259   echo "configure: failed program was:" >&5
5260   cat conftest.$ac_ext >&5
5261   rm -rf conftest*
5262   eval "ac_cv_func_socket=no"
5263 fi
5264 rm -f conftest*
5265 fi
5266
5267 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5268   echo "$ac_t""yes" 1>&6
5269   :
5270 else
5271   echo "$ac_t""no" 1>&6
5272         
5273         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5274 echo "configure:5275: checking for main in -lsocket" >&5
5275 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5276 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5277   echo $ac_n "(cached) $ac_c" 1>&6
5278 else
5279   ac_save_LIBS="$LIBS"
5280 LIBS="-lsocket  $LIBS"
5281 cat > conftest.$ac_ext <<EOF
5282 #line 5283 "configure"
5283 #include "confdefs.h"
5284
5285 int main() {
5286 main()
5287 ; return 0; }
5288 EOF
5289 if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5290   rm -rf conftest*
5291   eval "ac_cv_lib_$ac_lib_var=yes"
5292 else
5293   echo "configure: failed program was:" >&5
5294   cat conftest.$ac_ext >&5
5295   rm -rf conftest*
5296   eval "ac_cv_lib_$ac_lib_var=no"
5297 fi
5298 rm -f conftest*
5299 LIBS="$ac_save_LIBS"
5300
5301 fi
5302 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5303   echo "$ac_t""yes" 1>&6
5304     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5305     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5306   cat >> confdefs.h <<EOF
5307 #define $ac_tr_lib 1
5308 EOF
5309
5310   LIBS="-lsocket $LIBS"
5311
5312 else
5313   echo "$ac_t""no" 1>&6
5314 fi
5315
5316         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5317 echo "configure:5318: checking for main in -lnet" >&5
5318 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5319 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5320   echo $ac_n "(cached) $ac_c" 1>&6
5321 else
5322   ac_save_LIBS="$LIBS"
5323 LIBS="-lnet  $LIBS"
5324 cat > conftest.$ac_ext <<EOF
5325 #line 5326 "configure"
5326 #include "confdefs.h"
5327
5328 int main() {
5329 main()
5330 ; return 0; }
5331 EOF
5332 if { (eval echo configure:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5333   rm -rf conftest*
5334   eval "ac_cv_lib_$ac_lib_var=yes"
5335 else
5336   echo "configure: failed program was:" >&5
5337   cat conftest.$ac_ext >&5
5338   rm -rf conftest*
5339   eval "ac_cv_lib_$ac_lib_var=no"
5340 fi
5341 rm -f conftest*
5342 LIBS="$ac_save_LIBS"
5343
5344 fi
5345 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5346   echo "$ac_t""yes" 1>&6
5347     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5348     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5349   cat >> confdefs.h <<EOF
5350 #define $ac_tr_lib 1
5351 EOF
5352
5353   LIBS="-lnet $LIBS"
5354
5355 else
5356   echo "$ac_t""no" 1>&6
5357 fi
5358
5359         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5360 echo "configure:5361: checking for main in -lnsl_s" >&5
5361 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5362 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5363   echo $ac_n "(cached) $ac_c" 1>&6
5364 else
5365   ac_save_LIBS="$LIBS"
5366 LIBS="-lnsl_s  $LIBS"
5367 cat > conftest.$ac_ext <<EOF
5368 #line 5369 "configure"
5369 #include "confdefs.h"
5370
5371 int main() {
5372 main()
5373 ; return 0; }
5374 EOF
5375 if { (eval echo configure:5376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5376   rm -rf conftest*
5377   eval "ac_cv_lib_$ac_lib_var=yes"
5378 else
5379   echo "configure: failed program was:" >&5
5380   cat conftest.$ac_ext >&5
5381   rm -rf conftest*
5382   eval "ac_cv_lib_$ac_lib_var=no"
5383 fi
5384 rm -f conftest*
5385 LIBS="$ac_save_LIBS"
5386
5387 fi
5388 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5389   echo "$ac_t""yes" 1>&6
5390     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5391     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5392   cat >> confdefs.h <<EOF
5393 #define $ac_tr_lib 1
5394 EOF
5395
5396   LIBS="-lnsl_s $LIBS"
5397
5398 else
5399   echo "$ac_t""no" 1>&6
5400 fi
5401
5402         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5403 echo "configure:5404: checking for main in -lnsl" >&5
5404 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5405 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5406   echo $ac_n "(cached) $ac_c" 1>&6
5407 else
5408   ac_save_LIBS="$LIBS"
5409 LIBS="-lnsl  $LIBS"
5410 cat > conftest.$ac_ext <<EOF
5411 #line 5412 "configure"
5412 #include "confdefs.h"
5413
5414 int main() {
5415 main()
5416 ; return 0; }
5417 EOF
5418 if { (eval echo configure:5419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5419   rm -rf conftest*
5420   eval "ac_cv_lib_$ac_lib_var=yes"
5421 else
5422   echo "configure: failed program was:" >&5
5423   cat conftest.$ac_ext >&5
5424   rm -rf conftest*
5425   eval "ac_cv_lib_$ac_lib_var=no"
5426 fi
5427 rm -f conftest*
5428 LIBS="$ac_save_LIBS"
5429
5430 fi
5431 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5432   echo "$ac_t""yes" 1>&6
5433     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5434     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5435   cat >> confdefs.h <<EOF
5436 #define $ac_tr_lib 1
5437 EOF
5438
5439   LIBS="-lnsl $LIBS"
5440
5441 else
5442   echo "$ac_t""no" 1>&6
5443 fi
5444
5445         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5446 echo "configure:5447: checking for socket in -linet" >&5
5447 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5448 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5449   echo $ac_n "(cached) $ac_c" 1>&6
5450 else
5451   ac_save_LIBS="$LIBS"
5452 LIBS="-linet  $LIBS"
5453 cat > conftest.$ac_ext <<EOF
5454 #line 5455 "configure"
5455 #include "confdefs.h"
5456 /* Override any gcc2 internal prototype to avoid an error.  */
5457 /* We use char because int might match the return type of a gcc2
5458     builtin and then its argument prototype would still apply.  */
5459 char socket();
5460
5461 int main() {
5462 socket()
5463 ; return 0; }
5464 EOF
5465 if { (eval echo configure:5466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5466   rm -rf conftest*
5467   eval "ac_cv_lib_$ac_lib_var=yes"
5468 else
5469   echo "configure: failed program was:" >&5
5470   cat conftest.$ac_ext >&5
5471   rm -rf conftest*
5472   eval "ac_cv_lib_$ac_lib_var=no"
5473 fi
5474 rm -f conftest*
5475 LIBS="$ac_save_LIBS"
5476
5477 fi
5478 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5479   echo "$ac_t""yes" 1>&6
5480     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5481     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5482   cat >> confdefs.h <<EOF
5483 #define $ac_tr_lib 1
5484 EOF
5485
5486   LIBS="-linet $LIBS"
5487
5488 else
5489   echo "$ac_t""no" 1>&6
5490 fi
5491
5492         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5493 echo "configure:5494: checking for main in -lgen" >&5
5494 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5495 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5496   echo $ac_n "(cached) $ac_c" 1>&6
5497 else
5498   ac_save_LIBS="$LIBS"
5499 LIBS="-lgen  $LIBS"
5500 cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503
5504 int main() {
5505 main()
5506 ; return 0; }
5507 EOF
5508 if { (eval echo configure:5509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5509   rm -rf conftest*
5510   eval "ac_cv_lib_$ac_lib_var=yes"
5511 else
5512   echo "configure: failed program was:" >&5
5513   cat conftest.$ac_ext >&5
5514   rm -rf conftest*
5515   eval "ac_cv_lib_$ac_lib_var=no"
5516 fi
5517 rm -f conftest*
5518 LIBS="$ac_save_LIBS"
5519
5520 fi
5521 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5522   echo "$ac_t""yes" 1>&6
5523     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5524     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5525   cat >> confdefs.h <<EOF
5526 #define $ac_tr_lib 1
5527 EOF
5528
5529   LIBS="-lgen $LIBS"
5530
5531 else
5532   echo "$ac_t""no" 1>&6
5533 fi
5534
5535
5536 fi
5537
5538
5539 echo $ac_n "checking for select""... $ac_c" 1>&6
5540 echo "configure:5541: checking for select" >&5
5541 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5542   echo $ac_n "(cached) $ac_c" 1>&6
5543 else
5544   cat > conftest.$ac_ext <<EOF
5545 #line 5546 "configure"
5546 #include "confdefs.h"
5547 /* System header to define __stub macros and hopefully few prototypes,
5548     which can conflict with char select(); below.  */
5549 #include <assert.h>
5550 /* Override any gcc2 internal prototype to avoid an error.  */
5551 /* We use char because int might match the return type of a gcc2
5552     builtin and then its argument prototype would still apply.  */
5553 char select();
5554 char (*f)();
5555
5556 int main() {
5557
5558 /* The GNU C library defines this for functions which it implements
5559     to always fail with ENOSYS.  Some functions are actually named
5560     something starting with __ and the normal name is an alias.  */
5561 #if defined (__stub_select) || defined (__stub___select)
5562 choke me
5563 #else
5564 f = select;
5565 #endif
5566
5567 ; return 0; }
5568 EOF
5569 if { (eval echo configure:5570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5570   rm -rf conftest*
5571   eval "ac_cv_func_select=yes"
5572 else
5573   echo "configure: failed program was:" >&5
5574   cat conftest.$ac_ext >&5
5575   rm -rf conftest*
5576   eval "ac_cv_func_select=no"
5577 fi
5578 rm -f conftest*
5579 fi
5580
5581 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5582   echo "$ac_t""yes" 1>&6
5583   :
5584 else
5585   echo "$ac_t""no" 1>&6
5586 { echo "configure: error: select() required." 1>&2; exit 1; }
5587 fi
5588
5589
5590 if test "${ac_cv_header_winsock_h}" != yes; then
5591                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5592 echo "configure:5593: checking types of arguments for select()" >&5
5593  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5594   echo $ac_n "(cached) $ac_c" 1>&6
5595 else
5596    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5597   echo $ac_n "(cached) $ac_c" 1>&6
5598 else
5599     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5600   echo $ac_n "(cached) $ac_c" 1>&6
5601 else
5602      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5603      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5604       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5605        cat > conftest.$ac_ext <<EOF
5606 #line 5607 "configure"
5607 #include "confdefs.h"
5608 #ifdef HAVE_SYS_TYPES_H
5609 #include <sys/types.h>
5610 #endif
5611 #ifdef HAVE_SYS_TIME_H
5612 #include <sys/time.h>
5613 #endif
5614 #ifdef HAVE_SYS_SELECT_H
5615 #include <sys/select.h>
5616 #endif
5617 #ifdef HAVE_SYS_SOCKET_H
5618 #include <sys/socket.h>
5619 #endif
5620 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);
5621 int main() {
5622
5623 ; return 0; }
5624 EOF
5625 if { (eval echo configure:5626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5626   rm -rf conftest*
5627           ac_not_found=no ; break 3
5628 else
5629   echo "configure: failed program was:" >&5
5630   cat conftest.$ac_ext >&5
5631   rm -rf conftest*
5632   ac_not_found=yes
5633 fi
5634 rm -f conftest*
5635       done
5636      done
5637     done
5638    
5639 fi
5640   
5641 fi
5642  
5643 fi
5644  if test "$ac_not_found" = yes; then
5645   ac_cv_func_select_arg1=int 
5646   ac_cv_func_select_arg234='int *' 
5647   ac_cv_func_select_arg5='struct timeval *'
5648  fi
5649  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5650  cat >> confdefs.h <<EOF
5651 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5652 EOF
5653
5654  cat >> confdefs.h <<EOF
5655 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5656 EOF
5657
5658  cat >> confdefs.h <<EOF
5659 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5660 EOF
5661
5662
5663 fi
5664
5665
5666 for ac_hdr in regex.h 
5667 do
5668 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5669 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5670 echo "configure:5671: checking for $ac_hdr" >&5
5671 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5672   echo $ac_n "(cached) $ac_c" 1>&6
5673 else
5674   cat > conftest.$ac_ext <<EOF
5675 #line 5676 "configure"
5676 #include "confdefs.h"
5677 #include <$ac_hdr>
5678 EOF
5679 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5680 { (eval echo configure:5681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5681 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5682 if test -z "$ac_err"; then
5683   rm -rf conftest*
5684   eval "ac_cv_header_$ac_safe=yes"
5685 else
5686   echo "$ac_err" >&5
5687   echo "configure: failed program was:" >&5
5688   cat conftest.$ac_ext >&5
5689   rm -rf conftest*
5690   eval "ac_cv_header_$ac_safe=no"
5691 fi
5692 rm -f conftest*
5693 fi
5694 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5695   echo "$ac_t""yes" 1>&6
5696     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5697   cat >> confdefs.h <<EOF
5698 #define $ac_tr_hdr 1
5699 EOF
5700  
5701 else
5702   echo "$ac_t""no" 1>&6
5703 fi
5704 done
5705
5706 if test "$ac_cv_header_regex_h" != yes ; then
5707         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5708 fi
5709 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5710 echo "configure:5711: checking for regfree" >&5
5711 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5712   echo $ac_n "(cached) $ac_c" 1>&6
5713 else
5714   cat > conftest.$ac_ext <<EOF
5715 #line 5716 "configure"
5716 #include "confdefs.h"
5717 /* System header to define __stub macros and hopefully few prototypes,
5718     which can conflict with char regfree(); below.  */
5719 #include <assert.h>
5720 /* Override any gcc2 internal prototype to avoid an error.  */
5721 /* We use char because int might match the return type of a gcc2
5722     builtin and then its argument prototype would still apply.  */
5723 char regfree();
5724 char (*f)();
5725
5726 int main() {
5727
5728 /* The GNU C library defines this for functions which it implements
5729     to always fail with ENOSYS.  Some functions are actually named
5730     something starting with __ and the normal name is an alias.  */
5731 #if defined (__stub_regfree) || defined (__stub___regfree)
5732 choke me
5733 #else
5734 f = regfree;
5735 #endif
5736
5737 ; return 0; }
5738 EOF
5739 if { (eval echo configure:5740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5740   rm -rf conftest*
5741   eval "ac_cv_func_regfree=yes"
5742 else
5743   echo "configure: failed program was:" >&5
5744   cat conftest.$ac_ext >&5
5745   rm -rf conftest*
5746   eval "ac_cv_func_regfree=no"
5747 fi
5748 rm -f conftest*
5749 fi
5750
5751 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5752   echo "$ac_t""yes" 1>&6
5753   :
5754 else
5755   echo "$ac_t""no" 1>&6
5756 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5757 fi
5758
5759
5760
5761 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5762 echo "configure:5763: checking for compatible POSIX regex" >&5
5763 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5764   echo $ac_n "(cached) $ac_c" 1>&6
5765 else
5766   
5767         if test "$cross_compiling" = yes; then
5768   ol_cv_c_posix_regex=cross
5769 else
5770   cat > conftest.$ac_ext <<EOF
5771 #line 5772 "configure"
5772 #include "confdefs.h"
5773
5774 #include <sys/types.h>
5775 #include <regex.h>
5776 static char *pattern, *string;
5777 main()
5778 {
5779         int rc;
5780         regex_t re;
5781
5782         pattern = "^A";
5783
5784         if(regcomp(&re, pattern, 0)) {
5785                 return -1;
5786         }
5787         
5788         string = "ALL MATCH";
5789         
5790         rc = regexec(&re, string, 0, (void*)0, 0);
5791
5792         regfree(&re);
5793
5794         return rc;
5795 }
5796 EOF
5797 if { (eval echo configure:5798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5798 then
5799   ol_cv_c_posix_regex=yes
5800 else
5801   echo "configure: failed program was:" >&5
5802   cat conftest.$ac_ext >&5
5803   rm -fr conftest*
5804   ol_cv_c_posix_regex=no
5805 fi
5806 rm -fr conftest*
5807 fi
5808
5809 fi
5810
5811 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5812
5813 if test "$ol_cv_c_posix_regex" = no ; then
5814         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5815 fi
5816
5817 ol_link_dnssrv=no
5818 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5819 echo "configure:5820: checking for res_query" >&5
5820 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5821   echo $ac_n "(cached) $ac_c" 1>&6
5822 else
5823   cat > conftest.$ac_ext <<EOF
5824 #line 5825 "configure"
5825 #include "confdefs.h"
5826 /* System header to define __stub macros and hopefully few prototypes,
5827     which can conflict with char res_query(); below.  */
5828 #include <assert.h>
5829 /* Override any gcc2 internal prototype to avoid an error.  */
5830 /* We use char because int might match the return type of a gcc2
5831     builtin and then its argument prototype would still apply.  */
5832 char res_query();
5833 char (*f)();
5834
5835 int main() {
5836
5837 /* The GNU C library defines this for functions which it implements
5838     to always fail with ENOSYS.  Some functions are actually named
5839     something starting with __ and the normal name is an alias.  */
5840 #if defined (__stub_res_query) || defined (__stub___res_query)
5841 choke me
5842 #else
5843 f = res_query;
5844 #endif
5845
5846 ; return 0; }
5847 EOF
5848 if { (eval echo configure:5849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5849   rm -rf conftest*
5850   eval "ac_cv_func_res_query=yes"
5851 else
5852   echo "configure: failed program was:" >&5
5853   cat conftest.$ac_ext >&5
5854   rm -rf conftest*
5855   eval "ac_cv_func_res_query=no"
5856 fi
5857 rm -f conftest*
5858 fi
5859
5860 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5861   echo "$ac_t""yes" 1>&6
5862   :
5863 else
5864   echo "$ac_t""no" 1>&6
5865 fi
5866
5867 if test $ac_cv_func_res_query = no ; then 
5868         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5869 echo "configure:5870: checking for __res_query" >&5
5870 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5871   echo $ac_n "(cached) $ac_c" 1>&6
5872 else
5873   cat > conftest.$ac_ext <<EOF
5874 #line 5875 "configure"
5875 #include "confdefs.h"
5876 /* System header to define __stub macros and hopefully few prototypes,
5877     which can conflict with char __res_query(); below.  */
5878 #include <assert.h>
5879 /* Override any gcc2 internal prototype to avoid an error.  */
5880 /* We use char because int might match the return type of a gcc2
5881     builtin and then its argument prototype would still apply.  */
5882 char __res_query();
5883 char (*f)();
5884
5885 int main() {
5886
5887 /* The GNU C library defines this for functions which it implements
5888     to always fail with ENOSYS.  Some functions are actually named
5889     something starting with __ and the normal name is an alias.  */
5890 #if defined (__stub___res_query) || defined (__stub_____res_query)
5891 choke me
5892 #else
5893 f = __res_query;
5894 #endif
5895
5896 ; return 0; }
5897 EOF
5898 if { (eval echo configure:5899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5899   rm -rf conftest*
5900   eval "ac_cv_func___res_query=yes"
5901 else
5902   echo "configure: failed program was:" >&5
5903   cat conftest.$ac_ext >&5
5904   rm -rf conftest*
5905   eval "ac_cv_func___res_query=no"
5906 fi
5907 rm -f conftest*
5908 fi
5909
5910 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5911   echo "$ac_t""yes" 1>&6
5912   :
5913 else
5914   echo "$ac_t""no" 1>&6
5915 fi
5916
5917         ac_cv_func_res_query=$ac_cv_func___res_query
5918 fi
5919
5920 if test $ac_cv_func_res_query = no ; then 
5921         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5922 echo "configure:5923: checking for res_query in -lbind" >&5
5923 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5924 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5925   echo $ac_n "(cached) $ac_c" 1>&6
5926 else
5927   ac_save_LIBS="$LIBS"
5928 LIBS="-lbind  $LIBS"
5929 cat > conftest.$ac_ext <<EOF
5930 #line 5931 "configure"
5931 #include "confdefs.h"
5932 /* Override any gcc2 internal prototype to avoid an error.  */
5933 /* We use char because int might match the return type of a gcc2
5934     builtin and then its argument prototype would still apply.  */
5935 char res_query();
5936
5937 int main() {
5938 res_query()
5939 ; return 0; }
5940 EOF
5941 if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5942   rm -rf conftest*
5943   eval "ac_cv_lib_$ac_lib_var=yes"
5944 else
5945   echo "configure: failed program was:" >&5
5946   cat conftest.$ac_ext >&5
5947   rm -rf conftest*
5948   eval "ac_cv_lib_$ac_lib_var=no"
5949 fi
5950 rm -f conftest*
5951 LIBS="$ac_save_LIBS"
5952
5953 fi
5954 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5955   echo "$ac_t""yes" 1>&6
5956     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5957     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5958   cat >> confdefs.h <<EOF
5959 #define $ac_tr_lib 1
5960 EOF
5961
5962   LIBS="-lbind $LIBS"
5963
5964 else
5965   echo "$ac_t""no" 1>&6
5966 fi
5967
5968         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5969 fi
5970
5971 if test $ac_cv_func_res_query = no ; then 
5972         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5973 echo "configure:5974: checking for __res_query in -lbind" >&5
5974 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5975 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5976   echo $ac_n "(cached) $ac_c" 1>&6
5977 else
5978   ac_save_LIBS="$LIBS"
5979 LIBS="-lbind  $LIBS"
5980 cat > conftest.$ac_ext <<EOF
5981 #line 5982 "configure"
5982 #include "confdefs.h"
5983 /* Override any gcc2 internal prototype to avoid an error.  */
5984 /* We use char because int might match the return type of a gcc2
5985     builtin and then its argument prototype would still apply.  */
5986 char __res_query();
5987
5988 int main() {
5989 __res_query()
5990 ; return 0; }
5991 EOF
5992 if { (eval echo configure:5993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5993   rm -rf conftest*
5994   eval "ac_cv_lib_$ac_lib_var=yes"
5995 else
5996   echo "configure: failed program was:" >&5
5997   cat conftest.$ac_ext >&5
5998   rm -rf conftest*
5999   eval "ac_cv_lib_$ac_lib_var=no"
6000 fi
6001 rm -f conftest*
6002 LIBS="$ac_save_LIBS"
6003
6004 fi
6005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6006   echo "$ac_t""yes" 1>&6
6007     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6008     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6009   cat >> confdefs.h <<EOF
6010 #define $ac_tr_lib 1
6011 EOF
6012
6013   LIBS="-lbind $LIBS"
6014
6015 else
6016   echo "$ac_t""no" 1>&6
6017 fi
6018
6019         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
6020 fi
6021
6022 if test $ac_cv_func_res_query = no ; then 
6023         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
6024 echo "configure:6025: checking for res_query in -lresolv" >&5
6025 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
6026 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6027   echo $ac_n "(cached) $ac_c" 1>&6
6028 else
6029   ac_save_LIBS="$LIBS"
6030 LIBS="-lresolv  $LIBS"
6031 cat > conftest.$ac_ext <<EOF
6032 #line 6033 "configure"
6033 #include "confdefs.h"
6034 /* Override any gcc2 internal prototype to avoid an error.  */
6035 /* We use char because int might match the return type of a gcc2
6036     builtin and then its argument prototype would still apply.  */
6037 char res_query();
6038
6039 int main() {
6040 res_query()
6041 ; return 0; }
6042 EOF
6043 if { (eval echo configure:6044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6044   rm -rf conftest*
6045   eval "ac_cv_lib_$ac_lib_var=yes"
6046 else
6047   echo "configure: failed program was:" >&5
6048   cat conftest.$ac_ext >&5
6049   rm -rf conftest*
6050   eval "ac_cv_lib_$ac_lib_var=no"
6051 fi
6052 rm -f conftest*
6053 LIBS="$ac_save_LIBS"
6054
6055 fi
6056 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6057   echo "$ac_t""yes" 1>&6
6058     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6059     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6060   cat >> confdefs.h <<EOF
6061 #define $ac_tr_lib 1
6062 EOF
6063
6064   LIBS="-lresolv $LIBS"
6065
6066 else
6067   echo "$ac_t""no" 1>&6
6068 fi
6069
6070         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
6071 fi
6072
6073 if test $ac_cv_func_res_query = no ; then 
6074         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
6075 echo "configure:6076: checking for __res_query in -lresolv" >&5
6076 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
6077 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6078   echo $ac_n "(cached) $ac_c" 1>&6
6079 else
6080   ac_save_LIBS="$LIBS"
6081 LIBS="-lresolv  $LIBS"
6082 cat > conftest.$ac_ext <<EOF
6083 #line 6084 "configure"
6084 #include "confdefs.h"
6085 /* Override any gcc2 internal prototype to avoid an error.  */
6086 /* We use char because int might match the return type of a gcc2
6087     builtin and then its argument prototype would still apply.  */
6088 char __res_query();
6089
6090 int main() {
6091 __res_query()
6092 ; return 0; }
6093 EOF
6094 if { (eval echo configure:6095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6095   rm -rf conftest*
6096   eval "ac_cv_lib_$ac_lib_var=yes"
6097 else
6098   echo "configure: failed program was:" >&5
6099   cat conftest.$ac_ext >&5
6100   rm -rf conftest*
6101   eval "ac_cv_lib_$ac_lib_var=no"
6102 fi
6103 rm -f conftest*
6104 LIBS="$ac_save_LIBS"
6105
6106 fi
6107 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6108   echo "$ac_t""yes" 1>&6
6109     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6110     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6111   cat >> confdefs.h <<EOF
6112 #define $ac_tr_lib 1
6113 EOF
6114
6115   LIBS="-lresolv $LIBS"
6116
6117 else
6118   echo "$ac_t""no" 1>&6
6119 fi
6120
6121         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
6122 fi
6123
6124 if test "$ac_cv_func_res_query" = yes ; then
6125         cat >> confdefs.h <<\EOF
6126 #define HAVE_RES_QUERY 1
6127 EOF
6128
6129
6130         if test $ol_enable_dnssrv != no ; then
6131                 ol_link_dnssrv=yes
6132         fi
6133 fi
6134
6135 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
6136         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
6137 fi
6138
6139 for ac_func in getaddrinfo inet_ntop 
6140 do
6141 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6142 echo "configure:6143: checking for $ac_func" >&5
6143 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6144   echo $ac_n "(cached) $ac_c" 1>&6
6145 else
6146   cat > conftest.$ac_ext <<EOF
6147 #line 6148 "configure"
6148 #include "confdefs.h"
6149 /* System header to define __stub macros and hopefully few prototypes,
6150     which can conflict with char $ac_func(); below.  */
6151 #include <assert.h>
6152 /* Override any gcc2 internal prototype to avoid an error.  */
6153 /* We use char because int might match the return type of a gcc2
6154     builtin and then its argument prototype would still apply.  */
6155 char $ac_func();
6156 char (*f)();
6157
6158 int main() {
6159
6160 /* The GNU C library defines this for functions which it implements
6161     to always fail with ENOSYS.  Some functions are actually named
6162     something starting with __ and the normal name is an alias.  */
6163 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6164 choke me
6165 #else
6166 f = $ac_func;
6167 #endif
6168
6169 ; return 0; }
6170 EOF
6171 if { (eval echo configure:6172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6172   rm -rf conftest*
6173   eval "ac_cv_func_$ac_func=yes"
6174 else
6175   echo "configure: failed program was:" >&5
6176   cat conftest.$ac_ext >&5
6177   rm -rf conftest*
6178   eval "ac_cv_func_$ac_func=no"
6179 fi
6180 rm -f conftest*
6181 fi
6182
6183 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6184   echo "$ac_t""yes" 1>&6
6185     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6186   cat >> confdefs.h <<EOF
6187 #define $ac_tr_func 1
6188 EOF
6189  
6190 else
6191   echo "$ac_t""no" 1>&6
6192 fi
6193 done
6194
6195
6196 ol_link_ipv6=no
6197 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6198         if test $ol_enable_ipv6 = yes ; then
6199                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6200         fi
6201 else
6202         for ac_func in gai_strerror 
6203 do
6204 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6205 echo "configure:6206: checking for $ac_func" >&5
6206 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6207   echo $ac_n "(cached) $ac_c" 1>&6
6208 else
6209   cat > conftest.$ac_ext <<EOF
6210 #line 6211 "configure"
6211 #include "confdefs.h"
6212 /* System header to define __stub macros and hopefully few prototypes,
6213     which can conflict with char $ac_func(); below.  */
6214 #include <assert.h>
6215 /* Override any gcc2 internal prototype to avoid an error.  */
6216 /* We use char because int might match the return type of a gcc2
6217     builtin and then its argument prototype would still apply.  */
6218 char $ac_func();
6219 char (*f)();
6220
6221 int main() {
6222
6223 /* The GNU C library defines this for functions which it implements
6224     to always fail with ENOSYS.  Some functions are actually named
6225     something starting with __ and the normal name is an alias.  */
6226 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6227 choke me
6228 #else
6229 f = $ac_func;
6230 #endif
6231
6232 ; return 0; }
6233 EOF
6234 if { (eval echo configure:6235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6235   rm -rf conftest*
6236   eval "ac_cv_func_$ac_func=yes"
6237 else
6238   echo "configure: failed program was:" >&5
6239   cat conftest.$ac_ext >&5
6240   rm -rf conftest*
6241   eval "ac_cv_func_$ac_func=no"
6242 fi
6243 rm -f conftest*
6244 fi
6245
6246 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6247   echo "$ac_t""yes" 1>&6
6248     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6249   cat >> confdefs.h <<EOF
6250 #define $ac_tr_func 1
6251 EOF
6252  
6253 else
6254   echo "$ac_t""no" 1>&6
6255 fi
6256 done
6257
6258
6259         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6260 echo "configure:6261: checking INET6_ADDRSTRLEN" >&5
6261 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6262   echo $ac_n "(cached) $ac_c" 1>&6
6263 else
6264   
6265                 cat > conftest.$ac_ext <<EOF
6266 #line 6267 "configure"
6267 #include "confdefs.h"
6268
6269 #                       include <netinet/in.h>
6270 #                       ifdef INET6_ADDRSTRLEN
6271                                 __has_inet6_addrstrlen__;
6272 #                       endif
6273                 
6274 EOF
6275 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6276   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6277   rm -rf conftest*
6278   ol_cv_inet6_addrstrlen=yes
6279 else
6280   rm -rf conftest*
6281   ol_cv_inet6_addrstrlen=no
6282 fi
6283 rm -f conftest*
6284
6285 fi
6286
6287 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6288
6289         if test $ol_cv_inet6_addrstrlen = yes ; then
6290                 ol_link_ipv6=yes
6291         elif test $ol_enable_ipv6 = yes ; then
6292                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6293         fi
6294 fi
6295
6296 if test $ol_enable_local != no ; then
6297         for ac_hdr in sys/un.h 
6298 do
6299 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6300 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6301 echo "configure:6302: checking for $ac_hdr" >&5
6302 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6303   echo $ac_n "(cached) $ac_c" 1>&6
6304 else
6305   cat > conftest.$ac_ext <<EOF
6306 #line 6307 "configure"
6307 #include "confdefs.h"
6308 #include <$ac_hdr>
6309 EOF
6310 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6311 { (eval echo configure:6312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6312 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6313 if test -z "$ac_err"; then
6314   rm -rf conftest*
6315   eval "ac_cv_header_$ac_safe=yes"
6316 else
6317   echo "$ac_err" >&5
6318   echo "configure: failed program was:" >&5
6319   cat conftest.$ac_ext >&5
6320   rm -rf conftest*
6321   eval "ac_cv_header_$ac_safe=no"
6322 fi
6323 rm -f conftest*
6324 fi
6325 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6326   echo "$ac_t""yes" 1>&6
6327     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6328   cat >> confdefs.h <<EOF
6329 #define $ac_tr_hdr 1
6330 EOF
6331  
6332 else
6333   echo "$ac_t""no" 1>&6
6334 fi
6335 done
6336
6337
6338         if test $ol_enable_local = auto ; then
6339                 ol_enable_local=$ac_cv_header_sys_un_h
6340         elif test $ac_cv_header_sys_un_h = no ; then
6341                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6342         fi
6343 fi
6344
6345 ol_link_kbind=no
6346 ol_link_kpasswd=no
6347 ol_link_krb5=no
6348 ol_link_krb4=no
6349
6350 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6351         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6352         -o $ol_with_kerberos = k425 ; then
6353
6354         for ac_hdr in krb5.h
6355 do
6356 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6357 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6358 echo "configure:6359: checking for $ac_hdr" >&5
6359 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6360   echo $ac_n "(cached) $ac_c" 1>&6
6361 else
6362   cat > conftest.$ac_ext <<EOF
6363 #line 6364 "configure"
6364 #include "confdefs.h"
6365 #include <$ac_hdr>
6366 EOF
6367 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6368 { (eval echo configure:6369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6369 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6370 if test -z "$ac_err"; then
6371   rm -rf conftest*
6372   eval "ac_cv_header_$ac_safe=yes"
6373 else
6374   echo "$ac_err" >&5
6375   echo "configure: failed program was:" >&5
6376   cat conftest.$ac_ext >&5
6377   rm -rf conftest*
6378   eval "ac_cv_header_$ac_safe=no"
6379 fi
6380 rm -f conftest*
6381 fi
6382 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6383   echo "$ac_t""yes" 1>&6
6384     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6385   cat >> confdefs.h <<EOF
6386 #define $ac_tr_hdr 1
6387 EOF
6388  
6389 else
6390   echo "$ac_t""no" 1>&6
6391 fi
6392 done
6393
6394
6395         if test $ac_cv_header_krb5_h = yes ; then
6396                                 for ac_hdr in heim_err.h
6397 do
6398 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6399 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6400 echo "configure:6401: checking for $ac_hdr" >&5
6401 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6402   echo $ac_n "(cached) $ac_c" 1>&6
6403 else
6404   cat > conftest.$ac_ext <<EOF
6405 #line 6406 "configure"
6406 #include "confdefs.h"
6407 #include <$ac_hdr>
6408 EOF
6409 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6410 { (eval echo configure:6411: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6411 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6412 if test -z "$ac_err"; then
6413   rm -rf conftest*
6414   eval "ac_cv_header_$ac_safe=yes"
6415 else
6416   echo "$ac_err" >&5
6417   echo "configure: failed program was:" >&5
6418   cat conftest.$ac_ext >&5
6419   rm -rf conftest*
6420   eval "ac_cv_header_$ac_safe=no"
6421 fi
6422 rm -f conftest*
6423 fi
6424 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6425   echo "$ac_t""yes" 1>&6
6426     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6427   cat >> confdefs.h <<EOF
6428 #define $ac_tr_hdr 1
6429 EOF
6430  
6431 else
6432   echo "$ac_t""no" 1>&6
6433 fi
6434 done
6435
6436                 if test $ac_cv_header_heim_err_h = yes ; then
6437                         krb5_impl=heimdal
6438                 else
6439                         krb5_impl=mit
6440                 fi
6441
6442                 if test $krb5_impl = mit; then
6443                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
6444 echo "configure:6445: checking for main in -lk5crypto" >&5
6445 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
6446 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6447   echo $ac_n "(cached) $ac_c" 1>&6
6448 else
6449   ac_save_LIBS="$LIBS"
6450 LIBS="-lk5crypto  $LIBS"
6451 cat > conftest.$ac_ext <<EOF
6452 #line 6453 "configure"
6453 #include "confdefs.h"
6454
6455 int main() {
6456 main()
6457 ; return 0; }
6458 EOF
6459 if { (eval echo configure:6460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6460   rm -rf conftest*
6461   eval "ac_cv_lib_$ac_lib_var=yes"
6462 else
6463   echo "configure: failed program was:" >&5
6464   cat conftest.$ac_ext >&5
6465   rm -rf conftest*
6466   eval "ac_cv_lib_$ac_lib_var=no"
6467 fi
6468 rm -f conftest*
6469 LIBS="$ac_save_LIBS"
6470
6471 fi
6472 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6473   echo "$ac_t""yes" 1>&6
6474   krb5crypto=k5crypto
6475 else
6476   echo "$ac_t""no" 1>&6
6477 krb5crypto=crypto
6478 fi
6479
6480
6481                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6482 echo "configure:6483: checking for main in -lkrb5" >&5
6483 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6484 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6485   echo $ac_n "(cached) $ac_c" 1>&6
6486 else
6487   ac_save_LIBS="$LIBS"
6488 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
6489 cat > conftest.$ac_ext <<EOF
6490 #line 6491 "configure"
6491 #include "confdefs.h"
6492
6493 int main() {
6494 main()
6495 ; return 0; }
6496 EOF
6497 if { (eval echo configure:6498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6498   rm -rf conftest*
6499   eval "ac_cv_lib_$ac_lib_var=yes"
6500 else
6501   echo "configure: failed program was:" >&5
6502   cat conftest.$ac_ext >&5
6503   rm -rf conftest*
6504   eval "ac_cv_lib_$ac_lib_var=no"
6505 fi
6506 rm -f conftest*
6507 LIBS="$ac_save_LIBS"
6508
6509 fi
6510 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6511   echo "$ac_t""yes" 1>&6
6512   have_krb5=yes
6513                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6514 else
6515   echo "$ac_t""no" 1>&6
6516 have_krb5=no
6517 fi
6518
6519
6520                 elif test $krb5_impl = heimdal; then
6521                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6522 echo "configure:6523: checking for main in -lkrb5" >&5
6523 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6524 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6525   echo $ac_n "(cached) $ac_c" 1>&6
6526 else
6527   ac_save_LIBS="$LIBS"
6528 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6529 cat > conftest.$ac_ext <<EOF
6530 #line 6531 "configure"
6531 #include "confdefs.h"
6532
6533 int main() {
6534 main()
6535 ; return 0; }
6536 EOF
6537 if { (eval echo configure:6538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6538   rm -rf conftest*
6539   eval "ac_cv_lib_$ac_lib_var=yes"
6540 else
6541   echo "configure: failed program was:" >&5
6542   cat conftest.$ac_ext >&5
6543   rm -rf conftest*
6544   eval "ac_cv_lib_$ac_lib_var=no"
6545 fi
6546 rm -f conftest*
6547 LIBS="$ac_save_LIBS"
6548
6549 fi
6550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6551   echo "$ac_t""yes" 1>&6
6552   have_krb5=yes
6553                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6554 else
6555   echo "$ac_t""no" 1>&6
6556 have_krb5=no
6557 fi
6558
6559
6560                         cat >> confdefs.h <<\EOF
6561 #define HAVE_HEIMDAL_KERBEROS 1
6562 EOF
6563
6564
6565                 else
6566                         have_krb5=no
6567                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6568                 fi
6569
6570                 if test $have_krb5 = yes ; then
6571                         ol_link_krb5=yes
6572
6573                         cat >> confdefs.h <<\EOF
6574 #define HAVE_KRB5 1
6575 EOF
6576
6577
6578                         if test $ol_enable_kpasswd != no ; then
6579                                 ol_link_kpasswd=yes;
6580                         fi
6581
6582                         if test $ol_with_kerberos = k5only ; then
6583                                 ol_with_kerberos=found
6584                         fi
6585
6586                 elif test $ol_with_kerberos != auto ; then
6587                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6588                 fi
6589
6590         fi
6591 fi
6592
6593 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6594         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6595
6596         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6597 do
6598 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6599 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6600 echo "configure:6601: checking for $ac_hdr" >&5
6601 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6602   echo $ac_n "(cached) $ac_c" 1>&6
6603 else
6604   cat > conftest.$ac_ext <<EOF
6605 #line 6606 "configure"
6606 #include "confdefs.h"
6607 #include <$ac_hdr>
6608 EOF
6609 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6610 { (eval echo configure:6611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6611 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6612 if test -z "$ac_err"; then
6613   rm -rf conftest*
6614   eval "ac_cv_header_$ac_safe=yes"
6615 else
6616   echo "$ac_err" >&5
6617   echo "configure: failed program was:" >&5
6618   cat conftest.$ac_ext >&5
6619   rm -rf conftest*
6620   eval "ac_cv_header_$ac_safe=no"
6621 fi
6622 rm -f conftest*
6623 fi
6624 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6625   echo "$ac_t""yes" 1>&6
6626     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6627   cat >> confdefs.h <<EOF
6628 #define $ac_tr_hdr 1
6629 EOF
6630  
6631 else
6632   echo "$ac_t""no" 1>&6
6633 fi
6634 done
6635
6636
6637         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6638                 if test $krb5_impl = mit; then
6639                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6640 echo "configure:6641: checking for main in -lkrb4" >&5
6641 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6642 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6643   echo $ac_n "(cached) $ac_c" 1>&6
6644 else
6645   ac_save_LIBS="$LIBS"
6646 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6647 cat > conftest.$ac_ext <<EOF
6648 #line 6649 "configure"
6649 #include "confdefs.h"
6650
6651 int main() {
6652 main()
6653 ; return 0; }
6654 EOF
6655 if { (eval echo configure:6656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6656   rm -rf conftest*
6657   eval "ac_cv_lib_$ac_lib_var=yes"
6658 else
6659   echo "configure: failed program was:" >&5
6660   cat conftest.$ac_ext >&5
6661   rm -rf conftest*
6662   eval "ac_cv_lib_$ac_lib_var=no"
6663 fi
6664 rm -f conftest*
6665 LIBS="$ac_save_LIBS"
6666
6667 fi
6668 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6669   echo "$ac_t""yes" 1>&6
6670   have_k425=yes
6671                                 KRB4_LIBS="-lkrb4 -ldes425"
6672 else
6673   echo "$ac_t""no" 1>&6
6674 have_k425=no
6675 fi
6676
6677
6678                 elif test $krb5_impl = heimdal; then
6679                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6680 echo "configure:6681: checking for main in -lkrb4" >&5
6681 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6682 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6683   echo $ac_n "(cached) $ac_c" 1>&6
6684 else
6685   ac_save_LIBS="$LIBS"
6686 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6687 cat > conftest.$ac_ext <<EOF
6688 #line 6689 "configure"
6689 #include "confdefs.h"
6690
6691 int main() {
6692 main()
6693 ; return 0; }
6694 EOF
6695 if { (eval echo configure:6696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6696   rm -rf conftest*
6697   eval "ac_cv_lib_$ac_lib_var=yes"
6698 else
6699   echo "configure: failed program was:" >&5
6700   cat conftest.$ac_ext >&5
6701   rm -rf conftest*
6702   eval "ac_cv_lib_$ac_lib_var=no"
6703 fi
6704 rm -f conftest*
6705 LIBS="$ac_save_LIBS"
6706
6707 fi
6708 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6709   echo "$ac_t""yes" 1>&6
6710   have_k425=yes
6711                                 KRB4_LIBS="-lkrb4"
6712 else
6713   echo "$ac_t""no" 1>&6
6714 have_k425=no
6715 fi
6716
6717
6718                 else
6719                         have_425=no
6720                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6721                 fi
6722
6723                 if test $have_k425 = yes ; then
6724                         ol_with_kerberos=found
6725                         ol_link_krb4=yes
6726
6727                         cat >> confdefs.h <<\EOF
6728 #define HAVE_KRB425 1
6729 EOF
6730
6731                         cat >> confdefs.h <<\EOF
6732 #define HAVE_KRB4 1
6733 EOF
6734
6735
6736                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6737 echo "configure:6738: checking for des_debug in Kerberos libraries" >&5
6738 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6739   echo $ac_n "(cached) $ac_c" 1>&6
6740 else
6741   
6742                                                                 save_LIBS="$LIBS"
6743                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6744                                 cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747
6748 #include <kerberosIV/krb.h>
6749 #include <kerberosIV/des.h>
6750 extern int des_debug;
6751
6752 int main() {
6753
6754 des_debug = 1;
6755
6756 ; return 0; }
6757 EOF
6758 if { (eval echo configure:6759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6759   rm -rf conftest*
6760   ol_cv_var_des_debug=yes
6761 else
6762   echo "configure: failed program was:" >&5
6763   cat conftest.$ac_ext >&5
6764   rm -rf conftest*
6765   ol_cv_var_des_debug=no
6766 fi
6767 rm -f conftest*
6768                                                                 LIBS="$save_LIBS"
6769                         
6770 fi
6771
6772 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6773
6774                         if test $ol_cv_var_des_debug = yes ; then
6775                                 cat >> confdefs.h <<\EOF
6776 #define HAVE_DES_DEBUG 1
6777 EOF
6778
6779                         fi
6780
6781                         LIBS="$save_LIBS"
6782                 fi
6783         fi
6784 fi
6785
6786 if test $ol_link_krb5 = yes ; then
6787         ol_with_kerberos=found
6788 fi
6789
6790 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6791         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6792
6793         for ac_hdr in krb.h des.h krb-archaeology.h 
6794 do
6795 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6796 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6797 echo "configure:6798: checking for $ac_hdr" >&5
6798 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6799   echo $ac_n "(cached) $ac_c" 1>&6
6800 else
6801   cat > conftest.$ac_ext <<EOF
6802 #line 6803 "configure"
6803 #include "confdefs.h"
6804 #include <$ac_hdr>
6805 EOF
6806 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6807 { (eval echo configure:6808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6808 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6809 if test -z "$ac_err"; then
6810   rm -rf conftest*
6811   eval "ac_cv_header_$ac_safe=yes"
6812 else
6813   echo "$ac_err" >&5
6814   echo "configure: failed program was:" >&5
6815   cat conftest.$ac_ext >&5
6816   rm -rf conftest*
6817   eval "ac_cv_header_$ac_safe=no"
6818 fi
6819 rm -f conftest*
6820 fi
6821 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6822   echo "$ac_t""yes" 1>&6
6823     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6824   cat >> confdefs.h <<EOF
6825 #define $ac_tr_hdr 1
6826 EOF
6827  
6828 else
6829   echo "$ac_t""no" 1>&6
6830 fi
6831 done
6832
6833
6834         if test $ac_cv_header_krb_h = yes ; then
6835                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6836 echo "configure:6837: checking for main in -lkrb" >&5
6837 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6838 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6839   echo $ac_n "(cached) $ac_c" 1>&6
6840 else
6841   ac_save_LIBS="$LIBS"
6842 LIBS="-lkrb -ldes $LIBS"
6843 cat > conftest.$ac_ext <<EOF
6844 #line 6845 "configure"
6845 #include "confdefs.h"
6846
6847 int main() {
6848 main()
6849 ; return 0; }
6850 EOF
6851 if { (eval echo configure:6852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6852   rm -rf conftest*
6853   eval "ac_cv_lib_$ac_lib_var=yes"
6854 else
6855   echo "configure: failed program was:" >&5
6856   cat conftest.$ac_ext >&5
6857   rm -rf conftest*
6858   eval "ac_cv_lib_$ac_lib_var=no"
6859 fi
6860 rm -f conftest*
6861 LIBS="$ac_save_LIBS"
6862
6863 fi
6864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6865   echo "$ac_t""yes" 1>&6
6866   have_k4=yes
6867 else
6868   echo "$ac_t""no" 1>&6
6869 have_k4=no
6870 fi
6871
6872
6873                 if test $have_k4 = yes ; then
6874                         ol_with_kerberos=found
6875                         ol_link_krb4=yes
6876
6877                         cat >> confdefs.h <<\EOF
6878 #define HAVE_KRB4 1
6879 EOF
6880
6881
6882                         KRB4_LIBS="-lkrb -ldes"
6883
6884                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6885                                 cat >> confdefs.h <<\EOF
6886 #define HAVE_KTH_KERBEROS 1
6887 EOF
6888
6889                         fi
6890                 fi
6891         fi
6892 fi
6893
6894 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6895         ol_link_kpasswd=yes
6896 fi
6897
6898 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6899         ol_link_kbind=yes
6900
6901 elif test $ol_enable_kbind = yes ; then
6902         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6903 fi
6904
6905 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6906         cat >> confdefs.h <<\EOF
6907 #define HAVE_KERBEROS 1
6908 EOF
6909
6910
6911 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6912         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6913 fi
6914
6915 ol_link_tls=no
6916 if test $ol_with_tls != no ; then
6917         for ac_hdr in openssl/ssl.h ssl.h
6918 do
6919 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6920 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6921 echo "configure:6922: checking for $ac_hdr" >&5
6922 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6923   echo $ac_n "(cached) $ac_c" 1>&6
6924 else
6925   cat > conftest.$ac_ext <<EOF
6926 #line 6927 "configure"
6927 #include "confdefs.h"
6928 #include <$ac_hdr>
6929 EOF
6930 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6931 { (eval echo configure:6932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6932 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6933 if test -z "$ac_err"; then
6934   rm -rf conftest*
6935   eval "ac_cv_header_$ac_safe=yes"
6936 else
6937   echo "$ac_err" >&5
6938   echo "configure: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   rm -rf conftest*
6941   eval "ac_cv_header_$ac_safe=no"
6942 fi
6943 rm -f conftest*
6944 fi
6945 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6946   echo "$ac_t""yes" 1>&6
6947     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6948   cat >> confdefs.h <<EOF
6949 #define $ac_tr_hdr 1
6950 EOF
6951  
6952 else
6953   echo "$ac_t""no" 1>&6
6954 fi
6955 done
6956
6957         
6958         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6959                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6960 echo "configure:6961: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6961 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6962 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6963   echo $ac_n "(cached) $ac_c" 1>&6
6964 else
6965   ac_save_LIBS="$LIBS"
6966 LIBS="-lssl -lcrypto $LIBS"
6967 cat > conftest.$ac_ext <<EOF
6968 #line 6969 "configure"
6969 #include "confdefs.h"
6970 /* Override any gcc2 internal prototype to avoid an error.  */
6971 /* We use char because int might match the return type of a gcc2
6972     builtin and then its argument prototype would still apply.  */
6973 char SSLeay_add_ssl_algorithms();
6974
6975 int main() {
6976 SSLeay_add_ssl_algorithms()
6977 ; return 0; }
6978 EOF
6979 if { (eval echo configure:6980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6980   rm -rf conftest*
6981   eval "ac_cv_lib_$ac_lib_var=yes"
6982 else
6983   echo "configure: failed program was:" >&5
6984   cat conftest.$ac_ext >&5
6985   rm -rf conftest*
6986   eval "ac_cv_lib_$ac_lib_var=no"
6987 fi
6988 rm -f conftest*
6989 LIBS="$ac_save_LIBS"
6990
6991 fi
6992 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6993   echo "$ac_t""yes" 1>&6
6994   have_ssleay=yes
6995                         need_rsaref=no
6996 else
6997   echo "$ac_t""no" 1>&6
6998 have_ssleay=no
6999 fi
7000
7001                         
7002                 if test $have_ssleay = no ; then
7003                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
7004 echo "configure:7005: checking for SSL_library_init in -lssl" >&5
7005 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
7006 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7007   echo $ac_n "(cached) $ac_c" 1>&6
7008 else
7009   ac_save_LIBS="$LIBS"
7010 LIBS="-lssl -lcrypto $LIBS"
7011 cat > conftest.$ac_ext <<EOF
7012 #line 7013 "configure"
7013 #include "confdefs.h"
7014 /* Override any gcc2 internal prototype to avoid an error.  */
7015 /* We use char because int might match the return type of a gcc2
7016     builtin and then its argument prototype would still apply.  */
7017 char SSL_library_init();
7018
7019 int main() {
7020 SSL_library_init()
7021 ; return 0; }
7022 EOF
7023 if { (eval echo configure:7024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7024   rm -rf conftest*
7025   eval "ac_cv_lib_$ac_lib_var=yes"
7026 else
7027   echo "configure: failed program was:" >&5
7028   cat conftest.$ac_ext >&5
7029   rm -rf conftest*
7030   eval "ac_cv_lib_$ac_lib_var=no"
7031 fi
7032 rm -f conftest*
7033 LIBS="$ac_save_LIBS"
7034
7035 fi
7036 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7037   echo "$ac_t""yes" 1>&6
7038   have_ssleay=yes
7039                                 need_rsaref=no
7040 else
7041   echo "$ac_t""no" 1>&6
7042 have_ssleay=no
7043 fi
7044
7045                 fi
7046
7047                 if test $have_ssleay = no ; then
7048                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
7049 echo "configure:7050: checking for ssl3_accept in -lssl" >&5
7050 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
7051 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
7052   echo $ac_n "(cached) $ac_c" 1>&6
7053 else
7054   ac_save_LIBS="$LIBS"
7055 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
7056 cat > conftest.$ac_ext <<EOF
7057 #line 7058 "configure"
7058 #include "confdefs.h"
7059 /* Override any gcc2 internal prototype to avoid an error.  */
7060 /* We use char because int might match the return type of a gcc2
7061     builtin and then its argument prototype would still apply.  */
7062 char ssl3_accept();
7063
7064 int main() {
7065 ssl3_accept()
7066 ; return 0; }
7067 EOF
7068 if { (eval echo configure:7069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7069   rm -rf conftest*
7070   eval "ac_cv_lib_$ac_lib_var=yes"
7071 else
7072   echo "configure: failed program was:" >&5
7073   cat conftest.$ac_ext >&5
7074   rm -rf conftest*
7075   eval "ac_cv_lib_$ac_lib_var=no"
7076 fi
7077 rm -f conftest*
7078 LIBS="$ac_save_LIBS"
7079
7080 fi
7081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7082   echo "$ac_t""yes" 1>&6
7083   have_ssleay=yes
7084                                 need_rsaref=yes
7085 else
7086   echo "$ac_t""no" 1>&6
7087 have_ssleay=no
7088 fi
7089
7090                 fi
7091
7092                 if test $have_ssleay = yes ; then
7093                         ol_with_tls=found
7094                         ol_link_tls=yes
7095
7096                         cat >> confdefs.h <<\EOF
7097 #define HAVE_SSLEAY 1
7098 EOF
7099
7100
7101                         if test $need_rsaref = yes; then
7102                                 cat >> confdefs.h <<\EOF
7103 #define HAVE_RSAREF 1
7104 EOF
7105
7106
7107                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
7108                         else
7109                                 TLS_LIBS="-lssl -lcrypto"
7110                         fi
7111                 fi
7112         fi
7113
7114 else
7115         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7116 fi
7117
7118 if test $ol_link_tls = yes ; then
7119         cat >> confdefs.h <<\EOF
7120 #define HAVE_TLS 1
7121 EOF
7122
7123
7124 elif test $ol_with_tls = auto ; then
7125         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
7126         echo "configure: warning: TLS privacy protection not supported!" 1>&2
7127
7128 elif test $ol_with_tls != no ; then
7129         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
7130 fi
7131
7132 if test $ol_enable_lmpasswd != no; then
7133         if test $ol_link_tls != yes ; then
7134                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
7135         fi
7136
7137         cat >> confdefs.h <<\EOF
7138 #define SLAPD_LMHASH 1
7139 EOF
7140
7141 fi
7142
7143 for ac_func in \
7144         ctime_r                 \
7145         gethostbyname_r gethostbyaddr_r \
7146
7147 do
7148 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7149 echo "configure:7150: checking for $ac_func" >&5
7150 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
7151   echo $ac_n "(cached) $ac_c" 1>&6
7152 else
7153   cat > conftest.$ac_ext <<EOF
7154 #line 7155 "configure"
7155 #include "confdefs.h"
7156 /* System header to define __stub macros and hopefully few prototypes,
7157     which can conflict with char $ac_func(); below.  */
7158 #include <assert.h>
7159 /* Override any gcc2 internal prototype to avoid an error.  */
7160 /* We use char because int might match the return type of a gcc2
7161     builtin and then its argument prototype would still apply.  */
7162 char $ac_func();
7163 char (*f)();
7164
7165 int main() {
7166
7167 /* The GNU C library defines this for functions which it implements
7168     to always fail with ENOSYS.  Some functions are actually named
7169     something starting with __ and the normal name is an alias.  */
7170 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7171 choke me
7172 #else
7173 f = $ac_func;
7174 #endif
7175
7176 ; return 0; }
7177 EOF
7178 if { (eval echo configure:7179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7179   rm -rf conftest*
7180   eval "ac_cv_func_$ac_func=yes"
7181 else
7182   echo "configure: failed program was:" >&5
7183   cat conftest.$ac_ext >&5
7184   rm -rf conftest*
7185   eval "ac_cv_func_$ac_func=no"
7186 fi
7187 rm -f conftest*
7188 fi
7189
7190 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7191   echo "$ac_t""yes" 1>&6
7192     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7193   cat >> confdefs.h <<EOF
7194 #define $ac_tr_func 1
7195 EOF
7196  
7197 else
7198   echo "$ac_t""no" 1>&6
7199 fi
7200 done
7201
7202
7203 if test "$ac_cv_func_ctime_r" = no ; then
7204         ol_cv_func_ctime_r_nargs=0
7205 else
7206         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7207 echo "configure:7208: checking number of arguments of ctime_r" >&5
7208 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7209   echo $ac_n "(cached) $ac_c" 1>&6
7210 else
7211   cat > conftest.$ac_ext <<EOF
7212 #line 7213 "configure"
7213 #include "confdefs.h"
7214 #include <time.h>
7215 int main() {
7216 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7217 ; return 0; }
7218 EOF
7219 if { (eval echo configure:7220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7220   rm -rf conftest*
7221   ol_cv_func_ctime_r_nargs3=yes
7222 else
7223   echo "configure: failed program was:" >&5
7224   cat conftest.$ac_ext >&5
7225   rm -rf conftest*
7226   ol_cv_func_ctime_r_nargs3=no
7227 fi
7228 rm -f conftest*
7229
7230         cat > conftest.$ac_ext <<EOF
7231 #line 7232 "configure"
7232 #include "confdefs.h"
7233 #include <time.h>
7234 int main() {
7235 time_t ti; char *buffer; ctime_r(&ti,buffer);
7236 ; return 0; }
7237 EOF
7238 if { (eval echo configure:7239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7239   rm -rf conftest*
7240   ol_cv_func_ctime_r_nargs2=yes
7241 else
7242   echo "configure: failed program was:" >&5
7243   cat conftest.$ac_ext >&5
7244   rm -rf conftest*
7245   ol_cv_func_ctime_r_nargs2=no
7246 fi
7247 rm -f conftest*
7248
7249         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7250                 $ol_cv_func_ctime_r_nargs2 = no ; then
7251
7252                 ol_cv_func_ctime_r_nargs=3
7253
7254         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7255                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7256
7257                 ol_cv_func_ctime_r_nargs=2
7258
7259         else
7260                 ol_cv_func_ctime_r_nargs=0
7261         fi
7262   
7263 fi
7264
7265 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7266
7267   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7268         cat >> confdefs.h <<EOF
7269 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7270 EOF
7271
7272   fi
7273
7274 fi
7275
7276 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7277         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7278 echo "configure:7279: checking number of arguments of gethostbyname_r" >&5
7279 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7280   echo $ac_n "(cached) $ac_c" 1>&6
7281 else
7282   cat > conftest.$ac_ext <<EOF
7283 #line 7284 "configure"
7284 #include "confdefs.h"
7285 #include <sys/types.h>
7286 #include <sys/socket.h>
7287 #include <netinet/in.h>
7288 #include <netdb.h>
7289 #define BUFSIZE (sizeof(struct hostent)+10)
7290 int main() {
7291 struct hostent hent; char buffer[BUFSIZE];
7292                 int bufsize=BUFSIZE;int h_errno;
7293                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7294                         buffer, bufsize, &h_errno);
7295 ; return 0; }
7296 EOF
7297 if { (eval echo configure:7298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7298   rm -rf conftest*
7299   ol_cv_func_gethostbyname_r_nargs5=yes
7300 else
7301   echo "configure: failed program was:" >&5
7302   cat conftest.$ac_ext >&5
7303   rm -rf conftest*
7304   ol_cv_func_gethostbyname_r_nargs5=no
7305 fi
7306 rm -f conftest*
7307
7308         cat > conftest.$ac_ext <<EOF
7309 #line 7310 "configure"
7310 #include "confdefs.h"
7311 #include <sys/types.h>
7312 #include <sys/socket.h>
7313 #include <netinet/in.h>
7314 #include <netdb.h>
7315 #define BUFSIZE (sizeof(struct hostent)+10)
7316 int main() {
7317 struct hostent hent;struct hostent *rhent;
7318                 char buffer[BUFSIZE];
7319                 int bufsize=BUFSIZE;int h_errno;
7320                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7321                         &rhent, &h_errno);
7322 ; return 0; }
7323 EOF
7324 if { (eval echo configure:7325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7325   rm -rf conftest*
7326   ol_cv_func_gethostbyname_r_nargs6=yes
7327 else
7328   echo "configure: failed program was:" >&5
7329   cat conftest.$ac_ext >&5
7330   rm -rf conftest*
7331   ol_cv_func_gethostbyname_r_nargs6=no
7332 fi
7333 rm -f conftest*
7334
7335         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7336                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7337
7338                 ol_cv_func_gethostbyname_r_nargs=5
7339
7340         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7341                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7342
7343                 ol_cv_func_gethostbyname_r_nargs=6
7344
7345         else
7346                 ol_cv_func_gethostbyname_r_nargs=0
7347         fi
7348   
7349 fi
7350
7351 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7352   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7353         cat >> confdefs.h <<EOF
7354 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7355 EOF
7356
7357   fi
7358
7359 else
7360         ol_cv_func_gethostbyname_r_nargs=0
7361 fi
7362  
7363 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7364         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7365 echo "configure:7366: checking number of arguments of gethostbyaddr_r" >&5
7366 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7367   echo $ac_n "(cached) $ac_c" 1>&6
7368 else
7369   cat > conftest.$ac_ext <<EOF
7370 #line 7371 "configure"
7371 #include "confdefs.h"
7372 #include <sys/types.h>
7373 #include <sys/socket.h>
7374 #include <netinet/in.h>
7375 #include <netdb.h>
7376 #define BUFSIZE (sizeof(struct hostent)+10)
7377 int main() {
7378 struct hostent hent; char buffer[BUFSIZE]; 
7379             struct in_addr add;
7380             size_t alen=sizeof(struct in_addr);
7381             int bufsize=BUFSIZE;int h_errno;
7382                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7383                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7384 ; return 0; }
7385 EOF
7386 if { (eval echo configure:7387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7387   rm -rf conftest*
7388   ol_cv_func_gethostbyaddr_r_nargs7=yes
7389 else
7390   echo "configure: failed program was:" >&5
7391   cat conftest.$ac_ext >&5
7392   rm -rf conftest*
7393   ol_cv_func_gethostbyaddr_r_nargs7=no
7394 fi
7395 rm -f conftest*
7396
7397         cat > conftest.$ac_ext <<EOF
7398 #line 7399 "configure"
7399 #include "confdefs.h"
7400 #include <sys/types.h>
7401 #include <sys/socket.h>
7402 #include <netinet/in.h>
7403 #include <netdb.h>
7404 #define BUFSIZE (sizeof(struct hostent)+10)
7405 int main() {
7406 struct hostent hent;
7407                 struct hostent *rhent; char buffer[BUFSIZE]; 
7408                 struct in_addr add;
7409                 size_t alen=sizeof(struct in_addr);
7410                 int bufsize=BUFSIZE;int h_errno;
7411                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7412                         alen, AF_INET, &hent, buffer, bufsize, 
7413                         &rhent, &h_errno);
7414 ; return 0; }
7415 EOF
7416 if { (eval echo configure:7417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7417   rm -rf conftest*
7418   ol_cv_func_gethostbyaddr_r_nargs8=yes
7419 else
7420   echo "configure: failed program was:" >&5
7421   cat conftest.$ac_ext >&5
7422   rm -rf conftest*
7423   ol_cv_func_gethostbyaddr_r_nargs8=no
7424 fi
7425 rm -f conftest*
7426
7427         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7428                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7429
7430                 ol_cv_func_gethostbyaddr_r_nargs=7
7431
7432         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7433                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7434
7435                 ol_cv_func_gethostbyaddr_r_nargs=8
7436
7437         else
7438                 ol_cv_func_gethostbyaddr_r_nargs=0
7439         fi
7440   
7441 fi
7442
7443 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7444   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7445     cat >> confdefs.h <<EOF
7446 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7447 EOF
7448
7449   fi
7450
7451 else
7452         ol_cv_func_gethostbyaddr_r_nargs=0
7453 fi
7454
7455 if test "$ac_cv_func_ctime_r" = yes \
7456         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7457         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7458         -a "$ac_cv_func_gethostbyname_r" = yes \
7459         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7460         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7461         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7462         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7463         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7464         ; then
7465  
7466         cat >> confdefs.h <<\EOF
7467 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7468 EOF
7469
7470 fi
7471
7472 ol_link_threads=no
7473
7474 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7475         -o $ol_with_threads = nt ; then
7476
7477         
7478         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7479 echo "configure:7480: checking for _beginthread" >&5
7480 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7481   echo $ac_n "(cached) $ac_c" 1>&6
7482 else
7483   cat > conftest.$ac_ext <<EOF
7484 #line 7485 "configure"
7485 #include "confdefs.h"
7486 /* System header to define __stub macros and hopefully few prototypes,
7487     which can conflict with char _beginthread(); below.  */
7488 #include <assert.h>
7489 /* Override any gcc2 internal prototype to avoid an error.  */
7490 /* We use char because int might match the return type of a gcc2
7491     builtin and then its argument prototype would still apply.  */
7492 char _beginthread();
7493 char (*f)();
7494
7495 int main() {
7496
7497 /* The GNU C library defines this for functions which it implements
7498     to always fail with ENOSYS.  Some functions are actually named
7499     something starting with __ and the normal name is an alias.  */
7500 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7501 choke me
7502 #else
7503 f = _beginthread;
7504 #endif
7505
7506 ; return 0; }
7507 EOF
7508 if { (eval echo configure:7509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7509   rm -rf conftest*
7510   eval "ac_cv_func__beginthread=yes"
7511 else
7512   echo "configure: failed program was:" >&5
7513   cat conftest.$ac_ext >&5
7514   rm -rf conftest*
7515   eval "ac_cv_func__beginthread=no"
7516 fi
7517 rm -f conftest*
7518 fi
7519
7520 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7521   echo "$ac_t""yes" 1>&6
7522   :
7523 else
7524   echo "$ac_t""no" 1>&6
7525 fi
7526
7527
7528         if test $ac_cv_func__beginthread = yes ; then
7529                 cat >> confdefs.h <<\EOF
7530 #define HAVE_NT_THREADS 1
7531 EOF
7532
7533         fi
7534
7535
7536         if test "$ol_cv_nt_threads" = yes ; then
7537         ol_link_threads=nt
7538         ol_with_threads=found
7539         ol_with_yielding_select=yes
7540
7541                 cat >> confdefs.h <<\EOF
7542 #define HAVE_NT_SERVICE_MANAGER 1
7543 EOF
7544
7545                 cat >> confdefs.h <<\EOF
7546 #define HAVE_NT_EVENT_LOG 1
7547 EOF
7548
7549         fi
7550
7551         if test $ol_with_threads = nt ; then
7552                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7553         fi
7554 fi
7555
7556 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7557         -o $ol_with_threads = posix ; then
7558
7559         for ac_hdr in pthread.h
7560 do
7561 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7562 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7563 echo "configure:7564: checking for $ac_hdr" >&5
7564 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7565   echo $ac_n "(cached) $ac_c" 1>&6
7566 else
7567   cat > conftest.$ac_ext <<EOF
7568 #line 7569 "configure"
7569 #include "confdefs.h"
7570 #include <$ac_hdr>
7571 EOF
7572 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7573 { (eval echo configure:7574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7574 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7575 if test -z "$ac_err"; then
7576   rm -rf conftest*
7577   eval "ac_cv_header_$ac_safe=yes"
7578 else
7579   echo "$ac_err" >&5
7580   echo "configure: failed program was:" >&5
7581   cat conftest.$ac_ext >&5
7582   rm -rf conftest*
7583   eval "ac_cv_header_$ac_safe=no"
7584 fi
7585 rm -f conftest*
7586 fi
7587 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7588   echo "$ac_t""yes" 1>&6
7589     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7590   cat >> confdefs.h <<EOF
7591 #define $ac_tr_hdr 1
7592 EOF
7593  
7594 else
7595   echo "$ac_t""no" 1>&6
7596 fi
7597 done
7598
7599
7600         if test $ac_cv_header_pthread_h = yes ; then
7601                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7602 echo "configure:7603: checking POSIX thread version" >&5
7603 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7604   echo $ac_n "(cached) $ac_c" 1>&6
7605 else
7606   
7607         cat > conftest.$ac_ext <<EOF
7608 #line 7609 "configure"
7609 #include "confdefs.h"
7610
7611 #               include <pthread.h>
7612                 /* this check could be improved */
7613 #               ifdef PTHREAD_ONCE_INIT
7614                         pthread_version_final;
7615 #               endif
7616         
7617 EOF
7618 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7619   egrep "pthread_version_final" >/dev/null 2>&1; then
7620   rm -rf conftest*
7621   ol_pthread_final=yes
7622 else
7623   rm -rf conftest*
7624   ol_pthread_final=no
7625 fi
7626 rm -f conftest*
7627
7628
7629         cat > conftest.$ac_ext <<EOF
7630 #line 7631 "configure"
7631 #include "confdefs.h"
7632
7633 #               include <pthread.h>
7634                 /* this check could be improved */
7635 #               ifdef pthread_once_init
7636                         pthread_version_draft4;
7637 #               endif
7638         
7639 EOF
7640 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7641   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7642   rm -rf conftest*
7643   ol_pthread_draft4=yes
7644 else
7645   rm -rf conftest*
7646   ol_pthread_draft4=no
7647 fi
7648 rm -f conftest*
7649
7650
7651         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7652                 ol_cv_pthread_version=final
7653         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7654                 ol_cv_pthread_version=draft4
7655         else
7656                 ol_cv_pthread_version=unknown
7657         fi
7658
7659 fi
7660
7661 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7662
7663
7664                 if test $ol_cv_pthread_version = final ; then
7665                         cat >> confdefs.h <<\EOF
7666 #define HAVE_PTHREADS_FINAL 1
7667 EOF
7668
7669                 elif test $ol_cv_pthread_version = draft4 ; then
7670                         cat >> confdefs.h <<\EOF
7671 #define HAVE_PTHREADS_D4 1
7672 EOF
7673
7674                 else
7675                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7676                 fi
7677
7678                 # consider threads found
7679                 ol_with_threads=found
7680
7681                 
7682         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7683 echo "configure:7684: checking for LinuxThreads pthread.h" >&5
7684 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7685   echo $ac_n "(cached) $ac_c" 1>&6
7686 else
7687   cat > conftest.$ac_ext <<EOF
7688 #line 7689 "configure"
7689 #include "confdefs.h"
7690 #include <pthread.h>
7691 EOF
7692 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7693   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7694   rm -rf conftest*
7695   ol_cv_header_linux_threads=yes
7696 else
7697   rm -rf conftest*
7698   ol_cv_header_linux_threads=no
7699 fi
7700 rm -f conftest*
7701
7702                 
7703 fi
7704
7705 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7706         if test $ol_cv_header_linux_threads = yes; then
7707                 cat >> confdefs.h <<\EOF
7708 #define HAVE_LINUX_THREADS 1
7709 EOF
7710
7711         fi
7712
7713                 
7714         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7715 echo "configure:7716: checking for GNU Pth pthread.h" >&5
7716 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7717   echo $ac_n "(cached) $ac_c" 1>&6
7718 else
7719   cat > conftest.$ac_ext <<EOF
7720 #line 7721 "configure"
7721 #include "confdefs.h"
7722 #include <pthread.h>
7723 #ifdef _POSIX_THREAD_IS_GNU_PTH
7724         __gnu_pth__;
7725 #endif
7726
7727 EOF
7728 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7729   egrep "__gnu_pth__" >/dev/null 2>&1; then
7730   rm -rf conftest*
7731   ol_cv_header_gnu_pth_pthread_h=yes
7732 else
7733   rm -rf conftest*
7734   ol_cv_header_gnu_pth_pthread_h=no
7735 fi
7736 rm -f conftest*
7737
7738                 
7739 fi
7740
7741 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7742
7743
7744                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7745                         for ac_hdr in sched.h
7746 do
7747 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7748 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7749 echo "configure:7750: checking for $ac_hdr" >&5
7750 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7751   echo $ac_n "(cached) $ac_c" 1>&6
7752 else
7753   cat > conftest.$ac_ext <<EOF
7754 #line 7755 "configure"
7755 #include "confdefs.h"
7756 #include <$ac_hdr>
7757 EOF
7758 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7759 { (eval echo configure:7760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7760 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7761 if test -z "$ac_err"; then
7762   rm -rf conftest*
7763   eval "ac_cv_header_$ac_safe=yes"
7764 else
7765   echo "$ac_err" >&5
7766   echo "configure: failed program was:" >&5
7767   cat conftest.$ac_ext >&5
7768   rm -rf conftest*
7769   eval "ac_cv_header_$ac_safe=no"
7770 fi
7771 rm -f conftest*
7772 fi
7773 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7774   echo "$ac_t""yes" 1>&6
7775     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7776   cat >> confdefs.h <<EOF
7777 #define $ac_tr_hdr 1
7778 EOF
7779  
7780 else
7781   echo "$ac_t""no" 1>&6
7782 fi
7783 done
7784
7785                 fi
7786
7787                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7788                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7789 echo "configure:7790: checking for pthread_create in default libraries" >&5
7790 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7791   echo $ac_n "(cached) $ac_c" 1>&6
7792 else
7793   
7794                 if test "$cross_compiling" = yes; then
7795   cat > conftest.$ac_ext <<EOF
7796 #line 7797 "configure"
7797 #include "confdefs.h"
7798 /* pthread test headers */
7799 #include <pthread.h>
7800 #ifndef NULL
7801 #define NULL (void*)0
7802 #endif
7803
7804 static void *task(p)
7805         void *p;
7806 {
7807         return (void *) (p == NULL);
7808 }
7809
7810 int main() {
7811
7812         /* pthread test function */
7813         pthread_t t;
7814         int status;
7815         int detach = 1;
7816
7817 #ifdef HAVE_PTHREADS_FINAL
7818         /* Final pthreads */
7819         pthread_attr_t attr;
7820
7821         status = pthread_attr_init(&attr);
7822         if( status ) return status;
7823
7824 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7825         if( !detach ) {
7826 #if defined( PTHREAD_CREATE_JOINABLE )
7827                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7828 #else
7829                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7830 #endif
7831
7832 #ifdef PTHREAD_CREATE_DETACHED
7833         } else {
7834                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7835 #endif
7836         }
7837         if( status ) return status;
7838 #endif
7839
7840         status = pthread_create( &t, &attr, task, NULL );
7841         if( status ) return status;
7842
7843 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7844         if( detach ) {
7845                 /* give thread a chance to complete */
7846                 /* it should remain joinable and hence detachable */
7847                 sleep( 1 );
7848
7849                 status = pthread_detach( t );
7850                 if( status ) return status;
7851         }
7852 #endif
7853
7854 #else
7855         /* Draft 4 pthreads */
7856         status = pthread_create( &t, pthread_attr_default, task, NULL );
7857         if( status ) return status;
7858
7859         if( detach ) {
7860                 /* give thread a chance to complete */
7861                 /* it should remain joinable and hence detachable */
7862                 sleep( 1 );
7863
7864                 status = pthread_detach( &t );
7865                 if( status ) return status;
7866         }
7867 #endif
7868
7869 #ifdef HAVE_LINUX_THREADS
7870         pthread_kill_other_threads_np();
7871 #endif
7872
7873         return 0;
7874
7875 ; return 0; }
7876 EOF
7877 if { (eval echo configure:7878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7878   rm -rf conftest*
7879   ol_cv_pthread_create=yes
7880 else
7881   echo "configure: failed program was:" >&5
7882   cat conftest.$ac_ext >&5
7883   rm -rf conftest*
7884   ol_cv_pthread_create=no
7885 fi
7886 rm -f conftest*
7887 else
7888   cat > conftest.$ac_ext <<EOF
7889 #line 7890 "configure"
7890 #include "confdefs.h"
7891 /* pthread test headers */
7892 #include <pthread.h>
7893 #ifndef NULL
7894 #define NULL (void*)0
7895 #endif
7896
7897 static void *task(p)
7898         void *p;
7899 {
7900         return (void *) (p == NULL);
7901 }
7902
7903
7904 int main(argc, argv)
7905         int argc;
7906         char **argv;
7907 {
7908
7909         /* pthread test function */
7910         pthread_t t;
7911         int status;
7912         int detach = 1;
7913
7914 #ifdef HAVE_PTHREADS_FINAL
7915         /* Final pthreads */
7916         pthread_attr_t attr;
7917
7918         status = pthread_attr_init(&attr);
7919         if( status ) return status;
7920
7921 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7922         if( !detach ) {
7923 #if defined( PTHREAD_CREATE_JOINABLE )
7924                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7925 #else
7926                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7927 #endif
7928
7929 #ifdef PTHREAD_CREATE_DETACHED
7930         } else {
7931                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7932 #endif
7933         }
7934         if( status ) return status;
7935 #endif
7936
7937         status = pthread_create( &t, &attr, task, NULL );
7938         if( status ) return status;
7939
7940 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7941         if( detach ) {
7942                 /* give thread a chance to complete */
7943                 /* it should remain joinable and hence detachable */
7944                 sleep( 1 );
7945
7946                 status = pthread_detach( t );
7947                 if( status ) return status;
7948         }
7949 #endif
7950
7951 #else
7952         /* Draft 4 pthreads */
7953         status = pthread_create( &t, pthread_attr_default, task, NULL );
7954         if( status ) return status;
7955
7956         if( detach ) {
7957                 /* give thread a chance to complete */
7958                 /* it should remain joinable and hence detachable */
7959                 sleep( 1 );
7960
7961                 status = pthread_detach( &t );
7962                 if( status ) return status;
7963         }
7964 #endif
7965
7966 #ifdef HAVE_LINUX_THREADS
7967         pthread_kill_other_threads_np();
7968 #endif
7969
7970         return 0;
7971
7972 }
7973
7974 EOF
7975 if { (eval echo configure:7976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7976 then
7977   ol_cv_pthread_create=yes
7978 else
7979   echo "configure: failed program was:" >&5
7980   cat conftest.$ac_ext >&5
7981   rm -fr conftest*
7982   ol_cv_pthread_create=no
7983 fi
7984 rm -fr conftest*
7985 fi
7986
7987 fi
7988
7989 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7990
7991                 if test $ol_cv_pthread_create != no ; then
7992                         ol_link_threads=posix
7993                         ol_link_pthreads=""
7994                 fi
7995                 
7996                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7997 if test "$ol_link_threads" = no ; then
7998         # try -kthread
7999         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
8000 echo "configure:8001: checking for pthread link with -kthread" >&5
8001 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
8002   echo $ac_n "(cached) $ac_c" 1>&6
8003 else
8004   
8005                 # save the flags
8006                 ol_LIBS="$LIBS"
8007                 LIBS="-kthread $LIBS"
8008
8009                 if test "$cross_compiling" = yes; then
8010   cat > conftest.$ac_ext <<EOF
8011 #line 8012 "configure"
8012 #include "confdefs.h"
8013 /* pthread test headers */
8014 #include <pthread.h>
8015 #ifndef NULL
8016 #define NULL (void*)0
8017 #endif
8018
8019 static void *task(p)
8020         void *p;
8021 {
8022         return (void *) (p == NULL);
8023 }
8024
8025 int main() {
8026
8027         /* pthread test function */
8028         pthread_t t;
8029         int status;
8030         int detach = 1;
8031
8032 #ifdef HAVE_PTHREADS_FINAL
8033         /* Final pthreads */
8034         pthread_attr_t attr;
8035
8036         status = pthread_attr_init(&attr);
8037         if( status ) return status;
8038
8039 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8040         if( !detach ) {
8041 #if defined( PTHREAD_CREATE_JOINABLE )
8042                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8043 #else
8044                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8045 #endif
8046
8047 #ifdef PTHREAD_CREATE_DETACHED
8048         } else {
8049                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8050 #endif
8051         }
8052         if( status ) return status;
8053 #endif
8054
8055         status = pthread_create( &t, &attr, task, NULL );
8056         if( status ) return status;
8057
8058 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8059         if( detach ) {
8060                 /* give thread a chance to complete */
8061                 /* it should remain joinable and hence detachable */
8062                 sleep( 1 );
8063
8064                 status = pthread_detach( t );
8065                 if( status ) return status;
8066         }
8067 #endif
8068
8069 #else
8070         /* Draft 4 pthreads */
8071         status = pthread_create( &t, pthread_attr_default, task, NULL );
8072         if( status ) return status;
8073
8074         if( detach ) {
8075                 /* give thread a chance to complete */
8076                 /* it should remain joinable and hence detachable */
8077                 sleep( 1 );
8078
8079                 status = pthread_detach( &t );
8080                 if( status ) return status;
8081         }
8082 #endif
8083
8084 #ifdef HAVE_LINUX_THREADS
8085         pthread_kill_other_threads_np();
8086 #endif
8087
8088         return 0;
8089
8090 ; return 0; }
8091 EOF
8092 if { (eval echo configure:8093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8093   rm -rf conftest*
8094   ol_cv_pthread_kthread=yes
8095 else
8096   echo "configure: failed program was:" >&5
8097   cat conftest.$ac_ext >&5
8098   rm -rf conftest*
8099   ol_cv_pthread_kthread=no
8100 fi
8101 rm -f conftest*
8102 else
8103   cat > conftest.$ac_ext <<EOF
8104 #line 8105 "configure"
8105 #include "confdefs.h"
8106 /* pthread test headers */
8107 #include <pthread.h>
8108 #ifndef NULL
8109 #define NULL (void*)0
8110 #endif
8111
8112 static void *task(p)
8113         void *p;
8114 {
8115         return (void *) (p == NULL);
8116 }
8117
8118
8119 int main(argc, argv)
8120         int argc;
8121         char **argv;
8122 {
8123
8124         /* pthread test function */
8125         pthread_t t;
8126         int status;
8127         int detach = 1;
8128
8129 #ifdef HAVE_PTHREADS_FINAL
8130         /* Final pthreads */
8131         pthread_attr_t attr;
8132
8133         status = pthread_attr_init(&attr);
8134         if( status ) return status;
8135
8136 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8137         if( !detach ) {
8138 #if defined( PTHREAD_CREATE_JOINABLE )
8139                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8140 #else
8141                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8142 #endif
8143
8144 #ifdef PTHREAD_CREATE_DETACHED
8145         } else {
8146                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8147 #endif
8148         }
8149         if( status ) return status;
8150 #endif
8151
8152         status = pthread_create( &t, &attr, task, NULL );
8153         if( status ) return status;
8154
8155 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8156         if( detach ) {
8157                 /* give thread a chance to complete */
8158                 /* it should remain joinable and hence detachable */
8159                 sleep( 1 );
8160
8161                 status = pthread_detach( t );
8162                 if( status ) return status;
8163         }
8164 #endif
8165
8166 #else
8167         /* Draft 4 pthreads */
8168         status = pthread_create( &t, pthread_attr_default, task, NULL );
8169         if( status ) return status;
8170
8171         if( detach ) {
8172                 /* give thread a chance to complete */
8173                 /* it should remain joinable and hence detachable */
8174                 sleep( 1 );
8175
8176                 status = pthread_detach( &t );
8177                 if( status ) return status;
8178         }
8179 #endif
8180
8181 #ifdef HAVE_LINUX_THREADS
8182         pthread_kill_other_threads_np();
8183 #endif
8184
8185         return 0;
8186
8187 }
8188
8189 EOF
8190 if { (eval echo configure:8191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8191 then
8192   ol_cv_pthread_kthread=yes
8193 else
8194   echo "configure: failed program was:" >&5
8195   cat conftest.$ac_ext >&5
8196   rm -fr conftest*
8197   ol_cv_pthread_kthread=no
8198 fi
8199 rm -fr conftest*
8200 fi
8201
8202
8203                 # restore the LIBS
8204                 LIBS="$ol_LIBS"
8205         
8206 fi
8207
8208 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8209
8210         if test $ol_cv_pthread_kthread = yes ; then
8211                 ol_link_pthreads="-kthread"
8212                 ol_link_threads=posix
8213         fi
8214 fi
8215
8216                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8217 if test "$ol_link_threads" = no ; then
8218         # try -pthread
8219         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8220 echo "configure:8221: checking for pthread link with -pthread" >&5
8221 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8222   echo $ac_n "(cached) $ac_c" 1>&6
8223 else
8224   
8225                 # save the flags
8226                 ol_LIBS="$LIBS"
8227                 LIBS="-pthread $LIBS"
8228
8229                 if test "$cross_compiling" = yes; then
8230   cat > conftest.$ac_ext <<EOF
8231 #line 8232 "configure"
8232 #include "confdefs.h"
8233 /* pthread test headers */
8234 #include <pthread.h>
8235 #ifndef NULL
8236 #define NULL (void*)0
8237 #endif
8238
8239 static void *task(p)
8240         void *p;
8241 {
8242         return (void *) (p == NULL);
8243 }
8244
8245 int main() {
8246
8247         /* pthread test function */
8248         pthread_t t;
8249         int status;
8250         int detach = 1;
8251
8252 #ifdef HAVE_PTHREADS_FINAL
8253         /* Final pthreads */
8254         pthread_attr_t attr;
8255
8256         status = pthread_attr_init(&attr);
8257         if( status ) return status;
8258
8259 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8260         if( !detach ) {
8261 #if defined( PTHREAD_CREATE_JOINABLE )
8262                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8263 #else
8264                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8265 #endif
8266
8267 #ifdef PTHREAD_CREATE_DETACHED
8268         } else {
8269                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8270 #endif
8271         }
8272         if( status ) return status;
8273 #endif
8274
8275         status = pthread_create( &t, &attr, task, NULL );
8276         if( status ) return status;
8277
8278 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8279         if( detach ) {
8280                 /* give thread a chance to complete */
8281                 /* it should remain joinable and hence detachable */
8282                 sleep( 1 );
8283
8284                 status = pthread_detach( t );
8285                 if( status ) return status;
8286         }
8287 #endif
8288
8289 #else
8290         /* Draft 4 pthreads */
8291         status = pthread_create( &t, pthread_attr_default, task, NULL );
8292         if( status ) return status;
8293
8294         if( detach ) {
8295                 /* give thread a chance to complete */
8296                 /* it should remain joinable and hence detachable */
8297                 sleep( 1 );
8298
8299                 status = pthread_detach( &t );
8300                 if( status ) return status;
8301         }
8302 #endif
8303
8304 #ifdef HAVE_LINUX_THREADS
8305         pthread_kill_other_threads_np();
8306 #endif
8307
8308         return 0;
8309
8310 ; return 0; }
8311 EOF
8312 if { (eval echo configure:8313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8313   rm -rf conftest*
8314   ol_cv_pthread_pthread=yes
8315 else
8316   echo "configure: failed program was:" >&5
8317   cat conftest.$ac_ext >&5
8318   rm -rf conftest*
8319   ol_cv_pthread_pthread=no
8320 fi
8321 rm -f conftest*
8322 else
8323   cat > conftest.$ac_ext <<EOF
8324 #line 8325 "configure"
8325 #include "confdefs.h"
8326 /* pthread test headers */
8327 #include <pthread.h>
8328 #ifndef NULL
8329 #define NULL (void*)0
8330 #endif
8331
8332 static void *task(p)
8333         void *p;
8334 {
8335         return (void *) (p == NULL);
8336 }
8337
8338
8339 int main(argc, argv)
8340         int argc;
8341         char **argv;
8342 {
8343
8344         /* pthread test function */
8345         pthread_t t;
8346         int status;
8347         int detach = 1;
8348
8349 #ifdef HAVE_PTHREADS_FINAL
8350         /* Final pthreads */
8351         pthread_attr_t attr;
8352
8353         status = pthread_attr_init(&attr);
8354         if( status ) return status;
8355
8356 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8357         if( !detach ) {
8358 #if defined( PTHREAD_CREATE_JOINABLE )
8359                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8360 #else
8361                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8362 #endif
8363
8364 #ifdef PTHREAD_CREATE_DETACHED
8365         } else {
8366                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8367 #endif
8368         }
8369         if( status ) return status;
8370 #endif
8371
8372         status = pthread_create( &t, &attr, task, NULL );
8373         if( status ) return status;
8374
8375 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8376         if( detach ) {
8377                 /* give thread a chance to complete */
8378                 /* it should remain joinable and hence detachable */
8379                 sleep( 1 );
8380
8381                 status = pthread_detach( t );
8382                 if( status ) return status;
8383         }
8384 #endif
8385
8386 #else
8387         /* Draft 4 pthreads */
8388         status = pthread_create( &t, pthread_attr_default, task, NULL );
8389         if( status ) return status;
8390
8391         if( detach ) {
8392                 /* give thread a chance to complete */
8393                 /* it should remain joinable and hence detachable */
8394                 sleep( 1 );
8395
8396                 status = pthread_detach( &t );
8397                 if( status ) return status;
8398         }
8399 #endif
8400
8401 #ifdef HAVE_LINUX_THREADS
8402         pthread_kill_other_threads_np();
8403 #endif
8404
8405         return 0;
8406
8407 }
8408
8409 EOF
8410 if { (eval echo configure:8411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8411 then
8412   ol_cv_pthread_pthread=yes
8413 else
8414   echo "configure: failed program was:" >&5
8415   cat conftest.$ac_ext >&5
8416   rm -fr conftest*
8417   ol_cv_pthread_pthread=no
8418 fi
8419 rm -fr conftest*
8420 fi
8421
8422
8423                 # restore the LIBS
8424                 LIBS="$ol_LIBS"
8425         
8426 fi
8427
8428 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8429
8430         if test $ol_cv_pthread_pthread = yes ; then
8431                 ol_link_pthreads="-pthread"
8432                 ol_link_threads=posix
8433         fi
8434 fi
8435
8436                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8437 if test "$ol_link_threads" = no ; then
8438         # try -pthreads
8439         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8440 echo "configure:8441: checking for pthread link with -pthreads" >&5
8441 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8442   echo $ac_n "(cached) $ac_c" 1>&6
8443 else
8444   
8445                 # save the flags
8446                 ol_LIBS="$LIBS"
8447                 LIBS="-pthreads $LIBS"
8448
8449                 if test "$cross_compiling" = yes; then
8450   cat > conftest.$ac_ext <<EOF
8451 #line 8452 "configure"
8452 #include "confdefs.h"
8453 /* pthread test headers */
8454 #include <pthread.h>
8455 #ifndef NULL
8456 #define NULL (void*)0
8457 #endif
8458
8459 static void *task(p)
8460         void *p;
8461 {
8462         return (void *) (p == NULL);
8463 }
8464
8465 int main() {
8466
8467         /* pthread test function */
8468         pthread_t t;
8469         int status;
8470         int detach = 1;
8471
8472 #ifdef HAVE_PTHREADS_FINAL
8473         /* Final pthreads */
8474         pthread_attr_t attr;
8475
8476         status = pthread_attr_init(&attr);
8477         if( status ) return status;
8478
8479 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8480         if( !detach ) {
8481 #if defined( PTHREAD_CREATE_JOINABLE )
8482                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8483 #else
8484                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8485 #endif
8486
8487 #ifdef PTHREAD_CREATE_DETACHED
8488         } else {
8489                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8490 #endif
8491         }
8492         if( status ) return status;
8493 #endif
8494
8495         status = pthread_create( &t, &attr, task, NULL );
8496         if( status ) return status;
8497
8498 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8499         if( detach ) {
8500                 /* give thread a chance to complete */
8501                 /* it should remain joinable and hence detachable */
8502                 sleep( 1 );
8503
8504                 status = pthread_detach( t );
8505                 if( status ) return status;
8506         }
8507 #endif
8508
8509 #else
8510         /* Draft 4 pthreads */
8511         status = pthread_create( &t, pthread_attr_default, task, NULL );
8512         if( status ) return status;
8513
8514         if( detach ) {
8515                 /* give thread a chance to complete */
8516                 /* it should remain joinable and hence detachable */
8517                 sleep( 1 );
8518
8519                 status = pthread_detach( &t );
8520                 if( status ) return status;
8521         }
8522 #endif
8523
8524 #ifdef HAVE_LINUX_THREADS
8525         pthread_kill_other_threads_np();
8526 #endif
8527
8528         return 0;
8529
8530 ; return 0; }
8531 EOF
8532 if { (eval echo configure:8533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8533   rm -rf conftest*
8534   ol_cv_pthread_pthreads=yes
8535 else
8536   echo "configure: failed program was:" >&5
8537   cat conftest.$ac_ext >&5
8538   rm -rf conftest*
8539   ol_cv_pthread_pthreads=no
8540 fi
8541 rm -f conftest*
8542 else
8543   cat > conftest.$ac_ext <<EOF
8544 #line 8545 "configure"
8545 #include "confdefs.h"
8546 /* pthread test headers */
8547 #include <pthread.h>
8548 #ifndef NULL
8549 #define NULL (void*)0
8550 #endif
8551
8552 static void *task(p)
8553         void *p;
8554 {
8555         return (void *) (p == NULL);
8556 }
8557
8558
8559 int main(argc, argv)
8560         int argc;
8561         char **argv;
8562 {
8563
8564         /* pthread test function */
8565         pthread_t t;
8566         int status;
8567         int detach = 1;
8568
8569 #ifdef HAVE_PTHREADS_FINAL
8570         /* Final pthreads */
8571         pthread_attr_t attr;
8572
8573         status = pthread_attr_init(&attr);
8574         if( status ) return status;
8575
8576 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8577         if( !detach ) {
8578 #if defined( PTHREAD_CREATE_JOINABLE )
8579                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8580 #else
8581                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8582 #endif
8583
8584 #ifdef PTHREAD_CREATE_DETACHED
8585         } else {
8586                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8587 #endif
8588         }
8589         if( status ) return status;
8590 #endif
8591
8592         status = pthread_create( &t, &attr, task, NULL );
8593         if( status ) return status;
8594
8595 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8596         if( detach ) {
8597                 /* give thread a chance to complete */
8598                 /* it should remain joinable and hence detachable */
8599                 sleep( 1 );
8600
8601                 status = pthread_detach( t );
8602                 if( status ) return status;
8603         }
8604 #endif
8605
8606 #else
8607         /* Draft 4 pthreads */
8608         status = pthread_create( &t, pthread_attr_default, task, NULL );
8609         if( status ) return status;
8610
8611         if( detach ) {
8612                 /* give thread a chance to complete */
8613                 /* it should remain joinable and hence detachable */
8614                 sleep( 1 );
8615
8616                 status = pthread_detach( &t );
8617                 if( status ) return status;
8618         }
8619 #endif
8620
8621 #ifdef HAVE_LINUX_THREADS
8622         pthread_kill_other_threads_np();
8623 #endif
8624
8625         return 0;
8626
8627 }
8628
8629 EOF
8630 if { (eval echo configure:8631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8631 then
8632   ol_cv_pthread_pthreads=yes
8633 else
8634   echo "configure: failed program was:" >&5
8635   cat conftest.$ac_ext >&5
8636   rm -fr conftest*
8637   ol_cv_pthread_pthreads=no
8638 fi
8639 rm -fr conftest*
8640 fi
8641
8642
8643                 # restore the LIBS
8644                 LIBS="$ol_LIBS"
8645         
8646 fi
8647
8648 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8649
8650         if test $ol_cv_pthread_pthreads = yes ; then
8651                 ol_link_pthreads="-pthreads"
8652                 ol_link_threads=posix
8653         fi
8654 fi
8655
8656                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8657 if test "$ol_link_threads" = no ; then
8658         # try -mthreads
8659         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8660 echo "configure:8661: checking for pthread link with -mthreads" >&5
8661 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8662   echo $ac_n "(cached) $ac_c" 1>&6
8663 else
8664   
8665                 # save the flags
8666                 ol_LIBS="$LIBS"
8667                 LIBS="-mthreads $LIBS"
8668
8669                 if test "$cross_compiling" = yes; then
8670   cat > conftest.$ac_ext <<EOF
8671 #line 8672 "configure"
8672 #include "confdefs.h"
8673 /* pthread test headers */
8674 #include <pthread.h>
8675 #ifndef NULL
8676 #define NULL (void*)0
8677 #endif
8678
8679 static void *task(p)
8680         void *p;
8681 {
8682         return (void *) (p == NULL);
8683 }
8684
8685 int main() {
8686
8687         /* pthread test function */
8688         pthread_t t;
8689         int status;
8690         int detach = 1;
8691
8692 #ifdef HAVE_PTHREADS_FINAL
8693         /* Final pthreads */
8694         pthread_attr_t attr;
8695
8696         status = pthread_attr_init(&attr);
8697         if( status ) return status;
8698
8699 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8700         if( !detach ) {
8701 #if defined( PTHREAD_CREATE_JOINABLE )
8702                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8703 #else
8704                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8705 #endif
8706
8707 #ifdef PTHREAD_CREATE_DETACHED
8708         } else {
8709                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8710 #endif
8711         }
8712         if( status ) return status;
8713 #endif
8714
8715         status = pthread_create( &t, &attr, task, NULL );
8716         if( status ) return status;
8717
8718 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8719         if( detach ) {
8720                 /* give thread a chance to complete */
8721                 /* it should remain joinable and hence detachable */
8722                 sleep( 1 );
8723
8724                 status = pthread_detach( t );
8725                 if( status ) return status;
8726         }
8727 #endif
8728
8729 #else
8730         /* Draft 4 pthreads */
8731         status = pthread_create( &t, pthread_attr_default, task, NULL );
8732         if( status ) return status;
8733
8734         if( detach ) {
8735                 /* give thread a chance to complete */
8736                 /* it should remain joinable and hence detachable */
8737                 sleep( 1 );
8738
8739                 status = pthread_detach( &t );
8740                 if( status ) return status;
8741         }
8742 #endif
8743
8744 #ifdef HAVE_LINUX_THREADS
8745         pthread_kill_other_threads_np();
8746 #endif
8747
8748         return 0;
8749
8750 ; return 0; }
8751 EOF
8752 if { (eval echo configure:8753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8753   rm -rf conftest*
8754   ol_cv_pthread_mthreads=yes
8755 else
8756   echo "configure: failed program was:" >&5
8757   cat conftest.$ac_ext >&5
8758   rm -rf conftest*
8759   ol_cv_pthread_mthreads=no
8760 fi
8761 rm -f conftest*
8762 else
8763   cat > conftest.$ac_ext <<EOF
8764 #line 8765 "configure"
8765 #include "confdefs.h"
8766 /* pthread test headers */
8767 #include <pthread.h>
8768 #ifndef NULL
8769 #define NULL (void*)0
8770 #endif
8771
8772 static void *task(p)
8773         void *p;
8774 {
8775         return (void *) (p == NULL);
8776 }
8777
8778
8779 int main(argc, argv)
8780         int argc;
8781         char **argv;
8782 {
8783
8784         /* pthread test function */
8785         pthread_t t;
8786         int status;
8787         int detach = 1;
8788
8789 #ifdef HAVE_PTHREADS_FINAL
8790         /* Final pthreads */
8791         pthread_attr_t attr;
8792
8793         status = pthread_attr_init(&attr);
8794         if( status ) return status;
8795
8796 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8797         if( !detach ) {
8798 #if defined( PTHREAD_CREATE_JOINABLE )
8799                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8800 #else
8801                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8802 #endif
8803
8804 #ifdef PTHREAD_CREATE_DETACHED
8805         } else {
8806                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8807 #endif
8808         }
8809         if( status ) return status;
8810 #endif
8811
8812         status = pthread_create( &t, &attr, task, NULL );
8813         if( status ) return status;
8814
8815 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8816         if( detach ) {
8817                 /* give thread a chance to complete */
8818                 /* it should remain joinable and hence detachable */
8819                 sleep( 1 );
8820
8821                 status = pthread_detach( t );
8822                 if( status ) return status;
8823         }
8824 #endif
8825
8826 #else
8827         /* Draft 4 pthreads */
8828         status = pthread_create( &t, pthread_attr_default, task, NULL );
8829         if( status ) return status;
8830
8831         if( detach ) {
8832                 /* give thread a chance to complete */
8833                 /* it should remain joinable and hence detachable */
8834                 sleep( 1 );
8835
8836                 status = pthread_detach( &t );
8837                 if( status ) return status;
8838         }
8839 #endif
8840
8841 #ifdef HAVE_LINUX_THREADS
8842         pthread_kill_other_threads_np();
8843 #endif
8844
8845         return 0;
8846
8847 }
8848
8849 EOF
8850 if { (eval echo configure:8851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8851 then
8852   ol_cv_pthread_mthreads=yes
8853 else
8854   echo "configure: failed program was:" >&5
8855   cat conftest.$ac_ext >&5
8856   rm -fr conftest*
8857   ol_cv_pthread_mthreads=no
8858 fi
8859 rm -fr conftest*
8860 fi
8861
8862
8863                 # restore the LIBS
8864                 LIBS="$ol_LIBS"
8865         
8866 fi
8867
8868 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8869
8870         if test $ol_cv_pthread_mthreads = yes ; then
8871                 ol_link_pthreads="-mthreads"
8872                 ol_link_threads=posix
8873         fi
8874 fi
8875
8876                 # Pthread try link: -thread (ol_cv_pthread_thread)
8877 if test "$ol_link_threads" = no ; then
8878         # try -thread
8879         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8880 echo "configure:8881: checking for pthread link with -thread" >&5
8881 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8882   echo $ac_n "(cached) $ac_c" 1>&6
8883 else
8884   
8885                 # save the flags
8886                 ol_LIBS="$LIBS"
8887                 LIBS="-thread $LIBS"
8888
8889                 if test "$cross_compiling" = yes; then
8890   cat > conftest.$ac_ext <<EOF
8891 #line 8892 "configure"
8892 #include "confdefs.h"
8893 /* pthread test headers */
8894 #include <pthread.h>
8895 #ifndef NULL
8896 #define NULL (void*)0
8897 #endif
8898
8899 static void *task(p)
8900         void *p;
8901 {
8902         return (void *) (p == NULL);
8903 }
8904
8905 int main() {
8906
8907         /* pthread test function */
8908         pthread_t t;
8909         int status;
8910         int detach = 1;
8911
8912 #ifdef HAVE_PTHREADS_FINAL
8913         /* Final pthreads */
8914         pthread_attr_t attr;
8915
8916         status = pthread_attr_init(&attr);
8917         if( status ) return status;
8918
8919 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8920         if( !detach ) {
8921 #if defined( PTHREAD_CREATE_JOINABLE )
8922                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8923 #else
8924                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8925 #endif
8926
8927 #ifdef PTHREAD_CREATE_DETACHED
8928         } else {
8929                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8930 #endif
8931         }
8932         if( status ) return status;
8933 #endif
8934
8935         status = pthread_create( &t, &attr, task, NULL );
8936         if( status ) return status;
8937
8938 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8939         if( detach ) {
8940                 /* give thread a chance to complete */
8941                 /* it should remain joinable and hence detachable */
8942                 sleep( 1 );
8943
8944                 status = pthread_detach( t );
8945                 if( status ) return status;
8946         }
8947 #endif
8948
8949 #else
8950         /* Draft 4 pthreads */
8951         status = pthread_create( &t, pthread_attr_default, task, NULL );
8952         if( status ) return status;
8953
8954         if( detach ) {
8955                 /* give thread a chance to complete */
8956                 /* it should remain joinable and hence detachable */
8957                 sleep( 1 );
8958
8959                 status = pthread_detach( &t );
8960                 if( status ) return status;
8961         }
8962 #endif
8963
8964 #ifdef HAVE_LINUX_THREADS
8965         pthread_kill_other_threads_np();
8966 #endif
8967
8968         return 0;
8969
8970 ; return 0; }
8971 EOF
8972 if { (eval echo configure:8973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8973   rm -rf conftest*
8974   ol_cv_pthread_thread=yes
8975 else
8976   echo "configure: failed program was:" >&5
8977   cat conftest.$ac_ext >&5
8978   rm -rf conftest*
8979   ol_cv_pthread_thread=no
8980 fi
8981 rm -f conftest*
8982 else
8983   cat > conftest.$ac_ext <<EOF
8984 #line 8985 "configure"
8985 #include "confdefs.h"
8986 /* pthread test headers */
8987 #include <pthread.h>
8988 #ifndef NULL
8989 #define NULL (void*)0
8990 #endif
8991
8992 static void *task(p)
8993         void *p;
8994 {
8995         return (void *) (p == NULL);
8996 }
8997
8998
8999 int main(argc, argv)
9000         int argc;
9001         char **argv;
9002 {
9003
9004         /* pthread test function */
9005         pthread_t t;
9006         int status;
9007         int detach = 1;
9008
9009 #ifdef HAVE_PTHREADS_FINAL
9010         /* Final pthreads */
9011         pthread_attr_t attr;
9012
9013         status = pthread_attr_init(&attr);
9014         if( status ) return status;
9015
9016 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9017         if( !detach ) {
9018 #if defined( PTHREAD_CREATE_JOINABLE )
9019                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9020 #else
9021                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9022 #endif
9023
9024 #ifdef PTHREAD_CREATE_DETACHED
9025         } else {
9026                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9027 #endif
9028         }
9029         if( status ) return status;
9030 #endif
9031
9032         status = pthread_create( &t, &attr, task, NULL );
9033         if( status ) return status;
9034
9035 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9036         if( detach ) {
9037                 /* give thread a chance to complete */
9038                 /* it should remain joinable and hence detachable */
9039                 sleep( 1 );
9040
9041                 status = pthread_detach( t );
9042                 if( status ) return status;
9043         }
9044 #endif
9045
9046 #else
9047         /* Draft 4 pthreads */
9048         status = pthread_create( &t, pthread_attr_default, task, NULL );
9049         if( status ) return status;
9050
9051         if( detach ) {
9052                 /* give thread a chance to complete */
9053                 /* it should remain joinable and hence detachable */
9054                 sleep( 1 );
9055
9056                 status = pthread_detach( &t );
9057                 if( status ) return status;
9058         }
9059 #endif
9060
9061 #ifdef HAVE_LINUX_THREADS
9062         pthread_kill_other_threads_np();
9063 #endif
9064
9065         return 0;
9066
9067 }
9068
9069 EOF
9070 if { (eval echo configure:9071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9071 then
9072   ol_cv_pthread_thread=yes
9073 else
9074   echo "configure: failed program was:" >&5
9075   cat conftest.$ac_ext >&5
9076   rm -fr conftest*
9077   ol_cv_pthread_thread=no
9078 fi
9079 rm -fr conftest*
9080 fi
9081
9082
9083                 # restore the LIBS
9084                 LIBS="$ol_LIBS"
9085         
9086 fi
9087
9088 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
9089
9090         if test $ol_cv_pthread_thread = yes ; then
9091                 ol_link_pthreads="-thread"
9092                 ol_link_threads=posix
9093         fi
9094 fi
9095
9096
9097                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
9098 if test "$ol_link_threads" = no ; then
9099         # try -lpthread -lmach -lexc -lc_r
9100         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
9101 echo "configure:9102: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
9102 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
9103   echo $ac_n "(cached) $ac_c" 1>&6
9104 else
9105   
9106                 # save the flags
9107                 ol_LIBS="$LIBS"
9108                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
9109
9110                 if test "$cross_compiling" = yes; then
9111   cat > conftest.$ac_ext <<EOF
9112 #line 9113 "configure"
9113 #include "confdefs.h"
9114 /* pthread test headers */
9115 #include <pthread.h>
9116 #ifndef NULL
9117 #define NULL (void*)0
9118 #endif
9119
9120 static void *task(p)
9121         void *p;
9122 {
9123         return (void *) (p == NULL);
9124 }
9125
9126 int main() {
9127
9128         /* pthread test function */
9129         pthread_t t;
9130         int status;
9131         int detach = 1;
9132
9133 #ifdef HAVE_PTHREADS_FINAL
9134         /* Final pthreads */
9135         pthread_attr_t attr;
9136
9137         status = pthread_attr_init(&attr);
9138         if( status ) return status;
9139
9140 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9141         if( !detach ) {
9142 #if defined( PTHREAD_CREATE_JOINABLE )
9143                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9144 #else
9145                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9146 #endif
9147
9148 #ifdef PTHREAD_CREATE_DETACHED
9149         } else {
9150                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9151 #endif
9152         }
9153         if( status ) return status;
9154 #endif
9155
9156         status = pthread_create( &t, &attr, task, NULL );
9157         if( status ) return status;
9158
9159 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9160         if( detach ) {
9161                 /* give thread a chance to complete */
9162                 /* it should remain joinable and hence detachable */
9163                 sleep( 1 );
9164
9165                 status = pthread_detach( t );
9166                 if( status ) return status;
9167         }
9168 #endif
9169
9170 #else
9171         /* Draft 4 pthreads */
9172         status = pthread_create( &t, pthread_attr_default, task, NULL );
9173         if( status ) return status;
9174
9175         if( detach ) {
9176                 /* give thread a chance to complete */
9177                 /* it should remain joinable and hence detachable */
9178                 sleep( 1 );
9179
9180                 status = pthread_detach( &t );
9181                 if( status ) return status;
9182         }
9183 #endif
9184
9185 #ifdef HAVE_LINUX_THREADS
9186         pthread_kill_other_threads_np();
9187 #endif
9188
9189         return 0;
9190
9191 ; return 0; }
9192 EOF
9193 if { (eval echo configure:9194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9194   rm -rf conftest*
9195   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9196 else
9197   echo "configure: failed program was:" >&5
9198   cat conftest.$ac_ext >&5
9199   rm -rf conftest*
9200   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9201 fi
9202 rm -f conftest*
9203 else
9204   cat > conftest.$ac_ext <<EOF
9205 #line 9206 "configure"
9206 #include "confdefs.h"
9207 /* pthread test headers */
9208 #include <pthread.h>
9209 #ifndef NULL
9210 #define NULL (void*)0
9211 #endif
9212
9213 static void *task(p)
9214         void *p;
9215 {
9216         return (void *) (p == NULL);
9217 }
9218
9219
9220 int main(argc, argv)
9221         int argc;
9222         char **argv;
9223 {
9224
9225         /* pthread test function */
9226         pthread_t t;
9227         int status;
9228         int detach = 1;
9229
9230 #ifdef HAVE_PTHREADS_FINAL
9231         /* Final pthreads */
9232         pthread_attr_t attr;
9233
9234         status = pthread_attr_init(&attr);
9235         if( status ) return status;
9236
9237 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9238         if( !detach ) {
9239 #if defined( PTHREAD_CREATE_JOINABLE )
9240                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9241 #else
9242                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9243 #endif
9244
9245 #ifdef PTHREAD_CREATE_DETACHED
9246         } else {
9247                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9248 #endif
9249         }
9250         if( status ) return status;
9251 #endif
9252
9253         status = pthread_create( &t, &attr, task, NULL );
9254         if( status ) return status;
9255
9256 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9257         if( detach ) {
9258                 /* give thread a chance to complete */
9259                 /* it should remain joinable and hence detachable */
9260                 sleep( 1 );
9261
9262                 status = pthread_detach( t );
9263                 if( status ) return status;
9264         }
9265 #endif
9266
9267 #else
9268         /* Draft 4 pthreads */
9269         status = pthread_create( &t, pthread_attr_default, task, NULL );
9270         if( status ) return status;
9271
9272         if( detach ) {
9273                 /* give thread a chance to complete */
9274                 /* it should remain joinable and hence detachable */
9275                 sleep( 1 );
9276
9277                 status = pthread_detach( &t );
9278                 if( status ) return status;
9279         }
9280 #endif
9281
9282 #ifdef HAVE_LINUX_THREADS
9283         pthread_kill_other_threads_np();
9284 #endif
9285
9286         return 0;
9287
9288 }
9289
9290 EOF
9291 if { (eval echo configure:9292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9292 then
9293   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9294 else
9295   echo "configure: failed program was:" >&5
9296   cat conftest.$ac_ext >&5
9297   rm -fr conftest*
9298   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9299 fi
9300 rm -fr conftest*
9301 fi
9302
9303
9304                 # restore the LIBS
9305                 LIBS="$ol_LIBS"
9306         
9307 fi
9308
9309 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9310
9311         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9312                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9313                 ol_link_threads=posix
9314         fi
9315 fi
9316
9317                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9318 if test "$ol_link_threads" = no ; then
9319         # try -lpthread -lmach -lexc
9320         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9321 echo "configure:9322: checking for pthread link with -lpthread -lmach -lexc" >&5
9322 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9323   echo $ac_n "(cached) $ac_c" 1>&6
9324 else
9325   
9326                 # save the flags
9327                 ol_LIBS="$LIBS"
9328                 LIBS="-lpthread -lmach -lexc $LIBS"
9329
9330                 if test "$cross_compiling" = yes; then
9331   cat > conftest.$ac_ext <<EOF
9332 #line 9333 "configure"
9333 #include "confdefs.h"
9334 /* pthread test headers */
9335 #include <pthread.h>
9336 #ifndef NULL
9337 #define NULL (void*)0
9338 #endif
9339
9340 static void *task(p)
9341         void *p;
9342 {
9343         return (void *) (p == NULL);
9344 }
9345
9346 int main() {
9347
9348         /* pthread test function */
9349         pthread_t t;
9350         int status;
9351         int detach = 1;
9352
9353 #ifdef HAVE_PTHREADS_FINAL
9354         /* Final pthreads */
9355         pthread_attr_t attr;
9356
9357         status = pthread_attr_init(&attr);
9358         if( status ) return status;
9359
9360 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9361         if( !detach ) {
9362 #if defined( PTHREAD_CREATE_JOINABLE )
9363                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9364 #else
9365                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9366 #endif
9367
9368 #ifdef PTHREAD_CREATE_DETACHED
9369         } else {
9370                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9371 #endif
9372         }
9373         if( status ) return status;
9374 #endif
9375
9376         status = pthread_create( &t, &attr, task, NULL );
9377         if( status ) return status;
9378
9379 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9380         if( detach ) {
9381                 /* give thread a chance to complete */
9382                 /* it should remain joinable and hence detachable */
9383                 sleep( 1 );
9384
9385                 status = pthread_detach( t );
9386                 if( status ) return status;
9387         }
9388 #endif
9389
9390 #else
9391         /* Draft 4 pthreads */
9392         status = pthread_create( &t, pthread_attr_default, task, NULL );
9393         if( status ) return status;
9394
9395         if( detach ) {
9396                 /* give thread a chance to complete */
9397                 /* it should remain joinable and hence detachable */
9398                 sleep( 1 );
9399
9400                 status = pthread_detach( &t );
9401                 if( status ) return status;
9402         }
9403 #endif
9404
9405 #ifdef HAVE_LINUX_THREADS
9406         pthread_kill_other_threads_np();
9407 #endif
9408
9409         return 0;
9410
9411 ; return 0; }
9412 EOF
9413 if { (eval echo configure:9414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9414   rm -rf conftest*
9415   ol_cv_pthread_lpthread_lmach_lexc=yes
9416 else
9417   echo "configure: failed program was:" >&5
9418   cat conftest.$ac_ext >&5
9419   rm -rf conftest*
9420   ol_cv_pthread_lpthread_lmach_lexc=no
9421 fi
9422 rm -f conftest*
9423 else
9424   cat > conftest.$ac_ext <<EOF
9425 #line 9426 "configure"
9426 #include "confdefs.h"
9427 /* pthread test headers */
9428 #include <pthread.h>
9429 #ifndef NULL
9430 #define NULL (void*)0
9431 #endif
9432
9433 static void *task(p)
9434         void *p;
9435 {
9436         return (void *) (p == NULL);
9437 }
9438
9439
9440 int main(argc, argv)
9441         int argc;
9442         char **argv;
9443 {
9444
9445         /* pthread test function */
9446         pthread_t t;
9447         int status;
9448         int detach = 1;
9449
9450 #ifdef HAVE_PTHREADS_FINAL
9451         /* Final pthreads */
9452         pthread_attr_t attr;
9453
9454         status = pthread_attr_init(&attr);
9455         if( status ) return status;
9456
9457 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9458         if( !detach ) {
9459 #if defined( PTHREAD_CREATE_JOINABLE )
9460                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9461 #else
9462                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9463 #endif
9464
9465 #ifdef PTHREAD_CREATE_DETACHED
9466         } else {
9467                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9468 #endif
9469         }
9470         if( status ) return status;
9471 #endif
9472
9473         status = pthread_create( &t, &attr, task, NULL );
9474         if( status ) return status;
9475
9476 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9477         if( detach ) {
9478                 /* give thread a chance to complete */
9479                 /* it should remain joinable and hence detachable */
9480                 sleep( 1 );
9481
9482                 status = pthread_detach( t );
9483                 if( status ) return status;
9484         }
9485 #endif
9486
9487 #else
9488         /* Draft 4 pthreads */
9489         status = pthread_create( &t, pthread_attr_default, task, NULL );
9490         if( status ) return status;
9491
9492         if( detach ) {
9493                 /* give thread a chance to complete */
9494                 /* it should remain joinable and hence detachable */
9495                 sleep( 1 );
9496
9497                 status = pthread_detach( &t );
9498                 if( status ) return status;
9499         }
9500 #endif
9501
9502 #ifdef HAVE_LINUX_THREADS
9503         pthread_kill_other_threads_np();
9504 #endif
9505
9506         return 0;
9507
9508 }
9509
9510 EOF
9511 if { (eval echo configure:9512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9512 then
9513   ol_cv_pthread_lpthread_lmach_lexc=yes
9514 else
9515   echo "configure: failed program was:" >&5
9516   cat conftest.$ac_ext >&5
9517   rm -fr conftest*
9518   ol_cv_pthread_lpthread_lmach_lexc=no
9519 fi
9520 rm -fr conftest*
9521 fi
9522
9523
9524                 # restore the LIBS
9525                 LIBS="$ol_LIBS"
9526         
9527 fi
9528
9529 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9530
9531         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9532                 ol_link_pthreads="-lpthread -lmach -lexc"
9533                 ol_link_threads=posix
9534         fi
9535 fi
9536
9537
9538                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9539 if test "$ol_link_threads" = no ; then
9540         # try -lpthread -Wl,-woff,85
9541         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9542 echo "configure:9543: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9543 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9544   echo $ac_n "(cached) $ac_c" 1>&6
9545 else
9546   
9547                 # save the flags
9548                 ol_LIBS="$LIBS"
9549                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9550
9551                 if test "$cross_compiling" = yes; then
9552   cat > conftest.$ac_ext <<EOF
9553 #line 9554 "configure"
9554 #include "confdefs.h"
9555 /* pthread test headers */
9556 #include <pthread.h>
9557 #ifndef NULL
9558 #define NULL (void*)0
9559 #endif
9560
9561 static void *task(p)
9562         void *p;
9563 {
9564         return (void *) (p == NULL);
9565 }
9566
9567 int main() {
9568
9569         /* pthread test function */
9570         pthread_t t;
9571         int status;
9572         int detach = 1;
9573
9574 #ifdef HAVE_PTHREADS_FINAL
9575         /* Final pthreads */
9576         pthread_attr_t attr;
9577
9578         status = pthread_attr_init(&attr);
9579         if( status ) return status;
9580
9581 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9582         if( !detach ) {
9583 #if defined( PTHREAD_CREATE_JOINABLE )
9584                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9585 #else
9586                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9587 #endif
9588
9589 #ifdef PTHREAD_CREATE_DETACHED
9590         } else {
9591                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9592 #endif
9593         }
9594         if( status ) return status;
9595 #endif
9596
9597         status = pthread_create( &t, &attr, task, NULL );
9598         if( status ) return status;
9599
9600 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9601         if( detach ) {
9602                 /* give thread a chance to complete */
9603                 /* it should remain joinable and hence detachable */
9604                 sleep( 1 );
9605
9606                 status = pthread_detach( t );
9607                 if( status ) return status;
9608         }
9609 #endif
9610
9611 #else
9612         /* Draft 4 pthreads */
9613         status = pthread_create( &t, pthread_attr_default, task, NULL );
9614         if( status ) return status;
9615
9616         if( detach ) {
9617                 /* give thread a chance to complete */
9618                 /* it should remain joinable and hence detachable */
9619                 sleep( 1 );
9620
9621                 status = pthread_detach( &t );
9622                 if( status ) return status;
9623         }
9624 #endif
9625
9626 #ifdef HAVE_LINUX_THREADS
9627         pthread_kill_other_threads_np();
9628 #endif
9629
9630         return 0;
9631
9632 ; return 0; }
9633 EOF
9634 if { (eval echo configure:9635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9635   rm -rf conftest*
9636   ol_cv_pthread_lib_lpthread_woff=yes
9637 else
9638   echo "configure: failed program was:" >&5
9639   cat conftest.$ac_ext >&5
9640   rm -rf conftest*
9641   ol_cv_pthread_lib_lpthread_woff=no
9642 fi
9643 rm -f conftest*
9644 else
9645   cat > conftest.$ac_ext <<EOF
9646 #line 9647 "configure"
9647 #include "confdefs.h"
9648 /* pthread test headers */
9649 #include <pthread.h>
9650 #ifndef NULL
9651 #define NULL (void*)0
9652 #endif
9653
9654 static void *task(p)
9655         void *p;
9656 {
9657         return (void *) (p == NULL);
9658 }
9659
9660
9661 int main(argc, argv)
9662         int argc;
9663         char **argv;
9664 {
9665
9666         /* pthread test function */
9667         pthread_t t;
9668         int status;
9669         int detach = 1;
9670
9671 #ifdef HAVE_PTHREADS_FINAL
9672         /* Final pthreads */
9673         pthread_attr_t attr;
9674
9675         status = pthread_attr_init(&attr);
9676         if( status ) return status;
9677
9678 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9679         if( !detach ) {
9680 #if defined( PTHREAD_CREATE_JOINABLE )
9681                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9682 #else
9683                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9684 #endif
9685
9686 #ifdef PTHREAD_CREATE_DETACHED
9687         } else {
9688                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9689 #endif
9690         }
9691         if( status ) return status;
9692 #endif
9693
9694         status = pthread_create( &t, &attr, task, NULL );
9695         if( status ) return status;
9696
9697 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9698         if( detach ) {
9699                 /* give thread a chance to complete */
9700                 /* it should remain joinable and hence detachable */
9701                 sleep( 1 );
9702
9703                 status = pthread_detach( t );
9704                 if( status ) return status;
9705         }
9706 #endif
9707
9708 #else
9709         /* Draft 4 pthreads */
9710         status = pthread_create( &t, pthread_attr_default, task, NULL );
9711         if( status ) return status;
9712
9713         if( detach ) {
9714                 /* give thread a chance to complete */
9715                 /* it should remain joinable and hence detachable */
9716                 sleep( 1 );
9717
9718                 status = pthread_detach( &t );
9719                 if( status ) return status;
9720         }
9721 #endif
9722
9723 #ifdef HAVE_LINUX_THREADS
9724         pthread_kill_other_threads_np();
9725 #endif
9726
9727         return 0;
9728
9729 }
9730
9731 EOF
9732 if { (eval echo configure:9733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9733 then
9734   ol_cv_pthread_lib_lpthread_woff=yes
9735 else
9736   echo "configure: failed program was:" >&5
9737   cat conftest.$ac_ext >&5
9738   rm -fr conftest*
9739   ol_cv_pthread_lib_lpthread_woff=no
9740 fi
9741 rm -fr conftest*
9742 fi
9743
9744
9745                 # restore the LIBS
9746                 LIBS="$ol_LIBS"
9747         
9748 fi
9749
9750 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9751
9752         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9753                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9754                 ol_link_threads=posix
9755         fi
9756 fi
9757
9758
9759                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9760 if test "$ol_link_threads" = no ; then
9761         # try -lpthread
9762         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9763 echo "configure:9764: checking for pthread link with -lpthread" >&5
9764 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9765   echo $ac_n "(cached) $ac_c" 1>&6
9766 else
9767   
9768                 # save the flags
9769                 ol_LIBS="$LIBS"
9770                 LIBS="-lpthread $LIBS"
9771
9772                 if test "$cross_compiling" = yes; then
9773   cat > conftest.$ac_ext <<EOF
9774 #line 9775 "configure"
9775 #include "confdefs.h"
9776 /* pthread test headers */
9777 #include <pthread.h>
9778 #ifndef NULL
9779 #define NULL (void*)0
9780 #endif
9781
9782 static void *task(p)
9783         void *p;
9784 {
9785         return (void *) (p == NULL);
9786 }
9787
9788 int main() {
9789
9790         /* pthread test function */
9791         pthread_t t;
9792         int status;
9793         int detach = 1;
9794
9795 #ifdef HAVE_PTHREADS_FINAL
9796         /* Final pthreads */
9797         pthread_attr_t attr;
9798
9799         status = pthread_attr_init(&attr);
9800         if( status ) return status;
9801
9802 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9803         if( !detach ) {
9804 #if defined( PTHREAD_CREATE_JOINABLE )
9805                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9806 #else
9807                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9808 #endif
9809
9810 #ifdef PTHREAD_CREATE_DETACHED
9811         } else {
9812                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9813 #endif
9814         }
9815         if( status ) return status;
9816 #endif
9817
9818         status = pthread_create( &t, &attr, task, NULL );
9819         if( status ) return status;
9820
9821 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9822         if( detach ) {
9823                 /* give thread a chance to complete */
9824                 /* it should remain joinable and hence detachable */
9825                 sleep( 1 );
9826
9827                 status = pthread_detach( t );
9828                 if( status ) return status;
9829         }
9830 #endif
9831
9832 #else
9833         /* Draft 4 pthreads */
9834         status = pthread_create( &t, pthread_attr_default, task, NULL );
9835         if( status ) return status;
9836
9837         if( detach ) {
9838                 /* give thread a chance to complete */
9839                 /* it should remain joinable and hence detachable */
9840                 sleep( 1 );
9841
9842                 status = pthread_detach( &t );
9843                 if( status ) return status;
9844         }
9845 #endif
9846
9847 #ifdef HAVE_LINUX_THREADS
9848         pthread_kill_other_threads_np();
9849 #endif
9850
9851         return 0;
9852
9853 ; return 0; }
9854 EOF
9855 if { (eval echo configure:9856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9856   rm -rf conftest*
9857   ol_cv_pthread_lpthread=yes
9858 else
9859   echo "configure: failed program was:" >&5
9860   cat conftest.$ac_ext >&5
9861   rm -rf conftest*
9862   ol_cv_pthread_lpthread=no
9863 fi
9864 rm -f conftest*
9865 else
9866   cat > conftest.$ac_ext <<EOF
9867 #line 9868 "configure"
9868 #include "confdefs.h"
9869 /* pthread test headers */
9870 #include <pthread.h>
9871 #ifndef NULL
9872 #define NULL (void*)0
9873 #endif
9874
9875 static void *task(p)
9876         void *p;
9877 {
9878         return (void *) (p == NULL);
9879 }
9880
9881
9882 int main(argc, argv)
9883         int argc;
9884         char **argv;
9885 {
9886
9887         /* pthread test function */
9888         pthread_t t;
9889         int status;
9890         int detach = 1;
9891
9892 #ifdef HAVE_PTHREADS_FINAL
9893         /* Final pthreads */
9894         pthread_attr_t attr;
9895
9896         status = pthread_attr_init(&attr);
9897         if( status ) return status;
9898
9899 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9900         if( !detach ) {
9901 #if defined( PTHREAD_CREATE_JOINABLE )
9902                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9903 #else
9904                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9905 #endif
9906
9907 #ifdef PTHREAD_CREATE_DETACHED
9908         } else {
9909                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9910 #endif
9911         }
9912         if( status ) return status;
9913 #endif
9914
9915         status = pthread_create( &t, &attr, task, NULL );
9916         if( status ) return status;
9917
9918 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9919         if( detach ) {
9920                 /* give thread a chance to complete */
9921                 /* it should remain joinable and hence detachable */
9922                 sleep( 1 );
9923
9924                 status = pthread_detach( t );
9925                 if( status ) return status;
9926         }
9927 #endif
9928
9929 #else
9930         /* Draft 4 pthreads */
9931         status = pthread_create( &t, pthread_attr_default, task, NULL );
9932         if( status ) return status;
9933
9934         if( detach ) {
9935                 /* give thread a chance to complete */
9936                 /* it should remain joinable and hence detachable */
9937                 sleep( 1 );
9938
9939                 status = pthread_detach( &t );
9940                 if( status ) return status;
9941         }
9942 #endif
9943
9944 #ifdef HAVE_LINUX_THREADS
9945         pthread_kill_other_threads_np();
9946 #endif
9947
9948         return 0;
9949
9950 }
9951
9952 EOF
9953 if { (eval echo configure:9954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9954 then
9955   ol_cv_pthread_lpthread=yes
9956 else
9957   echo "configure: failed program was:" >&5
9958   cat conftest.$ac_ext >&5
9959   rm -fr conftest*
9960   ol_cv_pthread_lpthread=no
9961 fi
9962 rm -fr conftest*
9963 fi
9964
9965
9966                 # restore the LIBS
9967                 LIBS="$ol_LIBS"
9968         
9969 fi
9970
9971 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9972
9973         if test $ol_cv_pthread_lpthread = yes ; then
9974                 ol_link_pthreads="-lpthread"
9975                 ol_link_threads=posix
9976         fi
9977 fi
9978
9979                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9980 if test "$ol_link_threads" = no ; then
9981         # try -lc_r
9982         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9983 echo "configure:9984: checking for pthread link with -lc_r" >&5
9984 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9985   echo $ac_n "(cached) $ac_c" 1>&6
9986 else
9987   
9988                 # save the flags
9989                 ol_LIBS="$LIBS"
9990                 LIBS="-lc_r $LIBS"
9991
9992                 if test "$cross_compiling" = yes; then
9993   cat > conftest.$ac_ext <<EOF
9994 #line 9995 "configure"
9995 #include "confdefs.h"
9996 /* pthread test headers */
9997 #include <pthread.h>
9998 #ifndef NULL
9999 #define NULL (void*)0
10000 #endif
10001
10002 static void *task(p)
10003         void *p;
10004 {
10005         return (void *) (p == NULL);
10006 }
10007
10008 int main() {
10009
10010         /* pthread test function */
10011         pthread_t t;
10012         int status;
10013         int detach = 1;
10014
10015 #ifdef HAVE_PTHREADS_FINAL
10016         /* Final pthreads */
10017         pthread_attr_t attr;
10018
10019         status = pthread_attr_init(&attr);
10020         if( status ) return status;
10021
10022 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10023         if( !detach ) {
10024 #if defined( PTHREAD_CREATE_JOINABLE )
10025                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10026 #else
10027                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10028 #endif
10029
10030 #ifdef PTHREAD_CREATE_DETACHED
10031         } else {
10032                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10033 #endif
10034         }
10035         if( status ) return status;
10036 #endif
10037
10038         status = pthread_create( &t, &attr, task, NULL );
10039         if( status ) return status;
10040
10041 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10042         if( detach ) {
10043                 /* give thread a chance to complete */
10044                 /* it should remain joinable and hence detachable */
10045                 sleep( 1 );
10046
10047                 status = pthread_detach( t );
10048                 if( status ) return status;
10049         }
10050 #endif
10051
10052 #else
10053         /* Draft 4 pthreads */
10054         status = pthread_create( &t, pthread_attr_default, task, NULL );
10055         if( status ) return status;
10056
10057         if( detach ) {
10058                 /* give thread a chance to complete */
10059                 /* it should remain joinable and hence detachable */
10060                 sleep( 1 );
10061
10062                 status = pthread_detach( &t );
10063                 if( status ) return status;
10064         }
10065 #endif
10066
10067 #ifdef HAVE_LINUX_THREADS
10068         pthread_kill_other_threads_np();
10069 #endif
10070
10071         return 0;
10072
10073 ; return 0; }
10074 EOF
10075 if { (eval echo configure:10076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10076   rm -rf conftest*
10077   ol_cv_pthread_lc_r=yes
10078 else
10079   echo "configure: failed program was:" >&5
10080   cat conftest.$ac_ext >&5
10081   rm -rf conftest*
10082   ol_cv_pthread_lc_r=no
10083 fi
10084 rm -f conftest*
10085 else
10086   cat > conftest.$ac_ext <<EOF
10087 #line 10088 "configure"
10088 #include "confdefs.h"
10089 /* pthread test headers */
10090 #include <pthread.h>
10091 #ifndef NULL
10092 #define NULL (void*)0
10093 #endif
10094
10095 static void *task(p)
10096         void *p;
10097 {
10098         return (void *) (p == NULL);
10099 }
10100
10101
10102 int main(argc, argv)
10103         int argc;
10104         char **argv;
10105 {
10106
10107         /* pthread test function */
10108         pthread_t t;
10109         int status;
10110         int detach = 1;
10111
10112 #ifdef HAVE_PTHREADS_FINAL
10113         /* Final pthreads */
10114         pthread_attr_t attr;
10115
10116         status = pthread_attr_init(&attr);
10117         if( status ) return status;
10118
10119 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10120         if( !detach ) {
10121 #if defined( PTHREAD_CREATE_JOINABLE )
10122                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10123 #else
10124                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10125 #endif
10126
10127 #ifdef PTHREAD_CREATE_DETACHED
10128         } else {
10129                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10130 #endif
10131         }
10132         if( status ) return status;
10133 #endif
10134
10135         status = pthread_create( &t, &attr, task, NULL );
10136         if( status ) return status;
10137
10138 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10139         if( detach ) {
10140                 /* give thread a chance to complete */
10141                 /* it should remain joinable and hence detachable */
10142                 sleep( 1 );
10143
10144                 status = pthread_detach( t );
10145                 if( status ) return status;
10146         }
10147 #endif
10148
10149 #else
10150         /* Draft 4 pthreads */
10151         status = pthread_create( &t, pthread_attr_default, task, NULL );
10152         if( status ) return status;
10153
10154         if( detach ) {
10155                 /* give thread a chance to complete */
10156                 /* it should remain joinable and hence detachable */
10157                 sleep( 1 );
10158
10159                 status = pthread_detach( &t );
10160                 if( status ) return status;
10161         }
10162 #endif
10163
10164 #ifdef HAVE_LINUX_THREADS
10165         pthread_kill_other_threads_np();
10166 #endif
10167
10168         return 0;
10169
10170 }
10171
10172 EOF
10173 if { (eval echo configure:10174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10174 then
10175   ol_cv_pthread_lc_r=yes
10176 else
10177   echo "configure: failed program was:" >&5
10178   cat conftest.$ac_ext >&5
10179   rm -fr conftest*
10180   ol_cv_pthread_lc_r=no
10181 fi
10182 rm -fr conftest*
10183 fi
10184
10185
10186                 # restore the LIBS
10187                 LIBS="$ol_LIBS"
10188         
10189 fi
10190
10191 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10192
10193         if test $ol_cv_pthread_lc_r = yes ; then
10194                 ol_link_pthreads="-lc_r"
10195                 ol_link_threads=posix
10196         fi
10197 fi
10198
10199
10200                 # Pthread try link: -threads (ol_cv_pthread_threads)
10201 if test "$ol_link_threads" = no ; then
10202         # try -threads
10203         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10204 echo "configure:10205: checking for pthread link with -threads" >&5
10205 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10206   echo $ac_n "(cached) $ac_c" 1>&6
10207 else
10208   
10209                 # save the flags
10210                 ol_LIBS="$LIBS"
10211                 LIBS="-threads $LIBS"
10212
10213                 if test "$cross_compiling" = yes; then
10214   cat > conftest.$ac_ext <<EOF
10215 #line 10216 "configure"
10216 #include "confdefs.h"
10217 /* pthread test headers */
10218 #include <pthread.h>
10219 #ifndef NULL
10220 #define NULL (void*)0
10221 #endif
10222
10223 static void *task(p)
10224         void *p;
10225 {
10226         return (void *) (p == NULL);
10227 }
10228
10229 int main() {
10230
10231         /* pthread test function */
10232         pthread_t t;
10233         int status;
10234         int detach = 1;
10235
10236 #ifdef HAVE_PTHREADS_FINAL
10237         /* Final pthreads */
10238         pthread_attr_t attr;
10239
10240         status = pthread_attr_init(&attr);
10241         if( status ) return status;
10242
10243 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10244         if( !detach ) {
10245 #if defined( PTHREAD_CREATE_JOINABLE )
10246                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10247 #else
10248                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10249 #endif
10250
10251 #ifdef PTHREAD_CREATE_DETACHED
10252         } else {
10253                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10254 #endif
10255         }
10256         if( status ) return status;
10257 #endif
10258
10259         status = pthread_create( &t, &attr, task, NULL );
10260         if( status ) return status;
10261
10262 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10263         if( detach ) {
10264                 /* give thread a chance to complete */
10265                 /* it should remain joinable and hence detachable */
10266                 sleep( 1 );
10267
10268                 status = pthread_detach( t );
10269                 if( status ) return status;
10270         }
10271 #endif
10272
10273 #else
10274         /* Draft 4 pthreads */
10275         status = pthread_create( &t, pthread_attr_default, task, NULL );
10276         if( status ) return status;
10277
10278         if( detach ) {
10279                 /* give thread a chance to complete */
10280                 /* it should remain joinable and hence detachable */
10281                 sleep( 1 );
10282
10283                 status = pthread_detach( &t );
10284                 if( status ) return status;
10285         }
10286 #endif
10287
10288 #ifdef HAVE_LINUX_THREADS
10289         pthread_kill_other_threads_np();
10290 #endif
10291
10292         return 0;
10293
10294 ; return 0; }
10295 EOF
10296 if { (eval echo configure:10297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10297   rm -rf conftest*
10298   ol_cv_pthread_threads=yes
10299 else
10300   echo "configure: failed program was:" >&5
10301   cat conftest.$ac_ext >&5
10302   rm -rf conftest*
10303   ol_cv_pthread_threads=no
10304 fi
10305 rm -f conftest*
10306 else
10307   cat > conftest.$ac_ext <<EOF
10308 #line 10309 "configure"
10309 #include "confdefs.h"
10310 /* pthread test headers */
10311 #include <pthread.h>
10312 #ifndef NULL
10313 #define NULL (void*)0
10314 #endif
10315
10316 static void *task(p)
10317         void *p;
10318 {
10319         return (void *) (p == NULL);
10320 }
10321
10322
10323 int main(argc, argv)
10324         int argc;
10325         char **argv;
10326 {
10327
10328         /* pthread test function */
10329         pthread_t t;
10330         int status;
10331         int detach = 1;
10332
10333 #ifdef HAVE_PTHREADS_FINAL
10334         /* Final pthreads */
10335         pthread_attr_t attr;
10336
10337         status = pthread_attr_init(&attr);
10338         if( status ) return status;
10339
10340 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10341         if( !detach ) {
10342 #if defined( PTHREAD_CREATE_JOINABLE )
10343                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10344 #else
10345                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10346 #endif
10347
10348 #ifdef PTHREAD_CREATE_DETACHED
10349         } else {
10350                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10351 #endif
10352         }
10353         if( status ) return status;
10354 #endif
10355
10356         status = pthread_create( &t, &attr, task, NULL );
10357         if( status ) return status;
10358
10359 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10360         if( detach ) {
10361                 /* give thread a chance to complete */
10362                 /* it should remain joinable and hence detachable */
10363                 sleep( 1 );
10364
10365                 status = pthread_detach( t );
10366                 if( status ) return status;
10367         }
10368 #endif
10369
10370 #else
10371         /* Draft 4 pthreads */
10372         status = pthread_create( &t, pthread_attr_default, task, NULL );
10373         if( status ) return status;
10374
10375         if( detach ) {
10376                 /* give thread a chance to complete */
10377                 /* it should remain joinable and hence detachable */
10378                 sleep( 1 );
10379
10380                 status = pthread_detach( &t );
10381                 if( status ) return status;
10382         }
10383 #endif
10384
10385 #ifdef HAVE_LINUX_THREADS
10386         pthread_kill_other_threads_np();
10387 #endif
10388
10389         return 0;
10390
10391 }
10392
10393 EOF
10394 if { (eval echo configure:10395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10395 then
10396   ol_cv_pthread_threads=yes
10397 else
10398   echo "configure: failed program was:" >&5
10399   cat conftest.$ac_ext >&5
10400   rm -fr conftest*
10401   ol_cv_pthread_threads=no
10402 fi
10403 rm -fr conftest*
10404 fi
10405
10406
10407                 # restore the LIBS
10408                 LIBS="$ol_LIBS"
10409         
10410 fi
10411
10412 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10413
10414         if test $ol_cv_pthread_threads = yes ; then
10415                 ol_link_pthreads="-threads"
10416                 ol_link_threads=posix
10417         fi
10418 fi
10419
10420
10421                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10422 if test "$ol_link_threads" = no ; then
10423         # try -lpthreads -lmach -lexc -lc_r
10424         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10425 echo "configure:10426: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10426 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10427   echo $ac_n "(cached) $ac_c" 1>&6
10428 else
10429   
10430                 # save the flags
10431                 ol_LIBS="$LIBS"
10432                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10433
10434                 if test "$cross_compiling" = yes; then
10435   cat > conftest.$ac_ext <<EOF
10436 #line 10437 "configure"
10437 #include "confdefs.h"
10438 /* pthread test headers */
10439 #include <pthread.h>
10440 #ifndef NULL
10441 #define NULL (void*)0
10442 #endif
10443
10444 static void *task(p)
10445         void *p;
10446 {
10447         return (void *) (p == NULL);
10448 }
10449
10450 int main() {
10451
10452         /* pthread test function */
10453         pthread_t t;
10454         int status;
10455         int detach = 1;
10456
10457 #ifdef HAVE_PTHREADS_FINAL
10458         /* Final pthreads */
10459         pthread_attr_t attr;
10460
10461         status = pthread_attr_init(&attr);
10462         if( status ) return status;
10463
10464 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10465         if( !detach ) {
10466 #if defined( PTHREAD_CREATE_JOINABLE )
10467                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10468 #else
10469                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10470 #endif
10471
10472 #ifdef PTHREAD_CREATE_DETACHED
10473         } else {
10474                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10475 #endif
10476         }
10477         if( status ) return status;
10478 #endif
10479
10480         status = pthread_create( &t, &attr, task, NULL );
10481         if( status ) return status;
10482
10483 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10484         if( detach ) {
10485                 /* give thread a chance to complete */
10486                 /* it should remain joinable and hence detachable */
10487                 sleep( 1 );
10488
10489                 status = pthread_detach( t );
10490                 if( status ) return status;
10491         }
10492 #endif
10493
10494 #else
10495         /* Draft 4 pthreads */
10496         status = pthread_create( &t, pthread_attr_default, task, NULL );
10497         if( status ) return status;
10498
10499         if( detach ) {
10500                 /* give thread a chance to complete */
10501                 /* it should remain joinable and hence detachable */
10502                 sleep( 1 );
10503
10504                 status = pthread_detach( &t );
10505                 if( status ) return status;
10506         }
10507 #endif
10508
10509 #ifdef HAVE_LINUX_THREADS
10510         pthread_kill_other_threads_np();
10511 #endif
10512
10513         return 0;
10514
10515 ; return 0; }
10516 EOF
10517 if { (eval echo configure:10518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10518   rm -rf conftest*
10519   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10520 else
10521   echo "configure: failed program was:" >&5
10522   cat conftest.$ac_ext >&5
10523   rm -rf conftest*
10524   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10525 fi
10526 rm -f conftest*
10527 else
10528   cat > conftest.$ac_ext <<EOF
10529 #line 10530 "configure"
10530 #include "confdefs.h"
10531 /* pthread test headers */
10532 #include <pthread.h>
10533 #ifndef NULL
10534 #define NULL (void*)0
10535 #endif
10536
10537 static void *task(p)
10538         void *p;
10539 {
10540         return (void *) (p == NULL);
10541 }
10542
10543
10544 int main(argc, argv)
10545         int argc;
10546         char **argv;
10547 {
10548
10549         /* pthread test function */
10550         pthread_t t;
10551         int status;
10552         int detach = 1;
10553
10554 #ifdef HAVE_PTHREADS_FINAL
10555         /* Final pthreads */
10556         pthread_attr_t attr;
10557
10558         status = pthread_attr_init(&attr);
10559         if( status ) return status;
10560
10561 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10562         if( !detach ) {
10563 #if defined( PTHREAD_CREATE_JOINABLE )
10564                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10565 #else
10566                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10567 #endif
10568
10569 #ifdef PTHREAD_CREATE_DETACHED
10570         } else {
10571                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10572 #endif
10573         }
10574         if( status ) return status;
10575 #endif
10576
10577         status = pthread_create( &t, &attr, task, NULL );
10578         if( status ) return status;
10579
10580 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10581         if( detach ) {
10582                 /* give thread a chance to complete */
10583                 /* it should remain joinable and hence detachable */
10584                 sleep( 1 );
10585
10586                 status = pthread_detach( t );
10587                 if( status ) return status;
10588         }
10589 #endif
10590
10591 #else
10592         /* Draft 4 pthreads */
10593         status = pthread_create( &t, pthread_attr_default, task, NULL );
10594         if( status ) return status;
10595
10596         if( detach ) {
10597                 /* give thread a chance to complete */
10598                 /* it should remain joinable and hence detachable */
10599                 sleep( 1 );
10600
10601                 status = pthread_detach( &t );
10602                 if( status ) return status;
10603         }
10604 #endif
10605
10606 #ifdef HAVE_LINUX_THREADS
10607         pthread_kill_other_threads_np();
10608 #endif
10609
10610         return 0;
10611
10612 }
10613
10614 EOF
10615 if { (eval echo configure:10616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10616 then
10617   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10618 else
10619   echo "configure: failed program was:" >&5
10620   cat conftest.$ac_ext >&5
10621   rm -fr conftest*
10622   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10623 fi
10624 rm -fr conftest*
10625 fi
10626
10627
10628                 # restore the LIBS
10629                 LIBS="$ol_LIBS"
10630         
10631 fi
10632
10633 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10634
10635         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10636                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10637                 ol_link_threads=posix
10638         fi
10639 fi
10640
10641                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10642 if test "$ol_link_threads" = no ; then
10643         # try -lpthreads -lmach -lexc
10644         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10645 echo "configure:10646: checking for pthread link with -lpthreads -lmach -lexc" >&5
10646 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10647   echo $ac_n "(cached) $ac_c" 1>&6
10648 else
10649   
10650                 # save the flags
10651                 ol_LIBS="$LIBS"
10652                 LIBS="-lpthreads -lmach -lexc $LIBS"
10653
10654                 if test "$cross_compiling" = yes; then
10655   cat > conftest.$ac_ext <<EOF
10656 #line 10657 "configure"
10657 #include "confdefs.h"
10658 /* pthread test headers */
10659 #include <pthread.h>
10660 #ifndef NULL
10661 #define NULL (void*)0
10662 #endif
10663
10664 static void *task(p)
10665         void *p;
10666 {
10667         return (void *) (p == NULL);
10668 }
10669
10670 int main() {
10671
10672         /* pthread test function */
10673         pthread_t t;
10674         int status;
10675         int detach = 1;
10676
10677 #ifdef HAVE_PTHREADS_FINAL
10678         /* Final pthreads */
10679         pthread_attr_t attr;
10680
10681         status = pthread_attr_init(&attr);
10682         if( status ) return status;
10683
10684 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10685         if( !detach ) {
10686 #if defined( PTHREAD_CREATE_JOINABLE )
10687                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10688 #else
10689                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10690 #endif
10691
10692 #ifdef PTHREAD_CREATE_DETACHED
10693         } else {
10694                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10695 #endif
10696         }
10697         if( status ) return status;
10698 #endif
10699
10700         status = pthread_create( &t, &attr, task, NULL );
10701         if( status ) return status;
10702
10703 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10704         if( detach ) {
10705                 /* give thread a chance to complete */
10706                 /* it should remain joinable and hence detachable */
10707                 sleep( 1 );
10708
10709                 status = pthread_detach( t );
10710                 if( status ) return status;
10711         }
10712 #endif
10713
10714 #else
10715         /* Draft 4 pthreads */
10716         status = pthread_create( &t, pthread_attr_default, task, NULL );
10717         if( status ) return status;
10718
10719         if( detach ) {
10720                 /* give thread a chance to complete */
10721                 /* it should remain joinable and hence detachable */
10722                 sleep( 1 );
10723
10724                 status = pthread_detach( &t );
10725                 if( status ) return status;
10726         }
10727 #endif
10728
10729 #ifdef HAVE_LINUX_THREADS
10730         pthread_kill_other_threads_np();
10731 #endif
10732
10733         return 0;
10734
10735 ; return 0; }
10736 EOF
10737 if { (eval echo configure:10738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10738   rm -rf conftest*
10739   ol_cv_pthread_lpthreads_lmach_lexc=yes
10740 else
10741   echo "configure: failed program was:" >&5
10742   cat conftest.$ac_ext >&5
10743   rm -rf conftest*
10744   ol_cv_pthread_lpthreads_lmach_lexc=no
10745 fi
10746 rm -f conftest*
10747 else
10748   cat > conftest.$ac_ext <<EOF
10749 #line 10750 "configure"
10750 #include "confdefs.h"
10751 /* pthread test headers */
10752 #include <pthread.h>
10753 #ifndef NULL
10754 #define NULL (void*)0
10755 #endif
10756
10757 static void *task(p)
10758         void *p;
10759 {
10760         return (void *) (p == NULL);
10761 }
10762
10763
10764 int main(argc, argv)
10765         int argc;
10766         char **argv;
10767 {
10768
10769         /* pthread test function */
10770         pthread_t t;
10771         int status;
10772         int detach = 1;
10773
10774 #ifdef HAVE_PTHREADS_FINAL
10775         /* Final pthreads */
10776         pthread_attr_t attr;
10777
10778         status = pthread_attr_init(&attr);
10779         if( status ) return status;
10780
10781 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10782         if( !detach ) {
10783 #if defined( PTHREAD_CREATE_JOINABLE )
10784                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10785 #else
10786                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10787 #endif
10788
10789 #ifdef PTHREAD_CREATE_DETACHED
10790         } else {
10791                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10792 #endif
10793         }
10794         if( status ) return status;
10795 #endif
10796
10797         status = pthread_create( &t, &attr, task, NULL );
10798         if( status ) return status;
10799
10800 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10801         if( detach ) {
10802                 /* give thread a chance to complete */
10803                 /* it should remain joinable and hence detachable */
10804                 sleep( 1 );
10805
10806                 status = pthread_detach( t );
10807                 if( status ) return status;
10808         }
10809 #endif
10810
10811 #else
10812         /* Draft 4 pthreads */
10813         status = pthread_create( &t, pthread_attr_default, task, NULL );
10814         if( status ) return status;
10815
10816         if( detach ) {
10817                 /* give thread a chance to complete */
10818                 /* it should remain joinable and hence detachable */
10819                 sleep( 1 );
10820
10821                 status = pthread_detach( &t );
10822                 if( status ) return status;
10823         }
10824 #endif
10825
10826 #ifdef HAVE_LINUX_THREADS
10827         pthread_kill_other_threads_np();
10828 #endif
10829
10830         return 0;
10831
10832 }
10833
10834 EOF
10835 if { (eval echo configure:10836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10836 then
10837   ol_cv_pthread_lpthreads_lmach_lexc=yes
10838 else
10839   echo "configure: failed program was:" >&5
10840   cat conftest.$ac_ext >&5
10841   rm -fr conftest*
10842   ol_cv_pthread_lpthreads_lmach_lexc=no
10843 fi
10844 rm -fr conftest*
10845 fi
10846
10847
10848                 # restore the LIBS
10849                 LIBS="$ol_LIBS"
10850         
10851 fi
10852
10853 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10854
10855         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10856                 ol_link_pthreads="-lpthreads -lmach -lexc"
10857                 ol_link_threads=posix
10858         fi
10859 fi
10860
10861                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10862 if test "$ol_link_threads" = no ; then
10863         # try -lpthreads -lexc
10864         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10865 echo "configure:10866: checking for pthread link with -lpthreads -lexc" >&5
10866 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10867   echo $ac_n "(cached) $ac_c" 1>&6
10868 else
10869   
10870                 # save the flags
10871                 ol_LIBS="$LIBS"
10872                 LIBS="-lpthreads -lexc $LIBS"
10873
10874                 if test "$cross_compiling" = yes; then
10875   cat > conftest.$ac_ext <<EOF
10876 #line 10877 "configure"
10877 #include "confdefs.h"
10878 /* pthread test headers */
10879 #include <pthread.h>
10880 #ifndef NULL
10881 #define NULL (void*)0
10882 #endif
10883
10884 static void *task(p)
10885         void *p;
10886 {
10887         return (void *) (p == NULL);
10888 }
10889
10890 int main() {
10891
10892         /* pthread test function */
10893         pthread_t t;
10894         int status;
10895         int detach = 1;
10896
10897 #ifdef HAVE_PTHREADS_FINAL
10898         /* Final pthreads */
10899         pthread_attr_t attr;
10900
10901         status = pthread_attr_init(&attr);
10902         if( status ) return status;
10903
10904 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10905         if( !detach ) {
10906 #if defined( PTHREAD_CREATE_JOINABLE )
10907                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10908 #else
10909                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10910 #endif
10911
10912 #ifdef PTHREAD_CREATE_DETACHED
10913         } else {
10914                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10915 #endif
10916         }
10917         if( status ) return status;
10918 #endif
10919
10920         status = pthread_create( &t, &attr, task, NULL );
10921         if( status ) return status;
10922
10923 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10924         if( detach ) {
10925                 /* give thread a chance to complete */
10926                 /* it should remain joinable and hence detachable */
10927                 sleep( 1 );
10928
10929                 status = pthread_detach( t );
10930                 if( status ) return status;
10931         }
10932 #endif
10933
10934 #else
10935         /* Draft 4 pthreads */
10936         status = pthread_create( &t, pthread_attr_default, task, NULL );
10937         if( status ) return status;
10938
10939         if( detach ) {
10940                 /* give thread a chance to complete */
10941                 /* it should remain joinable and hence detachable */
10942                 sleep( 1 );
10943
10944                 status = pthread_detach( &t );
10945                 if( status ) return status;
10946         }
10947 #endif
10948
10949 #ifdef HAVE_LINUX_THREADS
10950         pthread_kill_other_threads_np();
10951 #endif
10952
10953         return 0;
10954
10955 ; return 0; }
10956 EOF
10957 if { (eval echo configure:10958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10958   rm -rf conftest*
10959   ol_cv_pthread_lpthreads_lexc=yes
10960 else
10961   echo "configure: failed program was:" >&5
10962   cat conftest.$ac_ext >&5
10963   rm -rf conftest*
10964   ol_cv_pthread_lpthreads_lexc=no
10965 fi
10966 rm -f conftest*
10967 else
10968   cat > conftest.$ac_ext <<EOF
10969 #line 10970 "configure"
10970 #include "confdefs.h"
10971 /* pthread test headers */
10972 #include <pthread.h>
10973 #ifndef NULL
10974 #define NULL (void*)0
10975 #endif
10976
10977 static void *task(p)
10978         void *p;
10979 {
10980         return (void *) (p == NULL);
10981 }
10982
10983
10984 int main(argc, argv)
10985         int argc;
10986         char **argv;
10987 {
10988
10989         /* pthread test function */
10990         pthread_t t;
10991         int status;
10992         int detach = 1;
10993
10994 #ifdef HAVE_PTHREADS_FINAL
10995         /* Final pthreads */
10996         pthread_attr_t attr;
10997
10998         status = pthread_attr_init(&attr);
10999         if( status ) return status;
11000
11001 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11002         if( !detach ) {
11003 #if defined( PTHREAD_CREATE_JOINABLE )
11004                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11005 #else
11006                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11007 #endif
11008
11009 #ifdef PTHREAD_CREATE_DETACHED
11010         } else {
11011                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11012 #endif
11013         }
11014         if( status ) return status;
11015 #endif
11016
11017         status = pthread_create( &t, &attr, task, NULL );
11018         if( status ) return status;
11019
11020 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11021         if( detach ) {
11022                 /* give thread a chance to complete */
11023                 /* it should remain joinable and hence detachable */
11024                 sleep( 1 );
11025
11026                 status = pthread_detach( t );
11027                 if( status ) return status;
11028         }
11029 #endif
11030
11031 #else
11032         /* Draft 4 pthreads */
11033         status = pthread_create( &t, pthread_attr_default, task, NULL );
11034         if( status ) return status;
11035
11036         if( detach ) {
11037                 /* give thread a chance to complete */
11038                 /* it should remain joinable and hence detachable */
11039                 sleep( 1 );
11040
11041                 status = pthread_detach( &t );
11042                 if( status ) return status;
11043         }
11044 #endif
11045
11046 #ifdef HAVE_LINUX_THREADS
11047         pthread_kill_other_threads_np();
11048 #endif
11049
11050         return 0;
11051
11052 }
11053
11054 EOF
11055 if { (eval echo configure:11056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11056 then
11057   ol_cv_pthread_lpthreads_lexc=yes
11058 else
11059   echo "configure: failed program was:" >&5
11060   cat conftest.$ac_ext >&5
11061   rm -fr conftest*
11062   ol_cv_pthread_lpthreads_lexc=no
11063 fi
11064 rm -fr conftest*
11065 fi
11066
11067
11068                 # restore the LIBS
11069                 LIBS="$ol_LIBS"
11070         
11071 fi
11072
11073 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
11074
11075         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
11076                 ol_link_pthreads="-lpthreads -lexc"
11077                 ol_link_threads=posix
11078         fi
11079 fi
11080
11081
11082                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
11083 if test "$ol_link_threads" = no ; then
11084         # try -lpthreads
11085         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
11086 echo "configure:11087: checking for pthread link with -lpthreads" >&5
11087 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
11088   echo $ac_n "(cached) $ac_c" 1>&6
11089 else
11090   
11091                 # save the flags
11092                 ol_LIBS="$LIBS"
11093                 LIBS="-lpthreads $LIBS"
11094
11095                 if test "$cross_compiling" = yes; then
11096   cat > conftest.$ac_ext <<EOF
11097 #line 11098 "configure"
11098 #include "confdefs.h"
11099 /* pthread test headers */
11100 #include <pthread.h>
11101 #ifndef NULL
11102 #define NULL (void*)0
11103 #endif
11104
11105 static void *task(p)
11106         void *p;
11107 {
11108         return (void *) (p == NULL);
11109 }
11110
11111 int main() {
11112
11113         /* pthread test function */
11114         pthread_t t;
11115         int status;
11116         int detach = 1;
11117
11118 #ifdef HAVE_PTHREADS_FINAL
11119         /* Final pthreads */
11120         pthread_attr_t attr;
11121
11122         status = pthread_attr_init(&attr);
11123         if( status ) return status;
11124
11125 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11126         if( !detach ) {
11127 #if defined( PTHREAD_CREATE_JOINABLE )
11128                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11129 #else
11130                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11131 #endif
11132
11133 #ifdef PTHREAD_CREATE_DETACHED
11134         } else {
11135                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11136 #endif
11137         }
11138         if( status ) return status;
11139 #endif
11140
11141         status = pthread_create( &t, &attr, task, NULL );
11142         if( status ) return status;
11143
11144 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11145         if( detach ) {
11146                 /* give thread a chance to complete */
11147                 /* it should remain joinable and hence detachable */
11148                 sleep( 1 );
11149
11150                 status = pthread_detach( t );
11151                 if( status ) return status;
11152         }
11153 #endif
11154
11155 #else
11156         /* Draft 4 pthreads */
11157         status = pthread_create( &t, pthread_attr_default, task, NULL );
11158         if( status ) return status;
11159
11160         if( detach ) {
11161                 /* give thread a chance to complete */
11162                 /* it should remain joinable and hence detachable */
11163                 sleep( 1 );
11164
11165                 status = pthread_detach( &t );
11166                 if( status ) return status;
11167         }
11168 #endif
11169
11170 #ifdef HAVE_LINUX_THREADS
11171         pthread_kill_other_threads_np();
11172 #endif
11173
11174         return 0;
11175
11176 ; return 0; }
11177 EOF
11178 if { (eval echo configure:11179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11179   rm -rf conftest*
11180   ol_cv_pthread_lib_lpthreads=yes
11181 else
11182   echo "configure: failed program was:" >&5
11183   cat conftest.$ac_ext >&5
11184   rm -rf conftest*
11185   ol_cv_pthread_lib_lpthreads=no
11186 fi
11187 rm -f conftest*
11188 else
11189   cat > conftest.$ac_ext <<EOF
11190 #line 11191 "configure"
11191 #include "confdefs.h"
11192 /* pthread test headers */
11193 #include <pthread.h>
11194 #ifndef NULL
11195 #define NULL (void*)0
11196 #endif
11197
11198 static void *task(p)
11199         void *p;
11200 {
11201         return (void *) (p == NULL);
11202 }
11203
11204
11205 int main(argc, argv)
11206         int argc;
11207         char **argv;
11208 {
11209
11210         /* pthread test function */
11211         pthread_t t;
11212         int status;
11213         int detach = 1;
11214
11215 #ifdef HAVE_PTHREADS_FINAL
11216         /* Final pthreads */
11217         pthread_attr_t attr;
11218
11219         status = pthread_attr_init(&attr);
11220         if( status ) return status;
11221
11222 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11223         if( !detach ) {
11224 #if defined( PTHREAD_CREATE_JOINABLE )
11225                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11226 #else
11227                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11228 #endif
11229
11230 #ifdef PTHREAD_CREATE_DETACHED
11231         } else {
11232                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11233 #endif
11234         }
11235         if( status ) return status;
11236 #endif
11237
11238         status = pthread_create( &t, &attr, task, NULL );
11239         if( status ) return status;
11240
11241 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11242         if( detach ) {
11243                 /* give thread a chance to complete */
11244                 /* it should remain joinable and hence detachable */
11245                 sleep( 1 );
11246
11247                 status = pthread_detach( t );
11248                 if( status ) return status;
11249         }
11250 #endif
11251
11252 #else
11253         /* Draft 4 pthreads */
11254         status = pthread_create( &t, pthread_attr_default, task, NULL );
11255         if( status ) return status;
11256
11257         if( detach ) {
11258                 /* give thread a chance to complete */
11259                 /* it should remain joinable and hence detachable */
11260                 sleep( 1 );
11261
11262                 status = pthread_detach( &t );
11263                 if( status ) return status;
11264         }
11265 #endif
11266
11267 #ifdef HAVE_LINUX_THREADS
11268         pthread_kill_other_threads_np();
11269 #endif
11270
11271         return 0;
11272
11273 }
11274
11275 EOF
11276 if { (eval echo configure:11277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11277 then
11278   ol_cv_pthread_lib_lpthreads=yes
11279 else
11280   echo "configure: failed program was:" >&5
11281   cat conftest.$ac_ext >&5
11282   rm -fr conftest*
11283   ol_cv_pthread_lib_lpthreads=no
11284 fi
11285 rm -fr conftest*
11286 fi
11287
11288
11289                 # restore the LIBS
11290                 LIBS="$ol_LIBS"
11291         
11292 fi
11293
11294 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11295
11296         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11297                 ol_link_pthreads="-lpthreads"
11298                 ol_link_threads=posix
11299         fi
11300 fi
11301
11302
11303                 if test $ol_link_threads != no ; then
11304                         cat >> confdefs.h <<\EOF
11305 #define HAVE_PTHREADS 1
11306 EOF
11307
11308
11309                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11310
11311                                                 save_CPPFLAGS="$CPPFLAGS"
11312                         save_LIBS="$LIBS"
11313                         LIBS="$LTHREAD_LIBS $LIBS"
11314
11315                                                                                                 for ac_func in sched_yield pthread_yield
11316 do
11317 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11318 echo "configure:11319: checking for $ac_func" >&5
11319 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11320   echo $ac_n "(cached) $ac_c" 1>&6
11321 else
11322   cat > conftest.$ac_ext <<EOF
11323 #line 11324 "configure"
11324 #include "confdefs.h"
11325 /* System header to define __stub macros and hopefully few prototypes,
11326     which can conflict with char $ac_func(); below.  */
11327 #include <assert.h>
11328 /* Override any gcc2 internal prototype to avoid an error.  */
11329 /* We use char because int might match the return type of a gcc2
11330     builtin and then its argument prototype would still apply.  */
11331 char $ac_func();
11332 char (*f)();
11333
11334 int main() {
11335
11336 /* The GNU C library defines this for functions which it implements
11337     to always fail with ENOSYS.  Some functions are actually named
11338     something starting with __ and the normal name is an alias.  */
11339 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11340 choke me
11341 #else
11342 f = $ac_func;
11343 #endif
11344
11345 ; return 0; }
11346 EOF
11347 if { (eval echo configure:11348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11348   rm -rf conftest*
11349   eval "ac_cv_func_$ac_func=yes"
11350 else
11351   echo "configure: failed program was:" >&5
11352   cat conftest.$ac_ext >&5
11353   rm -rf conftest*
11354   eval "ac_cv_func_$ac_func=no"
11355 fi
11356 rm -f conftest*
11357 fi
11358
11359 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11360   echo "$ac_t""yes" 1>&6
11361     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11362   cat >> confdefs.h <<EOF
11363 #define $ac_tr_func 1
11364 EOF
11365  
11366 else
11367   echo "$ac_t""no" 1>&6
11368 fi
11369 done
11370
11371
11372                         if test $ac_cv_func_sched_yield = no -a \
11373                                 $ac_cv_func_pthread_yield = no ; then
11374                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11375 echo "configure:11376: checking for sched_yield in -lrt" >&5
11376 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11377 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11378   echo $ac_n "(cached) $ac_c" 1>&6
11379 else
11380   ac_save_LIBS="$LIBS"
11381 LIBS="-lrt  $LIBS"
11382 cat > conftest.$ac_ext <<EOF
11383 #line 11384 "configure"
11384 #include "confdefs.h"
11385 /* Override any gcc2 internal prototype to avoid an error.  */
11386 /* We use char because int might match the return type of a gcc2
11387     builtin and then its argument prototype would still apply.  */
11388 char sched_yield();
11389
11390 int main() {
11391 sched_yield()
11392 ; return 0; }
11393 EOF
11394 if { (eval echo configure:11395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11395   rm -rf conftest*
11396   eval "ac_cv_lib_$ac_lib_var=yes"
11397 else
11398   echo "configure: failed program was:" >&5
11399   cat conftest.$ac_ext >&5
11400   rm -rf conftest*
11401   eval "ac_cv_lib_$ac_lib_var=no"
11402 fi
11403 rm -f conftest*
11404 LIBS="$ac_save_LIBS"
11405
11406 fi
11407 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11408   echo "$ac_t""yes" 1>&6
11409   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11410                                         cat >> confdefs.h <<\EOF
11411 #define HAVE_SCHED_YIELD 1
11412 EOF
11413
11414                                         ac_cv_func_sched_yield=yes
11415 else
11416   echo "$ac_t""no" 1>&6
11417 ac_cv_func_sched_yield=no
11418 fi
11419
11420                         fi
11421                         if test $ac_cv_func_sched_yield = no -a \
11422                                 $ac_cv_func_pthread_yield = no ; then
11423                                                                                                 for ac_func in thr_yield
11424 do
11425 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11426 echo "configure:11427: checking for $ac_func" >&5
11427 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11428   echo $ac_n "(cached) $ac_c" 1>&6
11429 else
11430   cat > conftest.$ac_ext <<EOF
11431 #line 11432 "configure"
11432 #include "confdefs.h"
11433 /* System header to define __stub macros and hopefully few prototypes,
11434     which can conflict with char $ac_func(); below.  */
11435 #include <assert.h>
11436 /* Override any gcc2 internal prototype to avoid an error.  */
11437 /* We use char because int might match the return type of a gcc2
11438     builtin and then its argument prototype would still apply.  */
11439 char $ac_func();
11440 char (*f)();
11441
11442 int main() {
11443
11444 /* The GNU C library defines this for functions which it implements
11445     to always fail with ENOSYS.  Some functions are actually named
11446     something starting with __ and the normal name is an alias.  */
11447 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11448 choke me
11449 #else
11450 f = $ac_func;
11451 #endif
11452
11453 ; return 0; }
11454 EOF
11455 if { (eval echo configure:11456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11456   rm -rf conftest*
11457   eval "ac_cv_func_$ac_func=yes"
11458 else
11459   echo "configure: failed program was:" >&5
11460   cat conftest.$ac_ext >&5
11461   rm -rf conftest*
11462   eval "ac_cv_func_$ac_func=no"
11463 fi
11464 rm -f conftest*
11465 fi
11466
11467 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11468   echo "$ac_t""yes" 1>&6
11469     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11470   cat >> confdefs.h <<EOF
11471 #define $ac_tr_func 1
11472 EOF
11473  
11474 else
11475   echo "$ac_t""no" 1>&6
11476 fi
11477 done
11478
11479                         fi
11480                         if test $ac_cv_func_sched_yield = no -a \
11481                                 $ac_cv_func_pthread_yield = no -a \
11482                                 "$ac_cv_func_thr_yield" = no ; then
11483                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11484                         fi
11485
11486                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11487 do
11488 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11489 echo "configure:11490: checking for $ac_func" >&5
11490 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11491   echo $ac_n "(cached) $ac_c" 1>&6
11492 else
11493   cat > conftest.$ac_ext <<EOF
11494 #line 11495 "configure"
11495 #include "confdefs.h"
11496 /* System header to define __stub macros and hopefully few prototypes,
11497     which can conflict with char $ac_func(); below.  */
11498 #include <assert.h>
11499 /* Override any gcc2 internal prototype to avoid an error.  */
11500 /* We use char because int might match the return type of a gcc2
11501     builtin and then its argument prototype would still apply.  */
11502 char $ac_func();
11503 char (*f)();
11504
11505 int main() {
11506
11507 /* The GNU C library defines this for functions which it implements
11508     to always fail with ENOSYS.  Some functions are actually named
11509     something starting with __ and the normal name is an alias.  */
11510 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11511 choke me
11512 #else
11513 f = $ac_func;
11514 #endif
11515
11516 ; return 0; }
11517 EOF
11518 if { (eval echo configure:11519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11519   rm -rf conftest*
11520   eval "ac_cv_func_$ac_func=yes"
11521 else
11522   echo "configure: failed program was:" >&5
11523   cat conftest.$ac_ext >&5
11524   rm -rf conftest*
11525   eval "ac_cv_func_$ac_func=no"
11526 fi
11527 rm -f conftest*
11528 fi
11529
11530 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11531   echo "$ac_t""yes" 1>&6
11532     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11533   cat >> confdefs.h <<EOF
11534 #define $ac_tr_func 1
11535 EOF
11536  
11537 else
11538   echo "$ac_t""no" 1>&6
11539 fi
11540 done
11541
11542
11543                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11544 echo "configure:11545: checking for pthread_detach with <pthread.h>" >&5
11545 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11546   echo $ac_n "(cached) $ac_c" 1>&6
11547 else
11548   
11549                                                                 cat > conftest.$ac_ext <<EOF
11550 #line 11551 "configure"
11551 #include "confdefs.h"
11552
11553 #include <pthread.h>
11554 #ifndef NULL
11555 #define NULL (void*)0
11556 #endif
11557
11558 int main() {
11559 pthread_detach(NULL);
11560 ; return 0; }
11561 EOF
11562 if { (eval echo configure:11563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11563   rm -rf conftest*
11564   ol_cv_func_pthread_detach=yes
11565 else
11566   echo "configure: failed program was:" >&5
11567   cat conftest.$ac_ext >&5
11568   rm -rf conftest*
11569   ol_cv_func_pthread_detach=no
11570 fi
11571 rm -f conftest*
11572                         
11573 fi
11574
11575 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11576
11577                         if test $ol_cv_func_pthread_detach = no ; then
11578                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11579                         fi
11580
11581                         cat >> confdefs.h <<\EOF
11582 #define HAVE_PTHREAD_DETACH 1
11583 EOF
11584
11585
11586                                                 for ac_func in \
11587                                 pthread_setconcurrency \
11588                                 pthread_getconcurrency \
11589                                 thr_setconcurrency \
11590                                 thr_getconcurrency \
11591                         
11592 do
11593 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11594 echo "configure:11595: checking for $ac_func" >&5
11595 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11596   echo $ac_n "(cached) $ac_c" 1>&6
11597 else
11598   cat > conftest.$ac_ext <<EOF
11599 #line 11600 "configure"
11600 #include "confdefs.h"
11601 /* System header to define __stub macros and hopefully few prototypes,
11602     which can conflict with char $ac_func(); below.  */
11603 #include <assert.h>
11604 /* Override any gcc2 internal prototype to avoid an error.  */
11605 /* We use char because int might match the return type of a gcc2
11606     builtin and then its argument prototype would still apply.  */
11607 char $ac_func();
11608 char (*f)();
11609
11610 int main() {
11611
11612 /* The GNU C library defines this for functions which it implements
11613     to always fail with ENOSYS.  Some functions are actually named
11614     something starting with __ and the normal name is an alias.  */
11615 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11616 choke me
11617 #else
11618 f = $ac_func;
11619 #endif
11620
11621 ; return 0; }
11622 EOF
11623 if { (eval echo configure:11624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11624   rm -rf conftest*
11625   eval "ac_cv_func_$ac_func=yes"
11626 else
11627   echo "configure: failed program was:" >&5
11628   cat conftest.$ac_ext >&5
11629   rm -rf conftest*
11630   eval "ac_cv_func_$ac_func=no"
11631 fi
11632 rm -f conftest*
11633 fi
11634
11635 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11636   echo "$ac_t""yes" 1>&6
11637     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11638   cat >> confdefs.h <<EOF
11639 #define $ac_tr_func 1
11640 EOF
11641  
11642 else
11643   echo "$ac_t""no" 1>&6
11644 fi
11645 done
11646
11647
11648                         
11649         for ac_func in pthread_kill_other_threads_np
11650 do
11651 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11652 echo "configure:11653: checking for $ac_func" >&5
11653 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11654   echo $ac_n "(cached) $ac_c" 1>&6
11655 else
11656   cat > conftest.$ac_ext <<EOF
11657 #line 11658 "configure"
11658 #include "confdefs.h"
11659 /* System header to define __stub macros and hopefully few prototypes,
11660     which can conflict with char $ac_func(); below.  */
11661 #include <assert.h>
11662 /* Override any gcc2 internal prototype to avoid an error.  */
11663 /* We use char because int might match the return type of a gcc2
11664     builtin and then its argument prototype would still apply.  */
11665 char $ac_func();
11666 char (*f)();
11667
11668 int main() {
11669
11670 /* The GNU C library defines this for functions which it implements
11671     to always fail with ENOSYS.  Some functions are actually named
11672     something starting with __ and the normal name is an alias.  */
11673 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11674 choke me
11675 #else
11676 f = $ac_func;
11677 #endif
11678
11679 ; return 0; }
11680 EOF
11681 if { (eval echo configure:11682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11682   rm -rf conftest*
11683   eval "ac_cv_func_$ac_func=yes"
11684 else
11685   echo "configure: failed program was:" >&5
11686   cat conftest.$ac_ext >&5
11687   rm -rf conftest*
11688   eval "ac_cv_func_$ac_func=no"
11689 fi
11690 rm -f conftest*
11691 fi
11692
11693 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11694   echo "$ac_t""yes" 1>&6
11695     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11696   cat >> confdefs.h <<EOF
11697 #define $ac_tr_func 1
11698 EOF
11699  
11700 else
11701   echo "$ac_t""no" 1>&6
11702 fi
11703 done
11704
11705         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11706 echo "configure:11707: checking for LinuxThreads implementation" >&5
11707 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11708   echo $ac_n "(cached) $ac_c" 1>&6
11709 else
11710   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11711 fi
11712
11713 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11714
11715                         
11716         
11717         
11718         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11719 echo "configure:11720: checking for LinuxThreads consistency" >&5
11720 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11721   echo $ac_n "(cached) $ac_c" 1>&6
11722 else
11723   
11724                 if test $ol_cv_header_linux_threads = yes -a \
11725                         $ol_cv_sys_linux_threads = yes; then
11726                         ol_cv_linux_threads=yes
11727                 elif test $ol_cv_header_linux_threads = no -a \
11728                         $ol_cv_sys_linux_threads = no; then
11729                         ol_cv_linux_threads=no
11730                 else
11731                         ol_cv_linux_threads=error
11732                 fi
11733         
11734 fi
11735
11736 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11737
11738
11739                         if test $ol_cv_linux_threads = error; then
11740                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11741                         fi
11742
11743                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11744 echo "configure:11745: checking if pthread_create() works" >&5
11745 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11746   echo $ac_n "(cached) $ac_c" 1>&6
11747 else
11748   
11749                         if test "$cross_compiling" = yes; then
11750                                 ol_cv_pthread_create_works=yes
11751 else
11752   cat > conftest.$ac_ext <<EOF
11753 #line 11754 "configure"
11754 #include "confdefs.h"
11755 /* pthread test headers */
11756 #include <pthread.h>
11757 #ifndef NULL
11758 #define NULL (void*)0
11759 #endif
11760
11761 static void *task(p)
11762         void *p;
11763 {
11764         return (void *) (p == NULL);
11765 }
11766
11767
11768 int main(argc, argv)
11769         int argc;
11770         char **argv;
11771 {
11772
11773         /* pthread test function */
11774         pthread_t t;
11775         int status;
11776         int detach = 1;
11777
11778 #ifdef HAVE_PTHREADS_FINAL
11779         /* Final pthreads */
11780         pthread_attr_t attr;
11781
11782         status = pthread_attr_init(&attr);
11783         if( status ) return status;
11784
11785 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11786         if( !detach ) {
11787 #if defined( PTHREAD_CREATE_JOINABLE )
11788                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11789 #else
11790                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11791 #endif
11792
11793 #ifdef PTHREAD_CREATE_DETACHED
11794         } else {
11795                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11796 #endif
11797         }
11798         if( status ) return status;
11799 #endif
11800
11801         status = pthread_create( &t, &attr, task, NULL );
11802         if( status ) return status;
11803
11804 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11805         if( detach ) {
11806                 /* give thread a chance to complete */
11807                 /* it should remain joinable and hence detachable */
11808                 sleep( 1 );
11809
11810                 status = pthread_detach( t );
11811                 if( status ) return status;
11812         }
11813 #endif
11814
11815 #else
11816         /* Draft 4 pthreads */
11817         status = pthread_create( &t, pthread_attr_default, task, NULL );
11818         if( status ) return status;
11819
11820         if( detach ) {
11821                 /* give thread a chance to complete */
11822                 /* it should remain joinable and hence detachable */
11823                 sleep( 1 );
11824
11825                 status = pthread_detach( &t );
11826                 if( status ) return status;
11827         }
11828 #endif
11829
11830 #ifdef HAVE_LINUX_THREADS
11831         pthread_kill_other_threads_np();
11832 #endif
11833
11834         return 0;
11835
11836 }
11837
11838 EOF
11839 if { (eval echo configure:11840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11840 then
11841   ol_cv_pthread_create_works=yes
11842 else
11843   echo "configure: failed program was:" >&5
11844   cat conftest.$ac_ext >&5
11845   rm -fr conftest*
11846   ol_cv_pthread_create_works=no
11847 fi
11848 rm -fr conftest*
11849 fi
11850
11851 fi
11852
11853 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11854
11855                         if test $ol_cv_pthread_create_works = no ; then
11856                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11857                         fi
11858
11859                                                 if test $ol_with_yielding_select = auto ; then
11860                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11861 echo "configure:11862: checking if select yields when using pthreads" >&5
11862 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11863   echo $ac_n "(cached) $ac_c" 1>&6
11864 else
11865   
11866                                 if test "$cross_compiling" = yes; then
11867   ol_cv_pthread_select_yields=cross
11868 else
11869   cat > conftest.$ac_ext <<EOF
11870 #line 11871 "configure"
11871 #include "confdefs.h"
11872
11873 #include <sys/types.h>
11874 #include <sys/time.h>
11875 #include <unistd.h>
11876 #include <pthread.h>
11877 #ifndef NULL
11878 #define NULL (void*) 0
11879 #endif
11880
11881 static int fildes[2];
11882
11883 static void *task(p)
11884         void *p;
11885 {
11886         int i;
11887         struct timeval tv;
11888
11889         fd_set rfds;
11890
11891         tv.tv_sec=10;
11892         tv.tv_usec=0;
11893
11894         FD_ZERO(&rfds);
11895         FD_SET(fildes[0], &rfds);
11896
11897         /* we're not interested in any fds */
11898         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11899
11900         if(i < 0) {
11901                 perror("select");
11902                 exit(10);
11903         }
11904
11905         exit(0); /* if we exit here, the select blocked the whole process */
11906 }
11907
11908 int main(argc, argv)
11909         int argc;
11910         char **argv;
11911 {
11912         pthread_t t;
11913
11914         /* create a pipe to select */
11915         if(pipe(&fildes[0])) {
11916                 perror("select");
11917                 exit(1);
11918         }
11919
11920 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11921         (void) pthread_setconcurrency(2);
11922 #else
11923 #ifdef HAVE_THR_SETCONCURRENCY
11924         /* Set Solaris LWP concurrency to 2 */
11925         thr_setconcurrency(2);
11926 #endif
11927 #endif
11928
11929 #if HAVE_PTHREADS_D4
11930         pthread_create(&t, pthread_attr_default, task, NULL);
11931 #else
11932         pthread_create(&t, NULL, task, NULL);
11933 #endif
11934
11935 #if HAVE_SCHED_YIELD
11936         sched_yield();  /* make sure task runs first */
11937 #else
11938 #ifdef HAVE_PTHREAD_YIELD
11939         pthread_yield();        /* make sure task runs first */
11940 #endif
11941 #endif
11942
11943         exit(2);
11944 }
11945 EOF
11946 if { (eval echo configure:11947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11947 then
11948   ol_cv_pthread_select_yields=no
11949 else
11950   echo "configure: failed program was:" >&5
11951   cat conftest.$ac_ext >&5
11952   rm -fr conftest*
11953   ol_cv_pthread_select_yields=yes
11954 fi
11955 rm -fr conftest*
11956 fi
11957
11958 fi
11959
11960 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11961
11962                                 if test $ol_cv_pthread_select_yields = cross ; then
11963                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11964                                 fi
11965
11966                                 if test $ol_cv_pthread_select_yields = yes ; then
11967                                         ol_with_yielding_select=yes
11968                                 fi
11969                         fi
11970
11971                                                 CPPFLAGS="$save_CPPFLAGS"
11972                         LIBS="$save_LIBS"
11973                 else
11974                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11975                 fi
11976         fi
11977
11978         if test $ol_with_threads = posix ; then
11979                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11980         fi
11981 fi
11982
11983 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11984         -o $ol_with_threads = mach ; then
11985
11986                 for ac_hdr in mach/cthreads.h cthread.h
11987 do
11988 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11989 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11990 echo "configure:11991: checking for $ac_hdr" >&5
11991 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11992   echo $ac_n "(cached) $ac_c" 1>&6
11993 else
11994   cat > conftest.$ac_ext <<EOF
11995 #line 11996 "configure"
11996 #include "confdefs.h"
11997 #include <$ac_hdr>
11998 EOF
11999 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12000 { (eval echo configure:12001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12001 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12002 if test -z "$ac_err"; then
12003   rm -rf conftest*
12004   eval "ac_cv_header_$ac_safe=yes"
12005 else
12006   echo "$ac_err" >&5
12007   echo "configure: failed program was:" >&5
12008   cat conftest.$ac_ext >&5
12009   rm -rf conftest*
12010   eval "ac_cv_header_$ac_safe=no"
12011 fi
12012 rm -f conftest*
12013 fi
12014 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12015   echo "$ac_t""yes" 1>&6
12016     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12017   cat >> confdefs.h <<EOF
12018 #define $ac_tr_hdr 1
12019 EOF
12020  
12021 else
12022   echo "$ac_t""no" 1>&6
12023 fi
12024 done
12025
12026         if test $ac_cv_header_mach_cthreads_h = yes ; then
12027                 ol_with_threads=found
12028
12029                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12030 echo "configure:12031: checking for cthread_fork" >&5
12031 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12032   echo $ac_n "(cached) $ac_c" 1>&6
12033 else
12034   cat > conftest.$ac_ext <<EOF
12035 #line 12036 "configure"
12036 #include "confdefs.h"
12037 /* System header to define __stub macros and hopefully few prototypes,
12038     which can conflict with char cthread_fork(); below.  */
12039 #include <assert.h>
12040 /* Override any gcc2 internal prototype to avoid an error.  */
12041 /* We use char because int might match the return type of a gcc2
12042     builtin and then its argument prototype would still apply.  */
12043 char cthread_fork();
12044 char (*f)();
12045
12046 int main() {
12047
12048 /* The GNU C library defines this for functions which it implements
12049     to always fail with ENOSYS.  Some functions are actually named
12050     something starting with __ and the normal name is an alias.  */
12051 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12052 choke me
12053 #else
12054 f = cthread_fork;
12055 #endif
12056
12057 ; return 0; }
12058 EOF
12059 if { (eval echo configure:12060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12060   rm -rf conftest*
12061   eval "ac_cv_func_cthread_fork=yes"
12062 else
12063   echo "configure: failed program was:" >&5
12064   cat conftest.$ac_ext >&5
12065   rm -rf conftest*
12066   eval "ac_cv_func_cthread_fork=no"
12067 fi
12068 rm -f conftest*
12069 fi
12070
12071 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12072   echo "$ac_t""yes" 1>&6
12073   ol_link_threads=yes
12074 else
12075   echo "$ac_t""no" 1>&6
12076 fi
12077
12078
12079                 if test $ol_link_threads = no ; then
12080                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
12081 echo "configure:12082: checking for cthread_fork with -all_load" >&5
12082 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
12083   echo $ac_n "(cached) $ac_c" 1>&6
12084 else
12085   
12086                                                                 save_LIBS="$LIBS"
12087                                 LIBS="-all_load $LIBS"
12088                                 cat > conftest.$ac_ext <<EOF
12089 #line 12090 "configure"
12090 #include "confdefs.h"
12091 #include <mach/cthreads.h>
12092 int main() {
12093
12094                                         cthread_fork((void *)0, (void *)0);
12095                                         
12096 ; return 0; }
12097 EOF
12098 if { (eval echo configure:12099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12099   rm -rf conftest*
12100   ol_cv_cthread_all_load=yes
12101 else
12102   echo "configure: failed program was:" >&5
12103   cat conftest.$ac_ext >&5
12104   rm -rf conftest*
12105   ol_cv_cthread_all_load=no
12106 fi
12107 rm -f conftest*
12108                                                                 LIBS="$save_LIBS"
12109                         
12110 fi
12111
12112 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
12113
12114                         if test $ol_cv_cthread_all_load = yes ; then
12115                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
12116                                 ol_link_threads=mach
12117                         fi
12118                 fi
12119
12120     elif test $ac_cv_header_cthreads_h = yes ; then
12121                                 
12122                 ol_with_threads=found
12123  
12124                                 save_LIBS="$LIBS"
12125                 LIBS="$LIBS -lthreads"
12126                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
12127 echo "configure:12128: checking for cthread_fork" >&5
12128 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
12129   echo $ac_n "(cached) $ac_c" 1>&6
12130 else
12131   cat > conftest.$ac_ext <<EOF
12132 #line 12133 "configure"
12133 #include "confdefs.h"
12134 /* System header to define __stub macros and hopefully few prototypes,
12135     which can conflict with char cthread_fork(); below.  */
12136 #include <assert.h>
12137 /* Override any gcc2 internal prototype to avoid an error.  */
12138 /* We use char because int might match the return type of a gcc2
12139     builtin and then its argument prototype would still apply.  */
12140 char cthread_fork();
12141 char (*f)();
12142
12143 int main() {
12144
12145 /* The GNU C library defines this for functions which it implements
12146     to always fail with ENOSYS.  Some functions are actually named
12147     something starting with __ and the normal name is an alias.  */
12148 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
12149 choke me
12150 #else
12151 f = cthread_fork;
12152 #endif
12153
12154 ; return 0; }
12155 EOF
12156 if { (eval echo configure:12157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12157   rm -rf conftest*
12158   eval "ac_cv_func_cthread_fork=yes"
12159 else
12160   echo "configure: failed program was:" >&5
12161   cat conftest.$ac_ext >&5
12162   rm -rf conftest*
12163   eval "ac_cv_func_cthread_fork=no"
12164 fi
12165 rm -f conftest*
12166 fi
12167
12168 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
12169   echo "$ac_t""yes" 1>&6
12170   ol_link_threads=yes
12171 else
12172   echo "$ac_t""no" 1>&6
12173 fi
12174
12175                 LIBS="$save_LIBS"
12176
12177                 if test $ol_link_threads = yes ; then
12178                         LTHREAD_LIBS="-lthreads"
12179                         ol_link_threads=mach
12180                 else
12181                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12182                 fi
12183
12184         elif test $ol_with_threads = mach ; then
12185                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
12186         fi
12187
12188         if test $ol_link_threads = mach ; then
12189                 cat >> confdefs.h <<\EOF
12190 #define HAVE_MACH_CTHREADS 1
12191 EOF
12192
12193         elif test $ol_with_threads = found ; then
12194                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
12195         fi
12196 fi
12197
12198 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12199         -o $ol_with_threads = pth ; then
12200
12201         for ac_hdr in pth.h
12202 do
12203 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12204 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12205 echo "configure:12206: checking for $ac_hdr" >&5
12206 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12207   echo $ac_n "(cached) $ac_c" 1>&6
12208 else
12209   cat > conftest.$ac_ext <<EOF
12210 #line 12211 "configure"
12211 #include "confdefs.h"
12212 #include <$ac_hdr>
12213 EOF
12214 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12215 { (eval echo configure:12216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12216 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12217 if test -z "$ac_err"; then
12218   rm -rf conftest*
12219   eval "ac_cv_header_$ac_safe=yes"
12220 else
12221   echo "$ac_err" >&5
12222   echo "configure: failed program was:" >&5
12223   cat conftest.$ac_ext >&5
12224   rm -rf conftest*
12225   eval "ac_cv_header_$ac_safe=no"
12226 fi
12227 rm -f conftest*
12228 fi
12229 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12230   echo "$ac_t""yes" 1>&6
12231     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12232   cat >> confdefs.h <<EOF
12233 #define $ac_tr_hdr 1
12234 EOF
12235  
12236 else
12237   echo "$ac_t""no" 1>&6
12238 fi
12239 done
12240
12241
12242         if test $ac_cv_header_pth_h = yes ; then
12243                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
12244 echo "configure:12245: checking for pth_version in -lpth" >&5
12245 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12246 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12247   echo $ac_n "(cached) $ac_c" 1>&6
12248 else
12249   ac_save_LIBS="$LIBS"
12250 LIBS="-lpth  $LIBS"
12251 cat > conftest.$ac_ext <<EOF
12252 #line 12253 "configure"
12253 #include "confdefs.h"
12254 /* Override any gcc2 internal prototype to avoid an error.  */
12255 /* We use char because int might match the return type of a gcc2
12256     builtin and then its argument prototype would still apply.  */
12257 char pth_version();
12258
12259 int main() {
12260 pth_version()
12261 ; return 0; }
12262 EOF
12263 if { (eval echo configure:12264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12264   rm -rf conftest*
12265   eval "ac_cv_lib_$ac_lib_var=yes"
12266 else
12267   echo "configure: failed program was:" >&5
12268   cat conftest.$ac_ext >&5
12269   rm -rf conftest*
12270   eval "ac_cv_lib_$ac_lib_var=no"
12271 fi
12272 rm -f conftest*
12273 LIBS="$ac_save_LIBS"
12274
12275 fi
12276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12277   echo "$ac_t""yes" 1>&6
12278   have_pth=yes
12279 else
12280   echo "$ac_t""no" 1>&6
12281 have_pth=no
12282 fi
12283
12284
12285                 if test $have_pth = yes ; then
12286                         cat >> confdefs.h <<\EOF
12287 #define HAVE_GNU_PTH 1
12288 EOF
12289
12290                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12291                         ol_link_threads=pth
12292
12293                         if test $ol_with_yielding_select = auto ; then
12294                                 ol_with_yielding_select=yes
12295                         fi
12296                 fi
12297         fi
12298 fi
12299
12300 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12301         -o $ol_with_threads = lwp ; then
12302
12303                 for ac_hdr in thread.h synch.h
12304 do
12305 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12306 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12307 echo "configure:12308: checking for $ac_hdr" >&5
12308 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12309   echo $ac_n "(cached) $ac_c" 1>&6
12310 else
12311   cat > conftest.$ac_ext <<EOF
12312 #line 12313 "configure"
12313 #include "confdefs.h"
12314 #include <$ac_hdr>
12315 EOF
12316 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12317 { (eval echo configure:12318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12318 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12319 if test -z "$ac_err"; then
12320   rm -rf conftest*
12321   eval "ac_cv_header_$ac_safe=yes"
12322 else
12323   echo "$ac_err" >&5
12324   echo "configure: failed program was:" >&5
12325   cat conftest.$ac_ext >&5
12326   rm -rf conftest*
12327   eval "ac_cv_header_$ac_safe=no"
12328 fi
12329 rm -f conftest*
12330 fi
12331 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12332   echo "$ac_t""yes" 1>&6
12333     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12334   cat >> confdefs.h <<EOF
12335 #define $ac_tr_hdr 1
12336 EOF
12337  
12338 else
12339   echo "$ac_t""no" 1>&6
12340 fi
12341 done
12342
12343         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12344                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12345 echo "configure:12346: checking for thr_create in -lthread" >&5
12346 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12347 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12348   echo $ac_n "(cached) $ac_c" 1>&6
12349 else
12350   ac_save_LIBS="$LIBS"
12351 LIBS="-lthread  $LIBS"
12352 cat > conftest.$ac_ext <<EOF
12353 #line 12354 "configure"
12354 #include "confdefs.h"
12355 /* Override any gcc2 internal prototype to avoid an error.  */
12356 /* We use char because int might match the return type of a gcc2
12357     builtin and then its argument prototype would still apply.  */
12358 char thr_create();
12359
12360 int main() {
12361 thr_create()
12362 ; return 0; }
12363 EOF
12364 if { (eval echo configure:12365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12365   rm -rf conftest*
12366   eval "ac_cv_lib_$ac_lib_var=yes"
12367 else
12368   echo "configure: failed program was:" >&5
12369   cat conftest.$ac_ext >&5
12370   rm -rf conftest*
12371   eval "ac_cv_lib_$ac_lib_var=no"
12372 fi
12373 rm -f conftest*
12374 LIBS="$ac_save_LIBS"
12375
12376 fi
12377 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12378   echo "$ac_t""yes" 1>&6
12379   have_thr=yes
12380 else
12381   echo "$ac_t""no" 1>&6
12382 have_thr=no
12383 fi
12384
12385
12386                 if test $have_thr = yes ; then
12387                         cat >> confdefs.h <<\EOF
12388 #define HAVE_THR 1
12389 EOF
12390
12391                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12392                         ol_link_threads=thr
12393
12394                         if test $ol_with_yielding_select = auto ; then
12395                                 ol_with_yielding_select=yes
12396                         fi
12397
12398                                                 for ac_func in \
12399                                 thr_setconcurrency \
12400                                 thr_getconcurrency \
12401                         
12402 do
12403 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12404 echo "configure:12405: checking for $ac_func" >&5
12405 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12406   echo $ac_n "(cached) $ac_c" 1>&6
12407 else
12408   cat > conftest.$ac_ext <<EOF
12409 #line 12410 "configure"
12410 #include "confdefs.h"
12411 /* System header to define __stub macros and hopefully few prototypes,
12412     which can conflict with char $ac_func(); below.  */
12413 #include <assert.h>
12414 /* Override any gcc2 internal prototype to avoid an error.  */
12415 /* We use char because int might match the return type of a gcc2
12416     builtin and then its argument prototype would still apply.  */
12417 char $ac_func();
12418 char (*f)();
12419
12420 int main() {
12421
12422 /* The GNU C library defines this for functions which it implements
12423     to always fail with ENOSYS.  Some functions are actually named
12424     something starting with __ and the normal name is an alias.  */
12425 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12426 choke me
12427 #else
12428 f = $ac_func;
12429 #endif
12430
12431 ; return 0; }
12432 EOF
12433 if { (eval echo configure:12434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12434   rm -rf conftest*
12435   eval "ac_cv_func_$ac_func=yes"
12436 else
12437   echo "configure: failed program was:" >&5
12438   cat conftest.$ac_ext >&5
12439   rm -rf conftest*
12440   eval "ac_cv_func_$ac_func=no"
12441 fi
12442 rm -f conftest*
12443 fi
12444
12445 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12446   echo "$ac_t""yes" 1>&6
12447     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12448   cat >> confdefs.h <<EOF
12449 #define $ac_tr_func 1
12450 EOF
12451  
12452 else
12453   echo "$ac_t""no" 1>&6
12454 fi
12455 done
12456
12457                 fi
12458         fi
12459
12460                 for ac_hdr in lwp/lwp.h
12461 do
12462 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12463 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12464 echo "configure:12465: checking for $ac_hdr" >&5
12465 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12466   echo $ac_n "(cached) $ac_c" 1>&6
12467 else
12468   cat > conftest.$ac_ext <<EOF
12469 #line 12470 "configure"
12470 #include "confdefs.h"
12471 #include <$ac_hdr>
12472 EOF
12473 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12474 { (eval echo configure:12475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12475 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12476 if test -z "$ac_err"; then
12477   rm -rf conftest*
12478   eval "ac_cv_header_$ac_safe=yes"
12479 else
12480   echo "$ac_err" >&5
12481   echo "configure: failed program was:" >&5
12482   cat conftest.$ac_ext >&5
12483   rm -rf conftest*
12484   eval "ac_cv_header_$ac_safe=no"
12485 fi
12486 rm -f conftest*
12487 fi
12488 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12489   echo "$ac_t""yes" 1>&6
12490     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12491   cat >> confdefs.h <<EOF
12492 #define $ac_tr_hdr 1
12493 EOF
12494  
12495 else
12496   echo "$ac_t""no" 1>&6
12497 fi
12498 done
12499
12500         if test $ac_cv_header_lwp_lwp_h = yes ; then
12501                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12502 echo "configure:12503: checking for lwp_create in -llwp" >&5
12503 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12504 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12505   echo $ac_n "(cached) $ac_c" 1>&6
12506 else
12507   ac_save_LIBS="$LIBS"
12508 LIBS="-llwp  $LIBS"
12509 cat > conftest.$ac_ext <<EOF
12510 #line 12511 "configure"
12511 #include "confdefs.h"
12512 /* Override any gcc2 internal prototype to avoid an error.  */
12513 /* We use char because int might match the return type of a gcc2
12514     builtin and then its argument prototype would still apply.  */
12515 char lwp_create();
12516
12517 int main() {
12518 lwp_create()
12519 ; return 0; }
12520 EOF
12521 if { (eval echo configure:12522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12522   rm -rf conftest*
12523   eval "ac_cv_lib_$ac_lib_var=yes"
12524 else
12525   echo "configure: failed program was:" >&5
12526   cat conftest.$ac_ext >&5
12527   rm -rf conftest*
12528   eval "ac_cv_lib_$ac_lib_var=no"
12529 fi
12530 rm -f conftest*
12531 LIBS="$ac_save_LIBS"
12532
12533 fi
12534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12535   echo "$ac_t""yes" 1>&6
12536   have_lwp=yes
12537 else
12538   echo "$ac_t""no" 1>&6
12539 have_lwp=no
12540 fi
12541
12542
12543                 if test $have_lwp = yes ; then
12544                         cat >> confdefs.h <<\EOF
12545 #define HAVE_LWP 1
12546 EOF
12547
12548                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12549                         ol_link_threads=lwp
12550
12551                         if test $ol_with_yielding_select = auto ; then
12552                                 ol_with_yielding_select=no
12553                         fi
12554                 fi
12555         fi
12556 fi
12557
12558 if test $ol_with_yielding_select = yes ; then
12559         cat >> confdefs.h <<\EOF
12560 #define HAVE_YIELDING_SELECT 1
12561 EOF
12562
12563 fi
12564
12565 if test $ol_with_threads = manual ; then
12566                 ol_link_threads=yes
12567
12568         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12569
12570         for ac_hdr in pthread.h sched.h
12571 do
12572 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12573 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12574 echo "configure:12575: checking for $ac_hdr" >&5
12575 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12576   echo $ac_n "(cached) $ac_c" 1>&6
12577 else
12578   cat > conftest.$ac_ext <<EOF
12579 #line 12580 "configure"
12580 #include "confdefs.h"
12581 #include <$ac_hdr>
12582 EOF
12583 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12584 { (eval echo configure:12585: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12585 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12586 if test -z "$ac_err"; then
12587   rm -rf conftest*
12588   eval "ac_cv_header_$ac_safe=yes"
12589 else
12590   echo "$ac_err" >&5
12591   echo "configure: failed program was:" >&5
12592   cat conftest.$ac_ext >&5
12593   rm -rf conftest*
12594   eval "ac_cv_header_$ac_safe=no"
12595 fi
12596 rm -f conftest*
12597 fi
12598 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12599   echo "$ac_t""yes" 1>&6
12600     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12601   cat >> confdefs.h <<EOF
12602 #define $ac_tr_hdr 1
12603 EOF
12604  
12605 else
12606   echo "$ac_t""no" 1>&6
12607 fi
12608 done
12609
12610         for ac_func in sched_yield pthread_yield
12611 do
12612 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12613 echo "configure:12614: checking for $ac_func" >&5
12614 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12615   echo $ac_n "(cached) $ac_c" 1>&6
12616 else
12617   cat > conftest.$ac_ext <<EOF
12618 #line 12619 "configure"
12619 #include "confdefs.h"
12620 /* System header to define __stub macros and hopefully few prototypes,
12621     which can conflict with char $ac_func(); below.  */
12622 #include <assert.h>
12623 /* Override any gcc2 internal prototype to avoid an error.  */
12624 /* We use char because int might match the return type of a gcc2
12625     builtin and then its argument prototype would still apply.  */
12626 char $ac_func();
12627 char (*f)();
12628
12629 int main() {
12630
12631 /* The GNU C library defines this for functions which it implements
12632     to always fail with ENOSYS.  Some functions are actually named
12633     something starting with __ and the normal name is an alias.  */
12634 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12635 choke me
12636 #else
12637 f = $ac_func;
12638 #endif
12639
12640 ; return 0; }
12641 EOF
12642 if { (eval echo configure:12643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12643   rm -rf conftest*
12644   eval "ac_cv_func_$ac_func=yes"
12645 else
12646   echo "configure: failed program was:" >&5
12647   cat conftest.$ac_ext >&5
12648   rm -rf conftest*
12649   eval "ac_cv_func_$ac_func=no"
12650 fi
12651 rm -f conftest*
12652 fi
12653
12654 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12655   echo "$ac_t""yes" 1>&6
12656     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12657   cat >> confdefs.h <<EOF
12658 #define $ac_tr_func 1
12659 EOF
12660  
12661 else
12662   echo "$ac_t""no" 1>&6
12663 fi
12664 done
12665
12666         
12667         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12668 echo "configure:12669: checking for LinuxThreads pthread.h" >&5
12669 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12670   echo $ac_n "(cached) $ac_c" 1>&6
12671 else
12672   cat > conftest.$ac_ext <<EOF
12673 #line 12674 "configure"
12674 #include "confdefs.h"
12675 #include <pthread.h>
12676 EOF
12677 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12678   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12679   rm -rf conftest*
12680   ol_cv_header_linux_threads=yes
12681 else
12682   rm -rf conftest*
12683   ol_cv_header_linux_threads=no
12684 fi
12685 rm -f conftest*
12686
12687                 
12688 fi
12689
12690 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12691         if test $ol_cv_header_linux_threads = yes; then
12692                 cat >> confdefs.h <<\EOF
12693 #define HAVE_LINUX_THREADS 1
12694 EOF
12695
12696         fi
12697
12698
12699         for ac_hdr in mach/cthreads.h
12700 do
12701 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12702 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12703 echo "configure:12704: checking for $ac_hdr" >&5
12704 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12705   echo $ac_n "(cached) $ac_c" 1>&6
12706 else
12707   cat > conftest.$ac_ext <<EOF
12708 #line 12709 "configure"
12709 #include "confdefs.h"
12710 #include <$ac_hdr>
12711 EOF
12712 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12713 { (eval echo configure:12714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12714 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12715 if test -z "$ac_err"; then
12716   rm -rf conftest*
12717   eval "ac_cv_header_$ac_safe=yes"
12718 else
12719   echo "$ac_err" >&5
12720   echo "configure: failed program was:" >&5
12721   cat conftest.$ac_ext >&5
12722   rm -rf conftest*
12723   eval "ac_cv_header_$ac_safe=no"
12724 fi
12725 rm -f conftest*
12726 fi
12727 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12728   echo "$ac_t""yes" 1>&6
12729     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12730   cat >> confdefs.h <<EOF
12731 #define $ac_tr_hdr 1
12732 EOF
12733  
12734 else
12735   echo "$ac_t""no" 1>&6
12736 fi
12737 done
12738
12739         for ac_hdr in lwp/lwp.h
12740 do
12741 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12742 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12743 echo "configure:12744: checking for $ac_hdr" >&5
12744 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12745   echo $ac_n "(cached) $ac_c" 1>&6
12746 else
12747   cat > conftest.$ac_ext <<EOF
12748 #line 12749 "configure"
12749 #include "confdefs.h"
12750 #include <$ac_hdr>
12751 EOF
12752 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12753 { (eval echo configure:12754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12754 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12755 if test -z "$ac_err"; then
12756   rm -rf conftest*
12757   eval "ac_cv_header_$ac_safe=yes"
12758 else
12759   echo "$ac_err" >&5
12760   echo "configure: failed program was:" >&5
12761   cat conftest.$ac_ext >&5
12762   rm -rf conftest*
12763   eval "ac_cv_header_$ac_safe=no"
12764 fi
12765 rm -f conftest*
12766 fi
12767 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12768   echo "$ac_t""yes" 1>&6
12769     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12770   cat >> confdefs.h <<EOF
12771 #define $ac_tr_hdr 1
12772 EOF
12773  
12774 else
12775   echo "$ac_t""no" 1>&6
12776 fi
12777 done
12778
12779         for ac_hdr in thread.h synch.h
12780 do
12781 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12782 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12783 echo "configure:12784: checking for $ac_hdr" >&5
12784 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12785   echo $ac_n "(cached) $ac_c" 1>&6
12786 else
12787   cat > conftest.$ac_ext <<EOF
12788 #line 12789 "configure"
12789 #include "confdefs.h"
12790 #include <$ac_hdr>
12791 EOF
12792 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12793 { (eval echo configure:12794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12794 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12795 if test -z "$ac_err"; then
12796   rm -rf conftest*
12797   eval "ac_cv_header_$ac_safe=yes"
12798 else
12799   echo "$ac_err" >&5
12800   echo "configure: failed program was:" >&5
12801   cat conftest.$ac_ext >&5
12802   rm -rf conftest*
12803   eval "ac_cv_header_$ac_safe=no"
12804 fi
12805 rm -f conftest*
12806 fi
12807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12808   echo "$ac_t""yes" 1>&6
12809     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12810   cat >> confdefs.h <<EOF
12811 #define $ac_tr_hdr 1
12812 EOF
12813  
12814 else
12815   echo "$ac_t""no" 1>&6
12816 fi
12817 done
12818
12819 fi
12820
12821 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12822                         cat >> confdefs.h <<\EOF
12823 #define REENTRANT 1
12824 EOF
12825
12826         cat >> confdefs.h <<\EOF
12827 #define _REENTRANT 1
12828 EOF
12829
12830         cat >> confdefs.h <<\EOF
12831 #define THREAD_SAFE 1
12832 EOF
12833
12834         cat >> confdefs.h <<\EOF
12835 #define _THREAD_SAFE 1
12836 EOF
12837
12838         cat >> confdefs.h <<\EOF
12839 #define THREADSAFE 1
12840 EOF
12841
12842         cat >> confdefs.h <<\EOF
12843 #define _THREADSAFE 1
12844 EOF
12845
12846         cat >> confdefs.h <<\EOF
12847 #define _SGI_MP_SOURCE 1
12848 EOF
12849
12850
12851                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12852 echo "configure:12853: checking for thread specific errno" >&5
12853 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12854   echo $ac_n "(cached) $ac_c" 1>&6
12855 else
12856   
12857                 cat > conftest.$ac_ext <<EOF
12858 #line 12859 "configure"
12859 #include "confdefs.h"
12860 #include <errno.h>
12861 int main() {
12862 errno = 0;
12863 ; return 0; }
12864 EOF
12865 if { (eval echo configure:12866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12866   rm -rf conftest*
12867   ol_cv_errno_thread_specific=yes
12868 else
12869   echo "configure: failed program was:" >&5
12870   cat conftest.$ac_ext >&5
12871   rm -rf conftest*
12872   ol_cv_errno_thread_specific=no
12873 fi
12874 rm -f conftest*
12875         
12876 fi
12877
12878 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12879
12880                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12881 echo "configure:12882: checking for thread specific h_errno" >&5
12882 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12883   echo $ac_n "(cached) $ac_c" 1>&6
12884 else
12885   
12886                 cat > conftest.$ac_ext <<EOF
12887 #line 12888 "configure"
12888 #include "confdefs.h"
12889 #include <netdb.h>
12890 int main() {
12891 h_errno = 0;
12892 ; return 0; }
12893 EOF
12894 if { (eval echo configure:12895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12895   rm -rf conftest*
12896   ol_cv_h_errno_thread_specific=yes
12897 else
12898   echo "configure: failed program was:" >&5
12899   cat conftest.$ac_ext >&5
12900   rm -rf conftest*
12901   ol_cv_h_errno_thread_specific=no
12902 fi
12903 rm -f conftest*
12904         
12905 fi
12906
12907 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12908
12909         if test $ol_cv_errno_thread_specific != yes \
12910                 -o $ol_cv_h_errno_thread_specific != yes ; then
12911                 LIBS="$LTHREAD_LIBS $LIBS"
12912                 LTHREAD_LIBS=""
12913         fi
12914
12915 fi  
12916
12917 if test $ol_link_threads = no ; then
12918         if test $ol_with_threads = yes ; then
12919                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12920         fi
12921
12922         if test $ol_with_threads = auto ; then
12923                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12924                 ol_with_threads=no
12925         fi
12926
12927         cat >> confdefs.h <<\EOF
12928 #define NO_THREADS 1
12929 EOF
12930
12931         LTHREAD_LIBS=""
12932 fi
12933
12934 if test $ol_link_threads != no ; then
12935         cat >> confdefs.h <<\EOF
12936 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12937 EOF
12938
12939 fi
12940
12941 ol_link_ldbm=no 
12942
12943 if test $ol_with_ldbm_api = auto \
12944         -o $ol_with_ldbm_api = berkeley \
12945         -o $ol_with_ldbm_api = bcompat ; then
12946
12947         if test $ol_with_ldbm_api = bcompat; then \
12948                 ol_cv_berkeley_db=no
12949 for ac_hdr in db_185.h db.h
12950 do
12951 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12952 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12953 echo "configure:12954: checking for $ac_hdr" >&5
12954 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12955   echo $ac_n "(cached) $ac_c" 1>&6
12956 else
12957   cat > conftest.$ac_ext <<EOF
12958 #line 12959 "configure"
12959 #include "confdefs.h"
12960 #include <$ac_hdr>
12961 EOF
12962 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12963 { (eval echo configure:12964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12964 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12965 if test -z "$ac_err"; then
12966   rm -rf conftest*
12967   eval "ac_cv_header_$ac_safe=yes"
12968 else
12969   echo "$ac_err" >&5
12970   echo "configure: failed program was:" >&5
12971   cat conftest.$ac_ext >&5
12972   rm -rf conftest*
12973   eval "ac_cv_header_$ac_safe=no"
12974 fi
12975 rm -f conftest*
12976 fi
12977 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12978   echo "$ac_t""yes" 1>&6
12979     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12980   cat >> confdefs.h <<EOF
12981 #define $ac_tr_hdr 1
12982 EOF
12983  
12984 else
12985   echo "$ac_t""no" 1>&6
12986 fi
12987 done
12988
12989 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12990         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12991 echo "configure:12992: checking if Berkeley DB header compatibility" >&5
12992 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12993   echo $ac_n "(cached) $ac_c" 1>&6
12994 else
12995   
12996                 cat > conftest.$ac_ext <<EOF
12997 #line 12998 "configure"
12998 #include "confdefs.h"
12999
13000 #if HAVE_DB_185_H
13001 #       include <db_185.h>
13002 #else
13003 #       include <db.h>
13004 #endif
13005
13006  /* this check could be improved */
13007 #ifndef DB_VERSION_MAJOR
13008 #       define DB_VERSION_MAJOR 1
13009 #endif
13010
13011 #if DB_VERSION_MAJOR == 1 
13012         __db_version_1
13013 #endif
13014
13015 EOF
13016 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13017   egrep "__db_version_1" >/dev/null 2>&1; then
13018   rm -rf conftest*
13019   ol_cv_header_db1=yes
13020 else
13021   rm -rf conftest*
13022   ol_cv_header_db1=no
13023 fi
13024 rm -f conftest*
13025
13026 fi
13027
13028 echo "$ac_t""$ol_cv_header_db1" 1>&6
13029
13030         if test $ol_cv_header_db1 = yes ; then
13031                 ol_cv_lib_db=no
13032 if test $ol_cv_lib_db = no ; then
13033         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13034 echo "configure:13035: checking for Berkeley DB link (default)" >&5
13035 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13036   echo $ac_n "(cached) $ac_c" 1>&6
13037 else
13038   
13039         ol_DB_LIB=
13040         ol_LIBS=$LIBS
13041         LIBS="$ol_DB_LIB $LIBS"
13042
13043         cat > conftest.$ac_ext <<EOF
13044 #line 13045 "configure"
13045 #include "confdefs.h"
13046
13047 #ifdef HAVE_DB_185_H
13048 # include <db_185.h>
13049 #else
13050 # include <db.h>
13051 #endif
13052
13053 #ifndef DB_VERSION_MAJOR
13054 # define DB_VERSION_MAJOR 1
13055 #endif
13056
13057 #ifndef NULL
13058 #define NULL ((void*)0)
13059 #endif
13060
13061 int main() {
13062
13063 #if DB_VERSION_MAJOR > 1
13064         {
13065                 char *version;
13066                 int major, minor, patch;
13067
13068                 version = db_version( &major, &minor, &patch );
13069
13070                 if( major != DB_VERSION_MAJOR ||
13071                         minor < DB_VERSION_MINOR )
13072                 {
13073                         printf("Berkeley DB version mismatch\n"
13074                                 "\texpected: %s\n\tgot: %s\n",
13075                                 DB_VERSION_STRING, version);
13076                         return 1;
13077                 }
13078         }
13079 #endif
13080
13081 #if DB_VERSION_MAJOR > 2
13082         db_env_create( NULL, 0 );
13083 #elif DB_VERSION_MAJOR > 1
13084         db_appexit( NULL );
13085 #else
13086         (void) dbopen( NULL, 0, 0, 0, NULL);
13087 #endif
13088
13089 ; return 0; }
13090 EOF
13091 if { (eval echo configure:13092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13092   rm -rf conftest*
13093   ol_cv_db_none=yes
13094 else
13095   echo "configure: failed program was:" >&5
13096   cat conftest.$ac_ext >&5
13097   rm -rf conftest*
13098   ol_cv_db_none=no
13099 fi
13100 rm -f conftest*
13101
13102         LIBS="$ol_LIBS"
13103
13104 fi
13105
13106 echo "$ac_t""$ol_cv_db_none" 1>&6
13107
13108         if test $ol_cv_db_none = yes ; then
13109                 ol_cv_lib_db=yes
13110         fi
13111 fi
13112
13113 if test $ol_cv_lib_db = no ; then
13114         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13115 echo "configure:13116: checking for Berkeley DB link (-ldb)" >&5
13116 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13117   echo $ac_n "(cached) $ac_c" 1>&6
13118 else
13119   
13120         ol_DB_LIB=-ldb
13121         ol_LIBS=$LIBS
13122         LIBS="$ol_DB_LIB $LIBS"
13123
13124         cat > conftest.$ac_ext <<EOF
13125 #line 13126 "configure"
13126 #include "confdefs.h"
13127
13128 #ifdef HAVE_DB_185_H
13129 # include <db_185.h>
13130 #else
13131 # include <db.h>
13132 #endif
13133
13134 #ifndef DB_VERSION_MAJOR
13135 # define DB_VERSION_MAJOR 1
13136 #endif
13137
13138 #ifndef NULL
13139 #define NULL ((void*)0)
13140 #endif
13141
13142 int main() {
13143
13144 #if DB_VERSION_MAJOR > 1
13145         {
13146                 char *version;
13147                 int major, minor, patch;
13148
13149                 version = db_version( &major, &minor, &patch );
13150
13151                 if( major != DB_VERSION_MAJOR ||
13152                         minor < DB_VERSION_MINOR )
13153                 {
13154                         printf("Berkeley DB version mismatch\n"
13155                                 "\texpected: %s\n\tgot: %s\n",
13156                                 DB_VERSION_STRING, version);
13157                         return 1;
13158                 }
13159         }
13160 #endif
13161
13162 #if DB_VERSION_MAJOR > 2
13163         db_env_create( NULL, 0 );
13164 #elif DB_VERSION_MAJOR > 1
13165         db_appexit( NULL );
13166 #else
13167         (void) dbopen( NULL, 0, 0, 0, NULL);
13168 #endif
13169
13170 ; return 0; }
13171 EOF
13172 if { (eval echo configure:13173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13173   rm -rf conftest*
13174   ol_cv_db_db=yes
13175 else
13176   echo "configure: failed program was:" >&5
13177   cat conftest.$ac_ext >&5
13178   rm -rf conftest*
13179   ol_cv_db_db=no
13180 fi
13181 rm -f conftest*
13182
13183         LIBS="$ol_LIBS"
13184
13185 fi
13186
13187 echo "$ac_t""$ol_cv_db_db" 1>&6
13188
13189         if test $ol_cv_db_db = yes ; then
13190                 ol_cv_lib_db=-ldb
13191         fi
13192 fi
13193
13194 if test $ol_cv_lib_db = no ; then
13195         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13196 echo "configure:13197: checking for Berkeley DB link (-ldb3)" >&5
13197 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13198   echo $ac_n "(cached) $ac_c" 1>&6
13199 else
13200   
13201         ol_DB_LIB=-ldb3
13202         ol_LIBS=$LIBS
13203         LIBS="$ol_DB_LIB $LIBS"
13204
13205         cat > conftest.$ac_ext <<EOF
13206 #line 13207 "configure"
13207 #include "confdefs.h"
13208
13209 #ifdef HAVE_DB_185_H
13210 # include <db_185.h>
13211 #else
13212 # include <db.h>
13213 #endif
13214
13215 #ifndef DB_VERSION_MAJOR
13216 # define DB_VERSION_MAJOR 1
13217 #endif
13218
13219 #ifndef NULL
13220 #define NULL ((void*)0)
13221 #endif
13222
13223 int main() {
13224
13225 #if DB_VERSION_MAJOR > 1
13226         {
13227                 char *version;
13228                 int major, minor, patch;
13229
13230                 version = db_version( &major, &minor, &patch );
13231
13232                 if( major != DB_VERSION_MAJOR ||
13233                         minor < DB_VERSION_MINOR )
13234                 {
13235                         printf("Berkeley DB version mismatch\n"
13236                                 "\texpected: %s\n\tgot: %s\n",
13237                                 DB_VERSION_STRING, version);
13238                         return 1;
13239                 }
13240         }
13241 #endif
13242
13243 #if DB_VERSION_MAJOR > 2
13244         db_env_create( NULL, 0 );
13245 #elif DB_VERSION_MAJOR > 1
13246         db_appexit( NULL );
13247 #else
13248         (void) dbopen( NULL, 0, 0, 0, NULL);
13249 #endif
13250
13251 ; return 0; }
13252 EOF
13253 if { (eval echo configure:13254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13254   rm -rf conftest*
13255   ol_cv_db_db3=yes
13256 else
13257   echo "configure: failed program was:" >&5
13258   cat conftest.$ac_ext >&5
13259   rm -rf conftest*
13260   ol_cv_db_db3=no
13261 fi
13262 rm -f conftest*
13263
13264         LIBS="$ol_LIBS"
13265
13266 fi
13267
13268 echo "$ac_t""$ol_cv_db_db3" 1>&6
13269
13270         if test $ol_cv_db_db3 = yes ; then
13271                 ol_cv_lib_db=-ldb3
13272         fi
13273 fi
13274
13275 if test $ol_cv_lib_db = no ; then
13276         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13277 echo "configure:13278: checking for Berkeley DB link (-ldb2)" >&5
13278 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13279   echo $ac_n "(cached) $ac_c" 1>&6
13280 else
13281   
13282         ol_DB_LIB=-ldb2
13283         ol_LIBS=$LIBS
13284         LIBS="$ol_DB_LIB $LIBS"
13285
13286         cat > conftest.$ac_ext <<EOF
13287 #line 13288 "configure"
13288 #include "confdefs.h"
13289
13290 #ifdef HAVE_DB_185_H
13291 # include <db_185.h>
13292 #else
13293 # include <db.h>
13294 #endif
13295
13296 #ifndef DB_VERSION_MAJOR
13297 # define DB_VERSION_MAJOR 1
13298 #endif
13299
13300 #ifndef NULL
13301 #define NULL ((void*)0)
13302 #endif
13303
13304 int main() {
13305
13306 #if DB_VERSION_MAJOR > 1
13307         {
13308                 char *version;
13309                 int major, minor, patch;
13310
13311                 version = db_version( &major, &minor, &patch );
13312
13313                 if( major != DB_VERSION_MAJOR ||
13314                         minor < DB_VERSION_MINOR )
13315                 {
13316                         printf("Berkeley DB version mismatch\n"
13317                                 "\texpected: %s\n\tgot: %s\n",
13318                                 DB_VERSION_STRING, version);
13319                         return 1;
13320                 }
13321         }
13322 #endif
13323
13324 #if DB_VERSION_MAJOR > 2
13325         db_env_create( NULL, 0 );
13326 #elif DB_VERSION_MAJOR > 1
13327         db_appexit( NULL );
13328 #else
13329         (void) dbopen( NULL, 0, 0, 0, NULL);
13330 #endif
13331
13332 ; return 0; }
13333 EOF
13334 if { (eval echo configure:13335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13335   rm -rf conftest*
13336   ol_cv_db_db2=yes
13337 else
13338   echo "configure: failed program was:" >&5
13339   cat conftest.$ac_ext >&5
13340   rm -rf conftest*
13341   ol_cv_db_db2=no
13342 fi
13343 rm -f conftest*
13344
13345         LIBS="$ol_LIBS"
13346
13347 fi
13348
13349 echo "$ac_t""$ol_cv_db_db2" 1>&6
13350
13351         if test $ol_cv_db_db2 = yes ; then
13352                 ol_cv_lib_db=-ldb2
13353         fi
13354 fi
13355
13356 if test $ol_cv_lib_db = no ; then
13357         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13358 echo "configure:13359: checking for Berkeley DB link (-ldb1)" >&5
13359 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13360   echo $ac_n "(cached) $ac_c" 1>&6
13361 else
13362   
13363         ol_DB_LIB=-ldb1
13364         ol_LIBS=$LIBS
13365         LIBS="$ol_DB_LIB $LIBS"
13366
13367         cat > conftest.$ac_ext <<EOF
13368 #line 13369 "configure"
13369 #include "confdefs.h"
13370
13371 #ifdef HAVE_DB_185_H
13372 # include <db_185.h>
13373 #else
13374 # include <db.h>
13375 #endif
13376
13377 #ifndef DB_VERSION_MAJOR
13378 # define DB_VERSION_MAJOR 1
13379 #endif
13380
13381 #ifndef NULL
13382 #define NULL ((void*)0)
13383 #endif
13384
13385 int main() {
13386
13387 #if DB_VERSION_MAJOR > 1
13388         {
13389                 char *version;
13390                 int major, minor, patch;
13391
13392                 version = db_version( &major, &minor, &patch );
13393
13394                 if( major != DB_VERSION_MAJOR ||
13395                         minor < DB_VERSION_MINOR )
13396                 {
13397                         printf("Berkeley DB version mismatch\n"
13398                                 "\texpected: %s\n\tgot: %s\n",
13399                                 DB_VERSION_STRING, version);
13400                         return 1;
13401                 }
13402         }
13403 #endif
13404
13405 #if DB_VERSION_MAJOR > 2
13406         db_env_create( NULL, 0 );
13407 #elif DB_VERSION_MAJOR > 1
13408         db_appexit( NULL );
13409 #else
13410         (void) dbopen( NULL, 0, 0, 0, NULL);
13411 #endif
13412
13413 ; return 0; }
13414 EOF
13415 if { (eval echo configure:13416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13416   rm -rf conftest*
13417   ol_cv_db_db1=yes
13418 else
13419   echo "configure: failed program was:" >&5
13420   cat conftest.$ac_ext >&5
13421   rm -rf conftest*
13422   ol_cv_db_db1=no
13423 fi
13424 rm -f conftest*
13425
13426         LIBS="$ol_LIBS"
13427
13428 fi
13429
13430 echo "$ac_t""$ol_cv_db_db1" 1>&6
13431
13432         if test $ol_cv_db_db1 = yes ; then
13433                 ol_cv_lib_db=-ldb1
13434         fi
13435 fi
13436
13437
13438                 if test "$ol_cv_lib_db" != no ; then
13439                         ol_cv_berkeley_db=yes
13440                 fi
13441         fi
13442 fi
13443
13444         else
13445                 ol_cv_berkeley_db=no
13446 for ac_hdr in db.h
13447 do
13448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13450 echo "configure:13451: checking for $ac_hdr" >&5
13451 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13452   echo $ac_n "(cached) $ac_c" 1>&6
13453 else
13454   cat > conftest.$ac_ext <<EOF
13455 #line 13456 "configure"
13456 #include "confdefs.h"
13457 #include <$ac_hdr>
13458 EOF
13459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13460 { (eval echo configure:13461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13462 if test -z "$ac_err"; then
13463   rm -rf conftest*
13464   eval "ac_cv_header_$ac_safe=yes"
13465 else
13466   echo "$ac_err" >&5
13467   echo "configure: failed program was:" >&5
13468   cat conftest.$ac_ext >&5
13469   rm -rf conftest*
13470   eval "ac_cv_header_$ac_safe=no"
13471 fi
13472 rm -f conftest*
13473 fi
13474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13475   echo "$ac_t""yes" 1>&6
13476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13477   cat >> confdefs.h <<EOF
13478 #define $ac_tr_hdr 1
13479 EOF
13480  
13481 else
13482   echo "$ac_t""no" 1>&6
13483 fi
13484 done
13485
13486 if test $ac_cv_header_db_h = yes; then
13487         ol_cv_lib_db=no
13488 if test $ol_cv_lib_db = no ; then
13489         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13490 echo "configure:13491: checking for Berkeley DB link (default)" >&5
13491 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13492   echo $ac_n "(cached) $ac_c" 1>&6
13493 else
13494   
13495         ol_DB_LIB=
13496         ol_LIBS=$LIBS
13497         LIBS="$ol_DB_LIB $LIBS"
13498
13499         cat > conftest.$ac_ext <<EOF
13500 #line 13501 "configure"
13501 #include "confdefs.h"
13502
13503 #ifdef HAVE_DB_185_H
13504 # include <db_185.h>
13505 #else
13506 # include <db.h>
13507 #endif
13508
13509 #ifndef DB_VERSION_MAJOR
13510 # define DB_VERSION_MAJOR 1
13511 #endif
13512
13513 #ifndef NULL
13514 #define NULL ((void*)0)
13515 #endif
13516
13517 int main() {
13518
13519 #if DB_VERSION_MAJOR > 1
13520         {
13521                 char *version;
13522                 int major, minor, patch;
13523
13524                 version = db_version( &major, &minor, &patch );
13525
13526                 if( major != DB_VERSION_MAJOR ||
13527                         minor < DB_VERSION_MINOR )
13528                 {
13529                         printf("Berkeley DB version mismatch\n"
13530                                 "\texpected: %s\n\tgot: %s\n",
13531                                 DB_VERSION_STRING, version);
13532                         return 1;
13533                 }
13534         }
13535 #endif
13536
13537 #if DB_VERSION_MAJOR > 2
13538         db_env_create( NULL, 0 );
13539 #elif DB_VERSION_MAJOR > 1
13540         db_appexit( NULL );
13541 #else
13542         (void) dbopen( NULL, 0, 0, 0, NULL);
13543 #endif
13544
13545 ; return 0; }
13546 EOF
13547 if { (eval echo configure:13548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13548   rm -rf conftest*
13549   ol_cv_db_none=yes
13550 else
13551   echo "configure: failed program was:" >&5
13552   cat conftest.$ac_ext >&5
13553   rm -rf conftest*
13554   ol_cv_db_none=no
13555 fi
13556 rm -f conftest*
13557
13558         LIBS="$ol_LIBS"
13559
13560 fi
13561
13562 echo "$ac_t""$ol_cv_db_none" 1>&6
13563
13564         if test $ol_cv_db_none = yes ; then
13565                 ol_cv_lib_db=yes
13566         fi
13567 fi
13568
13569 if test $ol_cv_lib_db = no ; then
13570         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13571 echo "configure:13572: checking for Berkeley DB link (-ldb)" >&5
13572 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13573   echo $ac_n "(cached) $ac_c" 1>&6
13574 else
13575   
13576         ol_DB_LIB=-ldb
13577         ol_LIBS=$LIBS
13578         LIBS="$ol_DB_LIB $LIBS"
13579
13580         cat > conftest.$ac_ext <<EOF
13581 #line 13582 "configure"
13582 #include "confdefs.h"
13583
13584 #ifdef HAVE_DB_185_H
13585 # include <db_185.h>
13586 #else
13587 # include <db.h>
13588 #endif
13589
13590 #ifndef DB_VERSION_MAJOR
13591 # define DB_VERSION_MAJOR 1
13592 #endif
13593
13594 #ifndef NULL
13595 #define NULL ((void*)0)
13596 #endif
13597
13598 int main() {
13599
13600 #if DB_VERSION_MAJOR > 1
13601         {
13602                 char *version;
13603                 int major, minor, patch;
13604
13605                 version = db_version( &major, &minor, &patch );
13606
13607                 if( major != DB_VERSION_MAJOR ||
13608                         minor < DB_VERSION_MINOR )
13609                 {
13610                         printf("Berkeley DB version mismatch\n"
13611                                 "\texpected: %s\n\tgot: %s\n",
13612                                 DB_VERSION_STRING, version);
13613                         return 1;
13614                 }
13615         }
13616 #endif
13617
13618 #if DB_VERSION_MAJOR > 2
13619         db_env_create( NULL, 0 );
13620 #elif DB_VERSION_MAJOR > 1
13621         db_appexit( NULL );
13622 #else
13623         (void) dbopen( NULL, 0, 0, 0, NULL);
13624 #endif
13625
13626 ; return 0; }
13627 EOF
13628 if { (eval echo configure:13629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13629   rm -rf conftest*
13630   ol_cv_db_db=yes
13631 else
13632   echo "configure: failed program was:" >&5
13633   cat conftest.$ac_ext >&5
13634   rm -rf conftest*
13635   ol_cv_db_db=no
13636 fi
13637 rm -f conftest*
13638
13639         LIBS="$ol_LIBS"
13640
13641 fi
13642
13643 echo "$ac_t""$ol_cv_db_db" 1>&6
13644
13645         if test $ol_cv_db_db = yes ; then
13646                 ol_cv_lib_db=-ldb
13647         fi
13648 fi
13649
13650 if test $ol_cv_lib_db = no ; then
13651         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13652 echo "configure:13653: checking for Berkeley DB link (-ldb3)" >&5
13653 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13654   echo $ac_n "(cached) $ac_c" 1>&6
13655 else
13656   
13657         ol_DB_LIB=-ldb3
13658         ol_LIBS=$LIBS
13659         LIBS="$ol_DB_LIB $LIBS"
13660
13661         cat > conftest.$ac_ext <<EOF
13662 #line 13663 "configure"
13663 #include "confdefs.h"
13664
13665 #ifdef HAVE_DB_185_H
13666 # include <db_185.h>
13667 #else
13668 # include <db.h>
13669 #endif
13670
13671 #ifndef DB_VERSION_MAJOR
13672 # define DB_VERSION_MAJOR 1
13673 #endif
13674
13675 #ifndef NULL
13676 #define NULL ((void*)0)
13677 #endif
13678
13679 int main() {
13680
13681 #if DB_VERSION_MAJOR > 1
13682         {
13683                 char *version;
13684                 int major, minor, patch;
13685
13686                 version = db_version( &major, &minor, &patch );
13687
13688                 if( major != DB_VERSION_MAJOR ||
13689                         minor < DB_VERSION_MINOR )
13690                 {
13691                         printf("Berkeley DB version mismatch\n"
13692                                 "\texpected: %s\n\tgot: %s\n",
13693                                 DB_VERSION_STRING, version);
13694                         return 1;
13695                 }
13696         }
13697 #endif
13698
13699 #if DB_VERSION_MAJOR > 2
13700         db_env_create( NULL, 0 );
13701 #elif DB_VERSION_MAJOR > 1
13702         db_appexit( NULL );
13703 #else
13704         (void) dbopen( NULL, 0, 0, 0, NULL);
13705 #endif
13706
13707 ; return 0; }
13708 EOF
13709 if { (eval echo configure:13710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13710   rm -rf conftest*
13711   ol_cv_db_db3=yes
13712 else
13713   echo "configure: failed program was:" >&5
13714   cat conftest.$ac_ext >&5
13715   rm -rf conftest*
13716   ol_cv_db_db3=no
13717 fi
13718 rm -f conftest*
13719
13720         LIBS="$ol_LIBS"
13721
13722 fi
13723
13724 echo "$ac_t""$ol_cv_db_db3" 1>&6
13725
13726         if test $ol_cv_db_db3 = yes ; then
13727                 ol_cv_lib_db=-ldb3
13728         fi
13729 fi
13730
13731 if test $ol_cv_lib_db = no ; then
13732         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13733 echo "configure:13734: checking for Berkeley DB link (-ldb2)" >&5
13734 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13735   echo $ac_n "(cached) $ac_c" 1>&6
13736 else
13737   
13738         ol_DB_LIB=-ldb2
13739         ol_LIBS=$LIBS
13740         LIBS="$ol_DB_LIB $LIBS"
13741
13742         cat > conftest.$ac_ext <<EOF
13743 #line 13744 "configure"
13744 #include "confdefs.h"
13745
13746 #ifdef HAVE_DB_185_H
13747 # include <db_185.h>
13748 #else
13749 # include <db.h>
13750 #endif
13751
13752 #ifndef DB_VERSION_MAJOR
13753 # define DB_VERSION_MAJOR 1
13754 #endif
13755
13756 #ifndef NULL
13757 #define NULL ((void*)0)
13758 #endif
13759
13760 int main() {
13761
13762 #if DB_VERSION_MAJOR > 1
13763         {
13764                 char *version;
13765                 int major, minor, patch;
13766
13767                 version = db_version( &major, &minor, &patch );
13768
13769                 if( major != DB_VERSION_MAJOR ||
13770                         minor < DB_VERSION_MINOR )
13771                 {
13772                         printf("Berkeley DB version mismatch\n"
13773                                 "\texpected: %s\n\tgot: %s\n",
13774                                 DB_VERSION_STRING, version);
13775                         return 1;
13776                 }
13777         }
13778 #endif
13779
13780 #if DB_VERSION_MAJOR > 2
13781         db_env_create( NULL, 0 );
13782 #elif DB_VERSION_MAJOR > 1
13783         db_appexit( NULL );
13784 #else
13785         (void) dbopen( NULL, 0, 0, 0, NULL);
13786 #endif
13787
13788 ; return 0; }
13789 EOF
13790 if { (eval echo configure:13791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13791   rm -rf conftest*
13792   ol_cv_db_db2=yes
13793 else
13794   echo "configure: failed program was:" >&5
13795   cat conftest.$ac_ext >&5
13796   rm -rf conftest*
13797   ol_cv_db_db2=no
13798 fi
13799 rm -f conftest*
13800
13801         LIBS="$ol_LIBS"
13802
13803 fi
13804
13805 echo "$ac_t""$ol_cv_db_db2" 1>&6
13806
13807         if test $ol_cv_db_db2 = yes ; then
13808                 ol_cv_lib_db=-ldb2
13809         fi
13810 fi
13811
13812 if test $ol_cv_lib_db = no ; then
13813         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13814 echo "configure:13815: checking for Berkeley DB link (-ldb1)" >&5
13815 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13816   echo $ac_n "(cached) $ac_c" 1>&6
13817 else
13818   
13819         ol_DB_LIB=-ldb1
13820         ol_LIBS=$LIBS
13821         LIBS="$ol_DB_LIB $LIBS"
13822
13823         cat > conftest.$ac_ext <<EOF
13824 #line 13825 "configure"
13825 #include "confdefs.h"
13826
13827 #ifdef HAVE_DB_185_H
13828 # include <db_185.h>
13829 #else
13830 # include <db.h>
13831 #endif
13832
13833 #ifndef DB_VERSION_MAJOR
13834 # define DB_VERSION_MAJOR 1
13835 #endif
13836
13837 #ifndef NULL
13838 #define NULL ((void*)0)
13839 #endif
13840
13841 int main() {
13842
13843 #if DB_VERSION_MAJOR > 1
13844         {
13845                 char *version;
13846                 int major, minor, patch;
13847
13848                 version = db_version( &major, &minor, &patch );
13849
13850                 if( major != DB_VERSION_MAJOR ||
13851                         minor < DB_VERSION_MINOR )
13852                 {
13853                         printf("Berkeley DB version mismatch\n"
13854                                 "\texpected: %s\n\tgot: %s\n",
13855                                 DB_VERSION_STRING, version);
13856                         return 1;
13857                 }
13858         }
13859 #endif
13860
13861 #if DB_VERSION_MAJOR > 2
13862         db_env_create( NULL, 0 );
13863 #elif DB_VERSION_MAJOR > 1
13864         db_appexit( NULL );
13865 #else
13866         (void) dbopen( NULL, 0, 0, 0, NULL);
13867 #endif
13868
13869 ; return 0; }
13870 EOF
13871 if { (eval echo configure:13872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13872   rm -rf conftest*
13873   ol_cv_db_db1=yes
13874 else
13875   echo "configure: failed program was:" >&5
13876   cat conftest.$ac_ext >&5
13877   rm -rf conftest*
13878   ol_cv_db_db1=no
13879 fi
13880 rm -f conftest*
13881
13882         LIBS="$ol_LIBS"
13883
13884 fi
13885
13886 echo "$ac_t""$ol_cv_db_db1" 1>&6
13887
13888         if test $ol_cv_db_db1 = yes ; then
13889                 ol_cv_lib_db=-ldb1
13890         fi
13891 fi
13892
13893
13894         if test "$ol_cv_lib_db" != no ; then
13895                 ol_cv_berkeley_db=yes
13896                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13897 echo "configure:13898: checking for Berkeley DB thread support" >&5
13898 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13899   echo $ac_n "(cached) $ac_c" 1>&6
13900 else
13901   
13902         ol_LIBS="$LIBS"
13903         if test $ol_cv_lib_db != yes ; then
13904                 LIBS="$ol_cv_lib_db"
13905         fi
13906
13907         if test "$cross_compiling" = yes; then
13908   ol_cv_berkeley_db_thread=cross
13909 else
13910   cat > conftest.$ac_ext <<EOF
13911 #line 13912 "configure"
13912 #include "confdefs.h"
13913
13914 #ifdef HAVE_DB_185_H
13915         choke me;
13916 #else
13917 #include <db.h>
13918 #endif
13919 #ifndef NULL
13920 #define NULL ((void *)0)
13921 #endif
13922 main()
13923 {
13924         int rc;
13925         u_int32_t flags = DB_CREATE |
13926 #ifdef DB_PRIVATE
13927                 DB_PRIVATE |
13928 #endif
13929                 DB_THREAD;
13930
13931 #if DB_VERSION_MAJOR > 2
13932         DB_ENV *env = NULL;
13933
13934         rc = db_env_create( &env, 0 );
13935
13936         flags |= DB_INIT_MPOOL;
13937 #ifdef DB_MPOOL_PRIVATE
13938         flags |= DB_MPOOL_PRIVATE;
13939 #endif
13940
13941         if( rc ) {
13942                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13943                 return rc;
13944         }
13945
13946 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13947         rc = env->open( env, NULL, flags, 0 );
13948 #else
13949         rc = env->open( env, NULL, NULL, flags, 0 );
13950 #endif
13951
13952         if ( rc == 0 ) {
13953                 rc = env->close( env, 0 );
13954         }
13955
13956         if( rc ) {
13957                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13958                 return rc;
13959         }
13960
13961 #else
13962         DB_ENV env;
13963         memset( &env, '\0', sizeof(env) );
13964
13965         rc = db_appinit( NULL, NULL, &env, flags );
13966
13967         if( rc == 0 ) {
13968                 db_appexit( &env );
13969         }
13970
13971         unlink("__db_mpool.share");
13972         unlink("__db_lock.share");
13973 #endif
13974
13975         return rc;
13976 }
13977 EOF
13978 if { (eval echo configure:13979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13979 then
13980   ol_cv_berkeley_db_thread=yes
13981 else
13982   echo "configure: failed program was:" >&5
13983   cat conftest.$ac_ext >&5
13984   rm -fr conftest*
13985   ol_cv_berkeley_db_thread=no
13986 fi
13987 rm -fr conftest*
13988 fi
13989
13990
13991         LIBS="$ol_LIBS"
13992
13993         if test $ol_cv_berkeley_db_thread != no ; then
13994                 cat >> confdefs.h <<\EOF
13995 #define HAVE_BERKELEY_DB_THREAD 1
13996 EOF
13997
13998         fi
13999
14000 fi
14001
14002 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
14003         fi
14004 fi
14005
14006         fi
14007
14008         if test $ol_cv_berkeley_db != no ; then
14009                 cat >> confdefs.h <<\EOF
14010 #define HAVE_BERKELEY_DB 1
14011 EOF
14012
14013
14014                 ol_link_ldbm=berkeley
14015                 ol_with_ldbm_api=berkeley
14016
14017                 if test $ol_with_ldbm_type = hash ; then
14018                         cat >> confdefs.h <<\EOF
14019 #define LDBM_USE_DBHASH 1
14020 EOF
14021
14022                 else
14023                         cat >> confdefs.h <<\EOF
14024 #define LDBM_USE_DBBTREE 1
14025 EOF
14026
14027                 fi
14028
14029                                                 if test $ol_cv_lib_db != yes ; then
14030                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
14031                 fi
14032         fi
14033 fi
14034
14035 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
14036         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
14037 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
14038         ol_enable_bdb=yes
14039 fi
14040
14041 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
14042         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
14043         ol_with_ldbm_api=none
14044 fi
14045
14046 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
14047         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
14048 echo "configure:14049: checking for MDBM library" >&5
14049 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
14050   echo $ac_n "(cached) $ac_c" 1>&6
14051 else
14052         ol_LIBS="$LIBS"
14053         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
14054 echo "configure:14055: checking for mdbm_set_chain" >&5
14055 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
14056   echo $ac_n "(cached) $ac_c" 1>&6
14057 else
14058   cat > conftest.$ac_ext <<EOF
14059 #line 14060 "configure"
14060 #include "confdefs.h"
14061 /* System header to define __stub macros and hopefully few prototypes,
14062     which can conflict with char mdbm_set_chain(); below.  */
14063 #include <assert.h>
14064 /* Override any gcc2 internal prototype to avoid an error.  */
14065 /* We use char because int might match the return type of a gcc2
14066     builtin and then its argument prototype would still apply.  */
14067 char mdbm_set_chain();
14068 char (*f)();
14069
14070 int main() {
14071
14072 /* The GNU C library defines this for functions which it implements
14073     to always fail with ENOSYS.  Some functions are actually named
14074     something starting with __ and the normal name is an alias.  */
14075 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
14076 choke me
14077 #else
14078 f = mdbm_set_chain;
14079 #endif
14080
14081 ; return 0; }
14082 EOF
14083 if { (eval echo configure:14084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14084   rm -rf conftest*
14085   eval "ac_cv_func_mdbm_set_chain=yes"
14086 else
14087   echo "configure: failed program was:" >&5
14088   cat conftest.$ac_ext >&5
14089   rm -rf conftest*
14090   eval "ac_cv_func_mdbm_set_chain=no"
14091 fi
14092 rm -f conftest*
14093 fi
14094
14095 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
14096   echo "$ac_t""yes" 1>&6
14097   ol_cv_lib_mdbm=yes
14098 else
14099   echo "$ac_t""no" 1>&6
14100
14101                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
14102 echo "configure:14103: checking for mdbm_set_chain in -lmdbm" >&5
14103 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
14104 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14105   echo $ac_n "(cached) $ac_c" 1>&6
14106 else
14107   ac_save_LIBS="$LIBS"
14108 LIBS="-lmdbm  $LIBS"
14109 cat > conftest.$ac_ext <<EOF
14110 #line 14111 "configure"
14111 #include "confdefs.h"
14112 /* Override any gcc2 internal prototype to avoid an error.  */
14113 /* We use char because int might match the return type of a gcc2
14114     builtin and then its argument prototype would still apply.  */
14115 char mdbm_set_chain();
14116
14117 int main() {
14118 mdbm_set_chain()
14119 ; return 0; }
14120 EOF
14121 if { (eval echo configure:14122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14122   rm -rf conftest*
14123   eval "ac_cv_lib_$ac_lib_var=yes"
14124 else
14125   echo "configure: failed program was:" >&5
14126   cat conftest.$ac_ext >&5
14127   rm -rf conftest*
14128   eval "ac_cv_lib_$ac_lib_var=no"
14129 fi
14130 rm -f conftest*
14131 LIBS="$ac_save_LIBS"
14132
14133 fi
14134 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14135   echo "$ac_t""yes" 1>&6
14136   ol_cv_lib_mdbm=-lmdbm
14137 else
14138   echo "$ac_t""no" 1>&6
14139 ol_cv_lib_mdbm=no
14140 fi
14141
14142         
14143 fi
14144
14145         LIBS="$ol_LIBS"
14146
14147 fi
14148
14149 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
14150
14151
14152  for ac_hdr in mdbm.h
14153 do
14154 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14155 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14156 echo "configure:14157: checking for $ac_hdr" >&5
14157 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14158   echo $ac_n "(cached) $ac_c" 1>&6
14159 else
14160   cat > conftest.$ac_ext <<EOF
14161 #line 14162 "configure"
14162 #include "confdefs.h"
14163 #include <$ac_hdr>
14164 EOF
14165 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14166 { (eval echo configure:14167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14167 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14168 if test -z "$ac_err"; then
14169   rm -rf conftest*
14170   eval "ac_cv_header_$ac_safe=yes"
14171 else
14172   echo "$ac_err" >&5
14173   echo "configure: failed program was:" >&5
14174   cat conftest.$ac_ext >&5
14175   rm -rf conftest*
14176   eval "ac_cv_header_$ac_safe=no"
14177 fi
14178 rm -f conftest*
14179 fi
14180 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14181   echo "$ac_t""yes" 1>&6
14182     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14183   cat >> confdefs.h <<EOF
14184 #define $ac_tr_hdr 1
14185 EOF
14186  
14187 else
14188   echo "$ac_t""no" 1>&6
14189 fi
14190 done
14191
14192  echo $ac_n "checking for db""... $ac_c" 1>&6
14193 echo "configure:14194: checking for db" >&5
14194 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
14195   echo $ac_n "(cached) $ac_c" 1>&6
14196 else
14197   
14198         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
14199                 ol_cv_mdbm=no
14200         else
14201                 ol_cv_mdbm=yes
14202         fi
14203
14204 fi
14205
14206 echo "$ac_t""$ol_cv_mdbm" 1>&6
14207  if test $ol_cv_mdbm = yes ; then
14208         cat >> confdefs.h <<\EOF
14209 #define HAVE_MDBM 1
14210 EOF
14211
14212  fi
14213
14214
14215         if test $ol_cv_mdbm = yes ; then
14216                 ol_link_ldbm=mdbm
14217                 ol_with_ldbm_api=mdbm
14218                 if test $ol_cv_lib_mdbm != yes ; then
14219                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
14220                 fi
14221         fi
14222 fi
14223
14224 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
14225         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
14226 echo "configure:14227: checking for GDBM library" >&5
14227 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
14228   echo $ac_n "(cached) $ac_c" 1>&6
14229 else
14230         ol_LIBS="$LIBS"
14231         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
14232 echo "configure:14233: checking for gdbm_open" >&5
14233 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
14234   echo $ac_n "(cached) $ac_c" 1>&6
14235 else
14236   cat > conftest.$ac_ext <<EOF
14237 #line 14238 "configure"
14238 #include "confdefs.h"
14239 /* System header to define __stub macros and hopefully few prototypes,
14240     which can conflict with char gdbm_open(); below.  */
14241 #include <assert.h>
14242 /* Override any gcc2 internal prototype to avoid an error.  */
14243 /* We use char because int might match the return type of a gcc2
14244     builtin and then its argument prototype would still apply.  */
14245 char gdbm_open();
14246 char (*f)();
14247
14248 int main() {
14249
14250 /* The GNU C library defines this for functions which it implements
14251     to always fail with ENOSYS.  Some functions are actually named
14252     something starting with __ and the normal name is an alias.  */
14253 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14254 choke me
14255 #else
14256 f = gdbm_open;
14257 #endif
14258
14259 ; return 0; }
14260 EOF
14261 if { (eval echo configure:14262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14262   rm -rf conftest*
14263   eval "ac_cv_func_gdbm_open=yes"
14264 else
14265   echo "configure: failed program was:" >&5
14266   cat conftest.$ac_ext >&5
14267   rm -rf conftest*
14268   eval "ac_cv_func_gdbm_open=no"
14269 fi
14270 rm -f conftest*
14271 fi
14272
14273 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14274   echo "$ac_t""yes" 1>&6
14275   ol_cv_lib_gdbm=yes
14276 else
14277   echo "$ac_t""no" 1>&6
14278
14279                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14280 echo "configure:14281: checking for gdbm_open in -lgdbm" >&5
14281 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14282 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14283   echo $ac_n "(cached) $ac_c" 1>&6
14284 else
14285   ac_save_LIBS="$LIBS"
14286 LIBS="-lgdbm  $LIBS"
14287 cat > conftest.$ac_ext <<EOF
14288 #line 14289 "configure"
14289 #include "confdefs.h"
14290 /* Override any gcc2 internal prototype to avoid an error.  */
14291 /* We use char because int might match the return type of a gcc2
14292     builtin and then its argument prototype would still apply.  */
14293 char gdbm_open();
14294
14295 int main() {
14296 gdbm_open()
14297 ; return 0; }
14298 EOF
14299 if { (eval echo configure:14300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14300   rm -rf conftest*
14301   eval "ac_cv_lib_$ac_lib_var=yes"
14302 else
14303   echo "configure: failed program was:" >&5
14304   cat conftest.$ac_ext >&5
14305   rm -rf conftest*
14306   eval "ac_cv_lib_$ac_lib_var=no"
14307 fi
14308 rm -f conftest*
14309 LIBS="$ac_save_LIBS"
14310
14311 fi
14312 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14313   echo "$ac_t""yes" 1>&6
14314   ol_cv_lib_gdbm=-lgdbm
14315 else
14316   echo "$ac_t""no" 1>&6
14317 ol_cv_lib_gdbm=no
14318 fi
14319
14320         
14321 fi
14322
14323         LIBS="$ol_LIBS"
14324
14325 fi
14326
14327 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14328
14329
14330  for ac_hdr in gdbm.h
14331 do
14332 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14333 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14334 echo "configure:14335: checking for $ac_hdr" >&5
14335 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14336   echo $ac_n "(cached) $ac_c" 1>&6
14337 else
14338   cat > conftest.$ac_ext <<EOF
14339 #line 14340 "configure"
14340 #include "confdefs.h"
14341 #include <$ac_hdr>
14342 EOF
14343 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14344 { (eval echo configure:14345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14345 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14346 if test -z "$ac_err"; then
14347   rm -rf conftest*
14348   eval "ac_cv_header_$ac_safe=yes"
14349 else
14350   echo "$ac_err" >&5
14351   echo "configure: failed program was:" >&5
14352   cat conftest.$ac_ext >&5
14353   rm -rf conftest*
14354   eval "ac_cv_header_$ac_safe=no"
14355 fi
14356 rm -f conftest*
14357 fi
14358 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14359   echo "$ac_t""yes" 1>&6
14360     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14361   cat >> confdefs.h <<EOF
14362 #define $ac_tr_hdr 1
14363 EOF
14364  
14365 else
14366   echo "$ac_t""no" 1>&6
14367 fi
14368 done
14369
14370  echo $ac_n "checking for db""... $ac_c" 1>&6
14371 echo "configure:14372: checking for db" >&5
14372 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14373   echo $ac_n "(cached) $ac_c" 1>&6
14374 else
14375   
14376         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14377                 ol_cv_gdbm=no
14378         else
14379                 ol_cv_gdbm=yes
14380         fi
14381
14382 fi
14383
14384 echo "$ac_t""$ol_cv_gdbm" 1>&6
14385  if test $ol_cv_gdbm = yes ; then
14386         cat >> confdefs.h <<\EOF
14387 #define HAVE_GDBM 1
14388 EOF
14389
14390  fi
14391
14392
14393         if test $ol_cv_gdbm = yes ; then
14394                 ol_link_ldbm=gdbm
14395                 ol_with_ldbm_api=gdbm
14396
14397                 if test $ol_cv_lib_gdbm != yes ; then
14398                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14399                 fi
14400         fi
14401 fi
14402
14403 if test $ol_with_ldbm_api = ndbm ; then
14404         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14405 echo "configure:14406: checking for NDBM library" >&5
14406 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14407   echo $ac_n "(cached) $ac_c" 1>&6
14408 else
14409         ol_LIBS="$LIBS"
14410         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14411 echo "configure:14412: checking for dbm_open" >&5
14412 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14413   echo $ac_n "(cached) $ac_c" 1>&6
14414 else
14415   cat > conftest.$ac_ext <<EOF
14416 #line 14417 "configure"
14417 #include "confdefs.h"
14418 /* System header to define __stub macros and hopefully few prototypes,
14419     which can conflict with char dbm_open(); below.  */
14420 #include <assert.h>
14421 /* Override any gcc2 internal prototype to avoid an error.  */
14422 /* We use char because int might match the return type of a gcc2
14423     builtin and then its argument prototype would still apply.  */
14424 char dbm_open();
14425 char (*f)();
14426
14427 int main() {
14428
14429 /* The GNU C library defines this for functions which it implements
14430     to always fail with ENOSYS.  Some functions are actually named
14431     something starting with __ and the normal name is an alias.  */
14432 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14433 choke me
14434 #else
14435 f = dbm_open;
14436 #endif
14437
14438 ; return 0; }
14439 EOF
14440 if { (eval echo configure:14441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14441   rm -rf conftest*
14442   eval "ac_cv_func_dbm_open=yes"
14443 else
14444   echo "configure: failed program was:" >&5
14445   cat conftest.$ac_ext >&5
14446   rm -rf conftest*
14447   eval "ac_cv_func_dbm_open=no"
14448 fi
14449 rm -f conftest*
14450 fi
14451
14452 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14453   echo "$ac_t""yes" 1>&6
14454   ol_cv_lib_ndbm=yes
14455 else
14456   echo "$ac_t""no" 1>&6
14457
14458                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14459 echo "configure:14460: checking for dbm_open in -lndbm" >&5
14460 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14461 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14462   echo $ac_n "(cached) $ac_c" 1>&6
14463 else
14464   ac_save_LIBS="$LIBS"
14465 LIBS="-lndbm  $LIBS"
14466 cat > conftest.$ac_ext <<EOF
14467 #line 14468 "configure"
14468 #include "confdefs.h"
14469 /* Override any gcc2 internal prototype to avoid an error.  */
14470 /* We use char because int might match the return type of a gcc2
14471     builtin and then its argument prototype would still apply.  */
14472 char dbm_open();
14473
14474 int main() {
14475 dbm_open()
14476 ; return 0; }
14477 EOF
14478 if { (eval echo configure:14479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14479   rm -rf conftest*
14480   eval "ac_cv_lib_$ac_lib_var=yes"
14481 else
14482   echo "configure: failed program was:" >&5
14483   cat conftest.$ac_ext >&5
14484   rm -rf conftest*
14485   eval "ac_cv_lib_$ac_lib_var=no"
14486 fi
14487 rm -f conftest*
14488 LIBS="$ac_save_LIBS"
14489
14490 fi
14491 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14492   echo "$ac_t""yes" 1>&6
14493   ol_cv_lib_ndbm=-lndbm
14494 else
14495   echo "$ac_t""no" 1>&6
14496
14497                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14498 echo "configure:14499: checking for dbm_open in -ldbm" >&5
14499 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14500 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14501   echo $ac_n "(cached) $ac_c" 1>&6
14502 else
14503   ac_save_LIBS="$LIBS"
14504 LIBS="-ldbm  $LIBS"
14505 cat > conftest.$ac_ext <<EOF
14506 #line 14507 "configure"
14507 #include "confdefs.h"
14508 /* Override any gcc2 internal prototype to avoid an error.  */
14509 /* We use char because int might match the return type of a gcc2
14510     builtin and then its argument prototype would still apply.  */
14511 char dbm_open();
14512
14513 int main() {
14514 dbm_open()
14515 ; return 0; }
14516 EOF
14517 if { (eval echo configure:14518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14518   rm -rf conftest*
14519   eval "ac_cv_lib_$ac_lib_var=yes"
14520 else
14521   echo "configure: failed program was:" >&5
14522   cat conftest.$ac_ext >&5
14523   rm -rf conftest*
14524   eval "ac_cv_lib_$ac_lib_var=no"
14525 fi
14526 rm -f conftest*
14527 LIBS="$ac_save_LIBS"
14528
14529 fi
14530 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14531   echo "$ac_t""yes" 1>&6
14532   ol_cv_lib_ndbm=-ldbm
14533 else
14534   echo "$ac_t""no" 1>&6
14535 ol_cv_lib_ndbm=no
14536 fi
14537                 
14538 fi
14539
14540         
14541 fi
14542
14543         LIBS="$ol_LIBS"
14544
14545 fi
14546
14547 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14548
14549
14550  for ac_hdr in ndbm.h
14551 do
14552 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14553 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14554 echo "configure:14555: checking for $ac_hdr" >&5
14555 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14556   echo $ac_n "(cached) $ac_c" 1>&6
14557 else
14558   cat > conftest.$ac_ext <<EOF
14559 #line 14560 "configure"
14560 #include "confdefs.h"
14561 #include <$ac_hdr>
14562 EOF
14563 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14564 { (eval echo configure:14565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14565 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14566 if test -z "$ac_err"; then
14567   rm -rf conftest*
14568   eval "ac_cv_header_$ac_safe=yes"
14569 else
14570   echo "$ac_err" >&5
14571   echo "configure: failed program was:" >&5
14572   cat conftest.$ac_ext >&5
14573   rm -rf conftest*
14574   eval "ac_cv_header_$ac_safe=no"
14575 fi
14576 rm -f conftest*
14577 fi
14578 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14579   echo "$ac_t""yes" 1>&6
14580     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14581   cat >> confdefs.h <<EOF
14582 #define $ac_tr_hdr 1
14583 EOF
14584  
14585 else
14586   echo "$ac_t""no" 1>&6
14587 fi
14588 done
14589
14590  echo $ac_n "checking for db""... $ac_c" 1>&6
14591 echo "configure:14592: checking for db" >&5
14592 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14593   echo $ac_n "(cached) $ac_c" 1>&6
14594 else
14595   
14596         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14597                 ol_cv_ndbm=no
14598         else
14599                 ol_cv_ndbm=yes
14600         fi
14601
14602 fi
14603
14604 echo "$ac_t""$ol_cv_ndbm" 1>&6
14605  if test $ol_cv_ndbm = yes ; then
14606         cat >> confdefs.h <<\EOF
14607 #define HAVE_NDBM 1
14608 EOF
14609
14610  fi
14611
14612
14613         if test $ol_cv_ndbm = yes ; then
14614                 ol_link_ldbm=ndbm
14615                 ol_with_ldbm_api=ndbm
14616
14617                 if test $ol_cv_lib_ndbm != yes ; then
14618                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14619                 fi
14620         fi
14621 fi
14622
14623 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14624         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14625         if test $ol_enable_ldbm = yes ; then
14626                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14627         fi
14628
14629         echo "configure: warning: disabling LDBM" 1>&2
14630         ol_enable_ldbm=no
14631 fi
14632
14633 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14634         LINK_BINS_DYNAMIC="yes"
14635 else
14636         LINK_BINS_DYNAMIC="no"
14637 fi
14638
14639 if test $ol_enable_wrappers != no ; then
14640         for ac_hdr in tcpd.h
14641 do
14642 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14643 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14644 echo "configure:14645: checking for $ac_hdr" >&5
14645 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14646   echo $ac_n "(cached) $ac_c" 1>&6
14647 else
14648   cat > conftest.$ac_ext <<EOF
14649 #line 14650 "configure"
14650 #include "confdefs.h"
14651 #include <$ac_hdr>
14652 EOF
14653 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14654 { (eval echo configure:14655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14655 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14656 if test -z "$ac_err"; then
14657   rm -rf conftest*
14658   eval "ac_cv_header_$ac_safe=yes"
14659 else
14660   echo "$ac_err" >&5
14661   echo "configure: failed program was:" >&5
14662   cat conftest.$ac_ext >&5
14663   rm -rf conftest*
14664   eval "ac_cv_header_$ac_safe=no"
14665 fi
14666 rm -f conftest*
14667 fi
14668 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14669   echo "$ac_t""yes" 1>&6
14670     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14671   cat >> confdefs.h <<EOF
14672 #define $ac_tr_hdr 1
14673 EOF
14674  
14675 else
14676   echo "$ac_t""no" 1>&6
14677 fi
14678 done
14679
14680
14681         if test $ac_cv_header_tcpd_h != yes ; then
14682                 have_wrappers=no
14683         else
14684                 cat > conftest.$ac_ext <<EOF
14685 #line 14686 "configure"
14686 #include "confdefs.h"
14687
14688 int allow_severity = 0;
14689 int deny_severity  = 0;
14690                 
14691 int main() {
14692 hosts_access()
14693 ; return 0; }
14694 EOF
14695 if { (eval echo configure:14696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14696   rm -rf conftest*
14697   have_wrappers=yes
14698 else
14699   echo "configure: failed program was:" >&5
14700   cat conftest.$ac_ext >&5
14701   rm -rf conftest*
14702   have_wrappers=no
14703 fi
14704 rm -f conftest*
14705         fi
14706
14707         if test $have_wrappers = yes ; then
14708                 cat >> confdefs.h <<\EOF
14709 #define HAVE_TCPD 1
14710 EOF
14711
14712                 WRAP_LIBS="-lwrap"
14713
14714                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14715 echo "configure:14716: checking for main in -lnsl" >&5
14716 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14717 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14718   echo $ac_n "(cached) $ac_c" 1>&6
14719 else
14720   ac_save_LIBS="$LIBS"
14721 LIBS="-lnsl  $LIBS"
14722 cat > conftest.$ac_ext <<EOF
14723 #line 14724 "configure"
14724 #include "confdefs.h"
14725
14726 int main() {
14727 main()
14728 ; return 0; }
14729 EOF
14730 if { (eval echo configure:14731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14731   rm -rf conftest*
14732   eval "ac_cv_lib_$ac_lib_var=yes"
14733 else
14734   echo "configure: failed program was:" >&5
14735   cat conftest.$ac_ext >&5
14736   rm -rf conftest*
14737   eval "ac_cv_lib_$ac_lib_var=no"
14738 fi
14739 rm -f conftest*
14740 LIBS="$ac_save_LIBS"
14741
14742 fi
14743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14744   echo "$ac_t""yes" 1>&6
14745     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14746     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14747   cat >> confdefs.h <<EOF
14748 #define $ac_tr_lib 1
14749 EOF
14750
14751   LIBS="-lnsl $LIBS"
14752
14753 else
14754   echo "$ac_t""no" 1>&6
14755 fi
14756
14757         else
14758                 echo "configure: warning: could not find -lwrap" 1>&2
14759                 if test $ol_enable_wrappers = yes ; then
14760                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14761                 fi
14762
14763                 echo "configure: warning: disabling wrappers support" 1>&2
14764                 ol_enable_wrappers=no
14765                 WRAP_LIBS=""
14766         fi
14767 fi
14768
14769 if test $ol_enable_syslog != no ; then
14770         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14771 echo "configure:14772: checking for openlog" >&5
14772 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14773   echo $ac_n "(cached) $ac_c" 1>&6
14774 else
14775   cat > conftest.$ac_ext <<EOF
14776 #line 14777 "configure"
14777 #include "confdefs.h"
14778 /* System header to define __stub macros and hopefully few prototypes,
14779     which can conflict with char openlog(); below.  */
14780 #include <assert.h>
14781 /* Override any gcc2 internal prototype to avoid an error.  */
14782 /* We use char because int might match the return type of a gcc2
14783     builtin and then its argument prototype would still apply.  */
14784 char openlog();
14785 char (*f)();
14786
14787 int main() {
14788
14789 /* The GNU C library defines this for functions which it implements
14790     to always fail with ENOSYS.  Some functions are actually named
14791     something starting with __ and the normal name is an alias.  */
14792 #if defined (__stub_openlog) || defined (__stub___openlog)
14793 choke me
14794 #else
14795 f = openlog;
14796 #endif
14797
14798 ; return 0; }
14799 EOF
14800 if { (eval echo configure:14801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14801   rm -rf conftest*
14802   eval "ac_cv_func_openlog=yes"
14803 else
14804   echo "configure: failed program was:" >&5
14805   cat conftest.$ac_ext >&5
14806   rm -rf conftest*
14807   eval "ac_cv_func_openlog=no"
14808 fi
14809 rm -f conftest*
14810 fi
14811
14812 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14813   echo "$ac_t""yes" 1>&6
14814   :
14815 else
14816   echo "$ac_t""no" 1>&6
14817 fi
14818
14819         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14820                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14821         fi
14822         ol_enable_syslog=$ac_cv_func_openlog
14823 fi
14824
14825
14826 ol_link_sql=no
14827 if test $ol_enable_sql != no ; then
14828         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14829 echo "configure:14830: checking for SQLDriverConnect in -liodbc" >&5
14830 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14831 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14832   echo $ac_n "(cached) $ac_c" 1>&6
14833 else
14834   ac_save_LIBS="$LIBS"
14835 LIBS="-liodbc  $LIBS"
14836 cat > conftest.$ac_ext <<EOF
14837 #line 14838 "configure"
14838 #include "confdefs.h"
14839 /* Override any gcc2 internal prototype to avoid an error.  */
14840 /* We use char because int might match the return type of a gcc2
14841     builtin and then its argument prototype would still apply.  */
14842 char SQLDriverConnect();
14843
14844 int main() {
14845 SQLDriverConnect()
14846 ; return 0; }
14847 EOF
14848 if { (eval echo configure:14849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14849   rm -rf conftest*
14850   eval "ac_cv_lib_$ac_lib_var=yes"
14851 else
14852   echo "configure: failed program was:" >&5
14853   cat conftest.$ac_ext >&5
14854   rm -rf conftest*
14855   eval "ac_cv_lib_$ac_lib_var=no"
14856 fi
14857 rm -f conftest*
14858 LIBS="$ac_save_LIBS"
14859
14860 fi
14861 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14862   echo "$ac_t""yes" 1>&6
14863   have_iodbc=yes
14864 else
14865   echo "$ac_t""no" 1>&6
14866 have_iodbc=no
14867 fi
14868
14869         if test $have_iodbc = yes ; then
14870                 ol_link_sql="-liodbc"
14871         else
14872                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14873 echo "configure:14874: checking for SQLDriverConnect in -lodbc" >&5
14874 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14875 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14876   echo $ac_n "(cached) $ac_c" 1>&6
14877 else
14878   ac_save_LIBS="$LIBS"
14879 LIBS="-lodbc  $LIBS"
14880 cat > conftest.$ac_ext <<EOF
14881 #line 14882 "configure"
14882 #include "confdefs.h"
14883 /* Override any gcc2 internal prototype to avoid an error.  */
14884 /* We use char because int might match the return type of a gcc2
14885     builtin and then its argument prototype would still apply.  */
14886 char SQLDriverConnect();
14887
14888 int main() {
14889 SQLDriverConnect()
14890 ; return 0; }
14891 EOF
14892 if { (eval echo configure:14893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14893   rm -rf conftest*
14894   eval "ac_cv_lib_$ac_lib_var=yes"
14895 else
14896   echo "configure: failed program was:" >&5
14897   cat conftest.$ac_ext >&5
14898   rm -rf conftest*
14899   eval "ac_cv_lib_$ac_lib_var=no"
14900 fi
14901 rm -f conftest*
14902 LIBS="$ac_save_LIBS"
14903
14904 fi
14905 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14906   echo "$ac_t""yes" 1>&6
14907   have_odbc=yes
14908 else
14909   echo "$ac_t""no" 1>&6
14910 have_odbc=no
14911 fi
14912
14913                 if test $have_odbc = yes ; then
14914                         ol_link_sql="-lodbc"
14915                 fi
14916         fi
14917
14918         if test $ol_link_sql != no ; then
14919                 SLAPD_SQL_LIBS="$ol_link_sql"
14920
14921         elif test $ol_enable_sql != auto ; then
14922                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14923         fi
14924 fi
14925
14926 if test $ol_enable_tcl != no ; then
14927         for ac_hdr in tcl.h
14928 do
14929 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14930 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14931 echo "configure:14932: checking for $ac_hdr" >&5
14932 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14933   echo $ac_n "(cached) $ac_c" 1>&6
14934 else
14935   cat > conftest.$ac_ext <<EOF
14936 #line 14937 "configure"
14937 #include "confdefs.h"
14938 #include <$ac_hdr>
14939 EOF
14940 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14941 { (eval echo configure:14942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14942 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14943 if test -z "$ac_err"; then
14944   rm -rf conftest*
14945   eval "ac_cv_header_$ac_safe=yes"
14946 else
14947   echo "$ac_err" >&5
14948   echo "configure: failed program was:" >&5
14949   cat conftest.$ac_ext >&5
14950   rm -rf conftest*
14951   eval "ac_cv_header_$ac_safe=no"
14952 fi
14953 rm -f conftest*
14954 fi
14955 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14956   echo "$ac_t""yes" 1>&6
14957     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14958   cat >> confdefs.h <<EOF
14959 #define $ac_tr_hdr 1
14960 EOF
14961  
14962 else
14963   echo "$ac_t""no" 1>&6
14964 fi
14965 done
14966
14967
14968         if test $ac_cv_header_tcl_h != yes ; then
14969                 have_tcl=no
14970         else
14971                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14972                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14973 echo "configure:14974: checking for main in -l$lib" >&5
14974 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
14975 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14976   echo $ac_n "(cached) $ac_c" 1>&6
14977 else
14978   ac_save_LIBS="$LIBS"
14979 LIBS="-l$lib  $LIBS"
14980 cat > conftest.$ac_ext <<EOF
14981 #line 14982 "configure"
14982 #include "confdefs.h"
14983
14984 int main() {
14985 main()
14986 ; return 0; }
14987 EOF
14988 if { (eval echo configure:14989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14989   rm -rf conftest*
14990   eval "ac_cv_lib_$ac_lib_var=yes"
14991 else
14992   echo "configure: failed program was:" >&5
14993   cat conftest.$ac_ext >&5
14994   rm -rf conftest*
14995   eval "ac_cv_lib_$ac_lib_var=no"
14996 fi
14997 rm -f conftest*
14998 LIBS="$ac_save_LIBS"
14999
15000 fi
15001 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15002   echo "$ac_t""yes" 1>&6
15003   have_tcl=yes
15004                            if test x"$ol_with_tcl_module" = "xstatic" ; then
15005                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
15006                            else
15007                                MOD_TCL_LIB="-l${lib}"
15008                            fi;break
15009 else
15010   echo "$ac_t""no" 1>&6
15011 have_tcl=no
15012 fi
15013
15014                 done
15015         fi
15016
15017         if test $have_tcl != yes ; then
15018                 echo "configure: warning: could not find -ltcl" 1>&2
15019                 if test $ol_enable_tcl = yes ; then
15020                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
15021                 fi
15022
15023                 ol_enable_tcl=no
15024         fi
15025 fi
15026
15027 ol_link_termcap=no
15028 for ac_hdr in termcap.h ncurses.h
15029 do
15030 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15031 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15032 echo "configure:15033: checking for $ac_hdr" >&5
15033 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15034   echo $ac_n "(cached) $ac_c" 1>&6
15035 else
15036   cat > conftest.$ac_ext <<EOF
15037 #line 15038 "configure"
15038 #include "confdefs.h"
15039 #include <$ac_hdr>
15040 EOF
15041 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15042 { (eval echo configure:15043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15043 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15044 if test -z "$ac_err"; then
15045   rm -rf conftest*
15046   eval "ac_cv_header_$ac_safe=yes"
15047 else
15048   echo "$ac_err" >&5
15049   echo "configure: failed program was:" >&5
15050   cat conftest.$ac_ext >&5
15051   rm -rf conftest*
15052   eval "ac_cv_header_$ac_safe=no"
15053 fi
15054 rm -f conftest*
15055 fi
15056 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15057   echo "$ac_t""yes" 1>&6
15058     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15059   cat >> confdefs.h <<EOF
15060 #define $ac_tr_hdr 1
15061 EOF
15062  
15063 else
15064   echo "$ac_t""no" 1>&6
15065 fi
15066 done
15067
15068
15069 if test $ol_link_termcap = no ; then
15070         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
15071 echo "configure:15072: checking for tputs in -ltermcap" >&5
15072 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
15073 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15074   echo $ac_n "(cached) $ac_c" 1>&6
15075 else
15076   ac_save_LIBS="$LIBS"
15077 LIBS="-ltermcap  $LIBS"
15078 cat > conftest.$ac_ext <<EOF
15079 #line 15080 "configure"
15080 #include "confdefs.h"
15081 /* Override any gcc2 internal prototype to avoid an error.  */
15082 /* We use char because int might match the return type of a gcc2
15083     builtin and then its argument prototype would still apply.  */
15084 char tputs();
15085
15086 int main() {
15087 tputs()
15088 ; return 0; }
15089 EOF
15090 if { (eval echo configure:15091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15091   rm -rf conftest*
15092   eval "ac_cv_lib_$ac_lib_var=yes"
15093 else
15094   echo "configure: failed program was:" >&5
15095   cat conftest.$ac_ext >&5
15096   rm -rf conftest*
15097   eval "ac_cv_lib_$ac_lib_var=no"
15098 fi
15099 rm -f conftest*
15100 LIBS="$ac_save_LIBS"
15101
15102 fi
15103 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15104   echo "$ac_t""yes" 1>&6
15105   have_termcap=yes
15106 else
15107   echo "$ac_t""no" 1>&6
15108 have_termcap=no
15109 fi
15110
15111         if test $have_termcap = yes ; then
15112                 cat >> confdefs.h <<\EOF
15113 #define HAVE_TERMCAP 1
15114 EOF
15115
15116                 ol_link_termcap=yes
15117                 TERMCAP_LIBS=-ltermcap
15118         fi
15119 fi
15120
15121 if test $ol_link_termcap = no ; then
15122         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
15123 echo "configure:15124: checking for initscr in -lncurses" >&5
15124 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
15125 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15126   echo $ac_n "(cached) $ac_c" 1>&6
15127 else
15128   ac_save_LIBS="$LIBS"
15129 LIBS="-lncurses  $LIBS"
15130 cat > conftest.$ac_ext <<EOF
15131 #line 15132 "configure"
15132 #include "confdefs.h"
15133 /* Override any gcc2 internal prototype to avoid an error.  */
15134 /* We use char because int might match the return type of a gcc2
15135     builtin and then its argument prototype would still apply.  */
15136 char initscr();
15137
15138 int main() {
15139 initscr()
15140 ; return 0; }
15141 EOF
15142 if { (eval echo configure:15143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15143   rm -rf conftest*
15144   eval "ac_cv_lib_$ac_lib_var=yes"
15145 else
15146   echo "configure: failed program was:" >&5
15147   cat conftest.$ac_ext >&5
15148   rm -rf conftest*
15149   eval "ac_cv_lib_$ac_lib_var=no"
15150 fi
15151 rm -f conftest*
15152 LIBS="$ac_save_LIBS"
15153
15154 fi
15155 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15156   echo "$ac_t""yes" 1>&6
15157   have_ncurses=yes
15158 else
15159   echo "$ac_t""no" 1>&6
15160 have_ncurses=no
15161 fi
15162
15163         if test $have_ncurses = yes ; then
15164                 cat >> confdefs.h <<\EOF
15165 #define HAVE_NCURSES 1
15166 EOF
15167
15168                 ol_link_termcap=yes
15169                 TERMCAP_LIBS=-lncurses
15170         fi
15171 fi
15172
15173 if test $ol_link_termcap = no ; then
15174         cat >> confdefs.h <<\EOF
15175 #define NO_TERMCAP 1
15176 EOF
15177
15178         TERMCAP_LIBS=
15179 fi
15180
15181 ol_link_sasl=no
15182 ol_link_spasswd=no
15183 if test $ol_with_cyrus_sasl != no ; then
15184         for ac_hdr in sasl.h
15185 do
15186 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15187 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15188 echo "configure:15189: checking for $ac_hdr" >&5
15189 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15190   echo $ac_n "(cached) $ac_c" 1>&6
15191 else
15192   cat > conftest.$ac_ext <<EOF
15193 #line 15194 "configure"
15194 #include "confdefs.h"
15195 #include <$ac_hdr>
15196 EOF
15197 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15198 { (eval echo configure:15199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15199 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15200 if test -z "$ac_err"; then
15201   rm -rf conftest*
15202   eval "ac_cv_header_$ac_safe=yes"
15203 else
15204   echo "$ac_err" >&5
15205   echo "configure: failed program was:" >&5
15206   cat conftest.$ac_ext >&5
15207   rm -rf conftest*
15208   eval "ac_cv_header_$ac_safe=no"
15209 fi
15210 rm -f conftest*
15211 fi
15212 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15213   echo "$ac_t""yes" 1>&6
15214     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15215   cat >> confdefs.h <<EOF
15216 #define $ac_tr_hdr 1
15217 EOF
15218  
15219 else
15220   echo "$ac_t""no" 1>&6
15221 fi
15222 done
15223
15224
15225         if test $ac_cv_header_sasl_h = yes ; then
15226                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
15227 echo "configure:15228: checking for sasl_client_init in -lsasl" >&5
15228 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
15229 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15230   echo $ac_n "(cached) $ac_c" 1>&6
15231 else
15232   ac_save_LIBS="$LIBS"
15233 LIBS="-lsasl  $LIBS"
15234 cat > conftest.$ac_ext <<EOF
15235 #line 15236 "configure"
15236 #include "confdefs.h"
15237 /* Override any gcc2 internal prototype to avoid an error.  */
15238 /* We use char because int might match the return type of a gcc2
15239     builtin and then its argument prototype would still apply.  */
15240 char sasl_client_init();
15241
15242 int main() {
15243 sasl_client_init()
15244 ; return 0; }
15245 EOF
15246 if { (eval echo configure:15247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15247   rm -rf conftest*
15248   eval "ac_cv_lib_$ac_lib_var=yes"
15249 else
15250   echo "configure: failed program was:" >&5
15251   cat conftest.$ac_ext >&5
15252   rm -rf conftest*
15253   eval "ac_cv_lib_$ac_lib_var=no"
15254 fi
15255 rm -f conftest*
15256 LIBS="$ac_save_LIBS"
15257
15258 fi
15259 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15260   echo "$ac_t""yes" 1>&6
15261   have_cyrus_sasl=yes
15262 else
15263   echo "$ac_t""no" 1>&6
15264 have_cyrus_sasl=no
15265 fi
15266
15267
15268                 if test $have_cyrus_sasl != no ; then
15269                         SASL_LIBS="-lsasl"
15270                         cat >> confdefs.h <<\EOF
15271 #define HAVE_CYRUS_SASL 1
15272 EOF
15273
15274                         ol_link_sasl=yes
15275                 fi
15276         fi
15277
15278         if test $ol_link_sasl = no ; then
15279                 if test $ol_with_cyrus_sasl != auto ; then
15280                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15281                 else
15282                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15283                         echo "configure: warning: SASL authentication not supported!" 1>&2
15284                         if test $ol_link_tls = no ; then
15285                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15286                         fi
15287                 fi
15288
15289         elif test $ol_enable_spasswd != no ; then
15290                 ol_link_spasswd=yes
15291         fi
15292
15293 else
15294         echo "configure: warning: SASL authentication not supported!" 1>&2
15295         if test $ol_link_tls = no ; then
15296                 echo "configure: warning: Strong authentication not supported!" 1>&2
15297         fi
15298 fi
15299
15300 if test $cross_compiling != yes ; then
15301         dev=no
15302         if test -r /dev/urandom ; then
15303                 dev="/dev/urandom";
15304         elif test -r /idev/urandom ; then
15305                 dev="/idev/urandom";
15306         elif test -r /dev/srandom ; then
15307                 dev="/dev/srandom";
15308         elif test -r /dev/random ; then
15309                 dev="/dev/random";
15310         elif test -r /idev/random ; then
15311                 dev="/idev/random";
15312         fi
15313
15314         if test $dev != no ; then
15315                 cat >> confdefs.h <<EOF
15316 #define URANDOM_DEVICE "$dev"
15317 EOF
15318
15319         fi
15320 fi
15321
15322 ol_link_fetch=no
15323 if test $ol_with_fetch != no ; then
15324         ol_LIBS=$LIBS
15325 LIBS="-lfetch -lcom_err $LIBS"
15326 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15327 echo "configure:15328: checking fetch(3) library" >&5
15328 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15329   echo $ac_n "(cached) $ac_c" 1>&6
15330 else
15331   
15332         cat > conftest.$ac_ext <<EOF
15333 #line 15334 "configure"
15334 #include "confdefs.h"
15335
15336 #include <sys/param.h>
15337 #include <stdio.h>
15338 #include <fetch.h>
15339 int main() {
15340 struct url *u = fetchParseURL("file:///"); 
15341 ; return 0; }
15342 EOF
15343 if { (eval echo configure:15344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15344   rm -rf conftest*
15345   ol_cv_lib_fetch=yes
15346 else
15347   echo "configure: failed program was:" >&5
15348   cat conftest.$ac_ext >&5
15349   rm -rf conftest*
15350   ol_cv_lib_fetch=no
15351 fi
15352 rm -f conftest*
15353 fi
15354
15355 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15356 LIBS=$ol_LIBS
15357 if test $ol_cv_lib_fetch != no ; then
15358         ol_link_fetch="-lfetch -lcom_err"
15359         cat >> confdefs.h <<\EOF
15360 #define HAVE_FETCH 1
15361 EOF
15362
15363 fi
15364
15365
15366         if test $ol_cv_lib_fetch != no ; then
15367                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15368                 ol_link_fetch=freebsd
15369
15370         elif test $ol_with_fetch != auto ; then
15371                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15372         fi 
15373 fi
15374
15375 ol_link_readline=no
15376 if test $ol_with_readline != no ; then
15377         for ac_hdr in readline/readline.h readline/history.h
15378 do
15379 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15380 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15381 echo "configure:15382: checking for $ac_hdr" >&5
15382 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15383   echo $ac_n "(cached) $ac_c" 1>&6
15384 else
15385   cat > conftest.$ac_ext <<EOF
15386 #line 15387 "configure"
15387 #include "confdefs.h"
15388 #include <$ac_hdr>
15389 EOF
15390 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15391 { (eval echo configure:15392: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15392 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15393 if test -z "$ac_err"; then
15394   rm -rf conftest*
15395   eval "ac_cv_header_$ac_safe=yes"
15396 else
15397   echo "$ac_err" >&5
15398   echo "configure: failed program was:" >&5
15399   cat conftest.$ac_ext >&5
15400   rm -rf conftest*
15401   eval "ac_cv_header_$ac_safe=no"
15402 fi
15403 rm -f conftest*
15404 fi
15405 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15406   echo "$ac_t""yes" 1>&6
15407     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15408   cat >> confdefs.h <<EOF
15409 #define $ac_tr_hdr 1
15410 EOF
15411  
15412 else
15413   echo "$ac_t""no" 1>&6
15414 fi
15415 done
15416
15417
15418         if test $ac_cv_header_readline_readline_h = yes ; then
15419                 save_LIBS="$LIBS"
15420                 LIBS="$TERMCAP_LIBS $LIBS"
15421                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15422 echo "configure:15423: checking for readline in -lreadline" >&5
15423 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15424 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15425   echo $ac_n "(cached) $ac_c" 1>&6
15426 else
15427   ac_save_LIBS="$LIBS"
15428 LIBS="-lreadline  $LIBS"
15429 cat > conftest.$ac_ext <<EOF
15430 #line 15431 "configure"
15431 #include "confdefs.h"
15432 /* Override any gcc2 internal prototype to avoid an error.  */
15433 /* We use char because int might match the return type of a gcc2
15434     builtin and then its argument prototype would still apply.  */
15435 char readline();
15436
15437 int main() {
15438 readline()
15439 ; return 0; }
15440 EOF
15441 if { (eval echo configure:15442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15442   rm -rf conftest*
15443   eval "ac_cv_lib_$ac_lib_var=yes"
15444 else
15445   echo "configure: failed program was:" >&5
15446   cat conftest.$ac_ext >&5
15447   rm -rf conftest*
15448   eval "ac_cv_lib_$ac_lib_var=no"
15449 fi
15450 rm -f conftest*
15451 LIBS="$ac_save_LIBS"
15452
15453 fi
15454 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15455   echo "$ac_t""yes" 1>&6
15456   have_readline=yes
15457 else
15458   echo "$ac_t""no" 1>&6
15459 have_readline=no
15460 fi
15461
15462                 LIBS="$save_LIBS"
15463                         
15464                 if test $have_readline = yes ; then
15465                         ol_with_readline=found
15466                         ol_link_readline=yes
15467
15468                         READLINE_LIBS="-lreadline"
15469                 fi
15470         fi
15471 fi
15472
15473 if test $ol_link_readline = yes ; then
15474         cat >> confdefs.h <<\EOF
15475 #define HAVE_READLINE 1
15476 EOF
15477
15478 fi
15479
15480
15481 if test $ol_enable_crypt != no ; then
15482         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15483 echo "configure:15484: checking for crypt" >&5
15484 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15485   echo $ac_n "(cached) $ac_c" 1>&6
15486 else
15487   cat > conftest.$ac_ext <<EOF
15488 #line 15489 "configure"
15489 #include "confdefs.h"
15490 /* System header to define __stub macros and hopefully few prototypes,
15491     which can conflict with char crypt(); below.  */
15492 #include <assert.h>
15493 /* Override any gcc2 internal prototype to avoid an error.  */
15494 /* We use char because int might match the return type of a gcc2
15495     builtin and then its argument prototype would still apply.  */
15496 char crypt();
15497 char (*f)();
15498
15499 int main() {
15500
15501 /* The GNU C library defines this for functions which it implements
15502     to always fail with ENOSYS.  Some functions are actually named
15503     something starting with __ and the normal name is an alias.  */
15504 #if defined (__stub_crypt) || defined (__stub___crypt)
15505 choke me
15506 #else
15507 f = crypt;
15508 #endif
15509
15510 ; return 0; }
15511 EOF
15512 if { (eval echo configure:15513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15513   rm -rf conftest*
15514   eval "ac_cv_func_crypt=yes"
15515 else
15516   echo "configure: failed program was:" >&5
15517   cat conftest.$ac_ext >&5
15518   rm -rf conftest*
15519   eval "ac_cv_func_crypt=no"
15520 fi
15521 rm -f conftest*
15522 fi
15523
15524 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15525   echo "$ac_t""yes" 1>&6
15526   have_crypt=yes
15527 else
15528   echo "$ac_t""no" 1>&6
15529
15530                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15531 echo "configure:15532: checking for crypt in -lcrypt" >&5
15532 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15533 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15534   echo $ac_n "(cached) $ac_c" 1>&6
15535 else
15536   ac_save_LIBS="$LIBS"
15537 LIBS="-lcrypt  $LIBS"
15538 cat > conftest.$ac_ext <<EOF
15539 #line 15540 "configure"
15540 #include "confdefs.h"
15541 /* Override any gcc2 internal prototype to avoid an error.  */
15542 /* We use char because int might match the return type of a gcc2
15543     builtin and then its argument prototype would still apply.  */
15544 char crypt();
15545
15546 int main() {
15547 crypt()
15548 ; return 0; }
15549 EOF
15550 if { (eval echo configure:15551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15551   rm -rf conftest*
15552   eval "ac_cv_lib_$ac_lib_var=yes"
15553 else
15554   echo "configure: failed program was:" >&5
15555   cat conftest.$ac_ext >&5
15556   rm -rf conftest*
15557   eval "ac_cv_lib_$ac_lib_var=no"
15558 fi
15559 rm -f conftest*
15560 LIBS="$ac_save_LIBS"
15561
15562 fi
15563 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15564   echo "$ac_t""yes" 1>&6
15565   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15566                         have_crypt=yes
15567 else
15568   echo "$ac_t""no" 1>&6
15569 have_crypt=no
15570 fi
15571
15572 fi
15573
15574
15575         if test $have_crypt = yes ; then
15576                 cat >> confdefs.h <<\EOF
15577 #define HAVE_CRYPT 1
15578 EOF
15579
15580         else
15581                 echo "configure: warning: could not find crypt" 1>&2
15582                 if test $ol_enable_crypt = yes ; then
15583                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15584                 fi
15585
15586                 echo "configure: warning: disabling crypt support" 1>&2
15587                 ol_enable_crypt=no
15588         fi
15589 fi
15590
15591 if test $ol_enable_proctitle != no ; then
15592         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15593 echo "configure:15594: checking for setproctitle" >&5
15594 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15595   echo $ac_n "(cached) $ac_c" 1>&6
15596 else
15597   cat > conftest.$ac_ext <<EOF
15598 #line 15599 "configure"
15599 #include "confdefs.h"
15600 /* System header to define __stub macros and hopefully few prototypes,
15601     which can conflict with char setproctitle(); below.  */
15602 #include <assert.h>
15603 /* Override any gcc2 internal prototype to avoid an error.  */
15604 /* We use char because int might match the return type of a gcc2
15605     builtin and then its argument prototype would still apply.  */
15606 char setproctitle();
15607 char (*f)();
15608
15609 int main() {
15610
15611 /* The GNU C library defines this for functions which it implements
15612     to always fail with ENOSYS.  Some functions are actually named
15613     something starting with __ and the normal name is an alias.  */
15614 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15615 choke me
15616 #else
15617 f = setproctitle;
15618 #endif
15619
15620 ; return 0; }
15621 EOF
15622 if { (eval echo configure:15623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15623   rm -rf conftest*
15624   eval "ac_cv_func_setproctitle=yes"
15625 else
15626   echo "configure: failed program was:" >&5
15627   cat conftest.$ac_ext >&5
15628   rm -rf conftest*
15629   eval "ac_cv_func_setproctitle=no"
15630 fi
15631 rm -f conftest*
15632 fi
15633
15634 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15635   echo "$ac_t""yes" 1>&6
15636   have_setproctitle=yes
15637 else
15638   echo "$ac_t""no" 1>&6
15639
15640                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15641 echo "configure:15642: checking for setproctitle in -lutil" >&5
15642 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15643 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15644   echo $ac_n "(cached) $ac_c" 1>&6
15645 else
15646   ac_save_LIBS="$LIBS"
15647 LIBS="-lutil  $LIBS"
15648 cat > conftest.$ac_ext <<EOF
15649 #line 15650 "configure"
15650 #include "confdefs.h"
15651 /* Override any gcc2 internal prototype to avoid an error.  */
15652 /* We use char because int might match the return type of a gcc2
15653     builtin and then its argument prototype would still apply.  */
15654 char setproctitle();
15655
15656 int main() {
15657 setproctitle()
15658 ; return 0; }
15659 EOF
15660 if { (eval echo configure:15661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15661   rm -rf conftest*
15662   eval "ac_cv_lib_$ac_lib_var=yes"
15663 else
15664   echo "configure: failed program was:" >&5
15665   cat conftest.$ac_ext >&5
15666   rm -rf conftest*
15667   eval "ac_cv_lib_$ac_lib_var=no"
15668 fi
15669 rm -f conftest*
15670 LIBS="$ac_save_LIBS"
15671
15672 fi
15673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15674   echo "$ac_t""yes" 1>&6
15675   have_setproctitle=yes
15676                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15677 else
15678   echo "$ac_t""no" 1>&6
15679 have_setproctitle=no
15680                         LIBOBJS="$LIBOBJS setproctitle.o"
15681                         LIBSRCS="$LIBSRCS setproctitle.c"
15682 fi
15683
15684 fi
15685
15686
15687         if test $have_setproctitle = yes ; then
15688                 cat >> confdefs.h <<\EOF
15689 #define HAVE_SETPROCTITLE 1
15690 EOF
15691
15692         fi
15693 fi
15694
15695 if test $ol_enable_slp != no ; then
15696         for ac_hdr in slp.h 
15697 do
15698 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15699 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15700 echo "configure:15701: checking for $ac_hdr" >&5
15701 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15702   echo $ac_n "(cached) $ac_c" 1>&6
15703 else
15704   cat > conftest.$ac_ext <<EOF
15705 #line 15706 "configure"
15706 #include "confdefs.h"
15707 #include <$ac_hdr>
15708 EOF
15709 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15710 { (eval echo configure:15711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15711 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15712 if test -z "$ac_err"; then
15713   rm -rf conftest*
15714   eval "ac_cv_header_$ac_safe=yes"
15715 else
15716   echo "$ac_err" >&5
15717   echo "configure: failed program was:" >&5
15718   cat conftest.$ac_ext >&5
15719   rm -rf conftest*
15720   eval "ac_cv_header_$ac_safe=no"
15721 fi
15722 rm -f conftest*
15723 fi
15724 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15725   echo "$ac_t""yes" 1>&6
15726     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15727   cat >> confdefs.h <<EOF
15728 #define $ac_tr_hdr 1
15729 EOF
15730  
15731 else
15732   echo "$ac_t""no" 1>&6
15733 fi
15734 done
15735
15736
15737         if test $ac_cv_header_slp_h = yes ; then
15738                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15739 echo "configure:15740: checking for SLPOpen in -lslp" >&5
15740 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15741 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15742   echo $ac_n "(cached) $ac_c" 1>&6
15743 else
15744   ac_save_LIBS="$LIBS"
15745 LIBS="-lslp  $LIBS"
15746 cat > conftest.$ac_ext <<EOF
15747 #line 15748 "configure"
15748 #include "confdefs.h"
15749 /* Override any gcc2 internal prototype to avoid an error.  */
15750 /* We use char because int might match the return type of a gcc2
15751     builtin and then its argument prototype would still apply.  */
15752 char SLPOpen();
15753
15754 int main() {
15755 SLPOpen()
15756 ; return 0; }
15757 EOF
15758 if { (eval echo configure:15759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15759   rm -rf conftest*
15760   eval "ac_cv_lib_$ac_lib_var=yes"
15761 else
15762   echo "configure: failed program was:" >&5
15763   cat conftest.$ac_ext >&5
15764   rm -rf conftest*
15765   eval "ac_cv_lib_$ac_lib_var=no"
15766 fi
15767 rm -f conftest*
15768 LIBS="$ac_save_LIBS"
15769
15770 fi
15771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15772   echo "$ac_t""yes" 1>&6
15773   have_slp=yes
15774 else
15775   echo "$ac_t""no" 1>&6
15776 have_slp=no
15777 fi
15778
15779                 if test $have_slp = yes ; then
15780                         cat >> confdefs.h <<\EOF
15781 #define HAVE_SLP 1
15782 EOF
15783
15784                         SLAPD_SLP_LIBS=-lslp
15785                 fi
15786
15787         elif test $ol_enable_slp = yes ; then
15788                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15789         fi
15790 fi
15791
15792 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15793 echo "configure:15794: checking for ANSI C header files" >&5
15794 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15795   echo $ac_n "(cached) $ac_c" 1>&6
15796 else
15797   cat > conftest.$ac_ext <<EOF
15798 #line 15799 "configure"
15799 #include "confdefs.h"
15800 #include <stdlib.h>
15801 #include <stdarg.h>
15802 #include <string.h>
15803 #include <float.h>
15804 EOF
15805 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15806 { (eval echo configure:15807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15807 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15808 if test -z "$ac_err"; then
15809   rm -rf conftest*
15810   ac_cv_header_stdc=yes
15811 else
15812   echo "$ac_err" >&5
15813   echo "configure: failed program was:" >&5
15814   cat conftest.$ac_ext >&5
15815   rm -rf conftest*
15816   ac_cv_header_stdc=no
15817 fi
15818 rm -f conftest*
15819
15820 if test $ac_cv_header_stdc = yes; then
15821   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15822 cat > conftest.$ac_ext <<EOF
15823 #line 15824 "configure"
15824 #include "confdefs.h"
15825 #include <string.h>
15826 EOF
15827 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15828   egrep "memchr" >/dev/null 2>&1; then
15829   :
15830 else
15831   rm -rf conftest*
15832   ac_cv_header_stdc=no
15833 fi
15834 rm -f conftest*
15835
15836 fi
15837
15838 if test $ac_cv_header_stdc = yes; then
15839   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15840 cat > conftest.$ac_ext <<EOF
15841 #line 15842 "configure"
15842 #include "confdefs.h"
15843 #include <stdlib.h>
15844 EOF
15845 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15846   egrep "free" >/dev/null 2>&1; then
15847   :
15848 else
15849   rm -rf conftest*
15850   ac_cv_header_stdc=no
15851 fi
15852 rm -f conftest*
15853
15854 fi
15855
15856 if test $ac_cv_header_stdc = yes; then
15857   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15858 if test "$cross_compiling" = yes; then
15859   :
15860 else
15861   cat > conftest.$ac_ext <<EOF
15862 #line 15863 "configure"
15863 #include "confdefs.h"
15864 #include <ctype.h>
15865 #if ((' ' & 0x0FF) == 0x020)
15866 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15867 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15868 #else
15869 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15870  || ('j' <= (c) && (c) <= 'r') \
15871  || ('s' <= (c) && (c) <= 'z'))
15872 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15873 #endif
15874 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15875 int main () { int i; for (i = 0; i < 256; i++)
15876 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15877 exit (0); }
15878
15879 EOF
15880 if { (eval echo configure:15881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15881 then
15882   :
15883 else
15884   echo "configure: failed program was:" >&5
15885   cat conftest.$ac_ext >&5
15886   rm -fr conftest*
15887   ac_cv_header_stdc=no
15888 fi
15889 rm -fr conftest*
15890 fi
15891
15892 fi
15893 fi
15894
15895 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15896 if test $ac_cv_header_stdc = yes; then
15897   cat >> confdefs.h <<\EOF
15898 #define STDC_HEADERS 1
15899 EOF
15900
15901 fi
15902
15903 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15904 echo "configure:15905: checking for mode_t" >&5
15905 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15906   echo $ac_n "(cached) $ac_c" 1>&6
15907 else
15908   cat > conftest.$ac_ext <<EOF
15909 #line 15910 "configure"
15910 #include "confdefs.h"
15911 #include <sys/types.h>
15912 #if STDC_HEADERS
15913 #include <stdlib.h>
15914 #include <stddef.h>
15915 #endif
15916
15917 EOF
15918 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15919   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15920   rm -rf conftest*
15921   eval "ac_cv_type_mode_t=yes"
15922 else
15923   rm -rf conftest*
15924   eval "ac_cv_type_mode_t=no"
15925 fi
15926 rm -f conftest*
15927
15928 fi
15929 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15930   echo "$ac_t""yes" 1>&6
15931 else
15932   echo "$ac_t""no" 1>&6
15933   cat >> confdefs.h <<EOF
15934 #define mode_t int
15935 EOF
15936
15937 fi
15938
15939 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15940 echo "configure:15941: checking for off_t" >&5
15941 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15942   echo $ac_n "(cached) $ac_c" 1>&6
15943 else
15944   cat > conftest.$ac_ext <<EOF
15945 #line 15946 "configure"
15946 #include "confdefs.h"
15947 #include <sys/types.h>
15948 #if STDC_HEADERS
15949 #include <stdlib.h>
15950 #include <stddef.h>
15951 #endif
15952
15953 EOF
15954 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15955   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15956   rm -rf conftest*
15957   eval "ac_cv_type_off_t=yes"
15958 else
15959   rm -rf conftest*
15960   eval "ac_cv_type_off_t=no"
15961 fi
15962 rm -f conftest*
15963
15964 fi
15965 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15966   echo "$ac_t""yes" 1>&6
15967 else
15968   echo "$ac_t""no" 1>&6
15969   cat >> confdefs.h <<EOF
15970 #define off_t long
15971 EOF
15972
15973 fi
15974
15975 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15976 echo "configure:15977: checking for pid_t" >&5
15977 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15978   echo $ac_n "(cached) $ac_c" 1>&6
15979 else
15980   cat > conftest.$ac_ext <<EOF
15981 #line 15982 "configure"
15982 #include "confdefs.h"
15983 #include <sys/types.h>
15984 #if STDC_HEADERS
15985 #include <stdlib.h>
15986 #include <stddef.h>
15987 #endif
15988
15989 EOF
15990 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15991   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15992   rm -rf conftest*
15993   eval "ac_cv_type_pid_t=yes"
15994 else
15995   rm -rf conftest*
15996   eval "ac_cv_type_pid_t=no"
15997 fi
15998 rm -f conftest*
15999
16000 fi
16001 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
16002   echo "$ac_t""yes" 1>&6
16003 else
16004   echo "$ac_t""no" 1>&6
16005   cat >> confdefs.h <<EOF
16006 #define pid_t int
16007 EOF
16008
16009 fi
16010
16011 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
16012 echo "configure:16013: checking for ptrdiff_t" >&5
16013 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
16014   echo $ac_n "(cached) $ac_c" 1>&6
16015 else
16016   cat > conftest.$ac_ext <<EOF
16017 #line 16018 "configure"
16018 #include "confdefs.h"
16019 #include <stddef.h>
16020 int main() {
16021 ptrdiff_t p
16022 ; return 0; }
16023 EOF
16024 if { (eval echo configure:16025: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16025   rm -rf conftest*
16026   am_cv_type_ptrdiff_t=yes
16027 else
16028   echo "configure: failed program was:" >&5
16029   cat conftest.$ac_ext >&5
16030   rm -rf conftest*
16031   am_cv_type_ptrdiff_t=no
16032 fi
16033 rm -f conftest*
16034 fi
16035
16036 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
16037    if test $am_cv_type_ptrdiff_t = yes; then
16038      cat >> confdefs.h <<\EOF
16039 #define HAVE_PTRDIFF_T 1
16040 EOF
16041
16042    fi
16043
16044 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
16045 echo "configure:16046: checking return type of signal handlers" >&5
16046 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
16047   echo $ac_n "(cached) $ac_c" 1>&6
16048 else
16049   cat > conftest.$ac_ext <<EOF
16050 #line 16051 "configure"
16051 #include "confdefs.h"
16052 #include <sys/types.h>
16053 #include <signal.h>
16054 #ifdef signal
16055 #undef signal
16056 #endif
16057 #ifdef __cplusplus
16058 extern "C" void (*signal (int, void (*)(int)))(int);
16059 #else
16060 void (*signal ()) ();
16061 #endif
16062
16063 int main() {
16064 int i;
16065 ; return 0; }
16066 EOF
16067 if { (eval echo configure:16068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16068   rm -rf conftest*
16069   ac_cv_type_signal=void
16070 else
16071   echo "configure: failed program was:" >&5
16072   cat conftest.$ac_ext >&5
16073   rm -rf conftest*
16074   ac_cv_type_signal=int
16075 fi
16076 rm -f conftest*
16077 fi
16078
16079 echo "$ac_t""$ac_cv_type_signal" 1>&6
16080 cat >> confdefs.h <<EOF
16081 #define RETSIGTYPE $ac_cv_type_signal
16082 EOF
16083
16084
16085 echo $ac_n "checking for size_t""... $ac_c" 1>&6
16086 echo "configure:16087: checking for size_t" >&5
16087 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
16088   echo $ac_n "(cached) $ac_c" 1>&6
16089 else
16090   cat > conftest.$ac_ext <<EOF
16091 #line 16092 "configure"
16092 #include "confdefs.h"
16093 #include <sys/types.h>
16094 #if STDC_HEADERS
16095 #include <stdlib.h>
16096 #include <stddef.h>
16097 #endif
16098
16099 EOF
16100 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16101   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16102   rm -rf conftest*
16103   eval "ac_cv_type_size_t=yes"
16104 else
16105   rm -rf conftest*
16106   eval "ac_cv_type_size_t=no"
16107 fi
16108 rm -f conftest*
16109
16110 fi
16111 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
16112   echo "$ac_t""yes" 1>&6
16113 else
16114   echo "$ac_t""no" 1>&6
16115   cat >> confdefs.h <<EOF
16116 #define size_t unsigned
16117 EOF
16118
16119 fi
16120
16121
16122 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
16123 echo "configure:16124: checking for ssize_t" >&5
16124 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
16125   echo $ac_n "(cached) $ac_c" 1>&6
16126 else
16127   cat > conftest.$ac_ext <<EOF
16128 #line 16129 "configure"
16129 #include "confdefs.h"
16130 #include <sys/types.h>
16131 #if STDC_HEADERS
16132 #include <stdlib.h>
16133 #include <stddef.h>
16134 #endif
16135
16136 EOF
16137 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16138   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16139   rm -rf conftest*
16140   eval "ac_cv_type_ssize_t=yes"
16141 else
16142   rm -rf conftest*
16143   eval "ac_cv_type_ssize_t=no"
16144 fi
16145 rm -f conftest*
16146
16147 fi
16148 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
16149   echo "$ac_t""yes" 1>&6
16150 else
16151   echo "$ac_t""no" 1>&6
16152   cat >> confdefs.h <<EOF
16153 #define ssize_t signed int
16154 EOF
16155
16156 fi
16157
16158 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
16159 echo "configure:16160: checking for caddr_t" >&5
16160 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
16161   echo $ac_n "(cached) $ac_c" 1>&6
16162 else
16163   cat > conftest.$ac_ext <<EOF
16164 #line 16165 "configure"
16165 #include "confdefs.h"
16166 #include <sys/types.h>
16167 #if STDC_HEADERS
16168 #include <stdlib.h>
16169 #include <stddef.h>
16170 #endif
16171
16172 EOF
16173 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16174   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
16175   rm -rf conftest*
16176   eval "ac_cv_type_caddr_t=yes"
16177 else
16178   rm -rf conftest*
16179   eval "ac_cv_type_caddr_t=no"
16180 fi
16181 rm -f conftest*
16182
16183 fi
16184 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
16185   echo "$ac_t""yes" 1>&6
16186 else
16187   echo "$ac_t""no" 1>&6
16188   cat >> confdefs.h <<EOF
16189 #define caddr_t char *
16190 EOF
16191
16192 fi
16193
16194
16195 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
16196 echo "configure:16197: checking for socklen_t" >&5
16197 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
16198   echo $ac_n "(cached) $ac_c" 1>&6
16199 else
16200   cat > conftest.$ac_ext <<EOF
16201 #line 16202 "configure"
16202 #include "confdefs.h"
16203
16204 #ifdef HAVE_SYS_TYPES_H
16205 #include <sys/types.h>
16206 #endif
16207 #ifdef HAVE_SYS_SOCKET_H
16208 #include <sys/socket.h>
16209 #endif
16210
16211 int main() {
16212 socklen_t len;
16213 ; return 0; }
16214 EOF
16215 if { (eval echo configure:16216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16216   rm -rf conftest*
16217   ol_cv_type_socklen_t=yes
16218 else
16219   echo "configure: failed program was:" >&5
16220   cat conftest.$ac_ext >&5
16221   rm -rf conftest*
16222   ol_cv_type_socklen_t=no
16223 fi
16224 rm -f conftest*
16225 fi
16226
16227 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
16228   if test $ol_cv_type_socklen_t = no; then
16229     cat >> confdefs.h <<\EOF
16230 #define socklen_t int
16231 EOF
16232
16233   fi
16234  
16235 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
16236 echo "configure:16237: checking for member st_blksize in aggregate type struct stat" >&5
16237 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
16238   echo $ac_n "(cached) $ac_c" 1>&6
16239 else
16240   cat > conftest.$ac_ext <<EOF
16241 #line 16242 "configure"
16242 #include "confdefs.h"
16243 #include <sys/types.h>
16244 #include <sys/stat.h>
16245 int main() {
16246 struct stat foo; foo.st_blksize;
16247 ; return 0; }
16248 EOF
16249 if { (eval echo configure:16250: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16250   rm -rf conftest*
16251   ac_cv_c_struct_member_st_blksize=yes
16252 else
16253   echo "configure: failed program was:" >&5
16254   cat conftest.$ac_ext >&5
16255   rm -rf conftest*
16256   ac_cv_c_struct_member_st_blksize=no
16257 fi
16258 rm -f conftest*
16259 fi
16260
16261 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16262 st_blksize="$ac_cv_c_struct_member_st_blksize"
16263 if test $ac_cv_c_struct_member_st_blksize = yes; then
16264   cat >> confdefs.h <<\EOF
16265 #define HAVE_ST_BLKSIZE 1
16266 EOF
16267
16268 fi
16269
16270 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16271 echo "configure:16272: checking whether time.h and sys/time.h may both be included" >&5
16272 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16273   echo $ac_n "(cached) $ac_c" 1>&6
16274 else
16275   cat > conftest.$ac_ext <<EOF
16276 #line 16277 "configure"
16277 #include "confdefs.h"
16278 #include <sys/types.h>
16279 #include <sys/time.h>
16280 #include <time.h>
16281 int main() {
16282 struct tm *tp;
16283 ; return 0; }
16284 EOF
16285 if { (eval echo configure:16286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16286   rm -rf conftest*
16287   ac_cv_header_time=yes
16288 else
16289   echo "configure: failed program was:" >&5
16290   cat conftest.$ac_ext >&5
16291   rm -rf conftest*
16292   ac_cv_header_time=no
16293 fi
16294 rm -f conftest*
16295 fi
16296
16297 echo "$ac_t""$ac_cv_header_time" 1>&6
16298 if test $ac_cv_header_time = yes; then
16299   cat >> confdefs.h <<\EOF
16300 #define TIME_WITH_SYS_TIME 1
16301 EOF
16302
16303 fi
16304
16305 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16306 echo "configure:16307: checking whether struct tm is in sys/time.h or time.h" >&5
16307 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16308   echo $ac_n "(cached) $ac_c" 1>&6
16309 else
16310   cat > conftest.$ac_ext <<EOF
16311 #line 16312 "configure"
16312 #include "confdefs.h"
16313 #include <sys/types.h>
16314 #include <time.h>
16315 int main() {
16316 struct tm *tp; tp->tm_sec;
16317 ; return 0; }
16318 EOF
16319 if { (eval echo configure:16320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16320   rm -rf conftest*
16321   ac_cv_struct_tm=time.h
16322 else
16323   echo "configure: failed program was:" >&5
16324   cat conftest.$ac_ext >&5
16325   rm -rf conftest*
16326   ac_cv_struct_tm=sys/time.h
16327 fi
16328 rm -f conftest*
16329 fi
16330
16331 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16332 if test $ac_cv_struct_tm = sys/time.h; then
16333   cat >> confdefs.h <<\EOF
16334 #define TM_IN_SYS_TIME 1
16335 EOF
16336
16337 fi
16338
16339 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16340 echo "configure:16341: checking for uid_t in sys/types.h" >&5
16341 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16342   echo $ac_n "(cached) $ac_c" 1>&6
16343 else
16344   cat > conftest.$ac_ext <<EOF
16345 #line 16346 "configure"
16346 #include "confdefs.h"
16347 #include <sys/types.h>
16348 EOF
16349 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16350   egrep "uid_t" >/dev/null 2>&1; then
16351   rm -rf conftest*
16352   ac_cv_type_uid_t=yes
16353 else
16354   rm -rf conftest*
16355   ac_cv_type_uid_t=no
16356 fi
16357 rm -f conftest*
16358
16359 fi
16360
16361 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16362 if test $ac_cv_type_uid_t = no; then
16363   cat >> confdefs.h <<\EOF
16364 #define uid_t int
16365 EOF
16366
16367   cat >> confdefs.h <<\EOF
16368 #define gid_t int
16369 EOF
16370
16371 fi
16372
16373 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16374 echo "configure:16375: checking for sig_atomic_t" >&5
16375 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16376   echo $ac_n "(cached) $ac_c" 1>&6
16377 else
16378   cat > conftest.$ac_ext <<EOF
16379 #line 16380 "configure"
16380 #include "confdefs.h"
16381 #include <signal.h>
16382 int main() {
16383 sig_atomic_t atomic;
16384 ; return 0; }
16385 EOF
16386 if { (eval echo configure:16387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16387   rm -rf conftest*
16388   ol_cv_type_sig_atomic_t=yes
16389 else
16390   echo "configure: failed program was:" >&5
16391   cat conftest.$ac_ext >&5
16392   rm -rf conftest*
16393   ol_cv_type_sig_atomic_t=no
16394 fi
16395 rm -f conftest*
16396 fi
16397
16398 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16399   if test $ol_cv_type_sig_atomic_t = no; then
16400     cat >> confdefs.h <<\EOF
16401 #define sig_atomic_t int
16402 EOF
16403
16404   fi
16405  
16406
16407
16408 # test for pw_gecos in struct passwd
16409 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16410 echo "configure:16411: checking struct passwd for pw_gecos" >&5
16411 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16412   echo $ac_n "(cached) $ac_c" 1>&6
16413 else
16414   
16415         cat > conftest.$ac_ext <<EOF
16416 #line 16417 "configure"
16417 #include "confdefs.h"
16418 #include <pwd.h>
16419 int main() {
16420
16421         struct passwd pwd;
16422         pwd.pw_gecos = pwd.pw_name;
16423
16424 ; return 0; }
16425 EOF
16426 if { (eval echo configure:16427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16427   rm -rf conftest*
16428   ol_cv_struct_passwd_pw_gecos=yes
16429 else
16430   echo "configure: failed program was:" >&5
16431   cat conftest.$ac_ext >&5
16432   rm -rf conftest*
16433   ol_cv_struct_passwd_pw_gecos=no
16434 fi
16435 rm -f conftest*
16436 fi
16437
16438 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16439 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16440         cat >> confdefs.h <<\EOF
16441 #define HAVE_PW_GECOS 1
16442 EOF
16443
16444 fi
16445
16446 # test for pw_passwd in struct passwd
16447 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16448 echo "configure:16449: checking struct passwd for pw_passwd" >&5
16449 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16450   echo $ac_n "(cached) $ac_c" 1>&6
16451 else
16452   
16453         cat > conftest.$ac_ext <<EOF
16454 #line 16455 "configure"
16455 #include "confdefs.h"
16456 #include <pwd.h>
16457 int main() {
16458
16459         struct passwd pwd;
16460         pwd.pw_passwd = pwd.pw_name;
16461
16462 ; return 0; }
16463 EOF
16464 if { (eval echo configure:16465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16465   rm -rf conftest*
16466   ol_cv_struct_passwd_pw_passwd=yes
16467 else
16468   echo "configure: failed program was:" >&5
16469   cat conftest.$ac_ext >&5
16470   rm -rf conftest*
16471   ol_cv_struct_passwd_pw_passwd=no
16472 fi
16473 rm -f conftest*
16474 fi
16475
16476 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16477 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16478         cat >> confdefs.h <<\EOF
16479 #define HAVE_PW_PASSWD 1
16480 EOF
16481
16482 fi
16483
16484
16485 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16486 echo "configure:16487: checking if toupper() requires islower()" >&5
16487 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16488   echo $ac_n "(cached) $ac_c" 1>&6
16489 else
16490   
16491         if test "$cross_compiling" = yes; then
16492   ol_cv_c_upper_lower=safe
16493 else
16494   cat > conftest.$ac_ext <<EOF
16495 #line 16496 "configure"
16496 #include "confdefs.h"
16497
16498 #include <ctype.h>
16499 main()
16500 {
16501         if ('C' == toupper('C'))
16502                 exit(0);
16503         else
16504                 exit(1);
16505 }
16506 EOF
16507 if { (eval echo configure:16508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16508 then
16509   ol_cv_c_upper_lower=no
16510 else
16511   echo "configure: failed program was:" >&5
16512   cat conftest.$ac_ext >&5
16513   rm -fr conftest*
16514   ol_cv_c_upper_lower=yes
16515 fi
16516 rm -fr conftest*
16517 fi
16518
16519 fi
16520
16521 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16522 if test $ol_cv_c_upper_lower != no ; then
16523         cat >> confdefs.h <<\EOF
16524 #define C_UPPER_LOWER 1
16525 EOF
16526
16527 fi
16528
16529 echo $ac_n "checking for working const""... $ac_c" 1>&6
16530 echo "configure:16531: checking for working const" >&5
16531 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16532   echo $ac_n "(cached) $ac_c" 1>&6
16533 else
16534   cat > conftest.$ac_ext <<EOF
16535 #line 16536 "configure"
16536 #include "confdefs.h"
16537
16538 int main() {
16539
16540 /* Ultrix mips cc rejects this.  */
16541 typedef int charset[2]; const charset x;
16542 /* SunOS 4.1.1 cc rejects this.  */
16543 char const *const *ccp;
16544 char **p;
16545 /* NEC SVR4.0.2 mips cc rejects this.  */
16546 struct point {int x, y;};
16547 static struct point const zero = {0,0};
16548 /* AIX XL C 1.02.0.0 rejects this.
16549    It does not let you subtract one const X* pointer from another in an arm
16550    of an if-expression whose if-part is not a constant expression */
16551 const char *g = "string";
16552 ccp = &g + (g ? g-g : 0);
16553 /* HPUX 7.0 cc rejects these. */
16554 ++ccp;
16555 p = (char**) ccp;
16556 ccp = (char const *const *) p;
16557 { /* SCO 3.2v4 cc rejects this.  */
16558   char *t;
16559   char const *s = 0 ? (char *) 0 : (char const *) 0;
16560
16561   *t++ = 0;
16562 }
16563 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16564   int x[] = {25, 17};
16565   const int *foo = &x[0];
16566   ++foo;
16567 }
16568 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16569   typedef const int *iptr;
16570   iptr p = 0;
16571   ++p;
16572 }
16573 { /* AIX XL C 1.02.0.0 rejects this saying
16574      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16575   struct s { int j; const int *ap[3]; };
16576   struct s *b; b->j = 5;
16577 }
16578 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16579   const int foo = 10;
16580 }
16581
16582 ; return 0; }
16583 EOF
16584 if { (eval echo configure:16585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16585   rm -rf conftest*
16586   ac_cv_c_const=yes
16587 else
16588   echo "configure: failed program was:" >&5
16589   cat conftest.$ac_ext >&5
16590   rm -rf conftest*
16591   ac_cv_c_const=no
16592 fi
16593 rm -f conftest*
16594 fi
16595
16596 echo "$ac_t""$ac_cv_c_const" 1>&6
16597 if test $ac_cv_c_const = no; then
16598   cat >> confdefs.h <<\EOF
16599 #define const 
16600 EOF
16601
16602 fi
16603
16604 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16605 echo "configure:16606: checking if compiler understands volatile" >&5
16606 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16607   echo $ac_n "(cached) $ac_c" 1>&6
16608 else
16609   cat > conftest.$ac_ext <<EOF
16610 #line 16611 "configure"
16611 #include "confdefs.h"
16612 int x, y, z;
16613 int main() {
16614 volatile int a; int * volatile b = x ? &y : &z;
16615       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16616       *b = 0;
16617 ; return 0; }
16618 EOF
16619 if { (eval echo configure:16620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16620   rm -rf conftest*
16621   ol_cv_c_volatile=yes
16622 else
16623   echo "configure: failed program was:" >&5
16624   cat conftest.$ac_ext >&5
16625   rm -rf conftest*
16626   ol_cv_c_volatile=no
16627 fi
16628 rm -f conftest*
16629 fi
16630
16631 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16632   if test $ol_cv_c_volatile = yes; then
16633     : 
16634   else
16635     cat >> confdefs.h <<\EOF
16636 #define volatile 
16637 EOF
16638
16639   fi
16640  
16641
16642 if test $cross_compiling = yes ; then
16643         cat >> confdefs.h <<\EOF
16644 #define CROSS_COMPILING 1
16645 EOF
16646
16647 else
16648         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16649 echo "configure:16650: checking whether byte ordering is bigendian" >&5
16650 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16651   echo $ac_n "(cached) $ac_c" 1>&6
16652 else
16653   ac_cv_c_bigendian=unknown
16654 # See if sys/param.h defines the BYTE_ORDER macro.
16655 cat > conftest.$ac_ext <<EOF
16656 #line 16657 "configure"
16657 #include "confdefs.h"
16658 #include <sys/types.h>
16659 #include <sys/param.h>
16660 int main() {
16661
16662 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16663  bogus endian macros
16664 #endif
16665 ; return 0; }
16666 EOF
16667 if { (eval echo configure:16668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16668   rm -rf conftest*
16669   # It does; now see whether it defined to BIG_ENDIAN or not.
16670 cat > conftest.$ac_ext <<EOF
16671 #line 16672 "configure"
16672 #include "confdefs.h"
16673 #include <sys/types.h>
16674 #include <sys/param.h>
16675 int main() {
16676
16677 #if BYTE_ORDER != BIG_ENDIAN
16678  not big endian
16679 #endif
16680 ; return 0; }
16681 EOF
16682 if { (eval echo configure:16683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16683   rm -rf conftest*
16684   ac_cv_c_bigendian=yes
16685 else
16686   echo "configure: failed program was:" >&5
16687   cat conftest.$ac_ext >&5
16688   rm -rf conftest*
16689   ac_cv_c_bigendian=no
16690 fi
16691 rm -f conftest*
16692 else
16693   echo "configure: failed program was:" >&5
16694   cat conftest.$ac_ext >&5
16695 fi
16696 rm -f conftest*
16697 if test $ac_cv_c_bigendian = unknown; then
16698 if test "$cross_compiling" = yes; then
16699     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16700 else
16701   cat > conftest.$ac_ext <<EOF
16702 #line 16703 "configure"
16703 #include "confdefs.h"
16704 main () {
16705   /* Are we little or big endian?  From Harbison&Steele.  */
16706   union
16707   {
16708     long l;
16709     char c[sizeof (long)];
16710   } u;
16711   u.l = 1;
16712   exit (u.c[sizeof (long) - 1] == 1);
16713 }
16714 EOF
16715 if { (eval echo configure:16716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16716 then
16717   ac_cv_c_bigendian=no
16718 else
16719   echo "configure: failed program was:" >&5
16720   cat conftest.$ac_ext >&5
16721   rm -fr conftest*
16722   ac_cv_c_bigendian=yes
16723 fi
16724 rm -fr conftest*
16725 fi
16726
16727 fi
16728 fi
16729
16730 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16731 if test $ac_cv_c_bigendian = yes; then
16732   cat >> confdefs.h <<\EOF
16733 #define WORDS_BIGENDIAN 1
16734 EOF
16735
16736 fi
16737
16738 fi
16739
16740 echo $ac_n "checking size of short""... $ac_c" 1>&6
16741 echo "configure:16742: checking size of short" >&5 
16742 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16743   echo $ac_n "(cached) $ac_c" 1>&6
16744 else
16745   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16746   cat > conftest.$ac_ext <<EOF
16747 #line 16748 "configure"
16748 #include "confdefs.h"
16749 #include "confdefs.h" 
16750 #include <sys/types.h> 
16751  
16752
16753 int main() {
16754 switch (0) case 0: case (sizeof (short) == $ac_size):;
16755 ; return 0; }
16756 EOF
16757 if { (eval echo configure:16758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16758   rm -rf conftest*
16759   ac_cv_sizeof_short=$ac_size
16760 else
16761   echo "configure: failed program was:" >&5
16762   cat conftest.$ac_ext >&5
16763 fi
16764 rm -f conftest* 
16765   if test x$ac_cv_sizeof_short != x ; then break; fi 
16766 done 
16767
16768 fi
16769  
16770 if test x$ac_cv_sizeof_short = x ; then 
16771   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16772 fi 
16773 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16774 cat >> confdefs.h <<EOF
16775 #define SIZEOF_SHORT $ac_cv_sizeof_short
16776 EOF
16777  
16778  
16779 echo $ac_n "checking size of int""... $ac_c" 1>&6
16780 echo "configure:16781: checking size of int" >&5 
16781 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16782   echo $ac_n "(cached) $ac_c" 1>&6
16783 else
16784   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16785   cat > conftest.$ac_ext <<EOF
16786 #line 16787 "configure"
16787 #include "confdefs.h"
16788 #include "confdefs.h" 
16789 #include <sys/types.h> 
16790  
16791
16792 int main() {
16793 switch (0) case 0: case (sizeof (int) == $ac_size):;
16794 ; return 0; }
16795 EOF
16796 if { (eval echo configure:16797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16797   rm -rf conftest*
16798   ac_cv_sizeof_int=$ac_size
16799 else
16800   echo "configure: failed program was:" >&5
16801   cat conftest.$ac_ext >&5
16802 fi
16803 rm -f conftest* 
16804   if test x$ac_cv_sizeof_int != x ; then break; fi 
16805 done 
16806
16807 fi
16808  
16809 if test x$ac_cv_sizeof_int = x ; then 
16810   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16811 fi 
16812 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16813 cat >> confdefs.h <<EOF
16814 #define SIZEOF_INT $ac_cv_sizeof_int
16815 EOF
16816  
16817  
16818 echo $ac_n "checking size of long""... $ac_c" 1>&6
16819 echo "configure:16820: checking size of long" >&5 
16820 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16821   echo $ac_n "(cached) $ac_c" 1>&6
16822 else
16823   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16824   cat > conftest.$ac_ext <<EOF
16825 #line 16826 "configure"
16826 #include "confdefs.h"
16827 #include "confdefs.h" 
16828 #include <sys/types.h> 
16829  
16830
16831 int main() {
16832 switch (0) case 0: case (sizeof (long) == $ac_size):;
16833 ; return 0; }
16834 EOF
16835 if { (eval echo configure:16836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16836   rm -rf conftest*
16837   ac_cv_sizeof_long=$ac_size
16838 else
16839   echo "configure: failed program was:" >&5
16840   cat conftest.$ac_ext >&5
16841 fi
16842 rm -f conftest* 
16843   if test x$ac_cv_sizeof_long != x ; then break; fi 
16844 done 
16845
16846 fi
16847  
16848 if test x$ac_cv_sizeof_long = x ; then 
16849   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16850 fi 
16851 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16852 cat >> confdefs.h <<EOF
16853 #define SIZEOF_LONG $ac_cv_sizeof_long
16854 EOF
16855  
16856
16857
16858 if test "$ac_cv_sizeof_int" -lt 4 ; then
16859         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16860
16861         cat >> confdefs.h <<\EOF
16862 #define LBER_INT_T long
16863 EOF
16864
16865 else
16866         cat >> confdefs.h <<\EOF
16867 #define LBER_INT_T int
16868 EOF
16869
16870 fi
16871
16872 cat >> confdefs.h <<\EOF
16873 #define LBER_LEN_T long
16874 EOF
16875
16876 cat >> confdefs.h <<\EOF
16877 #define LBER_SOCKET_T int
16878 EOF
16879
16880 cat >> confdefs.h <<\EOF
16881 #define LBER_TAG_T long
16882 EOF
16883
16884
16885 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16886 echo "configure:16887: checking for 8-bit clean memcmp" >&5
16887 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16888   echo $ac_n "(cached) $ac_c" 1>&6
16889 else
16890   if test "$cross_compiling" = yes; then
16891   ac_cv_func_memcmp_clean=no
16892 else
16893   cat > conftest.$ac_ext <<EOF
16894 #line 16895 "configure"
16895 #include "confdefs.h"
16896
16897 main()
16898 {
16899   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16900   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16901 }
16902
16903 EOF
16904 if { (eval echo configure:16905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16905 then
16906   ac_cv_func_memcmp_clean=yes
16907 else
16908   echo "configure: failed program was:" >&5
16909   cat conftest.$ac_ext >&5
16910   rm -fr conftest*
16911   ac_cv_func_memcmp_clean=no
16912 fi
16913 rm -fr conftest*
16914 fi
16915
16916 fi
16917
16918 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16919 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16920
16921 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16922 echo "configure:16923: checking for strftime" >&5
16923 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16924   echo $ac_n "(cached) $ac_c" 1>&6
16925 else
16926   cat > conftest.$ac_ext <<EOF
16927 #line 16928 "configure"
16928 #include "confdefs.h"
16929 /* System header to define __stub macros and hopefully few prototypes,
16930     which can conflict with char strftime(); below.  */
16931 #include <assert.h>
16932 /* Override any gcc2 internal prototype to avoid an error.  */
16933 /* We use char because int might match the return type of a gcc2
16934     builtin and then its argument prototype would still apply.  */
16935 char strftime();
16936 char (*f)();
16937
16938 int main() {
16939
16940 /* The GNU C library defines this for functions which it implements
16941     to always fail with ENOSYS.  Some functions are actually named
16942     something starting with __ and the normal name is an alias.  */
16943 #if defined (__stub_strftime) || defined (__stub___strftime)
16944 choke me
16945 #else
16946 f = strftime;
16947 #endif
16948
16949 ; return 0; }
16950 EOF
16951 if { (eval echo configure:16952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16952   rm -rf conftest*
16953   eval "ac_cv_func_strftime=yes"
16954 else
16955   echo "configure: failed program was:" >&5
16956   cat conftest.$ac_ext >&5
16957   rm -rf conftest*
16958   eval "ac_cv_func_strftime=no"
16959 fi
16960 rm -f conftest*
16961 fi
16962
16963 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16964   echo "$ac_t""yes" 1>&6
16965   cat >> confdefs.h <<\EOF
16966 #define HAVE_STRFTIME 1
16967 EOF
16968
16969 else
16970   echo "$ac_t""no" 1>&6
16971 # strftime is in -lintl on SCO UNIX.
16972 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16973 echo "configure:16974: checking for strftime in -lintl" >&5
16974 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16975 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16976   echo $ac_n "(cached) $ac_c" 1>&6
16977 else
16978   ac_save_LIBS="$LIBS"
16979 LIBS="-lintl  $LIBS"
16980 cat > conftest.$ac_ext <<EOF
16981 #line 16982 "configure"
16982 #include "confdefs.h"
16983 /* Override any gcc2 internal prototype to avoid an error.  */
16984 /* We use char because int might match the return type of a gcc2
16985     builtin and then its argument prototype would still apply.  */
16986 char strftime();
16987
16988 int main() {
16989 strftime()
16990 ; return 0; }
16991 EOF
16992 if { (eval echo configure:16993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16993   rm -rf conftest*
16994   eval "ac_cv_lib_$ac_lib_var=yes"
16995 else
16996   echo "configure: failed program was:" >&5
16997   cat conftest.$ac_ext >&5
16998   rm -rf conftest*
16999   eval "ac_cv_lib_$ac_lib_var=no"
17000 fi
17001 rm -f conftest*
17002 LIBS="$ac_save_LIBS"
17003
17004 fi
17005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
17006   echo "$ac_t""yes" 1>&6
17007   cat >> confdefs.h <<\EOF
17008 #define HAVE_STRFTIME 1
17009 EOF
17010
17011 LIBS="-lintl $LIBS"
17012 else
17013   echo "$ac_t""no" 1>&6
17014 fi
17015
17016 fi
17017
17018
17019 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
17020 echo "configure:17021: checking for inet_aton()" >&5
17021 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
17022   echo $ac_n "(cached) $ac_c" 1>&6
17023 else
17024   cat > conftest.$ac_ext <<EOF
17025 #line 17026 "configure"
17026 #include "confdefs.h"
17027
17028 #ifdef HAVE_SYS_TYPES_H
17029 #       include <sys/types.h>
17030 #endif
17031 #ifdef HAVE_SYS_SOCKET_H
17032 #       include <sys/socket.h>
17033 #       ifdef HAVE_SYS_SELECT_H
17034 #               include <sys/select.h>
17035 #       endif
17036 #       include <netinet/in.h>
17037 #       ifdef HAVE_ARPA_INET_H
17038 #               include <arpa/inet.h>
17039 #       endif
17040 #endif
17041
17042 int main() {
17043 struct in_addr in;
17044 int rc = inet_aton( "255.255.255.255", &in );
17045 ; return 0; }
17046 EOF
17047 if { (eval echo configure:17048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17048   rm -rf conftest*
17049   ol_cv_func_inet_aton=yes
17050 else
17051   echo "configure: failed program was:" >&5
17052   cat conftest.$ac_ext >&5
17053   rm -rf conftest*
17054   ol_cv_func_inet_aton=no
17055 fi
17056 rm -f conftest*
17057 fi
17058
17059 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
17060   if test $ol_cv_func_inet_aton != no; then
17061     cat >> confdefs.h <<\EOF
17062 #define HAVE_INET_ATON 1
17063 EOF
17064
17065   fi
17066  
17067
17068 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
17069 echo "configure:17070: checking for _spawnlp" >&5
17070 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
17071   echo $ac_n "(cached) $ac_c" 1>&6
17072 else
17073   cat > conftest.$ac_ext <<EOF
17074 #line 17075 "configure"
17075 #include "confdefs.h"
17076 /* System header to define __stub macros and hopefully few prototypes,
17077     which can conflict with char _spawnlp(); below.  */
17078 #include <assert.h>
17079 /* Override any gcc2 internal prototype to avoid an error.  */
17080 /* We use char because int might match the return type of a gcc2
17081     builtin and then its argument prototype would still apply.  */
17082 char _spawnlp();
17083 char (*f)();
17084
17085 int main() {
17086
17087 /* The GNU C library defines this for functions which it implements
17088     to always fail with ENOSYS.  Some functions are actually named
17089     something starting with __ and the normal name is an alias.  */
17090 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
17091 choke me
17092 #else
17093 f = _spawnlp;
17094 #endif
17095
17096 ; return 0; }
17097 EOF
17098 if { (eval echo configure:17099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17099   rm -rf conftest*
17100   eval "ac_cv_func__spawnlp=yes"
17101 else
17102   echo "configure: failed program was:" >&5
17103   cat conftest.$ac_ext >&5
17104   rm -rf conftest*
17105   eval "ac_cv_func__spawnlp=no"
17106 fi
17107 rm -f conftest*
17108 fi
17109
17110 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
17111   echo "$ac_t""yes" 1>&6
17112   cat >> confdefs.h <<\EOF
17113 #define HAVE_SPAWNLP 1
17114 EOF
17115
17116 else
17117   echo "$ac_t""no" 1>&6
17118 fi
17119
17120
17121 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
17122 echo "configure:17123: checking for _snprintf" >&5
17123 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
17124   echo $ac_n "(cached) $ac_c" 1>&6
17125 else
17126   cat > conftest.$ac_ext <<EOF
17127 #line 17128 "configure"
17128 #include "confdefs.h"
17129 /* System header to define __stub macros and hopefully few prototypes,
17130     which can conflict with char _snprintf(); below.  */
17131 #include <assert.h>
17132 /* Override any gcc2 internal prototype to avoid an error.  */
17133 /* We use char because int might match the return type of a gcc2
17134     builtin and then its argument prototype would still apply.  */
17135 char _snprintf();
17136 char (*f)();
17137
17138 int main() {
17139
17140 /* The GNU C library defines this for functions which it implements
17141     to always fail with ENOSYS.  Some functions are actually named
17142     something starting with __ and the normal name is an alias.  */
17143 #if defined (__stub__snprintf) || defined (__stub____snprintf)
17144 choke me
17145 #else
17146 f = _snprintf;
17147 #endif
17148
17149 ; return 0; }
17150 EOF
17151 if { (eval echo configure:17152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17152   rm -rf conftest*
17153   eval "ac_cv_func__snprintf=yes"
17154 else
17155   echo "configure: failed program was:" >&5
17156   cat conftest.$ac_ext >&5
17157   rm -rf conftest*
17158   eval "ac_cv_func__snprintf=no"
17159 fi
17160 rm -f conftest*
17161 fi
17162
17163 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
17164   echo "$ac_t""yes" 1>&6
17165   ac_cv_func_snprintf=yes
17166         cat >> confdefs.h <<\EOF
17167 #define snprintf _snprintf
17168 EOF
17169
17170
17171 else
17172   echo "$ac_t""no" 1>&6
17173 fi
17174
17175
17176 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
17177 echo "configure:17178: checking for _vsnprintf" >&5
17178 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
17179   echo $ac_n "(cached) $ac_c" 1>&6
17180 else
17181   cat > conftest.$ac_ext <<EOF
17182 #line 17183 "configure"
17183 #include "confdefs.h"
17184 /* System header to define __stub macros and hopefully few prototypes,
17185     which can conflict with char _vsnprintf(); below.  */
17186 #include <assert.h>
17187 /* Override any gcc2 internal prototype to avoid an error.  */
17188 /* We use char because int might match the return type of a gcc2
17189     builtin and then its argument prototype would still apply.  */
17190 char _vsnprintf();
17191 char (*f)();
17192
17193 int main() {
17194
17195 /* The GNU C library defines this for functions which it implements
17196     to always fail with ENOSYS.  Some functions are actually named
17197     something starting with __ and the normal name is an alias.  */
17198 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
17199 choke me
17200 #else
17201 f = _vsnprintf;
17202 #endif
17203
17204 ; return 0; }
17205 EOF
17206 if { (eval echo configure:17207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17207   rm -rf conftest*
17208   eval "ac_cv_func__vsnprintf=yes"
17209 else
17210   echo "configure: failed program was:" >&5
17211   cat conftest.$ac_ext >&5
17212   rm -rf conftest*
17213   eval "ac_cv_func__vsnprintf=no"
17214 fi
17215 rm -f conftest*
17216 fi
17217
17218 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
17219   echo "$ac_t""yes" 1>&6
17220   ac_cv_func_vsnprintf=yes
17221         cat >> confdefs.h <<\EOF
17222 #define vsnprintf _vsnprintf
17223 EOF
17224
17225
17226 else
17227   echo "$ac_t""no" 1>&6
17228 fi
17229
17230
17231 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
17232 echo "configure:17233: checking for vprintf" >&5
17233 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
17234   echo $ac_n "(cached) $ac_c" 1>&6
17235 else
17236   cat > conftest.$ac_ext <<EOF
17237 #line 17238 "configure"
17238 #include "confdefs.h"
17239 /* System header to define __stub macros and hopefully few prototypes,
17240     which can conflict with char vprintf(); below.  */
17241 #include <assert.h>
17242 /* Override any gcc2 internal prototype to avoid an error.  */
17243 /* We use char because int might match the return type of a gcc2
17244     builtin and then its argument prototype would still apply.  */
17245 char vprintf();
17246 char (*f)();
17247
17248 int main() {
17249
17250 /* The GNU C library defines this for functions which it implements
17251     to always fail with ENOSYS.  Some functions are actually named
17252     something starting with __ and the normal name is an alias.  */
17253 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17254 choke me
17255 #else
17256 f = vprintf;
17257 #endif
17258
17259 ; return 0; }
17260 EOF
17261 if { (eval echo configure:17262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17262   rm -rf conftest*
17263   eval "ac_cv_func_vprintf=yes"
17264 else
17265   echo "configure: failed program was:" >&5
17266   cat conftest.$ac_ext >&5
17267   rm -rf conftest*
17268   eval "ac_cv_func_vprintf=no"
17269 fi
17270 rm -f conftest*
17271 fi
17272
17273 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17274   echo "$ac_t""yes" 1>&6
17275   cat >> confdefs.h <<\EOF
17276 #define HAVE_VPRINTF 1
17277 EOF
17278
17279 else
17280   echo "$ac_t""no" 1>&6
17281 fi
17282
17283 if test "$ac_cv_func_vprintf" != yes; then
17284 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17285 echo "configure:17286: checking for _doprnt" >&5
17286 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17287   echo $ac_n "(cached) $ac_c" 1>&6
17288 else
17289   cat > conftest.$ac_ext <<EOF
17290 #line 17291 "configure"
17291 #include "confdefs.h"
17292 /* System header to define __stub macros and hopefully few prototypes,
17293     which can conflict with char _doprnt(); below.  */
17294 #include <assert.h>
17295 /* Override any gcc2 internal prototype to avoid an error.  */
17296 /* We use char because int might match the return type of a gcc2
17297     builtin and then its argument prototype would still apply.  */
17298 char _doprnt();
17299 char (*f)();
17300
17301 int main() {
17302
17303 /* The GNU C library defines this for functions which it implements
17304     to always fail with ENOSYS.  Some functions are actually named
17305     something starting with __ and the normal name is an alias.  */
17306 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17307 choke me
17308 #else
17309 f = _doprnt;
17310 #endif
17311
17312 ; return 0; }
17313 EOF
17314 if { (eval echo configure:17315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17315   rm -rf conftest*
17316   eval "ac_cv_func__doprnt=yes"
17317 else
17318   echo "configure: failed program was:" >&5
17319   cat conftest.$ac_ext >&5
17320   rm -rf conftest*
17321   eval "ac_cv_func__doprnt=no"
17322 fi
17323 rm -f conftest*
17324 fi
17325
17326 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17327   echo "$ac_t""yes" 1>&6
17328   cat >> confdefs.h <<\EOF
17329 #define HAVE_DOPRNT 1
17330 EOF
17331
17332 else
17333   echo "$ac_t""no" 1>&6
17334 fi
17335
17336 fi
17337
17338
17339 if test $ac_cv_func_vprintf = yes ; then
17340                 for ac_func in vsnprintf vsprintf
17341 do
17342 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17343 echo "configure:17344: checking for $ac_func" >&5
17344 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17345   echo $ac_n "(cached) $ac_c" 1>&6
17346 else
17347   cat > conftest.$ac_ext <<EOF
17348 #line 17349 "configure"
17349 #include "confdefs.h"
17350 /* System header to define __stub macros and hopefully few prototypes,
17351     which can conflict with char $ac_func(); below.  */
17352 #include <assert.h>
17353 /* Override any gcc2 internal prototype to avoid an error.  */
17354 /* We use char because int might match the return type of a gcc2
17355     builtin and then its argument prototype would still apply.  */
17356 char $ac_func();
17357 char (*f)();
17358
17359 int main() {
17360
17361 /* The GNU C library defines this for functions which it implements
17362     to always fail with ENOSYS.  Some functions are actually named
17363     something starting with __ and the normal name is an alias.  */
17364 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17365 choke me
17366 #else
17367 f = $ac_func;
17368 #endif
17369
17370 ; return 0; }
17371 EOF
17372 if { (eval echo configure:17373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17373   rm -rf conftest*
17374   eval "ac_cv_func_$ac_func=yes"
17375 else
17376   echo "configure: failed program was:" >&5
17377   cat conftest.$ac_ext >&5
17378   rm -rf conftest*
17379   eval "ac_cv_func_$ac_func=no"
17380 fi
17381 rm -f conftest*
17382 fi
17383
17384 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17385   echo "$ac_t""yes" 1>&6
17386     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17387   cat >> confdefs.h <<EOF
17388 #define $ac_tr_func 1
17389 EOF
17390  
17391 else
17392   echo "$ac_t""no" 1>&6
17393 fi
17394 done
17395
17396 fi
17397
17398 for ac_func in \
17399         bcopy                   \
17400         closesocket             \
17401         chroot                  \
17402         endgrent                \
17403         endpwent                \
17404         fcntl                   \
17405         flock                   \
17406         getdtablesize   \
17407         getgrgid                \
17408         gethostname             \
17409         getpass                 \
17410         getpassphrase   \
17411         getpwuid                \
17412         getpwnam                \
17413         getspnam                \
17414         gettimeofday    \
17415         initgroups              \
17416         lockf                   \
17417         memcpy                  \
17418         memmove                 \
17419         pipe                    \
17420         read                    \
17421         recv                    \
17422         recvfrom                \
17423         setpwfile               \
17424         setgid                  \
17425         setegid                 \
17426         setsid                  \
17427         setuid                  \
17428         seteuid                 \
17429         sigaction               \
17430         signal                  \
17431         sigset                  \
17432         strdup                  \
17433         strerror                \
17434         strpbrk                 \
17435         strrchr                 \
17436         strsep                  \
17437         strstr                  \
17438         strtol                  \
17439         strtoul                 \
17440         strspn                  \
17441         sysconf                 \
17442         usleep                  \
17443         waitpid                 \
17444         wait4                   \
17445         write                   \
17446         send                    \
17447         sendto                  \
17448
17449 do
17450 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17451 echo "configure:17452: checking for $ac_func" >&5
17452 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17453   echo $ac_n "(cached) $ac_c" 1>&6
17454 else
17455   cat > conftest.$ac_ext <<EOF
17456 #line 17457 "configure"
17457 #include "confdefs.h"
17458 /* System header to define __stub macros and hopefully few prototypes,
17459     which can conflict with char $ac_func(); below.  */
17460 #include <assert.h>
17461 /* Override any gcc2 internal prototype to avoid an error.  */
17462 /* We use char because int might match the return type of a gcc2
17463     builtin and then its argument prototype would still apply.  */
17464 char $ac_func();
17465 char (*f)();
17466
17467 int main() {
17468
17469 /* The GNU C library defines this for functions which it implements
17470     to always fail with ENOSYS.  Some functions are actually named
17471     something starting with __ and the normal name is an alias.  */
17472 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17473 choke me
17474 #else
17475 f = $ac_func;
17476 #endif
17477
17478 ; return 0; }
17479 EOF
17480 if { (eval echo configure:17481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17481   rm -rf conftest*
17482   eval "ac_cv_func_$ac_func=yes"
17483 else
17484   echo "configure: failed program was:" >&5
17485   cat conftest.$ac_ext >&5
17486   rm -rf conftest*
17487   eval "ac_cv_func_$ac_func=no"
17488 fi
17489 rm -f conftest*
17490 fi
17491
17492 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17493   echo "$ac_t""yes" 1>&6
17494     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17495   cat >> confdefs.h <<EOF
17496 #define $ac_tr_func 1
17497 EOF
17498  
17499 else
17500   echo "$ac_t""no" 1>&6
17501 fi
17502 done
17503
17504
17505 for ac_func in getopt
17506 do
17507 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17508 echo "configure:17509: checking for $ac_func" >&5
17509 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17510   echo $ac_n "(cached) $ac_c" 1>&6
17511 else
17512   cat > conftest.$ac_ext <<EOF
17513 #line 17514 "configure"
17514 #include "confdefs.h"
17515 /* System header to define __stub macros and hopefully few prototypes,
17516     which can conflict with char $ac_func(); below.  */
17517 #include <assert.h>
17518 /* Override any gcc2 internal prototype to avoid an error.  */
17519 /* We use char because int might match the return type of a gcc2
17520     builtin and then its argument prototype would still apply.  */
17521 char $ac_func();
17522 char (*f)();
17523
17524 int main() {
17525
17526 /* The GNU C library defines this for functions which it implements
17527     to always fail with ENOSYS.  Some functions are actually named
17528     something starting with __ and the normal name is an alias.  */
17529 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17530 choke me
17531 #else
17532 f = $ac_func;
17533 #endif
17534
17535 ; return 0; }
17536 EOF
17537 if { (eval echo configure:17538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17538   rm -rf conftest*
17539   eval "ac_cv_func_$ac_func=yes"
17540 else
17541   echo "configure: failed program was:" >&5
17542   cat conftest.$ac_ext >&5
17543   rm -rf conftest*
17544   eval "ac_cv_func_$ac_func=no"
17545 fi
17546 rm -f conftest*
17547 fi
17548
17549 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17550   echo "$ac_t""yes" 1>&6
17551     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17552   cat >> confdefs.h <<EOF
17553 #define $ac_tr_func 1
17554 EOF
17555  
17556 else
17557   echo "$ac_t""no" 1>&6
17558 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17559 fi
17560 done
17561
17562
17563
17564 if test "$ac_cv_func_getopt" != yes; then
17565     LIBSRCS="$LIBSRCS getopt.c"
17566 fi
17567
17568 # Check Configuration
17569 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17570 echo "configure:17571: checking declaration of sys_errlist" >&5
17571 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17572   echo $ac_n "(cached) $ac_c" 1>&6
17573 else
17574   
17575         cat > conftest.$ac_ext <<EOF
17576 #line 17577 "configure"
17577 #include "confdefs.h"
17578
17579 #include <stdio.h>
17580 #include <sys/types.h>
17581 #include <errno.h>
17582 #ifdef WINNT
17583 #include <stdlib.h>
17584 #endif 
17585 int main() {
17586 char *c = (char *) *sys_errlist
17587 ; return 0; }
17588 EOF
17589 if { (eval echo configure:17590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17590   rm -rf conftest*
17591   ol_cv_dcl_sys_errlist=yes
17592         ol_cv_have_sys_errlist=yes
17593 else
17594   echo "configure: failed program was:" >&5
17595   cat conftest.$ac_ext >&5
17596   rm -rf conftest*
17597   ol_cv_dcl_sys_errlist=no
17598 fi
17599 rm -f conftest*
17600 fi
17601
17602 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17603 #
17604 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17605 if test $ol_cv_dcl_sys_errlist = no ; then
17606         cat >> confdefs.h <<\EOF
17607 #define DECL_SYS_ERRLIST 1
17608 EOF
17609
17610
17611         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17612 echo "configure:17613: checking existence of sys_errlist" >&5
17613 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17614   echo $ac_n "(cached) $ac_c" 1>&6
17615 else
17616   
17617                 cat > conftest.$ac_ext <<EOF
17618 #line 17619 "configure"
17619 #include "confdefs.h"
17620 #include <errno.h>
17621 int main() {
17622 char *c = (char *) *sys_errlist
17623 ; return 0; }
17624 EOF
17625 if { (eval echo configure:17626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17626   rm -rf conftest*
17627   ol_cv_have_sys_errlist=yes
17628 else
17629   echo "configure: failed program was:" >&5
17630   cat conftest.$ac_ext >&5
17631   rm -rf conftest*
17632   ol_cv_have_sys_errlist=no
17633 fi
17634 rm -f conftest*
17635 fi
17636
17637 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17638 fi
17639 if test $ol_cv_have_sys_errlist = yes ; then
17640         cat >> confdefs.h <<\EOF
17641 #define HAVE_SYS_ERRLIST 1
17642 EOF
17643
17644 fi
17645
17646
17647
17648 if test "$ol_enable_debug" != no ; then
17649         cat >> confdefs.h <<\EOF
17650 #define LDAP_DEBUG 1
17651 EOF
17652
17653 fi
17654 if test "$ol_enable_syslog" = yes ; then
17655         cat >> confdefs.h <<\EOF
17656 #define LDAP_SYSLOG 1
17657 EOF
17658
17659 fi
17660 if test "$ol_enable_cache" = no ; then
17661         cat >> confdefs.h <<\EOF
17662 #define LDAP_NOCACHE 1
17663 EOF
17664
17665 fi
17666 if test "$ol_link_kbind" != no ; then
17667         cat >> confdefs.h <<\EOF
17668 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17669 EOF
17670
17671 fi
17672 if test "$ol_enable_proctitle" != no ; then
17673         cat >> confdefs.h <<\EOF
17674 #define LDAP_PROCTITLE 1
17675 EOF
17676
17677 fi
17678 if test "$ol_enable_referrals" != no ; then
17679         cat >> confdefs.h <<\EOF
17680 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17681 EOF
17682
17683 fi
17684 if test "$ol_enable_local" != no; then
17685         cat >> confdefs.h <<\EOF
17686 #define LDAP_PF_LOCAL 1
17687 EOF
17688
17689 fi
17690 if test "$ol_link_ipv6" != no; then
17691         cat >> confdefs.h <<\EOF
17692 #define LDAP_PF_INET6 1
17693 EOF
17694
17695 fi
17696 if test "$ol_enable_cleartext" != no ; then
17697         cat >> confdefs.h <<\EOF
17698 #define SLAPD_CLEARTEXT 1
17699 EOF
17700
17701 fi
17702 if test "$ol_enable_crypt" != no ; then
17703         cat >> confdefs.h <<\EOF
17704 #define SLAPD_CRYPT 1
17705 EOF
17706
17707 fi
17708 if test "$ol_link_kpasswd" != no ; then
17709         cat >> confdefs.h <<\EOF
17710 #define SLAPD_KPASSWD 1
17711 EOF
17712
17713 fi
17714 if test "$ol_link_spasswd" != no ; then
17715         cat >> confdefs.h <<\EOF
17716 #define SLAPD_SPASSWD 1
17717 EOF
17718
17719 fi
17720 if test "$ol_enable_phonetic" != no ; then
17721         cat >> confdefs.h <<\EOF
17722 #define SLAPD_PHONETIC 1
17723 EOF
17724
17725 fi
17726 if test "$ol_enable_rlookups" != no ; then
17727         cat >> confdefs.h <<\EOF
17728 #define SLAPD_RLOOKUPS 1
17729 EOF
17730
17731 fi
17732 if test "$ol_enable_aci" != no ; then
17733         cat >> confdefs.h <<\EOF
17734 #define SLAPD_ACI_ENABLED 1
17735 EOF
17736
17737 fi
17738
17739 if test "$ol_link_modules" != no ; then
17740         cat >> confdefs.h <<\EOF
17741 #define SLAPD_MODULES 1
17742 EOF
17743
17744         BUILD_SLAPD=yes
17745         SLAPD_MODULES_LDFLAGS="-dlopen self"
17746 fi
17747
17748 if test "$ol_enable_bdb" != no ; then
17749         cat >> confdefs.h <<\EOF
17750 #define SLAPD_BDB 1
17751 EOF
17752
17753         BUILD_SLAPD=yes
17754         BUILD_BDB=yes
17755         if test "$ol_with_bdb_module" != static ; then
17756                 cat >> confdefs.h <<\EOF
17757 #define SLAPD_BDB_DYNAMIC 1
17758 EOF
17759
17760                 BUILD_BDB=mod
17761                 BUILD_BDB_DYNAMIC=shared
17762                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17763         fi
17764 fi
17765
17766 if test "$ol_link_dnssrv" != no ; then
17767         cat >> confdefs.h <<\EOF
17768 #define SLAPD_DNSSRV 1
17769 EOF
17770
17771         BUILD_SLAPD=yes
17772         BUILD_DNSSRV=yes
17773         if test "$ol_with_dnssrv_module" != static ; then
17774                 cat >> confdefs.h <<\EOF
17775 #define SLAPD_DNSSRV_DYNAMIC 1
17776 EOF
17777
17778                 BUILD_DNSSRV=mod
17779                 BUILD_DNSSRV_DYNAMIC=shared
17780                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17781         fi
17782 fi
17783
17784 if test "$ol_enable_ldap" != no ; then
17785         cat >> confdefs.h <<\EOF
17786 #define SLAPD_LDAP 1
17787 EOF
17788
17789         BUILD_SLAPD=yes
17790         BUILD_LDAP=yes
17791         if test "$ol_with_ldap_module" != static ; then
17792                 cat >> confdefs.h <<\EOF
17793 #define SLAPD_LDAP_DYNAMIC 1
17794 EOF
17795
17796                 BUILD_LDAP=mod
17797                 BUILD_LDAP_DYNAMIC=shared
17798                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17799         fi
17800 fi
17801
17802 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17803         cat >> confdefs.h <<\EOF
17804 #define SLAPD_LDBM 1
17805 EOF
17806
17807         BUILD_SLAPD=yes
17808         BUILD_LDBM=yes
17809         LDBM_LIB="-lldbm"
17810         if test "$ol_with_ldbm_module" != static ; then
17811                 cat >> confdefs.h <<\EOF
17812 #define SLAPD_LDBM_DYNAMIC 1
17813 EOF
17814
17815                 BUILD_LDBM=mod
17816                 BUILD_LDBM_DYNAMIC=shared
17817                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17818         fi
17819 fi
17820
17821 if test "$ol_enable_meta" != no ; then
17822         if test "$ol_enable_ldap" = no ; then
17823                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17824         fi
17825         if test "$ol_enable_rewrite" = no ; then
17826                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17827         fi
17828         cat >> confdefs.h <<\EOF
17829 #define SLAPD_META 1
17830 EOF
17831
17832         BUILD_SLAPD=yes
17833         BUILD_META=yes
17834         if test "$ol_with_meta_module" != static ; then
17835                 cat >> confdefs.h <<\EOF
17836 #define SLAPD_META_DYNAMIC 1
17837 EOF
17838
17839                 BUILD_META=mod
17840                 BUILD_META_DYNAMIC=shared
17841                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17842         fi
17843 fi
17844
17845 if test "$ol_enable_monitor" != no ; then
17846         cat >> confdefs.h <<\EOF
17847 #define SLAPD_MONITOR 1
17848 EOF
17849
17850         BUILD_SLAPD=yes
17851         BUILD_MONITOR=yes
17852         if test "$ol_with_monitor_module" != static ; then
17853                 cat >> confdefs.h <<\EOF
17854 #define SLAPD_MONITOR_DYNAMIC 1
17855 EOF
17856
17857                 BUILD_MONITOR=mod
17858                 BUILD_MONITOR_DYNAMIC=shared
17859                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17860         fi
17861 fi
17862
17863 if test "$ol_enable_passwd" != no ; then
17864         cat >> confdefs.h <<\EOF
17865 #define SLAPD_PASSWD 1
17866 EOF
17867
17868         BUILD_SLAPD=yes
17869         BUILD_PASSWD=yes
17870         if test "$ol_with_passwd_module" != static ; then
17871                 cat >> confdefs.h <<\EOF
17872 #define SLAPD_PASSWD_DYNAMIC 1
17873 EOF
17874
17875                 BUILD_PASSWD=mod
17876                 BUILD_PASSWD_DYNAMIC=shared
17877                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17878         fi
17879 fi
17880
17881 if test "$ol_link_perl" != no ; then
17882         cat >> confdefs.h <<\EOF
17883 #define SLAPD_PERL 1
17884 EOF
17885
17886         BUILD_SLAPD=yes
17887         BUILD_PERL=yes
17888         if test "$ol_with_perl_module" != static ; then
17889                 cat >> confdefs.h <<\EOF
17890 #define SLAPD_PERL_DYNAMIC 1
17891 EOF
17892
17893                 BUILD_PERL=mod
17894                 BUILD_PERL_DYNAMIC=shared
17895                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17896         fi
17897 fi
17898
17899 if test "$ol_enable_shell" != no ; then
17900         cat >> confdefs.h <<\EOF
17901 #define SLAPD_SHELL 1
17902 EOF
17903
17904         BUILD_SLAPD=yes
17905         BUILD_SHELL=yes
17906         if test "$ol_with_shell_module" != static ; then
17907                 cat >> confdefs.h <<\EOF
17908 #define SLAPD_SHELL_DYNAMIC 1
17909 EOF
17910
17911                 BUILD_SHELL=mod
17912                 BUILD_SHELL_DYNAMIC=shared
17913                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17914         fi
17915 fi
17916
17917 if test "$ol_enable_tcl" != no ; then
17918         cat >> confdefs.h <<\EOF
17919 #define SLAPD_TCL 1
17920 EOF
17921
17922         BUILD_SLAPD=yes
17923         BUILD_TCL=yes
17924         if test "$ol_with_tcl_module" != static; then
17925                 cat >> confdefs.h <<\EOF
17926 #define SLAPD_TCL_DYNAMIC 1
17927 EOF
17928
17929                 BUILD_TCL=mod
17930                 BUILD_TCL_DYNAMIC=shared
17931                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17932         fi
17933 fi
17934
17935 if test "$ol_link_sql" != no ; then
17936         cat >> confdefs.h <<\EOF
17937 #define SLAPD_SQL 1
17938 EOF
17939
17940         BUILD_SLAPD=yes
17941         BUILD_SQL=yes
17942         if test "$ol_with_sql_module" != static; then
17943                 cat >> confdefs.h <<\EOF
17944 #define SLAPD_SQL_DYNAMIC 1
17945 EOF
17946
17947                 BUILD_SQL=mod
17948                 BUILD_SQL_DYNAMIC=shared
17949                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17950         fi
17951 fi
17952
17953 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17954         $BUILD_SLAPD = yes ; then
17955         BUILD_SLURPD=yes
17956 fi
17957
17958 if test "$ol_enable_rewrite" != no ; then
17959         cat >> confdefs.h <<\EOF
17960 #define ENABLE_REWRITE 1
17961 EOF
17962
17963         BUILD_REWRITE=yes
17964         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17965 fi
17966
17967
17968 if test "$LINK_BINS_DYNAMIC" = yes; then
17969     LIB_LINKAGE=DYN
17970     LT_LIB_LINKAGE=shared
17971 else
17972     LIB_LINKAGE=STAT
17973     LT_LIB_LINKAGE=static
17974 fi
17975
17976 if test "$ac_cv_mingw32" = yes ; then
17977     PLAT=NT
17978     DYN_EXT=dll
17979 else
17980     PLAT=UNIX
17981     DYN_EXT=so
17982 fi
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992   
17993   
17994   
17995   
17996   
17997   
17998   
17999   
18000   
18001   
18002   
18003   
18004   
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 trap '' 1 2 15
18054
18055 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
18056
18057 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18058 # Let make expand exec_prefix.
18059 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18060
18061 # Any assignment to VPATH causes Sun make to only execute
18062 # the first set of double-colon rules, so remove it if not needed.
18063 # If there is a colon in the path, we need to keep it.
18064 if test "x$srcdir" = x.; then
18065   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
18066 fi
18067
18068 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
18069
18070 DEFS=-DHAVE_CONFIG_H
18071
18072 # Without the "./", some shells look in PATH for config.status.
18073 : ${CONFIG_STATUS=./config.status}
18074
18075 echo creating $CONFIG_STATUS
18076 rm -f $CONFIG_STATUS
18077 cat > $CONFIG_STATUS <<EOF
18078 #! /bin/sh
18079 # Generated automatically by configure.
18080 # Run this file to recreate the current configuration.
18081 # This directory was configured as follows,
18082 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
18083 #
18084 # $0 $ac_configure_args
18085 #
18086 # Compiler output produced by configure, useful for debugging
18087 # configure, is in ./config.log if it exists.
18088
18089 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
18090 for ac_option
18091 do
18092   case "\$ac_option" in
18093   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18094     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
18095     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
18096   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
18097     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
18098     exit 0 ;;
18099   -help | --help | --hel | --he | --h)
18100     echo "\$ac_cs_usage"; exit 0 ;;
18101   *) echo "\$ac_cs_usage"; exit 1 ;;
18102   esac
18103 done
18104
18105 ac_given_srcdir=$srcdir
18106 ac_given_INSTALL="$INSTALL"
18107
18108 trap 'rm -fr `echo "\
18109 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18110 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18111 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18112 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18113 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18114 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18115 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18116 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18117 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18118 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18119 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18120 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18121 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18122 include/Makefile:build/top.mk:include/Makefile.in \
18123 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18124 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18125 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18126 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18127 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18128 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18129 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18130 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18131 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18132 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18133 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18134 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18135 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18136 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18137 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18138 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18139 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18140 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18141 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18142 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18143 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18144 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18145 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18146 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18147 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18148 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18149 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18150 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18151  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
18152 EOF
18153 cat >> $CONFIG_STATUS <<EOF
18154
18155 # Protect against being on the right side of a sed subst in config.status.
18156 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
18157  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
18158 $ac_vpsub
18159 $extrasub
18160 s%@SHELL@%$SHELL%g
18161 s%@CFLAGS@%$CFLAGS%g
18162 s%@CPPFLAGS@%$CPPFLAGS%g
18163 s%@CXXFLAGS@%$CXXFLAGS%g
18164 s%@FFLAGS@%$FFLAGS%g
18165 s%@DEFS@%$DEFS%g
18166 s%@LDFLAGS@%$LDFLAGS%g
18167 s%@LIBS@%$LIBS%g
18168 s%@exec_prefix@%$exec_prefix%g
18169 s%@prefix@%$prefix%g
18170 s%@program_transform_name@%$program_transform_name%g
18171 s%@bindir@%$bindir%g
18172 s%@sbindir@%$sbindir%g
18173 s%@libexecdir@%$libexecdir%g
18174 s%@datadir@%$datadir%g
18175 s%@sysconfdir@%$sysconfdir%g
18176 s%@sharedstatedir@%$sharedstatedir%g
18177 s%@localstatedir@%$localstatedir%g
18178 s%@libdir@%$libdir%g
18179 s%@includedir@%$includedir%g
18180 s%@oldincludedir@%$oldincludedir%g
18181 s%@infodir@%$infodir%g
18182 s%@mandir@%$mandir%g
18183 s%@host@%$host%g
18184 s%@host_alias@%$host_alias%g
18185 s%@host_cpu@%$host_cpu%g
18186 s%@host_vendor@%$host_vendor%g
18187 s%@host_os@%$host_os%g
18188 s%@target@%$target%g
18189 s%@target_alias@%$target_alias%g
18190 s%@target_cpu@%$target_cpu%g
18191 s%@target_vendor@%$target_vendor%g
18192 s%@target_os@%$target_os%g
18193 s%@build@%$build%g
18194 s%@build_alias@%$build_alias%g
18195 s%@build_cpu@%$build_cpu%g
18196 s%@build_vendor@%$build_vendor%g
18197 s%@build_os@%$build_os%g
18198 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
18199 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
18200 s%@INSTALL_DATA@%$INSTALL_DATA%g
18201 s%@PACKAGE@%$PACKAGE%g
18202 s%@VERSION@%$VERSION%g
18203 s%@ACLOCAL@%$ACLOCAL%g
18204 s%@AUTOCONF@%$AUTOCONF%g
18205 s%@AUTOMAKE@%$AUTOMAKE%g
18206 s%@AUTOHEADER@%$AUTOHEADER%g
18207 s%@MAKEINFO@%$MAKEINFO%g
18208 s%@install_sh@%$install_sh%g
18209 s%@AMTAR@%$AMTAR%g
18210 s%@AWK@%$AWK%g
18211 s%@AMTARFLAGS@%$AMTARFLAGS%g
18212 s%@SET_MAKE@%$SET_MAKE%g
18213 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
18214 s%@top_builddir@%$top_builddir%g
18215 s%@ldap_subdir@%$ldap_subdir%g
18216 s%@CC@%$CC%g
18217 s%@AR@%$AR%g
18218 s%@RANLIB@%$RANLIB%g
18219 s%@LN_S@%$LN_S%g
18220 s%@DLLTOOL@%$DLLTOOL%g
18221 s%@AS@%$AS%g
18222 s%@OBJDUMP@%$OBJDUMP%g
18223 s%@LIBTOOL@%$LIBTOOL%g
18224 s%@LN_H@%$LN_H%g
18225 s%@SENDMAIL@%$SENDMAIL%g
18226 s%@EDITOR@%$EDITOR%g
18227 s%@FINGER@%$FINGER%g
18228 s%@PERLBIN@%$PERLBIN%g
18229 s%@CPP@%$CPP%g
18230 s%@EXEEXT@%$EXEEXT%g
18231 s%@OBJEXT@%$OBJEXT%g
18232 s%@OL_MKDEP@%$OL_MKDEP%g
18233 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
18234 s%@LIBOBJS@%$LIBOBJS%g
18235 s%@LIBSRCS@%$LIBSRCS%g
18236 s%@PLAT@%$PLAT%g
18237 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
18238 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
18239 s%@DYN_EXT@%$DYN_EXT%g
18240 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
18241 s%@BUILD_BDB@%$BUILD_BDB%g
18242 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
18243 s%@BUILD_LDAP@%$BUILD_LDAP%g
18244 s%@BUILD_LDBM@%$BUILD_LDBM%g
18245 s%@BUILD_META@%$BUILD_META%g
18246 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18247 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18248 s%@BUILD_PERL@%$BUILD_PERL%g
18249 s%@BUILD_SHELL@%$BUILD_SHELL%g
18250 s%@BUILD_SQL@%$BUILD_SQL%g
18251 s%@BUILD_TCL@%$BUILD_TCL%g
18252 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18253 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18254 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18255 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18256 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18257 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18258 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18259 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18260 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18261 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18262 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18263 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18264 s%@LDBM_LIB@%$LDBM_LIB%g
18265 s%@LDAP_LIBS@%$LDAP_LIBS%g
18266 s%@LDIF_LIBS@%$LDIF_LIBS%g
18267 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18268 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18269 s%@LDBM_LIBS@%$LDBM_LIBS%g
18270 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18271 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18272 s%@WRAP_LIBS@%$WRAP_LIBS%g
18273 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18274 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
18275 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18276 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18277 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18278 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18279 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18280 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18281 s%@KRB4_LIBS@%$KRB4_LIBS%g
18282 s%@KRB5_LIBS@%$KRB5_LIBS%g
18283 s%@READLINE_LIBS@%$READLINE_LIBS%g
18284 s%@SASL_LIBS@%$SASL_LIBS%g
18285 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18286 s%@TLS_LIBS@%$TLS_LIBS%g
18287 s%@MODULES_LIBS@%$MODULES_LIBS%g
18288 s%@AUTH_LIBS@%$AUTH_LIBS%g
18289 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18290 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18291 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18292 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18293
18294 CEOF
18295 EOF
18296
18297 cat >> $CONFIG_STATUS <<\EOF
18298
18299 # Split the substitutions into bite-sized pieces for seds with
18300 # small command number limits, like on Digital OSF/1 and HP-UX.
18301 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18302 ac_file=1 # Number of current file.
18303 ac_beg=1 # First line for current file.
18304 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18305 ac_more_lines=:
18306 ac_sed_cmds=""
18307 while $ac_more_lines; do
18308   if test $ac_beg -gt 1; then
18309     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18310   else
18311     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18312   fi
18313   if test ! -s conftest.s$ac_file; then
18314     ac_more_lines=false
18315     rm -f conftest.s$ac_file
18316   else
18317     if test -z "$ac_sed_cmds"; then
18318       ac_sed_cmds="sed -f conftest.s$ac_file"
18319     else
18320       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18321     fi
18322     ac_file=`expr $ac_file + 1`
18323     ac_beg=$ac_end
18324     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18325   fi
18326 done
18327 if test -z "$ac_sed_cmds"; then
18328   ac_sed_cmds=cat
18329 fi
18330 EOF
18331
18332 cat >> $CONFIG_STATUS <<EOF
18333
18334 CONFIG_FILES=\${CONFIG_FILES-"\
18335 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18336 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18337 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18338 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18339 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18340 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18341 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18342 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18343 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18344 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18345 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18346 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18347 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18348 include/Makefile:build/top.mk:include/Makefile.in \
18349 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18350 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18351 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18352 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18353 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18354 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18355 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18356 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18357 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18358 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18359 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18360 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18361 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18362 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18363 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18364 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18365 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18366 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18367 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18368 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18369 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18370 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18371 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18372 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18373 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18374 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18375 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18376 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18377 "}
18378 EOF
18379 cat >> $CONFIG_STATUS <<\EOF
18380 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18381   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18382   case "$ac_file" in
18383   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18384        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18385   *) ac_file_in="${ac_file}.in" ;;
18386   esac
18387
18388   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18389
18390   # Remove last slash and all that follows it.  Not all systems have dirname.
18391   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18392   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18393     # The file is in a subdirectory.
18394     test ! -d "$ac_dir" && mkdir "$ac_dir"
18395     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18396     # A "../" for each directory in $ac_dir_suffix.
18397     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18398   else
18399     ac_dir_suffix= ac_dots=
18400   fi
18401
18402   case "$ac_given_srcdir" in
18403   .)  srcdir=.
18404       if test -z "$ac_dots"; then top_srcdir=.
18405       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18406   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18407   *) # Relative path.
18408     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18409     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18410   esac
18411
18412   case "$ac_given_INSTALL" in
18413   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18414   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18415   esac
18416
18417   echo creating "$ac_file"
18418   rm -f "$ac_file"
18419   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18420   case "$ac_file" in
18421   *[Mm]akefile*) ac_comsub="1i\\
18422 # $configure_input" ;;
18423   *) ac_comsub= ;;
18424   esac
18425
18426   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18427   sed -e "$ac_comsub
18428 s%@configure_input@%$configure_input%g
18429 s%@srcdir@%$srcdir%g
18430 s%@top_srcdir@%$top_srcdir%g
18431 s%@INSTALL@%$INSTALL%g
18432 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18433 fi; done
18434 rm -f conftest.s*
18435
18436 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18437 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18438 #
18439 # ac_d sets the value in "#define NAME VALUE" lines.
18440 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18441 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18442 ac_dC='\3'
18443 ac_dD='%g'
18444 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18445 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18446 ac_uB='\([      ]\)%\1#\2define\3'
18447 ac_uC=' '
18448 ac_uD='\4%g'
18449 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18450 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18451 ac_eB='$%\1#\2define\3'
18452 ac_eC=' '
18453 ac_eD='%g'
18454
18455 if test "${CONFIG_HEADERS+set}" != set; then
18456 EOF
18457 cat >> $CONFIG_STATUS <<EOF
18458   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18459 EOF
18460 cat >> $CONFIG_STATUS <<\EOF
18461 fi
18462 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18463   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18464   case "$ac_file" in
18465   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18466        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18467   *) ac_file_in="${ac_file}.in" ;;
18468   esac
18469
18470   echo creating $ac_file
18471
18472   rm -f conftest.frag conftest.in conftest.out
18473   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18474   cat $ac_file_inputs > conftest.in
18475
18476 EOF
18477
18478 # Transform confdefs.h into a sed script conftest.vals that substitutes
18479 # the proper values into config.h.in to produce config.h.  And first:
18480 # Protect against being on the right side of a sed subst in config.status.
18481 # Protect against being in an unquoted here document in config.status.
18482 rm -f conftest.vals
18483 cat > conftest.hdr <<\EOF
18484 s/[\\&%]/\\&/g
18485 s%[\\$`]%\\&%g
18486 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18487 s%ac_d%ac_u%gp
18488 s%ac_u%ac_e%gp
18489 EOF
18490 sed -n -f conftest.hdr confdefs.h > conftest.vals
18491 rm -f conftest.hdr
18492
18493 # This sed command replaces #undef with comments.  This is necessary, for
18494 # example, in the case of _POSIX_SOURCE, which is predefined and required
18495 # on some systems where configure will not decide to define it.
18496 cat >> conftest.vals <<\EOF
18497 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18498 EOF
18499
18500 # Break up conftest.vals because some shells have a limit on
18501 # the size of here documents, and old seds have small limits too.
18502
18503 rm -f conftest.tail
18504 while :
18505 do
18506   ac_lines=`grep -c . conftest.vals`
18507   # grep -c gives empty output for an empty file on some AIX systems.
18508   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18509   # Write a limited-size here document to conftest.frag.
18510   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18511   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18512   echo 'CEOF
18513   sed -f conftest.frag conftest.in > conftest.out
18514   rm -f conftest.in
18515   mv conftest.out conftest.in
18516 ' >> $CONFIG_STATUS
18517   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18518   rm -f conftest.vals
18519   mv conftest.tail conftest.vals
18520 done
18521 rm -f conftest.vals
18522
18523 cat >> $CONFIG_STATUS <<\EOF
18524   rm -f conftest.frag conftest.h
18525   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18526   cat conftest.in >> conftest.h
18527   rm -f conftest.in
18528   if cmp -s $ac_file conftest.h 2>/dev/null; then
18529     echo "$ac_file is unchanged"
18530     rm -f conftest.h
18531   else
18532     # Remove last slash and all that follows it.  Not all systems have dirname.
18533       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18534       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18535       # The file is in a subdirectory.
18536       test ! -d "$ac_dir" && mkdir "$ac_dir"
18537     fi
18538     rm -f $ac_file
18539     mv conftest.h $ac_file
18540   fi
18541 fi; done
18542
18543 EOF
18544 cat >> $CONFIG_STATUS <<EOF
18545
18546 EOF
18547 cat >> $CONFIG_STATUS <<\EOF
18548
18549 date > stamp-h
18550 echo Please \"make depend\" to build dependencies
18551
18552 exit 0
18553 EOF
18554 chmod +x $CONFIG_STATUS
18555 rm -fr confdefs* $ac_clean_files
18556 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18557