]> git.sur5r.net Git - openldap/blob - configure
2a95efa69512ec0f878159681d6593012139b263
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.369 2001/10/04 13:28:01 ando 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_module = 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         fi
2628         ol_with_kerberos=yes
2629 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2630         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2631                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2632         fi
2633         ol_with_kerberos=no
2634 fi
2635
2636 if test $ol_enable_spasswd = yes ; then
2637         if test $ol_with_cyrus_sasl = no ; then
2638                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2639         fi
2640         ol_with_cyrus_sasl=yes
2641 fi
2642
2643 echo "$ac_t""done" 1>&6
2644
2645 LDAP_LIBS=
2646 LDIF_LIBS=
2647 LDBM_LIB=
2648 LDBM_LIBS=
2649 LTHREAD_LIBS=
2650 LUTIL_LIBS=
2651
2652 SLAPD_LIBS=
2653 SLURPD_LIBS=
2654
2655 BUILD_SLAPD=no
2656 BUILD_SLURPD=no
2657
2658 BUILD_THREAD=no
2659
2660 BUILD_BDB=no
2661 BUILD_DNSSRV=no
2662 BUILD_LDAP=no
2663 BUILD_LDBM=no
2664 BUILD_META=no
2665 BUILD_MONITOR=no
2666 BUILD_PASSWD=no
2667 BUILD_PERL=no
2668 BUILD_SHELL=no
2669 BUILD_SQL=no
2670 BUILD_TCL=no
2671
2672 BUILD_BDB_DYNAMIC=static
2673 BUILD_DNSSRV_DYNAMIC=static
2674 BUILD_LDAP_DYNAMIC=static
2675 BUILD_LDBM_DYNAMIC=static
2676 BUILD_META_DYNAMIC=static
2677 BUILD_MONITOR_DYNAMIC=static
2678 BUILD_PASSWD_DYNAMIC=static
2679 BUILD_PERL_DYNAMIC=static
2680 BUILD_SHELL_DYNAMIC=static
2681 BUILD_TCL_DYNAMIC=static
2682 BUILD_SQL_DYNAMIC=static
2683
2684 SLAPD_MODULES_LDFLAGS=
2685 SLAPD_MODULES_CPPFLAGS=
2686 SLAPD_MODULES_LIST=
2687
2688 SLAPD_PERL_LDFLAGS=
2689 MOD_PERL_LDFLAGS=
2690 PERL_CPPFLAGS=
2691
2692 SLAPD_SQL_LDFLAGS=
2693 SLAPD_SQL_LIBS=
2694 SLAPD_SQL_INCLUDES=
2695
2696 MOD_TCL_LIB=
2697 KRB4_LIBS=
2698 KRB5_LIBS=
2699 READLINE_LIBS=
2700 SASL_LIBS=
2701 TERMCAP_LIBS=
2702 TLS_LIBS=
2703 MODULES_LIBS=
2704 AUTH_LIBS=
2705
2706 SLAPD_SLP_LIBS=
2707
2708
2709
2710 cat >> confdefs.h <<\EOF
2711 #define HAVE_MKVERSION 1
2712 EOF
2713
2714
2715
2716
2717 ol_aix_threads=no
2718 case "$target" in
2719 *-*-aix*)       if test -z "$CC" ; then
2720                 case "$ol_with_threads" in
2721                 auto | yes |  posix) ol_aix_threads=yes ;;
2722                 esac
2723         fi
2724 ;;
2725 esac
2726
2727 if test $ol_aix_threads = yes ; then
2728         if test -z "${CC}" ; then
2729                 for ac_prog in cc_r xlc_r cc
2730 do
2731 # Extract the first word of "$ac_prog", so it can be a program name with args.
2732 set dummy $ac_prog; ac_word=$2
2733 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2734 echo "configure:2735: checking for $ac_word" >&5
2735 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2736   echo $ac_n "(cached) $ac_c" 1>&6
2737 else
2738   if test -n "$CC"; then
2739   ac_cv_prog_CC="$CC" # Let the user override the test.
2740 else
2741   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2742   ac_dummy="$PATH"
2743   for ac_dir in $ac_dummy; do
2744     test -z "$ac_dir" && ac_dir=.
2745     if test -f $ac_dir/$ac_word; then
2746       ac_cv_prog_CC="$ac_prog"
2747       break
2748     fi
2749   done
2750   IFS="$ac_save_ifs"
2751 fi
2752 fi
2753 CC="$ac_cv_prog_CC"
2754 if test -n "$CC"; then
2755   echo "$ac_t""$CC" 1>&6
2756 else
2757   echo "$ac_t""no" 1>&6
2758 fi
2759
2760 test -n "$CC" && break
2761 done
2762
2763
2764                 if test "$CC" = cc ; then
2765                                                 if test $ol_with_threads != auto ; then
2766                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2767                         else
2768                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2769                         fi
2770                         ol_with_threads=no
2771                 fi
2772         fi
2773
2774         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2775                 ol_with_threads=posix
2776                 ol_cv_pthread_create=yes
2777         fi
2778 fi
2779
2780 if test -z "${CC}"; then
2781         for ac_prog in cc
2782 do
2783 # Extract the first word of "$ac_prog", so it can be a program name with args.
2784 set dummy $ac_prog; ac_word=$2
2785 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2786 echo "configure:2787: checking for $ac_word" >&5
2787 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2788   echo $ac_n "(cached) $ac_c" 1>&6
2789 else
2790   if test -n "$CC"; then
2791   ac_cv_prog_CC="$CC" # Let the user override the test.
2792 else
2793   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2794   ac_dummy="$PATH"
2795   for ac_dir in $ac_dummy; do
2796     test -z "$ac_dir" && ac_dir=.
2797     if test -f $ac_dir/$ac_word; then
2798       ac_cv_prog_CC="$ac_prog"
2799       break
2800     fi
2801   done
2802   IFS="$ac_save_ifs"
2803 fi
2804 fi
2805 CC="$ac_cv_prog_CC"
2806 if test -n "$CC"; then
2807   echo "$ac_t""$CC" 1>&6
2808 else
2809   echo "$ac_t""no" 1>&6
2810 fi
2811
2812 test -n "$CC" && break
2813 done
2814
2815 fi
2816
2817
2818
2819
2820 # Check whether --enable-fast-install or --disable-fast-install was given.
2821 if test "${enable_fast_install+set}" = set; then
2822   enableval="$enable_fast_install"
2823   p=${PACKAGE-default}
2824 case "$enableval" in
2825 yes) enable_fast_install=yes ;;
2826 no) enable_fast_install=no ;;
2827 *)
2828   enable_fast_install=no
2829   # Look at the argument we got.  We use all the common list separators.
2830   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2831   for pkg in $enableval; do
2832     if test "X$pkg" = "X$p"; then
2833       enable_fast_install=yes
2834     fi
2835   done
2836   IFS="$ac_save_ifs"
2837   ;;
2838 esac
2839 else
2840   enable_fast_install=yes
2841 fi
2842
2843 # Extract the first word of "ranlib", so it can be a program name with args.
2844 set dummy ranlib; ac_word=$2
2845 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2846 echo "configure:2847: checking for $ac_word" >&5
2847 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2848   echo $ac_n "(cached) $ac_c" 1>&6
2849 else
2850   if test -n "$RANLIB"; then
2851   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2852 else
2853   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2854   ac_dummy="$PATH"
2855   for ac_dir in $ac_dummy; do
2856     test -z "$ac_dir" && ac_dir=.
2857     if test -f $ac_dir/$ac_word; then
2858       ac_cv_prog_RANLIB="ranlib"
2859       break
2860     fi
2861   done
2862   IFS="$ac_save_ifs"
2863   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2864 fi
2865 fi
2866 RANLIB="$ac_cv_prog_RANLIB"
2867 if test -n "$RANLIB"; then
2868   echo "$ac_t""$RANLIB" 1>&6
2869 else
2870   echo "$ac_t""no" 1>&6
2871 fi
2872
2873 # Extract the first word of "gcc", so it can be a program name with args.
2874 set dummy gcc; ac_word=$2
2875 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2876 echo "configure:2877: checking for $ac_word" >&5
2877 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2878   echo $ac_n "(cached) $ac_c" 1>&6
2879 else
2880   if test -n "$CC"; then
2881   ac_cv_prog_CC="$CC" # Let the user override the test.
2882 else
2883   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2884   ac_dummy="$PATH"
2885   for ac_dir in $ac_dummy; do
2886     test -z "$ac_dir" && ac_dir=.
2887     if test -f $ac_dir/$ac_word; then
2888       ac_cv_prog_CC="gcc"
2889       break
2890     fi
2891   done
2892   IFS="$ac_save_ifs"
2893 fi
2894 fi
2895 CC="$ac_cv_prog_CC"
2896 if test -n "$CC"; then
2897   echo "$ac_t""$CC" 1>&6
2898 else
2899   echo "$ac_t""no" 1>&6
2900 fi
2901
2902 if test -z "$CC"; then
2903   # Extract the first word of "cc", so it can be a program name with args.
2904 set dummy cc; ac_word=$2
2905 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2906 echo "configure:2907: checking for $ac_word" >&5
2907 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2908   echo $ac_n "(cached) $ac_c" 1>&6
2909 else
2910   if test -n "$CC"; then
2911   ac_cv_prog_CC="$CC" # Let the user override the test.
2912 else
2913   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2914   ac_prog_rejected=no
2915   ac_dummy="$PATH"
2916   for ac_dir in $ac_dummy; do
2917     test -z "$ac_dir" && ac_dir=.
2918     if test -f $ac_dir/$ac_word; then
2919       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2920         ac_prog_rejected=yes
2921         continue
2922       fi
2923       ac_cv_prog_CC="cc"
2924       break
2925     fi
2926   done
2927   IFS="$ac_save_ifs"
2928 if test $ac_prog_rejected = yes; then
2929   # We found a bogon in the path, so make sure we never use it.
2930   set dummy $ac_cv_prog_CC
2931   shift
2932   if test $# -gt 0; then
2933     # We chose a different compiler from the bogus one.
2934     # However, it has the same basename, so the bogon will be chosen
2935     # first if we set CC to just the basename; use the full file name.
2936     shift
2937     set dummy "$ac_dir/$ac_word" "$@"
2938     shift
2939     ac_cv_prog_CC="$@"
2940   fi
2941 fi
2942 fi
2943 fi
2944 CC="$ac_cv_prog_CC"
2945 if test -n "$CC"; then
2946   echo "$ac_t""$CC" 1>&6
2947 else
2948   echo "$ac_t""no" 1>&6
2949 fi
2950
2951   if test -z "$CC"; then
2952     case "`uname -s`" in
2953     *win32* | *WIN32* | *CYGWIN*)
2954       # Extract the first word of "cl", so it can be a program name with args.
2955 set dummy cl; ac_word=$2
2956 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2957 echo "configure:2958: checking for $ac_word" >&5
2958 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2959   echo $ac_n "(cached) $ac_c" 1>&6
2960 else
2961   if test -n "$CC"; then
2962   ac_cv_prog_CC="$CC" # Let the user override the test.
2963 else
2964   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2965   ac_dummy="$PATH"
2966   for ac_dir in $ac_dummy; do
2967     test -z "$ac_dir" && ac_dir=.
2968     if test -f $ac_dir/$ac_word; then
2969       ac_cv_prog_CC="cl"
2970       break
2971     fi
2972   done
2973   IFS="$ac_save_ifs"
2974 fi
2975 fi
2976 CC="$ac_cv_prog_CC"
2977 if test -n "$CC"; then
2978   echo "$ac_t""$CC" 1>&6
2979 else
2980   echo "$ac_t""no" 1>&6
2981 fi
2982  ;;
2983     esac
2984   fi
2985   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2986 fi
2987
2988 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2989 echo "configure:2990: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2990
2991 ac_ext=c
2992 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2993 ac_cpp='$CPP $CPPFLAGS'
2994 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2995 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2996 cross_compiling=$ac_cv_prog_cc_cross
2997
2998 cat > conftest.$ac_ext << EOF
2999
3000 #line 3001 "configure"
3001 #include "confdefs.h"
3002
3003 main(){return(0);}
3004 EOF
3005 if { (eval echo configure:3006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3006   ac_cv_prog_cc_works=yes
3007   # If we can't run a trivial program, we are probably using a cross compiler.
3008   if (./conftest; exit) 2>/dev/null; then
3009     ac_cv_prog_cc_cross=no
3010   else
3011     ac_cv_prog_cc_cross=yes
3012   fi
3013 else
3014   echo "configure: failed program was:" >&5
3015   cat conftest.$ac_ext >&5
3016   ac_cv_prog_cc_works=no
3017 fi
3018 rm -fr conftest*
3019 ac_ext=c
3020 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3021 ac_cpp='$CPP $CPPFLAGS'
3022 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
3023 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
3024 cross_compiling=$ac_cv_prog_cc_cross
3025
3026 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
3027 if test $ac_cv_prog_cc_works = no; then
3028   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3029 fi
3030 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3031 echo "configure:3032: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
3032 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3033 cross_compiling=$ac_cv_prog_cc_cross
3034
3035 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3036 echo "configure:3037: checking whether we are using GNU C" >&5
3037 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
3038   echo $ac_n "(cached) $ac_c" 1>&6
3039 else
3040   cat > conftest.c <<EOF
3041 #ifdef __GNUC__
3042   yes;
3043 #endif
3044 EOF
3045 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3046   ac_cv_prog_gcc=yes
3047 else
3048   ac_cv_prog_gcc=no
3049 fi
3050 fi
3051
3052 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
3053
3054 if test $ac_cv_prog_gcc = yes; then
3055   GCC=yes
3056 else
3057   GCC=
3058 fi
3059
3060 ac_test_CFLAGS="${CFLAGS+set}"
3061 ac_save_CFLAGS="$CFLAGS"
3062 CFLAGS=
3063 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3064 echo "configure:3065: checking whether ${CC-cc} accepts -g" >&5
3065 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
3066   echo $ac_n "(cached) $ac_c" 1>&6
3067 else
3068   echo 'void f(){}' > conftest.c
3069 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
3070   ac_cv_prog_cc_g=yes
3071 else
3072   ac_cv_prog_cc_g=no
3073 fi
3074 rm -f conftest*
3075
3076 fi
3077
3078 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
3079 if test "$ac_test_CFLAGS" = set; then
3080   CFLAGS="$ac_save_CFLAGS"
3081 elif test $ac_cv_prog_cc_g = yes; then
3082   if test "$GCC" = yes; then
3083     CFLAGS="-g -O2"
3084   else
3085     CFLAGS="-g"
3086   fi
3087 else
3088   if test "$GCC" = yes; then
3089     CFLAGS="-O2"
3090   else
3091     CFLAGS=
3092   fi
3093 fi
3094
3095 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3096 if test "${with_gnu_ld+set}" = set; then
3097   withval="$with_gnu_ld"
3098   test "$withval" = no || with_gnu_ld=yes
3099 else
3100   with_gnu_ld=no
3101 fi
3102
3103 ac_prog=ld
3104 if test "$ac_cv_prog_gcc" = yes; then
3105   # Check if gcc -print-prog-name=ld gives a path.
3106   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3107 echo "configure:3108: checking for ld used by GCC" >&5
3108   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3109   case "$ac_prog" in
3110     # Accept absolute paths.
3111     [\\/]* | [A-Za-z]:[\\/]*)
3112       re_direlt='/[^/][^/]*/\.\./'
3113       # Canonicalize the path of ld
3114       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3115       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3116         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3117       done
3118       test -z "$LD" && LD="$ac_prog"
3119       ;;
3120   "")
3121     # If it fails, then pretend we aren't using GCC.
3122     ac_prog=ld
3123     ;;
3124   *)
3125     # If it is relative, then search for the first ld in PATH.
3126     with_gnu_ld=unknown
3127     ;;
3128   esac
3129 elif test "$with_gnu_ld" = yes; then
3130   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3131 echo "configure:3132: checking for GNU ld" >&5
3132 else
3133   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3134 echo "configure:3135: checking for non-GNU ld" >&5
3135 fi
3136 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3137   echo $ac_n "(cached) $ac_c" 1>&6
3138 else
3139   if test -z "$LD"; then
3140   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3141   for ac_dir in $PATH; do
3142     test -z "$ac_dir" && ac_dir=.
3143     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3144       ac_cv_path_LD="$ac_dir/$ac_prog"
3145       # Check to see if the program is GNU ld.  I'd rather use --version,
3146       # but apparently some GNU ld's only accept -v.
3147       # Break only if it was the GNU/non-GNU ld that we prefer.
3148       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3149         test "$with_gnu_ld" != no && break
3150       else
3151         test "$with_gnu_ld" != yes && break
3152       fi
3153     fi
3154   done
3155   IFS="$ac_save_ifs"
3156 else
3157   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3158 fi
3159 fi
3160
3161 LD="$ac_cv_path_LD"
3162 if test -n "$LD"; then
3163   echo "$ac_t""$LD" 1>&6
3164 else
3165   echo "$ac_t""no" 1>&6
3166 fi
3167 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3168 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3169 echo "configure:3170: checking if the linker ($LD) is GNU ld" >&5
3170 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3171   echo $ac_n "(cached) $ac_c" 1>&6
3172 else
3173   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3174 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3175   ac_cv_prog_gnu_ld=yes
3176 else
3177   ac_cv_prog_gnu_ld=no
3178 fi
3179 fi
3180
3181 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3182
3183
3184 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3185 echo "configure:3186: checking for BSD-compatible nm" >&5
3186 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3187   echo $ac_n "(cached) $ac_c" 1>&6
3188 else
3189   if test -n "$NM"; then
3190   # Let the user override the test.
3191   ac_cv_path_NM="$NM"
3192 else
3193   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3194   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3195     test -z "$ac_dir" && ac_dir=.
3196     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3197       # Check to see if the nm accepts a BSD-compat flag.
3198       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3199       #   nm: unknown option "B" ignored
3200       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3201         ac_cv_path_NM="$ac_dir/nm -B"
3202         break
3203       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3204         ac_cv_path_NM="$ac_dir/nm -p"
3205         break
3206       else
3207         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3208         continue # so that we can try to find one that supports BSD flags
3209       fi
3210     fi
3211   done
3212   IFS="$ac_save_ifs"
3213   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3214 fi
3215 fi
3216
3217 NM="$ac_cv_path_NM"
3218 echo "$ac_t""$NM" 1>&6
3219
3220 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3221 echo "configure:3222: checking whether ln -s works" >&5
3222 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3223   echo $ac_n "(cached) $ac_c" 1>&6
3224 else
3225   rm -f conftestdata
3226 if ln -s X conftestdata 2>/dev/null
3227 then
3228   rm -f conftestdata
3229   ac_cv_prog_LN_S="ln -s"
3230 else
3231   ac_cv_prog_LN_S=ln
3232 fi
3233 fi
3234 LN_S="$ac_cv_prog_LN_S"
3235 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3236   echo "$ac_t""yes" 1>&6
3237 else
3238   echo "$ac_t""no" 1>&6
3239 fi
3240
3241 if test $host != $build; then
3242   ac_tool_prefix=${host_alias}-
3243 else
3244   ac_tool_prefix=
3245 fi
3246
3247
3248 case "$target" in
3249 NONE) lt_target="$host" ;;
3250 *) lt_target="$target" ;;
3251 esac
3252
3253 # Check for any special flags to pass to ltconfig.
3254 libtool_flags="--cache-file=$cache_file"
3255 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3256 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3257 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3258 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3259 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3260 libtool_flags="$libtool_flags --enable-dlopen"
3261 libtool_flags="$libtool_flags --enable-win32-dll"
3262 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3263 if test "${enable_libtool_lock+set}" = set; then
3264   enableval="$enable_libtool_lock"
3265   :
3266 fi
3267
3268 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3269 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3270
3271 # Some flags need to be propagated to the compiler or linker for good
3272 # libtool support.
3273 case "$lt_target" in
3274 *-*-irix6*)
3275   # Find out which ABI we are using.
3276   echo '#line 3277 "configure"' > conftest.$ac_ext
3277   if { (eval echo configure:3278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3278     case "`/usr/bin/file conftest.o`" in
3279     *32-bit*)
3280       LD="${LD-ld} -32"
3281       ;;
3282     *N32*)
3283       LD="${LD-ld} -n32"
3284       ;;
3285     *64-bit*)
3286       LD="${LD-ld} -64"
3287       ;;
3288     esac
3289   fi
3290   rm -rf conftest*
3291   ;;
3292
3293 *-*-sco3.2v5*)
3294   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3295   SAVE_CFLAGS="$CFLAGS"
3296   CFLAGS="$CFLAGS -belf"
3297   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3298 echo "configure:3299: checking whether the C compiler needs -belf" >&5
3299 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3300   echo $ac_n "(cached) $ac_c" 1>&6
3301 else
3302   cat > conftest.$ac_ext <<EOF
3303 #line 3304 "configure"
3304 #include "confdefs.h"
3305
3306 int main() {
3307
3308 ; return 0; }
3309 EOF
3310 if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3311   rm -rf conftest*
3312   lt_cv_cc_needs_belf=yes
3313 else
3314   echo "configure: failed program was:" >&5
3315   cat conftest.$ac_ext >&5
3316   rm -rf conftest*
3317   lt_cv_cc_needs_belf=no
3318 fi
3319 rm -f conftest*
3320 fi
3321
3322 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3323   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3324     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3325     CFLAGS="$SAVE_CFLAGS"
3326   fi
3327   ;;
3328
3329 *-*-cygwin* | *-*-mingw*)
3330   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3331 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3332 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3333 echo "configure:3334: checking for $ac_word" >&5
3334 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3335   echo $ac_n "(cached) $ac_c" 1>&6
3336 else
3337   if test -n "$DLLTOOL"; then
3338   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3339 else
3340   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3341   ac_dummy="$PATH"
3342   for ac_dir in $ac_dummy; do
3343     test -z "$ac_dir" && ac_dir=.
3344     if test -f $ac_dir/$ac_word; then
3345       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3346       break
3347     fi
3348   done
3349   IFS="$ac_save_ifs"
3350 fi
3351 fi
3352 DLLTOOL="$ac_cv_prog_DLLTOOL"
3353 if test -n "$DLLTOOL"; then
3354   echo "$ac_t""$DLLTOOL" 1>&6
3355 else
3356   echo "$ac_t""no" 1>&6
3357 fi
3358
3359
3360 if test -z "$ac_cv_prog_DLLTOOL"; then
3361 if test -n "$ac_tool_prefix"; then
3362   # Extract the first word of "dlltool", so it can be a program name with args.
3363 set dummy dlltool; ac_word=$2
3364 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3365 echo "configure:3366: checking for $ac_word" >&5
3366 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3367   echo $ac_n "(cached) $ac_c" 1>&6
3368 else
3369   if test -n "$DLLTOOL"; then
3370   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3371 else
3372   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3373   ac_dummy="$PATH"
3374   for ac_dir in $ac_dummy; do
3375     test -z "$ac_dir" && ac_dir=.
3376     if test -f $ac_dir/$ac_word; then
3377       ac_cv_prog_DLLTOOL="dlltool"
3378       break
3379     fi
3380   done
3381   IFS="$ac_save_ifs"
3382   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3383 fi
3384 fi
3385 DLLTOOL="$ac_cv_prog_DLLTOOL"
3386 if test -n "$DLLTOOL"; then
3387   echo "$ac_t""$DLLTOOL" 1>&6
3388 else
3389   echo "$ac_t""no" 1>&6
3390 fi
3391
3392 else
3393   DLLTOOL="false"
3394 fi
3395 fi
3396
3397   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3398 set dummy ${ac_tool_prefix}as; ac_word=$2
3399 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3400 echo "configure:3401: checking for $ac_word" >&5
3401 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3402   echo $ac_n "(cached) $ac_c" 1>&6
3403 else
3404   if test -n "$AS"; then
3405   ac_cv_prog_AS="$AS" # Let the user override the test.
3406 else
3407   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3408   ac_dummy="$PATH"
3409   for ac_dir in $ac_dummy; do
3410     test -z "$ac_dir" && ac_dir=.
3411     if test -f $ac_dir/$ac_word; then
3412       ac_cv_prog_AS="${ac_tool_prefix}as"
3413       break
3414     fi
3415   done
3416   IFS="$ac_save_ifs"
3417 fi
3418 fi
3419 AS="$ac_cv_prog_AS"
3420 if test -n "$AS"; then
3421   echo "$ac_t""$AS" 1>&6
3422 else
3423   echo "$ac_t""no" 1>&6
3424 fi
3425
3426
3427 if test -z "$ac_cv_prog_AS"; then
3428 if test -n "$ac_tool_prefix"; then
3429   # Extract the first word of "as", so it can be a program name with args.
3430 set dummy as; ac_word=$2
3431 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3432 echo "configure:3433: checking for $ac_word" >&5
3433 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3434   echo $ac_n "(cached) $ac_c" 1>&6
3435 else
3436   if test -n "$AS"; then
3437   ac_cv_prog_AS="$AS" # Let the user override the test.
3438 else
3439   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3440   ac_dummy="$PATH"
3441   for ac_dir in $ac_dummy; do
3442     test -z "$ac_dir" && ac_dir=.
3443     if test -f $ac_dir/$ac_word; then
3444       ac_cv_prog_AS="as"
3445       break
3446     fi
3447   done
3448   IFS="$ac_save_ifs"
3449   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3450 fi
3451 fi
3452 AS="$ac_cv_prog_AS"
3453 if test -n "$AS"; then
3454   echo "$ac_t""$AS" 1>&6
3455 else
3456   echo "$ac_t""no" 1>&6
3457 fi
3458
3459 else
3460   AS="false"
3461 fi
3462 fi
3463
3464   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3465 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3466 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3467 echo "configure:3468: checking for $ac_word" >&5
3468 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3469   echo $ac_n "(cached) $ac_c" 1>&6
3470 else
3471   if test -n "$OBJDUMP"; then
3472   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3473 else
3474   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3475   ac_dummy="$PATH"
3476   for ac_dir in $ac_dummy; do
3477     test -z "$ac_dir" && ac_dir=.
3478     if test -f $ac_dir/$ac_word; then
3479       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3480       break
3481     fi
3482   done
3483   IFS="$ac_save_ifs"
3484 fi
3485 fi
3486 OBJDUMP="$ac_cv_prog_OBJDUMP"
3487 if test -n "$OBJDUMP"; then
3488   echo "$ac_t""$OBJDUMP" 1>&6
3489 else
3490   echo "$ac_t""no" 1>&6
3491 fi
3492
3493
3494 if test -z "$ac_cv_prog_OBJDUMP"; then
3495 if test -n "$ac_tool_prefix"; then
3496   # Extract the first word of "objdump", so it can be a program name with args.
3497 set dummy objdump; ac_word=$2
3498 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3499 echo "configure:3500: checking for $ac_word" >&5
3500 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3501   echo $ac_n "(cached) $ac_c" 1>&6
3502 else
3503   if test -n "$OBJDUMP"; then
3504   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3505 else
3506   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3507   ac_dummy="$PATH"
3508   for ac_dir in $ac_dummy; do
3509     test -z "$ac_dir" && ac_dir=.
3510     if test -f $ac_dir/$ac_word; then
3511       ac_cv_prog_OBJDUMP="objdump"
3512       break
3513     fi
3514   done
3515   IFS="$ac_save_ifs"
3516   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3517 fi
3518 fi
3519 OBJDUMP="$ac_cv_prog_OBJDUMP"
3520 if test -n "$OBJDUMP"; then
3521   echo "$ac_t""$OBJDUMP" 1>&6
3522 else
3523   echo "$ac_t""no" 1>&6
3524 fi
3525
3526 else
3527   OBJDUMP="false"
3528 fi
3529 fi
3530
3531   ;;
3532
3533 esac
3534
3535
3536 # Save cache, so that ltconfig can load it
3537
3538
3539 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3540 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3541 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3542 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3543 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3544 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3545 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3546 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3547
3548 # Reload cache, that may have been modified by ltconfig
3549
3550
3551 # This can be used to rebuild libtool when needed
3552 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3553
3554 # Always use our own libtool.
3555 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3556
3557 # Redirect the config.log output again, so that the ltconfig log is not
3558 # clobbered by the next message.
3559 exec 5>>./config.log
3560
3561
3562 for ac_prog in mawk gawk nawk awk
3563 do
3564 # Extract the first word of "$ac_prog", so it can be a program name with args.
3565 set dummy $ac_prog; ac_word=$2
3566 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3567 echo "configure:3568: checking for $ac_word" >&5
3568 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3569   echo $ac_n "(cached) $ac_c" 1>&6
3570 else
3571   if test -n "$AWK"; then
3572   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3573 else
3574   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3575   ac_dummy="$PATH"
3576   for ac_dir in $ac_dummy; do
3577     test -z "$ac_dir" && ac_dir=.
3578     if test -f $ac_dir/$ac_word; then
3579       ac_cv_prog_AWK="$ac_prog"
3580       break
3581     fi
3582   done
3583   IFS="$ac_save_ifs"
3584 fi
3585 fi
3586 AWK="$ac_cv_prog_AWK"
3587 if test -n "$AWK"; then
3588   echo "$ac_t""$AWK" 1>&6
3589 else
3590   echo "$ac_t""no" 1>&6
3591 fi
3592
3593 test -n "$AWK" && break
3594 done
3595
3596 # test for ln hardlink support
3597 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3598 echo "configure:3599: checking whether ln works" >&5
3599 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3600   echo $ac_n "(cached) $ac_c" 1>&6
3601 else
3602   rm -f conftest.src conftest.dst
3603 echo "conftest" > conftest.src
3604 if ln conftest.src conftest.dst 2>/dev/null
3605 then
3606   ol_cv_prog_LN_H="ln"
3607 else
3608   ol_cv_prog_LN_H="cp"
3609 fi
3610 rm -f conftest.src conftest.dst
3611
3612 fi
3613 LN_H="$ol_cv_prog_LN_H"
3614 if test "$ol_cv_prog_LN_H" = "ln"; then
3615         echo "$ac_t""yes" 1>&6
3616 else
3617         echo "$ac_t""no" 1>&6
3618 fi
3619
3620 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3621 echo "configure:3622: checking whether ln -s works" >&5
3622 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3623   echo $ac_n "(cached) $ac_c" 1>&6
3624 else
3625   rm -f conftestdata
3626 if ln -s X conftestdata 2>/dev/null
3627 then
3628   rm -f conftestdata
3629   ac_cv_prog_LN_S="ln -s"
3630 else
3631   ac_cv_prog_LN_S=ln
3632 fi
3633 fi
3634 LN_S="$ac_cv_prog_LN_S"
3635 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3636   echo "$ac_t""yes" 1>&6
3637 else
3638   echo "$ac_t""no" 1>&6
3639 fi
3640
3641
3642 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3643         LN_S="$LN_H"
3644 fi
3645
3646 # Extract the first word of "sendmail", so it can be a program name with args.
3647 set dummy sendmail; ac_word=$2
3648 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3649 echo "configure:3650: checking for $ac_word" >&5
3650 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3651   echo $ac_n "(cached) $ac_c" 1>&6
3652 else
3653   case "$SENDMAIL" in
3654   /*)
3655   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3656   ;;
3657   ?:/*)
3658   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3659   ;;
3660   *)
3661   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3662   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3663   for ac_dir in $ac_dummy; do 
3664     test -z "$ac_dir" && ac_dir=.
3665     if test -f $ac_dir/$ac_word; then
3666       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3667       break
3668     fi
3669   done
3670   IFS="$ac_save_ifs"
3671   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3672   ;;
3673 esac
3674 fi
3675 SENDMAIL="$ac_cv_path_SENDMAIL"
3676 if test -n "$SENDMAIL"; then
3677   echo "$ac_t""$SENDMAIL" 1>&6
3678 else
3679   echo "$ac_t""no" 1>&6
3680 fi
3681
3682 # Extract the first word of "vi", so it can be a program name with args.
3683 set dummy vi; ac_word=$2
3684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3685 echo "configure:3686: checking for $ac_word" >&5
3686 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3687   echo $ac_n "(cached) $ac_c" 1>&6
3688 else
3689   case "$EDITOR" in
3690   /*)
3691   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3692   ;;
3693   ?:/*)
3694   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3695   ;;
3696   *)
3697   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3698   ac_dummy="$PATH:/usr/ucb"
3699   for ac_dir in $ac_dummy; do 
3700     test -z "$ac_dir" && ac_dir=.
3701     if test -f $ac_dir/$ac_word; then
3702       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3703       break
3704     fi
3705   done
3706   IFS="$ac_save_ifs"
3707   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3708   ;;
3709 esac
3710 fi
3711 EDITOR="$ac_cv_path_EDITOR"
3712 if test -n "$EDITOR"; then
3713   echo "$ac_t""$EDITOR" 1>&6
3714 else
3715   echo "$ac_t""no" 1>&6
3716 fi
3717
3718 # Extract the first word of "finger", so it can be a program name with args.
3719 set dummy finger; ac_word=$2
3720 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3721 echo "configure:3722: checking for $ac_word" >&5
3722 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3723   echo $ac_n "(cached) $ac_c" 1>&6
3724 else
3725   case "$FINGER" in
3726   /*)
3727   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3728   ;;
3729   ?:/*)
3730   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3731   ;;
3732   *)
3733   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3734   ac_dummy="$PATH:/usr/ucb"
3735   for ac_dir in $ac_dummy; do 
3736     test -z "$ac_dir" && ac_dir=.
3737     if test -f $ac_dir/$ac_word; then
3738       ac_cv_path_FINGER="$ac_dir/$ac_word"
3739       break
3740     fi
3741   done
3742   IFS="$ac_save_ifs"
3743   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3744   ;;
3745 esac
3746 fi
3747 FINGER="$ac_cv_path_FINGER"
3748 if test -n "$FINGER"; then
3749   echo "$ac_t""$FINGER" 1>&6
3750 else
3751   echo "$ac_t""no" 1>&6
3752 fi
3753
3754
3755 ol_link_perl=no
3756 if test $ol_enable_perl != no ; then
3757         # Extract the first word of "perl", so it can be a program name with args.
3758 set dummy perl; ac_word=$2
3759 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3760 echo "configure:3761: checking for $ac_word" >&5
3761 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3762   echo $ac_n "(cached) $ac_c" 1>&6
3763 else
3764   case "$PERLBIN" in
3765   /*)
3766   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3767   ;;
3768   ?:/*)
3769   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3770   ;;
3771   *)
3772   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3773   ac_dummy="$PATH"
3774   for ac_dir in $ac_dummy; do 
3775     test -z "$ac_dir" && ac_dir=.
3776     if test -f $ac_dir/$ac_word; then
3777       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3778       break
3779     fi
3780   done
3781   IFS="$ac_save_ifs"
3782   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3783   ;;
3784 esac
3785 fi
3786 PERLBIN="$ac_cv_path_PERLBIN"
3787 if test -n "$PERLBIN"; then
3788   echo "$ac_t""$PERLBIN" 1>&6
3789 else
3790   echo "$ac_t""no" 1>&6
3791 fi
3792
3793
3794         if test "no$PERLBIN" = "no" ; then
3795                 if test $ol_enable_perl = yes ; then
3796                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3797                 fi
3798
3799         else
3800                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3801                 if test x"$ol_with_perl_module" = "xstatic" ; then
3802                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3803                 else
3804                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3805                 fi
3806                                 ol_link_perl=yes
3807         fi
3808 fi
3809
3810 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3811 echo "configure:3812: checking how to run the C preprocessor" >&5
3812 # On Suns, sometimes $CPP names a directory.
3813 if test -n "$CPP" && test -d "$CPP"; then
3814   CPP=
3815 fi
3816 if test -z "$CPP"; then
3817 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3818   echo $ac_n "(cached) $ac_c" 1>&6
3819 else
3820     # This must be in double quotes, not single quotes, because CPP may get
3821   # substituted into the Makefile and "${CC-cc}" will confuse make.
3822   CPP="${CC-cc} -E"
3823   # On the NeXT, cc -E runs the code through the compiler's parser,
3824   # not just through cpp.
3825   cat > conftest.$ac_ext <<EOF
3826 #line 3827 "configure"
3827 #include "confdefs.h"
3828 #include <assert.h>
3829 Syntax Error
3830 EOF
3831 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3832 { (eval echo configure:3833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3833 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3834 if test -z "$ac_err"; then
3835   :
3836 else
3837   echo "$ac_err" >&5
3838   echo "configure: failed program was:" >&5
3839   cat conftest.$ac_ext >&5
3840   rm -rf conftest*
3841   CPP="${CC-cc} -E -traditional-cpp"
3842   cat > conftest.$ac_ext <<EOF
3843 #line 3844 "configure"
3844 #include "confdefs.h"
3845 #include <assert.h>
3846 Syntax Error
3847 EOF
3848 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3849 { (eval echo configure:3850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3850 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3851 if test -z "$ac_err"; then
3852   :
3853 else
3854   echo "$ac_err" >&5
3855   echo "configure: failed program was:" >&5
3856   cat conftest.$ac_ext >&5
3857   rm -rf conftest*
3858   CPP="${CC-cc} -nologo -E"
3859   cat > conftest.$ac_ext <<EOF
3860 #line 3861 "configure"
3861 #include "confdefs.h"
3862 #include <assert.h>
3863 Syntax Error
3864 EOF
3865 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3866 { (eval echo configure:3867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3867 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3868 if test -z "$ac_err"; then
3869   :
3870 else
3871   echo "$ac_err" >&5
3872   echo "configure: failed program was:" >&5
3873   cat conftest.$ac_ext >&5
3874   rm -rf conftest*
3875   CPP=/lib/cpp
3876 fi
3877 rm -f conftest*
3878 fi
3879 rm -f conftest*
3880 fi
3881 rm -f conftest*
3882   ac_cv_prog_CPP="$CPP"
3883 fi
3884   CPP="$ac_cv_prog_CPP"
3885 else
3886   ac_cv_prog_CPP="$CPP"
3887 fi
3888 echo "$ac_t""$CPP" 1>&6
3889
3890
3891 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3892         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3893
3894 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3895         echo "configure: warning: programs compiled here do run here..." 1>&2
3896         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3897
3898 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3899         echo "configure: warning: programs compiled here do not run here..." 1>&2
3900         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3901 fi
3902
3903 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3904 echo "configure:3905: checking for AIX" >&5
3905 cat > conftest.$ac_ext <<EOF
3906 #line 3907 "configure"
3907 #include "confdefs.h"
3908 #ifdef _AIX
3909   yes
3910 #endif
3911
3912 EOF
3913 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3914   egrep "yes" >/dev/null 2>&1; then
3915   rm -rf conftest*
3916   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3917 #define _ALL_SOURCE 1
3918 EOF
3919
3920 else
3921   rm -rf conftest*
3922   echo "$ac_t""no" 1>&6
3923 fi
3924 rm -f conftest*
3925
3926
3927 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3928 echo "configure:3929: checking for POSIXized ISC" >&5
3929 if test -d /etc/conf/kconfig.d &&
3930   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3931 then
3932   echo "$ac_t""yes" 1>&6
3933   ISC=yes # If later tests want to check for ISC.
3934   cat >> confdefs.h <<\EOF
3935 #define _POSIX_SOURCE 1
3936 EOF
3937
3938   if test "$GCC" = yes; then
3939     CC="$CC -posix"
3940   else
3941     CC="$CC -Xp"
3942   fi
3943 else
3944   echo "$ac_t""no" 1>&6
3945   ISC=
3946 fi
3947
3948 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3949 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3950 echo "configure:3951: checking for minix/config.h" >&5
3951 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3952   echo $ac_n "(cached) $ac_c" 1>&6
3953 else
3954   cat > conftest.$ac_ext <<EOF
3955 #line 3956 "configure"
3956 #include "confdefs.h"
3957 #include <minix/config.h>
3958 EOF
3959 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3960 { (eval echo configure:3961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3961 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3962 if test -z "$ac_err"; then
3963   rm -rf conftest*
3964   eval "ac_cv_header_$ac_safe=yes"
3965 else
3966   echo "$ac_err" >&5
3967   echo "configure: failed program was:" >&5
3968   cat conftest.$ac_ext >&5
3969   rm -rf conftest*
3970   eval "ac_cv_header_$ac_safe=no"
3971 fi
3972 rm -f conftest*
3973 fi
3974 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3975   echo "$ac_t""yes" 1>&6
3976   MINIX=yes
3977 else
3978   echo "$ac_t""no" 1>&6
3979 MINIX=
3980 fi
3981
3982 if test "$MINIX" = yes; then
3983   cat >> confdefs.h <<\EOF
3984 #define _POSIX_SOURCE 1
3985 EOF
3986
3987   cat >> confdefs.h <<\EOF
3988 #define _POSIX_1_SOURCE 2
3989 EOF
3990
3991   cat >> confdefs.h <<\EOF
3992 #define _MINIX 1
3993 EOF
3994
3995 fi
3996
3997
3998 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3999 echo "configure:4000: checking for Cygwin environment" >&5
4000 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
4001   echo $ac_n "(cached) $ac_c" 1>&6
4002 else
4003   cat > conftest.$ac_ext <<EOF
4004 #line 4005 "configure"
4005 #include "confdefs.h"
4006
4007 int main() {
4008
4009 #ifndef __CYGWIN__
4010 #define __CYGWIN__ __CYGWIN32__
4011 #endif
4012 return __CYGWIN__;
4013 ; return 0; }
4014 EOF
4015 if { (eval echo configure:4016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4016   rm -rf conftest*
4017   ac_cv_cygwin=yes
4018 else
4019   echo "configure: failed program was:" >&5
4020   cat conftest.$ac_ext >&5
4021   rm -rf conftest*
4022   ac_cv_cygwin=no
4023 fi
4024 rm -f conftest*
4025 fi
4026
4027 echo "$ac_t""$ac_cv_cygwin" 1>&6
4028 CYGWIN=
4029 test "$ac_cv_cygwin" = yes && CYGWIN=yes
4030 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
4031 echo "configure:4032: checking for mingw32 environment" >&5
4032 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
4033   echo $ac_n "(cached) $ac_c" 1>&6
4034 else
4035   cat > conftest.$ac_ext <<EOF
4036 #line 4037 "configure"
4037 #include "confdefs.h"
4038
4039 int main() {
4040 return __MINGW32__;
4041 ; return 0; }
4042 EOF
4043 if { (eval echo configure:4044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4044   rm -rf conftest*
4045   ac_cv_mingw32=yes
4046 else
4047   echo "configure: failed program was:" >&5
4048   cat conftest.$ac_ext >&5
4049   rm -rf conftest*
4050   ac_cv_mingw32=no
4051 fi
4052 rm -f conftest*
4053 fi
4054
4055 echo "$ac_t""$ac_cv_mingw32" 1>&6
4056 MINGW32=
4057 test "$ac_cv_mingw32" = yes && MINGW32=yes
4058 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
4059 echo "configure:4060: checking for EMX OS/2 environment" >&5
4060 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
4061   echo $ac_n "(cached) $ac_c" 1>&6
4062 else
4063   cat > conftest.$ac_ext <<EOF
4064 #line 4065 "configure"
4065 #include "confdefs.h"
4066
4067 int main() {
4068 return __EMX__;
4069 ; return 0; }
4070 EOF
4071 if { (eval echo configure:4072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4072   rm -rf conftest*
4073   ac_cv_emxos2=yes
4074 else
4075   echo "configure: failed program was:" >&5
4076   cat conftest.$ac_ext >&5
4077   rm -rf conftest*
4078   ac_cv_emxos2=no
4079 fi
4080 rm -f conftest*
4081 fi
4082
4083 echo "$ac_t""$ac_cv_emxos2" 1>&6
4084 EMXOS2=
4085 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4086
4087
4088
4089 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4090 echo "configure:4091: checking for executable suffix" >&5
4091 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4092   echo $ac_n "(cached) $ac_c" 1>&6
4093 else
4094   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4095   ac_cv_exeext=.exe
4096 else
4097   rm -f conftest*
4098   echo 'int main () { return 0; }' > conftest.$ac_ext
4099   ac_cv_exeext=
4100   if { (eval echo configure:4101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4101     for file in conftest.*; do
4102       case $file in
4103       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4104       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4105       esac
4106     done
4107   else
4108     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4109   fi
4110   rm -f conftest*
4111   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4112 fi
4113 fi
4114
4115 EXEEXT=""
4116 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4117 echo "$ac_t""${ac_cv_exeext}" 1>&6
4118 ac_exeext=$EXEEXT
4119
4120 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4121 echo "configure:4122: checking for object suffix" >&5
4122 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4123   echo $ac_n "(cached) $ac_c" 1>&6
4124 else
4125   rm -f conftest*
4126 echo 'int i = 1;' > conftest.$ac_ext
4127 if { (eval echo configure:4128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4128   for ac_file in conftest.*; do
4129     case $ac_file in
4130     *.c) ;;
4131     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4132     esac
4133   done
4134 else
4135   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4136 fi
4137 rm -f conftest*
4138 fi
4139
4140 echo "$ac_t""$ac_cv_objext" 1>&6
4141 OBJEXT=$ac_cv_objext
4142 ac_objext=$ac_cv_objext
4143
4144
4145 cat >> confdefs.h <<EOF
4146 #define EXEEXT "${EXEEXT}"
4147 EOF
4148
4149
4150 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4151 echo "configure:4152: checking for be_app in -lbe" >&5
4152 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4153 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4154   echo $ac_n "(cached) $ac_c" 1>&6
4155 else
4156   ac_save_LIBS="$LIBS"
4157 LIBS="-lbe -lroot -lnet $LIBS"
4158 cat > conftest.$ac_ext <<EOF
4159 #line 4160 "configure"
4160 #include "confdefs.h"
4161 /* Override any gcc2 internal prototype to avoid an error.  */
4162 /* We use char because int might match the return type of a gcc2
4163     builtin and then its argument prototype would still apply.  */
4164 char be_app();
4165
4166 int main() {
4167 be_app()
4168 ; return 0; }
4169 EOF
4170 if { (eval echo configure:4171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4171   rm -rf conftest*
4172   eval "ac_cv_lib_$ac_lib_var=yes"
4173 else
4174   echo "configure: failed program was:" >&5
4175   cat conftest.$ac_ext >&5
4176   rm -rf conftest*
4177   eval "ac_cv_lib_$ac_lib_var=no"
4178 fi
4179 rm -f conftest*
4180 LIBS="$ac_save_LIBS"
4181
4182 fi
4183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4184   echo "$ac_t""yes" 1>&6
4185   LIBS="$LIBS -lbe -lroot -lnet"
4186 else
4187   echo "$ac_t""no" 1>&6
4188 :
4189 fi
4190
4191
4192
4193
4194
4195 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4196 echo "configure:4197: checking for ${CC-cc} option to accept ANSI C" >&5
4197 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4198   echo $ac_n "(cached) $ac_c" 1>&6
4199 else
4200   am_cv_prog_cc_stdc=no
4201 ac_save_CC="$CC"
4202 # Don't try gcc -ansi; that turns off useful extensions and
4203 # breaks some systems' header files.
4204 # AIX                   -qlanglvl=ansi
4205 # Ultrix and OSF/1      -std1
4206 # HP-UX 10.20 and later -Ae
4207 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4208 # SVR4                  -Xc -D__EXTENSIONS__
4209 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4210 do
4211   CC="$ac_save_CC $ac_arg"
4212   cat > conftest.$ac_ext <<EOF
4213 #line 4214 "configure"
4214 #include "confdefs.h"
4215 #include <stdarg.h>
4216 #include <stdio.h>
4217 #include <sys/types.h>
4218 #include <sys/stat.h>
4219 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4220 struct buf { int x; };
4221 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4222 static char *e (p, i)
4223      char **p;
4224      int i;
4225 {
4226   return p[i];
4227 }
4228 static char *f (char * (*g) (char **, int), char **p, ...)
4229 {
4230   char *s;
4231   va_list v;
4232   va_start (v,p);
4233   s = g (p, va_arg (v,int));
4234   va_end (v);
4235   return s;
4236 }
4237 int test (int i, double x);
4238 struct s1 {int (*f) (int a);};
4239 struct s2 {int (*f) (double a);};
4240 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4241 int argc;
4242 char **argv;
4243
4244 int main() {
4245
4246 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4247
4248 ; return 0; }
4249 EOF
4250 if { (eval echo configure:4251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4251   rm -rf conftest*
4252   am_cv_prog_cc_stdc="$ac_arg"; break
4253 else
4254   echo "configure: failed program was:" >&5
4255   cat conftest.$ac_ext >&5
4256 fi
4257 rm -f conftest*
4258 done
4259 CC="$ac_save_CC"
4260
4261 fi
4262
4263 if test -z "$am_cv_prog_cc_stdc"; then
4264   echo "$ac_t""none needed" 1>&6
4265 else
4266   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4267 fi
4268 case "x$am_cv_prog_cc_stdc" in
4269   x|xno) ;;
4270   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4271 esac
4272
4273 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4274         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4275 fi
4276
4277 # test for make depend flag
4278 OL_MKDEP=
4279 OL_MKDEP_FLAGS=
4280 if test -z "${MKDEP}"; then
4281         OL_MKDEP="${CC-cc}"
4282         if test -z "${MKDEP_FLAGS}"; then
4283                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4284 echo "configure:4285: checking for ${OL_MKDEP} depend flag" >&5
4285 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4286   echo $ac_n "(cached) $ac_c" 1>&6
4287 else
4288   
4289                         ol_cv_mkdep=no
4290                         for flag in "-M" "-xM"; do
4291                                 cat > conftest.c <<EOF
4292  noCode;
4293 EOF
4294                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4295                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4296                                 then
4297                                         if test ! -f conftest."${ac_object}" ; then
4298                                                 ol_cv_mkdep=$flag
4299                                                 OL_MKDEP_FLAGS="$flag"
4300                                                 break
4301                                         fi
4302                                 fi
4303                         done
4304                         rm -f conftest*
4305                 
4306 fi
4307
4308 echo "$ac_t""$ol_cv_mkdep" 1>&6
4309         else
4310                 cc_cv_mkdep=yes
4311                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4312         fi
4313 else
4314         cc_cv_mkdep=yes
4315         OL_MKDEP="${MKDEP}"
4316         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4317 fi
4318
4319
4320
4321 if test "${ol_cv_mkdep}" = no ; then
4322         # this will soon become an error
4323         echo "configure: warning: do not know how to generate dependencies" 1>&2
4324 fi
4325
4326 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4327 echo "configure:4328: checking for afopen in -ls" >&5
4328 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4329 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4330   echo $ac_n "(cached) $ac_c" 1>&6
4331 else
4332   ac_save_LIBS="$LIBS"
4333 LIBS="-ls  $LIBS"
4334 cat > conftest.$ac_ext <<EOF
4335 #line 4336 "configure"
4336 #include "confdefs.h"
4337 /* Override any gcc2 internal prototype to avoid an error.  */
4338 /* We use char because int might match the return type of a gcc2
4339     builtin and then its argument prototype would still apply.  */
4340 char afopen();
4341
4342 int main() {
4343 afopen()
4344 ; return 0; }
4345 EOF
4346 if { (eval echo configure:4347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4347   rm -rf conftest*
4348   eval "ac_cv_lib_$ac_lib_var=yes"
4349 else
4350   echo "configure: failed program was:" >&5
4351   cat conftest.$ac_ext >&5
4352   rm -rf conftest*
4353   eval "ac_cv_lib_$ac_lib_var=no"
4354 fi
4355 rm -f conftest*
4356 LIBS="$ac_save_LIBS"
4357
4358 fi
4359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4360   echo "$ac_t""yes" 1>&6
4361   
4362         AUTH_LIBS=-ls
4363         cat >> confdefs.h <<\EOF
4364 #define HAVE_AIX_SECURITY 1
4365 EOF
4366
4367
4368 else
4369   echo "$ac_t""no" 1>&6
4370 fi
4371
4372
4373
4374 ol_link_modules=no
4375 if test $ol_enable_modules != no ; then
4376         for ac_hdr in ltdl.h
4377 do
4378 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4379 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4380 echo "configure:4381: checking for $ac_hdr" >&5
4381 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4382   echo $ac_n "(cached) $ac_c" 1>&6
4383 else
4384   cat > conftest.$ac_ext <<EOF
4385 #line 4386 "configure"
4386 #include "confdefs.h"
4387 #include <$ac_hdr>
4388 EOF
4389 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4390 { (eval echo configure:4391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4391 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4392 if test -z "$ac_err"; then
4393   rm -rf conftest*
4394   eval "ac_cv_header_$ac_safe=yes"
4395 else
4396   echo "$ac_err" >&5
4397   echo "configure: failed program was:" >&5
4398   cat conftest.$ac_ext >&5
4399   rm -rf conftest*
4400   eval "ac_cv_header_$ac_safe=no"
4401 fi
4402 rm -f conftest*
4403 fi
4404 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4405   echo "$ac_t""yes" 1>&6
4406     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4407   cat >> confdefs.h <<EOF
4408 #define $ac_tr_hdr 1
4409 EOF
4410  
4411 else
4412   echo "$ac_t""no" 1>&6
4413 fi
4414 done
4415
4416
4417         if test $ac_cv_header_ltdl_h = no ; then
4418                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4419         fi
4420
4421         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4422 echo "configure:4423: checking for lt_dlinit in -lltdl" >&5
4423 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4424 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4425   echo $ac_n "(cached) $ac_c" 1>&6
4426 else
4427   ac_save_LIBS="$LIBS"
4428 LIBS="-lltdl  $LIBS"
4429 cat > conftest.$ac_ext <<EOF
4430 #line 4431 "configure"
4431 #include "confdefs.h"
4432 /* Override any gcc2 internal prototype to avoid an error.  */
4433 /* We use char because int might match the return type of a gcc2
4434     builtin and then its argument prototype would still apply.  */
4435 char lt_dlinit();
4436
4437 int main() {
4438 lt_dlinit()
4439 ; return 0; }
4440 EOF
4441 if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4442   rm -rf conftest*
4443   eval "ac_cv_lib_$ac_lib_var=yes"
4444 else
4445   echo "configure: failed program was:" >&5
4446   cat conftest.$ac_ext >&5
4447   rm -rf conftest*
4448   eval "ac_cv_lib_$ac_lib_var=no"
4449 fi
4450 rm -f conftest*
4451 LIBS="$ac_save_LIBS"
4452
4453 fi
4454 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4455   echo "$ac_t""yes" 1>&6
4456   
4457             MODULES_LIBS=-lltdl
4458             cat >> confdefs.h <<\EOF
4459 #define HAVE_LIBLTDL 1
4460 EOF
4461
4462         
4463 else
4464   echo "$ac_t""no" 1>&6
4465 fi
4466
4467
4468         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4469                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4470         fi
4471         ol_link_modules=yes
4472 else
4473         ol_with_bdb_module=static
4474         ol_with_dnssrv_module=static
4475         ol_with_ldap_module=static
4476         ol_with_ldbm_module=static
4477         ol_with_meta_module=static
4478         ol_with_monitor_module=static
4479         ol_with_passwd_module=static
4480         ol_with_perl_module=static
4481         ol_with_shell_module=static
4482         ol_with_tcl_module=static
4483         ol_with_sql_module=static
4484 fi
4485
4486 # test for EBCDIC
4487 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4488 echo "configure:4489: checking for EBCDIC" >&5
4489 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4490   echo $ac_n "(cached) $ac_c" 1>&6
4491 else
4492   
4493         cat > conftest.$ac_ext <<EOF
4494 #line 4495 "configure"
4495 #include "confdefs.h"
4496
4497 #if !('M' == 0xd4)
4498 #include <__ASCII__/generate_error.h>
4499 #endif
4500
4501 EOF
4502 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4503 { (eval echo configure:4504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4504 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4505 if test -z "$ac_err"; then
4506   rm -rf conftest*
4507   ol_cv_cpp_ebcdic=yes
4508 else
4509   echo "$ac_err" >&5
4510   echo "configure: failed program was:" >&5
4511   cat conftest.$ac_ext >&5
4512   rm -rf conftest*
4513   ol_cv_cpp_ebcdic=no
4514 fi
4515 rm -f conftest*
4516 fi
4517
4518 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4519 if test $ol_cv_cpp_ebcdic = yes ; then
4520         cat >> confdefs.h <<\EOF
4521 #define HAVE_EBCDIC 1
4522 EOF
4523
4524 fi
4525
4526 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4527 echo "configure:4528: checking for ANSI C header files" >&5
4528 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4529   echo $ac_n "(cached) $ac_c" 1>&6
4530 else
4531   cat > conftest.$ac_ext <<EOF
4532 #line 4533 "configure"
4533 #include "confdefs.h"
4534 #include <stdlib.h>
4535 #include <stdarg.h>
4536 #include <string.h>
4537 #include <float.h>
4538 EOF
4539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4540 { (eval echo configure:4541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4542 if test -z "$ac_err"; then
4543   rm -rf conftest*
4544   ol_cv_header_stdc=yes
4545 else
4546   echo "$ac_err" >&5
4547   echo "configure: failed program was:" >&5
4548   cat conftest.$ac_ext >&5
4549   rm -rf conftest*
4550   ol_cv_header_stdc=no
4551 fi
4552 rm -f conftest*
4553
4554 if test $ol_cv_header_stdc = yes; then
4555   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4556 cat > conftest.$ac_ext <<EOF
4557 #line 4558 "configure"
4558 #include "confdefs.h"
4559 #include <string.h>
4560 EOF
4561 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4562   egrep "memchr" >/dev/null 2>&1; then
4563   :
4564 else
4565   rm -rf conftest*
4566   ol_cv_header_stdc=no
4567 fi
4568 rm -f conftest*
4569
4570 fi
4571
4572 if test $ol_cv_header_stdc = yes; then
4573   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4574 cat > conftest.$ac_ext <<EOF
4575 #line 4576 "configure"
4576 #include "confdefs.h"
4577 #include <stdlib.h>
4578 EOF
4579 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4580   egrep "free" >/dev/null 2>&1; then
4581   :
4582 else
4583   rm -rf conftest*
4584   ol_cv_header_stdc=no
4585 fi
4586 rm -f conftest*
4587
4588 fi
4589
4590 if test $ol_cv_header_stdc = yes; then
4591   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4592 if test "$cross_compiling" = yes; then
4593   :
4594 else
4595   cat > conftest.$ac_ext <<EOF
4596 #line 4597 "configure"
4597 #include "confdefs.h"
4598 #include <ctype.h>
4599 #ifndef HAVE_EBCDIC
4600 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4601 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4602 #else
4603 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4604                 || ('j' <= (c) && (c) <= 'r') \
4605                 || ('s' <= (c) && (c) <= 'z'))
4606 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4607 #endif
4608 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4609 int main () { int i; for (i = 0; i < 256; i++)
4610 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4611 exit (0); }
4612
4613 EOF
4614 if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4615 then
4616   :
4617 else
4618   echo "configure: failed program was:" >&5
4619   cat conftest.$ac_ext >&5
4620   rm -fr conftest*
4621   ol_cv_header_stdc=no
4622 fi
4623 rm -fr conftest*
4624 fi
4625
4626 fi
4627 fi
4628
4629 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4630 if test $ol_cv_header_stdc = yes; then
4631   cat >> confdefs.h <<\EOF
4632 #define STDC_HEADERS 1
4633 EOF
4634
4635 fi
4636 ac_cv_header_stdc=disable
4637
4638
4639 if test $ol_cv_header_stdc != yes; then
4640         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4641 fi
4642
4643 ac_header_dirent=no
4644 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4645 do
4646 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4647 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4648 echo "configure:4649: checking for $ac_hdr that defines DIR" >&5
4649 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4650   echo $ac_n "(cached) $ac_c" 1>&6
4651 else
4652   cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"
4655 #include <sys/types.h>
4656 #include <$ac_hdr>
4657 int main() {
4658 DIR *dirp = 0;
4659 ; return 0; }
4660 EOF
4661 if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4662   rm -rf conftest*
4663   eval "ac_cv_header_dirent_$ac_safe=yes"
4664 else
4665   echo "configure: failed program was:" >&5
4666   cat conftest.$ac_ext >&5
4667   rm -rf conftest*
4668   eval "ac_cv_header_dirent_$ac_safe=no"
4669 fi
4670 rm -f conftest*
4671 fi
4672 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4673   echo "$ac_t""yes" 1>&6
4674     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4675   cat >> confdefs.h <<EOF
4676 #define $ac_tr_hdr 1
4677 EOF
4678  ac_header_dirent=$ac_hdr; break
4679 else
4680   echo "$ac_t""no" 1>&6
4681 fi
4682 done
4683 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4684 if test $ac_header_dirent = dirent.h; then
4685 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4686 echo "configure:4687: checking for opendir in -ldir" >&5
4687 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4688 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4689   echo $ac_n "(cached) $ac_c" 1>&6
4690 else
4691   ac_save_LIBS="$LIBS"
4692 LIBS="-ldir  $LIBS"
4693 cat > conftest.$ac_ext <<EOF
4694 #line 4695 "configure"
4695 #include "confdefs.h"
4696 /* Override any gcc2 internal prototype to avoid an error.  */
4697 /* We use char because int might match the return type of a gcc2
4698     builtin and then its argument prototype would still apply.  */
4699 char opendir();
4700
4701 int main() {
4702 opendir()
4703 ; return 0; }
4704 EOF
4705 if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4706   rm -rf conftest*
4707   eval "ac_cv_lib_$ac_lib_var=yes"
4708 else
4709   echo "configure: failed program was:" >&5
4710   cat conftest.$ac_ext >&5
4711   rm -rf conftest*
4712   eval "ac_cv_lib_$ac_lib_var=no"
4713 fi
4714 rm -f conftest*
4715 LIBS="$ac_save_LIBS"
4716
4717 fi
4718 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4719   echo "$ac_t""yes" 1>&6
4720   LIBS="$LIBS -ldir"
4721 else
4722   echo "$ac_t""no" 1>&6
4723 fi
4724
4725 else
4726 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4727 echo "configure:4728: checking for opendir in -lx" >&5
4728 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4729 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4730   echo $ac_n "(cached) $ac_c" 1>&6
4731 else
4732   ac_save_LIBS="$LIBS"
4733 LIBS="-lx  $LIBS"
4734 cat > conftest.$ac_ext <<EOF
4735 #line 4736 "configure"
4736 #include "confdefs.h"
4737 /* Override any gcc2 internal prototype to avoid an error.  */
4738 /* We use char because int might match the return type of a gcc2
4739     builtin and then its argument prototype would still apply.  */
4740 char opendir();
4741
4742 int main() {
4743 opendir()
4744 ; return 0; }
4745 EOF
4746 if { (eval echo configure:4747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4747   rm -rf conftest*
4748   eval "ac_cv_lib_$ac_lib_var=yes"
4749 else
4750   echo "configure: failed program was:" >&5
4751   cat conftest.$ac_ext >&5
4752   rm -rf conftest*
4753   eval "ac_cv_lib_$ac_lib_var=no"
4754 fi
4755 rm -f conftest*
4756 LIBS="$ac_save_LIBS"
4757
4758 fi
4759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4760   echo "$ac_t""yes" 1>&6
4761   LIBS="$LIBS -lx"
4762 else
4763   echo "$ac_t""no" 1>&6
4764 fi
4765
4766 fi
4767
4768 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4769 echo "configure:4770: checking for sys/wait.h that is POSIX.1 compatible" >&5
4770 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4771   echo $ac_n "(cached) $ac_c" 1>&6
4772 else
4773   cat > conftest.$ac_ext <<EOF
4774 #line 4775 "configure"
4775 #include "confdefs.h"
4776 #include <sys/types.h>
4777 #include <sys/wait.h>
4778 #ifndef WEXITSTATUS
4779 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4780 #endif
4781 #ifndef WIFEXITED
4782 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4783 #endif
4784 int main() {
4785 int s;
4786 wait (&s);
4787 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4788 ; return 0; }
4789 EOF
4790 if { (eval echo configure:4791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4791   rm -rf conftest*
4792   ac_cv_header_sys_wait_h=yes
4793 else
4794   echo "configure: failed program was:" >&5
4795   cat conftest.$ac_ext >&5
4796   rm -rf conftest*
4797   ac_cv_header_sys_wait_h=no
4798 fi
4799 rm -f conftest*
4800 fi
4801
4802 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4803 if test $ac_cv_header_sys_wait_h = yes; then
4804   cat >> confdefs.h <<\EOF
4805 #define HAVE_SYS_WAIT_H 1
4806 EOF
4807
4808 fi
4809
4810 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4811 echo "configure:4812: checking POSIX termios" >&5
4812 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4813   echo $ac_n "(cached) $ac_c" 1>&6
4814 else
4815   cat > conftest.$ac_ext <<EOF
4816 #line 4817 "configure"
4817 #include "confdefs.h"
4818 #include <sys/types.h>
4819 #include <unistd.h>
4820 #include <termios.h>
4821 int main() {
4822 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4823    tcgetattr(0, 0);
4824 ; return 0; }
4825 EOF
4826 if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4827   rm -rf conftest*
4828   am_cv_sys_posix_termios=yes
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833   am_cv_sys_posix_termios=no
4834 fi
4835 rm -f conftest*
4836 fi
4837
4838 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4839
4840
4841  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4842 echo "configure:4843: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4843 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4844   echo $ac_n "(cached) $ac_c" 1>&6
4845 else
4846   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4847
4848   gwinsz_in_termios_h=no
4849   if test $am_cv_sys_posix_termios = yes; then
4850     cat > conftest.$ac_ext <<EOF
4851 #line 4852 "configure"
4852 #include "confdefs.h"
4853 #include <sys/types.h>
4854 #     include <termios.h>
4855 #     ifdef TIOCGWINSZ
4856         yes
4857 #     endif
4858     
4859 EOF
4860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4861   egrep "yes" >/dev/null 2>&1; then
4862   rm -rf conftest*
4863   gwinsz_in_termios_h=yes
4864 fi
4865 rm -f conftest*
4866
4867   fi
4868
4869   if test $gwinsz_in_termios_h = no; then
4870     cat > conftest.$ac_ext <<EOF
4871 #line 4872 "configure"
4872 #include "confdefs.h"
4873 #include <sys/types.h>
4874 #     include <sys/ioctl.h>
4875 #     ifdef TIOCGWINSZ
4876         yes
4877 #     endif
4878     
4879 EOF
4880 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4881   egrep "yes" >/dev/null 2>&1; then
4882   rm -rf conftest*
4883   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4884 fi
4885 rm -f conftest*
4886
4887   fi
4888   
4889 fi
4890
4891 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4892   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4893     cat >> confdefs.h <<\EOF
4894 #define GWINSZ_IN_SYS_IOCTL 1
4895 EOF
4896
4897   fi
4898
4899 if test $am_cv_sys_posix_termios = yes ; then
4900         cat >> confdefs.h <<\EOF
4901 #define HAVE_POSIX_TERMIOS 1
4902 EOF
4903
4904 fi
4905
4906 for ac_hdr in \
4907         arpa/inet.h             \
4908         arpa/nameser.h  \
4909         assert.h                \
4910         conio.h                 \
4911         crypt.h                 \
4912         direct.h                \
4913         errno.h                 \
4914         fcntl.h                 \
4915         filio.h                 \
4916         getopt.h                \
4917         grp.h                   \
4918         io.h                    \
4919         libutil.h               \
4920         limits.h                \
4921         locale.h                \
4922         netinet/tcp.h   \
4923         malloc.h                \
4924         memory.h                \
4925         psap.h                  \
4926         pwd.h                   \
4927         process.h               \
4928         resolv.h                \
4929         sgtty.h                 \
4930         shadow.h                \
4931         stddef.h                \
4932         string.h                \
4933         strings.h               \
4934         sysexits.h              \
4935         sys/file.h              \
4936         sys/filio.h             \
4937         sys/errno.h             \
4938         sys/ioctl.h             \
4939         sys/param.h             \
4940         sys/resource.h  \
4941         sys/select.h    \
4942         sys/socket.h    \
4943         sys/syslog.h    \
4944         sys/time.h              \
4945         sys/types.h             \
4946         syslog.h                \
4947         termios.h               \
4948         unistd.h                \
4949         winsock.h               \
4950
4951 do
4952 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4953 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4954 echo "configure:4955: checking for $ac_hdr" >&5
4955 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4956   echo $ac_n "(cached) $ac_c" 1>&6
4957 else
4958   cat > conftest.$ac_ext <<EOF
4959 #line 4960 "configure"
4960 #include "confdefs.h"
4961 #include <$ac_hdr>
4962 EOF
4963 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4964 { (eval echo configure:4965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4965 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4966 if test -z "$ac_err"; then
4967   rm -rf conftest*
4968   eval "ac_cv_header_$ac_safe=yes"
4969 else
4970   echo "$ac_err" >&5
4971   echo "configure: failed program was:" >&5
4972   cat conftest.$ac_ext >&5
4973   rm -rf conftest*
4974   eval "ac_cv_header_$ac_safe=no"
4975 fi
4976 rm -f conftest*
4977 fi
4978 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4979   echo "$ac_t""yes" 1>&6
4980     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4981   cat >> confdefs.h <<EOF
4982 #define $ac_tr_hdr 1
4983 EOF
4984  
4985 else
4986   echo "$ac_t""no" 1>&6
4987 fi
4988 done
4989
4990
4991
4992
4993 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4994 echo "configure:4995: checking for dlopen" >&5
4995 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4996   echo $ac_n "(cached) $ac_c" 1>&6
4997 else
4998   cat > conftest.$ac_ext <<EOF
4999 #line 5000 "configure"
5000 #include "confdefs.h"
5001 /* System header to define __stub macros and hopefully few prototypes,
5002     which can conflict with char dlopen(); below.  */
5003 #include <assert.h>
5004 /* Override any gcc2 internal prototype to avoid an error.  */
5005 /* We use char because int might match the return type of a gcc2
5006     builtin and then its argument prototype would still apply.  */
5007 char dlopen();
5008 char (*f)();
5009
5010 int main() {
5011
5012 /* The GNU C library defines this for functions which it implements
5013     to always fail with ENOSYS.  Some functions are actually named
5014     something starting with __ and the normal name is an alias.  */
5015 #if defined (__stub_dlopen) || defined (__stub___dlopen)
5016 choke me
5017 #else
5018 f = dlopen;
5019 #endif
5020
5021 ; return 0; }
5022 EOF
5023 if { (eval echo configure:5024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5024   rm -rf conftest*
5025   eval "ac_cv_func_dlopen=yes"
5026 else
5027   echo "configure: failed program was:" >&5
5028   cat conftest.$ac_ext >&5
5029   rm -rf conftest*
5030   eval "ac_cv_func_dlopen=no"
5031 fi
5032 rm -f conftest*
5033 fi
5034
5035 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
5036   echo "$ac_t""yes" 1>&6
5037   :
5038 else
5039   echo "$ac_t""no" 1>&6
5040 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
5041 echo "configure:5042: checking for dlopen in -ldl" >&5
5042 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
5043 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5044   echo $ac_n "(cached) $ac_c" 1>&6
5045 else
5046   ac_save_LIBS="$LIBS"
5047 LIBS="-ldl  $LIBS"
5048 cat > conftest.$ac_ext <<EOF
5049 #line 5050 "configure"
5050 #include "confdefs.h"
5051 /* Override any gcc2 internal prototype to avoid an error.  */
5052 /* We use char because int might match the return type of a gcc2
5053     builtin and then its argument prototype would still apply.  */
5054 char dlopen();
5055
5056 int main() {
5057 dlopen()
5058 ; return 0; }
5059 EOF
5060 if { (eval echo configure:5061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5061   rm -rf conftest*
5062   eval "ac_cv_lib_$ac_lib_var=yes"
5063 else
5064   echo "configure: failed program was:" >&5
5065   cat conftest.$ac_ext >&5
5066   rm -rf conftest*
5067   eval "ac_cv_lib_$ac_lib_var=no"
5068 fi
5069 rm -f conftest*
5070 LIBS="$ac_save_LIBS"
5071
5072 fi
5073 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5074   echo "$ac_t""yes" 1>&6
5075     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5076     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5077   cat >> confdefs.h <<EOF
5078 #define $ac_tr_lib 1
5079 EOF
5080
5081   LIBS="-ldl $LIBS"
5082
5083 else
5084   echo "$ac_t""no" 1>&6
5085 fi
5086
5087 fi
5088
5089
5090 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5091 echo "configure:5092: checking for sigset in -lV3" >&5
5092 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5093 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5094   echo $ac_n "(cached) $ac_c" 1>&6
5095 else
5096   ac_save_LIBS="$LIBS"
5097 LIBS="-lV3  $LIBS"
5098 cat > conftest.$ac_ext <<EOF
5099 #line 5100 "configure"
5100 #include "confdefs.h"
5101 /* Override any gcc2 internal prototype to avoid an error.  */
5102 /* We use char because int might match the return type of a gcc2
5103     builtin and then its argument prototype would still apply.  */
5104 char sigset();
5105
5106 int main() {
5107 sigset()
5108 ; return 0; }
5109 EOF
5110 if { (eval echo configure:5111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5111   rm -rf conftest*
5112   eval "ac_cv_lib_$ac_lib_var=yes"
5113 else
5114   echo "configure: failed program was:" >&5
5115   cat conftest.$ac_ext >&5
5116   rm -rf conftest*
5117   eval "ac_cv_lib_$ac_lib_var=no"
5118 fi
5119 rm -f conftest*
5120 LIBS="$ac_save_LIBS"
5121
5122 fi
5123 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5124   echo "$ac_t""yes" 1>&6
5125     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5126     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5127   cat >> confdefs.h <<EOF
5128 #define $ac_tr_lib 1
5129 EOF
5130
5131   LIBS="-lV3 $LIBS"
5132
5133 else
5134   echo "$ac_t""no" 1>&6
5135 fi
5136
5137
5138 if test $ac_cv_header_winsock_h = yes; then
5139         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5140 echo "configure:5141: checking for winsock" >&5
5141 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
5142   echo $ac_n "(cached) $ac_c" 1>&6
5143 else
5144   cat > conftest.$ac_ext <<EOF
5145 #line 5146 "configure"
5146 #include "confdefs.h"
5147 #include <winsock.h>
5148 int main() {
5149
5150                         socket(0,0,0);
5151                         select(0,NULL,NULL,NULL,NULL);
5152                         closesocket(0);
5153                         gethostname(NULL,0);
5154         
5155 ; return 0; }
5156 EOF
5157 if { (eval echo configure:5158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5158   rm -rf conftest*
5159   ol_cv_winsock=yes
5160 else
5161   echo "configure: failed program was:" >&5
5162   cat conftest.$ac_ext >&5
5163   rm -rf conftest*
5164   ol_cv_winsock=no
5165 fi
5166 rm -f conftest*
5167 fi
5168
5169 echo "$ac_t""$ol_cv_winsock" 1>&6
5170
5171         if test $ol_cv_winsock = yes ; then
5172                 cat >> confdefs.h <<\EOF
5173 #define HAVE_WINSOCK 1
5174 EOF
5175
5176                 ac_cv_func_socket=yes
5177                 ac_cv_func_select=yes
5178                 ac_cv_func_closesocket=yes
5179                 ac_cv_func_gethostname=yes
5180         fi
5181 fi
5182
5183
5184 echo $ac_n "checking for socket""... $ac_c" 1>&6
5185 echo "configure:5186: checking for socket" >&5
5186 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5187   echo $ac_n "(cached) $ac_c" 1>&6
5188 else
5189   cat > conftest.$ac_ext <<EOF
5190 #line 5191 "configure"
5191 #include "confdefs.h"
5192 /* System header to define __stub macros and hopefully few prototypes,
5193     which can conflict with char socket(); below.  */
5194 #include <assert.h>
5195 /* Override any gcc2 internal prototype to avoid an error.  */
5196 /* We use char because int might match the return type of a gcc2
5197     builtin and then its argument prototype would still apply.  */
5198 char socket();
5199 char (*f)();
5200
5201 int main() {
5202
5203 /* The GNU C library defines this for functions which it implements
5204     to always fail with ENOSYS.  Some functions are actually named
5205     something starting with __ and the normal name is an alias.  */
5206 #if defined (__stub_socket) || defined (__stub___socket)
5207 choke me
5208 #else
5209 f = socket;
5210 #endif
5211
5212 ; return 0; }
5213 EOF
5214 if { (eval echo configure:5215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5215   rm -rf conftest*
5216   eval "ac_cv_func_socket=yes"
5217 else
5218   echo "configure: failed program was:" >&5
5219   cat conftest.$ac_ext >&5
5220   rm -rf conftest*
5221   eval "ac_cv_func_socket=no"
5222 fi
5223 rm -f conftest*
5224 fi
5225
5226 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5227   echo "$ac_t""yes" 1>&6
5228   :
5229 else
5230   echo "$ac_t""no" 1>&6
5231         
5232         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5233 echo "configure:5234: checking for main in -lsocket" >&5
5234 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5235 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5236   echo $ac_n "(cached) $ac_c" 1>&6
5237 else
5238   ac_save_LIBS="$LIBS"
5239 LIBS="-lsocket  $LIBS"
5240 cat > conftest.$ac_ext <<EOF
5241 #line 5242 "configure"
5242 #include "confdefs.h"
5243
5244 int main() {
5245 main()
5246 ; return 0; }
5247 EOF
5248 if { (eval echo configure:5249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5249   rm -rf conftest*
5250   eval "ac_cv_lib_$ac_lib_var=yes"
5251 else
5252   echo "configure: failed program was:" >&5
5253   cat conftest.$ac_ext >&5
5254   rm -rf conftest*
5255   eval "ac_cv_lib_$ac_lib_var=no"
5256 fi
5257 rm -f conftest*
5258 LIBS="$ac_save_LIBS"
5259
5260 fi
5261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5262   echo "$ac_t""yes" 1>&6
5263     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5264     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5265   cat >> confdefs.h <<EOF
5266 #define $ac_tr_lib 1
5267 EOF
5268
5269   LIBS="-lsocket $LIBS"
5270
5271 else
5272   echo "$ac_t""no" 1>&6
5273 fi
5274
5275         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5276 echo "configure:5277: checking for main in -lnet" >&5
5277 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5278 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5279   echo $ac_n "(cached) $ac_c" 1>&6
5280 else
5281   ac_save_LIBS="$LIBS"
5282 LIBS="-lnet  $LIBS"
5283 cat > conftest.$ac_ext <<EOF
5284 #line 5285 "configure"
5285 #include "confdefs.h"
5286
5287 int main() {
5288 main()
5289 ; return 0; }
5290 EOF
5291 if { (eval echo configure:5292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5292   rm -rf conftest*
5293   eval "ac_cv_lib_$ac_lib_var=yes"
5294 else
5295   echo "configure: failed program was:" >&5
5296   cat conftest.$ac_ext >&5
5297   rm -rf conftest*
5298   eval "ac_cv_lib_$ac_lib_var=no"
5299 fi
5300 rm -f conftest*
5301 LIBS="$ac_save_LIBS"
5302
5303 fi
5304 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5305   echo "$ac_t""yes" 1>&6
5306     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5307     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5308   cat >> confdefs.h <<EOF
5309 #define $ac_tr_lib 1
5310 EOF
5311
5312   LIBS="-lnet $LIBS"
5313
5314 else
5315   echo "$ac_t""no" 1>&6
5316 fi
5317
5318         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5319 echo "configure:5320: checking for main in -lnsl_s" >&5
5320 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5321 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5322   echo $ac_n "(cached) $ac_c" 1>&6
5323 else
5324   ac_save_LIBS="$LIBS"
5325 LIBS="-lnsl_s  $LIBS"
5326 cat > conftest.$ac_ext <<EOF
5327 #line 5328 "configure"
5328 #include "confdefs.h"
5329
5330 int main() {
5331 main()
5332 ; return 0; }
5333 EOF
5334 if { (eval echo configure:5335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5335   rm -rf conftest*
5336   eval "ac_cv_lib_$ac_lib_var=yes"
5337 else
5338   echo "configure: failed program was:" >&5
5339   cat conftest.$ac_ext >&5
5340   rm -rf conftest*
5341   eval "ac_cv_lib_$ac_lib_var=no"
5342 fi
5343 rm -f conftest*
5344 LIBS="$ac_save_LIBS"
5345
5346 fi
5347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5348   echo "$ac_t""yes" 1>&6
5349     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5350     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5351   cat >> confdefs.h <<EOF
5352 #define $ac_tr_lib 1
5353 EOF
5354
5355   LIBS="-lnsl_s $LIBS"
5356
5357 else
5358   echo "$ac_t""no" 1>&6
5359 fi
5360
5361         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5362 echo "configure:5363: checking for main in -lnsl" >&5
5363 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5364 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5365   echo $ac_n "(cached) $ac_c" 1>&6
5366 else
5367   ac_save_LIBS="$LIBS"
5368 LIBS="-lnsl  $LIBS"
5369 cat > conftest.$ac_ext <<EOF
5370 #line 5371 "configure"
5371 #include "confdefs.h"
5372
5373 int main() {
5374 main()
5375 ; return 0; }
5376 EOF
5377 if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5378   rm -rf conftest*
5379   eval "ac_cv_lib_$ac_lib_var=yes"
5380 else
5381   echo "configure: failed program was:" >&5
5382   cat conftest.$ac_ext >&5
5383   rm -rf conftest*
5384   eval "ac_cv_lib_$ac_lib_var=no"
5385 fi
5386 rm -f conftest*
5387 LIBS="$ac_save_LIBS"
5388
5389 fi
5390 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5391   echo "$ac_t""yes" 1>&6
5392     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5393     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5394   cat >> confdefs.h <<EOF
5395 #define $ac_tr_lib 1
5396 EOF
5397
5398   LIBS="-lnsl $LIBS"
5399
5400 else
5401   echo "$ac_t""no" 1>&6
5402 fi
5403
5404         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5405 echo "configure:5406: checking for socket in -linet" >&5
5406 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5407 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5408   echo $ac_n "(cached) $ac_c" 1>&6
5409 else
5410   ac_save_LIBS="$LIBS"
5411 LIBS="-linet  $LIBS"
5412 cat > conftest.$ac_ext <<EOF
5413 #line 5414 "configure"
5414 #include "confdefs.h"
5415 /* Override any gcc2 internal prototype to avoid an error.  */
5416 /* We use char because int might match the return type of a gcc2
5417     builtin and then its argument prototype would still apply.  */
5418 char socket();
5419
5420 int main() {
5421 socket()
5422 ; return 0; }
5423 EOF
5424 if { (eval echo configure:5425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5425   rm -rf conftest*
5426   eval "ac_cv_lib_$ac_lib_var=yes"
5427 else
5428   echo "configure: failed program was:" >&5
5429   cat conftest.$ac_ext >&5
5430   rm -rf conftest*
5431   eval "ac_cv_lib_$ac_lib_var=no"
5432 fi
5433 rm -f conftest*
5434 LIBS="$ac_save_LIBS"
5435
5436 fi
5437 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5438   echo "$ac_t""yes" 1>&6
5439     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5440     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5441   cat >> confdefs.h <<EOF
5442 #define $ac_tr_lib 1
5443 EOF
5444
5445   LIBS="-linet $LIBS"
5446
5447 else
5448   echo "$ac_t""no" 1>&6
5449 fi
5450
5451         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5452 echo "configure:5453: checking for main in -lgen" >&5
5453 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5454 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5455   echo $ac_n "(cached) $ac_c" 1>&6
5456 else
5457   ac_save_LIBS="$LIBS"
5458 LIBS="-lgen  $LIBS"
5459 cat > conftest.$ac_ext <<EOF
5460 #line 5461 "configure"
5461 #include "confdefs.h"
5462
5463 int main() {
5464 main()
5465 ; return 0; }
5466 EOF
5467 if { (eval echo configure:5468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5468   rm -rf conftest*
5469   eval "ac_cv_lib_$ac_lib_var=yes"
5470 else
5471   echo "configure: failed program was:" >&5
5472   cat conftest.$ac_ext >&5
5473   rm -rf conftest*
5474   eval "ac_cv_lib_$ac_lib_var=no"
5475 fi
5476 rm -f conftest*
5477 LIBS="$ac_save_LIBS"
5478
5479 fi
5480 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5481   echo "$ac_t""yes" 1>&6
5482     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5483     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5484   cat >> confdefs.h <<EOF
5485 #define $ac_tr_lib 1
5486 EOF
5487
5488   LIBS="-lgen $LIBS"
5489
5490 else
5491   echo "$ac_t""no" 1>&6
5492 fi
5493
5494
5495 fi
5496
5497
5498 echo $ac_n "checking for select""... $ac_c" 1>&6
5499 echo "configure:5500: checking for select" >&5
5500 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5501   echo $ac_n "(cached) $ac_c" 1>&6
5502 else
5503   cat > conftest.$ac_ext <<EOF
5504 #line 5505 "configure"
5505 #include "confdefs.h"
5506 /* System header to define __stub macros and hopefully few prototypes,
5507     which can conflict with char select(); below.  */
5508 #include <assert.h>
5509 /* Override any gcc2 internal prototype to avoid an error.  */
5510 /* We use char because int might match the return type of a gcc2
5511     builtin and then its argument prototype would still apply.  */
5512 char select();
5513 char (*f)();
5514
5515 int main() {
5516
5517 /* The GNU C library defines this for functions which it implements
5518     to always fail with ENOSYS.  Some functions are actually named
5519     something starting with __ and the normal name is an alias.  */
5520 #if defined (__stub_select) || defined (__stub___select)
5521 choke me
5522 #else
5523 f = select;
5524 #endif
5525
5526 ; return 0; }
5527 EOF
5528 if { (eval echo configure:5529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5529   rm -rf conftest*
5530   eval "ac_cv_func_select=yes"
5531 else
5532   echo "configure: failed program was:" >&5
5533   cat conftest.$ac_ext >&5
5534   rm -rf conftest*
5535   eval "ac_cv_func_select=no"
5536 fi
5537 rm -f conftest*
5538 fi
5539
5540 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5541   echo "$ac_t""yes" 1>&6
5542   :
5543 else
5544   echo "$ac_t""no" 1>&6
5545 { echo "configure: error: select() required." 1>&2; exit 1; }
5546 fi
5547
5548
5549 if test "${ac_cv_header_winsock_h}" != yes; then
5550                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5551 echo "configure:5552: checking types of arguments for select()" >&5
5552  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5553   echo $ac_n "(cached) $ac_c" 1>&6
5554 else
5555    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5556   echo $ac_n "(cached) $ac_c" 1>&6
5557 else
5558     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5559   echo $ac_n "(cached) $ac_c" 1>&6
5560 else
5561      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5562      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5563       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5564        cat > conftest.$ac_ext <<EOF
5565 #line 5566 "configure"
5566 #include "confdefs.h"
5567 #ifdef HAVE_SYS_TYPES_H
5568 #include <sys/types.h>
5569 #endif
5570 #ifdef HAVE_SYS_TIME_H
5571 #include <sys/time.h>
5572 #endif
5573 #ifdef HAVE_SYS_SELECT_H
5574 #include <sys/select.h>
5575 #endif
5576 #ifdef HAVE_SYS_SOCKET_H
5577 #include <sys/socket.h>
5578 #endif
5579 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);
5580 int main() {
5581
5582 ; return 0; }
5583 EOF
5584 if { (eval echo configure:5585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5585   rm -rf conftest*
5586           ac_not_found=no ; break 3
5587 else
5588   echo "configure: failed program was:" >&5
5589   cat conftest.$ac_ext >&5
5590   rm -rf conftest*
5591   ac_not_found=yes
5592 fi
5593 rm -f conftest*
5594       done
5595      done
5596     done
5597    
5598 fi
5599   
5600 fi
5601  
5602 fi
5603  if test "$ac_not_found" = yes; then
5604   ac_cv_func_select_arg1=int 
5605   ac_cv_func_select_arg234='int *' 
5606   ac_cv_func_select_arg5='struct timeval *'
5607  fi
5608  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5609  cat >> confdefs.h <<EOF
5610 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5611 EOF
5612
5613  cat >> confdefs.h <<EOF
5614 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5615 EOF
5616
5617  cat >> confdefs.h <<EOF
5618 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5619 EOF
5620
5621
5622 fi
5623
5624
5625 for ac_hdr in regex.h 
5626 do
5627 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5628 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5629 echo "configure:5630: checking for $ac_hdr" >&5
5630 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5631   echo $ac_n "(cached) $ac_c" 1>&6
5632 else
5633   cat > conftest.$ac_ext <<EOF
5634 #line 5635 "configure"
5635 #include "confdefs.h"
5636 #include <$ac_hdr>
5637 EOF
5638 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5639 { (eval echo configure:5640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5640 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5641 if test -z "$ac_err"; then
5642   rm -rf conftest*
5643   eval "ac_cv_header_$ac_safe=yes"
5644 else
5645   echo "$ac_err" >&5
5646   echo "configure: failed program was:" >&5
5647   cat conftest.$ac_ext >&5
5648   rm -rf conftest*
5649   eval "ac_cv_header_$ac_safe=no"
5650 fi
5651 rm -f conftest*
5652 fi
5653 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5654   echo "$ac_t""yes" 1>&6
5655     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5656   cat >> confdefs.h <<EOF
5657 #define $ac_tr_hdr 1
5658 EOF
5659  
5660 else
5661   echo "$ac_t""no" 1>&6
5662 fi
5663 done
5664
5665 if test "$ac_cv_header_regex_h" != yes ; then
5666         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5667 fi
5668 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5669 echo "configure:5670: checking for regfree" >&5
5670 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5671   echo $ac_n "(cached) $ac_c" 1>&6
5672 else
5673   cat > conftest.$ac_ext <<EOF
5674 #line 5675 "configure"
5675 #include "confdefs.h"
5676 /* System header to define __stub macros and hopefully few prototypes,
5677     which can conflict with char regfree(); below.  */
5678 #include <assert.h>
5679 /* Override any gcc2 internal prototype to avoid an error.  */
5680 /* We use char because int might match the return type of a gcc2
5681     builtin and then its argument prototype would still apply.  */
5682 char regfree();
5683 char (*f)();
5684
5685 int main() {
5686
5687 /* The GNU C library defines this for functions which it implements
5688     to always fail with ENOSYS.  Some functions are actually named
5689     something starting with __ and the normal name is an alias.  */
5690 #if defined (__stub_regfree) || defined (__stub___regfree)
5691 choke me
5692 #else
5693 f = regfree;
5694 #endif
5695
5696 ; return 0; }
5697 EOF
5698 if { (eval echo configure:5699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5699   rm -rf conftest*
5700   eval "ac_cv_func_regfree=yes"
5701 else
5702   echo "configure: failed program was:" >&5
5703   cat conftest.$ac_ext >&5
5704   rm -rf conftest*
5705   eval "ac_cv_func_regfree=no"
5706 fi
5707 rm -f conftest*
5708 fi
5709
5710 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5711   echo "$ac_t""yes" 1>&6
5712   :
5713 else
5714   echo "$ac_t""no" 1>&6
5715 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5716 fi
5717
5718
5719
5720 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5721 echo "configure:5722: checking for compatible POSIX regex" >&5
5722 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5723   echo $ac_n "(cached) $ac_c" 1>&6
5724 else
5725   
5726         if test "$cross_compiling" = yes; then
5727   ol_cv_c_posix_regex=cross
5728 else
5729   cat > conftest.$ac_ext <<EOF
5730 #line 5731 "configure"
5731 #include "confdefs.h"
5732
5733 #include <sys/types.h>
5734 #include <regex.h>
5735 static char *pattern, *string;
5736 main()
5737 {
5738         int rc;
5739         regex_t re;
5740
5741         pattern = "^A";
5742
5743         if(regcomp(&re, pattern, 0)) {
5744                 return -1;
5745         }
5746         
5747         string = "ALL MATCH";
5748         
5749         rc = regexec(&re, string, 0, (void*)0, 0);
5750
5751         regfree(&re);
5752
5753         return rc;
5754 }
5755 EOF
5756 if { (eval echo configure:5757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5757 then
5758   ol_cv_c_posix_regex=yes
5759 else
5760   echo "configure: failed program was:" >&5
5761   cat conftest.$ac_ext >&5
5762   rm -fr conftest*
5763   ol_cv_c_posix_regex=no
5764 fi
5765 rm -fr conftest*
5766 fi
5767
5768 fi
5769
5770 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5771
5772 if test "$ol_cv_c_posix_regex" = no ; then
5773         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5774 fi
5775
5776 ol_link_dnssrv=no
5777 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5778 echo "configure:5779: checking for res_query" >&5
5779 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5780   echo $ac_n "(cached) $ac_c" 1>&6
5781 else
5782   cat > conftest.$ac_ext <<EOF
5783 #line 5784 "configure"
5784 #include "confdefs.h"
5785 /* System header to define __stub macros and hopefully few prototypes,
5786     which can conflict with char res_query(); below.  */
5787 #include <assert.h>
5788 /* Override any gcc2 internal prototype to avoid an error.  */
5789 /* We use char because int might match the return type of a gcc2
5790     builtin and then its argument prototype would still apply.  */
5791 char res_query();
5792 char (*f)();
5793
5794 int main() {
5795
5796 /* The GNU C library defines this for functions which it implements
5797     to always fail with ENOSYS.  Some functions are actually named
5798     something starting with __ and the normal name is an alias.  */
5799 #if defined (__stub_res_query) || defined (__stub___res_query)
5800 choke me
5801 #else
5802 f = res_query;
5803 #endif
5804
5805 ; return 0; }
5806 EOF
5807 if { (eval echo configure:5808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5808   rm -rf conftest*
5809   eval "ac_cv_func_res_query=yes"
5810 else
5811   echo "configure: failed program was:" >&5
5812   cat conftest.$ac_ext >&5
5813   rm -rf conftest*
5814   eval "ac_cv_func_res_query=no"
5815 fi
5816 rm -f conftest*
5817 fi
5818
5819 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5820   echo "$ac_t""yes" 1>&6
5821   :
5822 else
5823   echo "$ac_t""no" 1>&6
5824 fi
5825
5826 if test $ac_cv_func_res_query = no ; then 
5827         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5828 echo "configure:5829: checking for res_query in -lbind" >&5
5829 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5830 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5831   echo $ac_n "(cached) $ac_c" 1>&6
5832 else
5833   ac_save_LIBS="$LIBS"
5834 LIBS="-lbind  $LIBS"
5835 cat > conftest.$ac_ext <<EOF
5836 #line 5837 "configure"
5837 #include "confdefs.h"
5838 /* Override any gcc2 internal prototype to avoid an error.  */
5839 /* We use char because int might match the return type of a gcc2
5840     builtin and then its argument prototype would still apply.  */
5841 char res_query();
5842
5843 int main() {
5844 res_query()
5845 ; return 0; }
5846 EOF
5847 if { (eval echo configure:5848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5848   rm -rf conftest*
5849   eval "ac_cv_lib_$ac_lib_var=yes"
5850 else
5851   echo "configure: failed program was:" >&5
5852   cat conftest.$ac_ext >&5
5853   rm -rf conftest*
5854   eval "ac_cv_lib_$ac_lib_var=no"
5855 fi
5856 rm -f conftest*
5857 LIBS="$ac_save_LIBS"
5858
5859 fi
5860 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5861   echo "$ac_t""yes" 1>&6
5862     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5863     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5864   cat >> confdefs.h <<EOF
5865 #define $ac_tr_lib 1
5866 EOF
5867
5868   LIBS="-lbind $LIBS"
5869
5870 else
5871   echo "$ac_t""no" 1>&6
5872 fi
5873
5874         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5875 fi
5876
5877 if test $ac_cv_func_res_query = no ; then 
5878         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5879 echo "configure:5880: checking for __res_query in -lbind" >&5
5880 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5881 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5882   echo $ac_n "(cached) $ac_c" 1>&6
5883 else
5884   ac_save_LIBS="$LIBS"
5885 LIBS="-lbind  $LIBS"
5886 cat > conftest.$ac_ext <<EOF
5887 #line 5888 "configure"
5888 #include "confdefs.h"
5889 /* Override any gcc2 internal prototype to avoid an error.  */
5890 /* We use char because int might match the return type of a gcc2
5891     builtin and then its argument prototype would still apply.  */
5892 char __res_query();
5893
5894 int main() {
5895 __res_query()
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_lib_$ac_lib_var=yes"
5901 else
5902   echo "configure: failed program was:" >&5
5903   cat conftest.$ac_ext >&5
5904   rm -rf conftest*
5905   eval "ac_cv_lib_$ac_lib_var=no"
5906 fi
5907 rm -f conftest*
5908 LIBS="$ac_save_LIBS"
5909
5910 fi
5911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5912   echo "$ac_t""yes" 1>&6
5913     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5914     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5915   cat >> confdefs.h <<EOF
5916 #define $ac_tr_lib 1
5917 EOF
5918
5919   LIBS="-lbind $LIBS"
5920
5921 else
5922   echo "$ac_t""no" 1>&6
5923 fi
5924
5925         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5926 fi
5927
5928 if test $ac_cv_func_res_query = no ; then 
5929         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5930 echo "configure:5931: checking for res_query in -lresolv" >&5
5931 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5932 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5933   echo $ac_n "(cached) $ac_c" 1>&6
5934 else
5935   ac_save_LIBS="$LIBS"
5936 LIBS="-lresolv  $LIBS"
5937 cat > conftest.$ac_ext <<EOF
5938 #line 5939 "configure"
5939 #include "confdefs.h"
5940 /* Override any gcc2 internal prototype to avoid an error.  */
5941 /* We use char because int might match the return type of a gcc2
5942     builtin and then its argument prototype would still apply.  */
5943 char res_query();
5944
5945 int main() {
5946 res_query()
5947 ; return 0; }
5948 EOF
5949 if { (eval echo configure:5950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5950   rm -rf conftest*
5951   eval "ac_cv_lib_$ac_lib_var=yes"
5952 else
5953   echo "configure: failed program was:" >&5
5954   cat conftest.$ac_ext >&5
5955   rm -rf conftest*
5956   eval "ac_cv_lib_$ac_lib_var=no"
5957 fi
5958 rm -f conftest*
5959 LIBS="$ac_save_LIBS"
5960
5961 fi
5962 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5963   echo "$ac_t""yes" 1>&6
5964     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5965     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5966   cat >> confdefs.h <<EOF
5967 #define $ac_tr_lib 1
5968 EOF
5969
5970   LIBS="-lresolv $LIBS"
5971
5972 else
5973   echo "$ac_t""no" 1>&6
5974 fi
5975
5976         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5977 fi
5978
5979 if test "$ac_cv_func_res_query" = yes ; then
5980         cat >> confdefs.h <<\EOF
5981 #define HAVE_RES_QUERY 1
5982 EOF
5983
5984
5985         if test $ol_enable_dnssrv != no ; then
5986                 ol_link_dnssrv=yes
5987         fi
5988 fi
5989
5990 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5991         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5992 fi
5993
5994 for ac_func in getaddrinfo inet_ntop 
5995 do
5996 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5997 echo "configure:5998: checking for $ac_func" >&5
5998 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5999   echo $ac_n "(cached) $ac_c" 1>&6
6000 else
6001   cat > conftest.$ac_ext <<EOF
6002 #line 6003 "configure"
6003 #include "confdefs.h"
6004 /* System header to define __stub macros and hopefully few prototypes,
6005     which can conflict with char $ac_func(); below.  */
6006 #include <assert.h>
6007 /* Override any gcc2 internal prototype to avoid an error.  */
6008 /* We use char because int might match the return type of a gcc2
6009     builtin and then its argument prototype would still apply.  */
6010 char $ac_func();
6011 char (*f)();
6012
6013 int main() {
6014
6015 /* The GNU C library defines this for functions which it implements
6016     to always fail with ENOSYS.  Some functions are actually named
6017     something starting with __ and the normal name is an alias.  */
6018 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6019 choke me
6020 #else
6021 f = $ac_func;
6022 #endif
6023
6024 ; return 0; }
6025 EOF
6026 if { (eval echo configure:6027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6027   rm -rf conftest*
6028   eval "ac_cv_func_$ac_func=yes"
6029 else
6030   echo "configure: failed program was:" >&5
6031   cat conftest.$ac_ext >&5
6032   rm -rf conftest*
6033   eval "ac_cv_func_$ac_func=no"
6034 fi
6035 rm -f conftest*
6036 fi
6037
6038 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6039   echo "$ac_t""yes" 1>&6
6040     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6041   cat >> confdefs.h <<EOF
6042 #define $ac_tr_func 1
6043 EOF
6044  
6045 else
6046   echo "$ac_t""no" 1>&6
6047 fi
6048 done
6049
6050
6051 ol_link_ipv6=no
6052 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
6053         if test $ol_enable_ipv6 = yes ; then
6054                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
6055         fi
6056 else
6057         for ac_func in gai_strerror 
6058 do
6059 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6060 echo "configure:6061: checking for $ac_func" >&5
6061 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6062   echo $ac_n "(cached) $ac_c" 1>&6
6063 else
6064   cat > conftest.$ac_ext <<EOF
6065 #line 6066 "configure"
6066 #include "confdefs.h"
6067 /* System header to define __stub macros and hopefully few prototypes,
6068     which can conflict with char $ac_func(); below.  */
6069 #include <assert.h>
6070 /* Override any gcc2 internal prototype to avoid an error.  */
6071 /* We use char because int might match the return type of a gcc2
6072     builtin and then its argument prototype would still apply.  */
6073 char $ac_func();
6074 char (*f)();
6075
6076 int main() {
6077
6078 /* The GNU C library defines this for functions which it implements
6079     to always fail with ENOSYS.  Some functions are actually named
6080     something starting with __ and the normal name is an alias.  */
6081 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6082 choke me
6083 #else
6084 f = $ac_func;
6085 #endif
6086
6087 ; return 0; }
6088 EOF
6089 if { (eval echo configure:6090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6090   rm -rf conftest*
6091   eval "ac_cv_func_$ac_func=yes"
6092 else
6093   echo "configure: failed program was:" >&5
6094   cat conftest.$ac_ext >&5
6095   rm -rf conftest*
6096   eval "ac_cv_func_$ac_func=no"
6097 fi
6098 rm -f conftest*
6099 fi
6100
6101 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6102   echo "$ac_t""yes" 1>&6
6103     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6104   cat >> confdefs.h <<EOF
6105 #define $ac_tr_func 1
6106 EOF
6107  
6108 else
6109   echo "$ac_t""no" 1>&6
6110 fi
6111 done
6112
6113
6114         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6115 echo "configure:6116: checking INET6_ADDRSTRLEN" >&5
6116 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6117   echo $ac_n "(cached) $ac_c" 1>&6
6118 else
6119   
6120                 cat > conftest.$ac_ext <<EOF
6121 #line 6122 "configure"
6122 #include "confdefs.h"
6123
6124 #                       include <netinet/in.h>
6125 #                       ifdef INET6_ADDRSTRLEN
6126                                 __has_inet6_addrstrlen__;
6127 #                       endif
6128                 
6129 EOF
6130 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6131   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6132   rm -rf conftest*
6133   ol_cv_inet6_addrstrlen=yes
6134 else
6135   rm -rf conftest*
6136   ol_cv_inet6_addrstrlen=no
6137 fi
6138 rm -f conftest*
6139
6140 fi
6141
6142 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6143
6144         if test $ol_cv_inet6_addrstrlen = yes ; then
6145                 ol_link_ipv6=yes
6146         elif test $ol_enable_ipv6 = yes ; then
6147                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6148         fi
6149 fi
6150
6151 if test $ol_enable_local != no ; then
6152         for ac_hdr in sys/un.h 
6153 do
6154 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6155 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6156 echo "configure:6157: checking for $ac_hdr" >&5
6157 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6158   echo $ac_n "(cached) $ac_c" 1>&6
6159 else
6160   cat > conftest.$ac_ext <<EOF
6161 #line 6162 "configure"
6162 #include "confdefs.h"
6163 #include <$ac_hdr>
6164 EOF
6165 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6166 { (eval echo configure:6167: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6167 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6168 if test -z "$ac_err"; then
6169   rm -rf conftest*
6170   eval "ac_cv_header_$ac_safe=yes"
6171 else
6172   echo "$ac_err" >&5
6173   echo "configure: failed program was:" >&5
6174   cat conftest.$ac_ext >&5
6175   rm -rf conftest*
6176   eval "ac_cv_header_$ac_safe=no"
6177 fi
6178 rm -f conftest*
6179 fi
6180 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6181   echo "$ac_t""yes" 1>&6
6182     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6183   cat >> confdefs.h <<EOF
6184 #define $ac_tr_hdr 1
6185 EOF
6186  
6187 else
6188   echo "$ac_t""no" 1>&6
6189 fi
6190 done
6191
6192
6193         if test $ol_enable_local = auto ; then
6194                 ol_enable_local=$ac_cv_header_sys_un_h
6195         elif test $ac_cv_header_sys_un_h = no ; then
6196                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6197         fi
6198 fi
6199
6200 ol_link_kbind=no
6201 ol_link_kpasswd=no
6202 ol_link_krb5=no
6203 ol_link_krb4=no
6204
6205 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6206         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6207         -o $ol_with_kerberos = k425 ; then
6208
6209         for ac_hdr in krb5.h
6210 do
6211 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6212 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6213 echo "configure:6214: checking for $ac_hdr" >&5
6214 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6215   echo $ac_n "(cached) $ac_c" 1>&6
6216 else
6217   cat > conftest.$ac_ext <<EOF
6218 #line 6219 "configure"
6219 #include "confdefs.h"
6220 #include <$ac_hdr>
6221 EOF
6222 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6223 { (eval echo configure:6224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6224 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6225 if test -z "$ac_err"; then
6226   rm -rf conftest*
6227   eval "ac_cv_header_$ac_safe=yes"
6228 else
6229   echo "$ac_err" >&5
6230   echo "configure: failed program was:" >&5
6231   cat conftest.$ac_ext >&5
6232   rm -rf conftest*
6233   eval "ac_cv_header_$ac_safe=no"
6234 fi
6235 rm -f conftest*
6236 fi
6237 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6238   echo "$ac_t""yes" 1>&6
6239     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6240   cat >> confdefs.h <<EOF
6241 #define $ac_tr_hdr 1
6242 EOF
6243  
6244 else
6245   echo "$ac_t""no" 1>&6
6246 fi
6247 done
6248
6249
6250         if test $ac_cv_header_krb5_h = yes ; then
6251                                 for ac_hdr in heim_err.h
6252 do
6253 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6254 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6255 echo "configure:6256: checking for $ac_hdr" >&5
6256 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6257   echo $ac_n "(cached) $ac_c" 1>&6
6258 else
6259   cat > conftest.$ac_ext <<EOF
6260 #line 6261 "configure"
6261 #include "confdefs.h"
6262 #include <$ac_hdr>
6263 EOF
6264 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6265 { (eval echo configure:6266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6266 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6267 if test -z "$ac_err"; then
6268   rm -rf conftest*
6269   eval "ac_cv_header_$ac_safe=yes"
6270 else
6271   echo "$ac_err" >&5
6272   echo "configure: failed program was:" >&5
6273   cat conftest.$ac_ext >&5
6274   rm -rf conftest*
6275   eval "ac_cv_header_$ac_safe=no"
6276 fi
6277 rm -f conftest*
6278 fi
6279 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6280   echo "$ac_t""yes" 1>&6
6281     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6282   cat >> confdefs.h <<EOF
6283 #define $ac_tr_hdr 1
6284 EOF
6285  
6286 else
6287   echo "$ac_t""no" 1>&6
6288 fi
6289 done
6290
6291                 if test $ac_cv_header_heim_err_h = yes ; then
6292                         krb5_impl=heimdal
6293                 else
6294                         krb5_impl=mit
6295                 fi
6296
6297                 if test $krb5_impl = mit; then
6298                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6299 echo "configure:6300: checking for main in -lkrb5" >&5
6300 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6301 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6302   echo $ac_n "(cached) $ac_c" 1>&6
6303 else
6304   ac_save_LIBS="$LIBS"
6305 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
6306 cat > conftest.$ac_ext <<EOF
6307 #line 6308 "configure"
6308 #include "confdefs.h"
6309
6310 int main() {
6311 main()
6312 ; return 0; }
6313 EOF
6314 if { (eval echo configure:6315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6315   rm -rf conftest*
6316   eval "ac_cv_lib_$ac_lib_var=yes"
6317 else
6318   echo "configure: failed program was:" >&5
6319   cat conftest.$ac_ext >&5
6320   rm -rf conftest*
6321   eval "ac_cv_lib_$ac_lib_var=no"
6322 fi
6323 rm -f conftest*
6324 LIBS="$ac_save_LIBS"
6325
6326 fi
6327 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6328   echo "$ac_t""yes" 1>&6
6329   have_krb5=yes
6330                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
6331 else
6332   echo "$ac_t""no" 1>&6
6333 have_krb5=no
6334 fi
6335
6336
6337                 elif test $krb5_impl = heimdal; then
6338                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6339 echo "configure:6340: checking for main in -lkrb5" >&5
6340 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6341 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6342   echo $ac_n "(cached) $ac_c" 1>&6
6343 else
6344   ac_save_LIBS="$LIBS"
6345 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6346 cat > conftest.$ac_ext <<EOF
6347 #line 6348 "configure"
6348 #include "confdefs.h"
6349
6350 int main() {
6351 main()
6352 ; return 0; }
6353 EOF
6354 if { (eval echo configure:6355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6355   rm -rf conftest*
6356   eval "ac_cv_lib_$ac_lib_var=yes"
6357 else
6358   echo "configure: failed program was:" >&5
6359   cat conftest.$ac_ext >&5
6360   rm -rf conftest*
6361   eval "ac_cv_lib_$ac_lib_var=no"
6362 fi
6363 rm -f conftest*
6364 LIBS="$ac_save_LIBS"
6365
6366 fi
6367 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6368   echo "$ac_t""yes" 1>&6
6369   have_krb5=yes
6370                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6371 else
6372   echo "$ac_t""no" 1>&6
6373 have_krb5=no
6374 fi
6375
6376
6377                         cat >> confdefs.h <<\EOF
6378 #define HAVE_HEIMDAL_KERBEROS 1
6379 EOF
6380
6381                 else
6382                         have_krb5=no
6383                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6384                 fi
6385
6386                 if test $have_krb5 = yes ; then
6387                         ol_link_krb5=yes
6388
6389                         cat >> confdefs.h <<\EOF
6390 #define HAVE_KRB5 1
6391 EOF
6392
6393
6394                         if test $ol_enable_kpasswd != no ; then
6395                                 ol_link_kpasswd=yes;
6396                         fi
6397
6398                         if test $ol_with_kerberos = k5only ; then
6399                                 ol_with_kerberos=found
6400                         fi
6401
6402                 elif test $ol_with_kerberos != auto ; then
6403                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6404                 fi
6405
6406         fi
6407 fi
6408
6409 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6410         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6411
6412         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6413 do
6414 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6415 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6416 echo "configure:6417: checking for $ac_hdr" >&5
6417 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6418   echo $ac_n "(cached) $ac_c" 1>&6
6419 else
6420   cat > conftest.$ac_ext <<EOF
6421 #line 6422 "configure"
6422 #include "confdefs.h"
6423 #include <$ac_hdr>
6424 EOF
6425 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6426 { (eval echo configure:6427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6427 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6428 if test -z "$ac_err"; then
6429   rm -rf conftest*
6430   eval "ac_cv_header_$ac_safe=yes"
6431 else
6432   echo "$ac_err" >&5
6433   echo "configure: failed program was:" >&5
6434   cat conftest.$ac_ext >&5
6435   rm -rf conftest*
6436   eval "ac_cv_header_$ac_safe=no"
6437 fi
6438 rm -f conftest*
6439 fi
6440 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6441   echo "$ac_t""yes" 1>&6
6442     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6443   cat >> confdefs.h <<EOF
6444 #define $ac_tr_hdr 1
6445 EOF
6446  
6447 else
6448   echo "$ac_t""no" 1>&6
6449 fi
6450 done
6451
6452
6453         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6454                 if test $krb5_impl = mit; then
6455                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6456 echo "configure:6457: checking for main in -lkrb4" >&5
6457 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6458 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6459   echo $ac_n "(cached) $ac_c" 1>&6
6460 else
6461   ac_save_LIBS="$LIBS"
6462 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
6463 cat > conftest.$ac_ext <<EOF
6464 #line 6465 "configure"
6465 #include "confdefs.h"
6466
6467 int main() {
6468 main()
6469 ; return 0; }
6470 EOF
6471 if { (eval echo configure:6472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6472   rm -rf conftest*
6473   eval "ac_cv_lib_$ac_lib_var=yes"
6474 else
6475   echo "configure: failed program was:" >&5
6476   cat conftest.$ac_ext >&5
6477   rm -rf conftest*
6478   eval "ac_cv_lib_$ac_lib_var=no"
6479 fi
6480 rm -f conftest*
6481 LIBS="$ac_save_LIBS"
6482
6483 fi
6484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6485   echo "$ac_t""yes" 1>&6
6486   have_k425=yes
6487                                 KRB4_LIBS="-lkrb4 -ldes425"
6488 else
6489   echo "$ac_t""no" 1>&6
6490 have_k425=no
6491 fi
6492
6493
6494                 elif test $krb5_impl = heimdal; then
6495                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6496 echo "configure:6497: checking for main in -lkrb4" >&5
6497 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6498 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6499   echo $ac_n "(cached) $ac_c" 1>&6
6500 else
6501   ac_save_LIBS="$LIBS"
6502 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6503 cat > conftest.$ac_ext <<EOF
6504 #line 6505 "configure"
6505 #include "confdefs.h"
6506
6507 int main() {
6508 main()
6509 ; return 0; }
6510 EOF
6511 if { (eval echo configure:6512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6512   rm -rf conftest*
6513   eval "ac_cv_lib_$ac_lib_var=yes"
6514 else
6515   echo "configure: failed program was:" >&5
6516   cat conftest.$ac_ext >&5
6517   rm -rf conftest*
6518   eval "ac_cv_lib_$ac_lib_var=no"
6519 fi
6520 rm -f conftest*
6521 LIBS="$ac_save_LIBS"
6522
6523 fi
6524 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6525   echo "$ac_t""yes" 1>&6
6526   have_k425=yes
6527                                 KRB4_LIBS="-lkrb4"
6528 else
6529   echo "$ac_t""no" 1>&6
6530 have_k425=no
6531 fi
6532
6533
6534                 else
6535                         have_425=no
6536                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6537                 fi
6538
6539                 if test $have_k425 = yes ; then
6540                         ol_with_kerberos=found
6541                         ol_link_krb4=yes
6542
6543                         cat >> confdefs.h <<\EOF
6544 #define HAVE_KRB425 1
6545 EOF
6546
6547                         cat >> confdefs.h <<\EOF
6548 #define HAVE_KRB4 1
6549 EOF
6550
6551
6552                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6553 echo "configure:6554: checking for des_debug in Kerberos libraries" >&5
6554 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6555   echo $ac_n "(cached) $ac_c" 1>&6
6556 else
6557   
6558                                                                 save_LIBS="$LIBS"
6559                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6560                                 cat > conftest.$ac_ext <<EOF
6561 #line 6562 "configure"
6562 #include "confdefs.h"
6563
6564 #include <kerberosIV/krb.h>
6565 #include <kerberosIV/des.h>
6566 extern int des_debug;
6567
6568 int main() {
6569
6570 des_debug = 1;
6571
6572 ; return 0; }
6573 EOF
6574 if { (eval echo configure:6575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6575   rm -rf conftest*
6576   ol_cv_var_des_debug=yes
6577 else
6578   echo "configure: failed program was:" >&5
6579   cat conftest.$ac_ext >&5
6580   rm -rf conftest*
6581   ol_cv_var_des_debug=no
6582 fi
6583 rm -f conftest*
6584                                                                 LIBS="$save_LIBS"
6585                         
6586 fi
6587
6588 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6589
6590                         if test $ol_cv_var_des_debug = yes ; then
6591                                 cat >> confdefs.h <<\EOF
6592 #define HAVE_DES_DEBUG 1
6593 EOF
6594
6595                         fi
6596
6597                         LIBS="$save_LIBS"
6598                 fi
6599         fi
6600 fi
6601
6602 if test $ol_link_krb5 = yes ; then
6603         ol_with_kerberos=found
6604 fi
6605
6606 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6607         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6608
6609         for ac_hdr in krb.h des.h krb-archaeology.h 
6610 do
6611 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6612 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6613 echo "configure:6614: checking for $ac_hdr" >&5
6614 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6615   echo $ac_n "(cached) $ac_c" 1>&6
6616 else
6617   cat > conftest.$ac_ext <<EOF
6618 #line 6619 "configure"
6619 #include "confdefs.h"
6620 #include <$ac_hdr>
6621 EOF
6622 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6623 { (eval echo configure:6624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6624 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6625 if test -z "$ac_err"; then
6626   rm -rf conftest*
6627   eval "ac_cv_header_$ac_safe=yes"
6628 else
6629   echo "$ac_err" >&5
6630   echo "configure: failed program was:" >&5
6631   cat conftest.$ac_ext >&5
6632   rm -rf conftest*
6633   eval "ac_cv_header_$ac_safe=no"
6634 fi
6635 rm -f conftest*
6636 fi
6637 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6638   echo "$ac_t""yes" 1>&6
6639     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6640   cat >> confdefs.h <<EOF
6641 #define $ac_tr_hdr 1
6642 EOF
6643  
6644 else
6645   echo "$ac_t""no" 1>&6
6646 fi
6647 done
6648
6649
6650         if test $ac_cv_header_krb_h = yes ; then
6651                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6652 echo "configure:6653: checking for main in -lkrb" >&5
6653 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6654 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6655   echo $ac_n "(cached) $ac_c" 1>&6
6656 else
6657   ac_save_LIBS="$LIBS"
6658 LIBS="-lkrb -ldes $LIBS"
6659 cat > conftest.$ac_ext <<EOF
6660 #line 6661 "configure"
6661 #include "confdefs.h"
6662
6663 int main() {
6664 main()
6665 ; return 0; }
6666 EOF
6667 if { (eval echo configure:6668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6668   rm -rf conftest*
6669   eval "ac_cv_lib_$ac_lib_var=yes"
6670 else
6671   echo "configure: failed program was:" >&5
6672   cat conftest.$ac_ext >&5
6673   rm -rf conftest*
6674   eval "ac_cv_lib_$ac_lib_var=no"
6675 fi
6676 rm -f conftest*
6677 LIBS="$ac_save_LIBS"
6678
6679 fi
6680 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6681   echo "$ac_t""yes" 1>&6
6682   have_k4=yes
6683 else
6684   echo "$ac_t""no" 1>&6
6685 have_k4=no
6686 fi
6687
6688
6689                 if test $have_k4 = yes ; then
6690                         ol_with_kerberos=found
6691                         ol_link_krb4=yes
6692
6693                         cat >> confdefs.h <<\EOF
6694 #define HAVE_KRB4 1
6695 EOF
6696
6697
6698                         KRB4_LIBS="-lkrb -ldes"
6699
6700                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6701                                 cat >> confdefs.h <<\EOF
6702 #define HAVE_KTH_KERBEROS 1
6703 EOF
6704
6705                         fi
6706                 fi
6707         fi
6708 fi
6709
6710 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6711         ol_link_kpasswd=yes
6712 fi
6713
6714 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6715         ol_link_kbind=yes
6716
6717 elif test $ol_enable_kbind = yes ; then
6718         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6719 fi
6720
6721 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6722         cat >> confdefs.h <<\EOF
6723 #define HAVE_KERBEROS 1
6724 EOF
6725
6726
6727 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6728         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6729 fi
6730
6731 ol_link_tls=no
6732 if test $ol_with_tls != no ; then
6733         for ac_hdr in openssl/ssl.h ssl.h
6734 do
6735 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6736 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6737 echo "configure:6738: checking for $ac_hdr" >&5
6738 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6739   echo $ac_n "(cached) $ac_c" 1>&6
6740 else
6741   cat > conftest.$ac_ext <<EOF
6742 #line 6743 "configure"
6743 #include "confdefs.h"
6744 #include <$ac_hdr>
6745 EOF
6746 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6747 { (eval echo configure:6748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6748 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6749 if test -z "$ac_err"; then
6750   rm -rf conftest*
6751   eval "ac_cv_header_$ac_safe=yes"
6752 else
6753   echo "$ac_err" >&5
6754   echo "configure: failed program was:" >&5
6755   cat conftest.$ac_ext >&5
6756   rm -rf conftest*
6757   eval "ac_cv_header_$ac_safe=no"
6758 fi
6759 rm -f conftest*
6760 fi
6761 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6762   echo "$ac_t""yes" 1>&6
6763     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6764   cat >> confdefs.h <<EOF
6765 #define $ac_tr_hdr 1
6766 EOF
6767  
6768 else
6769   echo "$ac_t""no" 1>&6
6770 fi
6771 done
6772
6773         
6774         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6775                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6776 echo "configure:6777: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6777 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6778 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6779   echo $ac_n "(cached) $ac_c" 1>&6
6780 else
6781   ac_save_LIBS="$LIBS"
6782 LIBS="-lssl -lcrypto $LIBS"
6783 cat > conftest.$ac_ext <<EOF
6784 #line 6785 "configure"
6785 #include "confdefs.h"
6786 /* Override any gcc2 internal prototype to avoid an error.  */
6787 /* We use char because int might match the return type of a gcc2
6788     builtin and then its argument prototype would still apply.  */
6789 char SSLeay_add_ssl_algorithms();
6790
6791 int main() {
6792 SSLeay_add_ssl_algorithms()
6793 ; return 0; }
6794 EOF
6795 if { (eval echo configure:6796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6796   rm -rf conftest*
6797   eval "ac_cv_lib_$ac_lib_var=yes"
6798 else
6799   echo "configure: failed program was:" >&5
6800   cat conftest.$ac_ext >&5
6801   rm -rf conftest*
6802   eval "ac_cv_lib_$ac_lib_var=no"
6803 fi
6804 rm -f conftest*
6805 LIBS="$ac_save_LIBS"
6806
6807 fi
6808 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6809   echo "$ac_t""yes" 1>&6
6810   have_ssleay=yes
6811                         need_rsaref=no
6812 else
6813   echo "$ac_t""no" 1>&6
6814 have_ssleay=no
6815 fi
6816
6817                         
6818                 if test $have_ssleay = no ; then
6819                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6820 echo "configure:6821: checking for SSL_library_init in -lssl" >&5
6821 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6822 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6823   echo $ac_n "(cached) $ac_c" 1>&6
6824 else
6825   ac_save_LIBS="$LIBS"
6826 LIBS="-lssl -lcrypto $LIBS"
6827 cat > conftest.$ac_ext <<EOF
6828 #line 6829 "configure"
6829 #include "confdefs.h"
6830 /* Override any gcc2 internal prototype to avoid an error.  */
6831 /* We use char because int might match the return type of a gcc2
6832     builtin and then its argument prototype would still apply.  */
6833 char SSL_library_init();
6834
6835 int main() {
6836 SSL_library_init()
6837 ; return 0; }
6838 EOF
6839 if { (eval echo configure:6840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6840   rm -rf conftest*
6841   eval "ac_cv_lib_$ac_lib_var=yes"
6842 else
6843   echo "configure: failed program was:" >&5
6844   cat conftest.$ac_ext >&5
6845   rm -rf conftest*
6846   eval "ac_cv_lib_$ac_lib_var=no"
6847 fi
6848 rm -f conftest*
6849 LIBS="$ac_save_LIBS"
6850
6851 fi
6852 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6853   echo "$ac_t""yes" 1>&6
6854   have_ssleay=yes
6855                                 need_rsaref=no
6856 else
6857   echo "$ac_t""no" 1>&6
6858 have_ssleay=no
6859 fi
6860
6861                 fi
6862
6863                 if test $have_ssleay = no ; then
6864                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6865 echo "configure:6866: checking for ssl3_accept in -lssl" >&5
6866 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6867 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6868   echo $ac_n "(cached) $ac_c" 1>&6
6869 else
6870   ac_save_LIBS="$LIBS"
6871 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6872 cat > conftest.$ac_ext <<EOF
6873 #line 6874 "configure"
6874 #include "confdefs.h"
6875 /* Override any gcc2 internal prototype to avoid an error.  */
6876 /* We use char because int might match the return type of a gcc2
6877     builtin and then its argument prototype would still apply.  */
6878 char ssl3_accept();
6879
6880 int main() {
6881 ssl3_accept()
6882 ; return 0; }
6883 EOF
6884 if { (eval echo configure:6885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6885   rm -rf conftest*
6886   eval "ac_cv_lib_$ac_lib_var=yes"
6887 else
6888   echo "configure: failed program was:" >&5
6889   cat conftest.$ac_ext >&5
6890   rm -rf conftest*
6891   eval "ac_cv_lib_$ac_lib_var=no"
6892 fi
6893 rm -f conftest*
6894 LIBS="$ac_save_LIBS"
6895
6896 fi
6897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6898   echo "$ac_t""yes" 1>&6
6899   have_ssleay=yes
6900                                 need_rsaref=yes
6901 else
6902   echo "$ac_t""no" 1>&6
6903 have_ssleay=no
6904 fi
6905
6906                 fi
6907
6908                 if test $have_ssleay = yes ; then
6909                         ol_with_tls=found
6910                         ol_link_tls=yes
6911
6912                         cat >> confdefs.h <<\EOF
6913 #define HAVE_SSLEAY 1
6914 EOF
6915
6916
6917                         if test $need_rsaref = yes; then
6918                                 cat >> confdefs.h <<\EOF
6919 #define HAVE_RSAREF 1
6920 EOF
6921
6922
6923                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6924                         else
6925                                 TLS_LIBS="-lssl -lcrypto"
6926                         fi
6927                 fi
6928         fi
6929
6930 else
6931         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6932 fi
6933
6934 if test $ol_link_tls = yes ; then
6935         cat >> confdefs.h <<\EOF
6936 #define HAVE_TLS 1
6937 EOF
6938
6939
6940 elif test $ol_with_tls = auto ; then
6941         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6942         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6943
6944 elif test $ol_with_tls != no ; then
6945         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6946 fi
6947
6948 if test $ol_enable_lmpasswd != no; then
6949         if test $ol_link_tls != yes ; then
6950                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
6951         fi
6952
6953         cat >> confdefs.h <<\EOF
6954 #define SLAPD_LMHASH 1
6955 EOF
6956
6957 fi
6958
6959 for ac_func in \
6960         ctime_r                 \
6961         gethostbyname_r gethostbyaddr_r \
6962
6963 do
6964 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6965 echo "configure:6966: checking for $ac_func" >&5
6966 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6967   echo $ac_n "(cached) $ac_c" 1>&6
6968 else
6969   cat > conftest.$ac_ext <<EOF
6970 #line 6971 "configure"
6971 #include "confdefs.h"
6972 /* System header to define __stub macros and hopefully few prototypes,
6973     which can conflict with char $ac_func(); below.  */
6974 #include <assert.h>
6975 /* Override any gcc2 internal prototype to avoid an error.  */
6976 /* We use char because int might match the return type of a gcc2
6977     builtin and then its argument prototype would still apply.  */
6978 char $ac_func();
6979 char (*f)();
6980
6981 int main() {
6982
6983 /* The GNU C library defines this for functions which it implements
6984     to always fail with ENOSYS.  Some functions are actually named
6985     something starting with __ and the normal name is an alias.  */
6986 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6987 choke me
6988 #else
6989 f = $ac_func;
6990 #endif
6991
6992 ; return 0; }
6993 EOF
6994 if { (eval echo configure:6995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6995   rm -rf conftest*
6996   eval "ac_cv_func_$ac_func=yes"
6997 else
6998   echo "configure: failed program was:" >&5
6999   cat conftest.$ac_ext >&5
7000   rm -rf conftest*
7001   eval "ac_cv_func_$ac_func=no"
7002 fi
7003 rm -f conftest*
7004 fi
7005
7006 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7007   echo "$ac_t""yes" 1>&6
7008     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7009   cat >> confdefs.h <<EOF
7010 #define $ac_tr_func 1
7011 EOF
7012  
7013 else
7014   echo "$ac_t""no" 1>&6
7015 fi
7016 done
7017
7018
7019 if test "$ac_cv_func_ctime_r" = no ; then
7020         ol_cv_func_ctime_r_nargs=0
7021 else
7022         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
7023 echo "configure:7024: checking number of arguments of ctime_r" >&5
7024 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
7025   echo $ac_n "(cached) $ac_c" 1>&6
7026 else
7027   cat > conftest.$ac_ext <<EOF
7028 #line 7029 "configure"
7029 #include "confdefs.h"
7030 #include <time.h>
7031 int main() {
7032 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
7033 ; return 0; }
7034 EOF
7035 if { (eval echo configure:7036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7036   rm -rf conftest*
7037   ol_cv_func_ctime_r_nargs3=yes
7038 else
7039   echo "configure: failed program was:" >&5
7040   cat conftest.$ac_ext >&5
7041   rm -rf conftest*
7042   ol_cv_func_ctime_r_nargs3=no
7043 fi
7044 rm -f conftest*
7045
7046         cat > conftest.$ac_ext <<EOF
7047 #line 7048 "configure"
7048 #include "confdefs.h"
7049 #include <time.h>
7050 int main() {
7051 time_t ti; char *buffer; ctime_r(&ti,buffer);
7052 ; return 0; }
7053 EOF
7054 if { (eval echo configure:7055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7055   rm -rf conftest*
7056   ol_cv_func_ctime_r_nargs2=yes
7057 else
7058   echo "configure: failed program was:" >&5
7059   cat conftest.$ac_ext >&5
7060   rm -rf conftest*
7061   ol_cv_func_ctime_r_nargs2=no
7062 fi
7063 rm -f conftest*
7064
7065         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
7066                 $ol_cv_func_ctime_r_nargs2 = no ; then
7067
7068                 ol_cv_func_ctime_r_nargs=3
7069
7070         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
7071                 $ol_cv_func_ctime_r_nargs2 = yes ; then
7072
7073                 ol_cv_func_ctime_r_nargs=2
7074
7075         else
7076                 ol_cv_func_ctime_r_nargs=0
7077         fi
7078   
7079 fi
7080
7081 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
7082
7083   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7084         cat >> confdefs.h <<EOF
7085 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7086 EOF
7087
7088   fi
7089
7090 fi
7091
7092 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7093         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7094 echo "configure:7095: checking number of arguments of gethostbyname_r" >&5
7095 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7096   echo $ac_n "(cached) $ac_c" 1>&6
7097 else
7098   cat > conftest.$ac_ext <<EOF
7099 #line 7100 "configure"
7100 #include "confdefs.h"
7101 #include <sys/types.h>
7102 #include <sys/socket.h>
7103 #include <netinet/in.h>
7104 #include <netdb.h>
7105 #define BUFSIZE (sizeof(struct hostent)+10)
7106 int main() {
7107 struct hostent hent; char buffer[BUFSIZE];
7108                 int bufsize=BUFSIZE;int h_errno;
7109                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7110                         buffer, bufsize, &h_errno);
7111 ; return 0; }
7112 EOF
7113 if { (eval echo configure:7114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7114   rm -rf conftest*
7115   ol_cv_func_gethostbyname_r_nargs5=yes
7116 else
7117   echo "configure: failed program was:" >&5
7118   cat conftest.$ac_ext >&5
7119   rm -rf conftest*
7120   ol_cv_func_gethostbyname_r_nargs5=no
7121 fi
7122 rm -f conftest*
7123
7124         cat > conftest.$ac_ext <<EOF
7125 #line 7126 "configure"
7126 #include "confdefs.h"
7127 #include <sys/types.h>
7128 #include <sys/socket.h>
7129 #include <netinet/in.h>
7130 #include <netdb.h>
7131 #define BUFSIZE (sizeof(struct hostent)+10)
7132 int main() {
7133 struct hostent hent;struct hostent *rhent;
7134                 char buffer[BUFSIZE];
7135                 int bufsize=BUFSIZE;int h_errno;
7136                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7137                         &rhent, &h_errno);
7138 ; return 0; }
7139 EOF
7140 if { (eval echo configure:7141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7141   rm -rf conftest*
7142   ol_cv_func_gethostbyname_r_nargs6=yes
7143 else
7144   echo "configure: failed program was:" >&5
7145   cat conftest.$ac_ext >&5
7146   rm -rf conftest*
7147   ol_cv_func_gethostbyname_r_nargs6=no
7148 fi
7149 rm -f conftest*
7150
7151         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7152                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7153
7154                 ol_cv_func_gethostbyname_r_nargs=5
7155
7156         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7157                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7158
7159                 ol_cv_func_gethostbyname_r_nargs=6
7160
7161         else
7162                 ol_cv_func_gethostbyname_r_nargs=0
7163         fi
7164   
7165 fi
7166
7167 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7168   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7169         cat >> confdefs.h <<EOF
7170 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7171 EOF
7172
7173   fi
7174
7175 else
7176         ol_cv_func_gethostbyname_r_nargs=0
7177 fi
7178  
7179 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7180         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7181 echo "configure:7182: checking number of arguments of gethostbyaddr_r" >&5
7182 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7183   echo $ac_n "(cached) $ac_c" 1>&6
7184 else
7185   cat > conftest.$ac_ext <<EOF
7186 #line 7187 "configure"
7187 #include "confdefs.h"
7188 #include <sys/types.h>
7189 #include <sys/socket.h>
7190 #include <netinet/in.h>
7191 #include <netdb.h>
7192 #define BUFSIZE (sizeof(struct hostent)+10)
7193 int main() {
7194 struct hostent hent; char buffer[BUFSIZE]; 
7195             struct in_addr add;
7196             size_t alen=sizeof(struct in_addr);
7197             int bufsize=BUFSIZE;int h_errno;
7198                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7199                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7200 ; return 0; }
7201 EOF
7202 if { (eval echo configure:7203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7203   rm -rf conftest*
7204   ol_cv_func_gethostbyaddr_r_nargs7=yes
7205 else
7206   echo "configure: failed program was:" >&5
7207   cat conftest.$ac_ext >&5
7208   rm -rf conftest*
7209   ol_cv_func_gethostbyaddr_r_nargs7=no
7210 fi
7211 rm -f conftest*
7212
7213         cat > conftest.$ac_ext <<EOF
7214 #line 7215 "configure"
7215 #include "confdefs.h"
7216 #include <sys/types.h>
7217 #include <sys/socket.h>
7218 #include <netinet/in.h>
7219 #include <netdb.h>
7220 #define BUFSIZE (sizeof(struct hostent)+10)
7221 int main() {
7222 struct hostent hent;
7223                 struct hostent *rhent; char buffer[BUFSIZE]; 
7224                 struct in_addr add;
7225                 size_t alen=sizeof(struct in_addr);
7226                 int bufsize=BUFSIZE;int h_errno;
7227                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7228                         alen, AF_INET, &hent, buffer, bufsize, 
7229                         &rhent, &h_errno);
7230 ; return 0; }
7231 EOF
7232 if { (eval echo configure:7233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7233   rm -rf conftest*
7234   ol_cv_func_gethostbyaddr_r_nargs8=yes
7235 else
7236   echo "configure: failed program was:" >&5
7237   cat conftest.$ac_ext >&5
7238   rm -rf conftest*
7239   ol_cv_func_gethostbyaddr_r_nargs8=no
7240 fi
7241 rm -f conftest*
7242
7243         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7244                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7245
7246                 ol_cv_func_gethostbyaddr_r_nargs=7
7247
7248         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7249                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7250
7251                 ol_cv_func_gethostbyaddr_r_nargs=8
7252
7253         else
7254                 ol_cv_func_gethostbyaddr_r_nargs=0
7255         fi
7256   
7257 fi
7258
7259 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7260   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7261     cat >> confdefs.h <<EOF
7262 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7263 EOF
7264
7265   fi
7266
7267 else
7268         ol_cv_func_gethostbyaddr_r_nargs=0
7269 fi
7270
7271 if test "$ac_cv_func_ctime_r" = yes \
7272         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7273         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7274         -a "$ac_cv_func_gethostbyname_r" = yes \
7275         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7276         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7277         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7278         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7279         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7280         ; then
7281  
7282         cat >> confdefs.h <<\EOF
7283 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7284 EOF
7285
7286 fi
7287
7288 ol_link_threads=no
7289
7290 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7291         -o $ol_with_threads = nt ; then
7292
7293         
7294         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7295 echo "configure:7296: checking for _beginthread" >&5
7296 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7297   echo $ac_n "(cached) $ac_c" 1>&6
7298 else
7299   cat > conftest.$ac_ext <<EOF
7300 #line 7301 "configure"
7301 #include "confdefs.h"
7302 /* System header to define __stub macros and hopefully few prototypes,
7303     which can conflict with char _beginthread(); below.  */
7304 #include <assert.h>
7305 /* Override any gcc2 internal prototype to avoid an error.  */
7306 /* We use char because int might match the return type of a gcc2
7307     builtin and then its argument prototype would still apply.  */
7308 char _beginthread();
7309 char (*f)();
7310
7311 int main() {
7312
7313 /* The GNU C library defines this for functions which it implements
7314     to always fail with ENOSYS.  Some functions are actually named
7315     something starting with __ and the normal name is an alias.  */
7316 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7317 choke me
7318 #else
7319 f = _beginthread;
7320 #endif
7321
7322 ; return 0; }
7323 EOF
7324 if { (eval echo configure:7325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7325   rm -rf conftest*
7326   eval "ac_cv_func__beginthread=yes"
7327 else
7328   echo "configure: failed program was:" >&5
7329   cat conftest.$ac_ext >&5
7330   rm -rf conftest*
7331   eval "ac_cv_func__beginthread=no"
7332 fi
7333 rm -f conftest*
7334 fi
7335
7336 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7337   echo "$ac_t""yes" 1>&6
7338   :
7339 else
7340   echo "$ac_t""no" 1>&6
7341 fi
7342
7343
7344         if test $ac_cv_func__beginthread = yes ; then
7345                 cat >> confdefs.h <<\EOF
7346 #define HAVE_NT_THREADS 1
7347 EOF
7348
7349         fi
7350
7351
7352         if test "$ol_cv_nt_threads" = yes ; then
7353         ol_link_threads=nt
7354         ol_with_threads=found
7355         ol_with_yielding_select=yes
7356
7357                 cat >> confdefs.h <<\EOF
7358 #define HAVE_NT_SERVICE_MANAGER 1
7359 EOF
7360
7361                 cat >> confdefs.h <<\EOF
7362 #define HAVE_NT_EVENT_LOG 1
7363 EOF
7364
7365         fi
7366
7367         if test $ol_with_threads = nt ; then
7368                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7369         fi
7370 fi
7371
7372 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7373         -o $ol_with_threads = posix ; then
7374
7375         for ac_hdr in pthread.h
7376 do
7377 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7378 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7379 echo "configure:7380: checking for $ac_hdr" >&5
7380 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7381   echo $ac_n "(cached) $ac_c" 1>&6
7382 else
7383   cat > conftest.$ac_ext <<EOF
7384 #line 7385 "configure"
7385 #include "confdefs.h"
7386 #include <$ac_hdr>
7387 EOF
7388 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7389 { (eval echo configure:7390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7390 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7391 if test -z "$ac_err"; then
7392   rm -rf conftest*
7393   eval "ac_cv_header_$ac_safe=yes"
7394 else
7395   echo "$ac_err" >&5
7396   echo "configure: failed program was:" >&5
7397   cat conftest.$ac_ext >&5
7398   rm -rf conftest*
7399   eval "ac_cv_header_$ac_safe=no"
7400 fi
7401 rm -f conftest*
7402 fi
7403 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7404   echo "$ac_t""yes" 1>&6
7405     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7406   cat >> confdefs.h <<EOF
7407 #define $ac_tr_hdr 1
7408 EOF
7409  
7410 else
7411   echo "$ac_t""no" 1>&6
7412 fi
7413 done
7414
7415
7416         if test $ac_cv_header_pthread_h = yes ; then
7417                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7418 echo "configure:7419: checking POSIX thread version" >&5
7419 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7420   echo $ac_n "(cached) $ac_c" 1>&6
7421 else
7422   
7423         cat > conftest.$ac_ext <<EOF
7424 #line 7425 "configure"
7425 #include "confdefs.h"
7426
7427 #               include <pthread.h>
7428                 /* this check could be improved */
7429 #               ifdef PTHREAD_ONCE_INIT
7430                         pthread_version_final;
7431 #               endif
7432         
7433 EOF
7434 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7435   egrep "pthread_version_final" >/dev/null 2>&1; then
7436   rm -rf conftest*
7437   ol_pthread_final=yes
7438 else
7439   rm -rf conftest*
7440   ol_pthread_final=no
7441 fi
7442 rm -f conftest*
7443
7444
7445         cat > conftest.$ac_ext <<EOF
7446 #line 7447 "configure"
7447 #include "confdefs.h"
7448
7449 #               include <pthread.h>
7450                 /* this check could be improved */
7451 #               ifdef pthread_once_init
7452                         pthread_version_draft4;
7453 #               endif
7454         
7455 EOF
7456 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7457   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7458   rm -rf conftest*
7459   ol_pthread_draft4=yes
7460 else
7461   rm -rf conftest*
7462   ol_pthread_draft4=no
7463 fi
7464 rm -f conftest*
7465
7466
7467         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7468                 ol_cv_pthread_version=final
7469         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7470                 ol_cv_pthread_version=draft4
7471         else
7472                 ol_cv_pthread_version=unknown
7473         fi
7474
7475 fi
7476
7477 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7478
7479
7480                 if test $ol_cv_pthread_version = final ; then
7481                         cat >> confdefs.h <<\EOF
7482 #define HAVE_PTHREADS_FINAL 1
7483 EOF
7484
7485                 elif test $ol_cv_pthread_version = draft4 ; then
7486                         cat >> confdefs.h <<\EOF
7487 #define HAVE_PTHREADS_D4 1
7488 EOF
7489
7490                 else
7491                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7492                 fi
7493
7494                 # consider threads found
7495                 ol_with_threads=found
7496
7497                 
7498         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7499 echo "configure:7500: checking for LinuxThreads pthread.h" >&5
7500 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7501   echo $ac_n "(cached) $ac_c" 1>&6
7502 else
7503   cat > conftest.$ac_ext <<EOF
7504 #line 7505 "configure"
7505 #include "confdefs.h"
7506 #include <pthread.h>
7507 EOF
7508 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7509   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7510   rm -rf conftest*
7511   ol_cv_header_linux_threads=yes
7512 else
7513   rm -rf conftest*
7514   ol_cv_header_linux_threads=no
7515 fi
7516 rm -f conftest*
7517
7518                 
7519 fi
7520
7521 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7522         if test $ol_cv_header_linux_threads = yes; then
7523                 cat >> confdefs.h <<\EOF
7524 #define HAVE_LINUX_THREADS 1
7525 EOF
7526
7527         fi
7528
7529                 
7530         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7531 echo "configure:7532: checking for GNU Pth pthread.h" >&5
7532 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7533   echo $ac_n "(cached) $ac_c" 1>&6
7534 else
7535   cat > conftest.$ac_ext <<EOF
7536 #line 7537 "configure"
7537 #include "confdefs.h"
7538 #include <pthread.h>
7539 #ifdef _POSIX_THREAD_IS_GNU_PTH
7540         __gnu_pth__;
7541 #endif
7542
7543 EOF
7544 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7545   egrep "__gnu_pth__" >/dev/null 2>&1; then
7546   rm -rf conftest*
7547   ol_cv_header_gnu_pth_pthread_h=yes
7548 else
7549   rm -rf conftest*
7550   ol_cv_header_gnu_pth_pthread_h=no
7551 fi
7552 rm -f conftest*
7553
7554                 
7555 fi
7556
7557 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7558
7559
7560                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7561                         for ac_hdr in sched.h
7562 do
7563 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7564 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7565 echo "configure:7566: checking for $ac_hdr" >&5
7566 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7567   echo $ac_n "(cached) $ac_c" 1>&6
7568 else
7569   cat > conftest.$ac_ext <<EOF
7570 #line 7571 "configure"
7571 #include "confdefs.h"
7572 #include <$ac_hdr>
7573 EOF
7574 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7575 { (eval echo configure:7576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7576 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7577 if test -z "$ac_err"; then
7578   rm -rf conftest*
7579   eval "ac_cv_header_$ac_safe=yes"
7580 else
7581   echo "$ac_err" >&5
7582   echo "configure: failed program was:" >&5
7583   cat conftest.$ac_ext >&5
7584   rm -rf conftest*
7585   eval "ac_cv_header_$ac_safe=no"
7586 fi
7587 rm -f conftest*
7588 fi
7589 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7590   echo "$ac_t""yes" 1>&6
7591     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7592   cat >> confdefs.h <<EOF
7593 #define $ac_tr_hdr 1
7594 EOF
7595  
7596 else
7597   echo "$ac_t""no" 1>&6
7598 fi
7599 done
7600
7601                 fi
7602
7603                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7604                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7605 echo "configure:7606: checking for pthread_create in default libraries" >&5
7606 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7607   echo $ac_n "(cached) $ac_c" 1>&6
7608 else
7609   
7610                 if test "$cross_compiling" = yes; then
7611   cat > conftest.$ac_ext <<EOF
7612 #line 7613 "configure"
7613 #include "confdefs.h"
7614 /* pthread test headers */
7615 #include <pthread.h>
7616 #ifndef NULL
7617 #define NULL (void*)0
7618 #endif
7619
7620 static void *task(p)
7621         void *p;
7622 {
7623         return (void *) (p == NULL);
7624 }
7625
7626 int main() {
7627
7628         /* pthread test function */
7629         pthread_t t;
7630         int status;
7631         int detach = 1;
7632
7633 #ifdef HAVE_PTHREADS_FINAL
7634         /* Final pthreads */
7635         pthread_attr_t attr;
7636
7637         status = pthread_attr_init(&attr);
7638         if( status ) return status;
7639
7640 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7641         if( !detach ) {
7642 #if defined( PTHREAD_CREATE_JOINABLE )
7643                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7644 #else
7645                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7646 #endif
7647
7648 #ifdef PTHREAD_CREATE_DETACHED
7649         } else {
7650                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7651 #endif
7652         }
7653         if( status ) return status;
7654 #endif
7655
7656         status = pthread_create( &t, &attr, task, NULL );
7657         if( status ) return status;
7658
7659 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7660         if( detach ) {
7661                 /* give thread a chance to complete */
7662                 /* it should remain joinable and hence detachable */
7663                 sleep( 1 );
7664
7665                 status = pthread_detach( t );
7666                 if( status ) return status;
7667         }
7668 #endif
7669
7670 #else
7671         /* Draft 4 pthreads */
7672         status = pthread_create( &t, pthread_attr_default, task, NULL );
7673         if( status ) return status;
7674
7675         if( detach ) {
7676                 /* give thread a chance to complete */
7677                 /* it should remain joinable and hence detachable */
7678                 sleep( 1 );
7679
7680                 status = pthread_detach( &t );
7681                 if( status ) return status;
7682         }
7683 #endif
7684
7685 #ifdef HAVE_LINUX_THREADS
7686         pthread_kill_other_threads_np();
7687 #endif
7688
7689         return 0;
7690
7691 ; return 0; }
7692 EOF
7693 if { (eval echo configure:7694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7694   rm -rf conftest*
7695   ol_cv_pthread_create=yes
7696 else
7697   echo "configure: failed program was:" >&5
7698   cat conftest.$ac_ext >&5
7699   rm -rf conftest*
7700   ol_cv_pthread_create=no
7701 fi
7702 rm -f conftest*
7703 else
7704   cat > conftest.$ac_ext <<EOF
7705 #line 7706 "configure"
7706 #include "confdefs.h"
7707 /* pthread test headers */
7708 #include <pthread.h>
7709 #ifndef NULL
7710 #define NULL (void*)0
7711 #endif
7712
7713 static void *task(p)
7714         void *p;
7715 {
7716         return (void *) (p == NULL);
7717 }
7718
7719
7720 int main(argc, argv)
7721         int argc;
7722         char **argv;
7723 {
7724
7725         /* pthread test function */
7726         pthread_t t;
7727         int status;
7728         int detach = 1;
7729
7730 #ifdef HAVE_PTHREADS_FINAL
7731         /* Final pthreads */
7732         pthread_attr_t attr;
7733
7734         status = pthread_attr_init(&attr);
7735         if( status ) return status;
7736
7737 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7738         if( !detach ) {
7739 #if defined( PTHREAD_CREATE_JOINABLE )
7740                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7741 #else
7742                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7743 #endif
7744
7745 #ifdef PTHREAD_CREATE_DETACHED
7746         } else {
7747                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7748 #endif
7749         }
7750         if( status ) return status;
7751 #endif
7752
7753         status = pthread_create( &t, &attr, task, NULL );
7754         if( status ) return status;
7755
7756 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7757         if( detach ) {
7758                 /* give thread a chance to complete */
7759                 /* it should remain joinable and hence detachable */
7760                 sleep( 1 );
7761
7762                 status = pthread_detach( t );
7763                 if( status ) return status;
7764         }
7765 #endif
7766
7767 #else
7768         /* Draft 4 pthreads */
7769         status = pthread_create( &t, pthread_attr_default, task, NULL );
7770         if( status ) return status;
7771
7772         if( detach ) {
7773                 /* give thread a chance to complete */
7774                 /* it should remain joinable and hence detachable */
7775                 sleep( 1 );
7776
7777                 status = pthread_detach( &t );
7778                 if( status ) return status;
7779         }
7780 #endif
7781
7782 #ifdef HAVE_LINUX_THREADS
7783         pthread_kill_other_threads_np();
7784 #endif
7785
7786         return 0;
7787
7788 }
7789
7790 EOF
7791 if { (eval echo configure:7792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7792 then
7793   ol_cv_pthread_create=yes
7794 else
7795   echo "configure: failed program was:" >&5
7796   cat conftest.$ac_ext >&5
7797   rm -fr conftest*
7798   ol_cv_pthread_create=no
7799 fi
7800 rm -fr conftest*
7801 fi
7802
7803 fi
7804
7805 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7806
7807                 if test $ol_cv_pthread_create != no ; then
7808                         ol_link_threads=posix
7809                         ol_link_pthreads=""
7810                 fi
7811                 
7812                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7813 if test "$ol_link_threads" = no ; then
7814         # try -kthread
7815         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7816 echo "configure:7817: checking for pthread link with -kthread" >&5
7817 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7818   echo $ac_n "(cached) $ac_c" 1>&6
7819 else
7820   
7821                 # save the flags
7822                 ol_LIBS="$LIBS"
7823                 LIBS="-kthread $LIBS"
7824
7825                 if test "$cross_compiling" = yes; then
7826   cat > conftest.$ac_ext <<EOF
7827 #line 7828 "configure"
7828 #include "confdefs.h"
7829 /* pthread test headers */
7830 #include <pthread.h>
7831 #ifndef NULL
7832 #define NULL (void*)0
7833 #endif
7834
7835 static void *task(p)
7836         void *p;
7837 {
7838         return (void *) (p == NULL);
7839 }
7840
7841 int main() {
7842
7843         /* pthread test function */
7844         pthread_t t;
7845         int status;
7846         int detach = 1;
7847
7848 #ifdef HAVE_PTHREADS_FINAL
7849         /* Final pthreads */
7850         pthread_attr_t attr;
7851
7852         status = pthread_attr_init(&attr);
7853         if( status ) return status;
7854
7855 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7856         if( !detach ) {
7857 #if defined( PTHREAD_CREATE_JOINABLE )
7858                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7859 #else
7860                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7861 #endif
7862
7863 #ifdef PTHREAD_CREATE_DETACHED
7864         } else {
7865                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7866 #endif
7867         }
7868         if( status ) return status;
7869 #endif
7870
7871         status = pthread_create( &t, &attr, task, NULL );
7872         if( status ) return status;
7873
7874 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7875         if( detach ) {
7876                 /* give thread a chance to complete */
7877                 /* it should remain joinable and hence detachable */
7878                 sleep( 1 );
7879
7880                 status = pthread_detach( t );
7881                 if( status ) return status;
7882         }
7883 #endif
7884
7885 #else
7886         /* Draft 4 pthreads */
7887         status = pthread_create( &t, pthread_attr_default, task, NULL );
7888         if( status ) return status;
7889
7890         if( detach ) {
7891                 /* give thread a chance to complete */
7892                 /* it should remain joinable and hence detachable */
7893                 sleep( 1 );
7894
7895                 status = pthread_detach( &t );
7896                 if( status ) return status;
7897         }
7898 #endif
7899
7900 #ifdef HAVE_LINUX_THREADS
7901         pthread_kill_other_threads_np();
7902 #endif
7903
7904         return 0;
7905
7906 ; return 0; }
7907 EOF
7908 if { (eval echo configure:7909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7909   rm -rf conftest*
7910   ol_cv_pthread_kthread=yes
7911 else
7912   echo "configure: failed program was:" >&5
7913   cat conftest.$ac_ext >&5
7914   rm -rf conftest*
7915   ol_cv_pthread_kthread=no
7916 fi
7917 rm -f conftest*
7918 else
7919   cat > conftest.$ac_ext <<EOF
7920 #line 7921 "configure"
7921 #include "confdefs.h"
7922 /* pthread test headers */
7923 #include <pthread.h>
7924 #ifndef NULL
7925 #define NULL (void*)0
7926 #endif
7927
7928 static void *task(p)
7929         void *p;
7930 {
7931         return (void *) (p == NULL);
7932 }
7933
7934
7935 int main(argc, argv)
7936         int argc;
7937         char **argv;
7938 {
7939
7940         /* pthread test function */
7941         pthread_t t;
7942         int status;
7943         int detach = 1;
7944
7945 #ifdef HAVE_PTHREADS_FINAL
7946         /* Final pthreads */
7947         pthread_attr_t attr;
7948
7949         status = pthread_attr_init(&attr);
7950         if( status ) return status;
7951
7952 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7953         if( !detach ) {
7954 #if defined( PTHREAD_CREATE_JOINABLE )
7955                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7956 #else
7957                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7958 #endif
7959
7960 #ifdef PTHREAD_CREATE_DETACHED
7961         } else {
7962                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7963 #endif
7964         }
7965         if( status ) return status;
7966 #endif
7967
7968         status = pthread_create( &t, &attr, task, NULL );
7969         if( status ) return status;
7970
7971 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7972         if( detach ) {
7973                 /* give thread a chance to complete */
7974                 /* it should remain joinable and hence detachable */
7975                 sleep( 1 );
7976
7977                 status = pthread_detach( t );
7978                 if( status ) return status;
7979         }
7980 #endif
7981
7982 #else
7983         /* Draft 4 pthreads */
7984         status = pthread_create( &t, pthread_attr_default, task, NULL );
7985         if( status ) return status;
7986
7987         if( detach ) {
7988                 /* give thread a chance to complete */
7989                 /* it should remain joinable and hence detachable */
7990                 sleep( 1 );
7991
7992                 status = pthread_detach( &t );
7993                 if( status ) return status;
7994         }
7995 #endif
7996
7997 #ifdef HAVE_LINUX_THREADS
7998         pthread_kill_other_threads_np();
7999 #endif
8000
8001         return 0;
8002
8003 }
8004
8005 EOF
8006 if { (eval echo configure:8007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8007 then
8008   ol_cv_pthread_kthread=yes
8009 else
8010   echo "configure: failed program was:" >&5
8011   cat conftest.$ac_ext >&5
8012   rm -fr conftest*
8013   ol_cv_pthread_kthread=no
8014 fi
8015 rm -fr conftest*
8016 fi
8017
8018
8019                 # restore the LIBS
8020                 LIBS="$ol_LIBS"
8021         
8022 fi
8023
8024 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
8025
8026         if test $ol_cv_pthread_kthread = yes ; then
8027                 ol_link_pthreads="-kthread"
8028                 ol_link_threads=posix
8029         fi
8030 fi
8031
8032                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
8033 if test "$ol_link_threads" = no ; then
8034         # try -pthread
8035         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
8036 echo "configure:8037: checking for pthread link with -pthread" >&5
8037 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
8038   echo $ac_n "(cached) $ac_c" 1>&6
8039 else
8040   
8041                 # save the flags
8042                 ol_LIBS="$LIBS"
8043                 LIBS="-pthread $LIBS"
8044
8045                 if test "$cross_compiling" = yes; then
8046   cat > conftest.$ac_ext <<EOF
8047 #line 8048 "configure"
8048 #include "confdefs.h"
8049 /* pthread test headers */
8050 #include <pthread.h>
8051 #ifndef NULL
8052 #define NULL (void*)0
8053 #endif
8054
8055 static void *task(p)
8056         void *p;
8057 {
8058         return (void *) (p == NULL);
8059 }
8060
8061 int main() {
8062
8063         /* pthread test function */
8064         pthread_t t;
8065         int status;
8066         int detach = 1;
8067
8068 #ifdef HAVE_PTHREADS_FINAL
8069         /* Final pthreads */
8070         pthread_attr_t attr;
8071
8072         status = pthread_attr_init(&attr);
8073         if( status ) return status;
8074
8075 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8076         if( !detach ) {
8077 #if defined( PTHREAD_CREATE_JOINABLE )
8078                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8079 #else
8080                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8081 #endif
8082
8083 #ifdef PTHREAD_CREATE_DETACHED
8084         } else {
8085                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8086 #endif
8087         }
8088         if( status ) return status;
8089 #endif
8090
8091         status = pthread_create( &t, &attr, task, NULL );
8092         if( status ) return status;
8093
8094 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8095         if( detach ) {
8096                 /* give thread a chance to complete */
8097                 /* it should remain joinable and hence detachable */
8098                 sleep( 1 );
8099
8100                 status = pthread_detach( t );
8101                 if( status ) return status;
8102         }
8103 #endif
8104
8105 #else
8106         /* Draft 4 pthreads */
8107         status = pthread_create( &t, pthread_attr_default, task, NULL );
8108         if( status ) return status;
8109
8110         if( detach ) {
8111                 /* give thread a chance to complete */
8112                 /* it should remain joinable and hence detachable */
8113                 sleep( 1 );
8114
8115                 status = pthread_detach( &t );
8116                 if( status ) return status;
8117         }
8118 #endif
8119
8120 #ifdef HAVE_LINUX_THREADS
8121         pthread_kill_other_threads_np();
8122 #endif
8123
8124         return 0;
8125
8126 ; return 0; }
8127 EOF
8128 if { (eval echo configure:8129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8129   rm -rf conftest*
8130   ol_cv_pthread_pthread=yes
8131 else
8132   echo "configure: failed program was:" >&5
8133   cat conftest.$ac_ext >&5
8134   rm -rf conftest*
8135   ol_cv_pthread_pthread=no
8136 fi
8137 rm -f conftest*
8138 else
8139   cat > conftest.$ac_ext <<EOF
8140 #line 8141 "configure"
8141 #include "confdefs.h"
8142 /* pthread test headers */
8143 #include <pthread.h>
8144 #ifndef NULL
8145 #define NULL (void*)0
8146 #endif
8147
8148 static void *task(p)
8149         void *p;
8150 {
8151         return (void *) (p == NULL);
8152 }
8153
8154
8155 int main(argc, argv)
8156         int argc;
8157         char **argv;
8158 {
8159
8160         /* pthread test function */
8161         pthread_t t;
8162         int status;
8163         int detach = 1;
8164
8165 #ifdef HAVE_PTHREADS_FINAL
8166         /* Final pthreads */
8167         pthread_attr_t attr;
8168
8169         status = pthread_attr_init(&attr);
8170         if( status ) return status;
8171
8172 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8173         if( !detach ) {
8174 #if defined( PTHREAD_CREATE_JOINABLE )
8175                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8176 #else
8177                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8178 #endif
8179
8180 #ifdef PTHREAD_CREATE_DETACHED
8181         } else {
8182                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8183 #endif
8184         }
8185         if( status ) return status;
8186 #endif
8187
8188         status = pthread_create( &t, &attr, task, NULL );
8189         if( status ) return status;
8190
8191 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8192         if( detach ) {
8193                 /* give thread a chance to complete */
8194                 /* it should remain joinable and hence detachable */
8195                 sleep( 1 );
8196
8197                 status = pthread_detach( t );
8198                 if( status ) return status;
8199         }
8200 #endif
8201
8202 #else
8203         /* Draft 4 pthreads */
8204         status = pthread_create( &t, pthread_attr_default, task, NULL );
8205         if( status ) return status;
8206
8207         if( detach ) {
8208                 /* give thread a chance to complete */
8209                 /* it should remain joinable and hence detachable */
8210                 sleep( 1 );
8211
8212                 status = pthread_detach( &t );
8213                 if( status ) return status;
8214         }
8215 #endif
8216
8217 #ifdef HAVE_LINUX_THREADS
8218         pthread_kill_other_threads_np();
8219 #endif
8220
8221         return 0;
8222
8223 }
8224
8225 EOF
8226 if { (eval echo configure:8227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8227 then
8228   ol_cv_pthread_pthread=yes
8229 else
8230   echo "configure: failed program was:" >&5
8231   cat conftest.$ac_ext >&5
8232   rm -fr conftest*
8233   ol_cv_pthread_pthread=no
8234 fi
8235 rm -fr conftest*
8236 fi
8237
8238
8239                 # restore the LIBS
8240                 LIBS="$ol_LIBS"
8241         
8242 fi
8243
8244 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8245
8246         if test $ol_cv_pthread_pthread = yes ; then
8247                 ol_link_pthreads="-pthread"
8248                 ol_link_threads=posix
8249         fi
8250 fi
8251
8252                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8253 if test "$ol_link_threads" = no ; then
8254         # try -pthreads
8255         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8256 echo "configure:8257: checking for pthread link with -pthreads" >&5
8257 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8258   echo $ac_n "(cached) $ac_c" 1>&6
8259 else
8260   
8261                 # save the flags
8262                 ol_LIBS="$LIBS"
8263                 LIBS="-pthreads $LIBS"
8264
8265                 if test "$cross_compiling" = yes; then
8266   cat > conftest.$ac_ext <<EOF
8267 #line 8268 "configure"
8268 #include "confdefs.h"
8269 /* pthread test headers */
8270 #include <pthread.h>
8271 #ifndef NULL
8272 #define NULL (void*)0
8273 #endif
8274
8275 static void *task(p)
8276         void *p;
8277 {
8278         return (void *) (p == NULL);
8279 }
8280
8281 int main() {
8282
8283         /* pthread test function */
8284         pthread_t t;
8285         int status;
8286         int detach = 1;
8287
8288 #ifdef HAVE_PTHREADS_FINAL
8289         /* Final pthreads */
8290         pthread_attr_t attr;
8291
8292         status = pthread_attr_init(&attr);
8293         if( status ) return status;
8294
8295 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8296         if( !detach ) {
8297 #if defined( PTHREAD_CREATE_JOINABLE )
8298                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8299 #else
8300                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8301 #endif
8302
8303 #ifdef PTHREAD_CREATE_DETACHED
8304         } else {
8305                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8306 #endif
8307         }
8308         if( status ) return status;
8309 #endif
8310
8311         status = pthread_create( &t, &attr, task, NULL );
8312         if( status ) return status;
8313
8314 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8315         if( detach ) {
8316                 /* give thread a chance to complete */
8317                 /* it should remain joinable and hence detachable */
8318                 sleep( 1 );
8319
8320                 status = pthread_detach( t );
8321                 if( status ) return status;
8322         }
8323 #endif
8324
8325 #else
8326         /* Draft 4 pthreads */
8327         status = pthread_create( &t, pthread_attr_default, task, NULL );
8328         if( status ) return status;
8329
8330         if( detach ) {
8331                 /* give thread a chance to complete */
8332                 /* it should remain joinable and hence detachable */
8333                 sleep( 1 );
8334
8335                 status = pthread_detach( &t );
8336                 if( status ) return status;
8337         }
8338 #endif
8339
8340 #ifdef HAVE_LINUX_THREADS
8341         pthread_kill_other_threads_np();
8342 #endif
8343
8344         return 0;
8345
8346 ; return 0; }
8347 EOF
8348 if { (eval echo configure:8349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8349   rm -rf conftest*
8350   ol_cv_pthread_pthreads=yes
8351 else
8352   echo "configure: failed program was:" >&5
8353   cat conftest.$ac_ext >&5
8354   rm -rf conftest*
8355   ol_cv_pthread_pthreads=no
8356 fi
8357 rm -f conftest*
8358 else
8359   cat > conftest.$ac_ext <<EOF
8360 #line 8361 "configure"
8361 #include "confdefs.h"
8362 /* pthread test headers */
8363 #include <pthread.h>
8364 #ifndef NULL
8365 #define NULL (void*)0
8366 #endif
8367
8368 static void *task(p)
8369         void *p;
8370 {
8371         return (void *) (p == NULL);
8372 }
8373
8374
8375 int main(argc, argv)
8376         int argc;
8377         char **argv;
8378 {
8379
8380         /* pthread test function */
8381         pthread_t t;
8382         int status;
8383         int detach = 1;
8384
8385 #ifdef HAVE_PTHREADS_FINAL
8386         /* Final pthreads */
8387         pthread_attr_t attr;
8388
8389         status = pthread_attr_init(&attr);
8390         if( status ) return status;
8391
8392 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8393         if( !detach ) {
8394 #if defined( PTHREAD_CREATE_JOINABLE )
8395                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8396 #else
8397                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8398 #endif
8399
8400 #ifdef PTHREAD_CREATE_DETACHED
8401         } else {
8402                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8403 #endif
8404         }
8405         if( status ) return status;
8406 #endif
8407
8408         status = pthread_create( &t, &attr, task, NULL );
8409         if( status ) return status;
8410
8411 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8412         if( detach ) {
8413                 /* give thread a chance to complete */
8414                 /* it should remain joinable and hence detachable */
8415                 sleep( 1 );
8416
8417                 status = pthread_detach( t );
8418                 if( status ) return status;
8419         }
8420 #endif
8421
8422 #else
8423         /* Draft 4 pthreads */
8424         status = pthread_create( &t, pthread_attr_default, task, NULL );
8425         if( status ) return status;
8426
8427         if( detach ) {
8428                 /* give thread a chance to complete */
8429                 /* it should remain joinable and hence detachable */
8430                 sleep( 1 );
8431
8432                 status = pthread_detach( &t );
8433                 if( status ) return status;
8434         }
8435 #endif
8436
8437 #ifdef HAVE_LINUX_THREADS
8438         pthread_kill_other_threads_np();
8439 #endif
8440
8441         return 0;
8442
8443 }
8444
8445 EOF
8446 if { (eval echo configure:8447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8447 then
8448   ol_cv_pthread_pthreads=yes
8449 else
8450   echo "configure: failed program was:" >&5
8451   cat conftest.$ac_ext >&5
8452   rm -fr conftest*
8453   ol_cv_pthread_pthreads=no
8454 fi
8455 rm -fr conftest*
8456 fi
8457
8458
8459                 # restore the LIBS
8460                 LIBS="$ol_LIBS"
8461         
8462 fi
8463
8464 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8465
8466         if test $ol_cv_pthread_pthreads = yes ; then
8467                 ol_link_pthreads="-pthreads"
8468                 ol_link_threads=posix
8469         fi
8470 fi
8471
8472                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8473 if test "$ol_link_threads" = no ; then
8474         # try -mthreads
8475         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8476 echo "configure:8477: checking for pthread link with -mthreads" >&5
8477 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8478   echo $ac_n "(cached) $ac_c" 1>&6
8479 else
8480   
8481                 # save the flags
8482                 ol_LIBS="$LIBS"
8483                 LIBS="-mthreads $LIBS"
8484
8485                 if test "$cross_compiling" = yes; then
8486   cat > conftest.$ac_ext <<EOF
8487 #line 8488 "configure"
8488 #include "confdefs.h"
8489 /* pthread test headers */
8490 #include <pthread.h>
8491 #ifndef NULL
8492 #define NULL (void*)0
8493 #endif
8494
8495 static void *task(p)
8496         void *p;
8497 {
8498         return (void *) (p == NULL);
8499 }
8500
8501 int main() {
8502
8503         /* pthread test function */
8504         pthread_t t;
8505         int status;
8506         int detach = 1;
8507
8508 #ifdef HAVE_PTHREADS_FINAL
8509         /* Final pthreads */
8510         pthread_attr_t attr;
8511
8512         status = pthread_attr_init(&attr);
8513         if( status ) return status;
8514
8515 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8516         if( !detach ) {
8517 #if defined( PTHREAD_CREATE_JOINABLE )
8518                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8519 #else
8520                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8521 #endif
8522
8523 #ifdef PTHREAD_CREATE_DETACHED
8524         } else {
8525                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8526 #endif
8527         }
8528         if( status ) return status;
8529 #endif
8530
8531         status = pthread_create( &t, &attr, task, NULL );
8532         if( status ) return status;
8533
8534 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8535         if( detach ) {
8536                 /* give thread a chance to complete */
8537                 /* it should remain joinable and hence detachable */
8538                 sleep( 1 );
8539
8540                 status = pthread_detach( t );
8541                 if( status ) return status;
8542         }
8543 #endif
8544
8545 #else
8546         /* Draft 4 pthreads */
8547         status = pthread_create( &t, pthread_attr_default, task, NULL );
8548         if( status ) return status;
8549
8550         if( detach ) {
8551                 /* give thread a chance to complete */
8552                 /* it should remain joinable and hence detachable */
8553                 sleep( 1 );
8554
8555                 status = pthread_detach( &t );
8556                 if( status ) return status;
8557         }
8558 #endif
8559
8560 #ifdef HAVE_LINUX_THREADS
8561         pthread_kill_other_threads_np();
8562 #endif
8563
8564         return 0;
8565
8566 ; return 0; }
8567 EOF
8568 if { (eval echo configure:8569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8569   rm -rf conftest*
8570   ol_cv_pthread_mthreads=yes
8571 else
8572   echo "configure: failed program was:" >&5
8573   cat conftest.$ac_ext >&5
8574   rm -rf conftest*
8575   ol_cv_pthread_mthreads=no
8576 fi
8577 rm -f conftest*
8578 else
8579   cat > conftest.$ac_ext <<EOF
8580 #line 8581 "configure"
8581 #include "confdefs.h"
8582 /* pthread test headers */
8583 #include <pthread.h>
8584 #ifndef NULL
8585 #define NULL (void*)0
8586 #endif
8587
8588 static void *task(p)
8589         void *p;
8590 {
8591         return (void *) (p == NULL);
8592 }
8593
8594
8595 int main(argc, argv)
8596         int argc;
8597         char **argv;
8598 {
8599
8600         /* pthread test function */
8601         pthread_t t;
8602         int status;
8603         int detach = 1;
8604
8605 #ifdef HAVE_PTHREADS_FINAL
8606         /* Final pthreads */
8607         pthread_attr_t attr;
8608
8609         status = pthread_attr_init(&attr);
8610         if( status ) return status;
8611
8612 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8613         if( !detach ) {
8614 #if defined( PTHREAD_CREATE_JOINABLE )
8615                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8616 #else
8617                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8618 #endif
8619
8620 #ifdef PTHREAD_CREATE_DETACHED
8621         } else {
8622                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8623 #endif
8624         }
8625         if( status ) return status;
8626 #endif
8627
8628         status = pthread_create( &t, &attr, task, NULL );
8629         if( status ) return status;
8630
8631 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8632         if( detach ) {
8633                 /* give thread a chance to complete */
8634                 /* it should remain joinable and hence detachable */
8635                 sleep( 1 );
8636
8637                 status = pthread_detach( t );
8638                 if( status ) return status;
8639         }
8640 #endif
8641
8642 #else
8643         /* Draft 4 pthreads */
8644         status = pthread_create( &t, pthread_attr_default, task, NULL );
8645         if( status ) return status;
8646
8647         if( detach ) {
8648                 /* give thread a chance to complete */
8649                 /* it should remain joinable and hence detachable */
8650                 sleep( 1 );
8651
8652                 status = pthread_detach( &t );
8653                 if( status ) return status;
8654         }
8655 #endif
8656
8657 #ifdef HAVE_LINUX_THREADS
8658         pthread_kill_other_threads_np();
8659 #endif
8660
8661         return 0;
8662
8663 }
8664
8665 EOF
8666 if { (eval echo configure:8667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8667 then
8668   ol_cv_pthread_mthreads=yes
8669 else
8670   echo "configure: failed program was:" >&5
8671   cat conftest.$ac_ext >&5
8672   rm -fr conftest*
8673   ol_cv_pthread_mthreads=no
8674 fi
8675 rm -fr conftest*
8676 fi
8677
8678
8679                 # restore the LIBS
8680                 LIBS="$ol_LIBS"
8681         
8682 fi
8683
8684 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8685
8686         if test $ol_cv_pthread_mthreads = yes ; then
8687                 ol_link_pthreads="-mthreads"
8688                 ol_link_threads=posix
8689         fi
8690 fi
8691
8692                 # Pthread try link: -thread (ol_cv_pthread_thread)
8693 if test "$ol_link_threads" = no ; then
8694         # try -thread
8695         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8696 echo "configure:8697: checking for pthread link with -thread" >&5
8697 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8698   echo $ac_n "(cached) $ac_c" 1>&6
8699 else
8700   
8701                 # save the flags
8702                 ol_LIBS="$LIBS"
8703                 LIBS="-thread $LIBS"
8704
8705                 if test "$cross_compiling" = yes; then
8706   cat > conftest.$ac_ext <<EOF
8707 #line 8708 "configure"
8708 #include "confdefs.h"
8709 /* pthread test headers */
8710 #include <pthread.h>
8711 #ifndef NULL
8712 #define NULL (void*)0
8713 #endif
8714
8715 static void *task(p)
8716         void *p;
8717 {
8718         return (void *) (p == NULL);
8719 }
8720
8721 int main() {
8722
8723         /* pthread test function */
8724         pthread_t t;
8725         int status;
8726         int detach = 1;
8727
8728 #ifdef HAVE_PTHREADS_FINAL
8729         /* Final pthreads */
8730         pthread_attr_t attr;
8731
8732         status = pthread_attr_init(&attr);
8733         if( status ) return status;
8734
8735 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8736         if( !detach ) {
8737 #if defined( PTHREAD_CREATE_JOINABLE )
8738                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8739 #else
8740                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8741 #endif
8742
8743 #ifdef PTHREAD_CREATE_DETACHED
8744         } else {
8745                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8746 #endif
8747         }
8748         if( status ) return status;
8749 #endif
8750
8751         status = pthread_create( &t, &attr, task, NULL );
8752         if( status ) return status;
8753
8754 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8755         if( detach ) {
8756                 /* give thread a chance to complete */
8757                 /* it should remain joinable and hence detachable */
8758                 sleep( 1 );
8759
8760                 status = pthread_detach( t );
8761                 if( status ) return status;
8762         }
8763 #endif
8764
8765 #else
8766         /* Draft 4 pthreads */
8767         status = pthread_create( &t, pthread_attr_default, task, NULL );
8768         if( status ) return status;
8769
8770         if( detach ) {
8771                 /* give thread a chance to complete */
8772                 /* it should remain joinable and hence detachable */
8773                 sleep( 1 );
8774
8775                 status = pthread_detach( &t );
8776                 if( status ) return status;
8777         }
8778 #endif
8779
8780 #ifdef HAVE_LINUX_THREADS
8781         pthread_kill_other_threads_np();
8782 #endif
8783
8784         return 0;
8785
8786 ; return 0; }
8787 EOF
8788 if { (eval echo configure:8789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8789   rm -rf conftest*
8790   ol_cv_pthread_thread=yes
8791 else
8792   echo "configure: failed program was:" >&5
8793   cat conftest.$ac_ext >&5
8794   rm -rf conftest*
8795   ol_cv_pthread_thread=no
8796 fi
8797 rm -f conftest*
8798 else
8799   cat > conftest.$ac_ext <<EOF
8800 #line 8801 "configure"
8801 #include "confdefs.h"
8802 /* pthread test headers */
8803 #include <pthread.h>
8804 #ifndef NULL
8805 #define NULL (void*)0
8806 #endif
8807
8808 static void *task(p)
8809         void *p;
8810 {
8811         return (void *) (p == NULL);
8812 }
8813
8814
8815 int main(argc, argv)
8816         int argc;
8817         char **argv;
8818 {
8819
8820         /* pthread test function */
8821         pthread_t t;
8822         int status;
8823         int detach = 1;
8824
8825 #ifdef HAVE_PTHREADS_FINAL
8826         /* Final pthreads */
8827         pthread_attr_t attr;
8828
8829         status = pthread_attr_init(&attr);
8830         if( status ) return status;
8831
8832 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8833         if( !detach ) {
8834 #if defined( PTHREAD_CREATE_JOINABLE )
8835                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8836 #else
8837                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8838 #endif
8839
8840 #ifdef PTHREAD_CREATE_DETACHED
8841         } else {
8842                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8843 #endif
8844         }
8845         if( status ) return status;
8846 #endif
8847
8848         status = pthread_create( &t, &attr, task, NULL );
8849         if( status ) return status;
8850
8851 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8852         if( detach ) {
8853                 /* give thread a chance to complete */
8854                 /* it should remain joinable and hence detachable */
8855                 sleep( 1 );
8856
8857                 status = pthread_detach( t );
8858                 if( status ) return status;
8859         }
8860 #endif
8861
8862 #else
8863         /* Draft 4 pthreads */
8864         status = pthread_create( &t, pthread_attr_default, task, NULL );
8865         if( status ) return status;
8866
8867         if( detach ) {
8868                 /* give thread a chance to complete */
8869                 /* it should remain joinable and hence detachable */
8870                 sleep( 1 );
8871
8872                 status = pthread_detach( &t );
8873                 if( status ) return status;
8874         }
8875 #endif
8876
8877 #ifdef HAVE_LINUX_THREADS
8878         pthread_kill_other_threads_np();
8879 #endif
8880
8881         return 0;
8882
8883 }
8884
8885 EOF
8886 if { (eval echo configure:8887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8887 then
8888   ol_cv_pthread_thread=yes
8889 else
8890   echo "configure: failed program was:" >&5
8891   cat conftest.$ac_ext >&5
8892   rm -fr conftest*
8893   ol_cv_pthread_thread=no
8894 fi
8895 rm -fr conftest*
8896 fi
8897
8898
8899                 # restore the LIBS
8900                 LIBS="$ol_LIBS"
8901         
8902 fi
8903
8904 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8905
8906         if test $ol_cv_pthread_thread = yes ; then
8907                 ol_link_pthreads="-thread"
8908                 ol_link_threads=posix
8909         fi
8910 fi
8911
8912
8913                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8914 if test "$ol_link_threads" = no ; then
8915         # try -lpthread -lmach -lexc -lc_r
8916         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8917 echo "configure:8918: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8918 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8919   echo $ac_n "(cached) $ac_c" 1>&6
8920 else
8921   
8922                 # save the flags
8923                 ol_LIBS="$LIBS"
8924                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8925
8926                 if test "$cross_compiling" = yes; then
8927   cat > conftest.$ac_ext <<EOF
8928 #line 8929 "configure"
8929 #include "confdefs.h"
8930 /* pthread test headers */
8931 #include <pthread.h>
8932 #ifndef NULL
8933 #define NULL (void*)0
8934 #endif
8935
8936 static void *task(p)
8937         void *p;
8938 {
8939         return (void *) (p == NULL);
8940 }
8941
8942 int main() {
8943
8944         /* pthread test function */
8945         pthread_t t;
8946         int status;
8947         int detach = 1;
8948
8949 #ifdef HAVE_PTHREADS_FINAL
8950         /* Final pthreads */
8951         pthread_attr_t attr;
8952
8953         status = pthread_attr_init(&attr);
8954         if( status ) return status;
8955
8956 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8957         if( !detach ) {
8958 #if defined( PTHREAD_CREATE_JOINABLE )
8959                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8960 #else
8961                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8962 #endif
8963
8964 #ifdef PTHREAD_CREATE_DETACHED
8965         } else {
8966                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8967 #endif
8968         }
8969         if( status ) return status;
8970 #endif
8971
8972         status = pthread_create( &t, &attr, task, NULL );
8973         if( status ) return status;
8974
8975 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8976         if( detach ) {
8977                 /* give thread a chance to complete */
8978                 /* it should remain joinable and hence detachable */
8979                 sleep( 1 );
8980
8981                 status = pthread_detach( t );
8982                 if( status ) return status;
8983         }
8984 #endif
8985
8986 #else
8987         /* Draft 4 pthreads */
8988         status = pthread_create( &t, pthread_attr_default, task, NULL );
8989         if( status ) return status;
8990
8991         if( detach ) {
8992                 /* give thread a chance to complete */
8993                 /* it should remain joinable and hence detachable */
8994                 sleep( 1 );
8995
8996                 status = pthread_detach( &t );
8997                 if( status ) return status;
8998         }
8999 #endif
9000
9001 #ifdef HAVE_LINUX_THREADS
9002         pthread_kill_other_threads_np();
9003 #endif
9004
9005         return 0;
9006
9007 ; return 0; }
9008 EOF
9009 if { (eval echo configure:9010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9010   rm -rf conftest*
9011   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9012 else
9013   echo "configure: failed program was:" >&5
9014   cat conftest.$ac_ext >&5
9015   rm -rf conftest*
9016   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9017 fi
9018 rm -f conftest*
9019 else
9020   cat > conftest.$ac_ext <<EOF
9021 #line 9022 "configure"
9022 #include "confdefs.h"
9023 /* pthread test headers */
9024 #include <pthread.h>
9025 #ifndef NULL
9026 #define NULL (void*)0
9027 #endif
9028
9029 static void *task(p)
9030         void *p;
9031 {
9032         return (void *) (p == NULL);
9033 }
9034
9035
9036 int main(argc, argv)
9037         int argc;
9038         char **argv;
9039 {
9040
9041         /* pthread test function */
9042         pthread_t t;
9043         int status;
9044         int detach = 1;
9045
9046 #ifdef HAVE_PTHREADS_FINAL
9047         /* Final pthreads */
9048         pthread_attr_t attr;
9049
9050         status = pthread_attr_init(&attr);
9051         if( status ) return status;
9052
9053 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9054         if( !detach ) {
9055 #if defined( PTHREAD_CREATE_JOINABLE )
9056                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9057 #else
9058                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9059 #endif
9060
9061 #ifdef PTHREAD_CREATE_DETACHED
9062         } else {
9063                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9064 #endif
9065         }
9066         if( status ) return status;
9067 #endif
9068
9069         status = pthread_create( &t, &attr, task, NULL );
9070         if( status ) return status;
9071
9072 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9073         if( detach ) {
9074                 /* give thread a chance to complete */
9075                 /* it should remain joinable and hence detachable */
9076                 sleep( 1 );
9077
9078                 status = pthread_detach( t );
9079                 if( status ) return status;
9080         }
9081 #endif
9082
9083 #else
9084         /* Draft 4 pthreads */
9085         status = pthread_create( &t, pthread_attr_default, task, NULL );
9086         if( status ) return status;
9087
9088         if( detach ) {
9089                 /* give thread a chance to complete */
9090                 /* it should remain joinable and hence detachable */
9091                 sleep( 1 );
9092
9093                 status = pthread_detach( &t );
9094                 if( status ) return status;
9095         }
9096 #endif
9097
9098 #ifdef HAVE_LINUX_THREADS
9099         pthread_kill_other_threads_np();
9100 #endif
9101
9102         return 0;
9103
9104 }
9105
9106 EOF
9107 if { (eval echo configure:9108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9108 then
9109   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9110 else
9111   echo "configure: failed program was:" >&5
9112   cat conftest.$ac_ext >&5
9113   rm -fr conftest*
9114   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9115 fi
9116 rm -fr conftest*
9117 fi
9118
9119
9120                 # restore the LIBS
9121                 LIBS="$ol_LIBS"
9122         
9123 fi
9124
9125 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9126
9127         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9128                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9129                 ol_link_threads=posix
9130         fi
9131 fi
9132
9133                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9134 if test "$ol_link_threads" = no ; then
9135         # try -lpthread -lmach -lexc
9136         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9137 echo "configure:9138: checking for pthread link with -lpthread -lmach -lexc" >&5
9138 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9139   echo $ac_n "(cached) $ac_c" 1>&6
9140 else
9141   
9142                 # save the flags
9143                 ol_LIBS="$LIBS"
9144                 LIBS="-lpthread -lmach -lexc $LIBS"
9145
9146                 if test "$cross_compiling" = yes; then
9147   cat > conftest.$ac_ext <<EOF
9148 #line 9149 "configure"
9149 #include "confdefs.h"
9150 /* pthread test headers */
9151 #include <pthread.h>
9152 #ifndef NULL
9153 #define NULL (void*)0
9154 #endif
9155
9156 static void *task(p)
9157         void *p;
9158 {
9159         return (void *) (p == NULL);
9160 }
9161
9162 int main() {
9163
9164         /* pthread test function */
9165         pthread_t t;
9166         int status;
9167         int detach = 1;
9168
9169 #ifdef HAVE_PTHREADS_FINAL
9170         /* Final pthreads */
9171         pthread_attr_t attr;
9172
9173         status = pthread_attr_init(&attr);
9174         if( status ) return status;
9175
9176 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9177         if( !detach ) {
9178 #if defined( PTHREAD_CREATE_JOINABLE )
9179                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9180 #else
9181                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9182 #endif
9183
9184 #ifdef PTHREAD_CREATE_DETACHED
9185         } else {
9186                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9187 #endif
9188         }
9189         if( status ) return status;
9190 #endif
9191
9192         status = pthread_create( &t, &attr, task, NULL );
9193         if( status ) return status;
9194
9195 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9196         if( detach ) {
9197                 /* give thread a chance to complete */
9198                 /* it should remain joinable and hence detachable */
9199                 sleep( 1 );
9200
9201                 status = pthread_detach( t );
9202                 if( status ) return status;
9203         }
9204 #endif
9205
9206 #else
9207         /* Draft 4 pthreads */
9208         status = pthread_create( &t, pthread_attr_default, task, NULL );
9209         if( status ) return status;
9210
9211         if( detach ) {
9212                 /* give thread a chance to complete */
9213                 /* it should remain joinable and hence detachable */
9214                 sleep( 1 );
9215
9216                 status = pthread_detach( &t );
9217                 if( status ) return status;
9218         }
9219 #endif
9220
9221 #ifdef HAVE_LINUX_THREADS
9222         pthread_kill_other_threads_np();
9223 #endif
9224
9225         return 0;
9226
9227 ; return 0; }
9228 EOF
9229 if { (eval echo configure:9230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9230   rm -rf conftest*
9231   ol_cv_pthread_lpthread_lmach_lexc=yes
9232 else
9233   echo "configure: failed program was:" >&5
9234   cat conftest.$ac_ext >&5
9235   rm -rf conftest*
9236   ol_cv_pthread_lpthread_lmach_lexc=no
9237 fi
9238 rm -f conftest*
9239 else
9240   cat > conftest.$ac_ext <<EOF
9241 #line 9242 "configure"
9242 #include "confdefs.h"
9243 /* pthread test headers */
9244 #include <pthread.h>
9245 #ifndef NULL
9246 #define NULL (void*)0
9247 #endif
9248
9249 static void *task(p)
9250         void *p;
9251 {
9252         return (void *) (p == NULL);
9253 }
9254
9255
9256 int main(argc, argv)
9257         int argc;
9258         char **argv;
9259 {
9260
9261         /* pthread test function */
9262         pthread_t t;
9263         int status;
9264         int detach = 1;
9265
9266 #ifdef HAVE_PTHREADS_FINAL
9267         /* Final pthreads */
9268         pthread_attr_t attr;
9269
9270         status = pthread_attr_init(&attr);
9271         if( status ) return status;
9272
9273 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9274         if( !detach ) {
9275 #if defined( PTHREAD_CREATE_JOINABLE )
9276                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9277 #else
9278                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9279 #endif
9280
9281 #ifdef PTHREAD_CREATE_DETACHED
9282         } else {
9283                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9284 #endif
9285         }
9286         if( status ) return status;
9287 #endif
9288
9289         status = pthread_create( &t, &attr, task, NULL );
9290         if( status ) return status;
9291
9292 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9293         if( detach ) {
9294                 /* give thread a chance to complete */
9295                 /* it should remain joinable and hence detachable */
9296                 sleep( 1 );
9297
9298                 status = pthread_detach( t );
9299                 if( status ) return status;
9300         }
9301 #endif
9302
9303 #else
9304         /* Draft 4 pthreads */
9305         status = pthread_create( &t, pthread_attr_default, task, NULL );
9306         if( status ) return status;
9307
9308         if( detach ) {
9309                 /* give thread a chance to complete */
9310                 /* it should remain joinable and hence detachable */
9311                 sleep( 1 );
9312
9313                 status = pthread_detach( &t );
9314                 if( status ) return status;
9315         }
9316 #endif
9317
9318 #ifdef HAVE_LINUX_THREADS
9319         pthread_kill_other_threads_np();
9320 #endif
9321
9322         return 0;
9323
9324 }
9325
9326 EOF
9327 if { (eval echo configure:9328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9328 then
9329   ol_cv_pthread_lpthread_lmach_lexc=yes
9330 else
9331   echo "configure: failed program was:" >&5
9332   cat conftest.$ac_ext >&5
9333   rm -fr conftest*
9334   ol_cv_pthread_lpthread_lmach_lexc=no
9335 fi
9336 rm -fr conftest*
9337 fi
9338
9339
9340                 # restore the LIBS
9341                 LIBS="$ol_LIBS"
9342         
9343 fi
9344
9345 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9346
9347         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9348                 ol_link_pthreads="-lpthread -lmach -lexc"
9349                 ol_link_threads=posix
9350         fi
9351 fi
9352
9353
9354                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9355 if test "$ol_link_threads" = no ; then
9356         # try -lpthread -Wl,-woff,85
9357         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9358 echo "configure:9359: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9359 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9360   echo $ac_n "(cached) $ac_c" 1>&6
9361 else
9362   
9363                 # save the flags
9364                 ol_LIBS="$LIBS"
9365                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9366
9367                 if test "$cross_compiling" = yes; then
9368   cat > conftest.$ac_ext <<EOF
9369 #line 9370 "configure"
9370 #include "confdefs.h"
9371 /* pthread test headers */
9372 #include <pthread.h>
9373 #ifndef NULL
9374 #define NULL (void*)0
9375 #endif
9376
9377 static void *task(p)
9378         void *p;
9379 {
9380         return (void *) (p == NULL);
9381 }
9382
9383 int main() {
9384
9385         /* pthread test function */
9386         pthread_t t;
9387         int status;
9388         int detach = 1;
9389
9390 #ifdef HAVE_PTHREADS_FINAL
9391         /* Final pthreads */
9392         pthread_attr_t attr;
9393
9394         status = pthread_attr_init(&attr);
9395         if( status ) return status;
9396
9397 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9398         if( !detach ) {
9399 #if defined( PTHREAD_CREATE_JOINABLE )
9400                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9401 #else
9402                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9403 #endif
9404
9405 #ifdef PTHREAD_CREATE_DETACHED
9406         } else {
9407                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9408 #endif
9409         }
9410         if( status ) return status;
9411 #endif
9412
9413         status = pthread_create( &t, &attr, task, NULL );
9414         if( status ) return status;
9415
9416 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9417         if( detach ) {
9418                 /* give thread a chance to complete */
9419                 /* it should remain joinable and hence detachable */
9420                 sleep( 1 );
9421
9422                 status = pthread_detach( t );
9423                 if( status ) return status;
9424         }
9425 #endif
9426
9427 #else
9428         /* Draft 4 pthreads */
9429         status = pthread_create( &t, pthread_attr_default, task, NULL );
9430         if( status ) return status;
9431
9432         if( detach ) {
9433                 /* give thread a chance to complete */
9434                 /* it should remain joinable and hence detachable */
9435                 sleep( 1 );
9436
9437                 status = pthread_detach( &t );
9438                 if( status ) return status;
9439         }
9440 #endif
9441
9442 #ifdef HAVE_LINUX_THREADS
9443         pthread_kill_other_threads_np();
9444 #endif
9445
9446         return 0;
9447
9448 ; return 0; }
9449 EOF
9450 if { (eval echo configure:9451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9451   rm -rf conftest*
9452   ol_cv_pthread_lib_lpthread_woff=yes
9453 else
9454   echo "configure: failed program was:" >&5
9455   cat conftest.$ac_ext >&5
9456   rm -rf conftest*
9457   ol_cv_pthread_lib_lpthread_woff=no
9458 fi
9459 rm -f conftest*
9460 else
9461   cat > conftest.$ac_ext <<EOF
9462 #line 9463 "configure"
9463 #include "confdefs.h"
9464 /* pthread test headers */
9465 #include <pthread.h>
9466 #ifndef NULL
9467 #define NULL (void*)0
9468 #endif
9469
9470 static void *task(p)
9471         void *p;
9472 {
9473         return (void *) (p == NULL);
9474 }
9475
9476
9477 int main(argc, argv)
9478         int argc;
9479         char **argv;
9480 {
9481
9482         /* pthread test function */
9483         pthread_t t;
9484         int status;
9485         int detach = 1;
9486
9487 #ifdef HAVE_PTHREADS_FINAL
9488         /* Final pthreads */
9489         pthread_attr_t attr;
9490
9491         status = pthread_attr_init(&attr);
9492         if( status ) return status;
9493
9494 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9495         if( !detach ) {
9496 #if defined( PTHREAD_CREATE_JOINABLE )
9497                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9498 #else
9499                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9500 #endif
9501
9502 #ifdef PTHREAD_CREATE_DETACHED
9503         } else {
9504                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9505 #endif
9506         }
9507         if( status ) return status;
9508 #endif
9509
9510         status = pthread_create( &t, &attr, task, NULL );
9511         if( status ) return status;
9512
9513 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9514         if( detach ) {
9515                 /* give thread a chance to complete */
9516                 /* it should remain joinable and hence detachable */
9517                 sleep( 1 );
9518
9519                 status = pthread_detach( t );
9520                 if( status ) return status;
9521         }
9522 #endif
9523
9524 #else
9525         /* Draft 4 pthreads */
9526         status = pthread_create( &t, pthread_attr_default, task, NULL );
9527         if( status ) return status;
9528
9529         if( detach ) {
9530                 /* give thread a chance to complete */
9531                 /* it should remain joinable and hence detachable */
9532                 sleep( 1 );
9533
9534                 status = pthread_detach( &t );
9535                 if( status ) return status;
9536         }
9537 #endif
9538
9539 #ifdef HAVE_LINUX_THREADS
9540         pthread_kill_other_threads_np();
9541 #endif
9542
9543         return 0;
9544
9545 }
9546
9547 EOF
9548 if { (eval echo configure:9549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9549 then
9550   ol_cv_pthread_lib_lpthread_woff=yes
9551 else
9552   echo "configure: failed program was:" >&5
9553   cat conftest.$ac_ext >&5
9554   rm -fr conftest*
9555   ol_cv_pthread_lib_lpthread_woff=no
9556 fi
9557 rm -fr conftest*
9558 fi
9559
9560
9561                 # restore the LIBS
9562                 LIBS="$ol_LIBS"
9563         
9564 fi
9565
9566 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9567
9568         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9569                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9570                 ol_link_threads=posix
9571         fi
9572 fi
9573
9574
9575                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9576 if test "$ol_link_threads" = no ; then
9577         # try -lpthread
9578         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9579 echo "configure:9580: checking for pthread link with -lpthread" >&5
9580 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9581   echo $ac_n "(cached) $ac_c" 1>&6
9582 else
9583   
9584                 # save the flags
9585                 ol_LIBS="$LIBS"
9586                 LIBS="-lpthread $LIBS"
9587
9588                 if test "$cross_compiling" = yes; then
9589   cat > conftest.$ac_ext <<EOF
9590 #line 9591 "configure"
9591 #include "confdefs.h"
9592 /* pthread test headers */
9593 #include <pthread.h>
9594 #ifndef NULL
9595 #define NULL (void*)0
9596 #endif
9597
9598 static void *task(p)
9599         void *p;
9600 {
9601         return (void *) (p == NULL);
9602 }
9603
9604 int main() {
9605
9606         /* pthread test function */
9607         pthread_t t;
9608         int status;
9609         int detach = 1;
9610
9611 #ifdef HAVE_PTHREADS_FINAL
9612         /* Final pthreads */
9613         pthread_attr_t attr;
9614
9615         status = pthread_attr_init(&attr);
9616         if( status ) return status;
9617
9618 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9619         if( !detach ) {
9620 #if defined( PTHREAD_CREATE_JOINABLE )
9621                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9622 #else
9623                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9624 #endif
9625
9626 #ifdef PTHREAD_CREATE_DETACHED
9627         } else {
9628                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9629 #endif
9630         }
9631         if( status ) return status;
9632 #endif
9633
9634         status = pthread_create( &t, &attr, task, NULL );
9635         if( status ) return status;
9636
9637 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9638         if( detach ) {
9639                 /* give thread a chance to complete */
9640                 /* it should remain joinable and hence detachable */
9641                 sleep( 1 );
9642
9643                 status = pthread_detach( t );
9644                 if( status ) return status;
9645         }
9646 #endif
9647
9648 #else
9649         /* Draft 4 pthreads */
9650         status = pthread_create( &t, pthread_attr_default, task, NULL );
9651         if( status ) return status;
9652
9653         if( detach ) {
9654                 /* give thread a chance to complete */
9655                 /* it should remain joinable and hence detachable */
9656                 sleep( 1 );
9657
9658                 status = pthread_detach( &t );
9659                 if( status ) return status;
9660         }
9661 #endif
9662
9663 #ifdef HAVE_LINUX_THREADS
9664         pthread_kill_other_threads_np();
9665 #endif
9666
9667         return 0;
9668
9669 ; return 0; }
9670 EOF
9671 if { (eval echo configure:9672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9672   rm -rf conftest*
9673   ol_cv_pthread_lpthread=yes
9674 else
9675   echo "configure: failed program was:" >&5
9676   cat conftest.$ac_ext >&5
9677   rm -rf conftest*
9678   ol_cv_pthread_lpthread=no
9679 fi
9680 rm -f conftest*
9681 else
9682   cat > conftest.$ac_ext <<EOF
9683 #line 9684 "configure"
9684 #include "confdefs.h"
9685 /* pthread test headers */
9686 #include <pthread.h>
9687 #ifndef NULL
9688 #define NULL (void*)0
9689 #endif
9690
9691 static void *task(p)
9692         void *p;
9693 {
9694         return (void *) (p == NULL);
9695 }
9696
9697
9698 int main(argc, argv)
9699         int argc;
9700         char **argv;
9701 {
9702
9703         /* pthread test function */
9704         pthread_t t;
9705         int status;
9706         int detach = 1;
9707
9708 #ifdef HAVE_PTHREADS_FINAL
9709         /* Final pthreads */
9710         pthread_attr_t attr;
9711
9712         status = pthread_attr_init(&attr);
9713         if( status ) return status;
9714
9715 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9716         if( !detach ) {
9717 #if defined( PTHREAD_CREATE_JOINABLE )
9718                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9719 #else
9720                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9721 #endif
9722
9723 #ifdef PTHREAD_CREATE_DETACHED
9724         } else {
9725                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9726 #endif
9727         }
9728         if( status ) return status;
9729 #endif
9730
9731         status = pthread_create( &t, &attr, task, NULL );
9732         if( status ) return status;
9733
9734 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9735         if( detach ) {
9736                 /* give thread a chance to complete */
9737                 /* it should remain joinable and hence detachable */
9738                 sleep( 1 );
9739
9740                 status = pthread_detach( t );
9741                 if( status ) return status;
9742         }
9743 #endif
9744
9745 #else
9746         /* Draft 4 pthreads */
9747         status = pthread_create( &t, pthread_attr_default, task, NULL );
9748         if( status ) return status;
9749
9750         if( detach ) {
9751                 /* give thread a chance to complete */
9752                 /* it should remain joinable and hence detachable */
9753                 sleep( 1 );
9754
9755                 status = pthread_detach( &t );
9756                 if( status ) return status;
9757         }
9758 #endif
9759
9760 #ifdef HAVE_LINUX_THREADS
9761         pthread_kill_other_threads_np();
9762 #endif
9763
9764         return 0;
9765
9766 }
9767
9768 EOF
9769 if { (eval echo configure:9770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9770 then
9771   ol_cv_pthread_lpthread=yes
9772 else
9773   echo "configure: failed program was:" >&5
9774   cat conftest.$ac_ext >&5
9775   rm -fr conftest*
9776   ol_cv_pthread_lpthread=no
9777 fi
9778 rm -fr conftest*
9779 fi
9780
9781
9782                 # restore the LIBS
9783                 LIBS="$ol_LIBS"
9784         
9785 fi
9786
9787 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9788
9789         if test $ol_cv_pthread_lpthread = yes ; then
9790                 ol_link_pthreads="-lpthread"
9791                 ol_link_threads=posix
9792         fi
9793 fi
9794
9795                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9796 if test "$ol_link_threads" = no ; then
9797         # try -lc_r
9798         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9799 echo "configure:9800: checking for pthread link with -lc_r" >&5
9800 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9801   echo $ac_n "(cached) $ac_c" 1>&6
9802 else
9803   
9804                 # save the flags
9805                 ol_LIBS="$LIBS"
9806                 LIBS="-lc_r $LIBS"
9807
9808                 if test "$cross_compiling" = yes; then
9809   cat > conftest.$ac_ext <<EOF
9810 #line 9811 "configure"
9811 #include "confdefs.h"
9812 /* pthread test headers */
9813 #include <pthread.h>
9814 #ifndef NULL
9815 #define NULL (void*)0
9816 #endif
9817
9818 static void *task(p)
9819         void *p;
9820 {
9821         return (void *) (p == NULL);
9822 }
9823
9824 int main() {
9825
9826         /* pthread test function */
9827         pthread_t t;
9828         int status;
9829         int detach = 1;
9830
9831 #ifdef HAVE_PTHREADS_FINAL
9832         /* Final pthreads */
9833         pthread_attr_t attr;
9834
9835         status = pthread_attr_init(&attr);
9836         if( status ) return status;
9837
9838 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9839         if( !detach ) {
9840 #if defined( PTHREAD_CREATE_JOINABLE )
9841                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9842 #else
9843                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9844 #endif
9845
9846 #ifdef PTHREAD_CREATE_DETACHED
9847         } else {
9848                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9849 #endif
9850         }
9851         if( status ) return status;
9852 #endif
9853
9854         status = pthread_create( &t, &attr, task, NULL );
9855         if( status ) return status;
9856
9857 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9858         if( detach ) {
9859                 /* give thread a chance to complete */
9860                 /* it should remain joinable and hence detachable */
9861                 sleep( 1 );
9862
9863                 status = pthread_detach( t );
9864                 if( status ) return status;
9865         }
9866 #endif
9867
9868 #else
9869         /* Draft 4 pthreads */
9870         status = pthread_create( &t, pthread_attr_default, task, NULL );
9871         if( status ) return status;
9872
9873         if( detach ) {
9874                 /* give thread a chance to complete */
9875                 /* it should remain joinable and hence detachable */
9876                 sleep( 1 );
9877
9878                 status = pthread_detach( &t );
9879                 if( status ) return status;
9880         }
9881 #endif
9882
9883 #ifdef HAVE_LINUX_THREADS
9884         pthread_kill_other_threads_np();
9885 #endif
9886
9887         return 0;
9888
9889 ; return 0; }
9890 EOF
9891 if { (eval echo configure:9892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9892   rm -rf conftest*
9893   ol_cv_pthread_lc_r=yes
9894 else
9895   echo "configure: failed program was:" >&5
9896   cat conftest.$ac_ext >&5
9897   rm -rf conftest*
9898   ol_cv_pthread_lc_r=no
9899 fi
9900 rm -f conftest*
9901 else
9902   cat > conftest.$ac_ext <<EOF
9903 #line 9904 "configure"
9904 #include "confdefs.h"
9905 /* pthread test headers */
9906 #include <pthread.h>
9907 #ifndef NULL
9908 #define NULL (void*)0
9909 #endif
9910
9911 static void *task(p)
9912         void *p;
9913 {
9914         return (void *) (p == NULL);
9915 }
9916
9917
9918 int main(argc, argv)
9919         int argc;
9920         char **argv;
9921 {
9922
9923         /* pthread test function */
9924         pthread_t t;
9925         int status;
9926         int detach = 1;
9927
9928 #ifdef HAVE_PTHREADS_FINAL
9929         /* Final pthreads */
9930         pthread_attr_t attr;
9931
9932         status = pthread_attr_init(&attr);
9933         if( status ) return status;
9934
9935 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9936         if( !detach ) {
9937 #if defined( PTHREAD_CREATE_JOINABLE )
9938                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9939 #else
9940                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9941 #endif
9942
9943 #ifdef PTHREAD_CREATE_DETACHED
9944         } else {
9945                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9946 #endif
9947         }
9948         if( status ) return status;
9949 #endif
9950
9951         status = pthread_create( &t, &attr, task, NULL );
9952         if( status ) return status;
9953
9954 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9955         if( detach ) {
9956                 /* give thread a chance to complete */
9957                 /* it should remain joinable and hence detachable */
9958                 sleep( 1 );
9959
9960                 status = pthread_detach( t );
9961                 if( status ) return status;
9962         }
9963 #endif
9964
9965 #else
9966         /* Draft 4 pthreads */
9967         status = pthread_create( &t, pthread_attr_default, task, NULL );
9968         if( status ) return status;
9969
9970         if( detach ) {
9971                 /* give thread a chance to complete */
9972                 /* it should remain joinable and hence detachable */
9973                 sleep( 1 );
9974
9975                 status = pthread_detach( &t );
9976                 if( status ) return status;
9977         }
9978 #endif
9979
9980 #ifdef HAVE_LINUX_THREADS
9981         pthread_kill_other_threads_np();
9982 #endif
9983
9984         return 0;
9985
9986 }
9987
9988 EOF
9989 if { (eval echo configure:9990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9990 then
9991   ol_cv_pthread_lc_r=yes
9992 else
9993   echo "configure: failed program was:" >&5
9994   cat conftest.$ac_ext >&5
9995   rm -fr conftest*
9996   ol_cv_pthread_lc_r=no
9997 fi
9998 rm -fr conftest*
9999 fi
10000
10001
10002                 # restore the LIBS
10003                 LIBS="$ol_LIBS"
10004         
10005 fi
10006
10007 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
10008
10009         if test $ol_cv_pthread_lc_r = yes ; then
10010                 ol_link_pthreads="-lc_r"
10011                 ol_link_threads=posix
10012         fi
10013 fi
10014
10015
10016                 # Pthread try link: -threads (ol_cv_pthread_threads)
10017 if test "$ol_link_threads" = no ; then
10018         # try -threads
10019         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
10020 echo "configure:10021: checking for pthread link with -threads" >&5
10021 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
10022   echo $ac_n "(cached) $ac_c" 1>&6
10023 else
10024   
10025                 # save the flags
10026                 ol_LIBS="$LIBS"
10027                 LIBS="-threads $LIBS"
10028
10029                 if test "$cross_compiling" = yes; then
10030   cat > conftest.$ac_ext <<EOF
10031 #line 10032 "configure"
10032 #include "confdefs.h"
10033 /* pthread test headers */
10034 #include <pthread.h>
10035 #ifndef NULL
10036 #define NULL (void*)0
10037 #endif
10038
10039 static void *task(p)
10040         void *p;
10041 {
10042         return (void *) (p == NULL);
10043 }
10044
10045 int main() {
10046
10047         /* pthread test function */
10048         pthread_t t;
10049         int status;
10050         int detach = 1;
10051
10052 #ifdef HAVE_PTHREADS_FINAL
10053         /* Final pthreads */
10054         pthread_attr_t attr;
10055
10056         status = pthread_attr_init(&attr);
10057         if( status ) return status;
10058
10059 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10060         if( !detach ) {
10061 #if defined( PTHREAD_CREATE_JOINABLE )
10062                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10063 #else
10064                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10065 #endif
10066
10067 #ifdef PTHREAD_CREATE_DETACHED
10068         } else {
10069                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10070 #endif
10071         }
10072         if( status ) return status;
10073 #endif
10074
10075         status = pthread_create( &t, &attr, task, NULL );
10076         if( status ) return status;
10077
10078 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10079         if( detach ) {
10080                 /* give thread a chance to complete */
10081                 /* it should remain joinable and hence detachable */
10082                 sleep( 1 );
10083
10084                 status = pthread_detach( t );
10085                 if( status ) return status;
10086         }
10087 #endif
10088
10089 #else
10090         /* Draft 4 pthreads */
10091         status = pthread_create( &t, pthread_attr_default, task, NULL );
10092         if( status ) return status;
10093
10094         if( detach ) {
10095                 /* give thread a chance to complete */
10096                 /* it should remain joinable and hence detachable */
10097                 sleep( 1 );
10098
10099                 status = pthread_detach( &t );
10100                 if( status ) return status;
10101         }
10102 #endif
10103
10104 #ifdef HAVE_LINUX_THREADS
10105         pthread_kill_other_threads_np();
10106 #endif
10107
10108         return 0;
10109
10110 ; return 0; }
10111 EOF
10112 if { (eval echo configure:10113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10113   rm -rf conftest*
10114   ol_cv_pthread_threads=yes
10115 else
10116   echo "configure: failed program was:" >&5
10117   cat conftest.$ac_ext >&5
10118   rm -rf conftest*
10119   ol_cv_pthread_threads=no
10120 fi
10121 rm -f conftest*
10122 else
10123   cat > conftest.$ac_ext <<EOF
10124 #line 10125 "configure"
10125 #include "confdefs.h"
10126 /* pthread test headers */
10127 #include <pthread.h>
10128 #ifndef NULL
10129 #define NULL (void*)0
10130 #endif
10131
10132 static void *task(p)
10133         void *p;
10134 {
10135         return (void *) (p == NULL);
10136 }
10137
10138
10139 int main(argc, argv)
10140         int argc;
10141         char **argv;
10142 {
10143
10144         /* pthread test function */
10145         pthread_t t;
10146         int status;
10147         int detach = 1;
10148
10149 #ifdef HAVE_PTHREADS_FINAL
10150         /* Final pthreads */
10151         pthread_attr_t attr;
10152
10153         status = pthread_attr_init(&attr);
10154         if( status ) return status;
10155
10156 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10157         if( !detach ) {
10158 #if defined( PTHREAD_CREATE_JOINABLE )
10159                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10160 #else
10161                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10162 #endif
10163
10164 #ifdef PTHREAD_CREATE_DETACHED
10165         } else {
10166                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10167 #endif
10168         }
10169         if( status ) return status;
10170 #endif
10171
10172         status = pthread_create( &t, &attr, task, NULL );
10173         if( status ) return status;
10174
10175 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10176         if( detach ) {
10177                 /* give thread a chance to complete */
10178                 /* it should remain joinable and hence detachable */
10179                 sleep( 1 );
10180
10181                 status = pthread_detach( t );
10182                 if( status ) return status;
10183         }
10184 #endif
10185
10186 #else
10187         /* Draft 4 pthreads */
10188         status = pthread_create( &t, pthread_attr_default, task, NULL );
10189         if( status ) return status;
10190
10191         if( detach ) {
10192                 /* give thread a chance to complete */
10193                 /* it should remain joinable and hence detachable */
10194                 sleep( 1 );
10195
10196                 status = pthread_detach( &t );
10197                 if( status ) return status;
10198         }
10199 #endif
10200
10201 #ifdef HAVE_LINUX_THREADS
10202         pthread_kill_other_threads_np();
10203 #endif
10204
10205         return 0;
10206
10207 }
10208
10209 EOF
10210 if { (eval echo configure:10211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10211 then
10212   ol_cv_pthread_threads=yes
10213 else
10214   echo "configure: failed program was:" >&5
10215   cat conftest.$ac_ext >&5
10216   rm -fr conftest*
10217   ol_cv_pthread_threads=no
10218 fi
10219 rm -fr conftest*
10220 fi
10221
10222
10223                 # restore the LIBS
10224                 LIBS="$ol_LIBS"
10225         
10226 fi
10227
10228 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10229
10230         if test $ol_cv_pthread_threads = yes ; then
10231                 ol_link_pthreads="-threads"
10232                 ol_link_threads=posix
10233         fi
10234 fi
10235
10236
10237                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10238 if test "$ol_link_threads" = no ; then
10239         # try -lpthreads -lmach -lexc -lc_r
10240         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10241 echo "configure:10242: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10242 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10243   echo $ac_n "(cached) $ac_c" 1>&6
10244 else
10245   
10246                 # save the flags
10247                 ol_LIBS="$LIBS"
10248                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10249
10250                 if test "$cross_compiling" = yes; then
10251   cat > conftest.$ac_ext <<EOF
10252 #line 10253 "configure"
10253 #include "confdefs.h"
10254 /* pthread test headers */
10255 #include <pthread.h>
10256 #ifndef NULL
10257 #define NULL (void*)0
10258 #endif
10259
10260 static void *task(p)
10261         void *p;
10262 {
10263         return (void *) (p == NULL);
10264 }
10265
10266 int main() {
10267
10268         /* pthread test function */
10269         pthread_t t;
10270         int status;
10271         int detach = 1;
10272
10273 #ifdef HAVE_PTHREADS_FINAL
10274         /* Final pthreads */
10275         pthread_attr_t attr;
10276
10277         status = pthread_attr_init(&attr);
10278         if( status ) return status;
10279
10280 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10281         if( !detach ) {
10282 #if defined( PTHREAD_CREATE_JOINABLE )
10283                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10284 #else
10285                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10286 #endif
10287
10288 #ifdef PTHREAD_CREATE_DETACHED
10289         } else {
10290                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10291 #endif
10292         }
10293         if( status ) return status;
10294 #endif
10295
10296         status = pthread_create( &t, &attr, task, NULL );
10297         if( status ) return status;
10298
10299 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10300         if( detach ) {
10301                 /* give thread a chance to complete */
10302                 /* it should remain joinable and hence detachable */
10303                 sleep( 1 );
10304
10305                 status = pthread_detach( t );
10306                 if( status ) return status;
10307         }
10308 #endif
10309
10310 #else
10311         /* Draft 4 pthreads */
10312         status = pthread_create( &t, pthread_attr_default, task, NULL );
10313         if( status ) return status;
10314
10315         if( detach ) {
10316                 /* give thread a chance to complete */
10317                 /* it should remain joinable and hence detachable */
10318                 sleep( 1 );
10319
10320                 status = pthread_detach( &t );
10321                 if( status ) return status;
10322         }
10323 #endif
10324
10325 #ifdef HAVE_LINUX_THREADS
10326         pthread_kill_other_threads_np();
10327 #endif
10328
10329         return 0;
10330
10331 ; return 0; }
10332 EOF
10333 if { (eval echo configure:10334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10334   rm -rf conftest*
10335   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10336 else
10337   echo "configure: failed program was:" >&5
10338   cat conftest.$ac_ext >&5
10339   rm -rf conftest*
10340   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10341 fi
10342 rm -f conftest*
10343 else
10344   cat > conftest.$ac_ext <<EOF
10345 #line 10346 "configure"
10346 #include "confdefs.h"
10347 /* pthread test headers */
10348 #include <pthread.h>
10349 #ifndef NULL
10350 #define NULL (void*)0
10351 #endif
10352
10353 static void *task(p)
10354         void *p;
10355 {
10356         return (void *) (p == NULL);
10357 }
10358
10359
10360 int main(argc, argv)
10361         int argc;
10362         char **argv;
10363 {
10364
10365         /* pthread test function */
10366         pthread_t t;
10367         int status;
10368         int detach = 1;
10369
10370 #ifdef HAVE_PTHREADS_FINAL
10371         /* Final pthreads */
10372         pthread_attr_t attr;
10373
10374         status = pthread_attr_init(&attr);
10375         if( status ) return status;
10376
10377 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10378         if( !detach ) {
10379 #if defined( PTHREAD_CREATE_JOINABLE )
10380                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10381 #else
10382                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10383 #endif
10384
10385 #ifdef PTHREAD_CREATE_DETACHED
10386         } else {
10387                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10388 #endif
10389         }
10390         if( status ) return status;
10391 #endif
10392
10393         status = pthread_create( &t, &attr, task, NULL );
10394         if( status ) return status;
10395
10396 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10397         if( detach ) {
10398                 /* give thread a chance to complete */
10399                 /* it should remain joinable and hence detachable */
10400                 sleep( 1 );
10401
10402                 status = pthread_detach( t );
10403                 if( status ) return status;
10404         }
10405 #endif
10406
10407 #else
10408         /* Draft 4 pthreads */
10409         status = pthread_create( &t, pthread_attr_default, task, NULL );
10410         if( status ) return status;
10411
10412         if( detach ) {
10413                 /* give thread a chance to complete */
10414                 /* it should remain joinable and hence detachable */
10415                 sleep( 1 );
10416
10417                 status = pthread_detach( &t );
10418                 if( status ) return status;
10419         }
10420 #endif
10421
10422 #ifdef HAVE_LINUX_THREADS
10423         pthread_kill_other_threads_np();
10424 #endif
10425
10426         return 0;
10427
10428 }
10429
10430 EOF
10431 if { (eval echo configure:10432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10432 then
10433   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10434 else
10435   echo "configure: failed program was:" >&5
10436   cat conftest.$ac_ext >&5
10437   rm -fr conftest*
10438   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10439 fi
10440 rm -fr conftest*
10441 fi
10442
10443
10444                 # restore the LIBS
10445                 LIBS="$ol_LIBS"
10446         
10447 fi
10448
10449 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10450
10451         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10452                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10453                 ol_link_threads=posix
10454         fi
10455 fi
10456
10457                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10458 if test "$ol_link_threads" = no ; then
10459         # try -lpthreads -lmach -lexc
10460         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10461 echo "configure:10462: checking for pthread link with -lpthreads -lmach -lexc" >&5
10462 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10463   echo $ac_n "(cached) $ac_c" 1>&6
10464 else
10465   
10466                 # save the flags
10467                 ol_LIBS="$LIBS"
10468                 LIBS="-lpthreads -lmach -lexc $LIBS"
10469
10470                 if test "$cross_compiling" = yes; then
10471   cat > conftest.$ac_ext <<EOF
10472 #line 10473 "configure"
10473 #include "confdefs.h"
10474 /* pthread test headers */
10475 #include <pthread.h>
10476 #ifndef NULL
10477 #define NULL (void*)0
10478 #endif
10479
10480 static void *task(p)
10481         void *p;
10482 {
10483         return (void *) (p == NULL);
10484 }
10485
10486 int main() {
10487
10488         /* pthread test function */
10489         pthread_t t;
10490         int status;
10491         int detach = 1;
10492
10493 #ifdef HAVE_PTHREADS_FINAL
10494         /* Final pthreads */
10495         pthread_attr_t attr;
10496
10497         status = pthread_attr_init(&attr);
10498         if( status ) return status;
10499
10500 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10501         if( !detach ) {
10502 #if defined( PTHREAD_CREATE_JOINABLE )
10503                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10504 #else
10505                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10506 #endif
10507
10508 #ifdef PTHREAD_CREATE_DETACHED
10509         } else {
10510                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10511 #endif
10512         }
10513         if( status ) return status;
10514 #endif
10515
10516         status = pthread_create( &t, &attr, task, NULL );
10517         if( status ) return status;
10518
10519 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10520         if( detach ) {
10521                 /* give thread a chance to complete */
10522                 /* it should remain joinable and hence detachable */
10523                 sleep( 1 );
10524
10525                 status = pthread_detach( t );
10526                 if( status ) return status;
10527         }
10528 #endif
10529
10530 #else
10531         /* Draft 4 pthreads */
10532         status = pthread_create( &t, pthread_attr_default, task, NULL );
10533         if( status ) return status;
10534
10535         if( detach ) {
10536                 /* give thread a chance to complete */
10537                 /* it should remain joinable and hence detachable */
10538                 sleep( 1 );
10539
10540                 status = pthread_detach( &t );
10541                 if( status ) return status;
10542         }
10543 #endif
10544
10545 #ifdef HAVE_LINUX_THREADS
10546         pthread_kill_other_threads_np();
10547 #endif
10548
10549         return 0;
10550
10551 ; return 0; }
10552 EOF
10553 if { (eval echo configure:10554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10554   rm -rf conftest*
10555   ol_cv_pthread_lpthreads_lmach_lexc=yes
10556 else
10557   echo "configure: failed program was:" >&5
10558   cat conftest.$ac_ext >&5
10559   rm -rf conftest*
10560   ol_cv_pthread_lpthreads_lmach_lexc=no
10561 fi
10562 rm -f conftest*
10563 else
10564   cat > conftest.$ac_ext <<EOF
10565 #line 10566 "configure"
10566 #include "confdefs.h"
10567 /* pthread test headers */
10568 #include <pthread.h>
10569 #ifndef NULL
10570 #define NULL (void*)0
10571 #endif
10572
10573 static void *task(p)
10574         void *p;
10575 {
10576         return (void *) (p == NULL);
10577 }
10578
10579
10580 int main(argc, argv)
10581         int argc;
10582         char **argv;
10583 {
10584
10585         /* pthread test function */
10586         pthread_t t;
10587         int status;
10588         int detach = 1;
10589
10590 #ifdef HAVE_PTHREADS_FINAL
10591         /* Final pthreads */
10592         pthread_attr_t attr;
10593
10594         status = pthread_attr_init(&attr);
10595         if( status ) return status;
10596
10597 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10598         if( !detach ) {
10599 #if defined( PTHREAD_CREATE_JOINABLE )
10600                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10601 #else
10602                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10603 #endif
10604
10605 #ifdef PTHREAD_CREATE_DETACHED
10606         } else {
10607                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10608 #endif
10609         }
10610         if( status ) return status;
10611 #endif
10612
10613         status = pthread_create( &t, &attr, task, NULL );
10614         if( status ) return status;
10615
10616 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10617         if( detach ) {
10618                 /* give thread a chance to complete */
10619                 /* it should remain joinable and hence detachable */
10620                 sleep( 1 );
10621
10622                 status = pthread_detach( t );
10623                 if( status ) return status;
10624         }
10625 #endif
10626
10627 #else
10628         /* Draft 4 pthreads */
10629         status = pthread_create( &t, pthread_attr_default, task, NULL );
10630         if( status ) return status;
10631
10632         if( detach ) {
10633                 /* give thread a chance to complete */
10634                 /* it should remain joinable and hence detachable */
10635                 sleep( 1 );
10636
10637                 status = pthread_detach( &t );
10638                 if( status ) return status;
10639         }
10640 #endif
10641
10642 #ifdef HAVE_LINUX_THREADS
10643         pthread_kill_other_threads_np();
10644 #endif
10645
10646         return 0;
10647
10648 }
10649
10650 EOF
10651 if { (eval echo configure:10652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10652 then
10653   ol_cv_pthread_lpthreads_lmach_lexc=yes
10654 else
10655   echo "configure: failed program was:" >&5
10656   cat conftest.$ac_ext >&5
10657   rm -fr conftest*
10658   ol_cv_pthread_lpthreads_lmach_lexc=no
10659 fi
10660 rm -fr conftest*
10661 fi
10662
10663
10664                 # restore the LIBS
10665                 LIBS="$ol_LIBS"
10666         
10667 fi
10668
10669 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10670
10671         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10672                 ol_link_pthreads="-lpthreads -lmach -lexc"
10673                 ol_link_threads=posix
10674         fi
10675 fi
10676
10677                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10678 if test "$ol_link_threads" = no ; then
10679         # try -lpthreads -lexc
10680         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10681 echo "configure:10682: checking for pthread link with -lpthreads -lexc" >&5
10682 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10683   echo $ac_n "(cached) $ac_c" 1>&6
10684 else
10685   
10686                 # save the flags
10687                 ol_LIBS="$LIBS"
10688                 LIBS="-lpthreads -lexc $LIBS"
10689
10690                 if test "$cross_compiling" = yes; then
10691   cat > conftest.$ac_ext <<EOF
10692 #line 10693 "configure"
10693 #include "confdefs.h"
10694 /* pthread test headers */
10695 #include <pthread.h>
10696 #ifndef NULL
10697 #define NULL (void*)0
10698 #endif
10699
10700 static void *task(p)
10701         void *p;
10702 {
10703         return (void *) (p == NULL);
10704 }
10705
10706 int main() {
10707
10708         /* pthread test function */
10709         pthread_t t;
10710         int status;
10711         int detach = 1;
10712
10713 #ifdef HAVE_PTHREADS_FINAL
10714         /* Final pthreads */
10715         pthread_attr_t attr;
10716
10717         status = pthread_attr_init(&attr);
10718         if( status ) return status;
10719
10720 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10721         if( !detach ) {
10722 #if defined( PTHREAD_CREATE_JOINABLE )
10723                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10724 #else
10725                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10726 #endif
10727
10728 #ifdef PTHREAD_CREATE_DETACHED
10729         } else {
10730                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10731 #endif
10732         }
10733         if( status ) return status;
10734 #endif
10735
10736         status = pthread_create( &t, &attr, task, NULL );
10737         if( status ) return status;
10738
10739 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10740         if( detach ) {
10741                 /* give thread a chance to complete */
10742                 /* it should remain joinable and hence detachable */
10743                 sleep( 1 );
10744
10745                 status = pthread_detach( t );
10746                 if( status ) return status;
10747         }
10748 #endif
10749
10750 #else
10751         /* Draft 4 pthreads */
10752         status = pthread_create( &t, pthread_attr_default, task, NULL );
10753         if( status ) return status;
10754
10755         if( detach ) {
10756                 /* give thread a chance to complete */
10757                 /* it should remain joinable and hence detachable */
10758                 sleep( 1 );
10759
10760                 status = pthread_detach( &t );
10761                 if( status ) return status;
10762         }
10763 #endif
10764
10765 #ifdef HAVE_LINUX_THREADS
10766         pthread_kill_other_threads_np();
10767 #endif
10768
10769         return 0;
10770
10771 ; return 0; }
10772 EOF
10773 if { (eval echo configure:10774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10774   rm -rf conftest*
10775   ol_cv_pthread_lpthreads_lexc=yes
10776 else
10777   echo "configure: failed program was:" >&5
10778   cat conftest.$ac_ext >&5
10779   rm -rf conftest*
10780   ol_cv_pthread_lpthreads_lexc=no
10781 fi
10782 rm -f conftest*
10783 else
10784   cat > conftest.$ac_ext <<EOF
10785 #line 10786 "configure"
10786 #include "confdefs.h"
10787 /* pthread test headers */
10788 #include <pthread.h>
10789 #ifndef NULL
10790 #define NULL (void*)0
10791 #endif
10792
10793 static void *task(p)
10794         void *p;
10795 {
10796         return (void *) (p == NULL);
10797 }
10798
10799
10800 int main(argc, argv)
10801         int argc;
10802         char **argv;
10803 {
10804
10805         /* pthread test function */
10806         pthread_t t;
10807         int status;
10808         int detach = 1;
10809
10810 #ifdef HAVE_PTHREADS_FINAL
10811         /* Final pthreads */
10812         pthread_attr_t attr;
10813
10814         status = pthread_attr_init(&attr);
10815         if( status ) return status;
10816
10817 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10818         if( !detach ) {
10819 #if defined( PTHREAD_CREATE_JOINABLE )
10820                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10821 #else
10822                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10823 #endif
10824
10825 #ifdef PTHREAD_CREATE_DETACHED
10826         } else {
10827                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10828 #endif
10829         }
10830         if( status ) return status;
10831 #endif
10832
10833         status = pthread_create( &t, &attr, task, NULL );
10834         if( status ) return status;
10835
10836 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10837         if( detach ) {
10838                 /* give thread a chance to complete */
10839                 /* it should remain joinable and hence detachable */
10840                 sleep( 1 );
10841
10842                 status = pthread_detach( t );
10843                 if( status ) return status;
10844         }
10845 #endif
10846
10847 #else
10848         /* Draft 4 pthreads */
10849         status = pthread_create( &t, pthread_attr_default, task, NULL );
10850         if( status ) return status;
10851
10852         if( detach ) {
10853                 /* give thread a chance to complete */
10854                 /* it should remain joinable and hence detachable */
10855                 sleep( 1 );
10856
10857                 status = pthread_detach( &t );
10858                 if( status ) return status;
10859         }
10860 #endif
10861
10862 #ifdef HAVE_LINUX_THREADS
10863         pthread_kill_other_threads_np();
10864 #endif
10865
10866         return 0;
10867
10868 }
10869
10870 EOF
10871 if { (eval echo configure:10872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10872 then
10873   ol_cv_pthread_lpthreads_lexc=yes
10874 else
10875   echo "configure: failed program was:" >&5
10876   cat conftest.$ac_ext >&5
10877   rm -fr conftest*
10878   ol_cv_pthread_lpthreads_lexc=no
10879 fi
10880 rm -fr conftest*
10881 fi
10882
10883
10884                 # restore the LIBS
10885                 LIBS="$ol_LIBS"
10886         
10887 fi
10888
10889 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10890
10891         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10892                 ol_link_pthreads="-lpthreads -lexc"
10893                 ol_link_threads=posix
10894         fi
10895 fi
10896
10897
10898                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10899 if test "$ol_link_threads" = no ; then
10900         # try -lpthreads
10901         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10902 echo "configure:10903: checking for pthread link with -lpthreads" >&5
10903 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10904   echo $ac_n "(cached) $ac_c" 1>&6
10905 else
10906   
10907                 # save the flags
10908                 ol_LIBS="$LIBS"
10909                 LIBS="-lpthreads $LIBS"
10910
10911                 if test "$cross_compiling" = yes; then
10912   cat > conftest.$ac_ext <<EOF
10913 #line 10914 "configure"
10914 #include "confdefs.h"
10915 /* pthread test headers */
10916 #include <pthread.h>
10917 #ifndef NULL
10918 #define NULL (void*)0
10919 #endif
10920
10921 static void *task(p)
10922         void *p;
10923 {
10924         return (void *) (p == NULL);
10925 }
10926
10927 int main() {
10928
10929         /* pthread test function */
10930         pthread_t t;
10931         int status;
10932         int detach = 1;
10933
10934 #ifdef HAVE_PTHREADS_FINAL
10935         /* Final pthreads */
10936         pthread_attr_t attr;
10937
10938         status = pthread_attr_init(&attr);
10939         if( status ) return status;
10940
10941 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10942         if( !detach ) {
10943 #if defined( PTHREAD_CREATE_JOINABLE )
10944                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10945 #else
10946                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10947 #endif
10948
10949 #ifdef PTHREAD_CREATE_DETACHED
10950         } else {
10951                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10952 #endif
10953         }
10954         if( status ) return status;
10955 #endif
10956
10957         status = pthread_create( &t, &attr, task, NULL );
10958         if( status ) return status;
10959
10960 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10961         if( detach ) {
10962                 /* give thread a chance to complete */
10963                 /* it should remain joinable and hence detachable */
10964                 sleep( 1 );
10965
10966                 status = pthread_detach( t );
10967                 if( status ) return status;
10968         }
10969 #endif
10970
10971 #else
10972         /* Draft 4 pthreads */
10973         status = pthread_create( &t, pthread_attr_default, task, NULL );
10974         if( status ) return status;
10975
10976         if( detach ) {
10977                 /* give thread a chance to complete */
10978                 /* it should remain joinable and hence detachable */
10979                 sleep( 1 );
10980
10981                 status = pthread_detach( &t );
10982                 if( status ) return status;
10983         }
10984 #endif
10985
10986 #ifdef HAVE_LINUX_THREADS
10987         pthread_kill_other_threads_np();
10988 #endif
10989
10990         return 0;
10991
10992 ; return 0; }
10993 EOF
10994 if { (eval echo configure:10995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10995   rm -rf conftest*
10996   ol_cv_pthread_lib_lpthreads=yes
10997 else
10998   echo "configure: failed program was:" >&5
10999   cat conftest.$ac_ext >&5
11000   rm -rf conftest*
11001   ol_cv_pthread_lib_lpthreads=no
11002 fi
11003 rm -f conftest*
11004 else
11005   cat > conftest.$ac_ext <<EOF
11006 #line 11007 "configure"
11007 #include "confdefs.h"
11008 /* pthread test headers */
11009 #include <pthread.h>
11010 #ifndef NULL
11011 #define NULL (void*)0
11012 #endif
11013
11014 static void *task(p)
11015         void *p;
11016 {
11017         return (void *) (p == NULL);
11018 }
11019
11020
11021 int main(argc, argv)
11022         int argc;
11023         char **argv;
11024 {
11025
11026         /* pthread test function */
11027         pthread_t t;
11028         int status;
11029         int detach = 1;
11030
11031 #ifdef HAVE_PTHREADS_FINAL
11032         /* Final pthreads */
11033         pthread_attr_t attr;
11034
11035         status = pthread_attr_init(&attr);
11036         if( status ) return status;
11037
11038 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11039         if( !detach ) {
11040 #if defined( PTHREAD_CREATE_JOINABLE )
11041                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11042 #else
11043                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11044 #endif
11045
11046 #ifdef PTHREAD_CREATE_DETACHED
11047         } else {
11048                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11049 #endif
11050         }
11051         if( status ) return status;
11052 #endif
11053
11054         status = pthread_create( &t, &attr, task, NULL );
11055         if( status ) return status;
11056
11057 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11058         if( detach ) {
11059                 /* give thread a chance to complete */
11060                 /* it should remain joinable and hence detachable */
11061                 sleep( 1 );
11062
11063                 status = pthread_detach( t );
11064                 if( status ) return status;
11065         }
11066 #endif
11067
11068 #else
11069         /* Draft 4 pthreads */
11070         status = pthread_create( &t, pthread_attr_default, task, NULL );
11071         if( status ) return status;
11072
11073         if( detach ) {
11074                 /* give thread a chance to complete */
11075                 /* it should remain joinable and hence detachable */
11076                 sleep( 1 );
11077
11078                 status = pthread_detach( &t );
11079                 if( status ) return status;
11080         }
11081 #endif
11082
11083 #ifdef HAVE_LINUX_THREADS
11084         pthread_kill_other_threads_np();
11085 #endif
11086
11087         return 0;
11088
11089 }
11090
11091 EOF
11092 if { (eval echo configure:11093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11093 then
11094   ol_cv_pthread_lib_lpthreads=yes
11095 else
11096   echo "configure: failed program was:" >&5
11097   cat conftest.$ac_ext >&5
11098   rm -fr conftest*
11099   ol_cv_pthread_lib_lpthreads=no
11100 fi
11101 rm -fr conftest*
11102 fi
11103
11104
11105                 # restore the LIBS
11106                 LIBS="$ol_LIBS"
11107         
11108 fi
11109
11110 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11111
11112         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11113                 ol_link_pthreads="-lpthreads"
11114                 ol_link_threads=posix
11115         fi
11116 fi
11117
11118
11119                 if test $ol_link_threads != no ; then
11120                         cat >> confdefs.h <<\EOF
11121 #define HAVE_PTHREADS 1
11122 EOF
11123
11124
11125                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11126
11127                                                 save_CPPFLAGS="$CPPFLAGS"
11128                         save_LIBS="$LIBS"
11129                         LIBS="$LTHREAD_LIBS $LIBS"
11130
11131                                                                                                 for ac_func in sched_yield pthread_yield
11132 do
11133 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11134 echo "configure:11135: checking for $ac_func" >&5
11135 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11136   echo $ac_n "(cached) $ac_c" 1>&6
11137 else
11138   cat > conftest.$ac_ext <<EOF
11139 #line 11140 "configure"
11140 #include "confdefs.h"
11141 /* System header to define __stub macros and hopefully few prototypes,
11142     which can conflict with char $ac_func(); below.  */
11143 #include <assert.h>
11144 /* Override any gcc2 internal prototype to avoid an error.  */
11145 /* We use char because int might match the return type of a gcc2
11146     builtin and then its argument prototype would still apply.  */
11147 char $ac_func();
11148 char (*f)();
11149
11150 int main() {
11151
11152 /* The GNU C library defines this for functions which it implements
11153     to always fail with ENOSYS.  Some functions are actually named
11154     something starting with __ and the normal name is an alias.  */
11155 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11156 choke me
11157 #else
11158 f = $ac_func;
11159 #endif
11160
11161 ; return 0; }
11162 EOF
11163 if { (eval echo configure:11164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11164   rm -rf conftest*
11165   eval "ac_cv_func_$ac_func=yes"
11166 else
11167   echo "configure: failed program was:" >&5
11168   cat conftest.$ac_ext >&5
11169   rm -rf conftest*
11170   eval "ac_cv_func_$ac_func=no"
11171 fi
11172 rm -f conftest*
11173 fi
11174
11175 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11176   echo "$ac_t""yes" 1>&6
11177     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11178   cat >> confdefs.h <<EOF
11179 #define $ac_tr_func 1
11180 EOF
11181  
11182 else
11183   echo "$ac_t""no" 1>&6
11184 fi
11185 done
11186
11187
11188                         if test $ac_cv_func_sched_yield = no -a \
11189                                 $ac_cv_func_pthread_yield = no ; then
11190                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11191 echo "configure:11192: checking for sched_yield in -lrt" >&5
11192 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11193 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11194   echo $ac_n "(cached) $ac_c" 1>&6
11195 else
11196   ac_save_LIBS="$LIBS"
11197 LIBS="-lrt  $LIBS"
11198 cat > conftest.$ac_ext <<EOF
11199 #line 11200 "configure"
11200 #include "confdefs.h"
11201 /* Override any gcc2 internal prototype to avoid an error.  */
11202 /* We use char because int might match the return type of a gcc2
11203     builtin and then its argument prototype would still apply.  */
11204 char sched_yield();
11205
11206 int main() {
11207 sched_yield()
11208 ; return 0; }
11209 EOF
11210 if { (eval echo configure:11211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11211   rm -rf conftest*
11212   eval "ac_cv_lib_$ac_lib_var=yes"
11213 else
11214   echo "configure: failed program was:" >&5
11215   cat conftest.$ac_ext >&5
11216   rm -rf conftest*
11217   eval "ac_cv_lib_$ac_lib_var=no"
11218 fi
11219 rm -f conftest*
11220 LIBS="$ac_save_LIBS"
11221
11222 fi
11223 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11224   echo "$ac_t""yes" 1>&6
11225   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11226                                         cat >> confdefs.h <<\EOF
11227 #define HAVE_SCHED_YIELD 1
11228 EOF
11229
11230                                         ac_cv_func_sched_yield=yes
11231 else
11232   echo "$ac_t""no" 1>&6
11233 ac_cv_func_sched_yield=no
11234 fi
11235
11236                         fi
11237                         if test $ac_cv_func_sched_yield = no -a \
11238                                 $ac_cv_func_pthread_yield = no ; then
11239                                                                                                 for ac_func in thr_yield
11240 do
11241 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11242 echo "configure:11243: checking for $ac_func" >&5
11243 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11244   echo $ac_n "(cached) $ac_c" 1>&6
11245 else
11246   cat > conftest.$ac_ext <<EOF
11247 #line 11248 "configure"
11248 #include "confdefs.h"
11249 /* System header to define __stub macros and hopefully few prototypes,
11250     which can conflict with char $ac_func(); below.  */
11251 #include <assert.h>
11252 /* Override any gcc2 internal prototype to avoid an error.  */
11253 /* We use char because int might match the return type of a gcc2
11254     builtin and then its argument prototype would still apply.  */
11255 char $ac_func();
11256 char (*f)();
11257
11258 int main() {
11259
11260 /* The GNU C library defines this for functions which it implements
11261     to always fail with ENOSYS.  Some functions are actually named
11262     something starting with __ and the normal name is an alias.  */
11263 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11264 choke me
11265 #else
11266 f = $ac_func;
11267 #endif
11268
11269 ; return 0; }
11270 EOF
11271 if { (eval echo configure:11272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11272   rm -rf conftest*
11273   eval "ac_cv_func_$ac_func=yes"
11274 else
11275   echo "configure: failed program was:" >&5
11276   cat conftest.$ac_ext >&5
11277   rm -rf conftest*
11278   eval "ac_cv_func_$ac_func=no"
11279 fi
11280 rm -f conftest*
11281 fi
11282
11283 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11284   echo "$ac_t""yes" 1>&6
11285     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11286   cat >> confdefs.h <<EOF
11287 #define $ac_tr_func 1
11288 EOF
11289  
11290 else
11291   echo "$ac_t""no" 1>&6
11292 fi
11293 done
11294
11295                         fi
11296                         if test $ac_cv_func_sched_yield = no -a \
11297                                 $ac_cv_func_pthread_yield = no -a \
11298                                 "$ac_cv_func_thr_yield" = no ; then
11299                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11300                         fi
11301
11302                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11303 do
11304 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11305 echo "configure:11306: checking for $ac_func" >&5
11306 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11307   echo $ac_n "(cached) $ac_c" 1>&6
11308 else
11309   cat > conftest.$ac_ext <<EOF
11310 #line 11311 "configure"
11311 #include "confdefs.h"
11312 /* System header to define __stub macros and hopefully few prototypes,
11313     which can conflict with char $ac_func(); below.  */
11314 #include <assert.h>
11315 /* Override any gcc2 internal prototype to avoid an error.  */
11316 /* We use char because int might match the return type of a gcc2
11317     builtin and then its argument prototype would still apply.  */
11318 char $ac_func();
11319 char (*f)();
11320
11321 int main() {
11322
11323 /* The GNU C library defines this for functions which it implements
11324     to always fail with ENOSYS.  Some functions are actually named
11325     something starting with __ and the normal name is an alias.  */
11326 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11327 choke me
11328 #else
11329 f = $ac_func;
11330 #endif
11331
11332 ; return 0; }
11333 EOF
11334 if { (eval echo configure:11335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11335   rm -rf conftest*
11336   eval "ac_cv_func_$ac_func=yes"
11337 else
11338   echo "configure: failed program was:" >&5
11339   cat conftest.$ac_ext >&5
11340   rm -rf conftest*
11341   eval "ac_cv_func_$ac_func=no"
11342 fi
11343 rm -f conftest*
11344 fi
11345
11346 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11347   echo "$ac_t""yes" 1>&6
11348     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11349   cat >> confdefs.h <<EOF
11350 #define $ac_tr_func 1
11351 EOF
11352  
11353 else
11354   echo "$ac_t""no" 1>&6
11355 fi
11356 done
11357
11358
11359                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11360 echo "configure:11361: checking for pthread_detach with <pthread.h>" >&5
11361 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11362   echo $ac_n "(cached) $ac_c" 1>&6
11363 else
11364   
11365                                                                 cat > conftest.$ac_ext <<EOF
11366 #line 11367 "configure"
11367 #include "confdefs.h"
11368
11369 #include <pthread.h>
11370 #ifndef NULL
11371 #define NULL (void*)0
11372 #endif
11373
11374 int main() {
11375 pthread_detach(NULL);
11376 ; return 0; }
11377 EOF
11378 if { (eval echo configure:11379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11379   rm -rf conftest*
11380   ol_cv_func_pthread_detach=yes
11381 else
11382   echo "configure: failed program was:" >&5
11383   cat conftest.$ac_ext >&5
11384   rm -rf conftest*
11385   ol_cv_func_pthread_detach=no
11386 fi
11387 rm -f conftest*
11388                         
11389 fi
11390
11391 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11392
11393                         if test $ol_cv_func_pthread_detach = no ; then
11394                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11395                         fi
11396
11397                         cat >> confdefs.h <<\EOF
11398 #define HAVE_PTHREAD_DETACH 1
11399 EOF
11400
11401
11402                                                 for ac_func in \
11403                                 pthread_setconcurrency \
11404                                 pthread_getconcurrency \
11405                                 thr_setconcurrency \
11406                                 thr_getconcurrency \
11407                         
11408 do
11409 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11410 echo "configure:11411: checking for $ac_func" >&5
11411 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11412   echo $ac_n "(cached) $ac_c" 1>&6
11413 else
11414   cat > conftest.$ac_ext <<EOF
11415 #line 11416 "configure"
11416 #include "confdefs.h"
11417 /* System header to define __stub macros and hopefully few prototypes,
11418     which can conflict with char $ac_func(); below.  */
11419 #include <assert.h>
11420 /* Override any gcc2 internal prototype to avoid an error.  */
11421 /* We use char because int might match the return type of a gcc2
11422     builtin and then its argument prototype would still apply.  */
11423 char $ac_func();
11424 char (*f)();
11425
11426 int main() {
11427
11428 /* The GNU C library defines this for functions which it implements
11429     to always fail with ENOSYS.  Some functions are actually named
11430     something starting with __ and the normal name is an alias.  */
11431 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11432 choke me
11433 #else
11434 f = $ac_func;
11435 #endif
11436
11437 ; return 0; }
11438 EOF
11439 if { (eval echo configure:11440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11440   rm -rf conftest*
11441   eval "ac_cv_func_$ac_func=yes"
11442 else
11443   echo "configure: failed program was:" >&5
11444   cat conftest.$ac_ext >&5
11445   rm -rf conftest*
11446   eval "ac_cv_func_$ac_func=no"
11447 fi
11448 rm -f conftest*
11449 fi
11450
11451 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11452   echo "$ac_t""yes" 1>&6
11453     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11454   cat >> confdefs.h <<EOF
11455 #define $ac_tr_func 1
11456 EOF
11457  
11458 else
11459   echo "$ac_t""no" 1>&6
11460 fi
11461 done
11462
11463
11464                         
11465         for ac_func in pthread_kill_other_threads_np
11466 do
11467 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11468 echo "configure:11469: checking for $ac_func" >&5
11469 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11470   echo $ac_n "(cached) $ac_c" 1>&6
11471 else
11472   cat > conftest.$ac_ext <<EOF
11473 #line 11474 "configure"
11474 #include "confdefs.h"
11475 /* System header to define __stub macros and hopefully few prototypes,
11476     which can conflict with char $ac_func(); below.  */
11477 #include <assert.h>
11478 /* Override any gcc2 internal prototype to avoid an error.  */
11479 /* We use char because int might match the return type of a gcc2
11480     builtin and then its argument prototype would still apply.  */
11481 char $ac_func();
11482 char (*f)();
11483
11484 int main() {
11485
11486 /* The GNU C library defines this for functions which it implements
11487     to always fail with ENOSYS.  Some functions are actually named
11488     something starting with __ and the normal name is an alias.  */
11489 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11490 choke me
11491 #else
11492 f = $ac_func;
11493 #endif
11494
11495 ; return 0; }
11496 EOF
11497 if { (eval echo configure:11498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11498   rm -rf conftest*
11499   eval "ac_cv_func_$ac_func=yes"
11500 else
11501   echo "configure: failed program was:" >&5
11502   cat conftest.$ac_ext >&5
11503   rm -rf conftest*
11504   eval "ac_cv_func_$ac_func=no"
11505 fi
11506 rm -f conftest*
11507 fi
11508
11509 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11510   echo "$ac_t""yes" 1>&6
11511     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11512   cat >> confdefs.h <<EOF
11513 #define $ac_tr_func 1
11514 EOF
11515  
11516 else
11517   echo "$ac_t""no" 1>&6
11518 fi
11519 done
11520
11521         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11522 echo "configure:11523: checking for LinuxThreads implementation" >&5
11523 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11524   echo $ac_n "(cached) $ac_c" 1>&6
11525 else
11526   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11527 fi
11528
11529 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11530
11531                         
11532         
11533         
11534         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11535 echo "configure:11536: checking for LinuxThreads consistency" >&5
11536 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11537   echo $ac_n "(cached) $ac_c" 1>&6
11538 else
11539   
11540                 if test $ol_cv_header_linux_threads = yes -a \
11541                         $ol_cv_sys_linux_threads = yes; then
11542                         ol_cv_linux_threads=yes
11543                 elif test $ol_cv_header_linux_threads = no -a \
11544                         $ol_cv_sys_linux_threads = no; then
11545                         ol_cv_linux_threads=no
11546                 else
11547                         ol_cv_linux_threads=error
11548                 fi
11549         
11550 fi
11551
11552 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11553
11554
11555                         if test $ol_cv_linux_threads = error; then
11556                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11557                         fi
11558
11559                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11560 echo "configure:11561: checking if pthread_create() works" >&5
11561 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11562   echo $ac_n "(cached) $ac_c" 1>&6
11563 else
11564   
11565                         if test "$cross_compiling" = yes; then
11566                                 ol_cv_pthread_create_works=yes
11567 else
11568   cat > conftest.$ac_ext <<EOF
11569 #line 11570 "configure"
11570 #include "confdefs.h"
11571 /* pthread test headers */
11572 #include <pthread.h>
11573 #ifndef NULL
11574 #define NULL (void*)0
11575 #endif
11576
11577 static void *task(p)
11578         void *p;
11579 {
11580         return (void *) (p == NULL);
11581 }
11582
11583
11584 int main(argc, argv)
11585         int argc;
11586         char **argv;
11587 {
11588
11589         /* pthread test function */
11590         pthread_t t;
11591         int status;
11592         int detach = 1;
11593
11594 #ifdef HAVE_PTHREADS_FINAL
11595         /* Final pthreads */
11596         pthread_attr_t attr;
11597
11598         status = pthread_attr_init(&attr);
11599         if( status ) return status;
11600
11601 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11602         if( !detach ) {
11603 #if defined( PTHREAD_CREATE_JOINABLE )
11604                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11605 #else
11606                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11607 #endif
11608
11609 #ifdef PTHREAD_CREATE_DETACHED
11610         } else {
11611                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11612 #endif
11613         }
11614         if( status ) return status;
11615 #endif
11616
11617         status = pthread_create( &t, &attr, task, NULL );
11618         if( status ) return status;
11619
11620 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11621         if( detach ) {
11622                 /* give thread a chance to complete */
11623                 /* it should remain joinable and hence detachable */
11624                 sleep( 1 );
11625
11626                 status = pthread_detach( t );
11627                 if( status ) return status;
11628         }
11629 #endif
11630
11631 #else
11632         /* Draft 4 pthreads */
11633         status = pthread_create( &t, pthread_attr_default, task, NULL );
11634         if( status ) return status;
11635
11636         if( detach ) {
11637                 /* give thread a chance to complete */
11638                 /* it should remain joinable and hence detachable */
11639                 sleep( 1 );
11640
11641                 status = pthread_detach( &t );
11642                 if( status ) return status;
11643         }
11644 #endif
11645
11646 #ifdef HAVE_LINUX_THREADS
11647         pthread_kill_other_threads_np();
11648 #endif
11649
11650         return 0;
11651
11652 }
11653
11654 EOF
11655 if { (eval echo configure:11656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11656 then
11657   ol_cv_pthread_create_works=yes
11658 else
11659   echo "configure: failed program was:" >&5
11660   cat conftest.$ac_ext >&5
11661   rm -fr conftest*
11662   ol_cv_pthread_create_works=no
11663 fi
11664 rm -fr conftest*
11665 fi
11666
11667 fi
11668
11669 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11670
11671                         if test $ol_cv_pthread_create_works = no ; then
11672                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11673                         fi
11674
11675                                                 if test $ol_with_yielding_select = auto ; then
11676                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11677 echo "configure:11678: checking if select yields when using pthreads" >&5
11678 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11679   echo $ac_n "(cached) $ac_c" 1>&6
11680 else
11681   
11682                                 if test "$cross_compiling" = yes; then
11683   ol_cv_pthread_select_yields=cross
11684 else
11685   cat > conftest.$ac_ext <<EOF
11686 #line 11687 "configure"
11687 #include "confdefs.h"
11688
11689 #include <sys/types.h>
11690 #include <sys/time.h>
11691 #include <unistd.h>
11692 #include <pthread.h>
11693 #ifndef NULL
11694 #define NULL (void*) 0
11695 #endif
11696
11697 static int fildes[2];
11698
11699 static void *task(p)
11700         void *p;
11701 {
11702         int i;
11703         struct timeval tv;
11704
11705         fd_set rfds;
11706
11707         tv.tv_sec=10;
11708         tv.tv_usec=0;
11709
11710         FD_ZERO(&rfds);
11711         FD_SET(fildes[0], &rfds);
11712
11713         /* we're not interested in any fds */
11714         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11715
11716         if(i < 0) {
11717                 perror("select");
11718                 exit(10);
11719         }
11720
11721         exit(0); /* if we exit here, the select blocked the whole process */
11722 }
11723
11724 int main(argc, argv)
11725         int argc;
11726         char **argv;
11727 {
11728         pthread_t t;
11729
11730         /* create a pipe to select */
11731         if(pipe(&fildes[0])) {
11732                 perror("select");
11733                 exit(1);
11734         }
11735
11736 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11737         (void) pthread_setconcurrency(2);
11738 #else
11739 #ifdef HAVE_THR_SETCONCURRENCY
11740         /* Set Solaris LWP concurrency to 2 */
11741         thr_setconcurrency(2);
11742 #endif
11743 #endif
11744
11745 #if HAVE_PTHREADS_D4
11746         pthread_create(&t, pthread_attr_default, task, NULL);
11747 #else
11748         pthread_create(&t, NULL, task, NULL);
11749 #endif
11750
11751 #if HAVE_SCHED_YIELD
11752         sched_yield();  /* make sure task runs first */
11753 #else
11754 #ifdef HAVE_PTHREAD_YIELD
11755         pthread_yield();        /* make sure task runs first */
11756 #endif
11757 #endif
11758
11759         exit(2);
11760 }
11761 EOF
11762 if { (eval echo configure:11763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11763 then
11764   ol_cv_pthread_select_yields=no
11765 else
11766   echo "configure: failed program was:" >&5
11767   cat conftest.$ac_ext >&5
11768   rm -fr conftest*
11769   ol_cv_pthread_select_yields=yes
11770 fi
11771 rm -fr conftest*
11772 fi
11773
11774 fi
11775
11776 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11777
11778                                 if test $ol_cv_pthread_select_yields = cross ; then
11779                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11780                                 fi
11781
11782                                 if test $ol_cv_pthread_select_yields = yes ; then
11783                                         ol_with_yielding_select=yes
11784                                 fi
11785                         fi
11786
11787                                                 CPPFLAGS="$save_CPPFLAGS"
11788                         LIBS="$save_LIBS"
11789                 else
11790                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11791                 fi
11792         fi
11793
11794         if test $ol_with_threads = posix ; then
11795                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11796         fi
11797 fi
11798
11799 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11800         -o $ol_with_threads = mach ; then
11801
11802                 for ac_hdr in mach/cthreads.h
11803 do
11804 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11805 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11806 echo "configure:11807: checking for $ac_hdr" >&5
11807 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11808   echo $ac_n "(cached) $ac_c" 1>&6
11809 else
11810   cat > conftest.$ac_ext <<EOF
11811 #line 11812 "configure"
11812 #include "confdefs.h"
11813 #include <$ac_hdr>
11814 EOF
11815 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11816 { (eval echo configure:11817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11817 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11818 if test -z "$ac_err"; then
11819   rm -rf conftest*
11820   eval "ac_cv_header_$ac_safe=yes"
11821 else
11822   echo "$ac_err" >&5
11823   echo "configure: failed program was:" >&5
11824   cat conftest.$ac_ext >&5
11825   rm -rf conftest*
11826   eval "ac_cv_header_$ac_safe=no"
11827 fi
11828 rm -f conftest*
11829 fi
11830 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11831   echo "$ac_t""yes" 1>&6
11832     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11833   cat >> confdefs.h <<EOF
11834 #define $ac_tr_hdr 1
11835 EOF
11836  
11837 else
11838   echo "$ac_t""no" 1>&6
11839 fi
11840 done
11841
11842         if test $ac_cv_header_mach_cthreads_h = yes ; then
11843                 ol_with_threads=found
11844
11845                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11846 echo "configure:11847: checking for cthread_fork" >&5
11847 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11848   echo $ac_n "(cached) $ac_c" 1>&6
11849 else
11850   cat > conftest.$ac_ext <<EOF
11851 #line 11852 "configure"
11852 #include "confdefs.h"
11853 /* System header to define __stub macros and hopefully few prototypes,
11854     which can conflict with char cthread_fork(); below.  */
11855 #include <assert.h>
11856 /* Override any gcc2 internal prototype to avoid an error.  */
11857 /* We use char because int might match the return type of a gcc2
11858     builtin and then its argument prototype would still apply.  */
11859 char cthread_fork();
11860 char (*f)();
11861
11862 int main() {
11863
11864 /* The GNU C library defines this for functions which it implements
11865     to always fail with ENOSYS.  Some functions are actually named
11866     something starting with __ and the normal name is an alias.  */
11867 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11868 choke me
11869 #else
11870 f = cthread_fork;
11871 #endif
11872
11873 ; return 0; }
11874 EOF
11875 if { (eval echo configure:11876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11876   rm -rf conftest*
11877   eval "ac_cv_func_cthread_fork=yes"
11878 else
11879   echo "configure: failed program was:" >&5
11880   cat conftest.$ac_ext >&5
11881   rm -rf conftest*
11882   eval "ac_cv_func_cthread_fork=no"
11883 fi
11884 rm -f conftest*
11885 fi
11886
11887 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11888   echo "$ac_t""yes" 1>&6
11889   ol_link_threads=yes
11890 else
11891   echo "$ac_t""no" 1>&6
11892 fi
11893
11894
11895                 if test $ol_link_threads = no ; then
11896                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11897 echo "configure:11898: checking for cthread_fork with -all_load" >&5
11898 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11899   echo $ac_n "(cached) $ac_c" 1>&6
11900 else
11901   
11902                                                                 save_LIBS="$LIBS"
11903                                 LIBS="-all_load $LIBS"
11904                                 cat > conftest.$ac_ext <<EOF
11905 #line 11906 "configure"
11906 #include "confdefs.h"
11907 #include <mach/cthreads.h>
11908 int main() {
11909
11910                                         cthread_fork((void *)0, (void *)0);
11911                                         
11912 ; return 0; }
11913 EOF
11914 if { (eval echo configure:11915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11915   rm -rf conftest*
11916   ol_cv_cthread_all_load=yes
11917 else
11918   echo "configure: failed program was:" >&5
11919   cat conftest.$ac_ext >&5
11920   rm -rf conftest*
11921   ol_cv_cthread_all_load=no
11922 fi
11923 rm -f conftest*
11924                                                                 LIBS="$save_LIBS"
11925                         
11926 fi
11927
11928 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11929
11930                         if test $ol_cv_cthread_all_load = yes ; then
11931                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11932                                 ol_link_threads=mach
11933                         fi
11934                 fi
11935
11936                 if test $ol_link_threads != no ; then
11937                         : check for cthread specific functionality here
11938                         cat >> confdefs.h <<\EOF
11939 #define HAVE_MACH_CTHREADS 1
11940 EOF
11941
11942                 else
11943                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11944                 fi
11945         fi
11946
11947         if test $ol_with_threads = mach ; then
11948                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11949         fi
11950 fi
11951
11952 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11953         -o $ol_with_threads = pth ; then
11954
11955         for ac_hdr in pth.h
11956 do
11957 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11958 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11959 echo "configure:11960: checking for $ac_hdr" >&5
11960 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11961   echo $ac_n "(cached) $ac_c" 1>&6
11962 else
11963   cat > conftest.$ac_ext <<EOF
11964 #line 11965 "configure"
11965 #include "confdefs.h"
11966 #include <$ac_hdr>
11967 EOF
11968 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11969 { (eval echo configure:11970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11970 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11971 if test -z "$ac_err"; then
11972   rm -rf conftest*
11973   eval "ac_cv_header_$ac_safe=yes"
11974 else
11975   echo "$ac_err" >&5
11976   echo "configure: failed program was:" >&5
11977   cat conftest.$ac_ext >&5
11978   rm -rf conftest*
11979   eval "ac_cv_header_$ac_safe=no"
11980 fi
11981 rm -f conftest*
11982 fi
11983 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11984   echo "$ac_t""yes" 1>&6
11985     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11986   cat >> confdefs.h <<EOF
11987 #define $ac_tr_hdr 1
11988 EOF
11989  
11990 else
11991   echo "$ac_t""no" 1>&6
11992 fi
11993 done
11994
11995
11996         if test $ac_cv_header_pth_h = yes ; then
11997                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11998 echo "configure:11999: checking for pth_version in -lpth" >&5
11999 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
12000 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12001   echo $ac_n "(cached) $ac_c" 1>&6
12002 else
12003   ac_save_LIBS="$LIBS"
12004 LIBS="-lpth  $LIBS"
12005 cat > conftest.$ac_ext <<EOF
12006 #line 12007 "configure"
12007 #include "confdefs.h"
12008 /* Override any gcc2 internal prototype to avoid an error.  */
12009 /* We use char because int might match the return type of a gcc2
12010     builtin and then its argument prototype would still apply.  */
12011 char pth_version();
12012
12013 int main() {
12014 pth_version()
12015 ; return 0; }
12016 EOF
12017 if { (eval echo configure:12018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12018   rm -rf conftest*
12019   eval "ac_cv_lib_$ac_lib_var=yes"
12020 else
12021   echo "configure: failed program was:" >&5
12022   cat conftest.$ac_ext >&5
12023   rm -rf conftest*
12024   eval "ac_cv_lib_$ac_lib_var=no"
12025 fi
12026 rm -f conftest*
12027 LIBS="$ac_save_LIBS"
12028
12029 fi
12030 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12031   echo "$ac_t""yes" 1>&6
12032   have_pth=yes
12033 else
12034   echo "$ac_t""no" 1>&6
12035 have_pth=no
12036 fi
12037
12038
12039                 if test $have_pth = yes ; then
12040                         cat >> confdefs.h <<\EOF
12041 #define HAVE_GNU_PTH 1
12042 EOF
12043
12044                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
12045                         ol_link_threads=pth
12046
12047                         if test $ol_with_yielding_select = auto ; then
12048                                 ol_with_yielding_select=yes
12049                         fi
12050                 fi
12051         fi
12052 fi
12053
12054 if test $ol_with_threads = auto -o $ol_with_threads = yes \
12055         -o $ol_with_threads = lwp ; then
12056
12057                 for ac_hdr in thread.h synch.h
12058 do
12059 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12060 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12061 echo "configure:12062: checking for $ac_hdr" >&5
12062 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12063   echo $ac_n "(cached) $ac_c" 1>&6
12064 else
12065   cat > conftest.$ac_ext <<EOF
12066 #line 12067 "configure"
12067 #include "confdefs.h"
12068 #include <$ac_hdr>
12069 EOF
12070 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12071 { (eval echo configure:12072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12072 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12073 if test -z "$ac_err"; then
12074   rm -rf conftest*
12075   eval "ac_cv_header_$ac_safe=yes"
12076 else
12077   echo "$ac_err" >&5
12078   echo "configure: failed program was:" >&5
12079   cat conftest.$ac_ext >&5
12080   rm -rf conftest*
12081   eval "ac_cv_header_$ac_safe=no"
12082 fi
12083 rm -f conftest*
12084 fi
12085 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12086   echo "$ac_t""yes" 1>&6
12087     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12088   cat >> confdefs.h <<EOF
12089 #define $ac_tr_hdr 1
12090 EOF
12091  
12092 else
12093   echo "$ac_t""no" 1>&6
12094 fi
12095 done
12096
12097         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12098                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12099 echo "configure:12100: checking for thr_create in -lthread" >&5
12100 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12101 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12102   echo $ac_n "(cached) $ac_c" 1>&6
12103 else
12104   ac_save_LIBS="$LIBS"
12105 LIBS="-lthread  $LIBS"
12106 cat > conftest.$ac_ext <<EOF
12107 #line 12108 "configure"
12108 #include "confdefs.h"
12109 /* Override any gcc2 internal prototype to avoid an error.  */
12110 /* We use char because int might match the return type of a gcc2
12111     builtin and then its argument prototype would still apply.  */
12112 char thr_create();
12113
12114 int main() {
12115 thr_create()
12116 ; return 0; }
12117 EOF
12118 if { (eval echo configure:12119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12119   rm -rf conftest*
12120   eval "ac_cv_lib_$ac_lib_var=yes"
12121 else
12122   echo "configure: failed program was:" >&5
12123   cat conftest.$ac_ext >&5
12124   rm -rf conftest*
12125   eval "ac_cv_lib_$ac_lib_var=no"
12126 fi
12127 rm -f conftest*
12128 LIBS="$ac_save_LIBS"
12129
12130 fi
12131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12132   echo "$ac_t""yes" 1>&6
12133   have_thr=yes
12134 else
12135   echo "$ac_t""no" 1>&6
12136 have_thr=no
12137 fi
12138
12139
12140                 if test $have_thr = yes ; then
12141                         cat >> confdefs.h <<\EOF
12142 #define HAVE_THR 1
12143 EOF
12144
12145                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12146                         ol_link_threads=thr
12147
12148                         if test $ol_with_yielding_select = auto ; then
12149                                 ol_with_yielding_select=yes
12150                         fi
12151
12152                                                 for ac_func in \
12153                                 thr_setconcurrency \
12154                                 thr_getconcurrency \
12155                         
12156 do
12157 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12158 echo "configure:12159: checking for $ac_func" >&5
12159 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12160   echo $ac_n "(cached) $ac_c" 1>&6
12161 else
12162   cat > conftest.$ac_ext <<EOF
12163 #line 12164 "configure"
12164 #include "confdefs.h"
12165 /* System header to define __stub macros and hopefully few prototypes,
12166     which can conflict with char $ac_func(); below.  */
12167 #include <assert.h>
12168 /* Override any gcc2 internal prototype to avoid an error.  */
12169 /* We use char because int might match the return type of a gcc2
12170     builtin and then its argument prototype would still apply.  */
12171 char $ac_func();
12172 char (*f)();
12173
12174 int main() {
12175
12176 /* The GNU C library defines this for functions which it implements
12177     to always fail with ENOSYS.  Some functions are actually named
12178     something starting with __ and the normal name is an alias.  */
12179 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12180 choke me
12181 #else
12182 f = $ac_func;
12183 #endif
12184
12185 ; return 0; }
12186 EOF
12187 if { (eval echo configure:12188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12188   rm -rf conftest*
12189   eval "ac_cv_func_$ac_func=yes"
12190 else
12191   echo "configure: failed program was:" >&5
12192   cat conftest.$ac_ext >&5
12193   rm -rf conftest*
12194   eval "ac_cv_func_$ac_func=no"
12195 fi
12196 rm -f conftest*
12197 fi
12198
12199 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12200   echo "$ac_t""yes" 1>&6
12201     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12202   cat >> confdefs.h <<EOF
12203 #define $ac_tr_func 1
12204 EOF
12205  
12206 else
12207   echo "$ac_t""no" 1>&6
12208 fi
12209 done
12210
12211                 fi
12212         fi
12213
12214                 for ac_hdr in lwp/lwp.h
12215 do
12216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12217 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12218 echo "configure:12219: checking for $ac_hdr" >&5
12219 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12220   echo $ac_n "(cached) $ac_c" 1>&6
12221 else
12222   cat > conftest.$ac_ext <<EOF
12223 #line 12224 "configure"
12224 #include "confdefs.h"
12225 #include <$ac_hdr>
12226 EOF
12227 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12228 { (eval echo configure:12229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12229 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12230 if test -z "$ac_err"; then
12231   rm -rf conftest*
12232   eval "ac_cv_header_$ac_safe=yes"
12233 else
12234   echo "$ac_err" >&5
12235   echo "configure: failed program was:" >&5
12236   cat conftest.$ac_ext >&5
12237   rm -rf conftest*
12238   eval "ac_cv_header_$ac_safe=no"
12239 fi
12240 rm -f conftest*
12241 fi
12242 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12243   echo "$ac_t""yes" 1>&6
12244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12245   cat >> confdefs.h <<EOF
12246 #define $ac_tr_hdr 1
12247 EOF
12248  
12249 else
12250   echo "$ac_t""no" 1>&6
12251 fi
12252 done
12253
12254         if test $ac_cv_header_lwp_lwp_h = yes ; then
12255                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12256 echo "configure:12257: checking for lwp_create in -llwp" >&5
12257 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12259   echo $ac_n "(cached) $ac_c" 1>&6
12260 else
12261   ac_save_LIBS="$LIBS"
12262 LIBS="-llwp  $LIBS"
12263 cat > conftest.$ac_ext <<EOF
12264 #line 12265 "configure"
12265 #include "confdefs.h"
12266 /* Override any gcc2 internal prototype to avoid an error.  */
12267 /* We use char because int might match the return type of a gcc2
12268     builtin and then its argument prototype would still apply.  */
12269 char lwp_create();
12270
12271 int main() {
12272 lwp_create()
12273 ; return 0; }
12274 EOF
12275 if { (eval echo configure:12276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12276   rm -rf conftest*
12277   eval "ac_cv_lib_$ac_lib_var=yes"
12278 else
12279   echo "configure: failed program was:" >&5
12280   cat conftest.$ac_ext >&5
12281   rm -rf conftest*
12282   eval "ac_cv_lib_$ac_lib_var=no"
12283 fi
12284 rm -f conftest*
12285 LIBS="$ac_save_LIBS"
12286
12287 fi
12288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12289   echo "$ac_t""yes" 1>&6
12290   have_lwp=yes
12291 else
12292   echo "$ac_t""no" 1>&6
12293 have_lwp=no
12294 fi
12295
12296
12297                 if test $have_lwp = yes ; then
12298                         cat >> confdefs.h <<\EOF
12299 #define HAVE_LWP 1
12300 EOF
12301
12302                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12303                         ol_link_threads=lwp
12304
12305                         if test $ol_with_yielding_select = auto ; then
12306                                 ol_with_yielding_select=no
12307                         fi
12308                 fi
12309         fi
12310 fi
12311
12312 if test $ol_with_yielding_select = yes ; then
12313         cat >> confdefs.h <<\EOF
12314 #define HAVE_YIELDING_SELECT 1
12315 EOF
12316
12317 fi
12318
12319 if test $ol_with_threads = manual ; then
12320                 ol_link_threads=yes
12321
12322         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12323
12324         for ac_hdr in pthread.h sched.h
12325 do
12326 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12327 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12328 echo "configure:12329: checking for $ac_hdr" >&5
12329 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12330   echo $ac_n "(cached) $ac_c" 1>&6
12331 else
12332   cat > conftest.$ac_ext <<EOF
12333 #line 12334 "configure"
12334 #include "confdefs.h"
12335 #include <$ac_hdr>
12336 EOF
12337 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12338 { (eval echo configure:12339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12339 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12340 if test -z "$ac_err"; then
12341   rm -rf conftest*
12342   eval "ac_cv_header_$ac_safe=yes"
12343 else
12344   echo "$ac_err" >&5
12345   echo "configure: failed program was:" >&5
12346   cat conftest.$ac_ext >&5
12347   rm -rf conftest*
12348   eval "ac_cv_header_$ac_safe=no"
12349 fi
12350 rm -f conftest*
12351 fi
12352 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12353   echo "$ac_t""yes" 1>&6
12354     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12355   cat >> confdefs.h <<EOF
12356 #define $ac_tr_hdr 1
12357 EOF
12358  
12359 else
12360   echo "$ac_t""no" 1>&6
12361 fi
12362 done
12363
12364         for ac_func in sched_yield pthread_yield
12365 do
12366 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12367 echo "configure:12368: checking for $ac_func" >&5
12368 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12369   echo $ac_n "(cached) $ac_c" 1>&6
12370 else
12371   cat > conftest.$ac_ext <<EOF
12372 #line 12373 "configure"
12373 #include "confdefs.h"
12374 /* System header to define __stub macros and hopefully few prototypes,
12375     which can conflict with char $ac_func(); below.  */
12376 #include <assert.h>
12377 /* Override any gcc2 internal prototype to avoid an error.  */
12378 /* We use char because int might match the return type of a gcc2
12379     builtin and then its argument prototype would still apply.  */
12380 char $ac_func();
12381 char (*f)();
12382
12383 int main() {
12384
12385 /* The GNU C library defines this for functions which it implements
12386     to always fail with ENOSYS.  Some functions are actually named
12387     something starting with __ and the normal name is an alias.  */
12388 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12389 choke me
12390 #else
12391 f = $ac_func;
12392 #endif
12393
12394 ; return 0; }
12395 EOF
12396 if { (eval echo configure:12397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12397   rm -rf conftest*
12398   eval "ac_cv_func_$ac_func=yes"
12399 else
12400   echo "configure: failed program was:" >&5
12401   cat conftest.$ac_ext >&5
12402   rm -rf conftest*
12403   eval "ac_cv_func_$ac_func=no"
12404 fi
12405 rm -f conftest*
12406 fi
12407
12408 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12409   echo "$ac_t""yes" 1>&6
12410     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12411   cat >> confdefs.h <<EOF
12412 #define $ac_tr_func 1
12413 EOF
12414  
12415 else
12416   echo "$ac_t""no" 1>&6
12417 fi
12418 done
12419
12420         
12421         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12422 echo "configure:12423: checking for LinuxThreads pthread.h" >&5
12423 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12424   echo $ac_n "(cached) $ac_c" 1>&6
12425 else
12426   cat > conftest.$ac_ext <<EOF
12427 #line 12428 "configure"
12428 #include "confdefs.h"
12429 #include <pthread.h>
12430 EOF
12431 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12432   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12433   rm -rf conftest*
12434   ol_cv_header_linux_threads=yes
12435 else
12436   rm -rf conftest*
12437   ol_cv_header_linux_threads=no
12438 fi
12439 rm -f conftest*
12440
12441                 
12442 fi
12443
12444 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12445         if test $ol_cv_header_linux_threads = yes; then
12446                 cat >> confdefs.h <<\EOF
12447 #define HAVE_LINUX_THREADS 1
12448 EOF
12449
12450         fi
12451
12452
12453         for ac_hdr in mach/cthreads.h
12454 do
12455 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12456 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12457 echo "configure:12458: checking for $ac_hdr" >&5
12458 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12459   echo $ac_n "(cached) $ac_c" 1>&6
12460 else
12461   cat > conftest.$ac_ext <<EOF
12462 #line 12463 "configure"
12463 #include "confdefs.h"
12464 #include <$ac_hdr>
12465 EOF
12466 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12467 { (eval echo configure:12468: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12468 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12469 if test -z "$ac_err"; then
12470   rm -rf conftest*
12471   eval "ac_cv_header_$ac_safe=yes"
12472 else
12473   echo "$ac_err" >&5
12474   echo "configure: failed program was:" >&5
12475   cat conftest.$ac_ext >&5
12476   rm -rf conftest*
12477   eval "ac_cv_header_$ac_safe=no"
12478 fi
12479 rm -f conftest*
12480 fi
12481 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12482   echo "$ac_t""yes" 1>&6
12483     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12484   cat >> confdefs.h <<EOF
12485 #define $ac_tr_hdr 1
12486 EOF
12487  
12488 else
12489   echo "$ac_t""no" 1>&6
12490 fi
12491 done
12492
12493         for ac_hdr in lwp/lwp.h
12494 do
12495 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12496 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12497 echo "configure:12498: checking for $ac_hdr" >&5
12498 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12499   echo $ac_n "(cached) $ac_c" 1>&6
12500 else
12501   cat > conftest.$ac_ext <<EOF
12502 #line 12503 "configure"
12503 #include "confdefs.h"
12504 #include <$ac_hdr>
12505 EOF
12506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12507 { (eval echo configure:12508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12509 if test -z "$ac_err"; then
12510   rm -rf conftest*
12511   eval "ac_cv_header_$ac_safe=yes"
12512 else
12513   echo "$ac_err" >&5
12514   echo "configure: failed program was:" >&5
12515   cat conftest.$ac_ext >&5
12516   rm -rf conftest*
12517   eval "ac_cv_header_$ac_safe=no"
12518 fi
12519 rm -f conftest*
12520 fi
12521 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12522   echo "$ac_t""yes" 1>&6
12523     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12524   cat >> confdefs.h <<EOF
12525 #define $ac_tr_hdr 1
12526 EOF
12527  
12528 else
12529   echo "$ac_t""no" 1>&6
12530 fi
12531 done
12532
12533         for ac_hdr in thread.h synch.h
12534 do
12535 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12536 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12537 echo "configure:12538: checking for $ac_hdr" >&5
12538 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12539   echo $ac_n "(cached) $ac_c" 1>&6
12540 else
12541   cat > conftest.$ac_ext <<EOF
12542 #line 12543 "configure"
12543 #include "confdefs.h"
12544 #include <$ac_hdr>
12545 EOF
12546 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12547 { (eval echo configure:12548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12548 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12549 if test -z "$ac_err"; then
12550   rm -rf conftest*
12551   eval "ac_cv_header_$ac_safe=yes"
12552 else
12553   echo "$ac_err" >&5
12554   echo "configure: failed program was:" >&5
12555   cat conftest.$ac_ext >&5
12556   rm -rf conftest*
12557   eval "ac_cv_header_$ac_safe=no"
12558 fi
12559 rm -f conftest*
12560 fi
12561 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12562   echo "$ac_t""yes" 1>&6
12563     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12564   cat >> confdefs.h <<EOF
12565 #define $ac_tr_hdr 1
12566 EOF
12567  
12568 else
12569   echo "$ac_t""no" 1>&6
12570 fi
12571 done
12572
12573 fi
12574
12575 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12576                         cat >> confdefs.h <<\EOF
12577 #define REENTRANT 1
12578 EOF
12579
12580         cat >> confdefs.h <<\EOF
12581 #define _REENTRANT 1
12582 EOF
12583
12584         cat >> confdefs.h <<\EOF
12585 #define THREAD_SAFE 1
12586 EOF
12587
12588         cat >> confdefs.h <<\EOF
12589 #define _THREAD_SAFE 1
12590 EOF
12591
12592         cat >> confdefs.h <<\EOF
12593 #define THREADSAFE 1
12594 EOF
12595
12596         cat >> confdefs.h <<\EOF
12597 #define _THREADSAFE 1
12598 EOF
12599
12600         cat >> confdefs.h <<\EOF
12601 #define _SGI_MP_SOURCE 1
12602 EOF
12603
12604
12605                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12606 echo "configure:12607: checking for thread specific errno" >&5
12607 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12608   echo $ac_n "(cached) $ac_c" 1>&6
12609 else
12610   
12611                 cat > conftest.$ac_ext <<EOF
12612 #line 12613 "configure"
12613 #include "confdefs.h"
12614 #include <errno.h>
12615 int main() {
12616 errno = 0;
12617 ; return 0; }
12618 EOF
12619 if { (eval echo configure:12620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12620   rm -rf conftest*
12621   ol_cv_errno_thread_specific=yes
12622 else
12623   echo "configure: failed program was:" >&5
12624   cat conftest.$ac_ext >&5
12625   rm -rf conftest*
12626   ol_cv_errno_thread_specific=no
12627 fi
12628 rm -f conftest*
12629         
12630 fi
12631
12632 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12633
12634                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12635 echo "configure:12636: checking for thread specific h_errno" >&5
12636 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12637   echo $ac_n "(cached) $ac_c" 1>&6
12638 else
12639   
12640                 cat > conftest.$ac_ext <<EOF
12641 #line 12642 "configure"
12642 #include "confdefs.h"
12643 #include <netdb.h>
12644 int main() {
12645 h_errno = 0;
12646 ; return 0; }
12647 EOF
12648 if { (eval echo configure:12649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12649   rm -rf conftest*
12650   ol_cv_h_errno_thread_specific=yes
12651 else
12652   echo "configure: failed program was:" >&5
12653   cat conftest.$ac_ext >&5
12654   rm -rf conftest*
12655   ol_cv_h_errno_thread_specific=no
12656 fi
12657 rm -f conftest*
12658         
12659 fi
12660
12661 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12662
12663         if test $ol_cv_errno_thread_specific != yes \
12664                 -o $ol_cv_h_errno_thread_specific != yes ; then
12665                 LIBS="$LTHREAD_LIBS $LIBS"
12666                 LTHREAD_LIBS=""
12667         fi
12668
12669 fi  
12670
12671 if test $ol_link_threads = no ; then
12672         if test $ol_with_threads = yes ; then
12673                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12674         fi
12675
12676         if test $ol_with_threads = auto ; then
12677                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12678                 ol_with_threads=no
12679         fi
12680
12681         cat >> confdefs.h <<\EOF
12682 #define NO_THREADS 1
12683 EOF
12684
12685         LTHREAD_LIBS=""
12686 fi
12687
12688 if test $ol_link_threads != no ; then
12689         cat >> confdefs.h <<\EOF
12690 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12691 EOF
12692
12693 fi
12694
12695 ol_link_ldbm=no 
12696
12697 if test $ol_with_ldbm_api = auto \
12698         -o $ol_with_ldbm_api = berkeley \
12699         -o $ol_with_ldbm_api = bcompat ; then
12700
12701         if test $ol_with_ldbm_api = bcompat; then \
12702                 ol_cv_berkeley_db=no
12703 for ac_hdr in db_185.h db.h
12704 do
12705 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12706 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12707 echo "configure:12708: checking for $ac_hdr" >&5
12708 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12709   echo $ac_n "(cached) $ac_c" 1>&6
12710 else
12711   cat > conftest.$ac_ext <<EOF
12712 #line 12713 "configure"
12713 #include "confdefs.h"
12714 #include <$ac_hdr>
12715 EOF
12716 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12717 { (eval echo configure:12718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12718 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12719 if test -z "$ac_err"; then
12720   rm -rf conftest*
12721   eval "ac_cv_header_$ac_safe=yes"
12722 else
12723   echo "$ac_err" >&5
12724   echo "configure: failed program was:" >&5
12725   cat conftest.$ac_ext >&5
12726   rm -rf conftest*
12727   eval "ac_cv_header_$ac_safe=no"
12728 fi
12729 rm -f conftest*
12730 fi
12731 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12732   echo "$ac_t""yes" 1>&6
12733     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12734   cat >> confdefs.h <<EOF
12735 #define $ac_tr_hdr 1
12736 EOF
12737  
12738 else
12739   echo "$ac_t""no" 1>&6
12740 fi
12741 done
12742
12743 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12744         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12745 echo "configure:12746: checking if Berkeley DB header compatibility" >&5
12746 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12747   echo $ac_n "(cached) $ac_c" 1>&6
12748 else
12749   
12750                 cat > conftest.$ac_ext <<EOF
12751 #line 12752 "configure"
12752 #include "confdefs.h"
12753
12754 #if HAVE_DB_185_H
12755 #       include <db_185.h>
12756 #else
12757 #       include <db.h>
12758 #endif
12759
12760  /* this check could be improved */
12761 #ifndef DB_VERSION_MAJOR
12762 #       define DB_VERSION_MAJOR 1
12763 #endif
12764
12765 #if DB_VERSION_MAJOR == 1 
12766         __db_version_1
12767 #endif
12768
12769 EOF
12770 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12771   egrep "__db_version_1" >/dev/null 2>&1; then
12772   rm -rf conftest*
12773   ol_cv_header_db1=yes
12774 else
12775   rm -rf conftest*
12776   ol_cv_header_db1=no
12777 fi
12778 rm -f conftest*
12779
12780 fi
12781
12782 echo "$ac_t""$ol_cv_header_db1" 1>&6
12783
12784         if test $ol_cv_header_db1 = yes ; then
12785                 ol_cv_lib_db=no
12786 if test $ol_cv_lib_db = no ; then
12787         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12788 echo "configure:12789: checking for Berkeley DB link (default)" >&5
12789 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12790   echo $ac_n "(cached) $ac_c" 1>&6
12791 else
12792   
12793         ol_DB_LIB=
12794         ol_LIBS=$LIBS
12795         LIBS="$ol_DB_LIB $LIBS"
12796
12797         cat > conftest.$ac_ext <<EOF
12798 #line 12799 "configure"
12799 #include "confdefs.h"
12800
12801 #ifdef HAVE_DB_185_H
12802 # include <db_185.h>
12803 #else
12804 # include <db.h>
12805 #endif
12806
12807 #ifndef DB_VERSION_MAJOR
12808 # define DB_VERSION_MAJOR 1
12809 #endif
12810
12811 #ifndef NULL
12812 #define NULL ((void*)0)
12813 #endif
12814
12815 int main() {
12816
12817 #if DB_VERSION_MAJOR > 1
12818         {
12819                 char *version;
12820                 int major, minor, patch;
12821
12822                 version = db_version( &major, &minor, &patch );
12823
12824                 if( major != DB_VERSION_MAJOR ||
12825                         minor < DB_VERSION_MINOR )
12826                 {
12827                         printf("Berkeley DB version mismatch\n"
12828                                 "\texpected: %s\n\tgot: %s\n",
12829                                 DB_VERSION_STRING, version);
12830                         return 1;
12831                 }
12832         }
12833 #endif
12834
12835 #if DB_VERSION_MAJOR > 2
12836         db_env_create( NULL, 0 );
12837 #elif DB_VERSION_MAJOR > 1
12838         db_appexit( NULL );
12839 #else
12840         (void) dbopen( NULL, 0, 0, 0, NULL);
12841 #endif
12842
12843 ; return 0; }
12844 EOF
12845 if { (eval echo configure:12846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12846   rm -rf conftest*
12847   ol_cv_db_none=yes
12848 else
12849   echo "configure: failed program was:" >&5
12850   cat conftest.$ac_ext >&5
12851   rm -rf conftest*
12852   ol_cv_db_none=no
12853 fi
12854 rm -f conftest*
12855
12856         LIBS="$ol_LIBS"
12857
12858 fi
12859
12860 echo "$ac_t""$ol_cv_db_none" 1>&6
12861
12862         if test $ol_cv_db_none = yes ; then
12863                 ol_cv_lib_db=yes
12864         fi
12865 fi
12866
12867 if test $ol_cv_lib_db = no ; then
12868         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12869 echo "configure:12870: checking for Berkeley DB link (-ldb)" >&5
12870 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12871   echo $ac_n "(cached) $ac_c" 1>&6
12872 else
12873   
12874         ol_DB_LIB=-ldb
12875         ol_LIBS=$LIBS
12876         LIBS="$ol_DB_LIB $LIBS"
12877
12878         cat > conftest.$ac_ext <<EOF
12879 #line 12880 "configure"
12880 #include "confdefs.h"
12881
12882 #ifdef HAVE_DB_185_H
12883 # include <db_185.h>
12884 #else
12885 # include <db.h>
12886 #endif
12887
12888 #ifndef DB_VERSION_MAJOR
12889 # define DB_VERSION_MAJOR 1
12890 #endif
12891
12892 #ifndef NULL
12893 #define NULL ((void*)0)
12894 #endif
12895
12896 int main() {
12897
12898 #if DB_VERSION_MAJOR > 1
12899         {
12900                 char *version;
12901                 int major, minor, patch;
12902
12903                 version = db_version( &major, &minor, &patch );
12904
12905                 if( major != DB_VERSION_MAJOR ||
12906                         minor < DB_VERSION_MINOR )
12907                 {
12908                         printf("Berkeley DB version mismatch\n"
12909                                 "\texpected: %s\n\tgot: %s\n",
12910                                 DB_VERSION_STRING, version);
12911                         return 1;
12912                 }
12913         }
12914 #endif
12915
12916 #if DB_VERSION_MAJOR > 2
12917         db_env_create( NULL, 0 );
12918 #elif DB_VERSION_MAJOR > 1
12919         db_appexit( NULL );
12920 #else
12921         (void) dbopen( NULL, 0, 0, 0, NULL);
12922 #endif
12923
12924 ; return 0; }
12925 EOF
12926 if { (eval echo configure:12927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12927   rm -rf conftest*
12928   ol_cv_db_db=yes
12929 else
12930   echo "configure: failed program was:" >&5
12931   cat conftest.$ac_ext >&5
12932   rm -rf conftest*
12933   ol_cv_db_db=no
12934 fi
12935 rm -f conftest*
12936
12937         LIBS="$ol_LIBS"
12938
12939 fi
12940
12941 echo "$ac_t""$ol_cv_db_db" 1>&6
12942
12943         if test $ol_cv_db_db = yes ; then
12944                 ol_cv_lib_db=-ldb
12945         fi
12946 fi
12947
12948 if test $ol_cv_lib_db = no ; then
12949         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12950 echo "configure:12951: checking for Berkeley DB link (-ldb3)" >&5
12951 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12952   echo $ac_n "(cached) $ac_c" 1>&6
12953 else
12954   
12955         ol_DB_LIB=-ldb3
12956         ol_LIBS=$LIBS
12957         LIBS="$ol_DB_LIB $LIBS"
12958
12959         cat > conftest.$ac_ext <<EOF
12960 #line 12961 "configure"
12961 #include "confdefs.h"
12962
12963 #ifdef HAVE_DB_185_H
12964 # include <db_185.h>
12965 #else
12966 # include <db.h>
12967 #endif
12968
12969 #ifndef DB_VERSION_MAJOR
12970 # define DB_VERSION_MAJOR 1
12971 #endif
12972
12973 #ifndef NULL
12974 #define NULL ((void*)0)
12975 #endif
12976
12977 int main() {
12978
12979 #if DB_VERSION_MAJOR > 1
12980         {
12981                 char *version;
12982                 int major, minor, patch;
12983
12984                 version = db_version( &major, &minor, &patch );
12985
12986                 if( major != DB_VERSION_MAJOR ||
12987                         minor < DB_VERSION_MINOR )
12988                 {
12989                         printf("Berkeley DB version mismatch\n"
12990                                 "\texpected: %s\n\tgot: %s\n",
12991                                 DB_VERSION_STRING, version);
12992                         return 1;
12993                 }
12994         }
12995 #endif
12996
12997 #if DB_VERSION_MAJOR > 2
12998         db_env_create( NULL, 0 );
12999 #elif DB_VERSION_MAJOR > 1
13000         db_appexit( NULL );
13001 #else
13002         (void) dbopen( NULL, 0, 0, 0, NULL);
13003 #endif
13004
13005 ; return 0; }
13006 EOF
13007 if { (eval echo configure:13008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13008   rm -rf conftest*
13009   ol_cv_db_db3=yes
13010 else
13011   echo "configure: failed program was:" >&5
13012   cat conftest.$ac_ext >&5
13013   rm -rf conftest*
13014   ol_cv_db_db3=no
13015 fi
13016 rm -f conftest*
13017
13018         LIBS="$ol_LIBS"
13019
13020 fi
13021
13022 echo "$ac_t""$ol_cv_db_db3" 1>&6
13023
13024         if test $ol_cv_db_db3 = yes ; then
13025                 ol_cv_lib_db=-ldb3
13026         fi
13027 fi
13028
13029 if test $ol_cv_lib_db = no ; then
13030         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13031 echo "configure:13032: checking for Berkeley DB link (-ldb2)" >&5
13032 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13033   echo $ac_n "(cached) $ac_c" 1>&6
13034 else
13035   
13036         ol_DB_LIB=-ldb2
13037         ol_LIBS=$LIBS
13038         LIBS="$ol_DB_LIB $LIBS"
13039
13040         cat > conftest.$ac_ext <<EOF
13041 #line 13042 "configure"
13042 #include "confdefs.h"
13043
13044 #ifdef HAVE_DB_185_H
13045 # include <db_185.h>
13046 #else
13047 # include <db.h>
13048 #endif
13049
13050 #ifndef DB_VERSION_MAJOR
13051 # define DB_VERSION_MAJOR 1
13052 #endif
13053
13054 #ifndef NULL
13055 #define NULL ((void*)0)
13056 #endif
13057
13058 int main() {
13059
13060 #if DB_VERSION_MAJOR > 1
13061         {
13062                 char *version;
13063                 int major, minor, patch;
13064
13065                 version = db_version( &major, &minor, &patch );
13066
13067                 if( major != DB_VERSION_MAJOR ||
13068                         minor < DB_VERSION_MINOR )
13069                 {
13070                         printf("Berkeley DB version mismatch\n"
13071                                 "\texpected: %s\n\tgot: %s\n",
13072                                 DB_VERSION_STRING, version);
13073                         return 1;
13074                 }
13075         }
13076 #endif
13077
13078 #if DB_VERSION_MAJOR > 2
13079         db_env_create( NULL, 0 );
13080 #elif DB_VERSION_MAJOR > 1
13081         db_appexit( NULL );
13082 #else
13083         (void) dbopen( NULL, 0, 0, 0, NULL);
13084 #endif
13085
13086 ; return 0; }
13087 EOF
13088 if { (eval echo configure:13089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13089   rm -rf conftest*
13090   ol_cv_db_db2=yes
13091 else
13092   echo "configure: failed program was:" >&5
13093   cat conftest.$ac_ext >&5
13094   rm -rf conftest*
13095   ol_cv_db_db2=no
13096 fi
13097 rm -f conftest*
13098
13099         LIBS="$ol_LIBS"
13100
13101 fi
13102
13103 echo "$ac_t""$ol_cv_db_db2" 1>&6
13104
13105         if test $ol_cv_db_db2 = yes ; then
13106                 ol_cv_lib_db=-ldb2
13107         fi
13108 fi
13109
13110 if test $ol_cv_lib_db = no ; then
13111         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13112 echo "configure:13113: checking for Berkeley DB link (-ldb1)" >&5
13113 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13114   echo $ac_n "(cached) $ac_c" 1>&6
13115 else
13116   
13117         ol_DB_LIB=-ldb1
13118         ol_LIBS=$LIBS
13119         LIBS="$ol_DB_LIB $LIBS"
13120
13121         cat > conftest.$ac_ext <<EOF
13122 #line 13123 "configure"
13123 #include "confdefs.h"
13124
13125 #ifdef HAVE_DB_185_H
13126 # include <db_185.h>
13127 #else
13128 # include <db.h>
13129 #endif
13130
13131 #ifndef DB_VERSION_MAJOR
13132 # define DB_VERSION_MAJOR 1
13133 #endif
13134
13135 #ifndef NULL
13136 #define NULL ((void*)0)
13137 #endif
13138
13139 int main() {
13140
13141 #if DB_VERSION_MAJOR > 1
13142         {
13143                 char *version;
13144                 int major, minor, patch;
13145
13146                 version = db_version( &major, &minor, &patch );
13147
13148                 if( major != DB_VERSION_MAJOR ||
13149                         minor < DB_VERSION_MINOR )
13150                 {
13151                         printf("Berkeley DB version mismatch\n"
13152                                 "\texpected: %s\n\tgot: %s\n",
13153                                 DB_VERSION_STRING, version);
13154                         return 1;
13155                 }
13156         }
13157 #endif
13158
13159 #if DB_VERSION_MAJOR > 2
13160         db_env_create( NULL, 0 );
13161 #elif DB_VERSION_MAJOR > 1
13162         db_appexit( NULL );
13163 #else
13164         (void) dbopen( NULL, 0, 0, 0, NULL);
13165 #endif
13166
13167 ; return 0; }
13168 EOF
13169 if { (eval echo configure:13170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13170   rm -rf conftest*
13171   ol_cv_db_db1=yes
13172 else
13173   echo "configure: failed program was:" >&5
13174   cat conftest.$ac_ext >&5
13175   rm -rf conftest*
13176   ol_cv_db_db1=no
13177 fi
13178 rm -f conftest*
13179
13180         LIBS="$ol_LIBS"
13181
13182 fi
13183
13184 echo "$ac_t""$ol_cv_db_db1" 1>&6
13185
13186         if test $ol_cv_db_db1 = yes ; then
13187                 ol_cv_lib_db=-ldb1
13188         fi
13189 fi
13190
13191
13192                 if test "$ol_cv_lib_db" != no ; then
13193                         ol_cv_berkeley_db=yes
13194                 fi
13195         fi
13196 fi
13197
13198         else
13199                 ol_cv_berkeley_db=no
13200 for ac_hdr in db.h
13201 do
13202 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13203 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13204 echo "configure:13205: checking for $ac_hdr" >&5
13205 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13206   echo $ac_n "(cached) $ac_c" 1>&6
13207 else
13208   cat > conftest.$ac_ext <<EOF
13209 #line 13210 "configure"
13210 #include "confdefs.h"
13211 #include <$ac_hdr>
13212 EOF
13213 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13214 { (eval echo configure:13215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13215 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13216 if test -z "$ac_err"; then
13217   rm -rf conftest*
13218   eval "ac_cv_header_$ac_safe=yes"
13219 else
13220   echo "$ac_err" >&5
13221   echo "configure: failed program was:" >&5
13222   cat conftest.$ac_ext >&5
13223   rm -rf conftest*
13224   eval "ac_cv_header_$ac_safe=no"
13225 fi
13226 rm -f conftest*
13227 fi
13228 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13229   echo "$ac_t""yes" 1>&6
13230     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13231   cat >> confdefs.h <<EOF
13232 #define $ac_tr_hdr 1
13233 EOF
13234  
13235 else
13236   echo "$ac_t""no" 1>&6
13237 fi
13238 done
13239
13240 if test $ac_cv_header_db_h = yes; then
13241         ol_cv_lib_db=no
13242 if test $ol_cv_lib_db = no ; then
13243         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13244 echo "configure:13245: checking for Berkeley DB link (default)" >&5
13245 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13246   echo $ac_n "(cached) $ac_c" 1>&6
13247 else
13248   
13249         ol_DB_LIB=
13250         ol_LIBS=$LIBS
13251         LIBS="$ol_DB_LIB $LIBS"
13252
13253         cat > conftest.$ac_ext <<EOF
13254 #line 13255 "configure"
13255 #include "confdefs.h"
13256
13257 #ifdef HAVE_DB_185_H
13258 # include <db_185.h>
13259 #else
13260 # include <db.h>
13261 #endif
13262
13263 #ifndef DB_VERSION_MAJOR
13264 # define DB_VERSION_MAJOR 1
13265 #endif
13266
13267 #ifndef NULL
13268 #define NULL ((void*)0)
13269 #endif
13270
13271 int main() {
13272
13273 #if DB_VERSION_MAJOR > 1
13274         {
13275                 char *version;
13276                 int major, minor, patch;
13277
13278                 version = db_version( &major, &minor, &patch );
13279
13280                 if( major != DB_VERSION_MAJOR ||
13281                         minor < DB_VERSION_MINOR )
13282                 {
13283                         printf("Berkeley DB version mismatch\n"
13284                                 "\texpected: %s\n\tgot: %s\n",
13285                                 DB_VERSION_STRING, version);
13286                         return 1;
13287                 }
13288         }
13289 #endif
13290
13291 #if DB_VERSION_MAJOR > 2
13292         db_env_create( NULL, 0 );
13293 #elif DB_VERSION_MAJOR > 1
13294         db_appexit( NULL );
13295 #else
13296         (void) dbopen( NULL, 0, 0, 0, NULL);
13297 #endif
13298
13299 ; return 0; }
13300 EOF
13301 if { (eval echo configure:13302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13302   rm -rf conftest*
13303   ol_cv_db_none=yes
13304 else
13305   echo "configure: failed program was:" >&5
13306   cat conftest.$ac_ext >&5
13307   rm -rf conftest*
13308   ol_cv_db_none=no
13309 fi
13310 rm -f conftest*
13311
13312         LIBS="$ol_LIBS"
13313
13314 fi
13315
13316 echo "$ac_t""$ol_cv_db_none" 1>&6
13317
13318         if test $ol_cv_db_none = yes ; then
13319                 ol_cv_lib_db=yes
13320         fi
13321 fi
13322
13323 if test $ol_cv_lib_db = no ; then
13324         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13325 echo "configure:13326: checking for Berkeley DB link (-ldb)" >&5
13326 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13327   echo $ac_n "(cached) $ac_c" 1>&6
13328 else
13329   
13330         ol_DB_LIB=-ldb
13331         ol_LIBS=$LIBS
13332         LIBS="$ol_DB_LIB $LIBS"
13333
13334         cat > conftest.$ac_ext <<EOF
13335 #line 13336 "configure"
13336 #include "confdefs.h"
13337
13338 #ifdef HAVE_DB_185_H
13339 # include <db_185.h>
13340 #else
13341 # include <db.h>
13342 #endif
13343
13344 #ifndef DB_VERSION_MAJOR
13345 # define DB_VERSION_MAJOR 1
13346 #endif
13347
13348 #ifndef NULL
13349 #define NULL ((void*)0)
13350 #endif
13351
13352 int main() {
13353
13354 #if DB_VERSION_MAJOR > 1
13355         {
13356                 char *version;
13357                 int major, minor, patch;
13358
13359                 version = db_version( &major, &minor, &patch );
13360
13361                 if( major != DB_VERSION_MAJOR ||
13362                         minor < DB_VERSION_MINOR )
13363                 {
13364                         printf("Berkeley DB version mismatch\n"
13365                                 "\texpected: %s\n\tgot: %s\n",
13366                                 DB_VERSION_STRING, version);
13367                         return 1;
13368                 }
13369         }
13370 #endif
13371
13372 #if DB_VERSION_MAJOR > 2
13373         db_env_create( NULL, 0 );
13374 #elif DB_VERSION_MAJOR > 1
13375         db_appexit( NULL );
13376 #else
13377         (void) dbopen( NULL, 0, 0, 0, NULL);
13378 #endif
13379
13380 ; return 0; }
13381 EOF
13382 if { (eval echo configure:13383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13383   rm -rf conftest*
13384   ol_cv_db_db=yes
13385 else
13386   echo "configure: failed program was:" >&5
13387   cat conftest.$ac_ext >&5
13388   rm -rf conftest*
13389   ol_cv_db_db=no
13390 fi
13391 rm -f conftest*
13392
13393         LIBS="$ol_LIBS"
13394
13395 fi
13396
13397 echo "$ac_t""$ol_cv_db_db" 1>&6
13398
13399         if test $ol_cv_db_db = yes ; then
13400                 ol_cv_lib_db=-ldb
13401         fi
13402 fi
13403
13404 if test $ol_cv_lib_db = no ; then
13405         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13406 echo "configure:13407: checking for Berkeley DB link (-ldb3)" >&5
13407 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13408   echo $ac_n "(cached) $ac_c" 1>&6
13409 else
13410   
13411         ol_DB_LIB=-ldb3
13412         ol_LIBS=$LIBS
13413         LIBS="$ol_DB_LIB $LIBS"
13414
13415         cat > conftest.$ac_ext <<EOF
13416 #line 13417 "configure"
13417 #include "confdefs.h"
13418
13419 #ifdef HAVE_DB_185_H
13420 # include <db_185.h>
13421 #else
13422 # include <db.h>
13423 #endif
13424
13425 #ifndef DB_VERSION_MAJOR
13426 # define DB_VERSION_MAJOR 1
13427 #endif
13428
13429 #ifndef NULL
13430 #define NULL ((void*)0)
13431 #endif
13432
13433 int main() {
13434
13435 #if DB_VERSION_MAJOR > 1
13436         {
13437                 char *version;
13438                 int major, minor, patch;
13439
13440                 version = db_version( &major, &minor, &patch );
13441
13442                 if( major != DB_VERSION_MAJOR ||
13443                         minor < DB_VERSION_MINOR )
13444                 {
13445                         printf("Berkeley DB version mismatch\n"
13446                                 "\texpected: %s\n\tgot: %s\n",
13447                                 DB_VERSION_STRING, version);
13448                         return 1;
13449                 }
13450         }
13451 #endif
13452
13453 #if DB_VERSION_MAJOR > 2
13454         db_env_create( NULL, 0 );
13455 #elif DB_VERSION_MAJOR > 1
13456         db_appexit( NULL );
13457 #else
13458         (void) dbopen( NULL, 0, 0, 0, NULL);
13459 #endif
13460
13461 ; return 0; }
13462 EOF
13463 if { (eval echo configure:13464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13464   rm -rf conftest*
13465   ol_cv_db_db3=yes
13466 else
13467   echo "configure: failed program was:" >&5
13468   cat conftest.$ac_ext >&5
13469   rm -rf conftest*
13470   ol_cv_db_db3=no
13471 fi
13472 rm -f conftest*
13473
13474         LIBS="$ol_LIBS"
13475
13476 fi
13477
13478 echo "$ac_t""$ol_cv_db_db3" 1>&6
13479
13480         if test $ol_cv_db_db3 = yes ; then
13481                 ol_cv_lib_db=-ldb3
13482         fi
13483 fi
13484
13485 if test $ol_cv_lib_db = no ; then
13486         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13487 echo "configure:13488: checking for Berkeley DB link (-ldb2)" >&5
13488 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13489   echo $ac_n "(cached) $ac_c" 1>&6
13490 else
13491   
13492         ol_DB_LIB=-ldb2
13493         ol_LIBS=$LIBS
13494         LIBS="$ol_DB_LIB $LIBS"
13495
13496         cat > conftest.$ac_ext <<EOF
13497 #line 13498 "configure"
13498 #include "confdefs.h"
13499
13500 #ifdef HAVE_DB_185_H
13501 # include <db_185.h>
13502 #else
13503 # include <db.h>
13504 #endif
13505
13506 #ifndef DB_VERSION_MAJOR
13507 # define DB_VERSION_MAJOR 1
13508 #endif
13509
13510 #ifndef NULL
13511 #define NULL ((void*)0)
13512 #endif
13513
13514 int main() {
13515
13516 #if DB_VERSION_MAJOR > 1
13517         {
13518                 char *version;
13519                 int major, minor, patch;
13520
13521                 version = db_version( &major, &minor, &patch );
13522
13523                 if( major != DB_VERSION_MAJOR ||
13524                         minor < DB_VERSION_MINOR )
13525                 {
13526                         printf("Berkeley DB version mismatch\n"
13527                                 "\texpected: %s\n\tgot: %s\n",
13528                                 DB_VERSION_STRING, version);
13529                         return 1;
13530                 }
13531         }
13532 #endif
13533
13534 #if DB_VERSION_MAJOR > 2
13535         db_env_create( NULL, 0 );
13536 #elif DB_VERSION_MAJOR > 1
13537         db_appexit( NULL );
13538 #else
13539         (void) dbopen( NULL, 0, 0, 0, NULL);
13540 #endif
13541
13542 ; return 0; }
13543 EOF
13544 if { (eval echo configure:13545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13545   rm -rf conftest*
13546   ol_cv_db_db2=yes
13547 else
13548   echo "configure: failed program was:" >&5
13549   cat conftest.$ac_ext >&5
13550   rm -rf conftest*
13551   ol_cv_db_db2=no
13552 fi
13553 rm -f conftest*
13554
13555         LIBS="$ol_LIBS"
13556
13557 fi
13558
13559 echo "$ac_t""$ol_cv_db_db2" 1>&6
13560
13561         if test $ol_cv_db_db2 = yes ; then
13562                 ol_cv_lib_db=-ldb2
13563         fi
13564 fi
13565
13566 if test $ol_cv_lib_db = no ; then
13567         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13568 echo "configure:13569: checking for Berkeley DB link (-ldb1)" >&5
13569 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13570   echo $ac_n "(cached) $ac_c" 1>&6
13571 else
13572   
13573         ol_DB_LIB=-ldb1
13574         ol_LIBS=$LIBS
13575         LIBS="$ol_DB_LIB $LIBS"
13576
13577         cat > conftest.$ac_ext <<EOF
13578 #line 13579 "configure"
13579 #include "confdefs.h"
13580
13581 #ifdef HAVE_DB_185_H
13582 # include <db_185.h>
13583 #else
13584 # include <db.h>
13585 #endif
13586
13587 #ifndef DB_VERSION_MAJOR
13588 # define DB_VERSION_MAJOR 1
13589 #endif
13590
13591 #ifndef NULL
13592 #define NULL ((void*)0)
13593 #endif
13594
13595 int main() {
13596
13597 #if DB_VERSION_MAJOR > 1
13598         {
13599                 char *version;
13600                 int major, minor, patch;
13601
13602                 version = db_version( &major, &minor, &patch );
13603
13604                 if( major != DB_VERSION_MAJOR ||
13605                         minor < DB_VERSION_MINOR )
13606                 {
13607                         printf("Berkeley DB version mismatch\n"
13608                                 "\texpected: %s\n\tgot: %s\n",
13609                                 DB_VERSION_STRING, version);
13610                         return 1;
13611                 }
13612         }
13613 #endif
13614
13615 #if DB_VERSION_MAJOR > 2
13616         db_env_create( NULL, 0 );
13617 #elif DB_VERSION_MAJOR > 1
13618         db_appexit( NULL );
13619 #else
13620         (void) dbopen( NULL, 0, 0, 0, NULL);
13621 #endif
13622
13623 ; return 0; }
13624 EOF
13625 if { (eval echo configure:13626: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13626   rm -rf conftest*
13627   ol_cv_db_db1=yes
13628 else
13629   echo "configure: failed program was:" >&5
13630   cat conftest.$ac_ext >&5
13631   rm -rf conftest*
13632   ol_cv_db_db1=no
13633 fi
13634 rm -f conftest*
13635
13636         LIBS="$ol_LIBS"
13637
13638 fi
13639
13640 echo "$ac_t""$ol_cv_db_db1" 1>&6
13641
13642         if test $ol_cv_db_db1 = yes ; then
13643                 ol_cv_lib_db=-ldb1
13644         fi
13645 fi
13646
13647
13648         if test "$ol_cv_lib_db" != no ; then
13649                 ol_cv_berkeley_db=yes
13650                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13651 echo "configure:13652: checking for Berkeley DB thread support" >&5
13652 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13653   echo $ac_n "(cached) $ac_c" 1>&6
13654 else
13655   
13656         ol_LIBS="$LIBS"
13657         if test $ol_cv_lib_db != yes ; then
13658                 LIBS="$ol_cv_lib_db"
13659         fi
13660
13661         if test "$cross_compiling" = yes; then
13662   ol_cv_berkeley_db_thread=cross
13663 else
13664   cat > conftest.$ac_ext <<EOF
13665 #line 13666 "configure"
13666 #include "confdefs.h"
13667
13668 #ifdef HAVE_DB_185_H
13669         choke me;
13670 #else
13671 #include <db.h>
13672 #endif
13673 #ifndef NULL
13674 #define NULL ((void *)0)
13675 #endif
13676 main()
13677 {
13678         int rc;
13679         u_int32_t flags = DB_CREATE |
13680 #ifdef DB_PRIVATE
13681                 DB_PRIVATE |
13682 #endif
13683                 DB_THREAD;
13684
13685 #if DB_VERSION_MAJOR > 2
13686         DB_ENV *env = NULL;
13687
13688         rc = db_env_create( &env, 0 );
13689
13690         flags |= DB_INIT_MPOOL;
13691 #ifdef DB_MPOOL_PRIVATE
13692         flags |= DB_MPOOL_PRIVATE;
13693 #endif
13694
13695         if( rc ) {
13696                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13697                 return rc;
13698         }
13699
13700 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13701         rc = env->open( env, NULL, flags, 0 );
13702 #else
13703         rc = env->open( env, NULL, NULL, flags, 0 );
13704 #endif
13705
13706         if ( rc == 0 ) {
13707                 rc = env->close( env, 0 );
13708         }
13709
13710         if( rc ) {
13711                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13712                 return rc;
13713         }
13714
13715 #else
13716         DB_ENV env;
13717         memset( &env, '\0', sizeof(env) );
13718
13719         rc = db_appinit( NULL, NULL, &env, flags );
13720
13721         if( rc == 0 ) {
13722                 db_appexit( &env );
13723         }
13724
13725         unlink("__db_mpool.share");
13726         unlink("__db_lock.share");
13727 #endif
13728
13729         return rc;
13730 }
13731 EOF
13732 if { (eval echo configure:13733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13733 then
13734   ol_cv_berkeley_db_thread=yes
13735 else
13736   echo "configure: failed program was:" >&5
13737   cat conftest.$ac_ext >&5
13738   rm -fr conftest*
13739   ol_cv_berkeley_db_thread=no
13740 fi
13741 rm -fr conftest*
13742 fi
13743
13744
13745         LIBS="$ol_LIBS"
13746
13747         if test $ol_cv_berkeley_db_thread != no ; then
13748                 cat >> confdefs.h <<\EOF
13749 #define HAVE_BERKELEY_DB_THREAD 1
13750 EOF
13751
13752         fi
13753
13754 fi
13755
13756 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13757         fi
13758 fi
13759
13760         fi
13761
13762         if test $ol_cv_berkeley_db != no ; then
13763                 cat >> confdefs.h <<\EOF
13764 #define HAVE_BERKELEY_DB 1
13765 EOF
13766
13767
13768                 ol_link_ldbm=berkeley
13769                 ol_with_ldbm_api=berkeley
13770
13771                 if test $ol_with_ldbm_type = hash ; then
13772                         cat >> confdefs.h <<\EOF
13773 #define LDBM_USE_DBHASH 1
13774 EOF
13775
13776                 else
13777                         cat >> confdefs.h <<\EOF
13778 #define LDBM_USE_DBBTREE 1
13779 EOF
13780
13781                 fi
13782
13783                                                 if test $ol_cv_lib_db != yes ; then
13784                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13785                 fi
13786         fi
13787 fi
13788
13789 if test $ol_enable_bdb = yes -a $ol_link_ldbm != berkeley ; then
13790         { echo "configure: error: BerkeleyDB not availabl" 1>&2; exit 1; }
13791 elif test $ol_enable_bdb != no -a $ol_link_ldbm != no ; then
13792         ol_enable_bdb=yes
13793 fi
13794
13795 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13796         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13797         ol_with_ldbm_api=none
13798 fi
13799
13800 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13801         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13802 echo "configure:13803: checking for MDBM library" >&5
13803 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13804   echo $ac_n "(cached) $ac_c" 1>&6
13805 else
13806         ol_LIBS="$LIBS"
13807         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13808 echo "configure:13809: checking for mdbm_set_chain" >&5
13809 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13810   echo $ac_n "(cached) $ac_c" 1>&6
13811 else
13812   cat > conftest.$ac_ext <<EOF
13813 #line 13814 "configure"
13814 #include "confdefs.h"
13815 /* System header to define __stub macros and hopefully few prototypes,
13816     which can conflict with char mdbm_set_chain(); below.  */
13817 #include <assert.h>
13818 /* Override any gcc2 internal prototype to avoid an error.  */
13819 /* We use char because int might match the return type of a gcc2
13820     builtin and then its argument prototype would still apply.  */
13821 char mdbm_set_chain();
13822 char (*f)();
13823
13824 int main() {
13825
13826 /* The GNU C library defines this for functions which it implements
13827     to always fail with ENOSYS.  Some functions are actually named
13828     something starting with __ and the normal name is an alias.  */
13829 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13830 choke me
13831 #else
13832 f = mdbm_set_chain;
13833 #endif
13834
13835 ; return 0; }
13836 EOF
13837 if { (eval echo configure:13838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13838   rm -rf conftest*
13839   eval "ac_cv_func_mdbm_set_chain=yes"
13840 else
13841   echo "configure: failed program was:" >&5
13842   cat conftest.$ac_ext >&5
13843   rm -rf conftest*
13844   eval "ac_cv_func_mdbm_set_chain=no"
13845 fi
13846 rm -f conftest*
13847 fi
13848
13849 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13850   echo "$ac_t""yes" 1>&6
13851   ol_cv_lib_mdbm=yes
13852 else
13853   echo "$ac_t""no" 1>&6
13854
13855                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13856 echo "configure:13857: checking for mdbm_set_chain in -lmdbm" >&5
13857 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13858 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13859   echo $ac_n "(cached) $ac_c" 1>&6
13860 else
13861   ac_save_LIBS="$LIBS"
13862 LIBS="-lmdbm  $LIBS"
13863 cat > conftest.$ac_ext <<EOF
13864 #line 13865 "configure"
13865 #include "confdefs.h"
13866 /* Override any gcc2 internal prototype to avoid an error.  */
13867 /* We use char because int might match the return type of a gcc2
13868     builtin and then its argument prototype would still apply.  */
13869 char mdbm_set_chain();
13870
13871 int main() {
13872 mdbm_set_chain()
13873 ; return 0; }
13874 EOF
13875 if { (eval echo configure:13876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13876   rm -rf conftest*
13877   eval "ac_cv_lib_$ac_lib_var=yes"
13878 else
13879   echo "configure: failed program was:" >&5
13880   cat conftest.$ac_ext >&5
13881   rm -rf conftest*
13882   eval "ac_cv_lib_$ac_lib_var=no"
13883 fi
13884 rm -f conftest*
13885 LIBS="$ac_save_LIBS"
13886
13887 fi
13888 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13889   echo "$ac_t""yes" 1>&6
13890   ol_cv_lib_mdbm=-lmdbm
13891 else
13892   echo "$ac_t""no" 1>&6
13893 ol_cv_lib_mdbm=no
13894 fi
13895
13896         
13897 fi
13898
13899         LIBS="$ol_LIBS"
13900
13901 fi
13902
13903 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13904
13905
13906  for ac_hdr in mdbm.h
13907 do
13908 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13909 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13910 echo "configure:13911: checking for $ac_hdr" >&5
13911 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13912   echo $ac_n "(cached) $ac_c" 1>&6
13913 else
13914   cat > conftest.$ac_ext <<EOF
13915 #line 13916 "configure"
13916 #include "confdefs.h"
13917 #include <$ac_hdr>
13918 EOF
13919 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13920 { (eval echo configure:13921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13921 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13922 if test -z "$ac_err"; then
13923   rm -rf conftest*
13924   eval "ac_cv_header_$ac_safe=yes"
13925 else
13926   echo "$ac_err" >&5
13927   echo "configure: failed program was:" >&5
13928   cat conftest.$ac_ext >&5
13929   rm -rf conftest*
13930   eval "ac_cv_header_$ac_safe=no"
13931 fi
13932 rm -f conftest*
13933 fi
13934 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13935   echo "$ac_t""yes" 1>&6
13936     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13937   cat >> confdefs.h <<EOF
13938 #define $ac_tr_hdr 1
13939 EOF
13940  
13941 else
13942   echo "$ac_t""no" 1>&6
13943 fi
13944 done
13945
13946  echo $ac_n "checking for db""... $ac_c" 1>&6
13947 echo "configure:13948: checking for db" >&5
13948 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13949   echo $ac_n "(cached) $ac_c" 1>&6
13950 else
13951   
13952         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13953                 ol_cv_mdbm=no
13954         else
13955                 ol_cv_mdbm=yes
13956         fi
13957
13958 fi
13959
13960 echo "$ac_t""$ol_cv_mdbm" 1>&6
13961  if test $ol_cv_mdbm = yes ; then
13962         cat >> confdefs.h <<\EOF
13963 #define HAVE_MDBM 1
13964 EOF
13965
13966  fi
13967
13968
13969         if test $ol_cv_mdbm = yes ; then
13970                 ol_link_ldbm=mdbm
13971                 ol_with_ldbm_api=mdbm
13972                 if test $ol_cv_lib_mdbm != yes ; then
13973                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13974                 fi
13975         fi
13976 fi
13977
13978 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13979         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13980 echo "configure:13981: checking for GDBM library" >&5
13981 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13982   echo $ac_n "(cached) $ac_c" 1>&6
13983 else
13984         ol_LIBS="$LIBS"
13985         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13986 echo "configure:13987: checking for gdbm_open" >&5
13987 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13988   echo $ac_n "(cached) $ac_c" 1>&6
13989 else
13990   cat > conftest.$ac_ext <<EOF
13991 #line 13992 "configure"
13992 #include "confdefs.h"
13993 /* System header to define __stub macros and hopefully few prototypes,
13994     which can conflict with char gdbm_open(); below.  */
13995 #include <assert.h>
13996 /* Override any gcc2 internal prototype to avoid an error.  */
13997 /* We use char because int might match the return type of a gcc2
13998     builtin and then its argument prototype would still apply.  */
13999 char gdbm_open();
14000 char (*f)();
14001
14002 int main() {
14003
14004 /* The GNU C library defines this for functions which it implements
14005     to always fail with ENOSYS.  Some functions are actually named
14006     something starting with __ and the normal name is an alias.  */
14007 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
14008 choke me
14009 #else
14010 f = gdbm_open;
14011 #endif
14012
14013 ; return 0; }
14014 EOF
14015 if { (eval echo configure:14016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14016   rm -rf conftest*
14017   eval "ac_cv_func_gdbm_open=yes"
14018 else
14019   echo "configure: failed program was:" >&5
14020   cat conftest.$ac_ext >&5
14021   rm -rf conftest*
14022   eval "ac_cv_func_gdbm_open=no"
14023 fi
14024 rm -f conftest*
14025 fi
14026
14027 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
14028   echo "$ac_t""yes" 1>&6
14029   ol_cv_lib_gdbm=yes
14030 else
14031   echo "$ac_t""no" 1>&6
14032
14033                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
14034 echo "configure:14035: checking for gdbm_open in -lgdbm" >&5
14035 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
14036 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14037   echo $ac_n "(cached) $ac_c" 1>&6
14038 else
14039   ac_save_LIBS="$LIBS"
14040 LIBS="-lgdbm  $LIBS"
14041 cat > conftest.$ac_ext <<EOF
14042 #line 14043 "configure"
14043 #include "confdefs.h"
14044 /* Override any gcc2 internal prototype to avoid an error.  */
14045 /* We use char because int might match the return type of a gcc2
14046     builtin and then its argument prototype would still apply.  */
14047 char gdbm_open();
14048
14049 int main() {
14050 gdbm_open()
14051 ; return 0; }
14052 EOF
14053 if { (eval echo configure:14054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14054   rm -rf conftest*
14055   eval "ac_cv_lib_$ac_lib_var=yes"
14056 else
14057   echo "configure: failed program was:" >&5
14058   cat conftest.$ac_ext >&5
14059   rm -rf conftest*
14060   eval "ac_cv_lib_$ac_lib_var=no"
14061 fi
14062 rm -f conftest*
14063 LIBS="$ac_save_LIBS"
14064
14065 fi
14066 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14067   echo "$ac_t""yes" 1>&6
14068   ol_cv_lib_gdbm=-lgdbm
14069 else
14070   echo "$ac_t""no" 1>&6
14071 ol_cv_lib_gdbm=no
14072 fi
14073
14074         
14075 fi
14076
14077         LIBS="$ol_LIBS"
14078
14079 fi
14080
14081 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14082
14083
14084  for ac_hdr in gdbm.h
14085 do
14086 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14087 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14088 echo "configure:14089: checking for $ac_hdr" >&5
14089 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14090   echo $ac_n "(cached) $ac_c" 1>&6
14091 else
14092   cat > conftest.$ac_ext <<EOF
14093 #line 14094 "configure"
14094 #include "confdefs.h"
14095 #include <$ac_hdr>
14096 EOF
14097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14098 { (eval echo configure:14099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14100 if test -z "$ac_err"; then
14101   rm -rf conftest*
14102   eval "ac_cv_header_$ac_safe=yes"
14103 else
14104   echo "$ac_err" >&5
14105   echo "configure: failed program was:" >&5
14106   cat conftest.$ac_ext >&5
14107   rm -rf conftest*
14108   eval "ac_cv_header_$ac_safe=no"
14109 fi
14110 rm -f conftest*
14111 fi
14112 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14113   echo "$ac_t""yes" 1>&6
14114     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14115   cat >> confdefs.h <<EOF
14116 #define $ac_tr_hdr 1
14117 EOF
14118  
14119 else
14120   echo "$ac_t""no" 1>&6
14121 fi
14122 done
14123
14124  echo $ac_n "checking for db""... $ac_c" 1>&6
14125 echo "configure:14126: checking for db" >&5
14126 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14127   echo $ac_n "(cached) $ac_c" 1>&6
14128 else
14129   
14130         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14131                 ol_cv_gdbm=no
14132         else
14133                 ol_cv_gdbm=yes
14134         fi
14135
14136 fi
14137
14138 echo "$ac_t""$ol_cv_gdbm" 1>&6
14139  if test $ol_cv_gdbm = yes ; then
14140         cat >> confdefs.h <<\EOF
14141 #define HAVE_GDBM 1
14142 EOF
14143
14144  fi
14145
14146
14147         if test $ol_cv_gdbm = yes ; then
14148                 ol_link_ldbm=gdbm
14149                 ol_with_ldbm_api=gdbm
14150
14151                 if test $ol_cv_lib_gdbm != yes ; then
14152                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14153                 fi
14154         fi
14155 fi
14156
14157 if test $ol_with_ldbm_api = ndbm ; then
14158         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14159 echo "configure:14160: checking for NDBM library" >&5
14160 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14161   echo $ac_n "(cached) $ac_c" 1>&6
14162 else
14163         ol_LIBS="$LIBS"
14164         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14165 echo "configure:14166: checking for dbm_open" >&5
14166 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14167   echo $ac_n "(cached) $ac_c" 1>&6
14168 else
14169   cat > conftest.$ac_ext <<EOF
14170 #line 14171 "configure"
14171 #include "confdefs.h"
14172 /* System header to define __stub macros and hopefully few prototypes,
14173     which can conflict with char dbm_open(); below.  */
14174 #include <assert.h>
14175 /* Override any gcc2 internal prototype to avoid an error.  */
14176 /* We use char because int might match the return type of a gcc2
14177     builtin and then its argument prototype would still apply.  */
14178 char dbm_open();
14179 char (*f)();
14180
14181 int main() {
14182
14183 /* The GNU C library defines this for functions which it implements
14184     to always fail with ENOSYS.  Some functions are actually named
14185     something starting with __ and the normal name is an alias.  */
14186 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14187 choke me
14188 #else
14189 f = dbm_open;
14190 #endif
14191
14192 ; return 0; }
14193 EOF
14194 if { (eval echo configure:14195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14195   rm -rf conftest*
14196   eval "ac_cv_func_dbm_open=yes"
14197 else
14198   echo "configure: failed program was:" >&5
14199   cat conftest.$ac_ext >&5
14200   rm -rf conftest*
14201   eval "ac_cv_func_dbm_open=no"
14202 fi
14203 rm -f conftest*
14204 fi
14205
14206 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14207   echo "$ac_t""yes" 1>&6
14208   ol_cv_lib_ndbm=yes
14209 else
14210   echo "$ac_t""no" 1>&6
14211
14212                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14213 echo "configure:14214: checking for dbm_open in -lndbm" >&5
14214 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14215 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14216   echo $ac_n "(cached) $ac_c" 1>&6
14217 else
14218   ac_save_LIBS="$LIBS"
14219 LIBS="-lndbm  $LIBS"
14220 cat > conftest.$ac_ext <<EOF
14221 #line 14222 "configure"
14222 #include "confdefs.h"
14223 /* Override any gcc2 internal prototype to avoid an error.  */
14224 /* We use char because int might match the return type of a gcc2
14225     builtin and then its argument prototype would still apply.  */
14226 char dbm_open();
14227
14228 int main() {
14229 dbm_open()
14230 ; return 0; }
14231 EOF
14232 if { (eval echo configure:14233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14233   rm -rf conftest*
14234   eval "ac_cv_lib_$ac_lib_var=yes"
14235 else
14236   echo "configure: failed program was:" >&5
14237   cat conftest.$ac_ext >&5
14238   rm -rf conftest*
14239   eval "ac_cv_lib_$ac_lib_var=no"
14240 fi
14241 rm -f conftest*
14242 LIBS="$ac_save_LIBS"
14243
14244 fi
14245 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14246   echo "$ac_t""yes" 1>&6
14247   ol_cv_lib_ndbm=-lndbm
14248 else
14249   echo "$ac_t""no" 1>&6
14250
14251                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14252 echo "configure:14253: checking for dbm_open in -ldbm" >&5
14253 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14254 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14255   echo $ac_n "(cached) $ac_c" 1>&6
14256 else
14257   ac_save_LIBS="$LIBS"
14258 LIBS="-ldbm  $LIBS"
14259 cat > conftest.$ac_ext <<EOF
14260 #line 14261 "configure"
14261 #include "confdefs.h"
14262 /* Override any gcc2 internal prototype to avoid an error.  */
14263 /* We use char because int might match the return type of a gcc2
14264     builtin and then its argument prototype would still apply.  */
14265 char dbm_open();
14266
14267 int main() {
14268 dbm_open()
14269 ; return 0; }
14270 EOF
14271 if { (eval echo configure:14272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14272   rm -rf conftest*
14273   eval "ac_cv_lib_$ac_lib_var=yes"
14274 else
14275   echo "configure: failed program was:" >&5
14276   cat conftest.$ac_ext >&5
14277   rm -rf conftest*
14278   eval "ac_cv_lib_$ac_lib_var=no"
14279 fi
14280 rm -f conftest*
14281 LIBS="$ac_save_LIBS"
14282
14283 fi
14284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14285   echo "$ac_t""yes" 1>&6
14286   ol_cv_lib_ndbm=-ldbm
14287 else
14288   echo "$ac_t""no" 1>&6
14289 ol_cv_lib_ndbm=no
14290 fi
14291                 
14292 fi
14293
14294         
14295 fi
14296
14297         LIBS="$ol_LIBS"
14298
14299 fi
14300
14301 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14302
14303
14304  for ac_hdr in ndbm.h
14305 do
14306 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14307 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14308 echo "configure:14309: checking for $ac_hdr" >&5
14309 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14310   echo $ac_n "(cached) $ac_c" 1>&6
14311 else
14312   cat > conftest.$ac_ext <<EOF
14313 #line 14314 "configure"
14314 #include "confdefs.h"
14315 #include <$ac_hdr>
14316 EOF
14317 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14318 { (eval echo configure:14319: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14319 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14320 if test -z "$ac_err"; then
14321   rm -rf conftest*
14322   eval "ac_cv_header_$ac_safe=yes"
14323 else
14324   echo "$ac_err" >&5
14325   echo "configure: failed program was:" >&5
14326   cat conftest.$ac_ext >&5
14327   rm -rf conftest*
14328   eval "ac_cv_header_$ac_safe=no"
14329 fi
14330 rm -f conftest*
14331 fi
14332 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14333   echo "$ac_t""yes" 1>&6
14334     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14335   cat >> confdefs.h <<EOF
14336 #define $ac_tr_hdr 1
14337 EOF
14338  
14339 else
14340   echo "$ac_t""no" 1>&6
14341 fi
14342 done
14343
14344  echo $ac_n "checking for db""... $ac_c" 1>&6
14345 echo "configure:14346: checking for db" >&5
14346 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14347   echo $ac_n "(cached) $ac_c" 1>&6
14348 else
14349   
14350         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14351                 ol_cv_ndbm=no
14352         else
14353                 ol_cv_ndbm=yes
14354         fi
14355
14356 fi
14357
14358 echo "$ac_t""$ol_cv_ndbm" 1>&6
14359  if test $ol_cv_ndbm = yes ; then
14360         cat >> confdefs.h <<\EOF
14361 #define HAVE_NDBM 1
14362 EOF
14363
14364  fi
14365
14366
14367         if test $ol_cv_ndbm = yes ; then
14368                 ol_link_ldbm=ndbm
14369                 ol_with_ldbm_api=ndbm
14370
14371                 if test $ol_cv_lib_ndbm != yes ; then
14372                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14373                 fi
14374         fi
14375 fi
14376
14377 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14378         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14379         if test $ol_enable_ldbm = yes ; then
14380                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14381         fi
14382
14383         echo "configure: warning: disabling LDBM" 1>&2
14384         ol_enable_ldbm=no
14385 fi
14386
14387 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14388         LINK_BINS_DYNAMIC="yes"
14389 else
14390         LINK_BINS_DYNAMIC="no"
14391 fi
14392
14393 if test $ol_enable_wrappers != no ; then
14394         for ac_hdr in tcpd.h
14395 do
14396 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14397 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14398 echo "configure:14399: checking for $ac_hdr" >&5
14399 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14400   echo $ac_n "(cached) $ac_c" 1>&6
14401 else
14402   cat > conftest.$ac_ext <<EOF
14403 #line 14404 "configure"
14404 #include "confdefs.h"
14405 #include <$ac_hdr>
14406 EOF
14407 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14408 { (eval echo configure:14409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14409 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14410 if test -z "$ac_err"; then
14411   rm -rf conftest*
14412   eval "ac_cv_header_$ac_safe=yes"
14413 else
14414   echo "$ac_err" >&5
14415   echo "configure: failed program was:" >&5
14416   cat conftest.$ac_ext >&5
14417   rm -rf conftest*
14418   eval "ac_cv_header_$ac_safe=no"
14419 fi
14420 rm -f conftest*
14421 fi
14422 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14423   echo "$ac_t""yes" 1>&6
14424     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14425   cat >> confdefs.h <<EOF
14426 #define $ac_tr_hdr 1
14427 EOF
14428  
14429 else
14430   echo "$ac_t""no" 1>&6
14431 fi
14432 done
14433
14434
14435         if test $ac_cv_header_tcpd_h != yes ; then
14436                 have_wrappers=no
14437         else
14438                 cat > conftest.$ac_ext <<EOF
14439 #line 14440 "configure"
14440 #include "confdefs.h"
14441
14442 int allow_severity = 0;
14443 int deny_severity  = 0;
14444                 
14445 int main() {
14446 hosts_access()
14447 ; return 0; }
14448 EOF
14449 if { (eval echo configure:14450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14450   rm -rf conftest*
14451   have_wrappers=yes
14452 else
14453   echo "configure: failed program was:" >&5
14454   cat conftest.$ac_ext >&5
14455   rm -rf conftest*
14456   have_wrappers=no
14457 fi
14458 rm -f conftest*
14459         fi
14460
14461         if test $have_wrappers = yes ; then
14462                 cat >> confdefs.h <<\EOF
14463 #define HAVE_TCPD 1
14464 EOF
14465
14466                 WRAP_LIBS="-lwrap"
14467
14468                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14469 echo "configure:14470: checking for main in -lnsl" >&5
14470 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14471 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14472   echo $ac_n "(cached) $ac_c" 1>&6
14473 else
14474   ac_save_LIBS="$LIBS"
14475 LIBS="-lnsl  $LIBS"
14476 cat > conftest.$ac_ext <<EOF
14477 #line 14478 "configure"
14478 #include "confdefs.h"
14479
14480 int main() {
14481 main()
14482 ; return 0; }
14483 EOF
14484 if { (eval echo configure:14485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14485   rm -rf conftest*
14486   eval "ac_cv_lib_$ac_lib_var=yes"
14487 else
14488   echo "configure: failed program was:" >&5
14489   cat conftest.$ac_ext >&5
14490   rm -rf conftest*
14491   eval "ac_cv_lib_$ac_lib_var=no"
14492 fi
14493 rm -f conftest*
14494 LIBS="$ac_save_LIBS"
14495
14496 fi
14497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14498   echo "$ac_t""yes" 1>&6
14499     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14500     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14501   cat >> confdefs.h <<EOF
14502 #define $ac_tr_lib 1
14503 EOF
14504
14505   LIBS="-lnsl $LIBS"
14506
14507 else
14508   echo "$ac_t""no" 1>&6
14509 fi
14510
14511         else
14512                 echo "configure: warning: could not find -lwrap" 1>&2
14513                 if test $ol_enable_wrappers = yes ; then
14514                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14515                 fi
14516
14517                 echo "configure: warning: disabling wrappers support" 1>&2
14518                 ol_enable_wrappers=no
14519                 WRAP_LIBS=""
14520         fi
14521 fi
14522
14523 if test $ol_enable_syslog != no ; then
14524         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14525 echo "configure:14526: checking for openlog" >&5
14526 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14527   echo $ac_n "(cached) $ac_c" 1>&6
14528 else
14529   cat > conftest.$ac_ext <<EOF
14530 #line 14531 "configure"
14531 #include "confdefs.h"
14532 /* System header to define __stub macros and hopefully few prototypes,
14533     which can conflict with char openlog(); below.  */
14534 #include <assert.h>
14535 /* Override any gcc2 internal prototype to avoid an error.  */
14536 /* We use char because int might match the return type of a gcc2
14537     builtin and then its argument prototype would still apply.  */
14538 char openlog();
14539 char (*f)();
14540
14541 int main() {
14542
14543 /* The GNU C library defines this for functions which it implements
14544     to always fail with ENOSYS.  Some functions are actually named
14545     something starting with __ and the normal name is an alias.  */
14546 #if defined (__stub_openlog) || defined (__stub___openlog)
14547 choke me
14548 #else
14549 f = openlog;
14550 #endif
14551
14552 ; return 0; }
14553 EOF
14554 if { (eval echo configure:14555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14555   rm -rf conftest*
14556   eval "ac_cv_func_openlog=yes"
14557 else
14558   echo "configure: failed program was:" >&5
14559   cat conftest.$ac_ext >&5
14560   rm -rf conftest*
14561   eval "ac_cv_func_openlog=no"
14562 fi
14563 rm -f conftest*
14564 fi
14565
14566 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14567   echo "$ac_t""yes" 1>&6
14568   :
14569 else
14570   echo "$ac_t""no" 1>&6
14571 fi
14572
14573         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14574                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14575         fi
14576         ol_enable_syslog=$ac_cv_func_openlog
14577 fi
14578
14579
14580 ol_link_sql=no
14581 if test $ol_enable_sql != no ; then
14582         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14583 echo "configure:14584: checking for SQLDriverConnect in -liodbc" >&5
14584 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14585 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14586   echo $ac_n "(cached) $ac_c" 1>&6
14587 else
14588   ac_save_LIBS="$LIBS"
14589 LIBS="-liodbc  $LIBS"
14590 cat > conftest.$ac_ext <<EOF
14591 #line 14592 "configure"
14592 #include "confdefs.h"
14593 /* Override any gcc2 internal prototype to avoid an error.  */
14594 /* We use char because int might match the return type of a gcc2
14595     builtin and then its argument prototype would still apply.  */
14596 char SQLDriverConnect();
14597
14598 int main() {
14599 SQLDriverConnect()
14600 ; return 0; }
14601 EOF
14602 if { (eval echo configure:14603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14603   rm -rf conftest*
14604   eval "ac_cv_lib_$ac_lib_var=yes"
14605 else
14606   echo "configure: failed program was:" >&5
14607   cat conftest.$ac_ext >&5
14608   rm -rf conftest*
14609   eval "ac_cv_lib_$ac_lib_var=no"
14610 fi
14611 rm -f conftest*
14612 LIBS="$ac_save_LIBS"
14613
14614 fi
14615 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14616   echo "$ac_t""yes" 1>&6
14617   have_iodbc=yes
14618 else
14619   echo "$ac_t""no" 1>&6
14620 have_iodbc=no
14621 fi
14622
14623         if test $have_iodbc = yes ; then
14624                 ol_link_sql="-liodbc"
14625         else
14626                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14627 echo "configure:14628: checking for SQLDriverConnect in -lodbc" >&5
14628 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14629 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14630   echo $ac_n "(cached) $ac_c" 1>&6
14631 else
14632   ac_save_LIBS="$LIBS"
14633 LIBS="-lodbc  $LIBS"
14634 cat > conftest.$ac_ext <<EOF
14635 #line 14636 "configure"
14636 #include "confdefs.h"
14637 /* Override any gcc2 internal prototype to avoid an error.  */
14638 /* We use char because int might match the return type of a gcc2
14639     builtin and then its argument prototype would still apply.  */
14640 char SQLDriverConnect();
14641
14642 int main() {
14643 SQLDriverConnect()
14644 ; return 0; }
14645 EOF
14646 if { (eval echo configure:14647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14647   rm -rf conftest*
14648   eval "ac_cv_lib_$ac_lib_var=yes"
14649 else
14650   echo "configure: failed program was:" >&5
14651   cat conftest.$ac_ext >&5
14652   rm -rf conftest*
14653   eval "ac_cv_lib_$ac_lib_var=no"
14654 fi
14655 rm -f conftest*
14656 LIBS="$ac_save_LIBS"
14657
14658 fi
14659 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14660   echo "$ac_t""yes" 1>&6
14661   have_odbc=yes
14662 else
14663   echo "$ac_t""no" 1>&6
14664 have_odbc=no
14665 fi
14666
14667                 if test $have_odbc = yes ; then
14668                         ol_link_sql="-lodbc"
14669                 fi
14670         fi
14671
14672         if test $ol_link_sql != no ; then
14673                 SLAPD_SQL_LIBS="$ol_link_sql"
14674
14675         elif test $ol_enable_sql != auto ; then
14676                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14677         fi
14678 fi
14679
14680 if test $ol_enable_tcl != no ; then
14681         for ac_hdr in tcl.h
14682 do
14683 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14684 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14685 echo "configure:14686: checking for $ac_hdr" >&5
14686 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14687   echo $ac_n "(cached) $ac_c" 1>&6
14688 else
14689   cat > conftest.$ac_ext <<EOF
14690 #line 14691 "configure"
14691 #include "confdefs.h"
14692 #include <$ac_hdr>
14693 EOF
14694 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14695 { (eval echo configure:14696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14696 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14697 if test -z "$ac_err"; then
14698   rm -rf conftest*
14699   eval "ac_cv_header_$ac_safe=yes"
14700 else
14701   echo "$ac_err" >&5
14702   echo "configure: failed program was:" >&5
14703   cat conftest.$ac_ext >&5
14704   rm -rf conftest*
14705   eval "ac_cv_header_$ac_safe=no"
14706 fi
14707 rm -f conftest*
14708 fi
14709 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14710   echo "$ac_t""yes" 1>&6
14711     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14712   cat >> confdefs.h <<EOF
14713 #define $ac_tr_hdr 1
14714 EOF
14715  
14716 else
14717   echo "$ac_t""no" 1>&6
14718 fi
14719 done
14720
14721
14722         if test $ac_cv_header_tcl_h != yes ; then
14723                 have_tcl=no
14724         else
14725                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14726                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14727 echo "configure:14728: checking for main in -l$lib" >&5
14728 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
14729 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14730   echo $ac_n "(cached) $ac_c" 1>&6
14731 else
14732   ac_save_LIBS="$LIBS"
14733 LIBS="-l$lib  $LIBS"
14734 cat > conftest.$ac_ext <<EOF
14735 #line 14736 "configure"
14736 #include "confdefs.h"
14737
14738 int main() {
14739 main()
14740 ; return 0; }
14741 EOF
14742 if { (eval echo configure:14743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14743   rm -rf conftest*
14744   eval "ac_cv_lib_$ac_lib_var=yes"
14745 else
14746   echo "configure: failed program was:" >&5
14747   cat conftest.$ac_ext >&5
14748   rm -rf conftest*
14749   eval "ac_cv_lib_$ac_lib_var=no"
14750 fi
14751 rm -f conftest*
14752 LIBS="$ac_save_LIBS"
14753
14754 fi
14755 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14756   echo "$ac_t""yes" 1>&6
14757   have_tcl=yes
14758                            if test x"$ol_with_tcl_module" = "xstatic" ; then
14759                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
14760                            else
14761                                MOD_TCL_LIB="-l${lib}"
14762                            fi;break
14763 else
14764   echo "$ac_t""no" 1>&6
14765 have_tcl=no
14766 fi
14767
14768                 done
14769         fi
14770
14771         if test $have_tcl != yes ; then
14772                 echo "configure: warning: could not find -ltcl" 1>&2
14773                 if test $ol_enable_tcl = yes ; then
14774                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
14775                 fi
14776
14777                 ol_enable_tcl=no
14778         fi
14779 fi
14780
14781 ol_link_termcap=no
14782 for ac_hdr in termcap.h ncurses.h
14783 do
14784 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14785 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14786 echo "configure:14787: checking for $ac_hdr" >&5
14787 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14788   echo $ac_n "(cached) $ac_c" 1>&6
14789 else
14790   cat > conftest.$ac_ext <<EOF
14791 #line 14792 "configure"
14792 #include "confdefs.h"
14793 #include <$ac_hdr>
14794 EOF
14795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14796 { (eval echo configure:14797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14797 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14798 if test -z "$ac_err"; then
14799   rm -rf conftest*
14800   eval "ac_cv_header_$ac_safe=yes"
14801 else
14802   echo "$ac_err" >&5
14803   echo "configure: failed program was:" >&5
14804   cat conftest.$ac_ext >&5
14805   rm -rf conftest*
14806   eval "ac_cv_header_$ac_safe=no"
14807 fi
14808 rm -f conftest*
14809 fi
14810 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14811   echo "$ac_t""yes" 1>&6
14812     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14813   cat >> confdefs.h <<EOF
14814 #define $ac_tr_hdr 1
14815 EOF
14816  
14817 else
14818   echo "$ac_t""no" 1>&6
14819 fi
14820 done
14821
14822
14823 if test $ol_link_termcap = no ; then
14824         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14825 echo "configure:14826: checking for tputs in -ltermcap" >&5
14826 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14827 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14828   echo $ac_n "(cached) $ac_c" 1>&6
14829 else
14830   ac_save_LIBS="$LIBS"
14831 LIBS="-ltermcap  $LIBS"
14832 cat > conftest.$ac_ext <<EOF
14833 #line 14834 "configure"
14834 #include "confdefs.h"
14835 /* Override any gcc2 internal prototype to avoid an error.  */
14836 /* We use char because int might match the return type of a gcc2
14837     builtin and then its argument prototype would still apply.  */
14838 char tputs();
14839
14840 int main() {
14841 tputs()
14842 ; return 0; }
14843 EOF
14844 if { (eval echo configure:14845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14845   rm -rf conftest*
14846   eval "ac_cv_lib_$ac_lib_var=yes"
14847 else
14848   echo "configure: failed program was:" >&5
14849   cat conftest.$ac_ext >&5
14850   rm -rf conftest*
14851   eval "ac_cv_lib_$ac_lib_var=no"
14852 fi
14853 rm -f conftest*
14854 LIBS="$ac_save_LIBS"
14855
14856 fi
14857 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14858   echo "$ac_t""yes" 1>&6
14859   have_termcap=yes
14860 else
14861   echo "$ac_t""no" 1>&6
14862 have_termcap=no
14863 fi
14864
14865         if test $have_termcap = yes ; then
14866                 cat >> confdefs.h <<\EOF
14867 #define HAVE_TERMCAP 1
14868 EOF
14869
14870                 ol_link_termcap=yes
14871                 TERMCAP_LIBS=-ltermcap
14872         fi
14873 fi
14874
14875 if test $ol_link_termcap = no ; then
14876         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14877 echo "configure:14878: checking for initscr in -lncurses" >&5
14878 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14879 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14880   echo $ac_n "(cached) $ac_c" 1>&6
14881 else
14882   ac_save_LIBS="$LIBS"
14883 LIBS="-lncurses  $LIBS"
14884 cat > conftest.$ac_ext <<EOF
14885 #line 14886 "configure"
14886 #include "confdefs.h"
14887 /* Override any gcc2 internal prototype to avoid an error.  */
14888 /* We use char because int might match the return type of a gcc2
14889     builtin and then its argument prototype would still apply.  */
14890 char initscr();
14891
14892 int main() {
14893 initscr()
14894 ; return 0; }
14895 EOF
14896 if { (eval echo configure:14897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14897   rm -rf conftest*
14898   eval "ac_cv_lib_$ac_lib_var=yes"
14899 else
14900   echo "configure: failed program was:" >&5
14901   cat conftest.$ac_ext >&5
14902   rm -rf conftest*
14903   eval "ac_cv_lib_$ac_lib_var=no"
14904 fi
14905 rm -f conftest*
14906 LIBS="$ac_save_LIBS"
14907
14908 fi
14909 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14910   echo "$ac_t""yes" 1>&6
14911   have_ncurses=yes
14912 else
14913   echo "$ac_t""no" 1>&6
14914 have_ncurses=no
14915 fi
14916
14917         if test $have_ncurses = yes ; then
14918                 cat >> confdefs.h <<\EOF
14919 #define HAVE_NCURSES 1
14920 EOF
14921
14922                 ol_link_termcap=yes
14923                 TERMCAP_LIBS=-lncurses
14924         fi
14925 fi
14926
14927 if test $ol_link_termcap = no ; then
14928         cat >> confdefs.h <<\EOF
14929 #define NO_TERMCAP 1
14930 EOF
14931
14932         TERMCAP_LIBS=
14933 fi
14934
14935 ol_link_sasl=no
14936 ol_link_spasswd=no
14937 if test $ol_with_cyrus_sasl != no ; then
14938         for ac_hdr in sasl.h
14939 do
14940 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14941 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14942 echo "configure:14943: checking for $ac_hdr" >&5
14943 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14944   echo $ac_n "(cached) $ac_c" 1>&6
14945 else
14946   cat > conftest.$ac_ext <<EOF
14947 #line 14948 "configure"
14948 #include "confdefs.h"
14949 #include <$ac_hdr>
14950 EOF
14951 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14952 { (eval echo configure:14953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14953 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14954 if test -z "$ac_err"; then
14955   rm -rf conftest*
14956   eval "ac_cv_header_$ac_safe=yes"
14957 else
14958   echo "$ac_err" >&5
14959   echo "configure: failed program was:" >&5
14960   cat conftest.$ac_ext >&5
14961   rm -rf conftest*
14962   eval "ac_cv_header_$ac_safe=no"
14963 fi
14964 rm -f conftest*
14965 fi
14966 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14967   echo "$ac_t""yes" 1>&6
14968     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14969   cat >> confdefs.h <<EOF
14970 #define $ac_tr_hdr 1
14971 EOF
14972  
14973 else
14974   echo "$ac_t""no" 1>&6
14975 fi
14976 done
14977
14978
14979         if test $ac_cv_header_sasl_h = yes ; then
14980                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14981 echo "configure:14982: checking for sasl_client_init in -lsasl" >&5
14982 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14983 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14984   echo $ac_n "(cached) $ac_c" 1>&6
14985 else
14986   ac_save_LIBS="$LIBS"
14987 LIBS="-lsasl  $LIBS"
14988 cat > conftest.$ac_ext <<EOF
14989 #line 14990 "configure"
14990 #include "confdefs.h"
14991 /* Override any gcc2 internal prototype to avoid an error.  */
14992 /* We use char because int might match the return type of a gcc2
14993     builtin and then its argument prototype would still apply.  */
14994 char sasl_client_init();
14995
14996 int main() {
14997 sasl_client_init()
14998 ; return 0; }
14999 EOF
15000 if { (eval echo configure:15001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15001   rm -rf conftest*
15002   eval "ac_cv_lib_$ac_lib_var=yes"
15003 else
15004   echo "configure: failed program was:" >&5
15005   cat conftest.$ac_ext >&5
15006   rm -rf conftest*
15007   eval "ac_cv_lib_$ac_lib_var=no"
15008 fi
15009 rm -f conftest*
15010 LIBS="$ac_save_LIBS"
15011
15012 fi
15013 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15014   echo "$ac_t""yes" 1>&6
15015   have_cyrus_sasl=yes
15016 else
15017   echo "$ac_t""no" 1>&6
15018 have_cyrus_sasl=no
15019 fi
15020
15021
15022                 if test $have_cyrus_sasl != no ; then
15023                         SASL_LIBS="-lsasl"
15024                         cat >> confdefs.h <<\EOF
15025 #define HAVE_CYRUS_SASL 1
15026 EOF
15027
15028                         ol_link_sasl=yes
15029                 fi
15030         fi
15031
15032         if test $ol_link_sasl = no ; then
15033                 if test $ol_with_cyrus_sasl != auto ; then
15034                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
15035                 else
15036                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
15037                         echo "configure: warning: SASL authentication not supported!" 1>&2
15038                         if test $ol_link_tls = no ; then
15039                                 echo "configure: warning: Strong authentication not supported!" 1>&2
15040                         fi
15041                 fi
15042
15043         elif test $ol_enable_spasswd != no ; then
15044                 ol_link_spasswd=yes
15045         fi
15046
15047 else
15048         echo "configure: warning: SASL authentication not supported!" 1>&2
15049         if test $ol_link_tls = no ; then
15050                 echo "configure: warning: Strong authentication not supported!" 1>&2
15051         fi
15052 fi
15053
15054 if test $cross_compiling != yes ; then
15055         dev=no
15056         if test -r /dev/urandom ; then
15057                 dev="/dev/urandom";
15058         elif test -r /idev/urandom ; then
15059                 dev="/idev/urandom";
15060         elif test -r /dev/srandom ; then
15061                 dev="/dev/srandom";
15062         elif test -r /dev/random ; then
15063                 dev="/dev/random";
15064         elif test -r /idev/random ; then
15065                 dev="/idev/random";
15066         fi
15067
15068         if test $dev != no ; then
15069                 cat >> confdefs.h <<EOF
15070 #define URANDOM_DEVICE "$dev"
15071 EOF
15072
15073         fi
15074 fi
15075
15076 ol_link_fetch=no
15077 if test $ol_with_fetch != no ; then
15078         ol_LIBS=$LIBS
15079 LIBS="-lfetch -lcom_err $LIBS"
15080 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
15081 echo "configure:15082: checking fetch(3) library" >&5
15082 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15083   echo $ac_n "(cached) $ac_c" 1>&6
15084 else
15085   
15086         cat > conftest.$ac_ext <<EOF
15087 #line 15088 "configure"
15088 #include "confdefs.h"
15089
15090 #include <sys/param.h>
15091 #include <stdio.h>
15092 #include <fetch.h>
15093 int main() {
15094 struct url *u = fetchParseURL("file:///"); 
15095 ; return 0; }
15096 EOF
15097 if { (eval echo configure:15098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15098   rm -rf conftest*
15099   ol_cv_lib_fetch=yes
15100 else
15101   echo "configure: failed program was:" >&5
15102   cat conftest.$ac_ext >&5
15103   rm -rf conftest*
15104   ol_cv_lib_fetch=no
15105 fi
15106 rm -f conftest*
15107 fi
15108
15109 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15110 LIBS=$ol_LIBS
15111 if test $ol_cv_lib_fetch != no ; then
15112         ol_link_fetch="-lfetch -lcom_err"
15113         cat >> confdefs.h <<\EOF
15114 #define HAVE_FETCH 1
15115 EOF
15116
15117 fi
15118
15119
15120         if test $ol_cv_lib_fetch != no ; then
15121                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15122                 ol_link_fetch=freebsd
15123
15124         elif test $ol_with_fetch != auto ; then
15125                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15126         fi 
15127 fi
15128
15129 ol_link_readline=no
15130 if test $ol_with_readline != no ; then
15131         for ac_hdr in readline/readline.h readline/history.h
15132 do
15133 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15134 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15135 echo "configure:15136: checking for $ac_hdr" >&5
15136 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15137   echo $ac_n "(cached) $ac_c" 1>&6
15138 else
15139   cat > conftest.$ac_ext <<EOF
15140 #line 15141 "configure"
15141 #include "confdefs.h"
15142 #include <$ac_hdr>
15143 EOF
15144 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15145 { (eval echo configure:15146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15146 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15147 if test -z "$ac_err"; then
15148   rm -rf conftest*
15149   eval "ac_cv_header_$ac_safe=yes"
15150 else
15151   echo "$ac_err" >&5
15152   echo "configure: failed program was:" >&5
15153   cat conftest.$ac_ext >&5
15154   rm -rf conftest*
15155   eval "ac_cv_header_$ac_safe=no"
15156 fi
15157 rm -f conftest*
15158 fi
15159 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15160   echo "$ac_t""yes" 1>&6
15161     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15162   cat >> confdefs.h <<EOF
15163 #define $ac_tr_hdr 1
15164 EOF
15165  
15166 else
15167   echo "$ac_t""no" 1>&6
15168 fi
15169 done
15170
15171
15172         if test $ac_cv_header_readline_readline_h = yes ; then
15173                 save_LIBS="$LIBS"
15174                 LIBS="$TERMCAP_LIBS $LIBS"
15175                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15176 echo "configure:15177: checking for readline in -lreadline" >&5
15177 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15178 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15179   echo $ac_n "(cached) $ac_c" 1>&6
15180 else
15181   ac_save_LIBS="$LIBS"
15182 LIBS="-lreadline  $LIBS"
15183 cat > conftest.$ac_ext <<EOF
15184 #line 15185 "configure"
15185 #include "confdefs.h"
15186 /* Override any gcc2 internal prototype to avoid an error.  */
15187 /* We use char because int might match the return type of a gcc2
15188     builtin and then its argument prototype would still apply.  */
15189 char readline();
15190
15191 int main() {
15192 readline()
15193 ; return 0; }
15194 EOF
15195 if { (eval echo configure:15196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15196   rm -rf conftest*
15197   eval "ac_cv_lib_$ac_lib_var=yes"
15198 else
15199   echo "configure: failed program was:" >&5
15200   cat conftest.$ac_ext >&5
15201   rm -rf conftest*
15202   eval "ac_cv_lib_$ac_lib_var=no"
15203 fi
15204 rm -f conftest*
15205 LIBS="$ac_save_LIBS"
15206
15207 fi
15208 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15209   echo "$ac_t""yes" 1>&6
15210   have_readline=yes
15211 else
15212   echo "$ac_t""no" 1>&6
15213 have_readline=no
15214 fi
15215
15216                 LIBS="$save_LIBS"
15217                         
15218                 if test $have_readline = yes ; then
15219                         ol_with_readline=found
15220                         ol_link_readline=yes
15221
15222                         READLINE_LIBS="-lreadline"
15223                 fi
15224         fi
15225 fi
15226
15227 if test $ol_link_readline = yes ; then
15228         cat >> confdefs.h <<\EOF
15229 #define HAVE_READLINE 1
15230 EOF
15231
15232 fi
15233
15234
15235 if test $ol_enable_crypt != no ; then
15236         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15237 echo "configure:15238: checking for crypt" >&5
15238 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15239   echo $ac_n "(cached) $ac_c" 1>&6
15240 else
15241   cat > conftest.$ac_ext <<EOF
15242 #line 15243 "configure"
15243 #include "confdefs.h"
15244 /* System header to define __stub macros and hopefully few prototypes,
15245     which can conflict with char crypt(); below.  */
15246 #include <assert.h>
15247 /* Override any gcc2 internal prototype to avoid an error.  */
15248 /* We use char because int might match the return type of a gcc2
15249     builtin and then its argument prototype would still apply.  */
15250 char crypt();
15251 char (*f)();
15252
15253 int main() {
15254
15255 /* The GNU C library defines this for functions which it implements
15256     to always fail with ENOSYS.  Some functions are actually named
15257     something starting with __ and the normal name is an alias.  */
15258 #if defined (__stub_crypt) || defined (__stub___crypt)
15259 choke me
15260 #else
15261 f = crypt;
15262 #endif
15263
15264 ; return 0; }
15265 EOF
15266 if { (eval echo configure:15267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15267   rm -rf conftest*
15268   eval "ac_cv_func_crypt=yes"
15269 else
15270   echo "configure: failed program was:" >&5
15271   cat conftest.$ac_ext >&5
15272   rm -rf conftest*
15273   eval "ac_cv_func_crypt=no"
15274 fi
15275 rm -f conftest*
15276 fi
15277
15278 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15279   echo "$ac_t""yes" 1>&6
15280   have_crypt=yes
15281 else
15282   echo "$ac_t""no" 1>&6
15283
15284                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15285 echo "configure:15286: checking for crypt in -lcrypt" >&5
15286 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15287 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15288   echo $ac_n "(cached) $ac_c" 1>&6
15289 else
15290   ac_save_LIBS="$LIBS"
15291 LIBS="-lcrypt  $LIBS"
15292 cat > conftest.$ac_ext <<EOF
15293 #line 15294 "configure"
15294 #include "confdefs.h"
15295 /* Override any gcc2 internal prototype to avoid an error.  */
15296 /* We use char because int might match the return type of a gcc2
15297     builtin and then its argument prototype would still apply.  */
15298 char crypt();
15299
15300 int main() {
15301 crypt()
15302 ; return 0; }
15303 EOF
15304 if { (eval echo configure:15305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15305   rm -rf conftest*
15306   eval "ac_cv_lib_$ac_lib_var=yes"
15307 else
15308   echo "configure: failed program was:" >&5
15309   cat conftest.$ac_ext >&5
15310   rm -rf conftest*
15311   eval "ac_cv_lib_$ac_lib_var=no"
15312 fi
15313 rm -f conftest*
15314 LIBS="$ac_save_LIBS"
15315
15316 fi
15317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15318   echo "$ac_t""yes" 1>&6
15319   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15320                         have_crypt=yes
15321 else
15322   echo "$ac_t""no" 1>&6
15323 have_crypt=no
15324 fi
15325
15326 fi
15327
15328
15329         if test $have_crypt = yes ; then
15330                 cat >> confdefs.h <<\EOF
15331 #define HAVE_CRYPT 1
15332 EOF
15333
15334         else
15335                 echo "configure: warning: could not find crypt" 1>&2
15336                 if test $ol_enable_crypt = yes ; then
15337                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15338                 fi
15339
15340                 echo "configure: warning: disabling crypt support" 1>&2
15341                 ol_enable_crypt=no
15342         fi
15343 fi
15344
15345 if test $ol_enable_proctitle != no ; then
15346         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15347 echo "configure:15348: checking for setproctitle" >&5
15348 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15349   echo $ac_n "(cached) $ac_c" 1>&6
15350 else
15351   cat > conftest.$ac_ext <<EOF
15352 #line 15353 "configure"
15353 #include "confdefs.h"
15354 /* System header to define __stub macros and hopefully few prototypes,
15355     which can conflict with char setproctitle(); below.  */
15356 #include <assert.h>
15357 /* Override any gcc2 internal prototype to avoid an error.  */
15358 /* We use char because int might match the return type of a gcc2
15359     builtin and then its argument prototype would still apply.  */
15360 char setproctitle();
15361 char (*f)();
15362
15363 int main() {
15364
15365 /* The GNU C library defines this for functions which it implements
15366     to always fail with ENOSYS.  Some functions are actually named
15367     something starting with __ and the normal name is an alias.  */
15368 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15369 choke me
15370 #else
15371 f = setproctitle;
15372 #endif
15373
15374 ; return 0; }
15375 EOF
15376 if { (eval echo configure:15377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15377   rm -rf conftest*
15378   eval "ac_cv_func_setproctitle=yes"
15379 else
15380   echo "configure: failed program was:" >&5
15381   cat conftest.$ac_ext >&5
15382   rm -rf conftest*
15383   eval "ac_cv_func_setproctitle=no"
15384 fi
15385 rm -f conftest*
15386 fi
15387
15388 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15389   echo "$ac_t""yes" 1>&6
15390   have_setproctitle=yes
15391 else
15392   echo "$ac_t""no" 1>&6
15393
15394                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15395 echo "configure:15396: checking for setproctitle in -lutil" >&5
15396 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15397 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15398   echo $ac_n "(cached) $ac_c" 1>&6
15399 else
15400   ac_save_LIBS="$LIBS"
15401 LIBS="-lutil  $LIBS"
15402 cat > conftest.$ac_ext <<EOF
15403 #line 15404 "configure"
15404 #include "confdefs.h"
15405 /* Override any gcc2 internal prototype to avoid an error.  */
15406 /* We use char because int might match the return type of a gcc2
15407     builtin and then its argument prototype would still apply.  */
15408 char setproctitle();
15409
15410 int main() {
15411 setproctitle()
15412 ; return 0; }
15413 EOF
15414 if { (eval echo configure:15415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15415   rm -rf conftest*
15416   eval "ac_cv_lib_$ac_lib_var=yes"
15417 else
15418   echo "configure: failed program was:" >&5
15419   cat conftest.$ac_ext >&5
15420   rm -rf conftest*
15421   eval "ac_cv_lib_$ac_lib_var=no"
15422 fi
15423 rm -f conftest*
15424 LIBS="$ac_save_LIBS"
15425
15426 fi
15427 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15428   echo "$ac_t""yes" 1>&6
15429   have_setproctitle=yes
15430                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15431 else
15432   echo "$ac_t""no" 1>&6
15433 have_setproctitle=no
15434                         LIBOBJS="$LIBOBJS setproctitle.o"
15435                         LIBSRCS="$LIBSRCS setproctitle.c"
15436 fi
15437
15438 fi
15439
15440
15441         if test $have_setproctitle = yes ; then
15442                 cat >> confdefs.h <<\EOF
15443 #define HAVE_SETPROCTITLE 1
15444 EOF
15445
15446         fi
15447 fi
15448
15449 if test $ol_enable_slp != no ; then
15450         for ac_hdr in slp.h 
15451 do
15452 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15453 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15454 echo "configure:15455: checking for $ac_hdr" >&5
15455 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15456   echo $ac_n "(cached) $ac_c" 1>&6
15457 else
15458   cat > conftest.$ac_ext <<EOF
15459 #line 15460 "configure"
15460 #include "confdefs.h"
15461 #include <$ac_hdr>
15462 EOF
15463 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15464 { (eval echo configure:15465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15465 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15466 if test -z "$ac_err"; then
15467   rm -rf conftest*
15468   eval "ac_cv_header_$ac_safe=yes"
15469 else
15470   echo "$ac_err" >&5
15471   echo "configure: failed program was:" >&5
15472   cat conftest.$ac_ext >&5
15473   rm -rf conftest*
15474   eval "ac_cv_header_$ac_safe=no"
15475 fi
15476 rm -f conftest*
15477 fi
15478 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15479   echo "$ac_t""yes" 1>&6
15480     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15481   cat >> confdefs.h <<EOF
15482 #define $ac_tr_hdr 1
15483 EOF
15484  
15485 else
15486   echo "$ac_t""no" 1>&6
15487 fi
15488 done
15489
15490
15491         if test $ac_cv_header_slp_h = yes ; then
15492                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15493 echo "configure:15494: checking for SLPOpen in -lslp" >&5
15494 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15495 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15496   echo $ac_n "(cached) $ac_c" 1>&6
15497 else
15498   ac_save_LIBS="$LIBS"
15499 LIBS="-lslp  $LIBS"
15500 cat > conftest.$ac_ext <<EOF
15501 #line 15502 "configure"
15502 #include "confdefs.h"
15503 /* Override any gcc2 internal prototype to avoid an error.  */
15504 /* We use char because int might match the return type of a gcc2
15505     builtin and then its argument prototype would still apply.  */
15506 char SLPOpen();
15507
15508 int main() {
15509 SLPOpen()
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_lib_$ac_lib_var=yes"
15515 else
15516   echo "configure: failed program was:" >&5
15517   cat conftest.$ac_ext >&5
15518   rm -rf conftest*
15519   eval "ac_cv_lib_$ac_lib_var=no"
15520 fi
15521 rm -f conftest*
15522 LIBS="$ac_save_LIBS"
15523
15524 fi
15525 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15526   echo "$ac_t""yes" 1>&6
15527   have_slp=yes
15528 else
15529   echo "$ac_t""no" 1>&6
15530 have_slp=no
15531 fi
15532
15533                 if test $have_slp = yes ; then
15534                         cat >> confdefs.h <<\EOF
15535 #define HAVE_SLP 1
15536 EOF
15537
15538                         SLAPD_SLP_LIBS=-lslp
15539                 fi
15540
15541         elif test $ol_enable_slp = yes ; then
15542                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15543         fi
15544 fi
15545
15546 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15547 echo "configure:15548: checking for ANSI C header files" >&5
15548 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15549   echo $ac_n "(cached) $ac_c" 1>&6
15550 else
15551   cat > conftest.$ac_ext <<EOF
15552 #line 15553 "configure"
15553 #include "confdefs.h"
15554 #include <stdlib.h>
15555 #include <stdarg.h>
15556 #include <string.h>
15557 #include <float.h>
15558 EOF
15559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15560 { (eval echo configure:15561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15562 if test -z "$ac_err"; then
15563   rm -rf conftest*
15564   ac_cv_header_stdc=yes
15565 else
15566   echo "$ac_err" >&5
15567   echo "configure: failed program was:" >&5
15568   cat conftest.$ac_ext >&5
15569   rm -rf conftest*
15570   ac_cv_header_stdc=no
15571 fi
15572 rm -f conftest*
15573
15574 if test $ac_cv_header_stdc = yes; then
15575   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15576 cat > conftest.$ac_ext <<EOF
15577 #line 15578 "configure"
15578 #include "confdefs.h"
15579 #include <string.h>
15580 EOF
15581 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15582   egrep "memchr" >/dev/null 2>&1; then
15583   :
15584 else
15585   rm -rf conftest*
15586   ac_cv_header_stdc=no
15587 fi
15588 rm -f conftest*
15589
15590 fi
15591
15592 if test $ac_cv_header_stdc = yes; then
15593   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15594 cat > conftest.$ac_ext <<EOF
15595 #line 15596 "configure"
15596 #include "confdefs.h"
15597 #include <stdlib.h>
15598 EOF
15599 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15600   egrep "free" >/dev/null 2>&1; then
15601   :
15602 else
15603   rm -rf conftest*
15604   ac_cv_header_stdc=no
15605 fi
15606 rm -f conftest*
15607
15608 fi
15609
15610 if test $ac_cv_header_stdc = yes; then
15611   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15612 if test "$cross_compiling" = yes; then
15613   :
15614 else
15615   cat > conftest.$ac_ext <<EOF
15616 #line 15617 "configure"
15617 #include "confdefs.h"
15618 #include <ctype.h>
15619 #if ((' ' & 0x0FF) == 0x020)
15620 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15621 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15622 #else
15623 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15624  || ('j' <= (c) && (c) <= 'r') \
15625  || ('s' <= (c) && (c) <= 'z'))
15626 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15627 #endif
15628 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15629 int main () { int i; for (i = 0; i < 256; i++)
15630 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15631 exit (0); }
15632
15633 EOF
15634 if { (eval echo configure:15635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15635 then
15636   :
15637 else
15638   echo "configure: failed program was:" >&5
15639   cat conftest.$ac_ext >&5
15640   rm -fr conftest*
15641   ac_cv_header_stdc=no
15642 fi
15643 rm -fr conftest*
15644 fi
15645
15646 fi
15647 fi
15648
15649 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15650 if test $ac_cv_header_stdc = yes; then
15651   cat >> confdefs.h <<\EOF
15652 #define STDC_HEADERS 1
15653 EOF
15654
15655 fi
15656
15657 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15658 echo "configure:15659: checking for mode_t" >&5
15659 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15660   echo $ac_n "(cached) $ac_c" 1>&6
15661 else
15662   cat > conftest.$ac_ext <<EOF
15663 #line 15664 "configure"
15664 #include "confdefs.h"
15665 #include <sys/types.h>
15666 #if STDC_HEADERS
15667 #include <stdlib.h>
15668 #include <stddef.h>
15669 #endif
15670
15671 EOF
15672 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15673   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15674   rm -rf conftest*
15675   eval "ac_cv_type_mode_t=yes"
15676 else
15677   rm -rf conftest*
15678   eval "ac_cv_type_mode_t=no"
15679 fi
15680 rm -f conftest*
15681
15682 fi
15683 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15684   echo "$ac_t""yes" 1>&6
15685 else
15686   echo "$ac_t""no" 1>&6
15687   cat >> confdefs.h <<EOF
15688 #define mode_t int
15689 EOF
15690
15691 fi
15692
15693 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15694 echo "configure:15695: checking for off_t" >&5
15695 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15696   echo $ac_n "(cached) $ac_c" 1>&6
15697 else
15698   cat > conftest.$ac_ext <<EOF
15699 #line 15700 "configure"
15700 #include "confdefs.h"
15701 #include <sys/types.h>
15702 #if STDC_HEADERS
15703 #include <stdlib.h>
15704 #include <stddef.h>
15705 #endif
15706
15707 EOF
15708 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15709   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15710   rm -rf conftest*
15711   eval "ac_cv_type_off_t=yes"
15712 else
15713   rm -rf conftest*
15714   eval "ac_cv_type_off_t=no"
15715 fi
15716 rm -f conftest*
15717
15718 fi
15719 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15720   echo "$ac_t""yes" 1>&6
15721 else
15722   echo "$ac_t""no" 1>&6
15723   cat >> confdefs.h <<EOF
15724 #define off_t long
15725 EOF
15726
15727 fi
15728
15729 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15730 echo "configure:15731: checking for pid_t" >&5
15731 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15732   echo $ac_n "(cached) $ac_c" 1>&6
15733 else
15734   cat > conftest.$ac_ext <<EOF
15735 #line 15736 "configure"
15736 #include "confdefs.h"
15737 #include <sys/types.h>
15738 #if STDC_HEADERS
15739 #include <stdlib.h>
15740 #include <stddef.h>
15741 #endif
15742
15743 EOF
15744 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15745   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15746   rm -rf conftest*
15747   eval "ac_cv_type_pid_t=yes"
15748 else
15749   rm -rf conftest*
15750   eval "ac_cv_type_pid_t=no"
15751 fi
15752 rm -f conftest*
15753
15754 fi
15755 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15756   echo "$ac_t""yes" 1>&6
15757 else
15758   echo "$ac_t""no" 1>&6
15759   cat >> confdefs.h <<EOF
15760 #define pid_t int
15761 EOF
15762
15763 fi
15764
15765 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15766 echo "configure:15767: checking for ptrdiff_t" >&5
15767 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15768   echo $ac_n "(cached) $ac_c" 1>&6
15769 else
15770   cat > conftest.$ac_ext <<EOF
15771 #line 15772 "configure"
15772 #include "confdefs.h"
15773 #include <stddef.h>
15774 int main() {
15775 ptrdiff_t p
15776 ; return 0; }
15777 EOF
15778 if { (eval echo configure:15779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15779   rm -rf conftest*
15780   am_cv_type_ptrdiff_t=yes
15781 else
15782   echo "configure: failed program was:" >&5
15783   cat conftest.$ac_ext >&5
15784   rm -rf conftest*
15785   am_cv_type_ptrdiff_t=no
15786 fi
15787 rm -f conftest*
15788 fi
15789
15790 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15791    if test $am_cv_type_ptrdiff_t = yes; then
15792      cat >> confdefs.h <<\EOF
15793 #define HAVE_PTRDIFF_T 1
15794 EOF
15795
15796    fi
15797
15798 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15799 echo "configure:15800: checking return type of signal handlers" >&5
15800 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15801   echo $ac_n "(cached) $ac_c" 1>&6
15802 else
15803   cat > conftest.$ac_ext <<EOF
15804 #line 15805 "configure"
15805 #include "confdefs.h"
15806 #include <sys/types.h>
15807 #include <signal.h>
15808 #ifdef signal
15809 #undef signal
15810 #endif
15811 #ifdef __cplusplus
15812 extern "C" void (*signal (int, void (*)(int)))(int);
15813 #else
15814 void (*signal ()) ();
15815 #endif
15816
15817 int main() {
15818 int i;
15819 ; return 0; }
15820 EOF
15821 if { (eval echo configure:15822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15822   rm -rf conftest*
15823   ac_cv_type_signal=void
15824 else
15825   echo "configure: failed program was:" >&5
15826   cat conftest.$ac_ext >&5
15827   rm -rf conftest*
15828   ac_cv_type_signal=int
15829 fi
15830 rm -f conftest*
15831 fi
15832
15833 echo "$ac_t""$ac_cv_type_signal" 1>&6
15834 cat >> confdefs.h <<EOF
15835 #define RETSIGTYPE $ac_cv_type_signal
15836 EOF
15837
15838
15839 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15840 echo "configure:15841: checking for size_t" >&5
15841 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15842   echo $ac_n "(cached) $ac_c" 1>&6
15843 else
15844   cat > conftest.$ac_ext <<EOF
15845 #line 15846 "configure"
15846 #include "confdefs.h"
15847 #include <sys/types.h>
15848 #if STDC_HEADERS
15849 #include <stdlib.h>
15850 #include <stddef.h>
15851 #endif
15852
15853 EOF
15854 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15855   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15856   rm -rf conftest*
15857   eval "ac_cv_type_size_t=yes"
15858 else
15859   rm -rf conftest*
15860   eval "ac_cv_type_size_t=no"
15861 fi
15862 rm -f conftest*
15863
15864 fi
15865 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15866   echo "$ac_t""yes" 1>&6
15867 else
15868   echo "$ac_t""no" 1>&6
15869   cat >> confdefs.h <<EOF
15870 #define size_t unsigned
15871 EOF
15872
15873 fi
15874
15875
15876 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15877 echo "configure:15878: checking for ssize_t" >&5
15878 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15879   echo $ac_n "(cached) $ac_c" 1>&6
15880 else
15881   cat > conftest.$ac_ext <<EOF
15882 #line 15883 "configure"
15883 #include "confdefs.h"
15884 #include <sys/types.h>
15885 #if STDC_HEADERS
15886 #include <stdlib.h>
15887 #include <stddef.h>
15888 #endif
15889
15890 EOF
15891 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15892   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15893   rm -rf conftest*
15894   eval "ac_cv_type_ssize_t=yes"
15895 else
15896   rm -rf conftest*
15897   eval "ac_cv_type_ssize_t=no"
15898 fi
15899 rm -f conftest*
15900
15901 fi
15902 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15903   echo "$ac_t""yes" 1>&6
15904 else
15905   echo "$ac_t""no" 1>&6
15906   cat >> confdefs.h <<EOF
15907 #define ssize_t signed int
15908 EOF
15909
15910 fi
15911
15912 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15913 echo "configure:15914: checking for caddr_t" >&5
15914 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15915   echo $ac_n "(cached) $ac_c" 1>&6
15916 else
15917   cat > conftest.$ac_ext <<EOF
15918 #line 15919 "configure"
15919 #include "confdefs.h"
15920 #include <sys/types.h>
15921 #if STDC_HEADERS
15922 #include <stdlib.h>
15923 #include <stddef.h>
15924 #endif
15925
15926 EOF
15927 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15928   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15929   rm -rf conftest*
15930   eval "ac_cv_type_caddr_t=yes"
15931 else
15932   rm -rf conftest*
15933   eval "ac_cv_type_caddr_t=no"
15934 fi
15935 rm -f conftest*
15936
15937 fi
15938 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15939   echo "$ac_t""yes" 1>&6
15940 else
15941   echo "$ac_t""no" 1>&6
15942   cat >> confdefs.h <<EOF
15943 #define caddr_t char *
15944 EOF
15945
15946 fi
15947
15948
15949 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15950 echo "configure:15951: checking for socklen_t" >&5
15951 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15952   echo $ac_n "(cached) $ac_c" 1>&6
15953 else
15954   cat > conftest.$ac_ext <<EOF
15955 #line 15956 "configure"
15956 #include "confdefs.h"
15957
15958 #ifdef HAVE_SYS_TYPES_H
15959 #include <sys/types.h>
15960 #endif
15961 #ifdef HAVE_SYS_SOCKET_H
15962 #include <sys/socket.h>
15963 #endif
15964
15965 int main() {
15966 socklen_t len;
15967 ; return 0; }
15968 EOF
15969 if { (eval echo configure:15970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15970   rm -rf conftest*
15971   ol_cv_type_socklen_t=yes
15972 else
15973   echo "configure: failed program was:" >&5
15974   cat conftest.$ac_ext >&5
15975   rm -rf conftest*
15976   ol_cv_type_socklen_t=no
15977 fi
15978 rm -f conftest*
15979 fi
15980
15981 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15982   if test $ol_cv_type_socklen_t = no; then
15983     cat >> confdefs.h <<\EOF
15984 #define socklen_t int
15985 EOF
15986
15987   fi
15988  
15989 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15990 echo "configure:15991: checking for member st_blksize in aggregate type struct stat" >&5
15991 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15992   echo $ac_n "(cached) $ac_c" 1>&6
15993 else
15994   cat > conftest.$ac_ext <<EOF
15995 #line 15996 "configure"
15996 #include "confdefs.h"
15997 #include <sys/types.h>
15998 #include <sys/stat.h>
15999 int main() {
16000 struct stat foo; foo.st_blksize;
16001 ; return 0; }
16002 EOF
16003 if { (eval echo configure:16004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16004   rm -rf conftest*
16005   ac_cv_c_struct_member_st_blksize=yes
16006 else
16007   echo "configure: failed program was:" >&5
16008   cat conftest.$ac_ext >&5
16009   rm -rf conftest*
16010   ac_cv_c_struct_member_st_blksize=no
16011 fi
16012 rm -f conftest*
16013 fi
16014
16015 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
16016 st_blksize="$ac_cv_c_struct_member_st_blksize"
16017 if test $ac_cv_c_struct_member_st_blksize = yes; then
16018   cat >> confdefs.h <<\EOF
16019 #define HAVE_ST_BLKSIZE 1
16020 EOF
16021
16022 fi
16023
16024 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
16025 echo "configure:16026: checking whether time.h and sys/time.h may both be included" >&5
16026 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
16027   echo $ac_n "(cached) $ac_c" 1>&6
16028 else
16029   cat > conftest.$ac_ext <<EOF
16030 #line 16031 "configure"
16031 #include "confdefs.h"
16032 #include <sys/types.h>
16033 #include <sys/time.h>
16034 #include <time.h>
16035 int main() {
16036 struct tm *tp;
16037 ; return 0; }
16038 EOF
16039 if { (eval echo configure:16040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16040   rm -rf conftest*
16041   ac_cv_header_time=yes
16042 else
16043   echo "configure: failed program was:" >&5
16044   cat conftest.$ac_ext >&5
16045   rm -rf conftest*
16046   ac_cv_header_time=no
16047 fi
16048 rm -f conftest*
16049 fi
16050
16051 echo "$ac_t""$ac_cv_header_time" 1>&6
16052 if test $ac_cv_header_time = yes; then
16053   cat >> confdefs.h <<\EOF
16054 #define TIME_WITH_SYS_TIME 1
16055 EOF
16056
16057 fi
16058
16059 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
16060 echo "configure:16061: checking whether struct tm is in sys/time.h or time.h" >&5
16061 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
16062   echo $ac_n "(cached) $ac_c" 1>&6
16063 else
16064   cat > conftest.$ac_ext <<EOF
16065 #line 16066 "configure"
16066 #include "confdefs.h"
16067 #include <sys/types.h>
16068 #include <time.h>
16069 int main() {
16070 struct tm *tp; tp->tm_sec;
16071 ; return 0; }
16072 EOF
16073 if { (eval echo configure:16074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16074   rm -rf conftest*
16075   ac_cv_struct_tm=time.h
16076 else
16077   echo "configure: failed program was:" >&5
16078   cat conftest.$ac_ext >&5
16079   rm -rf conftest*
16080   ac_cv_struct_tm=sys/time.h
16081 fi
16082 rm -f conftest*
16083 fi
16084
16085 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16086 if test $ac_cv_struct_tm = sys/time.h; then
16087   cat >> confdefs.h <<\EOF
16088 #define TM_IN_SYS_TIME 1
16089 EOF
16090
16091 fi
16092
16093 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16094 echo "configure:16095: checking for uid_t in sys/types.h" >&5
16095 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16096   echo $ac_n "(cached) $ac_c" 1>&6
16097 else
16098   cat > conftest.$ac_ext <<EOF
16099 #line 16100 "configure"
16100 #include "confdefs.h"
16101 #include <sys/types.h>
16102 EOF
16103 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16104   egrep "uid_t" >/dev/null 2>&1; then
16105   rm -rf conftest*
16106   ac_cv_type_uid_t=yes
16107 else
16108   rm -rf conftest*
16109   ac_cv_type_uid_t=no
16110 fi
16111 rm -f conftest*
16112
16113 fi
16114
16115 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16116 if test $ac_cv_type_uid_t = no; then
16117   cat >> confdefs.h <<\EOF
16118 #define uid_t int
16119 EOF
16120
16121   cat >> confdefs.h <<\EOF
16122 #define gid_t int
16123 EOF
16124
16125 fi
16126
16127 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16128 echo "configure:16129: checking for sig_atomic_t" >&5
16129 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16130   echo $ac_n "(cached) $ac_c" 1>&6
16131 else
16132   cat > conftest.$ac_ext <<EOF
16133 #line 16134 "configure"
16134 #include "confdefs.h"
16135 #include <signal.h>
16136 int main() {
16137 sig_atomic_t atomic;
16138 ; return 0; }
16139 EOF
16140 if { (eval echo configure:16141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16141   rm -rf conftest*
16142   ol_cv_type_sig_atomic_t=yes
16143 else
16144   echo "configure: failed program was:" >&5
16145   cat conftest.$ac_ext >&5
16146   rm -rf conftest*
16147   ol_cv_type_sig_atomic_t=no
16148 fi
16149 rm -f conftest*
16150 fi
16151
16152 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16153   if test $ol_cv_type_sig_atomic_t = no; then
16154     cat >> confdefs.h <<\EOF
16155 #define sig_atomic_t int
16156 EOF
16157
16158   fi
16159  
16160
16161
16162 # test for pw_gecos in struct passwd
16163 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16164 echo "configure:16165: checking struct passwd for pw_gecos" >&5
16165 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16166   echo $ac_n "(cached) $ac_c" 1>&6
16167 else
16168   
16169         cat > conftest.$ac_ext <<EOF
16170 #line 16171 "configure"
16171 #include "confdefs.h"
16172 #include <pwd.h>
16173 int main() {
16174
16175         struct passwd pwd;
16176         pwd.pw_gecos = pwd.pw_name;
16177
16178 ; return 0; }
16179 EOF
16180 if { (eval echo configure:16181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16181   rm -rf conftest*
16182   ol_cv_struct_passwd_pw_gecos=yes
16183 else
16184   echo "configure: failed program was:" >&5
16185   cat conftest.$ac_ext >&5
16186   rm -rf conftest*
16187   ol_cv_struct_passwd_pw_gecos=no
16188 fi
16189 rm -f conftest*
16190 fi
16191
16192 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16193 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16194         cat >> confdefs.h <<\EOF
16195 #define HAVE_PW_GECOS 1
16196 EOF
16197
16198 fi
16199
16200 # test for pw_passwd in struct passwd
16201 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16202 echo "configure:16203: checking struct passwd for pw_passwd" >&5
16203 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16204   echo $ac_n "(cached) $ac_c" 1>&6
16205 else
16206   
16207         cat > conftest.$ac_ext <<EOF
16208 #line 16209 "configure"
16209 #include "confdefs.h"
16210 #include <pwd.h>
16211 int main() {
16212
16213         struct passwd pwd;
16214         pwd.pw_passwd = pwd.pw_name;
16215
16216 ; return 0; }
16217 EOF
16218 if { (eval echo configure:16219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16219   rm -rf conftest*
16220   ol_cv_struct_passwd_pw_passwd=yes
16221 else
16222   echo "configure: failed program was:" >&5
16223   cat conftest.$ac_ext >&5
16224   rm -rf conftest*
16225   ol_cv_struct_passwd_pw_passwd=no
16226 fi
16227 rm -f conftest*
16228 fi
16229
16230 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16231 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16232         cat >> confdefs.h <<\EOF
16233 #define HAVE_PW_PASSWD 1
16234 EOF
16235
16236 fi
16237
16238
16239 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16240 echo "configure:16241: checking if toupper() requires islower()" >&5
16241 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16242   echo $ac_n "(cached) $ac_c" 1>&6
16243 else
16244   
16245         if test "$cross_compiling" = yes; then
16246   ol_cv_c_upper_lower=safe
16247 else
16248   cat > conftest.$ac_ext <<EOF
16249 #line 16250 "configure"
16250 #include "confdefs.h"
16251
16252 #include <ctype.h>
16253 main()
16254 {
16255         if ('C' == toupper('C'))
16256                 exit(0);
16257         else
16258                 exit(1);
16259 }
16260 EOF
16261 if { (eval echo configure:16262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16262 then
16263   ol_cv_c_upper_lower=no
16264 else
16265   echo "configure: failed program was:" >&5
16266   cat conftest.$ac_ext >&5
16267   rm -fr conftest*
16268   ol_cv_c_upper_lower=yes
16269 fi
16270 rm -fr conftest*
16271 fi
16272
16273 fi
16274
16275 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16276 if test $ol_cv_c_upper_lower != no ; then
16277         cat >> confdefs.h <<\EOF
16278 #define C_UPPER_LOWER 1
16279 EOF
16280
16281 fi
16282
16283 echo $ac_n "checking for working const""... $ac_c" 1>&6
16284 echo "configure:16285: checking for working const" >&5
16285 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16286   echo $ac_n "(cached) $ac_c" 1>&6
16287 else
16288   cat > conftest.$ac_ext <<EOF
16289 #line 16290 "configure"
16290 #include "confdefs.h"
16291
16292 int main() {
16293
16294 /* Ultrix mips cc rejects this.  */
16295 typedef int charset[2]; const charset x;
16296 /* SunOS 4.1.1 cc rejects this.  */
16297 char const *const *ccp;
16298 char **p;
16299 /* NEC SVR4.0.2 mips cc rejects this.  */
16300 struct point {int x, y;};
16301 static struct point const zero = {0,0};
16302 /* AIX XL C 1.02.0.0 rejects this.
16303    It does not let you subtract one const X* pointer from another in an arm
16304    of an if-expression whose if-part is not a constant expression */
16305 const char *g = "string";
16306 ccp = &g + (g ? g-g : 0);
16307 /* HPUX 7.0 cc rejects these. */
16308 ++ccp;
16309 p = (char**) ccp;
16310 ccp = (char const *const *) p;
16311 { /* SCO 3.2v4 cc rejects this.  */
16312   char *t;
16313   char const *s = 0 ? (char *) 0 : (char const *) 0;
16314
16315   *t++ = 0;
16316 }
16317 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16318   int x[] = {25, 17};
16319   const int *foo = &x[0];
16320   ++foo;
16321 }
16322 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16323   typedef const int *iptr;
16324   iptr p = 0;
16325   ++p;
16326 }
16327 { /* AIX XL C 1.02.0.0 rejects this saying
16328      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16329   struct s { int j; const int *ap[3]; };
16330   struct s *b; b->j = 5;
16331 }
16332 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16333   const int foo = 10;
16334 }
16335
16336 ; return 0; }
16337 EOF
16338 if { (eval echo configure:16339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16339   rm -rf conftest*
16340   ac_cv_c_const=yes
16341 else
16342   echo "configure: failed program was:" >&5
16343   cat conftest.$ac_ext >&5
16344   rm -rf conftest*
16345   ac_cv_c_const=no
16346 fi
16347 rm -f conftest*
16348 fi
16349
16350 echo "$ac_t""$ac_cv_c_const" 1>&6
16351 if test $ac_cv_c_const = no; then
16352   cat >> confdefs.h <<\EOF
16353 #define const 
16354 EOF
16355
16356 fi
16357
16358 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16359 echo "configure:16360: checking if compiler understands volatile" >&5
16360 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16361   echo $ac_n "(cached) $ac_c" 1>&6
16362 else
16363   cat > conftest.$ac_ext <<EOF
16364 #line 16365 "configure"
16365 #include "confdefs.h"
16366 int x, y, z;
16367 int main() {
16368 volatile int a; int * volatile b = x ? &y : &z;
16369       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16370       *b = 0;
16371 ; return 0; }
16372 EOF
16373 if { (eval echo configure:16374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16374   rm -rf conftest*
16375   ol_cv_c_volatile=yes
16376 else
16377   echo "configure: failed program was:" >&5
16378   cat conftest.$ac_ext >&5
16379   rm -rf conftest*
16380   ol_cv_c_volatile=no
16381 fi
16382 rm -f conftest*
16383 fi
16384
16385 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16386   if test $ol_cv_c_volatile = yes; then
16387     : 
16388   else
16389     cat >> confdefs.h <<\EOF
16390 #define volatile 
16391 EOF
16392
16393   fi
16394  
16395
16396 if test $cross_compiling = yes ; then
16397         cat >> confdefs.h <<\EOF
16398 #define CROSS_COMPILING 1
16399 EOF
16400
16401 else
16402         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16403 echo "configure:16404: checking whether byte ordering is bigendian" >&5
16404 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16405   echo $ac_n "(cached) $ac_c" 1>&6
16406 else
16407   ac_cv_c_bigendian=unknown
16408 # See if sys/param.h defines the BYTE_ORDER macro.
16409 cat > conftest.$ac_ext <<EOF
16410 #line 16411 "configure"
16411 #include "confdefs.h"
16412 #include <sys/types.h>
16413 #include <sys/param.h>
16414 int main() {
16415
16416 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16417  bogus endian macros
16418 #endif
16419 ; return 0; }
16420 EOF
16421 if { (eval echo configure:16422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16422   rm -rf conftest*
16423   # It does; now see whether it defined to BIG_ENDIAN or not.
16424 cat > conftest.$ac_ext <<EOF
16425 #line 16426 "configure"
16426 #include "confdefs.h"
16427 #include <sys/types.h>
16428 #include <sys/param.h>
16429 int main() {
16430
16431 #if BYTE_ORDER != BIG_ENDIAN
16432  not big endian
16433 #endif
16434 ; return 0; }
16435 EOF
16436 if { (eval echo configure:16437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16437   rm -rf conftest*
16438   ac_cv_c_bigendian=yes
16439 else
16440   echo "configure: failed program was:" >&5
16441   cat conftest.$ac_ext >&5
16442   rm -rf conftest*
16443   ac_cv_c_bigendian=no
16444 fi
16445 rm -f conftest*
16446 else
16447   echo "configure: failed program was:" >&5
16448   cat conftest.$ac_ext >&5
16449 fi
16450 rm -f conftest*
16451 if test $ac_cv_c_bigendian = unknown; then
16452 if test "$cross_compiling" = yes; then
16453     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16454 else
16455   cat > conftest.$ac_ext <<EOF
16456 #line 16457 "configure"
16457 #include "confdefs.h"
16458 main () {
16459   /* Are we little or big endian?  From Harbison&Steele.  */
16460   union
16461   {
16462     long l;
16463     char c[sizeof (long)];
16464   } u;
16465   u.l = 1;
16466   exit (u.c[sizeof (long) - 1] == 1);
16467 }
16468 EOF
16469 if { (eval echo configure:16470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16470 then
16471   ac_cv_c_bigendian=no
16472 else
16473   echo "configure: failed program was:" >&5
16474   cat conftest.$ac_ext >&5
16475   rm -fr conftest*
16476   ac_cv_c_bigendian=yes
16477 fi
16478 rm -fr conftest*
16479 fi
16480
16481 fi
16482 fi
16483
16484 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16485 if test $ac_cv_c_bigendian = yes; then
16486   cat >> confdefs.h <<\EOF
16487 #define WORDS_BIGENDIAN 1
16488 EOF
16489
16490 fi
16491
16492 fi
16493
16494 echo $ac_n "checking size of short""... $ac_c" 1>&6
16495 echo "configure:16496: checking size of short" >&5 
16496 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16497   echo $ac_n "(cached) $ac_c" 1>&6
16498 else
16499   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16500   cat > conftest.$ac_ext <<EOF
16501 #line 16502 "configure"
16502 #include "confdefs.h"
16503 #include "confdefs.h" 
16504 #include <sys/types.h> 
16505  
16506
16507 int main() {
16508 switch (0) case 0: case (sizeof (short) == $ac_size):;
16509 ; return 0; }
16510 EOF
16511 if { (eval echo configure:16512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16512   rm -rf conftest*
16513   ac_cv_sizeof_short=$ac_size
16514 else
16515   echo "configure: failed program was:" >&5
16516   cat conftest.$ac_ext >&5
16517 fi
16518 rm -f conftest* 
16519   if test x$ac_cv_sizeof_short != x ; then break; fi 
16520 done 
16521
16522 fi
16523  
16524 if test x$ac_cv_sizeof_short = x ; then 
16525   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16526 fi 
16527 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16528 cat >> confdefs.h <<EOF
16529 #define SIZEOF_SHORT $ac_cv_sizeof_short
16530 EOF
16531  
16532  
16533 echo $ac_n "checking size of int""... $ac_c" 1>&6
16534 echo "configure:16535: checking size of int" >&5 
16535 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16536   echo $ac_n "(cached) $ac_c" 1>&6
16537 else
16538   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16539   cat > conftest.$ac_ext <<EOF
16540 #line 16541 "configure"
16541 #include "confdefs.h"
16542 #include "confdefs.h" 
16543 #include <sys/types.h> 
16544  
16545
16546 int main() {
16547 switch (0) case 0: case (sizeof (int) == $ac_size):;
16548 ; return 0; }
16549 EOF
16550 if { (eval echo configure:16551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16551   rm -rf conftest*
16552   ac_cv_sizeof_int=$ac_size
16553 else
16554   echo "configure: failed program was:" >&5
16555   cat conftest.$ac_ext >&5
16556 fi
16557 rm -f conftest* 
16558   if test x$ac_cv_sizeof_int != x ; then break; fi 
16559 done 
16560
16561 fi
16562  
16563 if test x$ac_cv_sizeof_int = x ; then 
16564   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16565 fi 
16566 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16567 cat >> confdefs.h <<EOF
16568 #define SIZEOF_INT $ac_cv_sizeof_int
16569 EOF
16570  
16571  
16572 echo $ac_n "checking size of long""... $ac_c" 1>&6
16573 echo "configure:16574: checking size of long" >&5 
16574 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16575   echo $ac_n "(cached) $ac_c" 1>&6
16576 else
16577   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16578   cat > conftest.$ac_ext <<EOF
16579 #line 16580 "configure"
16580 #include "confdefs.h"
16581 #include "confdefs.h" 
16582 #include <sys/types.h> 
16583  
16584
16585 int main() {
16586 switch (0) case 0: case (sizeof (long) == $ac_size):;
16587 ; return 0; }
16588 EOF
16589 if { (eval echo configure:16590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16590   rm -rf conftest*
16591   ac_cv_sizeof_long=$ac_size
16592 else
16593   echo "configure: failed program was:" >&5
16594   cat conftest.$ac_ext >&5
16595 fi
16596 rm -f conftest* 
16597   if test x$ac_cv_sizeof_long != x ; then break; fi 
16598 done 
16599
16600 fi
16601  
16602 if test x$ac_cv_sizeof_long = x ; then 
16603   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16604 fi 
16605 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16606 cat >> confdefs.h <<EOF
16607 #define SIZEOF_LONG $ac_cv_sizeof_long
16608 EOF
16609  
16610
16611
16612 if test "$ac_cv_sizeof_int" -lt 4 ; then
16613         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16614
16615         cat >> confdefs.h <<\EOF
16616 #define LBER_INT_T long
16617 EOF
16618
16619 else
16620         cat >> confdefs.h <<\EOF
16621 #define LBER_INT_T int
16622 EOF
16623
16624 fi
16625
16626 cat >> confdefs.h <<\EOF
16627 #define LBER_LEN_T long
16628 EOF
16629
16630 cat >> confdefs.h <<\EOF
16631 #define LBER_SOCKET_T int
16632 EOF
16633
16634 cat >> confdefs.h <<\EOF
16635 #define LBER_TAG_T long
16636 EOF
16637
16638
16639 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16640 echo "configure:16641: checking for 8-bit clean memcmp" >&5
16641 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16642   echo $ac_n "(cached) $ac_c" 1>&6
16643 else
16644   if test "$cross_compiling" = yes; then
16645   ac_cv_func_memcmp_clean=no
16646 else
16647   cat > conftest.$ac_ext <<EOF
16648 #line 16649 "configure"
16649 #include "confdefs.h"
16650
16651 main()
16652 {
16653   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16654   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16655 }
16656
16657 EOF
16658 if { (eval echo configure:16659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16659 then
16660   ac_cv_func_memcmp_clean=yes
16661 else
16662   echo "configure: failed program was:" >&5
16663   cat conftest.$ac_ext >&5
16664   rm -fr conftest*
16665   ac_cv_func_memcmp_clean=no
16666 fi
16667 rm -fr conftest*
16668 fi
16669
16670 fi
16671
16672 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16673 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16674
16675 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16676 echo "configure:16677: checking for strftime" >&5
16677 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16678   echo $ac_n "(cached) $ac_c" 1>&6
16679 else
16680   cat > conftest.$ac_ext <<EOF
16681 #line 16682 "configure"
16682 #include "confdefs.h"
16683 /* System header to define __stub macros and hopefully few prototypes,
16684     which can conflict with char strftime(); below.  */
16685 #include <assert.h>
16686 /* Override any gcc2 internal prototype to avoid an error.  */
16687 /* We use char because int might match the return type of a gcc2
16688     builtin and then its argument prototype would still apply.  */
16689 char strftime();
16690 char (*f)();
16691
16692 int main() {
16693
16694 /* The GNU C library defines this for functions which it implements
16695     to always fail with ENOSYS.  Some functions are actually named
16696     something starting with __ and the normal name is an alias.  */
16697 #if defined (__stub_strftime) || defined (__stub___strftime)
16698 choke me
16699 #else
16700 f = strftime;
16701 #endif
16702
16703 ; return 0; }
16704 EOF
16705 if { (eval echo configure:16706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16706   rm -rf conftest*
16707   eval "ac_cv_func_strftime=yes"
16708 else
16709   echo "configure: failed program was:" >&5
16710   cat conftest.$ac_ext >&5
16711   rm -rf conftest*
16712   eval "ac_cv_func_strftime=no"
16713 fi
16714 rm -f conftest*
16715 fi
16716
16717 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16718   echo "$ac_t""yes" 1>&6
16719   cat >> confdefs.h <<\EOF
16720 #define HAVE_STRFTIME 1
16721 EOF
16722
16723 else
16724   echo "$ac_t""no" 1>&6
16725 # strftime is in -lintl on SCO UNIX.
16726 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16727 echo "configure:16728: checking for strftime in -lintl" >&5
16728 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16729 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16730   echo $ac_n "(cached) $ac_c" 1>&6
16731 else
16732   ac_save_LIBS="$LIBS"
16733 LIBS="-lintl  $LIBS"
16734 cat > conftest.$ac_ext <<EOF
16735 #line 16736 "configure"
16736 #include "confdefs.h"
16737 /* Override any gcc2 internal prototype to avoid an error.  */
16738 /* We use char because int might match the return type of a gcc2
16739     builtin and then its argument prototype would still apply.  */
16740 char strftime();
16741
16742 int main() {
16743 strftime()
16744 ; return 0; }
16745 EOF
16746 if { (eval echo configure:16747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16747   rm -rf conftest*
16748   eval "ac_cv_lib_$ac_lib_var=yes"
16749 else
16750   echo "configure: failed program was:" >&5
16751   cat conftest.$ac_ext >&5
16752   rm -rf conftest*
16753   eval "ac_cv_lib_$ac_lib_var=no"
16754 fi
16755 rm -f conftest*
16756 LIBS="$ac_save_LIBS"
16757
16758 fi
16759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16760   echo "$ac_t""yes" 1>&6
16761   cat >> confdefs.h <<\EOF
16762 #define HAVE_STRFTIME 1
16763 EOF
16764
16765 LIBS="-lintl $LIBS"
16766 else
16767   echo "$ac_t""no" 1>&6
16768 fi
16769
16770 fi
16771
16772
16773 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16774 echo "configure:16775: checking for inet_aton()" >&5
16775 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16776   echo $ac_n "(cached) $ac_c" 1>&6
16777 else
16778   cat > conftest.$ac_ext <<EOF
16779 #line 16780 "configure"
16780 #include "confdefs.h"
16781
16782 #ifdef HAVE_SYS_TYPES_H
16783 #       include <sys/types.h>
16784 #endif
16785 #ifdef HAVE_SYS_SOCKET_H
16786 #       include <sys/socket.h>
16787 #       ifdef HAVE_SYS_SELECT_H
16788 #               include <sys/select.h>
16789 #       endif
16790 #       include <netinet/in.h>
16791 #       ifdef HAVE_ARPA_INET_H
16792 #               include <arpa/inet.h>
16793 #       endif
16794 #endif
16795
16796 int main() {
16797 struct in_addr in;
16798 int rc = inet_aton( "255.255.255.255", &in );
16799 ; return 0; }
16800 EOF
16801 if { (eval echo configure:16802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16802   rm -rf conftest*
16803   ol_cv_func_inet_aton=yes
16804 else
16805   echo "configure: failed program was:" >&5
16806   cat conftest.$ac_ext >&5
16807   rm -rf conftest*
16808   ol_cv_func_inet_aton=no
16809 fi
16810 rm -f conftest*
16811 fi
16812
16813 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16814   if test $ol_cv_func_inet_aton != no; then
16815     cat >> confdefs.h <<\EOF
16816 #define HAVE_INET_ATON 1
16817 EOF
16818
16819   fi
16820  
16821
16822 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16823 echo "configure:16824: checking for _spawnlp" >&5
16824 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16825   echo $ac_n "(cached) $ac_c" 1>&6
16826 else
16827   cat > conftest.$ac_ext <<EOF
16828 #line 16829 "configure"
16829 #include "confdefs.h"
16830 /* System header to define __stub macros and hopefully few prototypes,
16831     which can conflict with char _spawnlp(); below.  */
16832 #include <assert.h>
16833 /* Override any gcc2 internal prototype to avoid an error.  */
16834 /* We use char because int might match the return type of a gcc2
16835     builtin and then its argument prototype would still apply.  */
16836 char _spawnlp();
16837 char (*f)();
16838
16839 int main() {
16840
16841 /* The GNU C library defines this for functions which it implements
16842     to always fail with ENOSYS.  Some functions are actually named
16843     something starting with __ and the normal name is an alias.  */
16844 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16845 choke me
16846 #else
16847 f = _spawnlp;
16848 #endif
16849
16850 ; return 0; }
16851 EOF
16852 if { (eval echo configure:16853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16853   rm -rf conftest*
16854   eval "ac_cv_func__spawnlp=yes"
16855 else
16856   echo "configure: failed program was:" >&5
16857   cat conftest.$ac_ext >&5
16858   rm -rf conftest*
16859   eval "ac_cv_func__spawnlp=no"
16860 fi
16861 rm -f conftest*
16862 fi
16863
16864 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16865   echo "$ac_t""yes" 1>&6
16866   cat >> confdefs.h <<\EOF
16867 #define HAVE_SPAWNLP 1
16868 EOF
16869
16870 else
16871   echo "$ac_t""no" 1>&6
16872 fi
16873
16874
16875 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16876 echo "configure:16877: checking for _snprintf" >&5
16877 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16878   echo $ac_n "(cached) $ac_c" 1>&6
16879 else
16880   cat > conftest.$ac_ext <<EOF
16881 #line 16882 "configure"
16882 #include "confdefs.h"
16883 /* System header to define __stub macros and hopefully few prototypes,
16884     which can conflict with char _snprintf(); below.  */
16885 #include <assert.h>
16886 /* Override any gcc2 internal prototype to avoid an error.  */
16887 /* We use char because int might match the return type of a gcc2
16888     builtin and then its argument prototype would still apply.  */
16889 char _snprintf();
16890 char (*f)();
16891
16892 int main() {
16893
16894 /* The GNU C library defines this for functions which it implements
16895     to always fail with ENOSYS.  Some functions are actually named
16896     something starting with __ and the normal name is an alias.  */
16897 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16898 choke me
16899 #else
16900 f = _snprintf;
16901 #endif
16902
16903 ; return 0; }
16904 EOF
16905 if { (eval echo configure:16906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16906   rm -rf conftest*
16907   eval "ac_cv_func__snprintf=yes"
16908 else
16909   echo "configure: failed program was:" >&5
16910   cat conftest.$ac_ext >&5
16911   rm -rf conftest*
16912   eval "ac_cv_func__snprintf=no"
16913 fi
16914 rm -f conftest*
16915 fi
16916
16917 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16918   echo "$ac_t""yes" 1>&6
16919   ac_cv_func_snprintf=yes
16920         cat >> confdefs.h <<\EOF
16921 #define snprintf _snprintf
16922 EOF
16923
16924
16925 else
16926   echo "$ac_t""no" 1>&6
16927 fi
16928
16929
16930 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16931 echo "configure:16932: checking for _vsnprintf" >&5
16932 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16933   echo $ac_n "(cached) $ac_c" 1>&6
16934 else
16935   cat > conftest.$ac_ext <<EOF
16936 #line 16937 "configure"
16937 #include "confdefs.h"
16938 /* System header to define __stub macros and hopefully few prototypes,
16939     which can conflict with char _vsnprintf(); below.  */
16940 #include <assert.h>
16941 /* Override any gcc2 internal prototype to avoid an error.  */
16942 /* We use char because int might match the return type of a gcc2
16943     builtin and then its argument prototype would still apply.  */
16944 char _vsnprintf();
16945 char (*f)();
16946
16947 int main() {
16948
16949 /* The GNU C library defines this for functions which it implements
16950     to always fail with ENOSYS.  Some functions are actually named
16951     something starting with __ and the normal name is an alias.  */
16952 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16953 choke me
16954 #else
16955 f = _vsnprintf;
16956 #endif
16957
16958 ; return 0; }
16959 EOF
16960 if { (eval echo configure:16961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16961   rm -rf conftest*
16962   eval "ac_cv_func__vsnprintf=yes"
16963 else
16964   echo "configure: failed program was:" >&5
16965   cat conftest.$ac_ext >&5
16966   rm -rf conftest*
16967   eval "ac_cv_func__vsnprintf=no"
16968 fi
16969 rm -f conftest*
16970 fi
16971
16972 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16973   echo "$ac_t""yes" 1>&6
16974   ac_cv_func_vsnprintf=yes
16975         cat >> confdefs.h <<\EOF
16976 #define vsnprintf _vsnprintf
16977 EOF
16978
16979
16980 else
16981   echo "$ac_t""no" 1>&6
16982 fi
16983
16984
16985 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16986 echo "configure:16987: checking for vprintf" >&5
16987 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16988   echo $ac_n "(cached) $ac_c" 1>&6
16989 else
16990   cat > conftest.$ac_ext <<EOF
16991 #line 16992 "configure"
16992 #include "confdefs.h"
16993 /* System header to define __stub macros and hopefully few prototypes,
16994     which can conflict with char vprintf(); below.  */
16995 #include <assert.h>
16996 /* Override any gcc2 internal prototype to avoid an error.  */
16997 /* We use char because int might match the return type of a gcc2
16998     builtin and then its argument prototype would still apply.  */
16999 char vprintf();
17000 char (*f)();
17001
17002 int main() {
17003
17004 /* The GNU C library defines this for functions which it implements
17005     to always fail with ENOSYS.  Some functions are actually named
17006     something starting with __ and the normal name is an alias.  */
17007 #if defined (__stub_vprintf) || defined (__stub___vprintf)
17008 choke me
17009 #else
17010 f = vprintf;
17011 #endif
17012
17013 ; return 0; }
17014 EOF
17015 if { (eval echo configure:17016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17016   rm -rf conftest*
17017   eval "ac_cv_func_vprintf=yes"
17018 else
17019   echo "configure: failed program was:" >&5
17020   cat conftest.$ac_ext >&5
17021   rm -rf conftest*
17022   eval "ac_cv_func_vprintf=no"
17023 fi
17024 rm -f conftest*
17025 fi
17026
17027 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
17028   echo "$ac_t""yes" 1>&6
17029   cat >> confdefs.h <<\EOF
17030 #define HAVE_VPRINTF 1
17031 EOF
17032
17033 else
17034   echo "$ac_t""no" 1>&6
17035 fi
17036
17037 if test "$ac_cv_func_vprintf" != yes; then
17038 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
17039 echo "configure:17040: checking for _doprnt" >&5
17040 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
17041   echo $ac_n "(cached) $ac_c" 1>&6
17042 else
17043   cat > conftest.$ac_ext <<EOF
17044 #line 17045 "configure"
17045 #include "confdefs.h"
17046 /* System header to define __stub macros and hopefully few prototypes,
17047     which can conflict with char _doprnt(); below.  */
17048 #include <assert.h>
17049 /* Override any gcc2 internal prototype to avoid an error.  */
17050 /* We use char because int might match the return type of a gcc2
17051     builtin and then its argument prototype would still apply.  */
17052 char _doprnt();
17053 char (*f)();
17054
17055 int main() {
17056
17057 /* The GNU C library defines this for functions which it implements
17058     to always fail with ENOSYS.  Some functions are actually named
17059     something starting with __ and the normal name is an alias.  */
17060 #if defined (__stub__doprnt) || defined (__stub____doprnt)
17061 choke me
17062 #else
17063 f = _doprnt;
17064 #endif
17065
17066 ; return 0; }
17067 EOF
17068 if { (eval echo configure:17069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17069   rm -rf conftest*
17070   eval "ac_cv_func__doprnt=yes"
17071 else
17072   echo "configure: failed program was:" >&5
17073   cat conftest.$ac_ext >&5
17074   rm -rf conftest*
17075   eval "ac_cv_func__doprnt=no"
17076 fi
17077 rm -f conftest*
17078 fi
17079
17080 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
17081   echo "$ac_t""yes" 1>&6
17082   cat >> confdefs.h <<\EOF
17083 #define HAVE_DOPRNT 1
17084 EOF
17085
17086 else
17087   echo "$ac_t""no" 1>&6
17088 fi
17089
17090 fi
17091
17092
17093 if test $ac_cv_func_vprintf = yes ; then
17094                 for ac_func in vsnprintf vsprintf
17095 do
17096 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17097 echo "configure:17098: checking for $ac_func" >&5
17098 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17099   echo $ac_n "(cached) $ac_c" 1>&6
17100 else
17101   cat > conftest.$ac_ext <<EOF
17102 #line 17103 "configure"
17103 #include "confdefs.h"
17104 /* System header to define __stub macros and hopefully few prototypes,
17105     which can conflict with char $ac_func(); below.  */
17106 #include <assert.h>
17107 /* Override any gcc2 internal prototype to avoid an error.  */
17108 /* We use char because int might match the return type of a gcc2
17109     builtin and then its argument prototype would still apply.  */
17110 char $ac_func();
17111 char (*f)();
17112
17113 int main() {
17114
17115 /* The GNU C library defines this for functions which it implements
17116     to always fail with ENOSYS.  Some functions are actually named
17117     something starting with __ and the normal name is an alias.  */
17118 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17119 choke me
17120 #else
17121 f = $ac_func;
17122 #endif
17123
17124 ; return 0; }
17125 EOF
17126 if { (eval echo configure:17127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17127   rm -rf conftest*
17128   eval "ac_cv_func_$ac_func=yes"
17129 else
17130   echo "configure: failed program was:" >&5
17131   cat conftest.$ac_ext >&5
17132   rm -rf conftest*
17133   eval "ac_cv_func_$ac_func=no"
17134 fi
17135 rm -f conftest*
17136 fi
17137
17138 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17139   echo "$ac_t""yes" 1>&6
17140     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17141   cat >> confdefs.h <<EOF
17142 #define $ac_tr_func 1
17143 EOF
17144  
17145 else
17146   echo "$ac_t""no" 1>&6
17147 fi
17148 done
17149
17150 fi
17151
17152 for ac_func in \
17153         bcopy                   \
17154         closesocket             \
17155         chroot                  \
17156         endgrent                \
17157         endpwent                \
17158         fcntl                   \
17159         flock                   \
17160         getdtablesize   \
17161         getgrgid                \
17162         gethostname             \
17163         getpass                 \
17164         getpassphrase   \
17165         getpwuid                \
17166         getpwnam                \
17167         getspnam                \
17168         gettimeofday    \
17169         initgroups              \
17170         lockf                   \
17171         memcpy                  \
17172         memmove                 \
17173         pipe                    \
17174         read                    \
17175         recv                    \
17176         recvfrom                \
17177         setpwfile               \
17178         setgid                  \
17179         setegid                 \
17180         setsid                  \
17181         setuid                  \
17182         seteuid                 \
17183         sigaction               \
17184         signal                  \
17185         sigset                  \
17186         strdup                  \
17187         strerror                \
17188         strpbrk                 \
17189         strrchr                 \
17190         strsep                  \
17191         strstr                  \
17192         strtol                  \
17193         strtoul                 \
17194         strspn                  \
17195         sysconf                 \
17196         waitpid                 \
17197         wait4                   \
17198         write                   \
17199         send                    \
17200         sendto                  \
17201
17202 do
17203 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17204 echo "configure:17205: checking for $ac_func" >&5
17205 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17206   echo $ac_n "(cached) $ac_c" 1>&6
17207 else
17208   cat > conftest.$ac_ext <<EOF
17209 #line 17210 "configure"
17210 #include "confdefs.h"
17211 /* System header to define __stub macros and hopefully few prototypes,
17212     which can conflict with char $ac_func(); below.  */
17213 #include <assert.h>
17214 /* Override any gcc2 internal prototype to avoid an error.  */
17215 /* We use char because int might match the return type of a gcc2
17216     builtin and then its argument prototype would still apply.  */
17217 char $ac_func();
17218 char (*f)();
17219
17220 int main() {
17221
17222 /* The GNU C library defines this for functions which it implements
17223     to always fail with ENOSYS.  Some functions are actually named
17224     something starting with __ and the normal name is an alias.  */
17225 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17226 choke me
17227 #else
17228 f = $ac_func;
17229 #endif
17230
17231 ; return 0; }
17232 EOF
17233 if { (eval echo configure:17234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17234   rm -rf conftest*
17235   eval "ac_cv_func_$ac_func=yes"
17236 else
17237   echo "configure: failed program was:" >&5
17238   cat conftest.$ac_ext >&5
17239   rm -rf conftest*
17240   eval "ac_cv_func_$ac_func=no"
17241 fi
17242 rm -f conftest*
17243 fi
17244
17245 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17246   echo "$ac_t""yes" 1>&6
17247     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17248   cat >> confdefs.h <<EOF
17249 #define $ac_tr_func 1
17250 EOF
17251  
17252 else
17253   echo "$ac_t""no" 1>&6
17254 fi
17255 done
17256
17257
17258 for ac_func in getopt
17259 do
17260 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17261 echo "configure:17262: checking for $ac_func" >&5
17262 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17263   echo $ac_n "(cached) $ac_c" 1>&6
17264 else
17265   cat > conftest.$ac_ext <<EOF
17266 #line 17267 "configure"
17267 #include "confdefs.h"
17268 /* System header to define __stub macros and hopefully few prototypes,
17269     which can conflict with char $ac_func(); below.  */
17270 #include <assert.h>
17271 /* Override any gcc2 internal prototype to avoid an error.  */
17272 /* We use char because int might match the return type of a gcc2
17273     builtin and then its argument prototype would still apply.  */
17274 char $ac_func();
17275 char (*f)();
17276
17277 int main() {
17278
17279 /* The GNU C library defines this for functions which it implements
17280     to always fail with ENOSYS.  Some functions are actually named
17281     something starting with __ and the normal name is an alias.  */
17282 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17283 choke me
17284 #else
17285 f = $ac_func;
17286 #endif
17287
17288 ; return 0; }
17289 EOF
17290 if { (eval echo configure:17291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17291   rm -rf conftest*
17292   eval "ac_cv_func_$ac_func=yes"
17293 else
17294   echo "configure: failed program was:" >&5
17295   cat conftest.$ac_ext >&5
17296   rm -rf conftest*
17297   eval "ac_cv_func_$ac_func=no"
17298 fi
17299 rm -f conftest*
17300 fi
17301
17302 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17303   echo "$ac_t""yes" 1>&6
17304     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17305   cat >> confdefs.h <<EOF
17306 #define $ac_tr_func 1
17307 EOF
17308  
17309 else
17310   echo "$ac_t""no" 1>&6
17311 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17312 fi
17313 done
17314
17315
17316
17317 if test "$ac_cv_func_getopt" != yes; then
17318     LIBSRCS="$LIBSRCS getopt.c"
17319 fi
17320
17321 # Check Configuration
17322 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17323 echo "configure:17324: checking declaration of sys_errlist" >&5
17324 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17325   echo $ac_n "(cached) $ac_c" 1>&6
17326 else
17327   
17328         cat > conftest.$ac_ext <<EOF
17329 #line 17330 "configure"
17330 #include "confdefs.h"
17331
17332 #include <stdio.h>
17333 #include <sys/types.h>
17334 #include <errno.h>
17335 #ifdef WINNT
17336 #include <stdlib.h>
17337 #endif 
17338 int main() {
17339 char *c = (char *) *sys_errlist
17340 ; return 0; }
17341 EOF
17342 if { (eval echo configure:17343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17343   rm -rf conftest*
17344   ol_cv_dcl_sys_errlist=yes
17345         ol_cv_have_sys_errlist=yes
17346 else
17347   echo "configure: failed program was:" >&5
17348   cat conftest.$ac_ext >&5
17349   rm -rf conftest*
17350   ol_cv_dcl_sys_errlist=no
17351 fi
17352 rm -f conftest*
17353 fi
17354
17355 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17356 #
17357 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17358 if test $ol_cv_dcl_sys_errlist = no ; then
17359         cat >> confdefs.h <<\EOF
17360 #define DECL_SYS_ERRLIST 1
17361 EOF
17362
17363
17364         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17365 echo "configure:17366: checking existence of sys_errlist" >&5
17366 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17367   echo $ac_n "(cached) $ac_c" 1>&6
17368 else
17369   
17370                 cat > conftest.$ac_ext <<EOF
17371 #line 17372 "configure"
17372 #include "confdefs.h"
17373 #include <errno.h>
17374 int main() {
17375 char *c = (char *) *sys_errlist
17376 ; return 0; }
17377 EOF
17378 if { (eval echo configure:17379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17379   rm -rf conftest*
17380   ol_cv_have_sys_errlist=yes
17381 else
17382   echo "configure: failed program was:" >&5
17383   cat conftest.$ac_ext >&5
17384   rm -rf conftest*
17385   ol_cv_have_sys_errlist=no
17386 fi
17387 rm -f conftest*
17388 fi
17389
17390 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17391 fi
17392 if test $ol_cv_have_sys_errlist = yes ; then
17393         cat >> confdefs.h <<\EOF
17394 #define HAVE_SYS_ERRLIST 1
17395 EOF
17396
17397 fi
17398
17399
17400
17401 if test "$ol_enable_debug" != no ; then
17402         cat >> confdefs.h <<\EOF
17403 #define LDAP_DEBUG 1
17404 EOF
17405
17406 fi
17407 if test "$ol_enable_syslog" = yes ; then
17408         cat >> confdefs.h <<\EOF
17409 #define LDAP_SYSLOG 1
17410 EOF
17411
17412 fi
17413 if test "$ol_enable_cache" = no ; then
17414         cat >> confdefs.h <<\EOF
17415 #define LDAP_NOCACHE 1
17416 EOF
17417
17418 fi
17419 if test "$ol_link_kbind" != no ; then
17420         cat >> confdefs.h <<\EOF
17421 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17422 EOF
17423
17424 fi
17425 if test "$ol_enable_proctitle" != no ; then
17426         cat >> confdefs.h <<\EOF
17427 #define LDAP_PROCTITLE 1
17428 EOF
17429
17430 fi
17431 if test "$ol_enable_referrals" != no ; then
17432         cat >> confdefs.h <<\EOF
17433 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17434 EOF
17435
17436 fi
17437 if test "$ol_enable_local" != no; then
17438         cat >> confdefs.h <<\EOF
17439 #define LDAP_PF_LOCAL 1
17440 EOF
17441
17442 fi
17443 if test "$ol_link_ipv6" != no; then
17444         cat >> confdefs.h <<\EOF
17445 #define LDAP_PF_INET6 1
17446 EOF
17447
17448 fi
17449 if test "$ol_enable_cleartext" != no ; then
17450         cat >> confdefs.h <<\EOF
17451 #define SLAPD_CLEARTEXT 1
17452 EOF
17453
17454 fi
17455 if test "$ol_enable_crypt" != no ; then
17456         cat >> confdefs.h <<\EOF
17457 #define SLAPD_CRYPT 1
17458 EOF
17459
17460 fi
17461 if test "$ol_link_kpasswd" != no ; then
17462         cat >> confdefs.h <<\EOF
17463 #define SLAPD_KPASSWD 1
17464 EOF
17465
17466 fi
17467 if test "$ol_link_spasswd" != no ; then
17468         cat >> confdefs.h <<\EOF
17469 #define SLAPD_SPASSWD 1
17470 EOF
17471
17472 fi
17473 if test "$ol_enable_phonetic" != no ; then
17474         cat >> confdefs.h <<\EOF
17475 #define SLAPD_PHONETIC 1
17476 EOF
17477
17478 fi
17479 if test "$ol_enable_rlookups" != no ; then
17480         cat >> confdefs.h <<\EOF
17481 #define SLAPD_RLOOKUPS 1
17482 EOF
17483
17484 fi
17485 if test "$ol_enable_aci" != no ; then
17486         cat >> confdefs.h <<\EOF
17487 #define SLAPD_ACI_ENABLED 1
17488 EOF
17489
17490 fi
17491
17492 if test "$ol_link_modules" != no ; then
17493         cat >> confdefs.h <<\EOF
17494 #define SLAPD_MODULES 1
17495 EOF
17496
17497         BUILD_SLAPD=yes
17498         SLAPD_MODULES_LDFLAGS="-dlopen self"
17499 fi
17500
17501 if test "$ol_enable_bdb" != no ; then
17502         cat >> confdefs.h <<\EOF
17503 #define SLAPD_BDB 1
17504 EOF
17505
17506         BUILD_SLAPD=yes
17507         BUILD_BDB=yes
17508         if test "$ol_with_bdb_module" != static ; then
17509                 cat >> confdefs.h <<\EOF
17510 #define SLAPD_BDB_DYNAMIC 1
17511 EOF
17512
17513                 BUILD_BDB=mod
17514                 BUILD_BDB_DYNAMIC=shared
17515                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17516         fi
17517 fi
17518
17519 if test "$ol_link_dnssrv" != no ; then
17520         cat >> confdefs.h <<\EOF
17521 #define SLAPD_DNSSRV 1
17522 EOF
17523
17524         BUILD_SLAPD=yes
17525         BUILD_DNSSRV=yes
17526         if test "$ol_with_dnssrv_module" != static ; then
17527                 cat >> confdefs.h <<\EOF
17528 #define SLAPD_DNSSRV_DYNAMIC 1
17529 EOF
17530
17531                 BUILD_DNSSRV=mod
17532                 BUILD_DNSSRV_DYNAMIC=shared
17533                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17534         fi
17535 fi
17536
17537 if test "$ol_enable_ldap" != no ; then
17538         cat >> confdefs.h <<\EOF
17539 #define SLAPD_LDAP 1
17540 EOF
17541
17542         BUILD_SLAPD=yes
17543         BUILD_LDAP=yes
17544         if test "$ol_with_ldap_module" != static ; then
17545                 cat >> confdefs.h <<\EOF
17546 #define SLAPD_LDAP_DYNAMIC 1
17547 EOF
17548
17549                 BUILD_LDAP=mod
17550                 BUILD_LDAP_DYNAMIC=shared
17551                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17552         fi
17553 fi
17554
17555 if test "$ol_link_ldbm" != no -a $ol_enable_ldbm != no; then
17556         cat >> confdefs.h <<\EOF
17557 #define SLAPD_LDBM 1
17558 EOF
17559
17560         BUILD_SLAPD=yes
17561         BUILD_LDBM=yes
17562         LDBM_LIB="-lldbm"
17563         if test "$ol_with_ldbm_module" != static ; then
17564                 cat >> confdefs.h <<\EOF
17565 #define SLAPD_LDBM_DYNAMIC 1
17566 EOF
17567
17568                 BUILD_LDBM=mod
17569                 BUILD_LDBM_DYNAMIC=shared
17570                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17571         fi
17572 fi
17573
17574 if test "$ol_enable_meta" != no ; then
17575         if test "$ol_enable_ldap" = no ; then
17576                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17577         fi
17578         if test "$ol_enable_rewrite" = no ; then
17579                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17580         fi
17581         cat >> confdefs.h <<\EOF
17582 #define SLAPD_META 1
17583 EOF
17584
17585         BUILD_SLAPD=yes
17586         BUILD_META=yes
17587         if test "$ol_with_meta_module" != static ; then
17588                 cat >> confdefs.h <<\EOF
17589 #define SLAPD_META_DYNAMIC 1
17590 EOF
17591
17592                 BUILD_META=mod
17593                 BUILD_META_DYNAMIC=shared
17594                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17595         fi
17596 fi
17597
17598 if test "$ol_enable_monitor" != no ; then
17599         cat >> confdefs.h <<\EOF
17600 #define SLAPD_MONITOR 1
17601 EOF
17602
17603         BUILD_SLAPD=yes
17604         BUILD_MONITOR=yes
17605         if test "$ol_with_monitor_module" != static ; then
17606                 cat >> confdefs.h <<\EOF
17607 #define SLAPD_MONITOR_DYNAMIC 1
17608 EOF
17609
17610                 BUILD_MONITOR=mod
17611                 BUILD_MONITOR_DYNAMIC=shared
17612                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-monitor/back_monitor.la"
17613         fi
17614 fi
17615
17616 if test "$ol_enable_passwd" != no ; then
17617         cat >> confdefs.h <<\EOF
17618 #define SLAPD_PASSWD 1
17619 EOF
17620
17621         BUILD_SLAPD=yes
17622         BUILD_PASSWD=yes
17623         if test "$ol_with_passwd_module" != static ; then
17624                 cat >> confdefs.h <<\EOF
17625 #define SLAPD_PASSWD_DYNAMIC 1
17626 EOF
17627
17628                 BUILD_PASSWD=mod
17629                 BUILD_PASSWD_DYNAMIC=shared
17630                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17631         fi
17632 fi
17633
17634 if test "$ol_link_perl" != no ; then
17635         cat >> confdefs.h <<\EOF
17636 #define SLAPD_PERL 1
17637 EOF
17638
17639         BUILD_SLAPD=yes
17640         BUILD_PERL=yes
17641         if test "$ol_with_perl_module" != static ; then
17642                 cat >> confdefs.h <<\EOF
17643 #define SLAPD_PERL_DYNAMIC 1
17644 EOF
17645
17646                 BUILD_PERL=mod
17647                 BUILD_PERL_DYNAMIC=shared
17648                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17649         fi
17650 fi
17651
17652 if test "$ol_enable_shell" != no ; then
17653         cat >> confdefs.h <<\EOF
17654 #define SLAPD_SHELL 1
17655 EOF
17656
17657         BUILD_SLAPD=yes
17658         BUILD_SHELL=yes
17659         if test "$ol_with_shell_module" != static ; then
17660                 cat >> confdefs.h <<\EOF
17661 #define SLAPD_SHELL_DYNAMIC 1
17662 EOF
17663
17664                 BUILD_SHELL=mod
17665                 BUILD_SHELL_DYNAMIC=shared
17666                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17667         fi
17668 fi
17669
17670 if test "$ol_enable_tcl" != no ; then
17671         cat >> confdefs.h <<\EOF
17672 #define SLAPD_TCL 1
17673 EOF
17674
17675         BUILD_SLAPD=yes
17676         BUILD_TCL=yes
17677         if test "$ol_with_tcl_module" != static; then
17678                 cat >> confdefs.h <<\EOF
17679 #define SLAPD_TCL_DYNAMIC 1
17680 EOF
17681
17682                 BUILD_TCL=mod
17683                 BUILD_TCL_DYNAMIC=shared
17684                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17685         fi
17686 fi
17687
17688 if test "$ol_link_sql" != no ; then
17689         cat >> confdefs.h <<\EOF
17690 #define SLAPD_SQL 1
17691 EOF
17692
17693         BUILD_SLAPD=yes
17694         BUILD_SQL=yes
17695         if test "$ol_with_sql_module" != static; then
17696                 cat >> confdefs.h <<\EOF
17697 #define SLAPD_SQL_DYNAMIC 1
17698 EOF
17699
17700                 BUILD_SQL=mod
17701                 BUILD_SQL_DYNAMIC=shared
17702                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17703         fi
17704 fi
17705
17706 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17707         $BUILD_SLAPD = yes ; then
17708         BUILD_SLURPD=yes
17709 fi
17710
17711 if test "$ol_enable_rewrite" != no ; then
17712         cat >> confdefs.h <<\EOF
17713 #define ENABLE_REWRITE 1
17714 EOF
17715
17716         BUILD_REWRITE=yes
17717         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17718 fi
17719
17720
17721 if test "$LINK_BINS_DYNAMIC" = yes; then
17722     LIB_LINKAGE=DYN
17723     LT_LIB_LINKAGE=shared
17724 else
17725     LIB_LINKAGE=STAT
17726     LT_LIB_LINKAGE=static
17727 fi
17728
17729 if test "$ac_cv_mingw32" = yes ; then
17730     PLAT=NT
17731     DYN_EXT=dll
17732 else
17733     PLAT=UNIX
17734     DYN_EXT=so
17735 fi
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745   
17746   
17747   
17748   
17749   
17750   
17751   
17752   
17753   
17754   
17755   
17756   
17757   
17758   
17759   
17760   
17761   
17762   
17763   
17764   
17765   
17766   
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806 trap '' 1 2 15
17807
17808 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17809
17810 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17811 # Let make expand exec_prefix.
17812 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17813
17814 # Any assignment to VPATH causes Sun make to only execute
17815 # the first set of double-colon rules, so remove it if not needed.
17816 # If there is a colon in the path, we need to keep it.
17817 if test "x$srcdir" = x.; then
17818   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17819 fi
17820
17821 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17822
17823 DEFS=-DHAVE_CONFIG_H
17824
17825 # Without the "./", some shells look in PATH for config.status.
17826 : ${CONFIG_STATUS=./config.status}
17827
17828 echo creating $CONFIG_STATUS
17829 rm -f $CONFIG_STATUS
17830 cat > $CONFIG_STATUS <<EOF
17831 #! /bin/sh
17832 # Generated automatically by configure.
17833 # Run this file to recreate the current configuration.
17834 # This directory was configured as follows,
17835 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17836 #
17837 # $0 $ac_configure_args
17838 #
17839 # Compiler output produced by configure, useful for debugging
17840 # configure, is in ./config.log if it exists.
17841
17842 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17843 for ac_option
17844 do
17845   case "\$ac_option" in
17846   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17847     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17848     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17849   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17850     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17851     exit 0 ;;
17852   -help | --help | --hel | --he | --h)
17853     echo "\$ac_cs_usage"; exit 0 ;;
17854   *) echo "\$ac_cs_usage"; exit 1 ;;
17855   esac
17856 done
17857
17858 ac_given_srcdir=$srcdir
17859 ac_given_INSTALL="$INSTALL"
17860
17861 trap 'rm -fr `echo "\
17862 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17863 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17864 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17865 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17866 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17867 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17868 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17869 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17870 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17871 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17872 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17873 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17874 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17875 include/Makefile:build/top.mk:include/Makefile.in \
17876 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17877 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17878 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17879 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17880 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17881 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17882 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17883 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17884 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17885 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17886 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17887 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17888 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17889 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17890 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17891 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17892 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17893 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
17894 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17895 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17896 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17897 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17898 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17899 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17900 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17901 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17902 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17903 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17904 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17905 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17906  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17907 EOF
17908 cat >> $CONFIG_STATUS <<EOF
17909
17910 # Protect against being on the right side of a sed subst in config.status.
17911 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17912  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17913 $ac_vpsub
17914 $extrasub
17915 s%@SHELL@%$SHELL%g
17916 s%@CFLAGS@%$CFLAGS%g
17917 s%@CPPFLAGS@%$CPPFLAGS%g
17918 s%@CXXFLAGS@%$CXXFLAGS%g
17919 s%@FFLAGS@%$FFLAGS%g
17920 s%@DEFS@%$DEFS%g
17921 s%@LDFLAGS@%$LDFLAGS%g
17922 s%@LIBS@%$LIBS%g
17923 s%@exec_prefix@%$exec_prefix%g
17924 s%@prefix@%$prefix%g
17925 s%@program_transform_name@%$program_transform_name%g
17926 s%@bindir@%$bindir%g
17927 s%@sbindir@%$sbindir%g
17928 s%@libexecdir@%$libexecdir%g
17929 s%@datadir@%$datadir%g
17930 s%@sysconfdir@%$sysconfdir%g
17931 s%@sharedstatedir@%$sharedstatedir%g
17932 s%@localstatedir@%$localstatedir%g
17933 s%@libdir@%$libdir%g
17934 s%@includedir@%$includedir%g
17935 s%@oldincludedir@%$oldincludedir%g
17936 s%@infodir@%$infodir%g
17937 s%@mandir@%$mandir%g
17938 s%@host@%$host%g
17939 s%@host_alias@%$host_alias%g
17940 s%@host_cpu@%$host_cpu%g
17941 s%@host_vendor@%$host_vendor%g
17942 s%@host_os@%$host_os%g
17943 s%@target@%$target%g
17944 s%@target_alias@%$target_alias%g
17945 s%@target_cpu@%$target_cpu%g
17946 s%@target_vendor@%$target_vendor%g
17947 s%@target_os@%$target_os%g
17948 s%@build@%$build%g
17949 s%@build_alias@%$build_alias%g
17950 s%@build_cpu@%$build_cpu%g
17951 s%@build_vendor@%$build_vendor%g
17952 s%@build_os@%$build_os%g
17953 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17954 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17955 s%@INSTALL_DATA@%$INSTALL_DATA%g
17956 s%@PACKAGE@%$PACKAGE%g
17957 s%@VERSION@%$VERSION%g
17958 s%@ACLOCAL@%$ACLOCAL%g
17959 s%@AUTOCONF@%$AUTOCONF%g
17960 s%@AUTOMAKE@%$AUTOMAKE%g
17961 s%@AUTOHEADER@%$AUTOHEADER%g
17962 s%@MAKEINFO@%$MAKEINFO%g
17963 s%@install_sh@%$install_sh%g
17964 s%@AMTAR@%$AMTAR%g
17965 s%@AWK@%$AWK%g
17966 s%@AMTARFLAGS@%$AMTARFLAGS%g
17967 s%@SET_MAKE@%$SET_MAKE%g
17968 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
17969 s%@top_builddir@%$top_builddir%g
17970 s%@ldap_subdir@%$ldap_subdir%g
17971 s%@CC@%$CC%g
17972 s%@RANLIB@%$RANLIB%g
17973 s%@LN_S@%$LN_S%g
17974 s%@DLLTOOL@%$DLLTOOL%g
17975 s%@AS@%$AS%g
17976 s%@OBJDUMP@%$OBJDUMP%g
17977 s%@LIBTOOL@%$LIBTOOL%g
17978 s%@LN_H@%$LN_H%g
17979 s%@SENDMAIL@%$SENDMAIL%g
17980 s%@EDITOR@%$EDITOR%g
17981 s%@FINGER@%$FINGER%g
17982 s%@PERLBIN@%$PERLBIN%g
17983 s%@CPP@%$CPP%g
17984 s%@EXEEXT@%$EXEEXT%g
17985 s%@OBJEXT@%$OBJEXT%g
17986 s%@OL_MKDEP@%$OL_MKDEP%g
17987 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17988 s%@LIBOBJS@%$LIBOBJS%g
17989 s%@LIBSRCS@%$LIBSRCS%g
17990 s%@PLAT@%$PLAT%g
17991 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17992 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17993 s%@DYN_EXT@%$DYN_EXT%g
17994 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17995 s%@BUILD_BDB@%$BUILD_BDB%g
17996 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17997 s%@BUILD_LDAP@%$BUILD_LDAP%g
17998 s%@BUILD_LDBM@%$BUILD_LDBM%g
17999 s%@BUILD_META@%$BUILD_META%g
18000 s%@BUILD_MONITOR@%$BUILD_MONITOR%g
18001 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
18002 s%@BUILD_PERL@%$BUILD_PERL%g
18003 s%@BUILD_SHELL@%$BUILD_SHELL%g
18004 s%@BUILD_SQL@%$BUILD_SQL%g
18005 s%@BUILD_TCL@%$BUILD_TCL%g
18006 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
18007 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
18008 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
18009 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
18010 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
18011 s%@BUILD_MONITOR_DYNAMIC@%$BUILD_MONITOR_DYNAMIC%g
18012 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
18013 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
18014 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
18015 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
18016 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
18017 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
18018 s%@LDBM_LIB@%$LDBM_LIB%g
18019 s%@LDAP_LIBS@%$LDAP_LIBS%g
18020 s%@LDIF_LIBS@%$LDIF_LIBS%g
18021 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
18022 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
18023 s%@LDBM_LIBS@%$LDBM_LIBS%g
18024 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
18025 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
18026 s%@WRAP_LIBS@%$WRAP_LIBS%g
18027 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
18028 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
18029 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
18030 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
18031 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
18032 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
18033 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
18034 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
18035 s%@KRB4_LIBS@%$KRB4_LIBS%g
18036 s%@KRB5_LIBS@%$KRB5_LIBS%g
18037 s%@READLINE_LIBS@%$READLINE_LIBS%g
18038 s%@SASL_LIBS@%$SASL_LIBS%g
18039 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
18040 s%@TLS_LIBS@%$TLS_LIBS%g
18041 s%@MODULES_LIBS@%$MODULES_LIBS%g
18042 s%@AUTH_LIBS@%$AUTH_LIBS%g
18043 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
18044 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
18045 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
18046 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
18047
18048 CEOF
18049 EOF
18050
18051 cat >> $CONFIG_STATUS <<\EOF
18052
18053 # Split the substitutions into bite-sized pieces for seds with
18054 # small command number limits, like on Digital OSF/1 and HP-UX.
18055 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
18056 ac_file=1 # Number of current file.
18057 ac_beg=1 # First line for current file.
18058 ac_end=$ac_max_sed_cmds # Line after last line for current file.
18059 ac_more_lines=:
18060 ac_sed_cmds=""
18061 while $ac_more_lines; do
18062   if test $ac_beg -gt 1; then
18063     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
18064   else
18065     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
18066   fi
18067   if test ! -s conftest.s$ac_file; then
18068     ac_more_lines=false
18069     rm -f conftest.s$ac_file
18070   else
18071     if test -z "$ac_sed_cmds"; then
18072       ac_sed_cmds="sed -f conftest.s$ac_file"
18073     else
18074       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
18075     fi
18076     ac_file=`expr $ac_file + 1`
18077     ac_beg=$ac_end
18078     ac_end=`expr $ac_end + $ac_max_sed_cmds`
18079   fi
18080 done
18081 if test -z "$ac_sed_cmds"; then
18082   ac_sed_cmds=cat
18083 fi
18084 EOF
18085
18086 cat >> $CONFIG_STATUS <<EOF
18087
18088 CONFIG_FILES=\${CONFIG_FILES-"\
18089 Makefile:build/top.mk:Makefile.in:build/dir.mk \
18090 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
18091 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
18092 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
18093 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
18094 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
18095 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
18096 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
18097 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
18098 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
18099 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
18100 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
18101 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18102 include/Makefile:build/top.mk:include/Makefile.in \
18103 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18104 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18105 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18106 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18107 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18108 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18109 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18110 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18111 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18112 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18113 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18114 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18115 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18116 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18117 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18118 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18119 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18120 servers/slapd/back-monitor/Makefile:build/top.mk:servers/slapd/back-monitor/Makefile.in:build/mod.mk \
18121 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18122 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18123 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18124 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18125 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18126 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18127 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18128 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18129 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18130 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18131 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
18132 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
18133 "}
18134 EOF
18135 cat >> $CONFIG_STATUS <<\EOF
18136 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18137   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18138   case "$ac_file" in
18139   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18140        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18141   *) ac_file_in="${ac_file}.in" ;;
18142   esac
18143
18144   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18145
18146   # Remove last slash and all that follows it.  Not all systems have dirname.
18147   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18148   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18149     # The file is in a subdirectory.
18150     test ! -d "$ac_dir" && mkdir "$ac_dir"
18151     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18152     # A "../" for each directory in $ac_dir_suffix.
18153     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18154   else
18155     ac_dir_suffix= ac_dots=
18156   fi
18157
18158   case "$ac_given_srcdir" in
18159   .)  srcdir=.
18160       if test -z "$ac_dots"; then top_srcdir=.
18161       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18162   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18163   *) # Relative path.
18164     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18165     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18166   esac
18167
18168   case "$ac_given_INSTALL" in
18169   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18170   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18171   esac
18172
18173   echo creating "$ac_file"
18174   rm -f "$ac_file"
18175   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18176   case "$ac_file" in
18177   *[Mm]akefile*) ac_comsub="1i\\
18178 # $configure_input" ;;
18179   *) ac_comsub= ;;
18180   esac
18181
18182   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18183   sed -e "$ac_comsub
18184 s%@configure_input@%$configure_input%g
18185 s%@srcdir@%$srcdir%g
18186 s%@top_srcdir@%$top_srcdir%g
18187 s%@INSTALL@%$INSTALL%g
18188 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18189 fi; done
18190 rm -f conftest.s*
18191
18192 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18193 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18194 #
18195 # ac_d sets the value in "#define NAME VALUE" lines.
18196 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18197 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18198 ac_dC='\3'
18199 ac_dD='%g'
18200 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18201 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18202 ac_uB='\([      ]\)%\1#\2define\3'
18203 ac_uC=' '
18204 ac_uD='\4%g'
18205 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18206 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18207 ac_eB='$%\1#\2define\3'
18208 ac_eC=' '
18209 ac_eD='%g'
18210
18211 if test "${CONFIG_HEADERS+set}" != set; then
18212 EOF
18213 cat >> $CONFIG_STATUS <<EOF
18214   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18215 EOF
18216 cat >> $CONFIG_STATUS <<\EOF
18217 fi
18218 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18219   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18220   case "$ac_file" in
18221   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18222        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18223   *) ac_file_in="${ac_file}.in" ;;
18224   esac
18225
18226   echo creating $ac_file
18227
18228   rm -f conftest.frag conftest.in conftest.out
18229   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18230   cat $ac_file_inputs > conftest.in
18231
18232 EOF
18233
18234 # Transform confdefs.h into a sed script conftest.vals that substitutes
18235 # the proper values into config.h.in to produce config.h.  And first:
18236 # Protect against being on the right side of a sed subst in config.status.
18237 # Protect against being in an unquoted here document in config.status.
18238 rm -f conftest.vals
18239 cat > conftest.hdr <<\EOF
18240 s/[\\&%]/\\&/g
18241 s%[\\$`]%\\&%g
18242 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18243 s%ac_d%ac_u%gp
18244 s%ac_u%ac_e%gp
18245 EOF
18246 sed -n -f conftest.hdr confdefs.h > conftest.vals
18247 rm -f conftest.hdr
18248
18249 # This sed command replaces #undef with comments.  This is necessary, for
18250 # example, in the case of _POSIX_SOURCE, which is predefined and required
18251 # on some systems where configure will not decide to define it.
18252 cat >> conftest.vals <<\EOF
18253 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18254 EOF
18255
18256 # Break up conftest.vals because some shells have a limit on
18257 # the size of here documents, and old seds have small limits too.
18258
18259 rm -f conftest.tail
18260 while :
18261 do
18262   ac_lines=`grep -c . conftest.vals`
18263   # grep -c gives empty output for an empty file on some AIX systems.
18264   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18265   # Write a limited-size here document to conftest.frag.
18266   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18267   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18268   echo 'CEOF
18269   sed -f conftest.frag conftest.in > conftest.out
18270   rm -f conftest.in
18271   mv conftest.out conftest.in
18272 ' >> $CONFIG_STATUS
18273   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18274   rm -f conftest.vals
18275   mv conftest.tail conftest.vals
18276 done
18277 rm -f conftest.vals
18278
18279 cat >> $CONFIG_STATUS <<\EOF
18280   rm -f conftest.frag conftest.h
18281   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18282   cat conftest.in >> conftest.h
18283   rm -f conftest.in
18284   if cmp -s $ac_file conftest.h 2>/dev/null; then
18285     echo "$ac_file is unchanged"
18286     rm -f conftest.h
18287   else
18288     # Remove last slash and all that follows it.  Not all systems have dirname.
18289       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18290       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18291       # The file is in a subdirectory.
18292       test ! -d "$ac_dir" && mkdir "$ac_dir"
18293     fi
18294     rm -f $ac_file
18295     mv conftest.h $ac_file
18296   fi
18297 fi; done
18298
18299 EOF
18300 cat >> $CONFIG_STATUS <<EOF
18301
18302 EOF
18303 cat >> $CONFIG_STATUS <<\EOF
18304
18305 date > stamp-h
18306 echo Please \"make depend\" to build dependencies
18307
18308 exit 0
18309 EOF
18310 chmod +x $CONFIG_STATUS
18311 rm -fr confdefs* $ac_clean_files
18312 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18313