]> git.sur5r.net Git - openldap/blob - configure
Sync with 2.x
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.361 2001/06/22 16:10:55 kurt Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable V2 Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable V2 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 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-passwd       enable passwd backend [no]"
118 ac_help="$ac_help
119     --with-passwd-module  module type [static]"
120 ac_help="$ac_help
121     --enable-perl         enable perl backend [no]"
122 ac_help="$ac_help
123     --with-perl-module    module type [static]"
124 ac_help="$ac_help
125     --enable-shell        enable shell backend [no]"
126 ac_help="$ac_help
127     --with-shell-module   module type [static]"
128 ac_help="$ac_help
129     --enable-sql          enable sql backend [no]"
130 ac_help="$ac_help
131     --with-sql-module     module type [static]"
132 ac_help="$ac_help
133     --enable-tcl          enable tcl backend [no]"
134 ac_help="$ac_help
135     --with-tcl-module     module type [static]"
136 ac_help="$ac_help
137 SLURPD (Replication Daemon) Options:"
138 ac_help="$ac_help
139   --enable-slurpd         enable building slurpd [auto]"
140 ac_help="$ac_help
141 Library Generation & Linking Options"
142 ac_help="$ac_help
143   --enable-static[=PKGS]  build static libraries [default=yes]"
144 ac_help="$ac_help
145   --enable-shared[=PKGS]  build shared libraries [default=yes]"
146 ac_help="$ac_help
147   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
148 ac_help="$ac_help
149   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
150 ac_help="$ac_help
151   --disable-libtool-lock  avoid locking (might break parallel builds)"
152
153 # Initialize some variables set by options.
154 # The variables have the same names as the options, with
155 # dashes changed to underlines.
156 build=NONE
157 cache_file=./config.cache
158 exec_prefix=NONE
159 host=NONE
160 no_create=
161 nonopt=NONE
162 no_recursion=
163 prefix=NONE
164 program_prefix=NONE
165 program_suffix=NONE
166 program_transform_name=s,x,x,
167 silent=
168 site=
169 srcdir=
170 target=NONE
171 verbose=
172 x_includes=NONE
173 x_libraries=NONE
174 bindir='${exec_prefix}/bin'
175 sbindir='${exec_prefix}/sbin'
176 libexecdir='${exec_prefix}/libexec'
177 datadir='${prefix}/share'
178 sysconfdir='${prefix}/etc'
179 sharedstatedir='${prefix}/com'
180 localstatedir='${prefix}/var'
181 libdir='${exec_prefix}/lib'
182 includedir='${prefix}/include'
183 oldincludedir='/usr/include'
184 infodir='${prefix}/info'
185 mandir='${prefix}/man'
186
187 # Initialize some other variables.
188 subdirs=
189 MFLAGS= MAKEFLAGS=
190 SHELL=${CONFIG_SHELL-/bin/sh}
191 # Maximum number of lines to put in a shell here document.
192 ac_max_here_lines=12
193
194 ac_prev=
195 for ac_option
196 do
197
198   # If the previous option needs an argument, assign it.
199   if test -n "$ac_prev"; then
200     eval "$ac_prev=\$ac_option"
201     ac_prev=
202     continue
203   fi
204
205   case "$ac_option" in
206   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
207   *) ac_optarg= ;;
208   esac
209
210   # Accept the important Cygnus configure options, so we can diagnose typos.
211
212   case "$ac_option" in
213
214   -bindir | --bindir | --bindi | --bind | --bin | --bi)
215     ac_prev=bindir ;;
216   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
217     bindir="$ac_optarg" ;;
218
219   -build | --build | --buil | --bui | --bu)
220     ac_prev=build ;;
221   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
222     build="$ac_optarg" ;;
223
224   -cache-file | --cache-file | --cache-fil | --cache-fi \
225   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
226     ac_prev=cache_file ;;
227   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
228   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
229     cache_file="$ac_optarg" ;;
230
231   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
232     ac_prev=datadir ;;
233   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
234   | --da=*)
235     datadir="$ac_optarg" ;;
236
237   -disable-* | --disable-*)
238     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
239     # Reject names that are not valid shell variable names.
240     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
241       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
242     fi
243     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
244     eval "enable_${ac_feature}=no" ;;
245
246   -enable-* | --enable-*)
247     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
248     # Reject names that are not valid shell variable names.
249     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
250       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
251     fi
252     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
253     case "$ac_option" in
254       *=*) ;;
255       *) ac_optarg=yes ;;
256     esac
257     eval "enable_${ac_feature}='$ac_optarg'" ;;
258
259   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
260   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
261   | --exec | --exe | --ex)
262     ac_prev=exec_prefix ;;
263   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
264   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
265   | --exec=* | --exe=* | --ex=*)
266     exec_prefix="$ac_optarg" ;;
267
268   -gas | --gas | --ga | --g)
269     # Obsolete; use --with-gas.
270     with_gas=yes ;;
271
272   -help | --help | --hel | --he)
273     # Omit some internal or obsolete options to make the list less imposing.
274     # This message is too long to be a string in the A/UX 3.1 sh.
275     cat << EOF
276 Usage: configure [options] [host]
277 Options: [defaults in brackets after descriptions]
278 Configuration:
279   --cache-file=FILE       cache test results in FILE
280   --help                  print this message
281   --no-create             do not create output files
282   --quiet, --silent       do not print \`checking...' messages
283   --version               print the version of autoconf that created configure
284 Directory and file names:
285   --prefix=PREFIX         install architecture-independent files in PREFIX
286                           [$ac_default_prefix]
287   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
288                           [same as prefix]
289   --bindir=DIR            user executables in DIR [EPREFIX/bin]
290   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
291   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
292   --datadir=DIR           read-only architecture-independent data in DIR
293                           [PREFIX/share]
294   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
295   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
296                           [PREFIX/com]
297   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
298   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
299   --includedir=DIR        C header files in DIR [PREFIX/include]
300   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
301   --infodir=DIR           info documentation in DIR [PREFIX/info]
302   --mandir=DIR            man documentation in DIR [PREFIX/man]
303   --srcdir=DIR            find the sources in DIR [configure dir or ..]
304   --program-prefix=PREFIX prepend PREFIX to installed program names
305   --program-suffix=SUFFIX append SUFFIX to installed program names
306   --program-transform-name=PROGRAM
307                           run sed PROGRAM on installed program names
308 EOF
309     cat << EOF
310 Host type:
311   --build=BUILD           configure for building on BUILD [BUILD=HOST]
312   --host=HOST             configure for HOST [guessed]
313   --target=TARGET         configure for TARGET [TARGET=HOST]
314 Features and packages:
315   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
316   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
317   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
318   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
319   --x-includes=DIR        X include files are in DIR
320   --x-libraries=DIR       X library files are in DIR
321 EOF
322     if test -n "$ac_help"; then
323       echo "--enable and --with options recognized:$ac_help"
324     fi
325     exit 0 ;;
326
327   -host | --host | --hos | --ho)
328     ac_prev=host ;;
329   -host=* | --host=* | --hos=* | --ho=*)
330     host="$ac_optarg" ;;
331
332   -includedir | --includedir | --includedi | --included | --include \
333   | --includ | --inclu | --incl | --inc)
334     ac_prev=includedir ;;
335   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
336   | --includ=* | --inclu=* | --incl=* | --inc=*)
337     includedir="$ac_optarg" ;;
338
339   -infodir | --infodir | --infodi | --infod | --info | --inf)
340     ac_prev=infodir ;;
341   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
342     infodir="$ac_optarg" ;;
343
344   -libdir | --libdir | --libdi | --libd)
345     ac_prev=libdir ;;
346   -libdir=* | --libdir=* | --libdi=* | --libd=*)
347     libdir="$ac_optarg" ;;
348
349   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
350   | --libexe | --libex | --libe)
351     ac_prev=libexecdir ;;
352   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
353   | --libexe=* | --libex=* | --libe=*)
354     libexecdir="$ac_optarg" ;;
355
356   -localstatedir | --localstatedir | --localstatedi | --localstated \
357   | --localstate | --localstat | --localsta | --localst \
358   | --locals | --local | --loca | --loc | --lo)
359     ac_prev=localstatedir ;;
360   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
361   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
362   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
363     localstatedir="$ac_optarg" ;;
364
365   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
366     ac_prev=mandir ;;
367   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
368     mandir="$ac_optarg" ;;
369
370   -nfp | --nfp | --nf)
371     # Obsolete; use --without-fp.
372     with_fp=no ;;
373
374   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
375   | --no-cr | --no-c)
376     no_create=yes ;;
377
378   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
379   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
380     no_recursion=yes ;;
381
382   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
383   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
384   | --oldin | --oldi | --old | --ol | --o)
385     ac_prev=oldincludedir ;;
386   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
387   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
388   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
389     oldincludedir="$ac_optarg" ;;
390
391   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
392     ac_prev=prefix ;;
393   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
394     prefix="$ac_optarg" ;;
395
396   -program-prefix | --program-prefix | --program-prefi | --program-pref \
397   | --program-pre | --program-pr | --program-p)
398     ac_prev=program_prefix ;;
399   -program-prefix=* | --program-prefix=* | --program-prefi=* \
400   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
401     program_prefix="$ac_optarg" ;;
402
403   -program-suffix | --program-suffix | --program-suffi | --program-suff \
404   | --program-suf | --program-su | --program-s)
405     ac_prev=program_suffix ;;
406   -program-suffix=* | --program-suffix=* | --program-suffi=* \
407   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
408     program_suffix="$ac_optarg" ;;
409
410   -program-transform-name | --program-transform-name \
411   | --program-transform-nam | --program-transform-na \
412   | --program-transform-n | --program-transform- \
413   | --program-transform | --program-transfor \
414   | --program-transfo | --program-transf \
415   | --program-trans | --program-tran \
416   | --progr-tra | --program-tr | --program-t)
417     ac_prev=program_transform_name ;;
418   -program-transform-name=* | --program-transform-name=* \
419   | --program-transform-nam=* | --program-transform-na=* \
420   | --program-transform-n=* | --program-transform-=* \
421   | --program-transform=* | --program-transfor=* \
422   | --program-transfo=* | --program-transf=* \
423   | --program-trans=* | --program-tran=* \
424   | --progr-tra=* | --program-tr=* | --program-t=*)
425     program_transform_name="$ac_optarg" ;;
426
427   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
428   | -silent | --silent | --silen | --sile | --sil)
429     silent=yes ;;
430
431   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
432     ac_prev=sbindir ;;
433   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
434   | --sbi=* | --sb=*)
435     sbindir="$ac_optarg" ;;
436
437   -sharedstatedir | --sharedstatedir | --sharedstatedi \
438   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
439   | --sharedst | --shareds | --shared | --share | --shar \
440   | --sha | --sh)
441     ac_prev=sharedstatedir ;;
442   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
443   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
444   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
445   | --sha=* | --sh=*)
446     sharedstatedir="$ac_optarg" ;;
447
448   -site | --site | --sit)
449     ac_prev=site ;;
450   -site=* | --site=* | --sit=*)
451     site="$ac_optarg" ;;
452
453   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
454     ac_prev=srcdir ;;
455   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
456     srcdir="$ac_optarg" ;;
457
458   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
459   | --syscon | --sysco | --sysc | --sys | --sy)
460     ac_prev=sysconfdir ;;
461   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
462   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
463     sysconfdir="$ac_optarg" ;;
464
465   -target | --target | --targe | --targ | --tar | --ta | --t)
466     ac_prev=target ;;
467   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
468     target="$ac_optarg" ;;
469
470   -v | -verbose | --verbose | --verbos | --verbo | --verb)
471     verbose=yes ;;
472
473   -version | --version | --versio | --versi | --vers)
474     echo "configure generated by autoconf version 2.13.1"
475     exit 0 ;;
476
477   -with-* | --with-*)
478     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
479     # Reject names that are not valid shell variable names.
480     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
481       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
482     fi
483     ac_package=`echo $ac_package| sed 's/-/_/g'`
484     case "$ac_option" in
485       *=*) ;;
486       *) ac_optarg=yes ;;
487     esac
488     eval "with_${ac_package}='$ac_optarg'" ;;
489
490   -without-* | --without-*)
491     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
492     # Reject names that are not valid shell variable names.
493     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
494       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
495     fi
496     ac_package=`echo $ac_package| sed 's/-/_/g'`
497     eval "with_${ac_package}=no" ;;
498
499   --x)
500     # Obsolete; use --with-x.
501     with_x=yes ;;
502
503   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
504   | --x-incl | --x-inc | --x-in | --x-i)
505     ac_prev=x_includes ;;
506   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
507   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
508     x_includes="$ac_optarg" ;;
509
510   -x-libraries | --x-libraries | --x-librarie | --x-librari \
511   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
512     ac_prev=x_libraries ;;
513   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
514   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
515     x_libraries="$ac_optarg" ;;
516
517   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
518     ;;
519
520   *)
521     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
522       echo "configure: warning: $ac_option: invalid host type" 1>&2
523     fi
524     if test "x$nonopt" != xNONE; then
525       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
526     fi
527     nonopt="$ac_option"
528     ;;
529
530   esac
531 done
532
533 if test -n "$ac_prev"; then
534   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
535 fi
536
537 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
538
539 # File descriptor usage:
540 # 0 standard input
541 # 1 file creation
542 # 2 errors and warnings
543 # 3 some systems may open it to /dev/tty
544 # 4 used on the Kubota Titan
545 # 6 checking for... messages and results
546 # 5 compiler messages saved in config.log
547 if test "$silent" = yes; then
548   exec 6>/dev/null
549 else
550   exec 6>&1
551 fi
552 exec 5>./config.log
553
554 echo "\
555 This file contains any messages produced by compilers while
556 running configure, to aid debugging if configure makes a mistake.
557 " 1>&5
558
559 # Strip out --no-create and --no-recursion so they do not pile up.
560 # Also quote any args containing shell metacharacters.
561 ac_configure_args=
562 for ac_arg
563 do
564   case "$ac_arg" in
565   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
566   | --no-cr | --no-c) ;;
567   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
568   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
569   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
570   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
571   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
572   esac
573 done
574
575 # NLS nuisances.
576 # Only set these to C if already set.  These must not be set unconditionally
577 # because not all systems understand e.g. LANG=C (notably SCO).
578 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
579 # Non-C LC_CTYPE values break the ctype check.
580 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
581 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
582 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
583 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
584
585 # confdefs.h avoids OS command line length limits that DEFS can exceed.
586 rm -rf conftest* confdefs.h
587 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
588 echo > confdefs.h
589
590 # A filename unique to this package, relative to the directory that
591 # configure is in, which we can look for to find out if srcdir is correct.
592 ac_unique_file=build/version.sh
593
594 # Find the source files, if location was not specified.
595 if test -z "$srcdir"; then
596   ac_srcdir_defaulted=yes
597   # Try the directory containing this script, then its parent.
598   ac_prog=$0
599   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
600   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
601   srcdir=$ac_confdir
602   if test ! -r $srcdir/$ac_unique_file; then
603     srcdir=..
604   fi
605 else
606   ac_srcdir_defaulted=no
607 fi
608 if test ! -r $srcdir/$ac_unique_file; then
609   if test "$ac_srcdir_defaulted" = yes; then
610     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
611   else
612     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
613   fi
614 fi
615 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
616
617 # Prefer explicitly selected file to automatically selected ones.
618 if test -z "$CONFIG_SITE"; then
619   if test "x$prefix" != xNONE; then
620     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
621   else
622     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
623   fi
624 fi
625 for ac_site_file in $CONFIG_SITE; do
626   if test -r "$ac_site_file"; then
627     echo "loading site script $ac_site_file"
628     . "$ac_site_file"
629   fi
630 done
631
632
633 ac_ext=c
634 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
635 ac_cpp='$CPP $CPPFLAGS'
636 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
637 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
638 cross_compiling=$ac_cv_prog_cc_cross
639
640 ac_exeext=
641 ac_objext=o
642 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
643   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
644   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
645     ac_n= ac_c='
646 ' ac_t='        '
647   else
648     ac_n=-n ac_c= ac_t=
649   fi
650 else
651   ac_n= ac_c='\c' ac_t=
652 fi
653
654
655 # set unset (borrowed from autoconf 2.49c)
656 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
657   ol_unset=unset
658 else
659   ol_unset=false
660 fi
661 # unset CDPATH
662 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
663
664 ac_aux_dir=
665 for ac_dir in build $srcdir/build; do
666   if test -f $ac_dir/install-sh; then
667     ac_aux_dir=$ac_dir
668     ac_install_sh="$ac_aux_dir/install-sh -c"
669     break
670   elif 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/shtool; then
675     ac_aux_dir=$ac_dir
676     ac_install_sh="$ac_aux_dir/shtool install -c"
677     break
678   fi
679 done
680 if test -z "$ac_aux_dir"; then
681   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
682 fi
683 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
684 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
685 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
686
687 eval `$ac_aux_dir/version.sh`
688 if test -z "$OL_STRING"; then
689         { echo "configure: error: could not determine version" 1>&2; exit 1; }
690 fi
691
692 echo "Configuring $OL_STRING ..."
693
694
695 echo $ac_n "checking host system type""... $ac_c" 1>&6
696 echo "configure:697: checking host system type" >&5
697 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
698
699 # Make sure we can run config.sub.
700   if $ac_config_sub sun4 >/dev/null 2>&1; then :
701     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
702   fi
703
704   ac_cv_host_alias=$host
705   case "$ac_cv_host_alias" in
706   NONE)
707     case $nonopt in
708     NONE)
709       if ac_cv_host_alias=`$ac_config_guess`; then :
710       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
711       fi ;;
712     *) ac_cv_host_alias=$nonopt ;;
713     esac ;;
714   esac
715
716   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
717   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
718   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
719   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
720 else
721   echo $ac_n "(cached) $ac_c" 1>&6
722 fi
723
724 echo "$ac_t""$ac_cv_host" 1>&6
725
726 host=$ac_cv_host
727 host_alias=$ac_cv_host_alias
728 host_cpu=$ac_cv_host_cpu
729 host_vendor=$ac_cv_host_vendor
730 host_os=$ac_cv_host_os
731
732
733
734
735
736 echo $ac_n "checking target system type""... $ac_c" 1>&6
737 echo "configure:738: checking target system type" >&5
738 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
739
740 # Make sure we can run config.sub.
741   if $ac_config_sub sun4 >/dev/null 2>&1; then :
742     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
743   fi
744
745   ac_cv_target_alias=$target
746   case "$ac_cv_target_alias" in
747   NONE)
748     case $nonopt in
749     NONE)
750       ac_cv_target_alias=$host_alias ;;
751
752     *) ac_cv_target_alias=$nonopt ;;
753     esac ;;
754   esac
755
756   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
757   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
758   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
759   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
760 else
761   echo $ac_n "(cached) $ac_c" 1>&6
762 fi
763
764 echo "$ac_t""$ac_cv_target" 1>&6
765
766 target=$ac_cv_target
767 target_alias=$ac_cv_target_alias
768 target_cpu=$ac_cv_target_cpu
769 target_vendor=$ac_cv_target_vendor
770 target_os=$ac_cv_target_os
771
772
773
774
775
776 echo $ac_n "checking build system type""... $ac_c" 1>&6
777 echo "configure:778: checking build system type" >&5
778 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
779
780 # Make sure we can run config.sub.
781   if $ac_config_sub sun4 >/dev/null 2>&1; then :
782     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
783   fi
784
785   ac_cv_build_alias=$build
786   case "$ac_cv_build_alias" in
787   NONE)
788     case $nonopt in
789     NONE)
790       ac_cv_build_alias=$host_alias ;;
791
792     *) ac_cv_build_alias=$nonopt ;;
793     esac ;;
794   esac
795
796   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
797   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
798   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
799   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
800 else
801   echo $ac_n "(cached) $ac_c" 1>&6
802 fi
803
804 echo "$ac_t""$ac_cv_build" 1>&6
805
806 build=$ac_cv_build
807 build_alias=$ac_cv_build_alias
808 build_cpu=$ac_cv_build_cpu
809 build_vendor=$ac_cv_build_vendor
810 build_os=$ac_cv_build_os
811
812
813
814
815
816 # Do some error checking and defaulting for the host and target type.
817 # The inputs are:
818 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
819 #
820 # The rules are:
821 # 1. You are not allowed to specify --host, --target, and nonopt at the
822 #    same time.
823 # 2. Host defaults to nonopt.
824 # 3. If nonopt is not specified, then host defaults to the current host,
825 #    as determined by config.guess.
826 # 4. Target and build default to nonopt.
827 # 5. If nonopt is not specified, then target and build default to host.
828
829 # The aliases save the names the user supplied, while $host etc.
830 # will get canonicalized.
831 case $host---$target---$nonopt in
832 NONE---*---* | *---NONE---* | *---*---NONE) ;;
833 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
834 esac
835
836 test "$host_alias" != "$target_alias" &&
837   test "$program_prefix$program_suffix$program_transform_name" = \
838     NONENONEs,x,x, &&
839   program_prefix=${target_alias}-
840
841
842 # Find a good install program.  We prefer a C program (faster),
843 # so one script is as good as another.  But avoid the broken or
844 # incompatible versions:
845 # SysV /etc/install, /usr/sbin/install
846 # SunOS /usr/etc/install
847 # IRIX /sbin/install
848 # AIX /bin/install
849 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
850 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
851 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
852 # ./install, which can be erroneously created by make from ./install.sh.
853 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
854 echo "configure:855: checking for a BSD compatible install" >&5
855 if test -z "$INSTALL"; then
856 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
857   echo $ac_n "(cached) $ac_c" 1>&6
858 else
859     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
860   for ac_dir in $PATH; do
861     # Account for people who put trailing slashes in PATH elements.
862     case "$ac_dir/" in
863     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
864     *)
865       # OSF1 and SCO ODT 3.0 have their own names for install.
866       # Don't use installbsd from OSF since it installs stuff as root
867       # by default.
868       for ac_prog in ginstall scoinst install; do
869         if test -f $ac_dir/$ac_prog; then
870           if test $ac_prog = install &&
871             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
872             # AIX install.  It has an incompatible calling convention.
873             :
874           elif test $ac_prog = install &&
875             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
876             # program-specific install script used by HP pwplus--don't use.
877             :
878           else
879             ac_cv_path_install="$ac_dir/$ac_prog -c"
880             break 2
881           fi
882         fi
883       done
884       ;;
885     esac
886   done
887   IFS="$ac_save_IFS"
888
889 fi
890   if test "${ac_cv_path_install+set}" = set; then
891     INSTALL="$ac_cv_path_install"
892   else
893     # As a last resort, use the slow shell script.  We don't cache a
894     # path for INSTALL within a source directory, because that will
895     # break other packages using the cache if that directory is
896     # removed, or if the path is relative.
897     INSTALL="$ac_install_sh"
898   fi
899 fi
900 echo "$ac_t""$INSTALL" 1>&6
901
902 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
903 # It thinks the first close brace ends the variable substitution.
904 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
905
906 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
907
908 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
909
910 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
911 echo "configure:912: checking whether build environment is sane" >&5
912 # Just in case
913 sleep 1
914 echo timestamp > conftestfile
915 # Do `set' in a subshell so we don't clobber the current shell's
916 # arguments.  Must try -L first in case configure is actually a
917 # symlink; some systems play weird games with the mod time of symlinks
918 # (eg FreeBSD returns the mod time of the symlink's containing
919 # directory).
920 if (
921    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
922    if test "$*" = "X"; then
923       # -L didn't work.
924       set X `ls -t $srcdir/configure conftestfile`
925    fi
926    if test "$*" != "X $srcdir/configure conftestfile" \
927       && test "$*" != "X conftestfile $srcdir/configure"; then
928
929       # If neither matched, then we have a broken ls.  This can happen
930       # if, for instance, CONFIG_SHELL is bash and it inherits a
931       # broken ls alias from the environment.  This has actually
932       # happened.  Such a system could not be considered "sane".
933       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
934 alias in your environment" 1>&2; exit 1; }
935    fi
936
937    test "$2" = conftestfile
938    )
939 then
940    # Ok.
941    :
942 else
943    { echo "configure: error: newly created file is older than distributed files!
944 Check your system clock" 1>&2; exit 1; }
945 fi
946 rm -f conftest*
947 echo "$ac_t""yes" 1>&6
948 if test "$program_transform_name" = s,x,x,; then
949   program_transform_name=
950 else
951   # Double any \ or $.  echo might interpret backslashes.
952   cat <<\EOF_SED > conftestsed
953 s,\\,\\\\,g; s,\$,$$,g
954 EOF_SED
955   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
956   rm -f conftestsed
957 fi
958 test "$program_prefix" != NONE &&
959   program_transform_name="s,^,${program_prefix},;$program_transform_name"
960 # Use a double $ so make ignores it.
961 test "$program_suffix" != NONE &&
962   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
963
964 # sed with no file args requires a program.
965 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
966
967 for ac_prog in mawk gawk nawk awk
968 do
969 # Extract the first word of "$ac_prog", so it can be a program name with args.
970 set dummy $ac_prog; ac_word=$2
971 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
972 echo "configure:973: checking for $ac_word" >&5
973 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
974   echo $ac_n "(cached) $ac_c" 1>&6
975 else
976   if test -n "$AWK"; then
977   ac_cv_prog_AWK="$AWK" # Let the user override the test.
978 else
979   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
980   ac_dummy="$PATH"
981   for ac_dir in $ac_dummy; do
982     test -z "$ac_dir" && ac_dir=.
983     if test -f $ac_dir/$ac_word; then
984       ac_cv_prog_AWK="$ac_prog"
985       break
986     fi
987   done
988   IFS="$ac_save_ifs"
989 fi
990 fi
991 AWK="$ac_cv_prog_AWK"
992 if test -n "$AWK"; then
993   echo "$ac_t""$AWK" 1>&6
994 else
995   echo "$ac_t""no" 1>&6
996 fi
997
998 test -n "$AWK" && break
999 done
1000
1001 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1002 echo "configure:1003: checking whether ${MAKE-make} sets \${MAKE}" >&5
1003 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1004 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1005   echo $ac_n "(cached) $ac_c" 1>&6
1006 else
1007   cat > conftestmake <<\EOF
1008 all:
1009         @echo 'ac_maketemp="${MAKE}"'
1010 EOF
1011 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1012 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1013 if test -n "$ac_maketemp"; then
1014   eval ac_cv_prog_make_${ac_make}_set=yes
1015 else
1016   eval ac_cv_prog_make_${ac_make}_set=no
1017 fi
1018 rm -f conftestmake
1019 fi
1020 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1021   echo "$ac_t""yes" 1>&6
1022   SET_MAKE=
1023 else
1024   echo "$ac_t""no" 1>&6
1025   SET_MAKE="MAKE=${MAKE-make}"
1026 fi
1027
1028
1029
1030 PACKAGE=$OL_PACKAGE
1031
1032 VERSION=$OL_VERSION
1033
1034 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1035   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1036 fi
1037
1038
1039
1040 missing_dir=`cd $ac_aux_dir && pwd`
1041 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1042 echo "configure:1043: checking for working aclocal" >&5
1043 # Run test in a subshell; some versions of sh will print an error if
1044 # an executable is not found, even if stderr is redirected.
1045 # Redirect stdin to placate older versions of autoconf.  Sigh.
1046 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1047    ACLOCAL=aclocal
1048    echo "$ac_t""found" 1>&6
1049 else
1050    ACLOCAL="$missing_dir/missing aclocal"
1051    echo "$ac_t""missing" 1>&6
1052 fi
1053
1054 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1055 echo "configure:1056: checking for working autoconf" >&5
1056 # Run test in a subshell; some versions of sh will print an error if
1057 # an executable is not found, even if stderr is redirected.
1058 # Redirect stdin to placate older versions of autoconf.  Sigh.
1059 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1060    AUTOCONF=autoconf
1061    echo "$ac_t""found" 1>&6
1062 else
1063    AUTOCONF="$missing_dir/missing autoconf"
1064    echo "$ac_t""missing" 1>&6
1065 fi
1066
1067 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1068 echo "configure:1069: checking for working automake" >&5
1069 # Run test in a subshell; some versions of sh will print an error if
1070 # an executable is not found, even if stderr is redirected.
1071 # Redirect stdin to placate older versions of autoconf.  Sigh.
1072 if (automake --version) < /dev/null > /dev/null 2>&1; then
1073    AUTOMAKE=automake
1074    echo "$ac_t""found" 1>&6
1075 else
1076    AUTOMAKE="$missing_dir/missing automake"
1077    echo "$ac_t""missing" 1>&6
1078 fi
1079
1080 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1081 echo "configure:1082: checking for working autoheader" >&5
1082 # Run test in a subshell; some versions of sh will print an error if
1083 # an executable is not found, even if stderr is redirected.
1084 # Redirect stdin to placate older versions of autoconf.  Sigh.
1085 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1086    AUTOHEADER=autoheader
1087    echo "$ac_t""found" 1>&6
1088 else
1089    AUTOHEADER="$missing_dir/missing autoheader"
1090    echo "$ac_t""missing" 1>&6
1091 fi
1092
1093 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1094 echo "configure:1095: checking for working makeinfo" >&5
1095 # Run test in a subshell; some versions of sh will print an error if
1096 # an executable is not found, even if stderr is redirected.
1097 # Redirect stdin to placate older versions of autoconf.  Sigh.
1098 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1099    MAKEINFO=makeinfo
1100    echo "$ac_t""found" 1>&6
1101 else
1102    MAKEINFO="$missing_dir/missing makeinfo"
1103    echo "$ac_t""missing" 1>&6
1104 fi
1105
1106 install_sh="$missing_dir/install-sh"
1107 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1108
1109 for ac_prog in gnutar gtar tar
1110 do
1111 # Extract the first word of "$ac_prog", so it can be a program name with args.
1112 set dummy $ac_prog; ac_word=$2
1113 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1114 echo "configure:1115: checking for $ac_word" >&5
1115 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1116   echo $ac_n "(cached) $ac_c" 1>&6
1117 else
1118   if test -n "$AMTAR"; then
1119   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1120 else
1121   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1122   ac_dummy="$PATH"
1123   for ac_dir in $ac_dummy; do
1124     test -z "$ac_dir" && ac_dir=.
1125     if test -f $ac_dir/$ac_word; then
1126       ac_cv_prog_AMTAR="$ac_prog"
1127       break
1128     fi
1129   done
1130   IFS="$ac_save_ifs"
1131 fi
1132 fi
1133 AMTAR="$ac_cv_prog_AMTAR"
1134 if test -n "$AMTAR"; then
1135   echo "$ac_t""$AMTAR" 1>&6
1136 else
1137   echo "$ac_t""no" 1>&6
1138 fi
1139
1140 test -n "$AMTAR" && break
1141 done
1142
1143
1144 AMTARFLAGS=
1145 if test -n "$AMTAR"; then
1146   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1147         AMTARFLAGS=o
1148   fi
1149 fi
1150
1151 cat >> confdefs.h <<EOF
1152 #define OPENLDAP_PACKAGE "$PACKAGE"
1153 EOF
1154
1155 cat >> confdefs.h <<EOF
1156 #define OPENLDAP_VERSION "$VERSION"
1157 EOF
1158
1159
1160 cat >> confdefs.h <<EOF
1161 #define LDAP_VENDOR_VERSION $OL_API_INC
1162 EOF
1163
1164 cat >> confdefs.h <<EOF
1165 #define LDAP_VENDOR_VERSION_MAJOR $OL_MAJOR
1166 EOF
1167
1168 cat >> confdefs.h <<EOF
1169 #define LDAP_VENDOR_VERSION_MINOR $OL_MINOR
1170 EOF
1171
1172 cat >> confdefs.h <<EOF
1173 #define LDAP_VENDOR_VERSION_PATCH $OL_PATCH
1174 EOF
1175
1176
1177 OPENLDAP_LIBVERSION=$OL_API_LIB
1178
1179
1180
1181 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1182 echo "configure:1183: checking configure arguments" >&5
1183
1184
1185 top_builddir=`pwd`
1186
1187 ldap_subdir="/openldap"
1188
1189 # Check whether --with-subdir or --without-subdir was given.
1190 if test "${with_subdir+set}" = set; then
1191   withval="$with_subdir"
1192   case "$withval" in
1193         no) ldap_subdir=""
1194                 ;;
1195         yes)
1196                 ;;
1197         /*|\\*)
1198                 ldap_subdir="$withval"
1199                 ;;
1200         *)
1201                 ldap_subdir="/$withval"
1202                 ;;
1203 esac
1204
1205 fi
1206
1207
1208 # OpenLDAP --enable-debug
1209         # Check whether --enable-debug or --disable-debug was given.
1210 if test "${enable_debug+set}" = set; then
1211   enableval="$enable_debug"
1212   
1213         ol_arg=invalid
1214         for ol_val in auto yes no ; do
1215                 if test "$enableval" = "$ol_val" ; then
1216                         ol_arg="$ol_val"
1217                 fi
1218         done
1219         if test "$ol_arg" = "invalid" ; then
1220                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1221         fi
1222         ol_enable_debug="$ol_arg"
1223
1224 else
1225         ol_enable_debug="yes"
1226 fi
1227 # end --enable-debug
1228 # OpenLDAP --enable-syslog
1229         # Check whether --enable-syslog or --disable-syslog was given.
1230 if test "${enable_syslog+set}" = set; then
1231   enableval="$enable_syslog"
1232   
1233         ol_arg=invalid
1234         for ol_val in auto yes no ; do
1235                 if test "$enableval" = "$ol_val" ; then
1236                         ol_arg="$ol_val"
1237                 fi
1238         done
1239         if test "$ol_arg" = "invalid" ; then
1240                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1241         fi
1242         ol_enable_syslog="$ol_arg"
1243
1244 else
1245         ol_enable_syslog="auto"
1246 fi
1247 # end --enable-syslog
1248 # OpenLDAP --enable-proctitle
1249         # Check whether --enable-proctitle or --disable-proctitle was given.
1250 if test "${enable_proctitle+set}" = set; then
1251   enableval="$enable_proctitle"
1252   
1253         ol_arg=invalid
1254         for ol_val in auto yes no ; do
1255                 if test "$enableval" = "$ol_val" ; then
1256                         ol_arg="$ol_val"
1257                 fi
1258         done
1259         if test "$ol_arg" = "invalid" ; then
1260                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1261         fi
1262         ol_enable_proctitle="$ol_arg"
1263
1264 else
1265         ol_enable_proctitle="yes"
1266 fi
1267 # end --enable-proctitle
1268 # OpenLDAP --enable-cache
1269         # Check whether --enable-cache or --disable-cache was given.
1270 if test "${enable_cache+set}" = set; then
1271   enableval="$enable_cache"
1272   
1273         ol_arg=invalid
1274         for ol_val in auto yes no ; do
1275                 if test "$enableval" = "$ol_val" ; then
1276                         ol_arg="$ol_val"
1277                 fi
1278         done
1279         if test "$ol_arg" = "invalid" ; then
1280                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1281         fi
1282         ol_enable_cache="$ol_arg"
1283
1284 else
1285         ol_enable_cache="no"
1286 fi
1287 # end --enable-cache
1288 # OpenLDAP --enable-referrals
1289         # Check whether --enable-referrals or --disable-referrals was given.
1290 if test "${enable_referrals+set}" = set; then
1291   enableval="$enable_referrals"
1292   
1293         ol_arg=invalid
1294         for ol_val in auto yes no ; do
1295                 if test "$enableval" = "$ol_val" ; then
1296                         ol_arg="$ol_val"
1297                 fi
1298         done
1299         if test "$ol_arg" = "invalid" ; then
1300                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1301         fi
1302         ol_enable_referrals="$ol_arg"
1303
1304 else
1305         ol_enable_referrals="no"
1306 fi
1307 # end --enable-referrals
1308 # OpenLDAP --enable-kbind
1309         # Check whether --enable-kbind or --disable-kbind was given.
1310 if test "${enable_kbind+set}" = set; then
1311   enableval="$enable_kbind"
1312   
1313         ol_arg=invalid
1314         for ol_val in auto yes no ; do
1315                 if test "$enableval" = "$ol_val" ; then
1316                         ol_arg="$ol_val"
1317                 fi
1318         done
1319         if test "$ol_arg" = "invalid" ; then
1320                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1321         fi
1322         ol_enable_kbind="$ol_arg"
1323
1324 else
1325         ol_enable_kbind="no"
1326 fi
1327 # end --enable-kbind
1328 # OpenLDAP --enable-ipv6
1329         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1330 if test "${enable_ipv6+set}" = set; then
1331   enableval="$enable_ipv6"
1332   
1333         ol_arg=invalid
1334         for ol_val in auto yes no ; do
1335                 if test "$enableval" = "$ol_val" ; then
1336                         ol_arg="$ol_val"
1337                 fi
1338         done
1339         if test "$ol_arg" = "invalid" ; then
1340                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1341         fi
1342         ol_enable_ipv6="$ol_arg"
1343
1344 else
1345         ol_enable_ipv6="auto"
1346 fi
1347 # end --enable-ipv6
1348 # OpenLDAP --enable-local
1349         # Check whether --enable-local or --disable-local was given.
1350 if test "${enable_local+set}" = set; then
1351   enableval="$enable_local"
1352   
1353         ol_arg=invalid
1354         for ol_val in auto yes no ; do
1355                 if test "$enableval" = "$ol_val" ; then
1356                         ol_arg="$ol_val"
1357                 fi
1358         done
1359         if test "$ol_arg" = "invalid" ; then
1360                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1361         fi
1362         ol_enable_local="$ol_arg"
1363
1364 else
1365         ol_enable_local="auto"
1366 fi
1367 # end --enable-local
1368 # OpenLDAP --enable-rewrite
1369         # Check whether --enable-rewrite or --disable-rewrite was given.
1370 if test "${enable_rewrite+set}" = set; then
1371   enableval="$enable_rewrite"
1372   
1373         ol_arg=invalid
1374         for ol_val in auto yes no ; do
1375                 if test "$enableval" = "$ol_val" ; then
1376                         ol_arg="$ol_val"
1377                 fi
1378         done
1379         if test "$ol_arg" = "invalid" ; then
1380                 { echo "configure: error: bad value $enableval for --enable-rewrite" 1>&2; exit 1; }
1381         fi
1382         ol_enable_rewrite="$ol_arg"
1383
1384 else
1385         ol_enable_rewrite="no"
1386 fi
1387 # end --enable-rewrite
1388 # OpenLDAP --enable-x_compile
1389         # Check whether --enable-x_compile or --disable-x_compile was given.
1390 if test "${enable_x_compile+set}" = set; then
1391   enableval="$enable_x_compile"
1392   
1393         ol_arg=invalid
1394         for ol_val in yes no ; do
1395                 if test "$enableval" = "$ol_val" ; then
1396                         ol_arg="$ol_val"
1397                 fi
1398         done
1399         if test "$ol_arg" = "invalid" ; then
1400                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1401         fi
1402         ol_enable_x_compile="$ol_arg"
1403
1404 else
1405         ol_enable_x_compile="no"
1406 fi
1407 # end --enable-x_compile
1408
1409
1410 # OpenLDAP --with-cyrus_sasl
1411         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1412 if test "${with_cyrus_sasl+set}" = set; then
1413   withval="$with_cyrus_sasl"
1414   
1415         ol_arg=invalid
1416         for ol_val in auto yes no  ; do
1417                 if test "$withval" = "$ol_val" ; then
1418                         ol_arg="$ol_val"
1419                 fi
1420         done
1421         if test "$ol_arg" = "invalid" ; then
1422                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1423         fi
1424         ol_with_cyrus_sasl="$ol_arg"
1425
1426 else
1427         ol_with_cyrus_sasl="auto"
1428 fi
1429 # end --with-cyrus_sasl
1430
1431 # OpenLDAP --with-fetch
1432         # Check whether --with-fetch or --without-fetch was given.
1433 if test "${with_fetch+set}" = set; then
1434   withval="$with_fetch"
1435   
1436         ol_arg=invalid
1437         for ol_val in auto yes no  ; do
1438                 if test "$withval" = "$ol_val" ; then
1439                         ol_arg="$ol_val"
1440                 fi
1441         done
1442         if test "$ol_arg" = "invalid" ; then
1443                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1444         fi
1445         ol_with_fetch="$ol_arg"
1446
1447 else
1448         ol_with_fetch="auto"
1449 fi
1450 # end --with-fetch
1451
1452 # OpenLDAP --with-kerberos
1453         # Check whether --with-kerberos or --without-kerberos was given.
1454 if test "${with_kerberos+set}" = set; then
1455   withval="$with_kerberos"
1456   
1457         ol_arg=invalid
1458         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1459                 if test "$withval" = "$ol_val" ; then
1460                         ol_arg="$ol_val"
1461                 fi
1462         done
1463         if test "$ol_arg" = "invalid" ; then
1464                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1465         fi
1466         ol_with_kerberos="$ol_arg"
1467
1468 else
1469         ol_with_kerberos="auto"
1470 fi
1471 # end --with-kerberos
1472
1473 # OpenLDAP --with-readline
1474         # Check whether --with-readline or --without-readline was given.
1475 if test "${with_readline+set}" = set; then
1476   withval="$with_readline"
1477   
1478         ol_arg=invalid
1479         for ol_val in auto yes no  ; do
1480                 if test "$withval" = "$ol_val" ; then
1481                         ol_arg="$ol_val"
1482                 fi
1483         done
1484         if test "$ol_arg" = "invalid" ; then
1485                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1486         fi
1487         ol_with_readline="$ol_arg"
1488
1489 else
1490         ol_with_readline="auto"
1491 fi
1492 # end --with-readline
1493
1494 # OpenLDAP --with-threads
1495         # Check whether --with-threads or --without-threads was given.
1496 if test "${with_threads+set}" = set; then
1497   withval="$with_threads"
1498   
1499         ol_arg=invalid
1500         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1501                 if test "$withval" = "$ol_val" ; then
1502                         ol_arg="$ol_val"
1503                 fi
1504         done
1505         if test "$ol_arg" = "invalid" ; then
1506                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1507         fi
1508         ol_with_threads="$ol_arg"
1509
1510 else
1511         ol_with_threads="auto"
1512 fi
1513 # end --with-threads
1514
1515 # OpenLDAP --with-tls
1516         # Check whether --with-tls or --without-tls was given.
1517 if test "${with_tls+set}" = set; then
1518   withval="$with_tls"
1519   
1520         ol_arg=invalid
1521         for ol_val in auto ssleay openssl yes no  ; do
1522                 if test "$withval" = "$ol_val" ; then
1523                         ol_arg="$ol_val"
1524                 fi
1525         done
1526         if test "$ol_arg" = "invalid" ; then
1527                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1528         fi
1529         ol_with_tls="$ol_arg"
1530
1531 else
1532         ol_with_tls="auto"
1533 fi
1534 # end --with-tls
1535
1536 # OpenLDAP --with-yielding_select
1537         # Check whether --with-yielding_select or --without-yielding_select was given.
1538 if test "${with_yielding_select+set}" = set; then
1539   withval="$with_yielding_select"
1540   
1541         ol_arg=invalid
1542         for ol_val in auto yes no manual  ; do
1543                 if test "$withval" = "$ol_val" ; then
1544                         ol_arg="$ol_val"
1545                 fi
1546         done
1547         if test "$ol_arg" = "invalid" ; then
1548                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1549         fi
1550         ol_with_yielding_select="$ol_arg"
1551
1552 else
1553         ol_with_yielding_select="auto"
1554 fi
1555 # end --with-yielding_select
1556
1557
1558
1559 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1560 if test "${with_xxslapdoptions+set}" = set; then
1561   withval="$with_xxslapdoptions"
1562   :
1563 fi
1564
1565 # OpenLDAP --enable-slapd
1566         # Check whether --enable-slapd or --disable-slapd was given.
1567 if test "${enable_slapd+set}" = set; then
1568   enableval="$enable_slapd"
1569   
1570         ol_arg=invalid
1571         for ol_val in auto yes no ; do
1572                 if test "$enableval" = "$ol_val" ; then
1573                         ol_arg="$ol_val"
1574                 fi
1575         done
1576         if test "$ol_arg" = "invalid" ; then
1577                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1578         fi
1579         ol_enable_slapd="$ol_arg"
1580
1581 else
1582         ol_enable_slapd="yes"
1583 fi
1584 # end --enable-slapd
1585 # OpenLDAP --enable-aci
1586         # Check whether --enable-aci or --disable-aci was given.
1587 if test "${enable_aci+set}" = set; then
1588   enableval="$enable_aci"
1589   
1590         ol_arg=invalid
1591         for ol_val in auto yes no ; do
1592                 if test "$enableval" = "$ol_val" ; then
1593                         ol_arg="$ol_val"
1594                 fi
1595         done
1596         if test "$ol_arg" = "invalid" ; then
1597                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1598         fi
1599         ol_enable_aci="$ol_arg"
1600
1601 else
1602         ol_enable_aci="no"
1603 fi
1604 # end --enable-aci
1605 # OpenLDAP --enable-cleartext
1606         # Check whether --enable-cleartext or --disable-cleartext was given.
1607 if test "${enable_cleartext+set}" = set; then
1608   enableval="$enable_cleartext"
1609   
1610         ol_arg=invalid
1611         for ol_val in auto yes no ; do
1612                 if test "$enableval" = "$ol_val" ; then
1613                         ol_arg="$ol_val"
1614                 fi
1615         done
1616         if test "$ol_arg" = "invalid" ; then
1617                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1618         fi
1619         ol_enable_cleartext="$ol_arg"
1620
1621 else
1622         ol_enable_cleartext="yes"
1623 fi
1624 # end --enable-cleartext
1625 # OpenLDAP --enable-crypt
1626         # Check whether --enable-crypt or --disable-crypt was given.
1627 if test "${enable_crypt+set}" = set; then
1628   enableval="$enable_crypt"
1629   
1630         ol_arg=invalid
1631         for ol_val in auto yes no ; do
1632                 if test "$enableval" = "$ol_val" ; then
1633                         ol_arg="$ol_val"
1634                 fi
1635         done
1636         if test "$ol_arg" = "invalid" ; then
1637                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1638         fi
1639         ol_enable_crypt="$ol_arg"
1640
1641 else
1642         ol_enable_crypt="no"
1643 fi
1644 # end --enable-crypt
1645 # OpenLDAP --enable-dynamic
1646         # Check whether --enable-dynamic or --disable-dynamic was given.
1647 if test "${enable_dynamic+set}" = set; then
1648   enableval="$enable_dynamic"
1649   
1650         ol_arg=invalid
1651         for ol_val in auto yes no ; do
1652                 if test "$enableval" = "$ol_val" ; then
1653                         ol_arg="$ol_val"
1654                 fi
1655         done
1656         if test "$ol_arg" = "invalid" ; then
1657                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1658         fi
1659         ol_enable_dynamic="$ol_arg"
1660
1661 else
1662         ol_enable_dynamic="no"
1663 fi
1664 # end --enable-dynamic
1665 # OpenLDAP --enable-kpasswd
1666         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1667 if test "${enable_kpasswd+set}" = set; then
1668   enableval="$enable_kpasswd"
1669   
1670         ol_arg=invalid
1671         for ol_val in auto yes no ; do
1672                 if test "$enableval" = "$ol_val" ; then
1673                         ol_arg="$ol_val"
1674                 fi
1675         done
1676         if test "$ol_arg" = "invalid" ; then
1677                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1678         fi
1679         ol_enable_kpasswd="$ol_arg"
1680
1681 else
1682         ol_enable_kpasswd="no"
1683 fi
1684 # end --enable-kpasswd
1685 # OpenLDAP --enable-lmpasswd
1686         # Check whether --enable-lmpasswd or --disable-lmpasswd was given.
1687 if test "${enable_lmpasswd+set}" = set; then
1688   enableval="$enable_lmpasswd"
1689   
1690         ol_arg=invalid
1691         for ol_val in auto yes no ; do
1692                 if test "$enableval" = "$ol_val" ; then
1693                         ol_arg="$ol_val"
1694                 fi
1695         done
1696         if test "$ol_arg" = "invalid" ; then
1697                 { echo "configure: error: bad value $enableval for --enable-lmpasswd" 1>&2; exit 1; }
1698         fi
1699         ol_enable_lmpasswd="$ol_arg"
1700
1701 else
1702         ol_enable_lmpasswd="no"
1703 fi
1704 # end --enable-lmpasswd
1705 # OpenLDAP --enable-spasswd
1706         # Check whether --enable-spasswd or --disable-spasswd was given.
1707 if test "${enable_spasswd+set}" = set; then
1708   enableval="$enable_spasswd"
1709   
1710         ol_arg=invalid
1711         for ol_val in auto yes no ; do
1712                 if test "$enableval" = "$ol_val" ; then
1713                         ol_arg="$ol_val"
1714                 fi
1715         done
1716         if test "$ol_arg" = "invalid" ; then
1717                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1718         fi
1719         ol_enable_spasswd="$ol_arg"
1720
1721 else
1722         ol_enable_spasswd="no"
1723 fi
1724 # end --enable-spasswd
1725 # OpenLDAP --enable-modules
1726         # Check whether --enable-modules or --disable-modules was given.
1727 if test "${enable_modules+set}" = set; then
1728   enableval="$enable_modules"
1729   
1730         ol_arg=invalid
1731         for ol_val in auto yes no ; do
1732                 if test "$enableval" = "$ol_val" ; then
1733                         ol_arg="$ol_val"
1734                 fi
1735         done
1736         if test "$ol_arg" = "invalid" ; then
1737                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1738         fi
1739         ol_enable_modules="$ol_arg"
1740
1741 else
1742         ol_enable_modules="no"
1743 fi
1744 # end --enable-modules
1745 # OpenLDAP --enable-phonetic
1746         # Check whether --enable-phonetic or --disable-phonetic was given.
1747 if test "${enable_phonetic+set}" = set; then
1748   enableval="$enable_phonetic"
1749   
1750         ol_arg=invalid
1751         for ol_val in auto yes no ; do
1752                 if test "$enableval" = "$ol_val" ; then
1753                         ol_arg="$ol_val"
1754                 fi
1755         done
1756         if test "$ol_arg" = "invalid" ; then
1757                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1758         fi
1759         ol_enable_phonetic="$ol_arg"
1760
1761 else
1762         ol_enable_phonetic="no"
1763 fi
1764 # end --enable-phonetic
1765 # OpenLDAP --enable-rlookups
1766         # Check whether --enable-rlookups or --disable-rlookups was given.
1767 if test "${enable_rlookups+set}" = set; then
1768   enableval="$enable_rlookups"
1769   
1770         ol_arg=invalid
1771         for ol_val in auto yes no ; do
1772                 if test "$enableval" = "$ol_val" ; then
1773                         ol_arg="$ol_val"
1774                 fi
1775         done
1776         if test "$ol_arg" = "invalid" ; then
1777                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1778         fi
1779         ol_enable_rlookups="$ol_arg"
1780
1781 else
1782         ol_enable_rlookups="no"
1783 fi
1784 # end --enable-rlookups
1785 # OpenLDAP --enable-slp
1786         # Check whether --enable-slp or --disable-slp was given.
1787 if test "${enable_slp+set}" = set; then
1788   enableval="$enable_slp"
1789   
1790         ol_arg=invalid
1791         for ol_val in auto yes no ; do
1792                 if test "$enableval" = "$ol_val" ; then
1793                         ol_arg="$ol_val"
1794                 fi
1795         done
1796         if test "$ol_arg" = "invalid" ; then
1797                 { echo "configure: error: bad value $enableval for --enable-slp" 1>&2; exit 1; }
1798         fi
1799         ol_enable_slp="$ol_arg"
1800
1801 else
1802         ol_enable_slp="no"
1803 fi
1804 # end --enable-slp
1805 # OpenLDAP --enable-wrappers
1806         # Check whether --enable-wrappers or --disable-wrappers was given.
1807 if test "${enable_wrappers+set}" = set; then
1808   enableval="$enable_wrappers"
1809   
1810         ol_arg=invalid
1811         for ol_val in auto yes no ; do
1812                 if test "$enableval" = "$ol_val" ; then
1813                         ol_arg="$ol_val"
1814                 fi
1815         done
1816         if test "$ol_arg" = "invalid" ; then
1817                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1818         fi
1819         ol_enable_wrappers="$ol_arg"
1820
1821 else
1822         ol_enable_wrappers="no"
1823 fi
1824 # end --enable-wrappers
1825
1826 # OpenLDAP --enable-bdb
1827         # Check whether --enable-bdb or --disable-bdb was given.
1828 if test "${enable_bdb+set}" = set; then
1829   enableval="$enable_bdb"
1830   
1831         ol_arg=invalid
1832         for ol_val in auto yes no ; do
1833                 if test "$enableval" = "$ol_val" ; then
1834                         ol_arg="$ol_val"
1835                 fi
1836         done
1837         if test "$ol_arg" = "invalid" ; then
1838                 { echo "configure: error: bad value $enableval for --enable-bdb" 1>&2; exit 1; }
1839         fi
1840         ol_enable_bdb="$ol_arg"
1841
1842 else
1843         ol_enable_bdb="no"
1844 fi
1845 # end --enable-bdb
1846 # OpenLDAP --with-bdb_module
1847         # Check whether --with-bdb_module or --without-bdb_module was given.
1848 if test "${with_bdb_module+set}" = set; then
1849   withval="$with_bdb_module"
1850   
1851         ol_arg=invalid
1852         for ol_val in static dynamic ; do
1853                 if test "$withval" = "$ol_val" ; then
1854                         ol_arg="$ol_val"
1855                 fi
1856         done
1857         if test "$ol_arg" = "invalid" ; then
1858                 { echo "configure: error: bad value $withval for --with-bdb_module" 1>&2; exit 1; }
1859         fi
1860         ol_with_bdb_module="$ol_arg"
1861
1862 else
1863         ol_with_bdb_module="static"
1864 fi
1865 # end --with-bdb_module
1866
1867 # OpenLDAP --enable-dnssrv
1868         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1869 if test "${enable_dnssrv+set}" = set; then
1870   enableval="$enable_dnssrv"
1871   
1872         ol_arg=invalid
1873         for ol_val in auto yes no ; do
1874                 if test "$enableval" = "$ol_val" ; then
1875                         ol_arg="$ol_val"
1876                 fi
1877         done
1878         if test "$ol_arg" = "invalid" ; then
1879                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1880         fi
1881         ol_enable_dnssrv="$ol_arg"
1882
1883 else
1884         ol_enable_dnssrv="no"
1885 fi
1886 # end --enable-dnssrv
1887 # OpenLDAP --with-dnssrv_module
1888         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1889 if test "${with_dnssrv_module+set}" = set; then
1890   withval="$with_dnssrv_module"
1891   
1892         ol_arg=invalid
1893         for ol_val in static dynamic ; do
1894                 if test "$withval" = "$ol_val" ; then
1895                         ol_arg="$ol_val"
1896                 fi
1897         done
1898         if test "$ol_arg" = "invalid" ; then
1899                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1900         fi
1901         ol_with_dnssrv_module="$ol_arg"
1902
1903 else
1904         ol_with_dnssrv_module="static"
1905 fi
1906 # end --with-dnssrv_module
1907
1908 # OpenLDAP --enable-ldap
1909         # Check whether --enable-ldap or --disable-ldap was given.
1910 if test "${enable_ldap+set}" = set; then
1911   enableval="$enable_ldap"
1912   
1913         ol_arg=invalid
1914         for ol_val in auto yes no ; do
1915                 if test "$enableval" = "$ol_val" ; then
1916                         ol_arg="$ol_val"
1917                 fi
1918         done
1919         if test "$ol_arg" = "invalid" ; then
1920                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1921         fi
1922         ol_enable_ldap="$ol_arg"
1923
1924 else
1925         ol_enable_ldap="no"
1926 fi
1927 # end --enable-ldap
1928 # OpenLDAP --with-ldap_module
1929         # Check whether --with-ldap_module or --without-ldap_module was given.
1930 if test "${with_ldap_module+set}" = set; then
1931   withval="$with_ldap_module"
1932   
1933         ol_arg=invalid
1934         for ol_val in static dynamic ; do
1935                 if test "$withval" = "$ol_val" ; then
1936                         ol_arg="$ol_val"
1937                 fi
1938         done
1939         if test "$ol_arg" = "invalid" ; then
1940                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1941         fi
1942         ol_with_ldap_module="$ol_arg"
1943
1944 else
1945         ol_with_ldap_module="static"
1946 fi
1947 # end --with-ldap_module
1948
1949 # OpenLDAP --enable-ldbm
1950         # Check whether --enable-ldbm or --disable-ldbm was given.
1951 if test "${enable_ldbm+set}" = set; then
1952   enableval="$enable_ldbm"
1953   
1954         ol_arg=invalid
1955         for ol_val in auto yes no ; do
1956                 if test "$enableval" = "$ol_val" ; then
1957                         ol_arg="$ol_val"
1958                 fi
1959         done
1960         if test "$ol_arg" = "invalid" ; then
1961                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1962         fi
1963         ol_enable_ldbm="$ol_arg"
1964
1965 else
1966         ol_enable_ldbm="yes"
1967 fi
1968 # end --enable-ldbm
1969 # OpenLDAP --with-ldbm_api
1970         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1971 if test "${with_ldbm_api+set}" = set; then
1972   withval="$with_ldbm_api"
1973   
1974         ol_arg=invalid
1975         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1976                 if test "$withval" = "$ol_val" ; then
1977                         ol_arg="$ol_val"
1978                 fi
1979         done
1980         if test "$ol_arg" = "invalid" ; then
1981                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1982         fi
1983         ol_with_ldbm_api="$ol_arg"
1984
1985 else
1986         ol_with_ldbm_api="auto"
1987 fi
1988 # end --with-ldbm_api
1989
1990 # OpenLDAP --with-ldbm_module
1991         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1992 if test "${with_ldbm_module+set}" = set; then
1993   withval="$with_ldbm_module"
1994   
1995         ol_arg=invalid
1996         for ol_val in static dynamic ; do
1997                 if test "$withval" = "$ol_val" ; then
1998                         ol_arg="$ol_val"
1999                 fi
2000         done
2001         if test "$ol_arg" = "invalid" ; then
2002                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
2003         fi
2004         ol_with_ldbm_module="$ol_arg"
2005
2006 else
2007         ol_with_ldbm_module="static"
2008 fi
2009 # end --with-ldbm_module
2010
2011 # OpenLDAP --with-ldbm_type
2012         # Check whether --with-ldbm_type or --without-ldbm_type was given.
2013 if test "${with_ldbm_type+set}" = set; then
2014   withval="$with_ldbm_type"
2015   
2016         ol_arg=invalid
2017         for ol_val in auto btree hash ; do
2018                 if test "$withval" = "$ol_val" ; then
2019                         ol_arg="$ol_val"
2020                 fi
2021         done
2022         if test "$ol_arg" = "invalid" ; then
2023                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
2024         fi
2025         ol_with_ldbm_type="$ol_arg"
2026
2027 else
2028         ol_with_ldbm_type="auto"
2029 fi
2030 # end --with-ldbm_type
2031
2032 # OpenLDAP --enable-meta
2033         # Check whether --enable-meta or --disable-meta was given.
2034 if test "${enable_meta+set}" = set; then
2035   enableval="$enable_meta"
2036   
2037         ol_arg=invalid
2038         for ol_val in auto yes no ; do
2039                 if test "$enableval" = "$ol_val" ; then
2040                         ol_arg="$ol_val"
2041                 fi
2042         done
2043         if test "$ol_arg" = "invalid" ; then
2044                 { echo "configure: error: bad value $enableval for --enable-meta" 1>&2; exit 1; }
2045         fi
2046         ol_enable_meta="$ol_arg"
2047
2048 else
2049         ol_enable_meta="no"
2050 fi
2051 # end --enable-meta
2052 # OpenLDAP --with-meta_module
2053         # Check whether --with-meta_module or --without-meta_module was given.
2054 if test "${with_meta_module+set}" = set; then
2055   withval="$with_meta_module"
2056   
2057         ol_arg=invalid
2058         for ol_val in static dynamic ; do
2059                 if test "$withval" = "$ol_val" ; then
2060                         ol_arg="$ol_val"
2061                 fi
2062         done
2063         if test "$ol_arg" = "invalid" ; then
2064                 { echo "configure: error: bad value $withval for --with-meta_module" 1>&2; exit 1; }
2065         fi
2066         ol_with_meta_module="$ol_arg"
2067
2068 else
2069         ol_with_meta_module="static"
2070 fi
2071 # end --with-meta_module
2072
2073 # OpenLDAP --enable-passwd
2074         # Check whether --enable-passwd or --disable-passwd was given.
2075 if test "${enable_passwd+set}" = set; then
2076   enableval="$enable_passwd"
2077   
2078         ol_arg=invalid
2079         for ol_val in auto yes no ; do
2080                 if test "$enableval" = "$ol_val" ; then
2081                         ol_arg="$ol_val"
2082                 fi
2083         done
2084         if test "$ol_arg" = "invalid" ; then
2085                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
2086         fi
2087         ol_enable_passwd="$ol_arg"
2088
2089 else
2090         ol_enable_passwd="no"
2091 fi
2092 # end --enable-passwd
2093 # OpenLDAP --with-passwd_module
2094         # Check whether --with-passwd_module or --without-passwd_module was given.
2095 if test "${with_passwd_module+set}" = set; then
2096   withval="$with_passwd_module"
2097   
2098         ol_arg=invalid
2099         for ol_val in static dynamic ; do
2100                 if test "$withval" = "$ol_val" ; then
2101                         ol_arg="$ol_val"
2102                 fi
2103         done
2104         if test "$ol_arg" = "invalid" ; then
2105                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
2106         fi
2107         ol_with_passwd_module="$ol_arg"
2108
2109 else
2110         ol_with_passwd_module="static"
2111 fi
2112 # end --with-passwd_module
2113
2114 # OpenLDAP --enable-perl
2115         # Check whether --enable-perl or --disable-perl was given.
2116 if test "${enable_perl+set}" = set; then
2117   enableval="$enable_perl"
2118   
2119         ol_arg=invalid
2120         for ol_val in auto yes no ; do
2121                 if test "$enableval" = "$ol_val" ; then
2122                         ol_arg="$ol_val"
2123                 fi
2124         done
2125         if test "$ol_arg" = "invalid" ; then
2126                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
2127         fi
2128         ol_enable_perl="$ol_arg"
2129
2130 else
2131         ol_enable_perl="no"
2132 fi
2133 # end --enable-perl
2134 # OpenLDAP --with-perl_module
2135         # Check whether --with-perl_module or --without-perl_module was given.
2136 if test "${with_perl_module+set}" = set; then
2137   withval="$with_perl_module"
2138   
2139         ol_arg=invalid
2140         for ol_val in static dynamic ; do
2141                 if test "$withval" = "$ol_val" ; then
2142                         ol_arg="$ol_val"
2143                 fi
2144         done
2145         if test "$ol_arg" = "invalid" ; then
2146                 { echo "configure: error: bad value $withval for --with-perl_module" 1>&2; exit 1; }
2147         fi
2148         ol_with_perl_module="$ol_arg"
2149
2150 else
2151         ol_with_perl_module="static"
2152 fi
2153 # end --with-perl_module
2154
2155 # OpenLDAP --enable-shell
2156         # Check whether --enable-shell or --disable-shell was given.
2157 if test "${enable_shell+set}" = set; then
2158   enableval="$enable_shell"
2159   
2160         ol_arg=invalid
2161         for ol_val in auto yes no ; do
2162                 if test "$enableval" = "$ol_val" ; then
2163                         ol_arg="$ol_val"
2164                 fi
2165         done
2166         if test "$ol_arg" = "invalid" ; then
2167                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2168         fi
2169         ol_enable_shell="$ol_arg"
2170
2171 else
2172         ol_enable_shell="no"
2173 fi
2174 # end --enable-shell
2175 # OpenLDAP --with-shell_module
2176         # Check whether --with-shell_module or --without-shell_module was given.
2177 if test "${with_shell_module+set}" = set; then
2178   withval="$with_shell_module"
2179   
2180         ol_arg=invalid
2181         for ol_val in static dynamic ; do
2182                 if test "$withval" = "$ol_val" ; then
2183                         ol_arg="$ol_val"
2184                 fi
2185         done
2186         if test "$ol_arg" = "invalid" ; then
2187                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2188         fi
2189         ol_with_shell_module="$ol_arg"
2190
2191 else
2192         ol_with_shell_module="static"
2193 fi
2194 # end --with-shell_module
2195
2196 # OpenLDAP --enable-sql
2197         # Check whether --enable-sql or --disable-sql was given.
2198 if test "${enable_sql+set}" = set; then
2199   enableval="$enable_sql"
2200   
2201         ol_arg=invalid
2202         for ol_val in auto yes no ; do
2203                 if test "$enableval" = "$ol_val" ; then
2204                         ol_arg="$ol_val"
2205                 fi
2206         done
2207         if test "$ol_arg" = "invalid" ; then
2208                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2209         fi
2210         ol_enable_sql="$ol_arg"
2211
2212 else
2213         ol_enable_sql="no"
2214 fi
2215 # end --enable-sql
2216 # OpenLDAP --with-sql_module
2217         # Check whether --with-sql_module or --without-sql_module was given.
2218 if test "${with_sql_module+set}" = set; then
2219   withval="$with_sql_module"
2220   
2221         ol_arg=invalid
2222         for ol_val in static dynamic ; do
2223                 if test "$withval" = "$ol_val" ; then
2224                         ol_arg="$ol_val"
2225                 fi
2226         done
2227         if test "$ol_arg" = "invalid" ; then
2228                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2229         fi
2230         ol_with_sql_module="$ol_arg"
2231
2232 else
2233         ol_with_sql_module="static"
2234 fi
2235 # end --with-sql_module
2236
2237 # OpenLDAP --enable-tcl
2238         # Check whether --enable-tcl or --disable-tcl was given.
2239 if test "${enable_tcl+set}" = set; then
2240   enableval="$enable_tcl"
2241   
2242         ol_arg=invalid
2243         for ol_val in auto yes no ; do
2244                 if test "$enableval" = "$ol_val" ; then
2245                         ol_arg="$ol_val"
2246                 fi
2247         done
2248         if test "$ol_arg" = "invalid" ; then
2249                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
2250         fi
2251         ol_enable_tcl="$ol_arg"
2252
2253 else
2254         ol_enable_tcl="no"
2255 fi
2256 # end --enable-tcl
2257 # OpenLDAP --with-tcl_module
2258         # Check whether --with-tcl_module or --without-tcl_module was given.
2259 if test "${with_tcl_module+set}" = set; then
2260   withval="$with_tcl_module"
2261   
2262         ol_arg=invalid
2263         for ol_val in static dynamic ; do
2264                 if test "$withval" = "$ol_val" ; then
2265                         ol_arg="$ol_val"
2266                 fi
2267         done
2268         if test "$ol_arg" = "invalid" ; then
2269                 { echo "configure: error: bad value $withval for --with-tcl_module" 1>&2; exit 1; }
2270         fi
2271         ol_with_tcl_module="$ol_arg"
2272
2273 else
2274         ol_with_tcl_module="static"
2275 fi
2276 # end --with-tcl_module
2277
2278
2279 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2280 if test "${with_xxslurpdoptions+set}" = set; then
2281   withval="$with_xxslurpdoptions"
2282   :
2283 fi
2284
2285 # OpenLDAP --enable-slurpd
2286         # Check whether --enable-slurpd or --disable-slurpd was given.
2287 if test "${enable_slurpd+set}" = set; then
2288   enableval="$enable_slurpd"
2289   
2290         ol_arg=invalid
2291         for ol_val in auto yes no ; do
2292                 if test "$enableval" = "$ol_val" ; then
2293                         ol_arg="$ol_val"
2294                 fi
2295         done
2296         if test "$ol_arg" = "invalid" ; then
2297                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2298         fi
2299         ol_enable_slurpd="$ol_arg"
2300
2301 else
2302         ol_enable_slurpd="auto"
2303 fi
2304 # end --enable-slurpd
2305
2306 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2307 if test "${with_xxliboptions+set}" = set; then
2308   withval="$with_xxliboptions"
2309   :
2310 fi
2311
2312 # Check whether --enable-static or --disable-static was given.
2313 if test "${enable_static+set}" = set; then
2314   enableval="$enable_static"
2315   p=${PACKAGE-default}
2316 case "$enableval" in
2317 yes) enable_static=yes ;;
2318 no) enable_static=no ;;
2319 *)
2320   enable_static=no
2321   # Look at the argument we got.  We use all the common list separators.
2322   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2323   for pkg in $enableval; do
2324     if test "X$pkg" = "X$p"; then
2325       enable_static=yes
2326     fi
2327   done
2328   IFS="$ac_save_ifs"
2329   ;;
2330 esac
2331 else
2332   enable_static=yes
2333 fi
2334
2335 # Check whether --enable-shared or --disable-shared was given.
2336 if test "${enable_shared+set}" = set; then
2337   enableval="$enable_shared"
2338   p=${PACKAGE-default}
2339 case "$enableval" in
2340 yes) enable_shared=yes ;;
2341 no) enable_shared=no ;;
2342 *)
2343   enable_shared=no
2344   # Look at the argument we got.  We use all the common list separators.
2345   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2346   for pkg in $enableval; do
2347     if test "X$pkg" = "X$p"; then
2348       enable_shared=yes
2349     fi
2350   done
2351   IFS="$ac_save_ifs"
2352   ;;
2353 esac
2354 else
2355   enable_shared=yes
2356 fi
2357
2358
2359
2360 # validate options
2361 if test $ol_enable_slapd = no ; then
2362                 if test $ol_enable_bdb = yes ; then
2363                 echo "configure: warning: slapd disabled, ignoring --enable-bdb argument" 1>&2
2364         fi
2365         if test $ol_enable_dnssrv = yes ; then
2366                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2367         fi
2368         if test $ol_enable_ldap = yes ; then
2369                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2370         fi
2371         if test $ol_enable_ldbm = yes ; then
2372                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2373         fi
2374         if test $ol_enable_meta = yes ; then
2375                 echo "configure: warning: slapd disabled, ignoring --enable-meta argument" 1>&2
2376         fi
2377         if test $ol_enable_passwd = yes ; then
2378                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2379         fi
2380         if test $ol_enable_perl = yes ; then
2381                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
2382         fi
2383         if test $ol_enable_shell = yes ; then
2384                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2385         fi
2386         if test $ol_enable_tcl = yes ; then
2387                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
2388         fi
2389         if test $ol_enable_sql = yes ; then
2390                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2391         fi
2392         if test $ol_enable_modules = yes ; then
2393                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2394         fi
2395         if test $ol_enable_wrappers = yes ; then
2396                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2397         fi
2398         if test $ol_enable_phonetic = yes ; then
2399                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2400         fi
2401         if test $ol_enable_rlookups = yes ; then
2402                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2403         fi
2404         if test $ol_enable_aci = yes ; then
2405                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2406         fi
2407         if test $ol_with_ldbm_api != auto ; then
2408                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2409         fi
2410         if test $ol_with_ldbm_type != auto ; then
2411                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2412         fi
2413         if test $ol_with_bdb_module != static ; then
2414                 echo "configure: warning: slapd disabled, ignoring --with-bdb-module argument" 1>&2
2415         fi
2416         if test $ol_with_dnssrv_module != static ; then
2417                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2418         fi
2419         if test $ol_with_ldap_module != static ; then
2420                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2421         fi
2422         if test $ol_with_ldbm_module != static ; then
2423                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2424         fi
2425         if test $ol_with_meta_module != static ; then
2426                 echo "configure: warning: slapd disabled, ignoring --with-meta-module argument" 1>&2
2427         fi
2428         if test $ol_with_passwd_module != static ; then
2429                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2430         fi
2431         if test $ol_with_perl_module != static ; then
2432                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
2433         fi
2434         if test $ol_with_shell_module != static ; then
2435                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2436         fi
2437         if test $ol_with_tcl_module != static ; then
2438                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
2439         fi
2440         if test $ol_with_sql_module != static ; then
2441                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2442         fi
2443         if test $ol_enable_slurpd = yes ; then
2444                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2445         fi
2446         if test $ol_enable_rewrite = yes ; then
2447                 echo "configure: warning: slapd disabled, ignoring --enable-rewrite argument" 1>&2
2448         fi
2449
2450         # force settings to no
2451         ol_enable_bdb=no
2452         ol_enable_dnssrv=no
2453         ol_enable_ldap=no
2454         ol_enable_ldbm=no
2455         ol_enable_meta=no
2456         ol_enable_passwd=no
2457         ol_enable_perl=no
2458         ol_enable_shell=no
2459         ol_enable_tcl=no
2460         ol_enable_sql=no
2461
2462         ol_enable_modules=no
2463         ol_enable_phonetic=no
2464         ol_enable_rlookups=no
2465         ol_enable_aci=no
2466         ol_enable_wrappers=no
2467         ol_enable_dynamic=no
2468
2469         ol_with_ldbm_api=no
2470         ol_with_ldbm_type=no
2471
2472         ol_with_bdb_module=static
2473         ol_with_dnssrv_module=static
2474         ol_with_ldap_module=static
2475         ol_with_ldbm_module=static
2476         ol_with_meta_module=static
2477         ol_with_passwd_module=static
2478         ol_with_perl_module=static
2479         ol_with_shell_module=static
2480         ol_with_tcl_module=static
2481         ol_with_sql_module=static
2482
2483         ol_enable_slurpd=no
2484
2485         ol_enable_rewrite=no
2486
2487 elif test $ol_enable_ldbm = no ; then
2488         
2489         if test $ol_with_ldbm_api != auto ; then
2490                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2491         fi
2492
2493         if test $ol_with_ldbm_type != auto ; then
2494                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2495         fi
2496
2497         if test $ol_with_ldbm_module != static ; then
2498                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2499         fi
2500
2501         if test $ol_enable_modules != yes -a \
2502                 $ol_enable_bdb = no -a \
2503                 $ol_enable_dnssrv = no -a \
2504                 $ol_enable_ldap = no -a \
2505                 $ol_enable_meta = no -a \
2506                 $ol_enable_passwd = no -a \
2507                 $ol_enable_perl = no -a \
2508                 $ol_enable_shell = no -a \
2509                 $ol_enable_sql = no -a \
2510                 $ol_enable_tcl = no ; then
2511                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2512         fi
2513
2514         ol_with_ldbm_api=no
2515         ol_with_ldbm_type=no
2516         ol_with_ldbm_module=static
2517
2518 else
2519                 if test $ol_with_ldbm_api = gdbm -a \
2520                 $ol_with_ldbm_type = btree ; then
2521                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2522         fi
2523         if test $ol_with_ldbm_api = mdbm -a \
2524                 $ol_with_ldbm_type = btree ; then
2525                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2526         fi
2527         if test $ol_with_ldbm_api = ndbm -a \
2528                 $ol_with_ldbm_type = btree ; then
2529                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2530         fi
2531 fi
2532
2533 if test $ol_enable_slurpd = yes ; then
2534                 if test $ol_with_threads = no ; then
2535                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2536         fi
2537 fi
2538
2539 if test $ol_enable_lmpasswd = yes ; then
2540         if test $ol_with_tls = no ; then
2541                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
2542         fi
2543 fi
2544
2545 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2546         if test $ol_with_kerberos = no ; then
2547                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2548         fi
2549         ol_with_kerberos=yes
2550 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2551         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2552                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2553         fi
2554         ol_with_kerberos=no
2555 fi
2556
2557 if test $ol_enable_spasswd = yes ; then
2558         if test $ol_with_cyrus_sasl = no ; then
2559                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2560         fi
2561         ol_with_cyrus_sasl=yes
2562 fi
2563
2564 echo "$ac_t""done" 1>&6
2565
2566 LDAP_LIBS=
2567 LDIF_LIBS=
2568 LDBM_LIBS=
2569 LTHREAD_LIBS=
2570 LUTIL_LIBS=
2571
2572 SLAPD_LIBS=
2573 SLURPD_LIBS=
2574
2575 BUILD_SLAPD=no
2576 BUILD_SLURPD=no
2577
2578 BUILD_THREAD=no
2579
2580 BUILD_BDB=no
2581 BUILD_DNSSRV=no
2582 BUILD_LDAP=no
2583 BUILD_LDBM=no
2584 BUILD_META=no
2585 BUILD_PASSWD=no
2586 BUILD_PERL=no
2587 BUILD_SHELL=no
2588 BUILD_SQL=no
2589 BUILD_TCL=no
2590
2591 BUILD_BDB_DYNAMIC=static
2592 BUILD_DNSSRV_DYNAMIC=static
2593 BUILD_LDAP_DYNAMIC=static
2594 BUILD_LDBM_DYNAMIC=static
2595 BUILD_META_DYNAMIC=static
2596 BUILD_PASSWD_DYNAMIC=static
2597 BUILD_PERL_DYNAMIC=static
2598 BUILD_SHELL_DYNAMIC=static
2599 BUILD_TCL_DYNAMIC=static
2600 BUILD_SQL_DYNAMIC=static
2601
2602 SLAPD_MODULES_LDFLAGS=
2603 SLAPD_MODULES_CPPFLAGS=
2604 SLAPD_MODULES_LIST=
2605
2606 SLAPD_PERL_LDFLAGS=
2607 MOD_PERL_LDFLAGS=
2608 PERL_CPPFLAGS=
2609
2610 SLAPD_SQL_LDFLAGS=
2611 SLAPD_SQL_LIBS=
2612 SLAPD_SQL_INCLUDES=
2613
2614 MOD_TCL_LIB=
2615 KRB4_LIBS=
2616 KRB5_LIBS=
2617 READLINE_LIBS=
2618 SASL_LIBS=
2619 TERMCAP_LIBS=
2620 TLS_LIBS=
2621 MODULES_LIBS=
2622 AUTH_LIBS=
2623
2624 SLAPD_SLP_LIBS=
2625
2626
2627
2628 cat >> confdefs.h <<\EOF
2629 #define HAVE_MKVERSION 1
2630 EOF
2631
2632
2633
2634
2635 ol_aix_threads=no
2636 case "$target" in
2637 *-*-aix*)       if test -z "$CC" ; then
2638                 case "$ol_with_threads" in
2639                 auto | yes |  posix) ol_aix_threads=yes ;;
2640                 esac
2641         fi
2642 ;;
2643 esac
2644
2645 if test $ol_aix_threads = yes ; then
2646         if test -z "${CC}" ; then
2647                 for ac_prog in cc_r xlc_r cc
2648 do
2649 # Extract the first word of "$ac_prog", so it can be a program name with args.
2650 set dummy $ac_prog; ac_word=$2
2651 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2652 echo "configure:2653: checking for $ac_word" >&5
2653 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2654   echo $ac_n "(cached) $ac_c" 1>&6
2655 else
2656   if test -n "$CC"; then
2657   ac_cv_prog_CC="$CC" # Let the user override the test.
2658 else
2659   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2660   ac_dummy="$PATH"
2661   for ac_dir in $ac_dummy; do
2662     test -z "$ac_dir" && ac_dir=.
2663     if test -f $ac_dir/$ac_word; then
2664       ac_cv_prog_CC="$ac_prog"
2665       break
2666     fi
2667   done
2668   IFS="$ac_save_ifs"
2669 fi
2670 fi
2671 CC="$ac_cv_prog_CC"
2672 if test -n "$CC"; then
2673   echo "$ac_t""$CC" 1>&6
2674 else
2675   echo "$ac_t""no" 1>&6
2676 fi
2677
2678 test -n "$CC" && break
2679 done
2680
2681
2682                 if test "$CC" = cc ; then
2683                                                 if test $ol_with_threads != auto ; then
2684                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2685                         else
2686                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2687                         fi
2688                         ol_with_threads=no
2689                 fi
2690         fi
2691
2692         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2693                 ol_with_threads=posix
2694                 ol_cv_pthread_create=yes
2695         fi
2696 fi
2697
2698 if test -z "${CC}"; then
2699         for ac_prog in cc
2700 do
2701 # Extract the first word of "$ac_prog", so it can be a program name with args.
2702 set dummy $ac_prog; ac_word=$2
2703 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2704 echo "configure:2705: checking for $ac_word" >&5
2705 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2706   echo $ac_n "(cached) $ac_c" 1>&6
2707 else
2708   if test -n "$CC"; then
2709   ac_cv_prog_CC="$CC" # Let the user override the test.
2710 else
2711   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2712   ac_dummy="$PATH"
2713   for ac_dir in $ac_dummy; do
2714     test -z "$ac_dir" && ac_dir=.
2715     if test -f $ac_dir/$ac_word; then
2716       ac_cv_prog_CC="$ac_prog"
2717       break
2718     fi
2719   done
2720   IFS="$ac_save_ifs"
2721 fi
2722 fi
2723 CC="$ac_cv_prog_CC"
2724 if test -n "$CC"; then
2725   echo "$ac_t""$CC" 1>&6
2726 else
2727   echo "$ac_t""no" 1>&6
2728 fi
2729
2730 test -n "$CC" && break
2731 done
2732
2733 fi
2734
2735
2736
2737
2738 # Check whether --enable-fast-install or --disable-fast-install was given.
2739 if test "${enable_fast_install+set}" = set; then
2740   enableval="$enable_fast_install"
2741   p=${PACKAGE-default}
2742 case "$enableval" in
2743 yes) enable_fast_install=yes ;;
2744 no) enable_fast_install=no ;;
2745 *)
2746   enable_fast_install=no
2747   # Look at the argument we got.  We use all the common list separators.
2748   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2749   for pkg in $enableval; do
2750     if test "X$pkg" = "X$p"; then
2751       enable_fast_install=yes
2752     fi
2753   done
2754   IFS="$ac_save_ifs"
2755   ;;
2756 esac
2757 else
2758   enable_fast_install=yes
2759 fi
2760
2761 # Extract the first word of "ranlib", so it can be a program name with args.
2762 set dummy ranlib; ac_word=$2
2763 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2764 echo "configure:2765: checking for $ac_word" >&5
2765 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2766   echo $ac_n "(cached) $ac_c" 1>&6
2767 else
2768   if test -n "$RANLIB"; then
2769   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2770 else
2771   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2772   ac_dummy="$PATH"
2773   for ac_dir in $ac_dummy; do
2774     test -z "$ac_dir" && ac_dir=.
2775     if test -f $ac_dir/$ac_word; then
2776       ac_cv_prog_RANLIB="ranlib"
2777       break
2778     fi
2779   done
2780   IFS="$ac_save_ifs"
2781   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2782 fi
2783 fi
2784 RANLIB="$ac_cv_prog_RANLIB"
2785 if test -n "$RANLIB"; then
2786   echo "$ac_t""$RANLIB" 1>&6
2787 else
2788   echo "$ac_t""no" 1>&6
2789 fi
2790
2791 # Extract the first word of "gcc", so it can be a program name with args.
2792 set dummy gcc; ac_word=$2
2793 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2794 echo "configure:2795: checking for $ac_word" >&5
2795 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2796   echo $ac_n "(cached) $ac_c" 1>&6
2797 else
2798   if test -n "$CC"; then
2799   ac_cv_prog_CC="$CC" # Let the user override the test.
2800 else
2801   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2802   ac_dummy="$PATH"
2803   for ac_dir in $ac_dummy; do
2804     test -z "$ac_dir" && ac_dir=.
2805     if test -f $ac_dir/$ac_word; then
2806       ac_cv_prog_CC="gcc"
2807       break
2808     fi
2809   done
2810   IFS="$ac_save_ifs"
2811 fi
2812 fi
2813 CC="$ac_cv_prog_CC"
2814 if test -n "$CC"; then
2815   echo "$ac_t""$CC" 1>&6
2816 else
2817   echo "$ac_t""no" 1>&6
2818 fi
2819
2820 if test -z "$CC"; then
2821   # Extract the first word of "cc", so it can be a program name with args.
2822 set dummy cc; ac_word=$2
2823 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2824 echo "configure:2825: checking for $ac_word" >&5
2825 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2826   echo $ac_n "(cached) $ac_c" 1>&6
2827 else
2828   if test -n "$CC"; then
2829   ac_cv_prog_CC="$CC" # Let the user override the test.
2830 else
2831   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2832   ac_prog_rejected=no
2833   ac_dummy="$PATH"
2834   for ac_dir in $ac_dummy; do
2835     test -z "$ac_dir" && ac_dir=.
2836     if test -f $ac_dir/$ac_word; then
2837       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2838         ac_prog_rejected=yes
2839         continue
2840       fi
2841       ac_cv_prog_CC="cc"
2842       break
2843     fi
2844   done
2845   IFS="$ac_save_ifs"
2846 if test $ac_prog_rejected = yes; then
2847   # We found a bogon in the path, so make sure we never use it.
2848   set dummy $ac_cv_prog_CC
2849   shift
2850   if test $# -gt 0; then
2851     # We chose a different compiler from the bogus one.
2852     # However, it has the same basename, so the bogon will be chosen
2853     # first if we set CC to just the basename; use the full file name.
2854     shift
2855     set dummy "$ac_dir/$ac_word" "$@"
2856     shift
2857     ac_cv_prog_CC="$@"
2858   fi
2859 fi
2860 fi
2861 fi
2862 CC="$ac_cv_prog_CC"
2863 if test -n "$CC"; then
2864   echo "$ac_t""$CC" 1>&6
2865 else
2866   echo "$ac_t""no" 1>&6
2867 fi
2868
2869   if test -z "$CC"; then
2870     case "`uname -s`" in
2871     *win32* | *WIN32* | *CYGWIN*)
2872       # Extract the first word of "cl", so it can be a program name with args.
2873 set dummy cl; ac_word=$2
2874 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2875 echo "configure:2876: checking for $ac_word" >&5
2876 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2877   echo $ac_n "(cached) $ac_c" 1>&6
2878 else
2879   if test -n "$CC"; then
2880   ac_cv_prog_CC="$CC" # Let the user override the test.
2881 else
2882   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2883   ac_dummy="$PATH"
2884   for ac_dir in $ac_dummy; do
2885     test -z "$ac_dir" && ac_dir=.
2886     if test -f $ac_dir/$ac_word; then
2887       ac_cv_prog_CC="cl"
2888       break
2889     fi
2890   done
2891   IFS="$ac_save_ifs"
2892 fi
2893 fi
2894 CC="$ac_cv_prog_CC"
2895 if test -n "$CC"; then
2896   echo "$ac_t""$CC" 1>&6
2897 else
2898   echo "$ac_t""no" 1>&6
2899 fi
2900  ;;
2901     esac
2902   fi
2903   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2904 fi
2905
2906 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2907 echo "configure:2908: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2908
2909 ac_ext=c
2910 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2911 ac_cpp='$CPP $CPPFLAGS'
2912 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2913 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2914 cross_compiling=$ac_cv_prog_cc_cross
2915
2916 cat > conftest.$ac_ext << EOF
2917
2918 #line 2919 "configure"
2919 #include "confdefs.h"
2920
2921 main(){return(0);}
2922 EOF
2923 if { (eval echo configure:2924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2924   ac_cv_prog_cc_works=yes
2925   # If we can't run a trivial program, we are probably using a cross compiler.
2926   if (./conftest; exit) 2>/dev/null; then
2927     ac_cv_prog_cc_cross=no
2928   else
2929     ac_cv_prog_cc_cross=yes
2930   fi
2931 else
2932   echo "configure: failed program was:" >&5
2933   cat conftest.$ac_ext >&5
2934   ac_cv_prog_cc_works=no
2935 fi
2936 rm -fr conftest*
2937 ac_ext=c
2938 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2939 ac_cpp='$CPP $CPPFLAGS'
2940 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2941 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2942 cross_compiling=$ac_cv_prog_cc_cross
2943
2944 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2945 if test $ac_cv_prog_cc_works = no; then
2946   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2947 fi
2948 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2949 echo "configure:2950: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2950 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2951 cross_compiling=$ac_cv_prog_cc_cross
2952
2953 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2954 echo "configure:2955: checking whether we are using GNU C" >&5
2955 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2956   echo $ac_n "(cached) $ac_c" 1>&6
2957 else
2958   cat > conftest.c <<EOF
2959 #ifdef __GNUC__
2960   yes;
2961 #endif
2962 EOF
2963 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2964: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2964   ac_cv_prog_gcc=yes
2965 else
2966   ac_cv_prog_gcc=no
2967 fi
2968 fi
2969
2970 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2971
2972 if test $ac_cv_prog_gcc = yes; then
2973   GCC=yes
2974 else
2975   GCC=
2976 fi
2977
2978 ac_test_CFLAGS="${CFLAGS+set}"
2979 ac_save_CFLAGS="$CFLAGS"
2980 CFLAGS=
2981 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2982 echo "configure:2983: checking whether ${CC-cc} accepts -g" >&5
2983 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2984   echo $ac_n "(cached) $ac_c" 1>&6
2985 else
2986   echo 'void f(){}' > conftest.c
2987 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2988   ac_cv_prog_cc_g=yes
2989 else
2990   ac_cv_prog_cc_g=no
2991 fi
2992 rm -f conftest*
2993
2994 fi
2995
2996 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2997 if test "$ac_test_CFLAGS" = set; then
2998   CFLAGS="$ac_save_CFLAGS"
2999 elif test $ac_cv_prog_cc_g = yes; then
3000   if test "$GCC" = yes; then
3001     CFLAGS="-g -O2"
3002   else
3003     CFLAGS="-g"
3004   fi
3005 else
3006   if test "$GCC" = yes; then
3007     CFLAGS="-O2"
3008   else
3009     CFLAGS=
3010   fi
3011 fi
3012
3013 # Check whether --with-gnu-ld or --without-gnu-ld was given.
3014 if test "${with_gnu_ld+set}" = set; then
3015   withval="$with_gnu_ld"
3016   test "$withval" = no || with_gnu_ld=yes
3017 else
3018   with_gnu_ld=no
3019 fi
3020
3021 ac_prog=ld
3022 if test "$ac_cv_prog_gcc" = yes; then
3023   # Check if gcc -print-prog-name=ld gives a path.
3024   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
3025 echo "configure:3026: checking for ld used by GCC" >&5
3026   ac_prog=`($CC -print-prog-name=ld) 2>&5`
3027   case "$ac_prog" in
3028     # Accept absolute paths.
3029     [\\/]* | [A-Za-z]:[\\/]*)
3030       re_direlt='/[^/][^/]*/\.\./'
3031       # Canonicalize the path of ld
3032       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3033       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3034         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3035       done
3036       test -z "$LD" && LD="$ac_prog"
3037       ;;
3038   "")
3039     # If it fails, then pretend we aren't using GCC.
3040     ac_prog=ld
3041     ;;
3042   *)
3043     # If it is relative, then search for the first ld in PATH.
3044     with_gnu_ld=unknown
3045     ;;
3046   esac
3047 elif test "$with_gnu_ld" = yes; then
3048   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
3049 echo "configure:3050: checking for GNU ld" >&5
3050 else
3051   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
3052 echo "configure:3053: checking for non-GNU ld" >&5
3053 fi
3054 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
3055   echo $ac_n "(cached) $ac_c" 1>&6
3056 else
3057   if test -z "$LD"; then
3058   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3059   for ac_dir in $PATH; do
3060     test -z "$ac_dir" && ac_dir=.
3061     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3062       ac_cv_path_LD="$ac_dir/$ac_prog"
3063       # Check to see if the program is GNU ld.  I'd rather use --version,
3064       # but apparently some GNU ld's only accept -v.
3065       # Break only if it was the GNU/non-GNU ld that we prefer.
3066       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
3067         test "$with_gnu_ld" != no && break
3068       else
3069         test "$with_gnu_ld" != yes && break
3070       fi
3071     fi
3072   done
3073   IFS="$ac_save_ifs"
3074 else
3075   ac_cv_path_LD="$LD" # Let the user override the test with a path.
3076 fi
3077 fi
3078
3079 LD="$ac_cv_path_LD"
3080 if test -n "$LD"; then
3081   echo "$ac_t""$LD" 1>&6
3082 else
3083   echo "$ac_t""no" 1>&6
3084 fi
3085 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
3086 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
3087 echo "configure:3088: checking if the linker ($LD) is GNU ld" >&5
3088 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
3089   echo $ac_n "(cached) $ac_c" 1>&6
3090 else
3091   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
3092 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
3093   ac_cv_prog_gnu_ld=yes
3094 else
3095   ac_cv_prog_gnu_ld=no
3096 fi
3097 fi
3098
3099 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
3100
3101
3102 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
3103 echo "configure:3104: checking for BSD-compatible nm" >&5
3104 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
3105   echo $ac_n "(cached) $ac_c" 1>&6
3106 else
3107   if test -n "$NM"; then
3108   # Let the user override the test.
3109   ac_cv_path_NM="$NM"
3110 else
3111   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3112   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
3113     test -z "$ac_dir" && ac_dir=.
3114     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
3115       # Check to see if the nm accepts a BSD-compat flag.
3116       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3117       #   nm: unknown option "B" ignored
3118       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3119         ac_cv_path_NM="$ac_dir/nm -B"
3120         break
3121       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
3122         ac_cv_path_NM="$ac_dir/nm -p"
3123         break
3124       else
3125         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
3126         continue # so that we can try to find one that supports BSD flags
3127       fi
3128     fi
3129   done
3130   IFS="$ac_save_ifs"
3131   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
3132 fi
3133 fi
3134
3135 NM="$ac_cv_path_NM"
3136 echo "$ac_t""$NM" 1>&6
3137
3138 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3139 echo "configure:3140: checking whether ln -s works" >&5
3140 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3141   echo $ac_n "(cached) $ac_c" 1>&6
3142 else
3143   rm -f conftestdata
3144 if ln -s X conftestdata 2>/dev/null
3145 then
3146   rm -f conftestdata
3147   ac_cv_prog_LN_S="ln -s"
3148 else
3149   ac_cv_prog_LN_S=ln
3150 fi
3151 fi
3152 LN_S="$ac_cv_prog_LN_S"
3153 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3154   echo "$ac_t""yes" 1>&6
3155 else
3156   echo "$ac_t""no" 1>&6
3157 fi
3158
3159 if test $host != $build; then
3160   ac_tool_prefix=${host_alias}-
3161 else
3162   ac_tool_prefix=
3163 fi
3164
3165
3166 case "$target" in
3167 NONE) lt_target="$host" ;;
3168 *) lt_target="$target" ;;
3169 esac
3170
3171 # Check for any special flags to pass to ltconfig.
3172 libtool_flags="--cache-file=$cache_file"
3173 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
3174 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
3175 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
3176 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
3177 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
3178 libtool_flags="$libtool_flags --enable-dlopen"
3179 libtool_flags="$libtool_flags --enable-win32-dll"
3180 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
3181 if test "${enable_libtool_lock+set}" = set; then
3182   enableval="$enable_libtool_lock"
3183   :
3184 fi
3185
3186 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
3187 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
3188
3189 # Some flags need to be propagated to the compiler or linker for good
3190 # libtool support.
3191 case "$lt_target" in
3192 *-*-irix6*)
3193   # Find out which ABI we are using.
3194   echo '#line 3195 "configure"' > conftest.$ac_ext
3195   if { (eval echo configure:3196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3196     case "`/usr/bin/file conftest.o`" in
3197     *32-bit*)
3198       LD="${LD-ld} -32"
3199       ;;
3200     *N32*)
3201       LD="${LD-ld} -n32"
3202       ;;
3203     *64-bit*)
3204       LD="${LD-ld} -64"
3205       ;;
3206     esac
3207   fi
3208   rm -rf conftest*
3209   ;;
3210
3211 *-*-sco3.2v5*)
3212   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
3213   SAVE_CFLAGS="$CFLAGS"
3214   CFLAGS="$CFLAGS -belf"
3215   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
3216 echo "configure:3217: checking whether the C compiler needs -belf" >&5
3217 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
3218   echo $ac_n "(cached) $ac_c" 1>&6
3219 else
3220   cat > conftest.$ac_ext <<EOF
3221 #line 3222 "configure"
3222 #include "confdefs.h"
3223
3224 int main() {
3225
3226 ; return 0; }
3227 EOF
3228 if { (eval echo configure:3229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3229   rm -rf conftest*
3230   lt_cv_cc_needs_belf=yes
3231 else
3232   echo "configure: failed program was:" >&5
3233   cat conftest.$ac_ext >&5
3234   rm -rf conftest*
3235   lt_cv_cc_needs_belf=no
3236 fi
3237 rm -f conftest*
3238 fi
3239
3240 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
3241   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
3242     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
3243     CFLAGS="$SAVE_CFLAGS"
3244   fi
3245   ;;
3246
3247 *-*-cygwin* | *-*-mingw*)
3248   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3249 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3250 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3251 echo "configure:3252: checking for $ac_word" >&5
3252 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3253   echo $ac_n "(cached) $ac_c" 1>&6
3254 else
3255   if test -n "$DLLTOOL"; then
3256   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3257 else
3258   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3259   ac_dummy="$PATH"
3260   for ac_dir in $ac_dummy; do
3261     test -z "$ac_dir" && ac_dir=.
3262     if test -f $ac_dir/$ac_word; then
3263       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3264       break
3265     fi
3266   done
3267   IFS="$ac_save_ifs"
3268 fi
3269 fi
3270 DLLTOOL="$ac_cv_prog_DLLTOOL"
3271 if test -n "$DLLTOOL"; then
3272   echo "$ac_t""$DLLTOOL" 1>&6
3273 else
3274   echo "$ac_t""no" 1>&6
3275 fi
3276
3277
3278 if test -z "$ac_cv_prog_DLLTOOL"; then
3279 if test -n "$ac_tool_prefix"; then
3280   # Extract the first word of "dlltool", so it can be a program name with args.
3281 set dummy dlltool; ac_word=$2
3282 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3283 echo "configure:3284: checking for $ac_word" >&5
3284 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
3285   echo $ac_n "(cached) $ac_c" 1>&6
3286 else
3287   if test -n "$DLLTOOL"; then
3288   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3289 else
3290   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3291   ac_dummy="$PATH"
3292   for ac_dir in $ac_dummy; do
3293     test -z "$ac_dir" && ac_dir=.
3294     if test -f $ac_dir/$ac_word; then
3295       ac_cv_prog_DLLTOOL="dlltool"
3296       break
3297     fi
3298   done
3299   IFS="$ac_save_ifs"
3300   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3301 fi
3302 fi
3303 DLLTOOL="$ac_cv_prog_DLLTOOL"
3304 if test -n "$DLLTOOL"; then
3305   echo "$ac_t""$DLLTOOL" 1>&6
3306 else
3307   echo "$ac_t""no" 1>&6
3308 fi
3309
3310 else
3311   DLLTOOL="false"
3312 fi
3313 fi
3314
3315   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3316 set dummy ${ac_tool_prefix}as; ac_word=$2
3317 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3318 echo "configure:3319: checking for $ac_word" >&5
3319 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3320   echo $ac_n "(cached) $ac_c" 1>&6
3321 else
3322   if test -n "$AS"; then
3323   ac_cv_prog_AS="$AS" # Let the user override the test.
3324 else
3325   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3326   ac_dummy="$PATH"
3327   for ac_dir in $ac_dummy; do
3328     test -z "$ac_dir" && ac_dir=.
3329     if test -f $ac_dir/$ac_word; then
3330       ac_cv_prog_AS="${ac_tool_prefix}as"
3331       break
3332     fi
3333   done
3334   IFS="$ac_save_ifs"
3335 fi
3336 fi
3337 AS="$ac_cv_prog_AS"
3338 if test -n "$AS"; then
3339   echo "$ac_t""$AS" 1>&6
3340 else
3341   echo "$ac_t""no" 1>&6
3342 fi
3343
3344
3345 if test -z "$ac_cv_prog_AS"; then
3346 if test -n "$ac_tool_prefix"; then
3347   # Extract the first word of "as", so it can be a program name with args.
3348 set dummy as; ac_word=$2
3349 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3350 echo "configure:3351: checking for $ac_word" >&5
3351 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3352   echo $ac_n "(cached) $ac_c" 1>&6
3353 else
3354   if test -n "$AS"; then
3355   ac_cv_prog_AS="$AS" # Let the user override the test.
3356 else
3357   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3358   ac_dummy="$PATH"
3359   for ac_dir in $ac_dummy; do
3360     test -z "$ac_dir" && ac_dir=.
3361     if test -f $ac_dir/$ac_word; then
3362       ac_cv_prog_AS="as"
3363       break
3364     fi
3365   done
3366   IFS="$ac_save_ifs"
3367   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3368 fi
3369 fi
3370 AS="$ac_cv_prog_AS"
3371 if test -n "$AS"; then
3372   echo "$ac_t""$AS" 1>&6
3373 else
3374   echo "$ac_t""no" 1>&6
3375 fi
3376
3377 else
3378   AS="false"
3379 fi
3380 fi
3381
3382   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3383 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3384 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3385 echo "configure:3386: checking for $ac_word" >&5
3386 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3387   echo $ac_n "(cached) $ac_c" 1>&6
3388 else
3389   if test -n "$OBJDUMP"; then
3390   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3391 else
3392   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3393   ac_dummy="$PATH"
3394   for ac_dir in $ac_dummy; do
3395     test -z "$ac_dir" && ac_dir=.
3396     if test -f $ac_dir/$ac_word; then
3397       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3398       break
3399     fi
3400   done
3401   IFS="$ac_save_ifs"
3402 fi
3403 fi
3404 OBJDUMP="$ac_cv_prog_OBJDUMP"
3405 if test -n "$OBJDUMP"; then
3406   echo "$ac_t""$OBJDUMP" 1>&6
3407 else
3408   echo "$ac_t""no" 1>&6
3409 fi
3410
3411
3412 if test -z "$ac_cv_prog_OBJDUMP"; then
3413 if test -n "$ac_tool_prefix"; then
3414   # Extract the first word of "objdump", so it can be a program name with args.
3415 set dummy objdump; ac_word=$2
3416 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3417 echo "configure:3418: checking for $ac_word" >&5
3418 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3419   echo $ac_n "(cached) $ac_c" 1>&6
3420 else
3421   if test -n "$OBJDUMP"; then
3422   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3423 else
3424   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3425   ac_dummy="$PATH"
3426   for ac_dir in $ac_dummy; do
3427     test -z "$ac_dir" && ac_dir=.
3428     if test -f $ac_dir/$ac_word; then
3429       ac_cv_prog_OBJDUMP="objdump"
3430       break
3431     fi
3432   done
3433   IFS="$ac_save_ifs"
3434   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3435 fi
3436 fi
3437 OBJDUMP="$ac_cv_prog_OBJDUMP"
3438 if test -n "$OBJDUMP"; then
3439   echo "$ac_t""$OBJDUMP" 1>&6
3440 else
3441   echo "$ac_t""no" 1>&6
3442 fi
3443
3444 else
3445   OBJDUMP="false"
3446 fi
3447 fi
3448
3449   ;;
3450
3451 esac
3452
3453
3454 # Save cache, so that ltconfig can load it
3455
3456
3457 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3458 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3459 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3460 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3461 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3462 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3463 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3464 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3465
3466 # Reload cache, that may have been modified by ltconfig
3467
3468
3469 # This can be used to rebuild libtool when needed
3470 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3471
3472 # Always use our own libtool.
3473 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3474
3475 # Redirect the config.log output again, so that the ltconfig log is not
3476 # clobbered by the next message.
3477 exec 5>>./config.log
3478
3479
3480 for ac_prog in mawk gawk nawk awk
3481 do
3482 # Extract the first word of "$ac_prog", so it can be a program name with args.
3483 set dummy $ac_prog; ac_word=$2
3484 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3485 echo "configure:3486: checking for $ac_word" >&5
3486 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3487   echo $ac_n "(cached) $ac_c" 1>&6
3488 else
3489   if test -n "$AWK"; then
3490   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3491 else
3492   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3493   ac_dummy="$PATH"
3494   for ac_dir in $ac_dummy; do
3495     test -z "$ac_dir" && ac_dir=.
3496     if test -f $ac_dir/$ac_word; then
3497       ac_cv_prog_AWK="$ac_prog"
3498       break
3499     fi
3500   done
3501   IFS="$ac_save_ifs"
3502 fi
3503 fi
3504 AWK="$ac_cv_prog_AWK"
3505 if test -n "$AWK"; then
3506   echo "$ac_t""$AWK" 1>&6
3507 else
3508   echo "$ac_t""no" 1>&6
3509 fi
3510
3511 test -n "$AWK" && break
3512 done
3513
3514 # test for ln hardlink support
3515 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3516 echo "configure:3517: checking whether ln works" >&5
3517 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3518   echo $ac_n "(cached) $ac_c" 1>&6
3519 else
3520   rm -f conftest.src conftest.dst
3521 echo "conftest" > conftest.src
3522 if ln conftest.src conftest.dst 2>/dev/null
3523 then
3524   ol_cv_prog_LN_H="ln"
3525 else
3526   ol_cv_prog_LN_H="cp"
3527 fi
3528 rm -f conftest.src conftest.dst
3529
3530 fi
3531 LN_H="$ol_cv_prog_LN_H"
3532 if test "$ol_cv_prog_LN_H" = "ln"; then
3533         echo "$ac_t""yes" 1>&6
3534 else
3535         echo "$ac_t""no" 1>&6
3536 fi
3537
3538 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3539 echo "configure:3540: checking whether ln -s works" >&5
3540 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3541   echo $ac_n "(cached) $ac_c" 1>&6
3542 else
3543   rm -f conftestdata
3544 if ln -s X conftestdata 2>/dev/null
3545 then
3546   rm -f conftestdata
3547   ac_cv_prog_LN_S="ln -s"
3548 else
3549   ac_cv_prog_LN_S=ln
3550 fi
3551 fi
3552 LN_S="$ac_cv_prog_LN_S"
3553 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3554   echo "$ac_t""yes" 1>&6
3555 else
3556   echo "$ac_t""no" 1>&6
3557 fi
3558
3559
3560 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3561         LN_S="$LN_H"
3562 fi
3563
3564 # Extract the first word of "sendmail", so it can be a program name with args.
3565 set dummy sendmail; 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_path_SENDMAIL+set}\" = set"; then
3569   echo $ac_n "(cached) $ac_c" 1>&6
3570 else
3571   case "$SENDMAIL" in
3572   /*)
3573   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3574   ;;
3575   ?:/*)
3576   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3577   ;;
3578   *)
3579   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3580   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3581   for ac_dir in $ac_dummy; do 
3582     test -z "$ac_dir" && ac_dir=.
3583     if test -f $ac_dir/$ac_word; then
3584       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3585       break
3586     fi
3587   done
3588   IFS="$ac_save_ifs"
3589   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3590   ;;
3591 esac
3592 fi
3593 SENDMAIL="$ac_cv_path_SENDMAIL"
3594 if test -n "$SENDMAIL"; then
3595   echo "$ac_t""$SENDMAIL" 1>&6
3596 else
3597   echo "$ac_t""no" 1>&6
3598 fi
3599
3600 # Extract the first word of "vi", so it can be a program name with args.
3601 set dummy vi; ac_word=$2
3602 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3603 echo "configure:3604: checking for $ac_word" >&5
3604 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3605   echo $ac_n "(cached) $ac_c" 1>&6
3606 else
3607   case "$EDITOR" in
3608   /*)
3609   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3610   ;;
3611   ?:/*)
3612   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3613   ;;
3614   *)
3615   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3616   ac_dummy="$PATH:/usr/ucb"
3617   for ac_dir in $ac_dummy; do 
3618     test -z "$ac_dir" && ac_dir=.
3619     if test -f $ac_dir/$ac_word; then
3620       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3621       break
3622     fi
3623   done
3624   IFS="$ac_save_ifs"
3625   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3626   ;;
3627 esac
3628 fi
3629 EDITOR="$ac_cv_path_EDITOR"
3630 if test -n "$EDITOR"; then
3631   echo "$ac_t""$EDITOR" 1>&6
3632 else
3633   echo "$ac_t""no" 1>&6
3634 fi
3635
3636 # Extract the first word of "finger", so it can be a program name with args.
3637 set dummy finger; ac_word=$2
3638 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3639 echo "configure:3640: checking for $ac_word" >&5
3640 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3641   echo $ac_n "(cached) $ac_c" 1>&6
3642 else
3643   case "$FINGER" in
3644   /*)
3645   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3646   ;;
3647   ?:/*)
3648   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3649   ;;
3650   *)
3651   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3652   ac_dummy="$PATH:/usr/ucb"
3653   for ac_dir in $ac_dummy; do 
3654     test -z "$ac_dir" && ac_dir=.
3655     if test -f $ac_dir/$ac_word; then
3656       ac_cv_path_FINGER="$ac_dir/$ac_word"
3657       break
3658     fi
3659   done
3660   IFS="$ac_save_ifs"
3661   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3662   ;;
3663 esac
3664 fi
3665 FINGER="$ac_cv_path_FINGER"
3666 if test -n "$FINGER"; then
3667   echo "$ac_t""$FINGER" 1>&6
3668 else
3669   echo "$ac_t""no" 1>&6
3670 fi
3671
3672
3673 ol_link_perl=no
3674 if test $ol_enable_perl != no ; then
3675         # Extract the first word of "perl", so it can be a program name with args.
3676 set dummy perl; ac_word=$2
3677 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3678 echo "configure:3679: checking for $ac_word" >&5
3679 if eval "test \"\${ac_cv_path_PERLBIN+set}\" = set"; then
3680   echo $ac_n "(cached) $ac_c" 1>&6
3681 else
3682   case "$PERLBIN" in
3683   /*)
3684   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
3685   ;;
3686   ?:/*)
3687   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
3688   ;;
3689   *)
3690   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3691   ac_dummy="$PATH"
3692   for ac_dir in $ac_dummy; do 
3693     test -z "$ac_dir" && ac_dir=.
3694     if test -f $ac_dir/$ac_word; then
3695       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
3696       break
3697     fi
3698   done
3699   IFS="$ac_save_ifs"
3700   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
3701   ;;
3702 esac
3703 fi
3704 PERLBIN="$ac_cv_path_PERLBIN"
3705 if test -n "$PERLBIN"; then
3706   echo "$ac_t""$PERLBIN" 1>&6
3707 else
3708   echo "$ac_t""no" 1>&6
3709 fi
3710
3711
3712         if test "no$PERLBIN" = "no" ; then
3713                 if test $ol_enable_perl = yes ; then
3714                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
3715                 fi
3716
3717         else
3718                 PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
3719                 if test x"$ol_with_perl_module" = "xstatic" ; then
3720                         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3721                 else
3722                         MOD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
3723                 fi
3724                                 ol_link_perl=yes
3725         fi
3726 fi
3727
3728 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3729 echo "configure:3730: checking how to run the C preprocessor" >&5
3730 # On Suns, sometimes $CPP names a directory.
3731 if test -n "$CPP" && test -d "$CPP"; then
3732   CPP=
3733 fi
3734 if test -z "$CPP"; then
3735 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3736   echo $ac_n "(cached) $ac_c" 1>&6
3737 else
3738     # This must be in double quotes, not single quotes, because CPP may get
3739   # substituted into the Makefile and "${CC-cc}" will confuse make.
3740   CPP="${CC-cc} -E"
3741   # On the NeXT, cc -E runs the code through the compiler's parser,
3742   # not just through cpp.
3743   cat > conftest.$ac_ext <<EOF
3744 #line 3745 "configure"
3745 #include "confdefs.h"
3746 #include <assert.h>
3747 Syntax Error
3748 EOF
3749 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3750 { (eval echo configure:3751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3751 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3752 if test -z "$ac_err"; then
3753   :
3754 else
3755   echo "$ac_err" >&5
3756   echo "configure: failed program was:" >&5
3757   cat conftest.$ac_ext >&5
3758   rm -rf conftest*
3759   CPP="${CC-cc} -E -traditional-cpp"
3760   cat > conftest.$ac_ext <<EOF
3761 #line 3762 "configure"
3762 #include "confdefs.h"
3763 #include <assert.h>
3764 Syntax Error
3765 EOF
3766 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3767 { (eval echo configure:3768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3768 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3769 if test -z "$ac_err"; then
3770   :
3771 else
3772   echo "$ac_err" >&5
3773   echo "configure: failed program was:" >&5
3774   cat conftest.$ac_ext >&5
3775   rm -rf conftest*
3776   CPP="${CC-cc} -nologo -E"
3777   cat > conftest.$ac_ext <<EOF
3778 #line 3779 "configure"
3779 #include "confdefs.h"
3780 #include <assert.h>
3781 Syntax Error
3782 EOF
3783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3784 { (eval echo configure:3785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3786 if test -z "$ac_err"; then
3787   :
3788 else
3789   echo "$ac_err" >&5
3790   echo "configure: failed program was:" >&5
3791   cat conftest.$ac_ext >&5
3792   rm -rf conftest*
3793   CPP=/lib/cpp
3794 fi
3795 rm -f conftest*
3796 fi
3797 rm -f conftest*
3798 fi
3799 rm -f conftest*
3800   ac_cv_prog_CPP="$CPP"
3801 fi
3802   CPP="$ac_cv_prog_CPP"
3803 else
3804   ac_cv_prog_CPP="$CPP"
3805 fi
3806 echo "$ac_t""$CPP" 1>&6
3807
3808
3809 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3810         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3811
3812 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3813         echo "configure: warning: programs compiled here do run here..." 1>&2
3814         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3815
3816 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3817         echo "configure: warning: programs compiled here do not run here..." 1>&2
3818         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3819 fi
3820
3821 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3822 echo "configure:3823: checking for AIX" >&5
3823 cat > conftest.$ac_ext <<EOF
3824 #line 3825 "configure"
3825 #include "confdefs.h"
3826 #ifdef _AIX
3827   yes
3828 #endif
3829
3830 EOF
3831 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3832   egrep "yes" >/dev/null 2>&1; then
3833   rm -rf conftest*
3834   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3835 #define _ALL_SOURCE 1
3836 EOF
3837
3838 else
3839   rm -rf conftest*
3840   echo "$ac_t""no" 1>&6
3841 fi
3842 rm -f conftest*
3843
3844
3845 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3846 echo "configure:3847: checking for POSIXized ISC" >&5
3847 if test -d /etc/conf/kconfig.d &&
3848   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3849 then
3850   echo "$ac_t""yes" 1>&6
3851   ISC=yes # If later tests want to check for ISC.
3852   cat >> confdefs.h <<\EOF
3853 #define _POSIX_SOURCE 1
3854 EOF
3855
3856   if test "$GCC" = yes; then
3857     CC="$CC -posix"
3858   else
3859     CC="$CC -Xp"
3860   fi
3861 else
3862   echo "$ac_t""no" 1>&6
3863   ISC=
3864 fi
3865
3866 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3867 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3868 echo "configure:3869: checking for minix/config.h" >&5
3869 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3870   echo $ac_n "(cached) $ac_c" 1>&6
3871 else
3872   cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 #include <minix/config.h>
3876 EOF
3877 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3878 { (eval echo configure:3879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3879 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3880 if test -z "$ac_err"; then
3881   rm -rf conftest*
3882   eval "ac_cv_header_$ac_safe=yes"
3883 else
3884   echo "$ac_err" >&5
3885   echo "configure: failed program was:" >&5
3886   cat conftest.$ac_ext >&5
3887   rm -rf conftest*
3888   eval "ac_cv_header_$ac_safe=no"
3889 fi
3890 rm -f conftest*
3891 fi
3892 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3893   echo "$ac_t""yes" 1>&6
3894   MINIX=yes
3895 else
3896   echo "$ac_t""no" 1>&6
3897 MINIX=
3898 fi
3899
3900 if test "$MINIX" = yes; then
3901   cat >> confdefs.h <<\EOF
3902 #define _POSIX_SOURCE 1
3903 EOF
3904
3905   cat >> confdefs.h <<\EOF
3906 #define _POSIX_1_SOURCE 2
3907 EOF
3908
3909   cat >> confdefs.h <<\EOF
3910 #define _MINIX 1
3911 EOF
3912
3913 fi
3914
3915
3916 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3917 echo "configure:3918: checking for Cygwin environment" >&5
3918 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3919   echo $ac_n "(cached) $ac_c" 1>&6
3920 else
3921   cat > conftest.$ac_ext <<EOF
3922 #line 3923 "configure"
3923 #include "confdefs.h"
3924
3925 int main() {
3926
3927 #ifndef __CYGWIN__
3928 #define __CYGWIN__ __CYGWIN32__
3929 #endif
3930 return __CYGWIN__;
3931 ; return 0; }
3932 EOF
3933 if { (eval echo configure:3934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3934   rm -rf conftest*
3935   ac_cv_cygwin=yes
3936 else
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -rf conftest*
3940   ac_cv_cygwin=no
3941 fi
3942 rm -f conftest*
3943 fi
3944
3945 echo "$ac_t""$ac_cv_cygwin" 1>&6
3946 CYGWIN=
3947 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3948 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3949 echo "configure:3950: checking for mingw32 environment" >&5
3950 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3951   echo $ac_n "(cached) $ac_c" 1>&6
3952 else
3953   cat > conftest.$ac_ext <<EOF
3954 #line 3955 "configure"
3955 #include "confdefs.h"
3956
3957 int main() {
3958 return __MINGW32__;
3959 ; return 0; }
3960 EOF
3961 if { (eval echo configure:3962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3962   rm -rf conftest*
3963   ac_cv_mingw32=yes
3964 else
3965   echo "configure: failed program was:" >&5
3966   cat conftest.$ac_ext >&5
3967   rm -rf conftest*
3968   ac_cv_mingw32=no
3969 fi
3970 rm -f conftest*
3971 fi
3972
3973 echo "$ac_t""$ac_cv_mingw32" 1>&6
3974 MINGW32=
3975 test "$ac_cv_mingw32" = yes && MINGW32=yes
3976 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3977 echo "configure:3978: checking for EMX OS/2 environment" >&5
3978 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3979   echo $ac_n "(cached) $ac_c" 1>&6
3980 else
3981   cat > conftest.$ac_ext <<EOF
3982 #line 3983 "configure"
3983 #include "confdefs.h"
3984
3985 int main() {
3986 return __EMX__;
3987 ; return 0; }
3988 EOF
3989 if { (eval echo configure:3990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3990   rm -rf conftest*
3991   ac_cv_emxos2=yes
3992 else
3993   echo "configure: failed program was:" >&5
3994   cat conftest.$ac_ext >&5
3995   rm -rf conftest*
3996   ac_cv_emxos2=no
3997 fi
3998 rm -f conftest*
3999 fi
4000
4001 echo "$ac_t""$ac_cv_emxos2" 1>&6
4002 EMXOS2=
4003 test "$ac_cv_emxos2" = yes && EMXOS2=yes
4004
4005
4006
4007 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
4008 echo "configure:4009: checking for executable suffix" >&5
4009 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
4010   echo $ac_n "(cached) $ac_c" 1>&6
4011 else
4012   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
4013   ac_cv_exeext=.exe
4014 else
4015   rm -f conftest*
4016   echo 'int main () { return 0; }' > conftest.$ac_ext
4017   ac_cv_exeext=
4018   if { (eval echo configure:4019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4019     for file in conftest.*; do
4020       case $file in
4021       *.c | *.C | *.o | *.obj | *.xcoff) ;;
4022       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
4023       esac
4024     done
4025   else
4026     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
4027   fi
4028   rm -f conftest*
4029   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
4030 fi
4031 fi
4032
4033 EXEEXT=""
4034 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
4035 echo "$ac_t""${ac_cv_exeext}" 1>&6
4036 ac_exeext=$EXEEXT
4037
4038 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
4039 echo "configure:4040: checking for object suffix" >&5
4040 if eval "test \"\${ac_cv_objext+set}\" = set"; then
4041   echo $ac_n "(cached) $ac_c" 1>&6
4042 else
4043   rm -f conftest*
4044 echo 'int i = 1;' > conftest.$ac_ext
4045 if { (eval echo configure:4046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4046   for ac_file in conftest.*; do
4047     case $ac_file in
4048     *.c) ;;
4049     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
4050     esac
4051   done
4052 else
4053   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
4054 fi
4055 rm -f conftest*
4056 fi
4057
4058 echo "$ac_t""$ac_cv_objext" 1>&6
4059 OBJEXT=$ac_cv_objext
4060 ac_objext=$ac_cv_objext
4061
4062
4063 cat >> confdefs.h <<EOF
4064 #define EXEEXT "${EXEEXT}"
4065 EOF
4066
4067
4068 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
4069 echo "configure:4070: checking for be_app in -lbe" >&5
4070 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
4071 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4072   echo $ac_n "(cached) $ac_c" 1>&6
4073 else
4074   ac_save_LIBS="$LIBS"
4075 LIBS="-lbe -lroot -lnet $LIBS"
4076 cat > conftest.$ac_ext <<EOF
4077 #line 4078 "configure"
4078 #include "confdefs.h"
4079 /* Override any gcc2 internal prototype to avoid an error.  */
4080 /* We use char because int might match the return type of a gcc2
4081     builtin and then its argument prototype would still apply.  */
4082 char be_app();
4083
4084 int main() {
4085 be_app()
4086 ; return 0; }
4087 EOF
4088 if { (eval echo configure:4089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4089   rm -rf conftest*
4090   eval "ac_cv_lib_$ac_lib_var=yes"
4091 else
4092   echo "configure: failed program was:" >&5
4093   cat conftest.$ac_ext >&5
4094   rm -rf conftest*
4095   eval "ac_cv_lib_$ac_lib_var=no"
4096 fi
4097 rm -f conftest*
4098 LIBS="$ac_save_LIBS"
4099
4100 fi
4101 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4102   echo "$ac_t""yes" 1>&6
4103   LIBS="$LIBS -lbe -lroot -lnet"
4104 else
4105   echo "$ac_t""no" 1>&6
4106 :
4107 fi
4108
4109
4110
4111
4112
4113 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
4114 echo "configure:4115: checking for ${CC-cc} option to accept ANSI C" >&5
4115 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
4116   echo $ac_n "(cached) $ac_c" 1>&6
4117 else
4118   am_cv_prog_cc_stdc=no
4119 ac_save_CC="$CC"
4120 # Don't try gcc -ansi; that turns off useful extensions and
4121 # breaks some systems' header files.
4122 # AIX                   -qlanglvl=ansi
4123 # Ultrix and OSF/1      -std1
4124 # HP-UX 10.20 and later -Ae
4125 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4126 # SVR4                  -Xc -D__EXTENSIONS__
4127 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4128 do
4129   CC="$ac_save_CC $ac_arg"
4130   cat > conftest.$ac_ext <<EOF
4131 #line 4132 "configure"
4132 #include "confdefs.h"
4133 #include <stdarg.h>
4134 #include <stdio.h>
4135 #include <sys/types.h>
4136 #include <sys/stat.h>
4137 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4138 struct buf { int x; };
4139 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4140 static char *e (p, i)
4141      char **p;
4142      int i;
4143 {
4144   return p[i];
4145 }
4146 static char *f (char * (*g) (char **, int), char **p, ...)
4147 {
4148   char *s;
4149   va_list v;
4150   va_start (v,p);
4151   s = g (p, va_arg (v,int));
4152   va_end (v);
4153   return s;
4154 }
4155 int test (int i, double x);
4156 struct s1 {int (*f) (int a);};
4157 struct s2 {int (*f) (double a);};
4158 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4159 int argc;
4160 char **argv;
4161
4162 int main() {
4163
4164 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4165
4166 ; return 0; }
4167 EOF
4168 if { (eval echo configure:4169: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4169   rm -rf conftest*
4170   am_cv_prog_cc_stdc="$ac_arg"; break
4171 else
4172   echo "configure: failed program was:" >&5
4173   cat conftest.$ac_ext >&5
4174 fi
4175 rm -f conftest*
4176 done
4177 CC="$ac_save_CC"
4178
4179 fi
4180
4181 if test -z "$am_cv_prog_cc_stdc"; then
4182   echo "$ac_t""none needed" 1>&6
4183 else
4184   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
4185 fi
4186 case "x$am_cv_prog_cc_stdc" in
4187   x|xno) ;;
4188   *) CC="$CC $am_cv_prog_cc_stdc" ;;
4189 esac
4190
4191 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
4192         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
4193 fi
4194
4195 # test for make depend flag
4196 OL_MKDEP=
4197 OL_MKDEP_FLAGS=
4198 if test -z "${MKDEP}"; then
4199         OL_MKDEP="${CC-cc}"
4200         if test -z "${MKDEP_FLAGS}"; then
4201                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
4202 echo "configure:4203: checking for ${OL_MKDEP} depend flag" >&5
4203 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
4204   echo $ac_n "(cached) $ac_c" 1>&6
4205 else
4206   
4207                         ol_cv_mkdep=no
4208                         for flag in "-M" "-xM"; do
4209                                 cat > conftest.c <<EOF
4210  noCode;
4211 EOF
4212                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:4213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
4213                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
4214                                 then
4215                                         if test ! -f conftest."${ac_object}" ; then
4216                                                 ol_cv_mkdep=$flag
4217                                                 OL_MKDEP_FLAGS="$flag"
4218                                                 break
4219                                         fi
4220                                 fi
4221                         done
4222                         rm -f conftest*
4223                 
4224 fi
4225
4226 echo "$ac_t""$ol_cv_mkdep" 1>&6
4227         else
4228                 cc_cv_mkdep=yes
4229                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4230         fi
4231 else
4232         cc_cv_mkdep=yes
4233         OL_MKDEP="${MKDEP}"
4234         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
4235 fi
4236
4237
4238
4239 if test "${ol_cv_mkdep}" = no ; then
4240         # this will soon become an error
4241         echo "configure: warning: do not know how to generate dependencies" 1>&2
4242 fi
4243
4244 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
4245 echo "configure:4246: checking for afopen in -ls" >&5
4246 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
4247 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4248   echo $ac_n "(cached) $ac_c" 1>&6
4249 else
4250   ac_save_LIBS="$LIBS"
4251 LIBS="-ls  $LIBS"
4252 cat > conftest.$ac_ext <<EOF
4253 #line 4254 "configure"
4254 #include "confdefs.h"
4255 /* Override any gcc2 internal prototype to avoid an error.  */
4256 /* We use char because int might match the return type of a gcc2
4257     builtin and then its argument prototype would still apply.  */
4258 char afopen();
4259
4260 int main() {
4261 afopen()
4262 ; return 0; }
4263 EOF
4264 if { (eval echo configure:4265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4265   rm -rf conftest*
4266   eval "ac_cv_lib_$ac_lib_var=yes"
4267 else
4268   echo "configure: failed program was:" >&5
4269   cat conftest.$ac_ext >&5
4270   rm -rf conftest*
4271   eval "ac_cv_lib_$ac_lib_var=no"
4272 fi
4273 rm -f conftest*
4274 LIBS="$ac_save_LIBS"
4275
4276 fi
4277 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4278   echo "$ac_t""yes" 1>&6
4279   
4280         AUTH_LIBS=-ls
4281         cat >> confdefs.h <<\EOF
4282 #define HAVE_AIX_SECURITY 1
4283 EOF
4284
4285
4286 else
4287   echo "$ac_t""no" 1>&6
4288 fi
4289
4290
4291
4292 ol_link_modules=no
4293 if test $ol_enable_modules != no ; then
4294         for ac_hdr in ltdl.h
4295 do
4296 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4297 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4298 echo "configure:4299: checking for $ac_hdr" >&5
4299 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4300   echo $ac_n "(cached) $ac_c" 1>&6
4301 else
4302   cat > conftest.$ac_ext <<EOF
4303 #line 4304 "configure"
4304 #include "confdefs.h"
4305 #include <$ac_hdr>
4306 EOF
4307 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4308 { (eval echo configure:4309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4309 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4310 if test -z "$ac_err"; then
4311   rm -rf conftest*
4312   eval "ac_cv_header_$ac_safe=yes"
4313 else
4314   echo "$ac_err" >&5
4315   echo "configure: failed program was:" >&5
4316   cat conftest.$ac_ext >&5
4317   rm -rf conftest*
4318   eval "ac_cv_header_$ac_safe=no"
4319 fi
4320 rm -f conftest*
4321 fi
4322 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4323   echo "$ac_t""yes" 1>&6
4324     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4325   cat >> confdefs.h <<EOF
4326 #define $ac_tr_hdr 1
4327 EOF
4328  
4329 else
4330   echo "$ac_t""no" 1>&6
4331 fi
4332 done
4333
4334
4335         if test $ac_cv_header_ltdl_h = no ; then
4336                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4337         fi
4338
4339         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4340 echo "configure:4341: checking for lt_dlinit in -lltdl" >&5
4341 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4342 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4343   echo $ac_n "(cached) $ac_c" 1>&6
4344 else
4345   ac_save_LIBS="$LIBS"
4346 LIBS="-lltdl  $LIBS"
4347 cat > conftest.$ac_ext <<EOF
4348 #line 4349 "configure"
4349 #include "confdefs.h"
4350 /* Override any gcc2 internal prototype to avoid an error.  */
4351 /* We use char because int might match the return type of a gcc2
4352     builtin and then its argument prototype would still apply.  */
4353 char lt_dlinit();
4354
4355 int main() {
4356 lt_dlinit()
4357 ; return 0; }
4358 EOF
4359 if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4360   rm -rf conftest*
4361   eval "ac_cv_lib_$ac_lib_var=yes"
4362 else
4363   echo "configure: failed program was:" >&5
4364   cat conftest.$ac_ext >&5
4365   rm -rf conftest*
4366   eval "ac_cv_lib_$ac_lib_var=no"
4367 fi
4368 rm -f conftest*
4369 LIBS="$ac_save_LIBS"
4370
4371 fi
4372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4373   echo "$ac_t""yes" 1>&6
4374   
4375             MODULES_LIBS=-lltdl
4376             cat >> confdefs.h <<\EOF
4377 #define HAVE_LIBLTDL 1
4378 EOF
4379
4380         
4381 else
4382   echo "$ac_t""no" 1>&6
4383 fi
4384
4385
4386         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4387                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4388         fi
4389         ol_link_modules=yes
4390 else
4391         ol_with_bdb_module=static
4392         ol_with_dnssrv_module=static
4393         ol_with_ldap_module=static
4394         ol_with_ldbm_module=static
4395         ol_with_meta_module=static
4396         ol_with_passwd_module=static
4397         ol_with_perl_module=static
4398         ol_with_shell_module=static
4399         ol_with_tcl_module=static
4400         ol_with_sql_module=static
4401 fi
4402
4403 # test for EBCDIC
4404 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4405 echo "configure:4406: checking for EBCDIC" >&5
4406 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4407   echo $ac_n "(cached) $ac_c" 1>&6
4408 else
4409   
4410         cat > conftest.$ac_ext <<EOF
4411 #line 4412 "configure"
4412 #include "confdefs.h"
4413
4414 #if !('M' == 0xd4)
4415 #include <__ASCII__/generate_error.h>
4416 #endif
4417
4418 EOF
4419 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4420 { (eval echo configure:4421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4421 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4422 if test -z "$ac_err"; then
4423   rm -rf conftest*
4424   ol_cv_cpp_ebcdic=yes
4425 else
4426   echo "$ac_err" >&5
4427   echo "configure: failed program was:" >&5
4428   cat conftest.$ac_ext >&5
4429   rm -rf conftest*
4430   ol_cv_cpp_ebcdic=no
4431 fi
4432 rm -f conftest*
4433 fi
4434
4435 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4436 if test $ol_cv_cpp_ebcdic = yes ; then
4437         cat >> confdefs.h <<\EOF
4438 #define HAVE_EBCDIC 1
4439 EOF
4440
4441 fi
4442
4443 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4444 echo "configure:4445: checking for ANSI C header files" >&5
4445 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4446   echo $ac_n "(cached) $ac_c" 1>&6
4447 else
4448   cat > conftest.$ac_ext <<EOF
4449 #line 4450 "configure"
4450 #include "confdefs.h"
4451 #include <stdlib.h>
4452 #include <stdarg.h>
4453 #include <string.h>
4454 #include <float.h>
4455 EOF
4456 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4457 { (eval echo configure:4458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4458 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4459 if test -z "$ac_err"; then
4460   rm -rf conftest*
4461   ol_cv_header_stdc=yes
4462 else
4463   echo "$ac_err" >&5
4464   echo "configure: failed program was:" >&5
4465   cat conftest.$ac_ext >&5
4466   rm -rf conftest*
4467   ol_cv_header_stdc=no
4468 fi
4469 rm -f conftest*
4470
4471 if test $ol_cv_header_stdc = yes; then
4472   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4473 cat > conftest.$ac_ext <<EOF
4474 #line 4475 "configure"
4475 #include "confdefs.h"
4476 #include <string.h>
4477 EOF
4478 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4479   egrep "memchr" >/dev/null 2>&1; then
4480   :
4481 else
4482   rm -rf conftest*
4483   ol_cv_header_stdc=no
4484 fi
4485 rm -f conftest*
4486
4487 fi
4488
4489 if test $ol_cv_header_stdc = yes; then
4490   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4491 cat > conftest.$ac_ext <<EOF
4492 #line 4493 "configure"
4493 #include "confdefs.h"
4494 #include <stdlib.h>
4495 EOF
4496 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4497   egrep "free" >/dev/null 2>&1; then
4498   :
4499 else
4500   rm -rf conftest*
4501   ol_cv_header_stdc=no
4502 fi
4503 rm -f conftest*
4504
4505 fi
4506
4507 if test $ol_cv_header_stdc = yes; then
4508   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4509 if test "$cross_compiling" = yes; then
4510   :
4511 else
4512   cat > conftest.$ac_ext <<EOF
4513 #line 4514 "configure"
4514 #include "confdefs.h"
4515 #include <ctype.h>
4516 #ifndef HAVE_EBCDIC
4517 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4518 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4519 #else
4520 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4521                 || ('j' <= (c) && (c) <= 'r') \
4522                 || ('s' <= (c) && (c) <= 'z'))
4523 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4524 #endif
4525 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4526 int main () { int i; for (i = 0; i < 256; i++)
4527 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4528 exit (0); }
4529
4530 EOF
4531 if { (eval echo configure:4532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4532 then
4533   :
4534 else
4535   echo "configure: failed program was:" >&5
4536   cat conftest.$ac_ext >&5
4537   rm -fr conftest*
4538   ol_cv_header_stdc=no
4539 fi
4540 rm -fr conftest*
4541 fi
4542
4543 fi
4544 fi
4545
4546 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4547 if test $ol_cv_header_stdc = yes; then
4548   cat >> confdefs.h <<\EOF
4549 #define STDC_HEADERS 1
4550 EOF
4551
4552 fi
4553 ac_cv_header_stdc=disable
4554
4555
4556 if test $ol_cv_header_stdc != yes; then
4557         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4558 fi
4559
4560 ac_header_dirent=no
4561 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4562 do
4563 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4564 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4565 echo "configure:4566: checking for $ac_hdr that defines DIR" >&5
4566 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4567   echo $ac_n "(cached) $ac_c" 1>&6
4568 else
4569   cat > conftest.$ac_ext <<EOF
4570 #line 4571 "configure"
4571 #include "confdefs.h"
4572 #include <sys/types.h>
4573 #include <$ac_hdr>
4574 int main() {
4575 DIR *dirp = 0;
4576 ; return 0; }
4577 EOF
4578 if { (eval echo configure:4579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4579   rm -rf conftest*
4580   eval "ac_cv_header_dirent_$ac_safe=yes"
4581 else
4582   echo "configure: failed program was:" >&5
4583   cat conftest.$ac_ext >&5
4584   rm -rf conftest*
4585   eval "ac_cv_header_dirent_$ac_safe=no"
4586 fi
4587 rm -f conftest*
4588 fi
4589 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4590   echo "$ac_t""yes" 1>&6
4591     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4592   cat >> confdefs.h <<EOF
4593 #define $ac_tr_hdr 1
4594 EOF
4595  ac_header_dirent=$ac_hdr; break
4596 else
4597   echo "$ac_t""no" 1>&6
4598 fi
4599 done
4600 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4601 if test $ac_header_dirent = dirent.h; then
4602 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4603 echo "configure:4604: checking for opendir in -ldir" >&5
4604 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4605 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4606   echo $ac_n "(cached) $ac_c" 1>&6
4607 else
4608   ac_save_LIBS="$LIBS"
4609 LIBS="-ldir  $LIBS"
4610 cat > conftest.$ac_ext <<EOF
4611 #line 4612 "configure"
4612 #include "confdefs.h"
4613 /* Override any gcc2 internal prototype to avoid an error.  */
4614 /* We use char because int might match the return type of a gcc2
4615     builtin and then its argument prototype would still apply.  */
4616 char opendir();
4617
4618 int main() {
4619 opendir()
4620 ; return 0; }
4621 EOF
4622 if { (eval echo configure:4623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4623   rm -rf conftest*
4624   eval "ac_cv_lib_$ac_lib_var=yes"
4625 else
4626   echo "configure: failed program was:" >&5
4627   cat conftest.$ac_ext >&5
4628   rm -rf conftest*
4629   eval "ac_cv_lib_$ac_lib_var=no"
4630 fi
4631 rm -f conftest*
4632 LIBS="$ac_save_LIBS"
4633
4634 fi
4635 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4636   echo "$ac_t""yes" 1>&6
4637   LIBS="$LIBS -ldir"
4638 else
4639   echo "$ac_t""no" 1>&6
4640 fi
4641
4642 else
4643 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4644 echo "configure:4645: checking for opendir in -lx" >&5
4645 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4646 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4647   echo $ac_n "(cached) $ac_c" 1>&6
4648 else
4649   ac_save_LIBS="$LIBS"
4650 LIBS="-lx  $LIBS"
4651 cat > conftest.$ac_ext <<EOF
4652 #line 4653 "configure"
4653 #include "confdefs.h"
4654 /* Override any gcc2 internal prototype to avoid an error.  */
4655 /* We use char because int might match the return type of a gcc2
4656     builtin and then its argument prototype would still apply.  */
4657 char opendir();
4658
4659 int main() {
4660 opendir()
4661 ; return 0; }
4662 EOF
4663 if { (eval echo configure:4664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4664   rm -rf conftest*
4665   eval "ac_cv_lib_$ac_lib_var=yes"
4666 else
4667   echo "configure: failed program was:" >&5
4668   cat conftest.$ac_ext >&5
4669   rm -rf conftest*
4670   eval "ac_cv_lib_$ac_lib_var=no"
4671 fi
4672 rm -f conftest*
4673 LIBS="$ac_save_LIBS"
4674
4675 fi
4676 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4677   echo "$ac_t""yes" 1>&6
4678   LIBS="$LIBS -lx"
4679 else
4680   echo "$ac_t""no" 1>&6
4681 fi
4682
4683 fi
4684
4685 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4686 echo "configure:4687: checking for sys/wait.h that is POSIX.1 compatible" >&5
4687 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4688   echo $ac_n "(cached) $ac_c" 1>&6
4689 else
4690   cat > conftest.$ac_ext <<EOF
4691 #line 4692 "configure"
4692 #include "confdefs.h"
4693 #include <sys/types.h>
4694 #include <sys/wait.h>
4695 #ifndef WEXITSTATUS
4696 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4697 #endif
4698 #ifndef WIFEXITED
4699 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4700 #endif
4701 int main() {
4702 int s;
4703 wait (&s);
4704 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4705 ; return 0; }
4706 EOF
4707 if { (eval echo configure:4708: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4708   rm -rf conftest*
4709   ac_cv_header_sys_wait_h=yes
4710 else
4711   echo "configure: failed program was:" >&5
4712   cat conftest.$ac_ext >&5
4713   rm -rf conftest*
4714   ac_cv_header_sys_wait_h=no
4715 fi
4716 rm -f conftest*
4717 fi
4718
4719 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4720 if test $ac_cv_header_sys_wait_h = yes; then
4721   cat >> confdefs.h <<\EOF
4722 #define HAVE_SYS_WAIT_H 1
4723 EOF
4724
4725 fi
4726
4727 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4728 echo "configure:4729: checking POSIX termios" >&5
4729 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4730   echo $ac_n "(cached) $ac_c" 1>&6
4731 else
4732   cat > conftest.$ac_ext <<EOF
4733 #line 4734 "configure"
4734 #include "confdefs.h"
4735 #include <sys/types.h>
4736 #include <unistd.h>
4737 #include <termios.h>
4738 int main() {
4739 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4740    tcgetattr(0, 0);
4741 ; return 0; }
4742 EOF
4743 if { (eval echo configure:4744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4744   rm -rf conftest*
4745   am_cv_sys_posix_termios=yes
4746 else
4747   echo "configure: failed program was:" >&5
4748   cat conftest.$ac_ext >&5
4749   rm -rf conftest*
4750   am_cv_sys_posix_termios=no
4751 fi
4752 rm -f conftest*
4753 fi
4754
4755 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4756
4757
4758  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4759 echo "configure:4760: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4760 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4761   echo $ac_n "(cached) $ac_c" 1>&6
4762 else
4763   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4764
4765   gwinsz_in_termios_h=no
4766   if test $am_cv_sys_posix_termios = yes; then
4767     cat > conftest.$ac_ext <<EOF
4768 #line 4769 "configure"
4769 #include "confdefs.h"
4770 #include <sys/types.h>
4771 #     include <termios.h>
4772 #     ifdef TIOCGWINSZ
4773         yes
4774 #     endif
4775     
4776 EOF
4777 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4778   egrep "yes" >/dev/null 2>&1; then
4779   rm -rf conftest*
4780   gwinsz_in_termios_h=yes
4781 fi
4782 rm -f conftest*
4783
4784   fi
4785
4786   if test $gwinsz_in_termios_h = no; then
4787     cat > conftest.$ac_ext <<EOF
4788 #line 4789 "configure"
4789 #include "confdefs.h"
4790 #include <sys/types.h>
4791 #     include <sys/ioctl.h>
4792 #     ifdef TIOCGWINSZ
4793         yes
4794 #     endif
4795     
4796 EOF
4797 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4798   egrep "yes" >/dev/null 2>&1; then
4799   rm -rf conftest*
4800   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4801 fi
4802 rm -f conftest*
4803
4804   fi
4805   
4806 fi
4807
4808 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4809   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4810     cat >> confdefs.h <<\EOF
4811 #define GWINSZ_IN_SYS_IOCTL 1
4812 EOF
4813
4814   fi
4815
4816 if test $am_cv_sys_posix_termios = yes ; then
4817         cat >> confdefs.h <<\EOF
4818 #define HAVE_POSIX_TERMIOS 1
4819 EOF
4820
4821 fi
4822
4823 for ac_hdr in \
4824         arpa/inet.h             \
4825         arpa/nameser.h  \
4826         assert.h                \
4827         conio.h                 \
4828         crypt.h                 \
4829         direct.h                \
4830         errno.h                 \
4831         fcntl.h                 \
4832         filio.h                 \
4833         getopt.h                \
4834         grp.h                   \
4835         io.h                    \
4836         libutil.h               \
4837         limits.h                \
4838         locale.h                \
4839         netinet/tcp.h   \
4840         malloc.h                \
4841         memory.h                \
4842         psap.h                  \
4843         pwd.h                   \
4844         process.h               \
4845         resolv.h                \
4846         sgtty.h                 \
4847         shadow.h                \
4848         stddef.h                \
4849         string.h                \
4850         strings.h               \
4851         sysexits.h              \
4852         sys/file.h              \
4853         sys/filio.h             \
4854         sys/errno.h             \
4855         sys/ioctl.h             \
4856         sys/param.h             \
4857         sys/resource.h  \
4858         sys/select.h    \
4859         sys/socket.h    \
4860         sys/syslog.h    \
4861         sys/time.h              \
4862         sys/types.h             \
4863         syslog.h                \
4864         termios.h               \
4865         unistd.h                \
4866         winsock.h               \
4867
4868 do
4869 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4870 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4871 echo "configure:4872: checking for $ac_hdr" >&5
4872 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4873   echo $ac_n "(cached) $ac_c" 1>&6
4874 else
4875   cat > conftest.$ac_ext <<EOF
4876 #line 4877 "configure"
4877 #include "confdefs.h"
4878 #include <$ac_hdr>
4879 EOF
4880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4881 { (eval echo configure:4882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4883 if test -z "$ac_err"; then
4884   rm -rf conftest*
4885   eval "ac_cv_header_$ac_safe=yes"
4886 else
4887   echo "$ac_err" >&5
4888   echo "configure: failed program was:" >&5
4889   cat conftest.$ac_ext >&5
4890   rm -rf conftest*
4891   eval "ac_cv_header_$ac_safe=no"
4892 fi
4893 rm -f conftest*
4894 fi
4895 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4896   echo "$ac_t""yes" 1>&6
4897     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4898   cat >> confdefs.h <<EOF
4899 #define $ac_tr_hdr 1
4900 EOF
4901  
4902 else
4903   echo "$ac_t""no" 1>&6
4904 fi
4905 done
4906
4907
4908
4909
4910 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4911 echo "configure:4912: checking for dlopen" >&5
4912 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4913   echo $ac_n "(cached) $ac_c" 1>&6
4914 else
4915   cat > conftest.$ac_ext <<EOF
4916 #line 4917 "configure"
4917 #include "confdefs.h"
4918 /* System header to define __stub macros and hopefully few prototypes,
4919     which can conflict with char dlopen(); below.  */
4920 #include <assert.h>
4921 /* Override any gcc2 internal prototype to avoid an error.  */
4922 /* We use char because int might match the return type of a gcc2
4923     builtin and then its argument prototype would still apply.  */
4924 char dlopen();
4925 char (*f)();
4926
4927 int main() {
4928
4929 /* The GNU C library defines this for functions which it implements
4930     to always fail with ENOSYS.  Some functions are actually named
4931     something starting with __ and the normal name is an alias.  */
4932 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4933 choke me
4934 #else
4935 f = dlopen;
4936 #endif
4937
4938 ; return 0; }
4939 EOF
4940 if { (eval echo configure:4941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4941   rm -rf conftest*
4942   eval "ac_cv_func_dlopen=yes"
4943 else
4944   echo "configure: failed program was:" >&5
4945   cat conftest.$ac_ext >&5
4946   rm -rf conftest*
4947   eval "ac_cv_func_dlopen=no"
4948 fi
4949 rm -f conftest*
4950 fi
4951
4952 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4953   echo "$ac_t""yes" 1>&6
4954   :
4955 else
4956   echo "$ac_t""no" 1>&6
4957 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4958 echo "configure:4959: checking for dlopen in -ldl" >&5
4959 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4960 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4961   echo $ac_n "(cached) $ac_c" 1>&6
4962 else
4963   ac_save_LIBS="$LIBS"
4964 LIBS="-ldl  $LIBS"
4965 cat > conftest.$ac_ext <<EOF
4966 #line 4967 "configure"
4967 #include "confdefs.h"
4968 /* Override any gcc2 internal prototype to avoid an error.  */
4969 /* We use char because int might match the return type of a gcc2
4970     builtin and then its argument prototype would still apply.  */
4971 char dlopen();
4972
4973 int main() {
4974 dlopen()
4975 ; return 0; }
4976 EOF
4977 if { (eval echo configure:4978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4978   rm -rf conftest*
4979   eval "ac_cv_lib_$ac_lib_var=yes"
4980 else
4981   echo "configure: failed program was:" >&5
4982   cat conftest.$ac_ext >&5
4983   rm -rf conftest*
4984   eval "ac_cv_lib_$ac_lib_var=no"
4985 fi
4986 rm -f conftest*
4987 LIBS="$ac_save_LIBS"
4988
4989 fi
4990 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4991   echo "$ac_t""yes" 1>&6
4992     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4993     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4994   cat >> confdefs.h <<EOF
4995 #define $ac_tr_lib 1
4996 EOF
4997
4998   LIBS="-ldl $LIBS"
4999
5000 else
5001   echo "$ac_t""no" 1>&6
5002 fi
5003
5004 fi
5005
5006
5007 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
5008 echo "configure:5009: checking for sigset in -lV3" >&5
5009 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
5010 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5011   echo $ac_n "(cached) $ac_c" 1>&6
5012 else
5013   ac_save_LIBS="$LIBS"
5014 LIBS="-lV3  $LIBS"
5015 cat > conftest.$ac_ext <<EOF
5016 #line 5017 "configure"
5017 #include "confdefs.h"
5018 /* Override any gcc2 internal prototype to avoid an error.  */
5019 /* We use char because int might match the return type of a gcc2
5020     builtin and then its argument prototype would still apply.  */
5021 char sigset();
5022
5023 int main() {
5024 sigset()
5025 ; return 0; }
5026 EOF
5027 if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5028   rm -rf conftest*
5029   eval "ac_cv_lib_$ac_lib_var=yes"
5030 else
5031   echo "configure: failed program was:" >&5
5032   cat conftest.$ac_ext >&5
5033   rm -rf conftest*
5034   eval "ac_cv_lib_$ac_lib_var=no"
5035 fi
5036 rm -f conftest*
5037 LIBS="$ac_save_LIBS"
5038
5039 fi
5040 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5041   echo "$ac_t""yes" 1>&6
5042     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5043     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5044   cat >> confdefs.h <<EOF
5045 #define $ac_tr_lib 1
5046 EOF
5047
5048   LIBS="-lV3 $LIBS"
5049
5050 else
5051   echo "$ac_t""no" 1>&6
5052 fi
5053
5054
5055 if test $ac_cv_header_winsock_h = yes; then
5056         echo $ac_n "checking for winsock""... $ac_c" 1>&6
5057 echo "configure:5058: checking for winsock" >&5
5058 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
5059   echo $ac_n "(cached) $ac_c" 1>&6
5060 else
5061   cat > conftest.$ac_ext <<EOF
5062 #line 5063 "configure"
5063 #include "confdefs.h"
5064 #include <winsock.h>
5065 int main() {
5066
5067                         socket(0,0,0);
5068                         select(0,NULL,NULL,NULL,NULL);
5069                         closesocket(0);
5070                         gethostname(NULL,0);
5071         
5072 ; return 0; }
5073 EOF
5074 if { (eval echo configure:5075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5075   rm -rf conftest*
5076   ol_cv_winsock=yes
5077 else
5078   echo "configure: failed program was:" >&5
5079   cat conftest.$ac_ext >&5
5080   rm -rf conftest*
5081   ol_cv_winsock=no
5082 fi
5083 rm -f conftest*]
5084 fi
5085
5086 echo "$ac_t""$ol_cv_winsock" 1>&6
5087
5088         if test $ol_cv_winsock = yes ; then
5089                 cat >> confdefs.h <<\EOF
5090 #define HAVE_WINSOCK 1
5091 EOF
5092
5093                 ac_cv_func_socket=yes
5094                 ac_cv_func_select=yes
5095                 ac_cv_func_closesocket=yes
5096                 ac_cv_func_gethostname=yes
5097         fi
5098 fi
5099
5100
5101 echo $ac_n "checking for socket""... $ac_c" 1>&6
5102 echo "configure:5103: checking for socket" >&5
5103 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
5104   echo $ac_n "(cached) $ac_c" 1>&6
5105 else
5106   cat > conftest.$ac_ext <<EOF
5107 #line 5108 "configure"
5108 #include "confdefs.h"
5109 /* System header to define __stub macros and hopefully few prototypes,
5110     which can conflict with char socket(); below.  */
5111 #include <assert.h>
5112 /* Override any gcc2 internal prototype to avoid an error.  */
5113 /* We use char because int might match the return type of a gcc2
5114     builtin and then its argument prototype would still apply.  */
5115 char socket();
5116 char (*f)();
5117
5118 int main() {
5119
5120 /* The GNU C library defines this for functions which it implements
5121     to always fail with ENOSYS.  Some functions are actually named
5122     something starting with __ and the normal name is an alias.  */
5123 #if defined (__stub_socket) || defined (__stub___socket)
5124 choke me
5125 #else
5126 f = socket;
5127 #endif
5128
5129 ; return 0; }
5130 EOF
5131 if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5132   rm -rf conftest*
5133   eval "ac_cv_func_socket=yes"
5134 else
5135   echo "configure: failed program was:" >&5
5136   cat conftest.$ac_ext >&5
5137   rm -rf conftest*
5138   eval "ac_cv_func_socket=no"
5139 fi
5140 rm -f conftest*
5141 fi
5142
5143 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
5144   echo "$ac_t""yes" 1>&6
5145   :
5146 else
5147   echo "$ac_t""no" 1>&6
5148         
5149         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
5150 echo "configure:5151: checking for main in -lsocket" >&5
5151 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
5152 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5153   echo $ac_n "(cached) $ac_c" 1>&6
5154 else
5155   ac_save_LIBS="$LIBS"
5156 LIBS="-lsocket  $LIBS"
5157 cat > conftest.$ac_ext <<EOF
5158 #line 5159 "configure"
5159 #include "confdefs.h"
5160
5161 int main() {
5162 main()
5163 ; return 0; }
5164 EOF
5165 if { (eval echo configure:5166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5166   rm -rf conftest*
5167   eval "ac_cv_lib_$ac_lib_var=yes"
5168 else
5169   echo "configure: failed program was:" >&5
5170   cat conftest.$ac_ext >&5
5171   rm -rf conftest*
5172   eval "ac_cv_lib_$ac_lib_var=no"
5173 fi
5174 rm -f conftest*
5175 LIBS="$ac_save_LIBS"
5176
5177 fi
5178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5179   echo "$ac_t""yes" 1>&6
5180     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5181     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5182   cat >> confdefs.h <<EOF
5183 #define $ac_tr_lib 1
5184 EOF
5185
5186   LIBS="-lsocket $LIBS"
5187
5188 else
5189   echo "$ac_t""no" 1>&6
5190 fi
5191
5192         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
5193 echo "configure:5194: checking for main in -lnet" >&5
5194 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
5195 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5196   echo $ac_n "(cached) $ac_c" 1>&6
5197 else
5198   ac_save_LIBS="$LIBS"
5199 LIBS="-lnet  $LIBS"
5200 cat > conftest.$ac_ext <<EOF
5201 #line 5202 "configure"
5202 #include "confdefs.h"
5203
5204 int main() {
5205 main()
5206 ; return 0; }
5207 EOF
5208 if { (eval echo configure:5209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5209   rm -rf conftest*
5210   eval "ac_cv_lib_$ac_lib_var=yes"
5211 else
5212   echo "configure: failed program was:" >&5
5213   cat conftest.$ac_ext >&5
5214   rm -rf conftest*
5215   eval "ac_cv_lib_$ac_lib_var=no"
5216 fi
5217 rm -f conftest*
5218 LIBS="$ac_save_LIBS"
5219
5220 fi
5221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5222   echo "$ac_t""yes" 1>&6
5223     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5224     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5225   cat >> confdefs.h <<EOF
5226 #define $ac_tr_lib 1
5227 EOF
5228
5229   LIBS="-lnet $LIBS"
5230
5231 else
5232   echo "$ac_t""no" 1>&6
5233 fi
5234
5235         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
5236 echo "configure:5237: checking for main in -lnsl_s" >&5
5237 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
5238 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5239   echo $ac_n "(cached) $ac_c" 1>&6
5240 else
5241   ac_save_LIBS="$LIBS"
5242 LIBS="-lnsl_s  $LIBS"
5243 cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246
5247 int main() {
5248 main()
5249 ; return 0; }
5250 EOF
5251 if { (eval echo configure:5252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5252   rm -rf conftest*
5253   eval "ac_cv_lib_$ac_lib_var=yes"
5254 else
5255   echo "configure: failed program was:" >&5
5256   cat conftest.$ac_ext >&5
5257   rm -rf conftest*
5258   eval "ac_cv_lib_$ac_lib_var=no"
5259 fi
5260 rm -f conftest*
5261 LIBS="$ac_save_LIBS"
5262
5263 fi
5264 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5265   echo "$ac_t""yes" 1>&6
5266     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5267     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5268   cat >> confdefs.h <<EOF
5269 #define $ac_tr_lib 1
5270 EOF
5271
5272   LIBS="-lnsl_s $LIBS"
5273
5274 else
5275   echo "$ac_t""no" 1>&6
5276 fi
5277
5278         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
5279 echo "configure:5280: checking for main in -lnsl" >&5
5280 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
5281 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5282   echo $ac_n "(cached) $ac_c" 1>&6
5283 else
5284   ac_save_LIBS="$LIBS"
5285 LIBS="-lnsl  $LIBS"
5286 cat > conftest.$ac_ext <<EOF
5287 #line 5288 "configure"
5288 #include "confdefs.h"
5289
5290 int main() {
5291 main()
5292 ; return 0; }
5293 EOF
5294 if { (eval echo configure:5295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5295   rm -rf conftest*
5296   eval "ac_cv_lib_$ac_lib_var=yes"
5297 else
5298   echo "configure: failed program was:" >&5
5299   cat conftest.$ac_ext >&5
5300   rm -rf conftest*
5301   eval "ac_cv_lib_$ac_lib_var=no"
5302 fi
5303 rm -f conftest*
5304 LIBS="$ac_save_LIBS"
5305
5306 fi
5307 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5308   echo "$ac_t""yes" 1>&6
5309     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5310     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5311   cat >> confdefs.h <<EOF
5312 #define $ac_tr_lib 1
5313 EOF
5314
5315   LIBS="-lnsl $LIBS"
5316
5317 else
5318   echo "$ac_t""no" 1>&6
5319 fi
5320
5321         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
5322 echo "configure:5323: checking for socket in -linet" >&5
5323 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
5324 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5325   echo $ac_n "(cached) $ac_c" 1>&6
5326 else
5327   ac_save_LIBS="$LIBS"
5328 LIBS="-linet  $LIBS"
5329 cat > conftest.$ac_ext <<EOF
5330 #line 5331 "configure"
5331 #include "confdefs.h"
5332 /* Override any gcc2 internal prototype to avoid an error.  */
5333 /* We use char because int might match the return type of a gcc2
5334     builtin and then its argument prototype would still apply.  */
5335 char socket();
5336
5337 int main() {
5338 socket()
5339 ; return 0; }
5340 EOF
5341 if { (eval echo configure:5342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5342   rm -rf conftest*
5343   eval "ac_cv_lib_$ac_lib_var=yes"
5344 else
5345   echo "configure: failed program was:" >&5
5346   cat conftest.$ac_ext >&5
5347   rm -rf conftest*
5348   eval "ac_cv_lib_$ac_lib_var=no"
5349 fi
5350 rm -f conftest*
5351 LIBS="$ac_save_LIBS"
5352
5353 fi
5354 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5355   echo "$ac_t""yes" 1>&6
5356     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5357     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5358   cat >> confdefs.h <<EOF
5359 #define $ac_tr_lib 1
5360 EOF
5361
5362   LIBS="-linet $LIBS"
5363
5364 else
5365   echo "$ac_t""no" 1>&6
5366 fi
5367
5368         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5369 echo "configure:5370: checking for main in -lgen" >&5
5370 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5371 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5372   echo $ac_n "(cached) $ac_c" 1>&6
5373 else
5374   ac_save_LIBS="$LIBS"
5375 LIBS="-lgen  $LIBS"
5376 cat > conftest.$ac_ext <<EOF
5377 #line 5378 "configure"
5378 #include "confdefs.h"
5379
5380 int main() {
5381 main()
5382 ; return 0; }
5383 EOF
5384 if { (eval echo configure:5385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5385   rm -rf conftest*
5386   eval "ac_cv_lib_$ac_lib_var=yes"
5387 else
5388   echo "configure: failed program was:" >&5
5389   cat conftest.$ac_ext >&5
5390   rm -rf conftest*
5391   eval "ac_cv_lib_$ac_lib_var=no"
5392 fi
5393 rm -f conftest*
5394 LIBS="$ac_save_LIBS"
5395
5396 fi
5397 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5398   echo "$ac_t""yes" 1>&6
5399     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5400     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5401   cat >> confdefs.h <<EOF
5402 #define $ac_tr_lib 1
5403 EOF
5404
5405   LIBS="-lgen $LIBS"
5406
5407 else
5408   echo "$ac_t""no" 1>&6
5409 fi
5410
5411
5412 fi
5413
5414
5415 echo $ac_n "checking for select""... $ac_c" 1>&6
5416 echo "configure:5417: checking for select" >&5
5417 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5418   echo $ac_n "(cached) $ac_c" 1>&6
5419 else
5420   cat > conftest.$ac_ext <<EOF
5421 #line 5422 "configure"
5422 #include "confdefs.h"
5423 /* System header to define __stub macros and hopefully few prototypes,
5424     which can conflict with char select(); below.  */
5425 #include <assert.h>
5426 /* Override any gcc2 internal prototype to avoid an error.  */
5427 /* We use char because int might match the return type of a gcc2
5428     builtin and then its argument prototype would still apply.  */
5429 char select();
5430 char (*f)();
5431
5432 int main() {
5433
5434 /* The GNU C library defines this for functions which it implements
5435     to always fail with ENOSYS.  Some functions are actually named
5436     something starting with __ and the normal name is an alias.  */
5437 #if defined (__stub_select) || defined (__stub___select)
5438 choke me
5439 #else
5440 f = select;
5441 #endif
5442
5443 ; return 0; }
5444 EOF
5445 if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5446   rm -rf conftest*
5447   eval "ac_cv_func_select=yes"
5448 else
5449   echo "configure: failed program was:" >&5
5450   cat conftest.$ac_ext >&5
5451   rm -rf conftest*
5452   eval "ac_cv_func_select=no"
5453 fi
5454 rm -f conftest*
5455 fi
5456
5457 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5458   echo "$ac_t""yes" 1>&6
5459   :
5460 else
5461   echo "$ac_t""no" 1>&6
5462 { echo "configure: error: select() required." 1>&2; exit 1; }
5463 fi
5464
5465
5466 if test "${ac_cv_header_winsock_h}" != yes; then
5467                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5468 echo "configure:5469: checking types of arguments for select()" >&5
5469  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5470   echo $ac_n "(cached) $ac_c" 1>&6
5471 else
5472    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5473   echo $ac_n "(cached) $ac_c" 1>&6
5474 else
5475     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5476   echo $ac_n "(cached) $ac_c" 1>&6
5477 else
5478      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5479      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5480       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5481        cat > conftest.$ac_ext <<EOF
5482 #line 5483 "configure"
5483 #include "confdefs.h"
5484 #ifdef HAVE_SYS_TYPES_H
5485 #include <sys/types.h>
5486 #endif
5487 #ifdef HAVE_SYS_TIME_H
5488 #include <sys/time.h>
5489 #endif
5490 #ifdef HAVE_SYS_SELECT_H
5491 #include <sys/select.h>
5492 #endif
5493 #ifdef HAVE_SYS_SOCKET_H
5494 #include <sys/socket.h>
5495 #endif
5496 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);
5497 int main() {
5498
5499 ; return 0; }
5500 EOF
5501 if { (eval echo configure:5502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5502   rm -rf conftest*
5503           ac_not_found=no ; break 3
5504 else
5505   echo "configure: failed program was:" >&5
5506   cat conftest.$ac_ext >&5
5507   rm -rf conftest*
5508   ac_not_found=yes
5509 fi
5510 rm -f conftest*
5511       done
5512      done
5513     done
5514    
5515 fi
5516   
5517 fi
5518  
5519 fi
5520  if test "$ac_not_found" = yes; then
5521   ac_cv_func_select_arg1=int 
5522   ac_cv_func_select_arg234='int *' 
5523   ac_cv_func_select_arg5='struct timeval *'
5524  fi
5525  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5526  cat >> confdefs.h <<EOF
5527 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5528 EOF
5529
5530  cat >> confdefs.h <<EOF
5531 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5532 EOF
5533
5534  cat >> confdefs.h <<EOF
5535 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5536 EOF
5537
5538
5539 fi
5540
5541
5542 for ac_hdr in regex.h 
5543 do
5544 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5545 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5546 echo "configure:5547: checking for $ac_hdr" >&5
5547 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5548   echo $ac_n "(cached) $ac_c" 1>&6
5549 else
5550   cat > conftest.$ac_ext <<EOF
5551 #line 5552 "configure"
5552 #include "confdefs.h"
5553 #include <$ac_hdr>
5554 EOF
5555 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5556 { (eval echo configure:5557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5557 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5558 if test -z "$ac_err"; then
5559   rm -rf conftest*
5560   eval "ac_cv_header_$ac_safe=yes"
5561 else
5562   echo "$ac_err" >&5
5563   echo "configure: failed program was:" >&5
5564   cat conftest.$ac_ext >&5
5565   rm -rf conftest*
5566   eval "ac_cv_header_$ac_safe=no"
5567 fi
5568 rm -f conftest*
5569 fi
5570 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5571   echo "$ac_t""yes" 1>&6
5572     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5573   cat >> confdefs.h <<EOF
5574 #define $ac_tr_hdr 1
5575 EOF
5576  
5577 else
5578   echo "$ac_t""no" 1>&6
5579 fi
5580 done
5581
5582 if test "$ac_cv_header_regex_h" != yes ; then
5583         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5584 fi
5585 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5586 echo "configure:5587: checking for regfree" >&5
5587 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5588   echo $ac_n "(cached) $ac_c" 1>&6
5589 else
5590   cat > conftest.$ac_ext <<EOF
5591 #line 5592 "configure"
5592 #include "confdefs.h"
5593 /* System header to define __stub macros and hopefully few prototypes,
5594     which can conflict with char regfree(); below.  */
5595 #include <assert.h>
5596 /* Override any gcc2 internal prototype to avoid an error.  */
5597 /* We use char because int might match the return type of a gcc2
5598     builtin and then its argument prototype would still apply.  */
5599 char regfree();
5600 char (*f)();
5601
5602 int main() {
5603
5604 /* The GNU C library defines this for functions which it implements
5605     to always fail with ENOSYS.  Some functions are actually named
5606     something starting with __ and the normal name is an alias.  */
5607 #if defined (__stub_regfree) || defined (__stub___regfree)
5608 choke me
5609 #else
5610 f = regfree;
5611 #endif
5612
5613 ; return 0; }
5614 EOF
5615 if { (eval echo configure:5616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5616   rm -rf conftest*
5617   eval "ac_cv_func_regfree=yes"
5618 else
5619   echo "configure: failed program was:" >&5
5620   cat conftest.$ac_ext >&5
5621   rm -rf conftest*
5622   eval "ac_cv_func_regfree=no"
5623 fi
5624 rm -f conftest*
5625 fi
5626
5627 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5628   echo "$ac_t""yes" 1>&6
5629   :
5630 else
5631   echo "$ac_t""no" 1>&6
5632 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5633 fi
5634
5635
5636
5637 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5638 echo "configure:5639: checking for compatible POSIX regex" >&5
5639 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5640   echo $ac_n "(cached) $ac_c" 1>&6
5641 else
5642   
5643         if test "$cross_compiling" = yes; then
5644   ol_cv_c_posix_regex=cross
5645 else
5646   cat > conftest.$ac_ext <<EOF
5647 #line 5648 "configure"
5648 #include "confdefs.h"
5649
5650 #include <sys/types.h>
5651 #include <regex.h>
5652 static char *pattern, *string;
5653 main()
5654 {
5655         int rc;
5656         regex_t re;
5657
5658         pattern = "^A";
5659
5660         if(regcomp(&re, pattern, 0)) {
5661                 return -1;
5662         }
5663         
5664         string = "ALL MATCH";
5665         
5666         rc = regexec(&re, string, 0, (void*)0, 0);
5667
5668         regfree(&re);
5669
5670         return rc;
5671 }
5672 EOF
5673 if { (eval echo configure:5674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5674 then
5675   ol_cv_c_posix_regex=yes
5676 else
5677   echo "configure: failed program was:" >&5
5678   cat conftest.$ac_ext >&5
5679   rm -fr conftest*
5680   ol_cv_c_posix_regex=no
5681 fi
5682 rm -fr conftest*
5683 fi
5684
5685 fi
5686
5687 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5688
5689 if test "$ol_cv_c_posix_regex" = no ; then
5690         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5691 fi
5692
5693 ol_link_dnssrv=no
5694 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5695 echo "configure:5696: checking for res_query" >&5
5696 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5697   echo $ac_n "(cached) $ac_c" 1>&6
5698 else
5699   cat > conftest.$ac_ext <<EOF
5700 #line 5701 "configure"
5701 #include "confdefs.h"
5702 /* System header to define __stub macros and hopefully few prototypes,
5703     which can conflict with char res_query(); below.  */
5704 #include <assert.h>
5705 /* Override any gcc2 internal prototype to avoid an error.  */
5706 /* We use char because int might match the return type of a gcc2
5707     builtin and then its argument prototype would still apply.  */
5708 char res_query();
5709 char (*f)();
5710
5711 int main() {
5712
5713 /* The GNU C library defines this for functions which it implements
5714     to always fail with ENOSYS.  Some functions are actually named
5715     something starting with __ and the normal name is an alias.  */
5716 #if defined (__stub_res_query) || defined (__stub___res_query)
5717 choke me
5718 #else
5719 f = res_query;
5720 #endif
5721
5722 ; return 0; }
5723 EOF
5724 if { (eval echo configure:5725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5725   rm -rf conftest*
5726   eval "ac_cv_func_res_query=yes"
5727 else
5728   echo "configure: failed program was:" >&5
5729   cat conftest.$ac_ext >&5
5730   rm -rf conftest*
5731   eval "ac_cv_func_res_query=no"
5732 fi
5733 rm -f conftest*
5734 fi
5735
5736 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5737   echo "$ac_t""yes" 1>&6
5738   :
5739 else
5740   echo "$ac_t""no" 1>&6
5741 fi
5742
5743 if test $ac_cv_func_res_query = no ; then 
5744         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5745 echo "configure:5746: checking for res_query in -lbind" >&5
5746 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5747 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5748   echo $ac_n "(cached) $ac_c" 1>&6
5749 else
5750   ac_save_LIBS="$LIBS"
5751 LIBS="-lbind  $LIBS"
5752 cat > conftest.$ac_ext <<EOF
5753 #line 5754 "configure"
5754 #include "confdefs.h"
5755 /* Override any gcc2 internal prototype to avoid an error.  */
5756 /* We use char because int might match the return type of a gcc2
5757     builtin and then its argument prototype would still apply.  */
5758 char res_query();
5759
5760 int main() {
5761 res_query()
5762 ; return 0; }
5763 EOF
5764 if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5765   rm -rf conftest*
5766   eval "ac_cv_lib_$ac_lib_var=yes"
5767 else
5768   echo "configure: failed program was:" >&5
5769   cat conftest.$ac_ext >&5
5770   rm -rf conftest*
5771   eval "ac_cv_lib_$ac_lib_var=no"
5772 fi
5773 rm -f conftest*
5774 LIBS="$ac_save_LIBS"
5775
5776 fi
5777 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5778   echo "$ac_t""yes" 1>&6
5779     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5780     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5781   cat >> confdefs.h <<EOF
5782 #define $ac_tr_lib 1
5783 EOF
5784
5785   LIBS="-lbind $LIBS"
5786
5787 else
5788   echo "$ac_t""no" 1>&6
5789 fi
5790
5791         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5792 fi
5793
5794 if test $ac_cv_func_res_query = no ; then 
5795         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5796 echo "configure:5797: checking for __res_query in -lbind" >&5
5797 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5798 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5799   echo $ac_n "(cached) $ac_c" 1>&6
5800 else
5801   ac_save_LIBS="$LIBS"
5802 LIBS="-lbind  $LIBS"
5803 cat > conftest.$ac_ext <<EOF
5804 #line 5805 "configure"
5805 #include "confdefs.h"
5806 /* Override any gcc2 internal prototype to avoid an error.  */
5807 /* We use char because int might match the return type of a gcc2
5808     builtin and then its argument prototype would still apply.  */
5809 char __res_query();
5810
5811 int main() {
5812 __res_query()
5813 ; return 0; }
5814 EOF
5815 if { (eval echo configure:5816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5816   rm -rf conftest*
5817   eval "ac_cv_lib_$ac_lib_var=yes"
5818 else
5819   echo "configure: failed program was:" >&5
5820   cat conftest.$ac_ext >&5
5821   rm -rf conftest*
5822   eval "ac_cv_lib_$ac_lib_var=no"
5823 fi
5824 rm -f conftest*
5825 LIBS="$ac_save_LIBS"
5826
5827 fi
5828 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5829   echo "$ac_t""yes" 1>&6
5830     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5831     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5832   cat >> confdefs.h <<EOF
5833 #define $ac_tr_lib 1
5834 EOF
5835
5836   LIBS="-lbind $LIBS"
5837
5838 else
5839   echo "$ac_t""no" 1>&6
5840 fi
5841
5842         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5843 fi
5844
5845 if test $ac_cv_func_res_query = no ; then 
5846         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5847 echo "configure:5848: checking for res_query in -lresolv" >&5
5848 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5849 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5850   echo $ac_n "(cached) $ac_c" 1>&6
5851 else
5852   ac_save_LIBS="$LIBS"
5853 LIBS="-lresolv  $LIBS"
5854 cat > conftest.$ac_ext <<EOF
5855 #line 5856 "configure"
5856 #include "confdefs.h"
5857 /* Override any gcc2 internal prototype to avoid an error.  */
5858 /* We use char because int might match the return type of a gcc2
5859     builtin and then its argument prototype would still apply.  */
5860 char res_query();
5861
5862 int main() {
5863 res_query()
5864 ; return 0; }
5865 EOF
5866 if { (eval echo configure:5867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5867   rm -rf conftest*
5868   eval "ac_cv_lib_$ac_lib_var=yes"
5869 else
5870   echo "configure: failed program was:" >&5
5871   cat conftest.$ac_ext >&5
5872   rm -rf conftest*
5873   eval "ac_cv_lib_$ac_lib_var=no"
5874 fi
5875 rm -f conftest*
5876 LIBS="$ac_save_LIBS"
5877
5878 fi
5879 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5880   echo "$ac_t""yes" 1>&6
5881     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5882     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5883   cat >> confdefs.h <<EOF
5884 #define $ac_tr_lib 1
5885 EOF
5886
5887   LIBS="-lresolv $LIBS"
5888
5889 else
5890   echo "$ac_t""no" 1>&6
5891 fi
5892
5893         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5894 fi
5895
5896 if test "$ac_cv_func_res_query" = yes ; then
5897         cat >> confdefs.h <<\EOF
5898 #define HAVE_RES_QUERY 1
5899 EOF
5900
5901
5902         if test $ol_enable_dnssrv != no ; then
5903                 ol_link_dnssrv=yes
5904         fi
5905 fi
5906
5907 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5908         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5909 fi
5910
5911 for ac_func in getaddrinfo inet_ntop 
5912 do
5913 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5914 echo "configure:5915: checking for $ac_func" >&5
5915 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5916   echo $ac_n "(cached) $ac_c" 1>&6
5917 else
5918   cat > conftest.$ac_ext <<EOF
5919 #line 5920 "configure"
5920 #include "confdefs.h"
5921 /* System header to define __stub macros and hopefully few prototypes,
5922     which can conflict with char $ac_func(); below.  */
5923 #include <assert.h>
5924 /* Override any gcc2 internal prototype to avoid an error.  */
5925 /* We use char because int might match the return type of a gcc2
5926     builtin and then its argument prototype would still apply.  */
5927 char $ac_func();
5928 char (*f)();
5929
5930 int main() {
5931
5932 /* The GNU C library defines this for functions which it implements
5933     to always fail with ENOSYS.  Some functions are actually named
5934     something starting with __ and the normal name is an alias.  */
5935 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5936 choke me
5937 #else
5938 f = $ac_func;
5939 #endif
5940
5941 ; return 0; }
5942 EOF
5943 if { (eval echo configure:5944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5944   rm -rf conftest*
5945   eval "ac_cv_func_$ac_func=yes"
5946 else
5947   echo "configure: failed program was:" >&5
5948   cat conftest.$ac_ext >&5
5949   rm -rf conftest*
5950   eval "ac_cv_func_$ac_func=no"
5951 fi
5952 rm -f conftest*
5953 fi
5954
5955 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5956   echo "$ac_t""yes" 1>&6
5957     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5958   cat >> confdefs.h <<EOF
5959 #define $ac_tr_func 1
5960 EOF
5961  
5962 else
5963   echo "$ac_t""no" 1>&6
5964 fi
5965 done
5966
5967
5968 ol_link_ipv6=no
5969 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5970         if test $ol_enable_ipv6 = yes ; then
5971                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5972         fi
5973 else
5974         for ac_func in gai_strerror 
5975 do
5976 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5977 echo "configure:5978: checking for $ac_func" >&5
5978 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5979   echo $ac_n "(cached) $ac_c" 1>&6
5980 else
5981   cat > conftest.$ac_ext <<EOF
5982 #line 5983 "configure"
5983 #include "confdefs.h"
5984 /* System header to define __stub macros and hopefully few prototypes,
5985     which can conflict with char $ac_func(); below.  */
5986 #include <assert.h>
5987 /* Override any gcc2 internal prototype to avoid an error.  */
5988 /* We use char because int might match the return type of a gcc2
5989     builtin and then its argument prototype would still apply.  */
5990 char $ac_func();
5991 char (*f)();
5992
5993 int main() {
5994
5995 /* The GNU C library defines this for functions which it implements
5996     to always fail with ENOSYS.  Some functions are actually named
5997     something starting with __ and the normal name is an alias.  */
5998 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5999 choke me
6000 #else
6001 f = $ac_func;
6002 #endif
6003
6004 ; return 0; }
6005 EOF
6006 if { (eval echo configure:6007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6007   rm -rf conftest*
6008   eval "ac_cv_func_$ac_func=yes"
6009 else
6010   echo "configure: failed program was:" >&5
6011   cat conftest.$ac_ext >&5
6012   rm -rf conftest*
6013   eval "ac_cv_func_$ac_func=no"
6014 fi
6015 rm -f conftest*
6016 fi
6017
6018 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6019   echo "$ac_t""yes" 1>&6
6020     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6021   cat >> confdefs.h <<EOF
6022 #define $ac_tr_func 1
6023 EOF
6024  
6025 else
6026   echo "$ac_t""no" 1>&6
6027 fi
6028 done
6029
6030
6031         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
6032 echo "configure:6033: checking INET6_ADDRSTRLEN" >&5
6033 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
6034   echo $ac_n "(cached) $ac_c" 1>&6
6035 else
6036   
6037                 cat > conftest.$ac_ext <<EOF
6038 #line 6039 "configure"
6039 #include "confdefs.h"
6040
6041 #                       include <netinet/in.h>
6042 #                       ifdef INET6_ADDRSTRLEN
6043                                 __has_inet6_addrstrlen__;
6044 #                       endif
6045                 
6046 EOF
6047 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6048   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
6049   rm -rf conftest*
6050   ol_cv_inet6_addrstrlen=yes
6051 else
6052   rm -rf conftest*
6053   ol_cv_inet6_addrstrlen=no
6054 fi
6055 rm -f conftest*
6056
6057 fi
6058
6059 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
6060
6061         if test $ol_cv_inet6_addrstrlen = yes ; then
6062                 ol_link_ipv6=yes
6063         elif test $ol_enable_ipv6 = yes ; then
6064                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
6065         fi
6066 fi
6067
6068 if test $ol_enable_local != no ; then
6069         for ac_hdr in sys/un.h 
6070 do
6071 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6072 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6073 echo "configure:6074: checking for $ac_hdr" >&5
6074 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6075   echo $ac_n "(cached) $ac_c" 1>&6
6076 else
6077   cat > conftest.$ac_ext <<EOF
6078 #line 6079 "configure"
6079 #include "confdefs.h"
6080 #include <$ac_hdr>
6081 EOF
6082 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6083 { (eval echo configure:6084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6084 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6085 if test -z "$ac_err"; then
6086   rm -rf conftest*
6087   eval "ac_cv_header_$ac_safe=yes"
6088 else
6089   echo "$ac_err" >&5
6090   echo "configure: failed program was:" >&5
6091   cat conftest.$ac_ext >&5
6092   rm -rf conftest*
6093   eval "ac_cv_header_$ac_safe=no"
6094 fi
6095 rm -f conftest*
6096 fi
6097 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6098   echo "$ac_t""yes" 1>&6
6099     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6100   cat >> confdefs.h <<EOF
6101 #define $ac_tr_hdr 1
6102 EOF
6103  
6104 else
6105   echo "$ac_t""no" 1>&6
6106 fi
6107 done
6108
6109
6110         if test $ol_enable_local = auto ; then
6111                 ol_enable_local=$ac_cv_header_sys_un_h
6112         elif test $ac_cv_header_sys_un_h = no ; then
6113                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
6114         fi
6115 fi
6116
6117 ol_link_kbind=no
6118 ol_link_kpasswd=no
6119 ol_link_krb5=no
6120 ol_link_krb4=no
6121
6122 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6123         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
6124         -o $ol_with_kerberos = k425 ; then
6125
6126         for ac_hdr in krb5.h
6127 do
6128 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6129 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6130 echo "configure:6131: checking for $ac_hdr" >&5
6131 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6132   echo $ac_n "(cached) $ac_c" 1>&6
6133 else
6134   cat > conftest.$ac_ext <<EOF
6135 #line 6136 "configure"
6136 #include "confdefs.h"
6137 #include <$ac_hdr>
6138 EOF
6139 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6140 { (eval echo configure:6141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6141 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6142 if test -z "$ac_err"; then
6143   rm -rf conftest*
6144   eval "ac_cv_header_$ac_safe=yes"
6145 else
6146   echo "$ac_err" >&5
6147   echo "configure: failed program was:" >&5
6148   cat conftest.$ac_ext >&5
6149   rm -rf conftest*
6150   eval "ac_cv_header_$ac_safe=no"
6151 fi
6152 rm -f conftest*
6153 fi
6154 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6155   echo "$ac_t""yes" 1>&6
6156     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6157   cat >> confdefs.h <<EOF
6158 #define $ac_tr_hdr 1
6159 EOF
6160  
6161 else
6162   echo "$ac_t""no" 1>&6
6163 fi
6164 done
6165
6166
6167         if test $ac_cv_header_krb5_h = yes ; then
6168                                 for ac_hdr in heim_err.h
6169 do
6170 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6171 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6172 echo "configure:6173: checking for $ac_hdr" >&5
6173 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6174   echo $ac_n "(cached) $ac_c" 1>&6
6175 else
6176   cat > conftest.$ac_ext <<EOF
6177 #line 6178 "configure"
6178 #include "confdefs.h"
6179 #include <$ac_hdr>
6180 EOF
6181 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6182 { (eval echo configure:6183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6183 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6184 if test -z "$ac_err"; then
6185   rm -rf conftest*
6186   eval "ac_cv_header_$ac_safe=yes"
6187 else
6188   echo "$ac_err" >&5
6189   echo "configure: failed program was:" >&5
6190   cat conftest.$ac_ext >&5
6191   rm -rf conftest*
6192   eval "ac_cv_header_$ac_safe=no"
6193 fi
6194 rm -f conftest*
6195 fi
6196 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6197   echo "$ac_t""yes" 1>&6
6198     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6199   cat >> confdefs.h <<EOF
6200 #define $ac_tr_hdr 1
6201 EOF
6202  
6203 else
6204   echo "$ac_t""no" 1>&6
6205 fi
6206 done
6207
6208                 if test $ac_cv_header_heim_err_h = yes ; then
6209                         krb5_impl=heimdal
6210                 else
6211                         krb5_impl=mit
6212                 fi
6213
6214                 if test $krb5_impl = mit; then
6215                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6216 echo "configure:6217: checking for main in -lkrb5" >&5
6217 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6218 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6219   echo $ac_n "(cached) $ac_c" 1>&6
6220 else
6221   ac_save_LIBS="$LIBS"
6222 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
6223 cat > conftest.$ac_ext <<EOF
6224 #line 6225 "configure"
6225 #include "confdefs.h"
6226
6227 int main() {
6228 main()
6229 ; return 0; }
6230 EOF
6231 if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6232   rm -rf conftest*
6233   eval "ac_cv_lib_$ac_lib_var=yes"
6234 else
6235   echo "configure: failed program was:" >&5
6236   cat conftest.$ac_ext >&5
6237   rm -rf conftest*
6238   eval "ac_cv_lib_$ac_lib_var=no"
6239 fi
6240 rm -f conftest*
6241 LIBS="$ac_save_LIBS"
6242
6243 fi
6244 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6245   echo "$ac_t""yes" 1>&6
6246   have_krb5=yes
6247                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
6248 else
6249   echo "$ac_t""no" 1>&6
6250 have_krb5=no
6251 fi
6252
6253
6254                 elif test $krb5_impl = heimdal; then
6255                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6256 echo "configure:6257: checking for main in -lkrb5" >&5
6257 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6259   echo $ac_n "(cached) $ac_c" 1>&6
6260 else
6261   ac_save_LIBS="$LIBS"
6262 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6263 cat > conftest.$ac_ext <<EOF
6264 #line 6265 "configure"
6265 #include "confdefs.h"
6266
6267 int main() {
6268 main()
6269 ; return 0; }
6270 EOF
6271 if { (eval echo configure:6272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6272   rm -rf conftest*
6273   eval "ac_cv_lib_$ac_lib_var=yes"
6274 else
6275   echo "configure: failed program was:" >&5
6276   cat conftest.$ac_ext >&5
6277   rm -rf conftest*
6278   eval "ac_cv_lib_$ac_lib_var=no"
6279 fi
6280 rm -f conftest*
6281 LIBS="$ac_save_LIBS"
6282
6283 fi
6284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6285   echo "$ac_t""yes" 1>&6
6286   have_krb5=yes
6287                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6288 else
6289   echo "$ac_t""no" 1>&6
6290 have_krb5=no
6291 fi
6292
6293
6294                         cat >> confdefs.h <<\EOF
6295 #define HAVE_HEIMDAL_KERBEROS 1
6296 EOF
6297
6298                 else
6299                         have_krb5=no
6300                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6301                 fi
6302
6303                 if test $have_krb5 = yes ; then
6304                         ol_link_krb5=yes
6305
6306                         cat >> confdefs.h <<\EOF
6307 #define HAVE_KRB5 1
6308 EOF
6309
6310
6311                         if test $ol_enable_kpasswd != no ; then
6312                                 ol_link_kpasswd=yes;
6313                         fi
6314
6315                         if test $ol_with_kerberos = k5only ; then
6316                                 ol_with_kerberos=found
6317                         fi
6318
6319                 elif test $ol_with_kerberos != auto ; then
6320                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6321                 fi
6322
6323         fi
6324 fi
6325
6326 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6327         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6328
6329         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6330 do
6331 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6332 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6333 echo "configure:6334: checking for $ac_hdr" >&5
6334 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6335   echo $ac_n "(cached) $ac_c" 1>&6
6336 else
6337   cat > conftest.$ac_ext <<EOF
6338 #line 6339 "configure"
6339 #include "confdefs.h"
6340 #include <$ac_hdr>
6341 EOF
6342 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6343 { (eval echo configure:6344: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6344 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6345 if test -z "$ac_err"; then
6346   rm -rf conftest*
6347   eval "ac_cv_header_$ac_safe=yes"
6348 else
6349   echo "$ac_err" >&5
6350   echo "configure: failed program was:" >&5
6351   cat conftest.$ac_ext >&5
6352   rm -rf conftest*
6353   eval "ac_cv_header_$ac_safe=no"
6354 fi
6355 rm -f conftest*
6356 fi
6357 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6358   echo "$ac_t""yes" 1>&6
6359     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6360   cat >> confdefs.h <<EOF
6361 #define $ac_tr_hdr 1
6362 EOF
6363  
6364 else
6365   echo "$ac_t""no" 1>&6
6366 fi
6367 done
6368
6369
6370         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6371                 if test $krb5_impl = mit; then
6372                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6373 echo "configure:6374: checking for main in -lkrb4" >&5
6374 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6375 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6376   echo $ac_n "(cached) $ac_c" 1>&6
6377 else
6378   ac_save_LIBS="$LIBS"
6379 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
6380 cat > conftest.$ac_ext <<EOF
6381 #line 6382 "configure"
6382 #include "confdefs.h"
6383
6384 int main() {
6385 main()
6386 ; return 0; }
6387 EOF
6388 if { (eval echo configure:6389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6389   rm -rf conftest*
6390   eval "ac_cv_lib_$ac_lib_var=yes"
6391 else
6392   echo "configure: failed program was:" >&5
6393   cat conftest.$ac_ext >&5
6394   rm -rf conftest*
6395   eval "ac_cv_lib_$ac_lib_var=no"
6396 fi
6397 rm -f conftest*
6398 LIBS="$ac_save_LIBS"
6399
6400 fi
6401 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6402   echo "$ac_t""yes" 1>&6
6403   have_k425=yes
6404                                 KRB4_LIBS="-lkrb4 -ldes425"
6405 else
6406   echo "$ac_t""no" 1>&6
6407 have_k425=no
6408 fi
6409
6410
6411                 elif test $krb5_impl = heimdal; then
6412                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6413 echo "configure:6414: checking for main in -lkrb4" >&5
6414 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6415 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6416   echo $ac_n "(cached) $ac_c" 1>&6
6417 else
6418   ac_save_LIBS="$LIBS"
6419 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6420 cat > conftest.$ac_ext <<EOF
6421 #line 6422 "configure"
6422 #include "confdefs.h"
6423
6424 int main() {
6425 main()
6426 ; return 0; }
6427 EOF
6428 if { (eval echo configure:6429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6429   rm -rf conftest*
6430   eval "ac_cv_lib_$ac_lib_var=yes"
6431 else
6432   echo "configure: failed program was:" >&5
6433   cat conftest.$ac_ext >&5
6434   rm -rf conftest*
6435   eval "ac_cv_lib_$ac_lib_var=no"
6436 fi
6437 rm -f conftest*
6438 LIBS="$ac_save_LIBS"
6439
6440 fi
6441 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6442   echo "$ac_t""yes" 1>&6
6443   have_k425=yes
6444                                 KRB4_LIBS="-lkrb4"
6445 else
6446   echo "$ac_t""no" 1>&6
6447 have_k425=no
6448 fi
6449
6450
6451                 else
6452                         have_425=no
6453                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6454                 fi
6455
6456                 if test $have_k425 = yes ; then
6457                         ol_with_kerberos=found
6458                         ol_link_krb4=yes
6459
6460                         cat >> confdefs.h <<\EOF
6461 #define HAVE_KRB425 1
6462 EOF
6463
6464                         cat >> confdefs.h <<\EOF
6465 #define HAVE_KRB4 1
6466 EOF
6467
6468
6469                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6470 echo "configure:6471: checking for des_debug in Kerberos libraries" >&5
6471 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6472   echo $ac_n "(cached) $ac_c" 1>&6
6473 else
6474   
6475                                                                 save_LIBS="$LIBS"
6476                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6477                                 cat > conftest.$ac_ext <<EOF
6478 #line 6479 "configure"
6479 #include "confdefs.h"
6480
6481 #include <kerberosIV/krb.h>
6482 #include <kerberosIV/des.h>
6483 extern int des_debug;
6484
6485 int main() {
6486
6487 des_debug = 1;
6488
6489 ; return 0; }
6490 EOF
6491 if { (eval echo configure:6492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6492   rm -rf conftest*
6493   ol_cv_var_des_debug=yes
6494 else
6495   echo "configure: failed program was:" >&5
6496   cat conftest.$ac_ext >&5
6497   rm -rf conftest*
6498   ol_cv_var_des_debug=no
6499 fi
6500 rm -f conftest*
6501                                                                 LIBS="$save_LIBS"
6502                         
6503 fi
6504
6505 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6506
6507                         if test $ol_cv_var_des_debug = yes ; then
6508                                 cat >> confdefs.h <<\EOF
6509 #define HAVE_DES_DEBUG 1
6510 EOF
6511
6512                         fi
6513
6514                         LIBS="$save_LIBS"
6515                 fi
6516         fi
6517 fi
6518
6519 if test $ol_link_krb5 = yes ; then
6520         ol_with_kerberos=found
6521 fi
6522
6523 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6524         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6525
6526         for ac_hdr in krb.h des.h krb-archaeology.h 
6527 do
6528 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6529 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6530 echo "configure:6531: checking for $ac_hdr" >&5
6531 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6532   echo $ac_n "(cached) $ac_c" 1>&6
6533 else
6534   cat > conftest.$ac_ext <<EOF
6535 #line 6536 "configure"
6536 #include "confdefs.h"
6537 #include <$ac_hdr>
6538 EOF
6539 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6540 { (eval echo configure:6541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6541 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6542 if test -z "$ac_err"; then
6543   rm -rf conftest*
6544   eval "ac_cv_header_$ac_safe=yes"
6545 else
6546   echo "$ac_err" >&5
6547   echo "configure: failed program was:" >&5
6548   cat conftest.$ac_ext >&5
6549   rm -rf conftest*
6550   eval "ac_cv_header_$ac_safe=no"
6551 fi
6552 rm -f conftest*
6553 fi
6554 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6555   echo "$ac_t""yes" 1>&6
6556     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6557   cat >> confdefs.h <<EOF
6558 #define $ac_tr_hdr 1
6559 EOF
6560  
6561 else
6562   echo "$ac_t""no" 1>&6
6563 fi
6564 done
6565
6566
6567         if test $ac_cv_header_krb_h = yes ; then
6568                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6569 echo "configure:6570: checking for main in -lkrb" >&5
6570 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6571 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6572   echo $ac_n "(cached) $ac_c" 1>&6
6573 else
6574   ac_save_LIBS="$LIBS"
6575 LIBS="-lkrb -ldes $LIBS"
6576 cat > conftest.$ac_ext <<EOF
6577 #line 6578 "configure"
6578 #include "confdefs.h"
6579
6580 int main() {
6581 main()
6582 ; return 0; }
6583 EOF
6584 if { (eval echo configure:6585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6585   rm -rf conftest*
6586   eval "ac_cv_lib_$ac_lib_var=yes"
6587 else
6588   echo "configure: failed program was:" >&5
6589   cat conftest.$ac_ext >&5
6590   rm -rf conftest*
6591   eval "ac_cv_lib_$ac_lib_var=no"
6592 fi
6593 rm -f conftest*
6594 LIBS="$ac_save_LIBS"
6595
6596 fi
6597 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6598   echo "$ac_t""yes" 1>&6
6599   have_k4=yes
6600 else
6601   echo "$ac_t""no" 1>&6
6602 have_k4=no
6603 fi
6604
6605
6606                 if test $have_k4 = yes ; then
6607                         ol_with_kerberos=found
6608                         ol_link_krb4=yes
6609
6610                         cat >> confdefs.h <<\EOF
6611 #define HAVE_KRB4 1
6612 EOF
6613
6614
6615                         KRB4_LIBS="-lkrb -ldes"
6616
6617                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6618                                 cat >> confdefs.h <<\EOF
6619 #define HAVE_KTH_KERBEROS 1
6620 EOF
6621
6622                         fi
6623                 fi
6624         fi
6625 fi
6626
6627 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6628         ol_link_kpasswd=yes
6629 fi
6630
6631 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6632         ol_link_kbind=yes
6633
6634 elif test $ol_enable_kbind = yes ; then
6635         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6636 fi
6637
6638 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6639         cat >> confdefs.h <<\EOF
6640 #define HAVE_KERBEROS 1
6641 EOF
6642
6643
6644 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6645         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6646 fi
6647
6648 ol_link_tls=no
6649 if test $ol_with_tls != no ; then
6650         for ac_hdr in openssl/ssl.h ssl.h
6651 do
6652 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6653 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6654 echo "configure:6655: checking for $ac_hdr" >&5
6655 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6656   echo $ac_n "(cached) $ac_c" 1>&6
6657 else
6658   cat > conftest.$ac_ext <<EOF
6659 #line 6660 "configure"
6660 #include "confdefs.h"
6661 #include <$ac_hdr>
6662 EOF
6663 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6664 { (eval echo configure:6665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6665 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6666 if test -z "$ac_err"; then
6667   rm -rf conftest*
6668   eval "ac_cv_header_$ac_safe=yes"
6669 else
6670   echo "$ac_err" >&5
6671   echo "configure: failed program was:" >&5
6672   cat conftest.$ac_ext >&5
6673   rm -rf conftest*
6674   eval "ac_cv_header_$ac_safe=no"
6675 fi
6676 rm -f conftest*
6677 fi
6678 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6679   echo "$ac_t""yes" 1>&6
6680     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6681   cat >> confdefs.h <<EOF
6682 #define $ac_tr_hdr 1
6683 EOF
6684  
6685 else
6686   echo "$ac_t""no" 1>&6
6687 fi
6688 done
6689
6690         
6691         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6692                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6693 echo "configure:6694: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6694 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6695 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6696   echo $ac_n "(cached) $ac_c" 1>&6
6697 else
6698   ac_save_LIBS="$LIBS"
6699 LIBS="-lssl -lcrypto $LIBS"
6700 cat > conftest.$ac_ext <<EOF
6701 #line 6702 "configure"
6702 #include "confdefs.h"
6703 /* Override any gcc2 internal prototype to avoid an error.  */
6704 /* We use char because int might match the return type of a gcc2
6705     builtin and then its argument prototype would still apply.  */
6706 char SSLeay_add_ssl_algorithms();
6707
6708 int main() {
6709 SSLeay_add_ssl_algorithms()
6710 ; return 0; }
6711 EOF
6712 if { (eval echo configure:6713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6713   rm -rf conftest*
6714   eval "ac_cv_lib_$ac_lib_var=yes"
6715 else
6716   echo "configure: failed program was:" >&5
6717   cat conftest.$ac_ext >&5
6718   rm -rf conftest*
6719   eval "ac_cv_lib_$ac_lib_var=no"
6720 fi
6721 rm -f conftest*
6722 LIBS="$ac_save_LIBS"
6723
6724 fi
6725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6726   echo "$ac_t""yes" 1>&6
6727   have_ssleay=yes
6728                         need_rsaref=no
6729 else
6730   echo "$ac_t""no" 1>&6
6731 have_ssleay=no
6732 fi
6733
6734                         
6735                 if test $have_ssleay = no ; then
6736                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6737 echo "configure:6738: checking for SSL_library_init in -lssl" >&5
6738 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6739 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6740   echo $ac_n "(cached) $ac_c" 1>&6
6741 else
6742   ac_save_LIBS="$LIBS"
6743 LIBS="-lssl -lcrypto $LIBS"
6744 cat > conftest.$ac_ext <<EOF
6745 #line 6746 "configure"
6746 #include "confdefs.h"
6747 /* Override any gcc2 internal prototype to avoid an error.  */
6748 /* We use char because int might match the return type of a gcc2
6749     builtin and then its argument prototype would still apply.  */
6750 char SSL_library_init();
6751
6752 int main() {
6753 SSL_library_init()
6754 ; return 0; }
6755 EOF
6756 if { (eval echo configure:6757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6757   rm -rf conftest*
6758   eval "ac_cv_lib_$ac_lib_var=yes"
6759 else
6760   echo "configure: failed program was:" >&5
6761   cat conftest.$ac_ext >&5
6762   rm -rf conftest*
6763   eval "ac_cv_lib_$ac_lib_var=no"
6764 fi
6765 rm -f conftest*
6766 LIBS="$ac_save_LIBS"
6767
6768 fi
6769 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6770   echo "$ac_t""yes" 1>&6
6771   have_ssleay=yes
6772                                 need_rsaref=no
6773 else
6774   echo "$ac_t""no" 1>&6
6775 have_ssleay=no
6776 fi
6777
6778                 fi
6779
6780                 if test $have_ssleay = no ; then
6781                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6782 echo "configure:6783: checking for ssl3_accept in -lssl" >&5
6783 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6784 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6785   echo $ac_n "(cached) $ac_c" 1>&6
6786 else
6787   ac_save_LIBS="$LIBS"
6788 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6789 cat > conftest.$ac_ext <<EOF
6790 #line 6791 "configure"
6791 #include "confdefs.h"
6792 /* Override any gcc2 internal prototype to avoid an error.  */
6793 /* We use char because int might match the return type of a gcc2
6794     builtin and then its argument prototype would still apply.  */
6795 char ssl3_accept();
6796
6797 int main() {
6798 ssl3_accept()
6799 ; return 0; }
6800 EOF
6801 if { (eval echo configure:6802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6802   rm -rf conftest*
6803   eval "ac_cv_lib_$ac_lib_var=yes"
6804 else
6805   echo "configure: failed program was:" >&5
6806   cat conftest.$ac_ext >&5
6807   rm -rf conftest*
6808   eval "ac_cv_lib_$ac_lib_var=no"
6809 fi
6810 rm -f conftest*
6811 LIBS="$ac_save_LIBS"
6812
6813 fi
6814 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6815   echo "$ac_t""yes" 1>&6
6816   have_ssleay=yes
6817                                 need_rsaref=yes
6818 else
6819   echo "$ac_t""no" 1>&6
6820 have_ssleay=no
6821 fi
6822
6823                 fi
6824
6825                 if test $have_ssleay = yes ; then
6826                         ol_with_tls=found
6827                         ol_link_tls=yes
6828
6829                         cat >> confdefs.h <<\EOF
6830 #define HAVE_SSLEAY 1
6831 EOF
6832
6833
6834                         if test $need_rsaref = yes; then
6835                                 cat >> confdefs.h <<\EOF
6836 #define HAVE_RSAREF 1
6837 EOF
6838
6839
6840                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6841                         else
6842                                 TLS_LIBS="-lssl -lcrypto"
6843                         fi
6844                 fi
6845         fi
6846
6847 else
6848         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6849 fi
6850
6851 if test $ol_link_tls = yes ; then
6852         cat >> confdefs.h <<\EOF
6853 #define HAVE_TLS 1
6854 EOF
6855
6856
6857 elif test $ol_with_tls = auto ; then
6858         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6859         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6860
6861 elif test $ol_with_tls != no ; then
6862         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6863 fi
6864
6865 if test $ol_enable_lmpasswd != no; then
6866         if test $ol_link_tls != yes ; then
6867                 { echo "configure: error: LAN Manager passwords require OpenSSL" 1>&2; exit 1; }
6868         fi
6869
6870         cat >> confdefs.h <<\EOF
6871 #define SLAPD_LMHASH 1
6872 EOF
6873
6874 fi
6875
6876 for ac_func in \
6877         ctime_r                 \
6878         gethostbyname_r gethostbyaddr_r \
6879
6880 do
6881 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6882 echo "configure:6883: checking for $ac_func" >&5
6883 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6884   echo $ac_n "(cached) $ac_c" 1>&6
6885 else
6886   cat > conftest.$ac_ext <<EOF
6887 #line 6888 "configure"
6888 #include "confdefs.h"
6889 /* System header to define __stub macros and hopefully few prototypes,
6890     which can conflict with char $ac_func(); below.  */
6891 #include <assert.h>
6892 /* Override any gcc2 internal prototype to avoid an error.  */
6893 /* We use char because int might match the return type of a gcc2
6894     builtin and then its argument prototype would still apply.  */
6895 char $ac_func();
6896 char (*f)();
6897
6898 int main() {
6899
6900 /* The GNU C library defines this for functions which it implements
6901     to always fail with ENOSYS.  Some functions are actually named
6902     something starting with __ and the normal name is an alias.  */
6903 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6904 choke me
6905 #else
6906 f = $ac_func;
6907 #endif
6908
6909 ; return 0; }
6910 EOF
6911 if { (eval echo configure:6912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6912   rm -rf conftest*
6913   eval "ac_cv_func_$ac_func=yes"
6914 else
6915   echo "configure: failed program was:" >&5
6916   cat conftest.$ac_ext >&5
6917   rm -rf conftest*
6918   eval "ac_cv_func_$ac_func=no"
6919 fi
6920 rm -f conftest*
6921 fi
6922
6923 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6924   echo "$ac_t""yes" 1>&6
6925     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6926   cat >> confdefs.h <<EOF
6927 #define $ac_tr_func 1
6928 EOF
6929  
6930 else
6931   echo "$ac_t""no" 1>&6
6932 fi
6933 done
6934
6935
6936 if test "$ac_cv_func_ctime_r" = no ; then
6937         ol_cv_func_ctime_r_nargs=0
6938 else
6939         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6940 echo "configure:6941: checking number of arguments of ctime_r" >&5
6941 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6942   echo $ac_n "(cached) $ac_c" 1>&6
6943 else
6944   cat > conftest.$ac_ext <<EOF
6945 #line 6946 "configure"
6946 #include "confdefs.h"
6947 #include <time.h>
6948 int main() {
6949 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6950 ; return 0; }
6951 EOF
6952 if { (eval echo configure:6953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6953   rm -rf conftest*
6954   ol_cv_func_ctime_r_nargs3=yes
6955 else
6956   echo "configure: failed program was:" >&5
6957   cat conftest.$ac_ext >&5
6958   rm -rf conftest*
6959   ol_cv_func_ctime_r_nargs3=no
6960 fi
6961 rm -f conftest*
6962
6963         cat > conftest.$ac_ext <<EOF
6964 #line 6965 "configure"
6965 #include "confdefs.h"
6966 #include <time.h>
6967 int main() {
6968 time_t ti; char *buffer; ctime_r(&ti,buffer);
6969 ; return 0; }
6970 EOF
6971 if { (eval echo configure:6972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6972   rm -rf conftest*
6973   ol_cv_func_ctime_r_nargs2=yes
6974 else
6975   echo "configure: failed program was:" >&5
6976   cat conftest.$ac_ext >&5
6977   rm -rf conftest*
6978   ol_cv_func_ctime_r_nargs2=no
6979 fi
6980 rm -f conftest*
6981
6982         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6983                 $ol_cv_func_ctime_r_nargs2 = no ; then
6984
6985                 ol_cv_func_ctime_r_nargs=3
6986
6987         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6988                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6989
6990                 ol_cv_func_ctime_r_nargs=2
6991
6992         else
6993                 ol_cv_func_ctime_r_nargs=0
6994         fi
6995   
6996 fi
6997
6998 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6999
7000   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
7001         cat >> confdefs.h <<EOF
7002 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
7003 EOF
7004
7005   fi
7006
7007 fi
7008
7009 if test "$ac_cv_func_gethostbyname_r" = yes ; then
7010         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
7011 echo "configure:7012: checking number of arguments of gethostbyname_r" >&5
7012 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
7013   echo $ac_n "(cached) $ac_c" 1>&6
7014 else
7015   cat > conftest.$ac_ext <<EOF
7016 #line 7017 "configure"
7017 #include "confdefs.h"
7018 #include <sys/types.h>
7019 #include <sys/socket.h>
7020 #include <netinet/in.h>
7021 #include <netdb.h>
7022 #define BUFSIZE (sizeof(struct hostent)+10)
7023 int main() {
7024 struct hostent hent; char buffer[BUFSIZE];
7025                 int bufsize=BUFSIZE;int h_errno;
7026                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
7027                         buffer, bufsize, &h_errno);
7028 ; return 0; }
7029 EOF
7030 if { (eval echo configure:7031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7031   rm -rf conftest*
7032   ol_cv_func_gethostbyname_r_nargs5=yes
7033 else
7034   echo "configure: failed program was:" >&5
7035   cat conftest.$ac_ext >&5
7036   rm -rf conftest*
7037   ol_cv_func_gethostbyname_r_nargs5=no
7038 fi
7039 rm -f conftest*
7040
7041         cat > conftest.$ac_ext <<EOF
7042 #line 7043 "configure"
7043 #include "confdefs.h"
7044 #include <sys/types.h>
7045 #include <sys/socket.h>
7046 #include <netinet/in.h>
7047 #include <netdb.h>
7048 #define BUFSIZE (sizeof(struct hostent)+10)
7049 int main() {
7050 struct hostent hent;struct hostent *rhent;
7051                 char buffer[BUFSIZE];
7052                 int bufsize=BUFSIZE;int h_errno;
7053                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
7054                         &rhent, &h_errno);
7055 ; return 0; }
7056 EOF
7057 if { (eval echo configure:7058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7058   rm -rf conftest*
7059   ol_cv_func_gethostbyname_r_nargs6=yes
7060 else
7061   echo "configure: failed program was:" >&5
7062   cat conftest.$ac_ext >&5
7063   rm -rf conftest*
7064   ol_cv_func_gethostbyname_r_nargs6=no
7065 fi
7066 rm -f conftest*
7067
7068         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
7069                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
7070
7071                 ol_cv_func_gethostbyname_r_nargs=5
7072
7073         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
7074                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
7075
7076                 ol_cv_func_gethostbyname_r_nargs=6
7077
7078         else
7079                 ol_cv_func_gethostbyname_r_nargs=0
7080         fi
7081   
7082 fi
7083
7084 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
7085   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
7086         cat >> confdefs.h <<EOF
7087 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
7088 EOF
7089
7090   fi
7091
7092 else
7093         ol_cv_func_gethostbyname_r_nargs=0
7094 fi
7095  
7096 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
7097         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
7098 echo "configure:7099: checking number of arguments of gethostbyaddr_r" >&5
7099 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
7100   echo $ac_n "(cached) $ac_c" 1>&6
7101 else
7102   cat > conftest.$ac_ext <<EOF
7103 #line 7104 "configure"
7104 #include "confdefs.h"
7105 #include <sys/types.h>
7106 #include <sys/socket.h>
7107 #include <netinet/in.h>
7108 #include <netdb.h>
7109 #define BUFSIZE (sizeof(struct hostent)+10)
7110 int main() {
7111 struct hostent hent; char buffer[BUFSIZE]; 
7112             struct in_addr add;
7113             size_t alen=sizeof(struct in_addr);
7114             int bufsize=BUFSIZE;int h_errno;
7115                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7116                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
7117 ; return 0; }
7118 EOF
7119 if { (eval echo configure:7120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7120   rm -rf conftest*
7121   ol_cv_func_gethostbyaddr_r_nargs7=yes
7122 else
7123   echo "configure: failed program was:" >&5
7124   cat conftest.$ac_ext >&5
7125   rm -rf conftest*
7126   ol_cv_func_gethostbyaddr_r_nargs7=no
7127 fi
7128 rm -f conftest*
7129
7130         cat > conftest.$ac_ext <<EOF
7131 #line 7132 "configure"
7132 #include "confdefs.h"
7133 #include <sys/types.h>
7134 #include <sys/socket.h>
7135 #include <netinet/in.h>
7136 #include <netdb.h>
7137 #define BUFSIZE (sizeof(struct hostent)+10)
7138 int main() {
7139 struct hostent hent;
7140                 struct hostent *rhent; char buffer[BUFSIZE]; 
7141                 struct in_addr add;
7142                 size_t alen=sizeof(struct in_addr);
7143                 int bufsize=BUFSIZE;int h_errno;
7144                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
7145                         alen, AF_INET, &hent, buffer, bufsize, 
7146                         &rhent, &h_errno);
7147 ; return 0; }
7148 EOF
7149 if { (eval echo configure:7150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7150   rm -rf conftest*
7151   ol_cv_func_gethostbyaddr_r_nargs8=yes
7152 else
7153   echo "configure: failed program was:" >&5
7154   cat conftest.$ac_ext >&5
7155   rm -rf conftest*
7156   ol_cv_func_gethostbyaddr_r_nargs8=no
7157 fi
7158 rm -f conftest*
7159
7160         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
7161                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
7162
7163                 ol_cv_func_gethostbyaddr_r_nargs=7
7164
7165         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
7166                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
7167
7168                 ol_cv_func_gethostbyaddr_r_nargs=8
7169
7170         else
7171                 ol_cv_func_gethostbyaddr_r_nargs=0
7172         fi
7173   
7174 fi
7175
7176 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
7177   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
7178     cat >> confdefs.h <<EOF
7179 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
7180 EOF
7181
7182   fi
7183
7184 else
7185         ol_cv_func_gethostbyaddr_r_nargs=0
7186 fi
7187
7188 if test "$ac_cv_func_ctime_r" = yes \
7189         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
7190         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
7191         -a "$ac_cv_func_gethostbyname_r" = yes \
7192         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
7193         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
7194         -a "$ac_cv_func_gethostbyaddr_r" = yes \
7195         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
7196         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
7197         ; then
7198  
7199         cat >> confdefs.h <<\EOF
7200 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
7201 EOF
7202
7203 fi
7204
7205 ol_link_threads=no
7206
7207 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7208         -o $ol_with_threads = nt ; then
7209
7210         
7211         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
7212 echo "configure:7213: checking for _beginthread" >&5
7213 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
7214   echo $ac_n "(cached) $ac_c" 1>&6
7215 else
7216   cat > conftest.$ac_ext <<EOF
7217 #line 7218 "configure"
7218 #include "confdefs.h"
7219 /* System header to define __stub macros and hopefully few prototypes,
7220     which can conflict with char _beginthread(); below.  */
7221 #include <assert.h>
7222 /* Override any gcc2 internal prototype to avoid an error.  */
7223 /* We use char because int might match the return type of a gcc2
7224     builtin and then its argument prototype would still apply.  */
7225 char _beginthread();
7226 char (*f)();
7227
7228 int main() {
7229
7230 /* The GNU C library defines this for functions which it implements
7231     to always fail with ENOSYS.  Some functions are actually named
7232     something starting with __ and the normal name is an alias.  */
7233 #if defined (__stub__beginthread) || defined (__stub____beginthread)
7234 choke me
7235 #else
7236 f = _beginthread;
7237 #endif
7238
7239 ; return 0; }
7240 EOF
7241 if { (eval echo configure:7242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7242   rm -rf conftest*
7243   eval "ac_cv_func__beginthread=yes"
7244 else
7245   echo "configure: failed program was:" >&5
7246   cat conftest.$ac_ext >&5
7247   rm -rf conftest*
7248   eval "ac_cv_func__beginthread=no"
7249 fi
7250 rm -f conftest*
7251 fi
7252
7253 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7254   echo "$ac_t""yes" 1>&6
7255   :
7256 else
7257   echo "$ac_t""no" 1>&6
7258 fi
7259
7260
7261         if test $ac_cv_func__beginthread = yes ; then
7262                 cat >> confdefs.h <<\EOF
7263 #define HAVE_NT_THREADS 1
7264 EOF
7265
7266         fi
7267
7268
7269         if test "$ol_cv_nt_threads" = yes ; then
7270         ol_link_threads=nt
7271         ol_with_threads=found
7272         ol_with_yielding_select=yes
7273
7274                 cat >> confdefs.h <<\EOF
7275 #define HAVE_NT_SERVICE_MANAGER 1
7276 EOF
7277
7278                 cat >> confdefs.h <<\EOF
7279 #define HAVE_NT_EVENT_LOG 1
7280 EOF
7281
7282         fi
7283
7284         if test $ol_with_threads = nt ; then
7285                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7286         fi
7287 fi
7288
7289 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7290         -o $ol_with_threads = posix ; then
7291
7292         for ac_hdr in pthread.h
7293 do
7294 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7295 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7296 echo "configure:7297: checking for $ac_hdr" >&5
7297 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7298   echo $ac_n "(cached) $ac_c" 1>&6
7299 else
7300   cat > conftest.$ac_ext <<EOF
7301 #line 7302 "configure"
7302 #include "confdefs.h"
7303 #include <$ac_hdr>
7304 EOF
7305 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7306 { (eval echo configure:7307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7307 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7308 if test -z "$ac_err"; then
7309   rm -rf conftest*
7310   eval "ac_cv_header_$ac_safe=yes"
7311 else
7312   echo "$ac_err" >&5
7313   echo "configure: failed program was:" >&5
7314   cat conftest.$ac_ext >&5
7315   rm -rf conftest*
7316   eval "ac_cv_header_$ac_safe=no"
7317 fi
7318 rm -f conftest*
7319 fi
7320 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7321   echo "$ac_t""yes" 1>&6
7322     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7323   cat >> confdefs.h <<EOF
7324 #define $ac_tr_hdr 1
7325 EOF
7326  
7327 else
7328   echo "$ac_t""no" 1>&6
7329 fi
7330 done
7331
7332
7333         if test $ac_cv_header_pthread_h = yes ; then
7334                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7335 echo "configure:7336: checking POSIX thread version" >&5
7336 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7337   echo $ac_n "(cached) $ac_c" 1>&6
7338 else
7339   
7340         cat > conftest.$ac_ext <<EOF
7341 #line 7342 "configure"
7342 #include "confdefs.h"
7343
7344 #               include <pthread.h>
7345                 /* this check could be improved */
7346 #               ifdef PTHREAD_ONCE_INIT
7347                         pthread_version_final;
7348 #               endif
7349         
7350 EOF
7351 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7352   egrep "pthread_version_final" >/dev/null 2>&1; then
7353   rm -rf conftest*
7354   ol_pthread_final=yes
7355 else
7356   rm -rf conftest*
7357   ol_pthread_final=no
7358 fi
7359 rm -f conftest*
7360
7361
7362         cat > conftest.$ac_ext <<EOF
7363 #line 7364 "configure"
7364 #include "confdefs.h"
7365
7366 #               include <pthread.h>
7367                 /* this check could be improved */
7368 #               ifdef pthread_once_init
7369                         pthread_version_draft4;
7370 #               endif
7371         
7372 EOF
7373 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7374   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7375   rm -rf conftest*
7376   ol_pthread_draft4=yes
7377 else
7378   rm -rf conftest*
7379   ol_pthread_draft4=no
7380 fi
7381 rm -f conftest*
7382
7383
7384         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7385                 ol_cv_pthread_version=final
7386         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7387                 ol_cv_pthread_version=draft4
7388         else
7389                 ol_cv_pthread_version=unknown
7390         fi
7391
7392 fi
7393
7394 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7395
7396
7397                 if test $ol_cv_pthread_version = final ; then
7398                         cat >> confdefs.h <<\EOF
7399 #define HAVE_PTHREADS_FINAL 1
7400 EOF
7401
7402                 elif test $ol_cv_pthread_version = draft4 ; then
7403                         cat >> confdefs.h <<\EOF
7404 #define HAVE_PTHREADS_D4 1
7405 EOF
7406
7407                 else
7408                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7409                 fi
7410
7411                 # consider threads found
7412                 ol_with_threads=found
7413
7414                 
7415         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7416 echo "configure:7417: checking for LinuxThreads pthread.h" >&5
7417 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7418   echo $ac_n "(cached) $ac_c" 1>&6
7419 else
7420   cat > conftest.$ac_ext <<EOF
7421 #line 7422 "configure"
7422 #include "confdefs.h"
7423 #include <pthread.h>
7424 EOF
7425 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7426   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7427   rm -rf conftest*
7428   ol_cv_header_linux_threads=yes
7429 else
7430   rm -rf conftest*
7431   ol_cv_header_linux_threads=no
7432 fi
7433 rm -f conftest*
7434
7435                 
7436 fi
7437
7438 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7439         if test $ol_cv_header_linux_threads = yes; then
7440                 cat >> confdefs.h <<\EOF
7441 #define HAVE_LINUX_THREADS 1
7442 EOF
7443
7444         fi
7445
7446                 
7447         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7448 echo "configure:7449: checking for GNU Pth pthread.h" >&5
7449 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7450   echo $ac_n "(cached) $ac_c" 1>&6
7451 else
7452   cat > conftest.$ac_ext <<EOF
7453 #line 7454 "configure"
7454 #include "confdefs.h"
7455 #include <pthread.h>
7456 #ifdef _POSIX_THREAD_IS_GNU_PTH
7457         __gnu_pth__;
7458 #endif
7459
7460 EOF
7461 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7462   egrep "__gnu_pth__" >/dev/null 2>&1; then
7463   rm -rf conftest*
7464   ol_cv_header_gnu_pth_pthread_h=yes
7465 else
7466   rm -rf conftest*
7467   ol_cv_header_gnu_pth_pthread_h=no
7468 fi
7469 rm -f conftest*
7470
7471                 
7472 fi
7473
7474 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7475
7476
7477                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7478                         for ac_hdr in sched.h
7479 do
7480 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7481 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7482 echo "configure:7483: checking for $ac_hdr" >&5
7483 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7484   echo $ac_n "(cached) $ac_c" 1>&6
7485 else
7486   cat > conftest.$ac_ext <<EOF
7487 #line 7488 "configure"
7488 #include "confdefs.h"
7489 #include <$ac_hdr>
7490 EOF
7491 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7492 { (eval echo configure:7493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7493 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7494 if test -z "$ac_err"; then
7495   rm -rf conftest*
7496   eval "ac_cv_header_$ac_safe=yes"
7497 else
7498   echo "$ac_err" >&5
7499   echo "configure: failed program was:" >&5
7500   cat conftest.$ac_ext >&5
7501   rm -rf conftest*
7502   eval "ac_cv_header_$ac_safe=no"
7503 fi
7504 rm -f conftest*
7505 fi
7506 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7507   echo "$ac_t""yes" 1>&6
7508     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7509   cat >> confdefs.h <<EOF
7510 #define $ac_tr_hdr 1
7511 EOF
7512  
7513 else
7514   echo "$ac_t""no" 1>&6
7515 fi
7516 done
7517
7518                 fi
7519
7520                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7521                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7522 echo "configure:7523: checking for pthread_create in default libraries" >&5
7523 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7524   echo $ac_n "(cached) $ac_c" 1>&6
7525 else
7526   
7527                 if test "$cross_compiling" = yes; then
7528   cat > conftest.$ac_ext <<EOF
7529 #line 7530 "configure"
7530 #include "confdefs.h"
7531 /* pthread test headers */
7532 #include <pthread.h>
7533 #ifndef NULL
7534 #define NULL (void*)0
7535 #endif
7536
7537 static void *task(p)
7538         void *p;
7539 {
7540         return (void *) (p == NULL);
7541 }
7542
7543 int main() {
7544
7545         /* pthread test function */
7546         pthread_t t;
7547         int status;
7548         int detach = 1;
7549
7550 #ifdef HAVE_PTHREADS_FINAL
7551         /* Final pthreads */
7552         pthread_attr_t attr;
7553
7554         status = pthread_attr_init(&attr);
7555         if( status ) return status;
7556
7557 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7558         if( !detach ) {
7559 #if defined( PTHREAD_CREATE_JOINABLE )
7560                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7561 #else
7562                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7563 #endif
7564
7565 #ifdef PTHREAD_CREATE_DETACHED
7566         } else {
7567                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7568 #endif
7569         }
7570         if( status ) return status;
7571 #endif
7572
7573         status = pthread_create( &t, &attr, task, NULL );
7574         if( status ) return status;
7575
7576 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7577         if( detach ) {
7578                 /* give thread a chance to complete */
7579                 /* it should remain joinable and hence detachable */
7580                 sleep( 1 );
7581
7582                 status = pthread_detach( t );
7583                 if( status ) return status;
7584         }
7585 #endif
7586
7587 #else
7588         /* Draft 4 pthreads */
7589         status = pthread_create( &t, pthread_attr_default, task, NULL );
7590         if( status ) return status;
7591
7592         if( detach ) {
7593                 /* give thread a chance to complete */
7594                 /* it should remain joinable and hence detachable */
7595                 sleep( 1 );
7596
7597                 status = pthread_detach( &t );
7598                 if( status ) return status;
7599         }
7600 #endif
7601
7602 #ifdef HAVE_LINUX_THREADS
7603         pthread_kill_other_threads_np();
7604 #endif
7605
7606         return 0;
7607
7608 ; return 0; }
7609 EOF
7610 if { (eval echo configure:7611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7611   rm -rf conftest*
7612   ol_cv_pthread_create=yes
7613 else
7614   echo "configure: failed program was:" >&5
7615   cat conftest.$ac_ext >&5
7616   rm -rf conftest*
7617   ol_cv_pthread_create=no
7618 fi
7619 rm -f conftest*
7620 else
7621   cat > conftest.$ac_ext <<EOF
7622 #line 7623 "configure"
7623 #include "confdefs.h"
7624 /* pthread test headers */
7625 #include <pthread.h>
7626 #ifndef NULL
7627 #define NULL (void*)0
7628 #endif
7629
7630 static void *task(p)
7631         void *p;
7632 {
7633         return (void *) (p == NULL);
7634 }
7635
7636
7637 int main(argc, argv)
7638         int argc;
7639         char **argv;
7640 {
7641
7642         /* pthread test function */
7643         pthread_t t;
7644         int status;
7645         int detach = 1;
7646
7647 #ifdef HAVE_PTHREADS_FINAL
7648         /* Final pthreads */
7649         pthread_attr_t attr;
7650
7651         status = pthread_attr_init(&attr);
7652         if( status ) return status;
7653
7654 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7655         if( !detach ) {
7656 #if defined( PTHREAD_CREATE_JOINABLE )
7657                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7658 #else
7659                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7660 #endif
7661
7662 #ifdef PTHREAD_CREATE_DETACHED
7663         } else {
7664                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7665 #endif
7666         }
7667         if( status ) return status;
7668 #endif
7669
7670         status = pthread_create( &t, &attr, task, NULL );
7671         if( status ) return status;
7672
7673 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7674         if( detach ) {
7675                 /* give thread a chance to complete */
7676                 /* it should remain joinable and hence detachable */
7677                 sleep( 1 );
7678
7679                 status = pthread_detach( t );
7680                 if( status ) return status;
7681         }
7682 #endif
7683
7684 #else
7685         /* Draft 4 pthreads */
7686         status = pthread_create( &t, pthread_attr_default, task, NULL );
7687         if( status ) return status;
7688
7689         if( detach ) {
7690                 /* give thread a chance to complete */
7691                 /* it should remain joinable and hence detachable */
7692                 sleep( 1 );
7693
7694                 status = pthread_detach( &t );
7695                 if( status ) return status;
7696         }
7697 #endif
7698
7699 #ifdef HAVE_LINUX_THREADS
7700         pthread_kill_other_threads_np();
7701 #endif
7702
7703         return 0;
7704
7705 }
7706
7707 EOF
7708 if { (eval echo configure:7709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7709 then
7710   ol_cv_pthread_create=yes
7711 else
7712   echo "configure: failed program was:" >&5
7713   cat conftest.$ac_ext >&5
7714   rm -fr conftest*
7715   ol_cv_pthread_create=no
7716 fi
7717 rm -fr conftest*
7718 fi
7719
7720 fi
7721
7722 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7723
7724                 if test $ol_cv_pthread_create != no ; then
7725                         ol_link_threads=posix
7726                         ol_link_pthreads=""
7727                 fi
7728                 
7729                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7730 if test "$ol_link_threads" = no ; then
7731         # try -kthread
7732         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7733 echo "configure:7734: checking for pthread link with -kthread" >&5
7734 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7735   echo $ac_n "(cached) $ac_c" 1>&6
7736 else
7737   
7738                 # save the flags
7739                 ol_LIBS="$LIBS"
7740                 LIBS="-kthread $LIBS"
7741
7742                 if test "$cross_compiling" = yes; then
7743   cat > conftest.$ac_ext <<EOF
7744 #line 7745 "configure"
7745 #include "confdefs.h"
7746 /* pthread test headers */
7747 #include <pthread.h>
7748 #ifndef NULL
7749 #define NULL (void*)0
7750 #endif
7751
7752 static void *task(p)
7753         void *p;
7754 {
7755         return (void *) (p == NULL);
7756 }
7757
7758 int main() {
7759
7760         /* pthread test function */
7761         pthread_t t;
7762         int status;
7763         int detach = 1;
7764
7765 #ifdef HAVE_PTHREADS_FINAL
7766         /* Final pthreads */
7767         pthread_attr_t attr;
7768
7769         status = pthread_attr_init(&attr);
7770         if( status ) return status;
7771
7772 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7773         if( !detach ) {
7774 #if defined( PTHREAD_CREATE_JOINABLE )
7775                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7776 #else
7777                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7778 #endif
7779
7780 #ifdef PTHREAD_CREATE_DETACHED
7781         } else {
7782                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7783 #endif
7784         }
7785         if( status ) return status;
7786 #endif
7787
7788         status = pthread_create( &t, &attr, task, NULL );
7789         if( status ) return status;
7790
7791 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7792         if( detach ) {
7793                 /* give thread a chance to complete */
7794                 /* it should remain joinable and hence detachable */
7795                 sleep( 1 );
7796
7797                 status = pthread_detach( t );
7798                 if( status ) return status;
7799         }
7800 #endif
7801
7802 #else
7803         /* Draft 4 pthreads */
7804         status = pthread_create( &t, pthread_attr_default, task, NULL );
7805         if( status ) return status;
7806
7807         if( detach ) {
7808                 /* give thread a chance to complete */
7809                 /* it should remain joinable and hence detachable */
7810                 sleep( 1 );
7811
7812                 status = pthread_detach( &t );
7813                 if( status ) return status;
7814         }
7815 #endif
7816
7817 #ifdef HAVE_LINUX_THREADS
7818         pthread_kill_other_threads_np();
7819 #endif
7820
7821         return 0;
7822
7823 ; return 0; }
7824 EOF
7825 if { (eval echo configure:7826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7826   rm -rf conftest*
7827   ol_cv_pthread_kthread=yes
7828 else
7829   echo "configure: failed program was:" >&5
7830   cat conftest.$ac_ext >&5
7831   rm -rf conftest*
7832   ol_cv_pthread_kthread=no
7833 fi
7834 rm -f conftest*
7835 else
7836   cat > conftest.$ac_ext <<EOF
7837 #line 7838 "configure"
7838 #include "confdefs.h"
7839 /* pthread test headers */
7840 #include <pthread.h>
7841 #ifndef NULL
7842 #define NULL (void*)0
7843 #endif
7844
7845 static void *task(p)
7846         void *p;
7847 {
7848         return (void *) (p == NULL);
7849 }
7850
7851
7852 int main(argc, argv)
7853         int argc;
7854         char **argv;
7855 {
7856
7857         /* pthread test function */
7858         pthread_t t;
7859         int status;
7860         int detach = 1;
7861
7862 #ifdef HAVE_PTHREADS_FINAL
7863         /* Final pthreads */
7864         pthread_attr_t attr;
7865
7866         status = pthread_attr_init(&attr);
7867         if( status ) return status;
7868
7869 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7870         if( !detach ) {
7871 #if defined( PTHREAD_CREATE_JOINABLE )
7872                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7873 #else
7874                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7875 #endif
7876
7877 #ifdef PTHREAD_CREATE_DETACHED
7878         } else {
7879                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7880 #endif
7881         }
7882         if( status ) return status;
7883 #endif
7884
7885         status = pthread_create( &t, &attr, task, NULL );
7886         if( status ) return status;
7887
7888 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7889         if( detach ) {
7890                 /* give thread a chance to complete */
7891                 /* it should remain joinable and hence detachable */
7892                 sleep( 1 );
7893
7894                 status = pthread_detach( t );
7895                 if( status ) return status;
7896         }
7897 #endif
7898
7899 #else
7900         /* Draft 4 pthreads */
7901         status = pthread_create( &t, pthread_attr_default, task, NULL );
7902         if( status ) return status;
7903
7904         if( detach ) {
7905                 /* give thread a chance to complete */
7906                 /* it should remain joinable and hence detachable */
7907                 sleep( 1 );
7908
7909                 status = pthread_detach( &t );
7910                 if( status ) return status;
7911         }
7912 #endif
7913
7914 #ifdef HAVE_LINUX_THREADS
7915         pthread_kill_other_threads_np();
7916 #endif
7917
7918         return 0;
7919
7920 }
7921
7922 EOF
7923 if { (eval echo configure:7924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7924 then
7925   ol_cv_pthread_kthread=yes
7926 else
7927   echo "configure: failed program was:" >&5
7928   cat conftest.$ac_ext >&5
7929   rm -fr conftest*
7930   ol_cv_pthread_kthread=no
7931 fi
7932 rm -fr conftest*
7933 fi
7934
7935
7936                 # restore the LIBS
7937                 LIBS="$ol_LIBS"
7938         
7939 fi
7940
7941 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7942
7943         if test $ol_cv_pthread_kthread = yes ; then
7944                 ol_link_pthreads="-kthread"
7945                 ol_link_threads=posix
7946         fi
7947 fi
7948
7949                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7950 if test "$ol_link_threads" = no ; then
7951         # try -pthread
7952         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7953 echo "configure:7954: checking for pthread link with -pthread" >&5
7954 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7955   echo $ac_n "(cached) $ac_c" 1>&6
7956 else
7957   
7958                 # save the flags
7959                 ol_LIBS="$LIBS"
7960                 LIBS="-pthread $LIBS"
7961
7962                 if test "$cross_compiling" = yes; then
7963   cat > conftest.$ac_ext <<EOF
7964 #line 7965 "configure"
7965 #include "confdefs.h"
7966 /* pthread test headers */
7967 #include <pthread.h>
7968 #ifndef NULL
7969 #define NULL (void*)0
7970 #endif
7971
7972 static void *task(p)
7973         void *p;
7974 {
7975         return (void *) (p == NULL);
7976 }
7977
7978 int main() {
7979
7980         /* pthread test function */
7981         pthread_t t;
7982         int status;
7983         int detach = 1;
7984
7985 #ifdef HAVE_PTHREADS_FINAL
7986         /* Final pthreads */
7987         pthread_attr_t attr;
7988
7989         status = pthread_attr_init(&attr);
7990         if( status ) return status;
7991
7992 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7993         if( !detach ) {
7994 #if defined( PTHREAD_CREATE_JOINABLE )
7995                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7996 #else
7997                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7998 #endif
7999
8000 #ifdef PTHREAD_CREATE_DETACHED
8001         } else {
8002                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8003 #endif
8004         }
8005         if( status ) return status;
8006 #endif
8007
8008         status = pthread_create( &t, &attr, task, NULL );
8009         if( status ) return status;
8010
8011 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8012         if( detach ) {
8013                 /* give thread a chance to complete */
8014                 /* it should remain joinable and hence detachable */
8015                 sleep( 1 );
8016
8017                 status = pthread_detach( t );
8018                 if( status ) return status;
8019         }
8020 #endif
8021
8022 #else
8023         /* Draft 4 pthreads */
8024         status = pthread_create( &t, pthread_attr_default, task, NULL );
8025         if( status ) return status;
8026
8027         if( detach ) {
8028                 /* give thread a chance to complete */
8029                 /* it should remain joinable and hence detachable */
8030                 sleep( 1 );
8031
8032                 status = pthread_detach( &t );
8033                 if( status ) return status;
8034         }
8035 #endif
8036
8037 #ifdef HAVE_LINUX_THREADS
8038         pthread_kill_other_threads_np();
8039 #endif
8040
8041         return 0;
8042
8043 ; return 0; }
8044 EOF
8045 if { (eval echo configure:8046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8046   rm -rf conftest*
8047   ol_cv_pthread_pthread=yes
8048 else
8049   echo "configure: failed program was:" >&5
8050   cat conftest.$ac_ext >&5
8051   rm -rf conftest*
8052   ol_cv_pthread_pthread=no
8053 fi
8054 rm -f conftest*
8055 else
8056   cat > conftest.$ac_ext <<EOF
8057 #line 8058 "configure"
8058 #include "confdefs.h"
8059 /* pthread test headers */
8060 #include <pthread.h>
8061 #ifndef NULL
8062 #define NULL (void*)0
8063 #endif
8064
8065 static void *task(p)
8066         void *p;
8067 {
8068         return (void *) (p == NULL);
8069 }
8070
8071
8072 int main(argc, argv)
8073         int argc;
8074         char **argv;
8075 {
8076
8077         /* pthread test function */
8078         pthread_t t;
8079         int status;
8080         int detach = 1;
8081
8082 #ifdef HAVE_PTHREADS_FINAL
8083         /* Final pthreads */
8084         pthread_attr_t attr;
8085
8086         status = pthread_attr_init(&attr);
8087         if( status ) return status;
8088
8089 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8090         if( !detach ) {
8091 #if defined( PTHREAD_CREATE_JOINABLE )
8092                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8093 #else
8094                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8095 #endif
8096
8097 #ifdef PTHREAD_CREATE_DETACHED
8098         } else {
8099                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8100 #endif
8101         }
8102         if( status ) return status;
8103 #endif
8104
8105         status = pthread_create( &t, &attr, task, NULL );
8106         if( status ) return status;
8107
8108 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8109         if( detach ) {
8110                 /* give thread a chance to complete */
8111                 /* it should remain joinable and hence detachable */
8112                 sleep( 1 );
8113
8114                 status = pthread_detach( t );
8115                 if( status ) return status;
8116         }
8117 #endif
8118
8119 #else
8120         /* Draft 4 pthreads */
8121         status = pthread_create( &t, pthread_attr_default, task, NULL );
8122         if( status ) return status;
8123
8124         if( detach ) {
8125                 /* give thread a chance to complete */
8126                 /* it should remain joinable and hence detachable */
8127                 sleep( 1 );
8128
8129                 status = pthread_detach( &t );
8130                 if( status ) return status;
8131         }
8132 #endif
8133
8134 #ifdef HAVE_LINUX_THREADS
8135         pthread_kill_other_threads_np();
8136 #endif
8137
8138         return 0;
8139
8140 }
8141
8142 EOF
8143 if { (eval echo configure:8144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8144 then
8145   ol_cv_pthread_pthread=yes
8146 else
8147   echo "configure: failed program was:" >&5
8148   cat conftest.$ac_ext >&5
8149   rm -fr conftest*
8150   ol_cv_pthread_pthread=no
8151 fi
8152 rm -fr conftest*
8153 fi
8154
8155
8156                 # restore the LIBS
8157                 LIBS="$ol_LIBS"
8158         
8159 fi
8160
8161 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
8162
8163         if test $ol_cv_pthread_pthread = yes ; then
8164                 ol_link_pthreads="-pthread"
8165                 ol_link_threads=posix
8166         fi
8167 fi
8168
8169                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
8170 if test "$ol_link_threads" = no ; then
8171         # try -pthreads
8172         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
8173 echo "configure:8174: checking for pthread link with -pthreads" >&5
8174 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
8175   echo $ac_n "(cached) $ac_c" 1>&6
8176 else
8177   
8178                 # save the flags
8179                 ol_LIBS="$LIBS"
8180                 LIBS="-pthreads $LIBS"
8181
8182                 if test "$cross_compiling" = yes; then
8183   cat > conftest.$ac_ext <<EOF
8184 #line 8185 "configure"
8185 #include "confdefs.h"
8186 /* pthread test headers */
8187 #include <pthread.h>
8188 #ifndef NULL
8189 #define NULL (void*)0
8190 #endif
8191
8192 static void *task(p)
8193         void *p;
8194 {
8195         return (void *) (p == NULL);
8196 }
8197
8198 int main() {
8199
8200         /* pthread test function */
8201         pthread_t t;
8202         int status;
8203         int detach = 1;
8204
8205 #ifdef HAVE_PTHREADS_FINAL
8206         /* Final pthreads */
8207         pthread_attr_t attr;
8208
8209         status = pthread_attr_init(&attr);
8210         if( status ) return status;
8211
8212 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8213         if( !detach ) {
8214 #if defined( PTHREAD_CREATE_JOINABLE )
8215                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8216 #else
8217                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8218 #endif
8219
8220 #ifdef PTHREAD_CREATE_DETACHED
8221         } else {
8222                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8223 #endif
8224         }
8225         if( status ) return status;
8226 #endif
8227
8228         status = pthread_create( &t, &attr, task, NULL );
8229         if( status ) return status;
8230
8231 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8232         if( detach ) {
8233                 /* give thread a chance to complete */
8234                 /* it should remain joinable and hence detachable */
8235                 sleep( 1 );
8236
8237                 status = pthread_detach( t );
8238                 if( status ) return status;
8239         }
8240 #endif
8241
8242 #else
8243         /* Draft 4 pthreads */
8244         status = pthread_create( &t, pthread_attr_default, task, NULL );
8245         if( status ) return status;
8246
8247         if( detach ) {
8248                 /* give thread a chance to complete */
8249                 /* it should remain joinable and hence detachable */
8250                 sleep( 1 );
8251
8252                 status = pthread_detach( &t );
8253                 if( status ) return status;
8254         }
8255 #endif
8256
8257 #ifdef HAVE_LINUX_THREADS
8258         pthread_kill_other_threads_np();
8259 #endif
8260
8261         return 0;
8262
8263 ; return 0; }
8264 EOF
8265 if { (eval echo configure:8266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8266   rm -rf conftest*
8267   ol_cv_pthread_pthreads=yes
8268 else
8269   echo "configure: failed program was:" >&5
8270   cat conftest.$ac_ext >&5
8271   rm -rf conftest*
8272   ol_cv_pthread_pthreads=no
8273 fi
8274 rm -f conftest*
8275 else
8276   cat > conftest.$ac_ext <<EOF
8277 #line 8278 "configure"
8278 #include "confdefs.h"
8279 /* pthread test headers */
8280 #include <pthread.h>
8281 #ifndef NULL
8282 #define NULL (void*)0
8283 #endif
8284
8285 static void *task(p)
8286         void *p;
8287 {
8288         return (void *) (p == NULL);
8289 }
8290
8291
8292 int main(argc, argv)
8293         int argc;
8294         char **argv;
8295 {
8296
8297         /* pthread test function */
8298         pthread_t t;
8299         int status;
8300         int detach = 1;
8301
8302 #ifdef HAVE_PTHREADS_FINAL
8303         /* Final pthreads */
8304         pthread_attr_t attr;
8305
8306         status = pthread_attr_init(&attr);
8307         if( status ) return status;
8308
8309 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8310         if( !detach ) {
8311 #if defined( PTHREAD_CREATE_JOINABLE )
8312                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8313 #else
8314                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8315 #endif
8316
8317 #ifdef PTHREAD_CREATE_DETACHED
8318         } else {
8319                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8320 #endif
8321         }
8322         if( status ) return status;
8323 #endif
8324
8325         status = pthread_create( &t, &attr, task, NULL );
8326         if( status ) return status;
8327
8328 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8329         if( detach ) {
8330                 /* give thread a chance to complete */
8331                 /* it should remain joinable and hence detachable */
8332                 sleep( 1 );
8333
8334                 status = pthread_detach( t );
8335                 if( status ) return status;
8336         }
8337 #endif
8338
8339 #else
8340         /* Draft 4 pthreads */
8341         status = pthread_create( &t, pthread_attr_default, task, NULL );
8342         if( status ) return status;
8343
8344         if( detach ) {
8345                 /* give thread a chance to complete */
8346                 /* it should remain joinable and hence detachable */
8347                 sleep( 1 );
8348
8349                 status = pthread_detach( &t );
8350                 if( status ) return status;
8351         }
8352 #endif
8353
8354 #ifdef HAVE_LINUX_THREADS
8355         pthread_kill_other_threads_np();
8356 #endif
8357
8358         return 0;
8359
8360 }
8361
8362 EOF
8363 if { (eval echo configure:8364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8364 then
8365   ol_cv_pthread_pthreads=yes
8366 else
8367   echo "configure: failed program was:" >&5
8368   cat conftest.$ac_ext >&5
8369   rm -fr conftest*
8370   ol_cv_pthread_pthreads=no
8371 fi
8372 rm -fr conftest*
8373 fi
8374
8375
8376                 # restore the LIBS
8377                 LIBS="$ol_LIBS"
8378         
8379 fi
8380
8381 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8382
8383         if test $ol_cv_pthread_pthreads = yes ; then
8384                 ol_link_pthreads="-pthreads"
8385                 ol_link_threads=posix
8386         fi
8387 fi
8388
8389                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8390 if test "$ol_link_threads" = no ; then
8391         # try -mthreads
8392         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8393 echo "configure:8394: checking for pthread link with -mthreads" >&5
8394 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8395   echo $ac_n "(cached) $ac_c" 1>&6
8396 else
8397   
8398                 # save the flags
8399                 ol_LIBS="$LIBS"
8400                 LIBS="-mthreads $LIBS"
8401
8402                 if test "$cross_compiling" = yes; then
8403   cat > conftest.$ac_ext <<EOF
8404 #line 8405 "configure"
8405 #include "confdefs.h"
8406 /* pthread test headers */
8407 #include <pthread.h>
8408 #ifndef NULL
8409 #define NULL (void*)0
8410 #endif
8411
8412 static void *task(p)
8413         void *p;
8414 {
8415         return (void *) (p == NULL);
8416 }
8417
8418 int main() {
8419
8420         /* pthread test function */
8421         pthread_t t;
8422         int status;
8423         int detach = 1;
8424
8425 #ifdef HAVE_PTHREADS_FINAL
8426         /* Final pthreads */
8427         pthread_attr_t attr;
8428
8429         status = pthread_attr_init(&attr);
8430         if( status ) return status;
8431
8432 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8433         if( !detach ) {
8434 #if defined( PTHREAD_CREATE_JOINABLE )
8435                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8436 #else
8437                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8438 #endif
8439
8440 #ifdef PTHREAD_CREATE_DETACHED
8441         } else {
8442                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8443 #endif
8444         }
8445         if( status ) return status;
8446 #endif
8447
8448         status = pthread_create( &t, &attr, task, NULL );
8449         if( status ) return status;
8450
8451 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8452         if( detach ) {
8453                 /* give thread a chance to complete */
8454                 /* it should remain joinable and hence detachable */
8455                 sleep( 1 );
8456
8457                 status = pthread_detach( t );
8458                 if( status ) return status;
8459         }
8460 #endif
8461
8462 #else
8463         /* Draft 4 pthreads */
8464         status = pthread_create( &t, pthread_attr_default, task, NULL );
8465         if( status ) return status;
8466
8467         if( detach ) {
8468                 /* give thread a chance to complete */
8469                 /* it should remain joinable and hence detachable */
8470                 sleep( 1 );
8471
8472                 status = pthread_detach( &t );
8473                 if( status ) return status;
8474         }
8475 #endif
8476
8477 #ifdef HAVE_LINUX_THREADS
8478         pthread_kill_other_threads_np();
8479 #endif
8480
8481         return 0;
8482
8483 ; return 0; }
8484 EOF
8485 if { (eval echo configure:8486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8486   rm -rf conftest*
8487   ol_cv_pthread_mthreads=yes
8488 else
8489   echo "configure: failed program was:" >&5
8490   cat conftest.$ac_ext >&5
8491   rm -rf conftest*
8492   ol_cv_pthread_mthreads=no
8493 fi
8494 rm -f conftest*
8495 else
8496   cat > conftest.$ac_ext <<EOF
8497 #line 8498 "configure"
8498 #include "confdefs.h"
8499 /* pthread test headers */
8500 #include <pthread.h>
8501 #ifndef NULL
8502 #define NULL (void*)0
8503 #endif
8504
8505 static void *task(p)
8506         void *p;
8507 {
8508         return (void *) (p == NULL);
8509 }
8510
8511
8512 int main(argc, argv)
8513         int argc;
8514         char **argv;
8515 {
8516
8517         /* pthread test function */
8518         pthread_t t;
8519         int status;
8520         int detach = 1;
8521
8522 #ifdef HAVE_PTHREADS_FINAL
8523         /* Final pthreads */
8524         pthread_attr_t attr;
8525
8526         status = pthread_attr_init(&attr);
8527         if( status ) return status;
8528
8529 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8530         if( !detach ) {
8531 #if defined( PTHREAD_CREATE_JOINABLE )
8532                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8533 #else
8534                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8535 #endif
8536
8537 #ifdef PTHREAD_CREATE_DETACHED
8538         } else {
8539                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8540 #endif
8541         }
8542         if( status ) return status;
8543 #endif
8544
8545         status = pthread_create( &t, &attr, task, NULL );
8546         if( status ) return status;
8547
8548 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8549         if( detach ) {
8550                 /* give thread a chance to complete */
8551                 /* it should remain joinable and hence detachable */
8552                 sleep( 1 );
8553
8554                 status = pthread_detach( t );
8555                 if( status ) return status;
8556         }
8557 #endif
8558
8559 #else
8560         /* Draft 4 pthreads */
8561         status = pthread_create( &t, pthread_attr_default, task, NULL );
8562         if( status ) return status;
8563
8564         if( detach ) {
8565                 /* give thread a chance to complete */
8566                 /* it should remain joinable and hence detachable */
8567                 sleep( 1 );
8568
8569                 status = pthread_detach( &t );
8570                 if( status ) return status;
8571         }
8572 #endif
8573
8574 #ifdef HAVE_LINUX_THREADS
8575         pthread_kill_other_threads_np();
8576 #endif
8577
8578         return 0;
8579
8580 }
8581
8582 EOF
8583 if { (eval echo configure:8584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8584 then
8585   ol_cv_pthread_mthreads=yes
8586 else
8587   echo "configure: failed program was:" >&5
8588   cat conftest.$ac_ext >&5
8589   rm -fr conftest*
8590   ol_cv_pthread_mthreads=no
8591 fi
8592 rm -fr conftest*
8593 fi
8594
8595
8596                 # restore the LIBS
8597                 LIBS="$ol_LIBS"
8598         
8599 fi
8600
8601 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8602
8603         if test $ol_cv_pthread_mthreads = yes ; then
8604                 ol_link_pthreads="-mthreads"
8605                 ol_link_threads=posix
8606         fi
8607 fi
8608
8609                 # Pthread try link: -thread (ol_cv_pthread_thread)
8610 if test "$ol_link_threads" = no ; then
8611         # try -thread
8612         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8613 echo "configure:8614: checking for pthread link with -thread" >&5
8614 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8615   echo $ac_n "(cached) $ac_c" 1>&6
8616 else
8617   
8618                 # save the flags
8619                 ol_LIBS="$LIBS"
8620                 LIBS="-thread $LIBS"
8621
8622                 if test "$cross_compiling" = yes; then
8623   cat > conftest.$ac_ext <<EOF
8624 #line 8625 "configure"
8625 #include "confdefs.h"
8626 /* pthread test headers */
8627 #include <pthread.h>
8628 #ifndef NULL
8629 #define NULL (void*)0
8630 #endif
8631
8632 static void *task(p)
8633         void *p;
8634 {
8635         return (void *) (p == NULL);
8636 }
8637
8638 int main() {
8639
8640         /* pthread test function */
8641         pthread_t t;
8642         int status;
8643         int detach = 1;
8644
8645 #ifdef HAVE_PTHREADS_FINAL
8646         /* Final pthreads */
8647         pthread_attr_t attr;
8648
8649         status = pthread_attr_init(&attr);
8650         if( status ) return status;
8651
8652 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8653         if( !detach ) {
8654 #if defined( PTHREAD_CREATE_JOINABLE )
8655                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8656 #else
8657                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8658 #endif
8659
8660 #ifdef PTHREAD_CREATE_DETACHED
8661         } else {
8662                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8663 #endif
8664         }
8665         if( status ) return status;
8666 #endif
8667
8668         status = pthread_create( &t, &attr, task, NULL );
8669         if( status ) return status;
8670
8671 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8672         if( detach ) {
8673                 /* give thread a chance to complete */
8674                 /* it should remain joinable and hence detachable */
8675                 sleep( 1 );
8676
8677                 status = pthread_detach( t );
8678                 if( status ) return status;
8679         }
8680 #endif
8681
8682 #else
8683         /* Draft 4 pthreads */
8684         status = pthread_create( &t, pthread_attr_default, task, NULL );
8685         if( status ) return status;
8686
8687         if( detach ) {
8688                 /* give thread a chance to complete */
8689                 /* it should remain joinable and hence detachable */
8690                 sleep( 1 );
8691
8692                 status = pthread_detach( &t );
8693                 if( status ) return status;
8694         }
8695 #endif
8696
8697 #ifdef HAVE_LINUX_THREADS
8698         pthread_kill_other_threads_np();
8699 #endif
8700
8701         return 0;
8702
8703 ; return 0; }
8704 EOF
8705 if { (eval echo configure:8706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8706   rm -rf conftest*
8707   ol_cv_pthread_thread=yes
8708 else
8709   echo "configure: failed program was:" >&5
8710   cat conftest.$ac_ext >&5
8711   rm -rf conftest*
8712   ol_cv_pthread_thread=no
8713 fi
8714 rm -f conftest*
8715 else
8716   cat > conftest.$ac_ext <<EOF
8717 #line 8718 "configure"
8718 #include "confdefs.h"
8719 /* pthread test headers */
8720 #include <pthread.h>
8721 #ifndef NULL
8722 #define NULL (void*)0
8723 #endif
8724
8725 static void *task(p)
8726         void *p;
8727 {
8728         return (void *) (p == NULL);
8729 }
8730
8731
8732 int main(argc, argv)
8733         int argc;
8734         char **argv;
8735 {
8736
8737         /* pthread test function */
8738         pthread_t t;
8739         int status;
8740         int detach = 1;
8741
8742 #ifdef HAVE_PTHREADS_FINAL
8743         /* Final pthreads */
8744         pthread_attr_t attr;
8745
8746         status = pthread_attr_init(&attr);
8747         if( status ) return status;
8748
8749 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8750         if( !detach ) {
8751 #if defined( PTHREAD_CREATE_JOINABLE )
8752                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8753 #else
8754                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8755 #endif
8756
8757 #ifdef PTHREAD_CREATE_DETACHED
8758         } else {
8759                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8760 #endif
8761         }
8762         if( status ) return status;
8763 #endif
8764
8765         status = pthread_create( &t, &attr, task, NULL );
8766         if( status ) return status;
8767
8768 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8769         if( detach ) {
8770                 /* give thread a chance to complete */
8771                 /* it should remain joinable and hence detachable */
8772                 sleep( 1 );
8773
8774                 status = pthread_detach( t );
8775                 if( status ) return status;
8776         }
8777 #endif
8778
8779 #else
8780         /* Draft 4 pthreads */
8781         status = pthread_create( &t, pthread_attr_default, task, NULL );
8782         if( status ) return status;
8783
8784         if( detach ) {
8785                 /* give thread a chance to complete */
8786                 /* it should remain joinable and hence detachable */
8787                 sleep( 1 );
8788
8789                 status = pthread_detach( &t );
8790                 if( status ) return status;
8791         }
8792 #endif
8793
8794 #ifdef HAVE_LINUX_THREADS
8795         pthread_kill_other_threads_np();
8796 #endif
8797
8798         return 0;
8799
8800 }
8801
8802 EOF
8803 if { (eval echo configure:8804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8804 then
8805   ol_cv_pthread_thread=yes
8806 else
8807   echo "configure: failed program was:" >&5
8808   cat conftest.$ac_ext >&5
8809   rm -fr conftest*
8810   ol_cv_pthread_thread=no
8811 fi
8812 rm -fr conftest*
8813 fi
8814
8815
8816                 # restore the LIBS
8817                 LIBS="$ol_LIBS"
8818         
8819 fi
8820
8821 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8822
8823         if test $ol_cv_pthread_thread = yes ; then
8824                 ol_link_pthreads="-thread"
8825                 ol_link_threads=posix
8826         fi
8827 fi
8828
8829
8830                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8831 if test "$ol_link_threads" = no ; then
8832         # try -lpthread -lmach -lexc -lc_r
8833         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8834 echo "configure:8835: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8835 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8836   echo $ac_n "(cached) $ac_c" 1>&6
8837 else
8838   
8839                 # save the flags
8840                 ol_LIBS="$LIBS"
8841                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8842
8843                 if test "$cross_compiling" = yes; then
8844   cat > conftest.$ac_ext <<EOF
8845 #line 8846 "configure"
8846 #include "confdefs.h"
8847 /* pthread test headers */
8848 #include <pthread.h>
8849 #ifndef NULL
8850 #define NULL (void*)0
8851 #endif
8852
8853 static void *task(p)
8854         void *p;
8855 {
8856         return (void *) (p == NULL);
8857 }
8858
8859 int main() {
8860
8861         /* pthread test function */
8862         pthread_t t;
8863         int status;
8864         int detach = 1;
8865
8866 #ifdef HAVE_PTHREADS_FINAL
8867         /* Final pthreads */
8868         pthread_attr_t attr;
8869
8870         status = pthread_attr_init(&attr);
8871         if( status ) return status;
8872
8873 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8874         if( !detach ) {
8875 #if defined( PTHREAD_CREATE_JOINABLE )
8876                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8877 #else
8878                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8879 #endif
8880
8881 #ifdef PTHREAD_CREATE_DETACHED
8882         } else {
8883                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8884 #endif
8885         }
8886         if( status ) return status;
8887 #endif
8888
8889         status = pthread_create( &t, &attr, task, NULL );
8890         if( status ) return status;
8891
8892 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8893         if( detach ) {
8894                 /* give thread a chance to complete */
8895                 /* it should remain joinable and hence detachable */
8896                 sleep( 1 );
8897
8898                 status = pthread_detach( t );
8899                 if( status ) return status;
8900         }
8901 #endif
8902
8903 #else
8904         /* Draft 4 pthreads */
8905         status = pthread_create( &t, pthread_attr_default, task, NULL );
8906         if( status ) return status;
8907
8908         if( detach ) {
8909                 /* give thread a chance to complete */
8910                 /* it should remain joinable and hence detachable */
8911                 sleep( 1 );
8912
8913                 status = pthread_detach( &t );
8914                 if( status ) return status;
8915         }
8916 #endif
8917
8918 #ifdef HAVE_LINUX_THREADS
8919         pthread_kill_other_threads_np();
8920 #endif
8921
8922         return 0;
8923
8924 ; return 0; }
8925 EOF
8926 if { (eval echo configure:8927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8927   rm -rf conftest*
8928   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8929 else
8930   echo "configure: failed program was:" >&5
8931   cat conftest.$ac_ext >&5
8932   rm -rf conftest*
8933   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8934 fi
8935 rm -f conftest*
8936 else
8937   cat > conftest.$ac_ext <<EOF
8938 #line 8939 "configure"
8939 #include "confdefs.h"
8940 /* pthread test headers */
8941 #include <pthread.h>
8942 #ifndef NULL
8943 #define NULL (void*)0
8944 #endif
8945
8946 static void *task(p)
8947         void *p;
8948 {
8949         return (void *) (p == NULL);
8950 }
8951
8952
8953 int main(argc, argv)
8954         int argc;
8955         char **argv;
8956 {
8957
8958         /* pthread test function */
8959         pthread_t t;
8960         int status;
8961         int detach = 1;
8962
8963 #ifdef HAVE_PTHREADS_FINAL
8964         /* Final pthreads */
8965         pthread_attr_t attr;
8966
8967         status = pthread_attr_init(&attr);
8968         if( status ) return status;
8969
8970 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8971         if( !detach ) {
8972 #if defined( PTHREAD_CREATE_JOINABLE )
8973                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8974 #else
8975                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8976 #endif
8977
8978 #ifdef PTHREAD_CREATE_DETACHED
8979         } else {
8980                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8981 #endif
8982         }
8983         if( status ) return status;
8984 #endif
8985
8986         status = pthread_create( &t, &attr, task, NULL );
8987         if( status ) return status;
8988
8989 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8990         if( detach ) {
8991                 /* give thread a chance to complete */
8992                 /* it should remain joinable and hence detachable */
8993                 sleep( 1 );
8994
8995                 status = pthread_detach( t );
8996                 if( status ) return status;
8997         }
8998 #endif
8999
9000 #else
9001         /* Draft 4 pthreads */
9002         status = pthread_create( &t, pthread_attr_default, task, NULL );
9003         if( status ) return status;
9004
9005         if( detach ) {
9006                 /* give thread a chance to complete */
9007                 /* it should remain joinable and hence detachable */
9008                 sleep( 1 );
9009
9010                 status = pthread_detach( &t );
9011                 if( status ) return status;
9012         }
9013 #endif
9014
9015 #ifdef HAVE_LINUX_THREADS
9016         pthread_kill_other_threads_np();
9017 #endif
9018
9019         return 0;
9020
9021 }
9022
9023 EOF
9024 if { (eval echo configure:9025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9025 then
9026   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
9027 else
9028   echo "configure: failed program was:" >&5
9029   cat conftest.$ac_ext >&5
9030   rm -fr conftest*
9031   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
9032 fi
9033 rm -fr conftest*
9034 fi
9035
9036
9037                 # restore the LIBS
9038                 LIBS="$ol_LIBS"
9039         
9040 fi
9041
9042 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
9043
9044         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
9045                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
9046                 ol_link_threads=posix
9047         fi
9048 fi
9049
9050                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
9051 if test "$ol_link_threads" = no ; then
9052         # try -lpthread -lmach -lexc
9053         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
9054 echo "configure:9055: checking for pthread link with -lpthread -lmach -lexc" >&5
9055 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
9056   echo $ac_n "(cached) $ac_c" 1>&6
9057 else
9058   
9059                 # save the flags
9060                 ol_LIBS="$LIBS"
9061                 LIBS="-lpthread -lmach -lexc $LIBS"
9062
9063                 if test "$cross_compiling" = yes; then
9064   cat > conftest.$ac_ext <<EOF
9065 #line 9066 "configure"
9066 #include "confdefs.h"
9067 /* pthread test headers */
9068 #include <pthread.h>
9069 #ifndef NULL
9070 #define NULL (void*)0
9071 #endif
9072
9073 static void *task(p)
9074         void *p;
9075 {
9076         return (void *) (p == NULL);
9077 }
9078
9079 int main() {
9080
9081         /* pthread test function */
9082         pthread_t t;
9083         int status;
9084         int detach = 1;
9085
9086 #ifdef HAVE_PTHREADS_FINAL
9087         /* Final pthreads */
9088         pthread_attr_t attr;
9089
9090         status = pthread_attr_init(&attr);
9091         if( status ) return status;
9092
9093 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9094         if( !detach ) {
9095 #if defined( PTHREAD_CREATE_JOINABLE )
9096                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9097 #else
9098                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9099 #endif
9100
9101 #ifdef PTHREAD_CREATE_DETACHED
9102         } else {
9103                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9104 #endif
9105         }
9106         if( status ) return status;
9107 #endif
9108
9109         status = pthread_create( &t, &attr, task, NULL );
9110         if( status ) return status;
9111
9112 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9113         if( detach ) {
9114                 /* give thread a chance to complete */
9115                 /* it should remain joinable and hence detachable */
9116                 sleep( 1 );
9117
9118                 status = pthread_detach( t );
9119                 if( status ) return status;
9120         }
9121 #endif
9122
9123 #else
9124         /* Draft 4 pthreads */
9125         status = pthread_create( &t, pthread_attr_default, task, NULL );
9126         if( status ) return status;
9127
9128         if( detach ) {
9129                 /* give thread a chance to complete */
9130                 /* it should remain joinable and hence detachable */
9131                 sleep( 1 );
9132
9133                 status = pthread_detach( &t );
9134                 if( status ) return status;
9135         }
9136 #endif
9137
9138 #ifdef HAVE_LINUX_THREADS
9139         pthread_kill_other_threads_np();
9140 #endif
9141
9142         return 0;
9143
9144 ; return 0; }
9145 EOF
9146 if { (eval echo configure:9147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9147   rm -rf conftest*
9148   ol_cv_pthread_lpthread_lmach_lexc=yes
9149 else
9150   echo "configure: failed program was:" >&5
9151   cat conftest.$ac_ext >&5
9152   rm -rf conftest*
9153   ol_cv_pthread_lpthread_lmach_lexc=no
9154 fi
9155 rm -f conftest*
9156 else
9157   cat > conftest.$ac_ext <<EOF
9158 #line 9159 "configure"
9159 #include "confdefs.h"
9160 /* pthread test headers */
9161 #include <pthread.h>
9162 #ifndef NULL
9163 #define NULL (void*)0
9164 #endif
9165
9166 static void *task(p)
9167         void *p;
9168 {
9169         return (void *) (p == NULL);
9170 }
9171
9172
9173 int main(argc, argv)
9174         int argc;
9175         char **argv;
9176 {
9177
9178         /* pthread test function */
9179         pthread_t t;
9180         int status;
9181         int detach = 1;
9182
9183 #ifdef HAVE_PTHREADS_FINAL
9184         /* Final pthreads */
9185         pthread_attr_t attr;
9186
9187         status = pthread_attr_init(&attr);
9188         if( status ) return status;
9189
9190 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9191         if( !detach ) {
9192 #if defined( PTHREAD_CREATE_JOINABLE )
9193                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9194 #else
9195                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9196 #endif
9197
9198 #ifdef PTHREAD_CREATE_DETACHED
9199         } else {
9200                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9201 #endif
9202         }
9203         if( status ) return status;
9204 #endif
9205
9206         status = pthread_create( &t, &attr, task, NULL );
9207         if( status ) return status;
9208
9209 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9210         if( detach ) {
9211                 /* give thread a chance to complete */
9212                 /* it should remain joinable and hence detachable */
9213                 sleep( 1 );
9214
9215                 status = pthread_detach( t );
9216                 if( status ) return status;
9217         }
9218 #endif
9219
9220 #else
9221         /* Draft 4 pthreads */
9222         status = pthread_create( &t, pthread_attr_default, task, NULL );
9223         if( status ) return status;
9224
9225         if( detach ) {
9226                 /* give thread a chance to complete */
9227                 /* it should remain joinable and hence detachable */
9228                 sleep( 1 );
9229
9230                 status = pthread_detach( &t );
9231                 if( status ) return status;
9232         }
9233 #endif
9234
9235 #ifdef HAVE_LINUX_THREADS
9236         pthread_kill_other_threads_np();
9237 #endif
9238
9239         return 0;
9240
9241 }
9242
9243 EOF
9244 if { (eval echo configure:9245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9245 then
9246   ol_cv_pthread_lpthread_lmach_lexc=yes
9247 else
9248   echo "configure: failed program was:" >&5
9249   cat conftest.$ac_ext >&5
9250   rm -fr conftest*
9251   ol_cv_pthread_lpthread_lmach_lexc=no
9252 fi
9253 rm -fr conftest*
9254 fi
9255
9256
9257                 # restore the LIBS
9258                 LIBS="$ol_LIBS"
9259         
9260 fi
9261
9262 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9263
9264         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9265                 ol_link_pthreads="-lpthread -lmach -lexc"
9266                 ol_link_threads=posix
9267         fi
9268 fi
9269
9270
9271                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9272 if test "$ol_link_threads" = no ; then
9273         # try -lpthread -Wl,-woff,85
9274         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9275 echo "configure:9276: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9276 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9277   echo $ac_n "(cached) $ac_c" 1>&6
9278 else
9279   
9280                 # save the flags
9281                 ol_LIBS="$LIBS"
9282                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9283
9284                 if test "$cross_compiling" = yes; then
9285   cat > conftest.$ac_ext <<EOF
9286 #line 9287 "configure"
9287 #include "confdefs.h"
9288 /* pthread test headers */
9289 #include <pthread.h>
9290 #ifndef NULL
9291 #define NULL (void*)0
9292 #endif
9293
9294 static void *task(p)
9295         void *p;
9296 {
9297         return (void *) (p == NULL);
9298 }
9299
9300 int main() {
9301
9302         /* pthread test function */
9303         pthread_t t;
9304         int status;
9305         int detach = 1;
9306
9307 #ifdef HAVE_PTHREADS_FINAL
9308         /* Final pthreads */
9309         pthread_attr_t attr;
9310
9311         status = pthread_attr_init(&attr);
9312         if( status ) return status;
9313
9314 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9315         if( !detach ) {
9316 #if defined( PTHREAD_CREATE_JOINABLE )
9317                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9318 #else
9319                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9320 #endif
9321
9322 #ifdef PTHREAD_CREATE_DETACHED
9323         } else {
9324                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9325 #endif
9326         }
9327         if( status ) return status;
9328 #endif
9329
9330         status = pthread_create( &t, &attr, task, NULL );
9331         if( status ) return status;
9332
9333 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9334         if( detach ) {
9335                 /* give thread a chance to complete */
9336                 /* it should remain joinable and hence detachable */
9337                 sleep( 1 );
9338
9339                 status = pthread_detach( t );
9340                 if( status ) return status;
9341         }
9342 #endif
9343
9344 #else
9345         /* Draft 4 pthreads */
9346         status = pthread_create( &t, pthread_attr_default, task, NULL );
9347         if( status ) return status;
9348
9349         if( detach ) {
9350                 /* give thread a chance to complete */
9351                 /* it should remain joinable and hence detachable */
9352                 sleep( 1 );
9353
9354                 status = pthread_detach( &t );
9355                 if( status ) return status;
9356         }
9357 #endif
9358
9359 #ifdef HAVE_LINUX_THREADS
9360         pthread_kill_other_threads_np();
9361 #endif
9362
9363         return 0;
9364
9365 ; return 0; }
9366 EOF
9367 if { (eval echo configure:9368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9368   rm -rf conftest*
9369   ol_cv_pthread_lib_lpthread_woff=yes
9370 else
9371   echo "configure: failed program was:" >&5
9372   cat conftest.$ac_ext >&5
9373   rm -rf conftest*
9374   ol_cv_pthread_lib_lpthread_woff=no
9375 fi
9376 rm -f conftest*
9377 else
9378   cat > conftest.$ac_ext <<EOF
9379 #line 9380 "configure"
9380 #include "confdefs.h"
9381 /* pthread test headers */
9382 #include <pthread.h>
9383 #ifndef NULL
9384 #define NULL (void*)0
9385 #endif
9386
9387 static void *task(p)
9388         void *p;
9389 {
9390         return (void *) (p == NULL);
9391 }
9392
9393
9394 int main(argc, argv)
9395         int argc;
9396         char **argv;
9397 {
9398
9399         /* pthread test function */
9400         pthread_t t;
9401         int status;
9402         int detach = 1;
9403
9404 #ifdef HAVE_PTHREADS_FINAL
9405         /* Final pthreads */
9406         pthread_attr_t attr;
9407
9408         status = pthread_attr_init(&attr);
9409         if( status ) return status;
9410
9411 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9412         if( !detach ) {
9413 #if defined( PTHREAD_CREATE_JOINABLE )
9414                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9415 #else
9416                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9417 #endif
9418
9419 #ifdef PTHREAD_CREATE_DETACHED
9420         } else {
9421                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9422 #endif
9423         }
9424         if( status ) return status;
9425 #endif
9426
9427         status = pthread_create( &t, &attr, task, NULL );
9428         if( status ) return status;
9429
9430 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9431         if( detach ) {
9432                 /* give thread a chance to complete */
9433                 /* it should remain joinable and hence detachable */
9434                 sleep( 1 );
9435
9436                 status = pthread_detach( t );
9437                 if( status ) return status;
9438         }
9439 #endif
9440
9441 #else
9442         /* Draft 4 pthreads */
9443         status = pthread_create( &t, pthread_attr_default, task, NULL );
9444         if( status ) return status;
9445
9446         if( detach ) {
9447                 /* give thread a chance to complete */
9448                 /* it should remain joinable and hence detachable */
9449                 sleep( 1 );
9450
9451                 status = pthread_detach( &t );
9452                 if( status ) return status;
9453         }
9454 #endif
9455
9456 #ifdef HAVE_LINUX_THREADS
9457         pthread_kill_other_threads_np();
9458 #endif
9459
9460         return 0;
9461
9462 }
9463
9464 EOF
9465 if { (eval echo configure:9466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9466 then
9467   ol_cv_pthread_lib_lpthread_woff=yes
9468 else
9469   echo "configure: failed program was:" >&5
9470   cat conftest.$ac_ext >&5
9471   rm -fr conftest*
9472   ol_cv_pthread_lib_lpthread_woff=no
9473 fi
9474 rm -fr conftest*
9475 fi
9476
9477
9478                 # restore the LIBS
9479                 LIBS="$ol_LIBS"
9480         
9481 fi
9482
9483 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9484
9485         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9486                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9487                 ol_link_threads=posix
9488         fi
9489 fi
9490
9491
9492                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9493 if test "$ol_link_threads" = no ; then
9494         # try -lpthread
9495         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9496 echo "configure:9497: checking for pthread link with -lpthread" >&5
9497 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9498   echo $ac_n "(cached) $ac_c" 1>&6
9499 else
9500   
9501                 # save the flags
9502                 ol_LIBS="$LIBS"
9503                 LIBS="-lpthread $LIBS"
9504
9505                 if test "$cross_compiling" = yes; then
9506   cat > conftest.$ac_ext <<EOF
9507 #line 9508 "configure"
9508 #include "confdefs.h"
9509 /* pthread test headers */
9510 #include <pthread.h>
9511 #ifndef NULL
9512 #define NULL (void*)0
9513 #endif
9514
9515 static void *task(p)
9516         void *p;
9517 {
9518         return (void *) (p == NULL);
9519 }
9520
9521 int main() {
9522
9523         /* pthread test function */
9524         pthread_t t;
9525         int status;
9526         int detach = 1;
9527
9528 #ifdef HAVE_PTHREADS_FINAL
9529         /* Final pthreads */
9530         pthread_attr_t attr;
9531
9532         status = pthread_attr_init(&attr);
9533         if( status ) return status;
9534
9535 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9536         if( !detach ) {
9537 #if defined( PTHREAD_CREATE_JOINABLE )
9538                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9539 #else
9540                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9541 #endif
9542
9543 #ifdef PTHREAD_CREATE_DETACHED
9544         } else {
9545                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9546 #endif
9547         }
9548         if( status ) return status;
9549 #endif
9550
9551         status = pthread_create( &t, &attr, task, NULL );
9552         if( status ) return status;
9553
9554 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9555         if( detach ) {
9556                 /* give thread a chance to complete */
9557                 /* it should remain joinable and hence detachable */
9558                 sleep( 1 );
9559
9560                 status = pthread_detach( t );
9561                 if( status ) return status;
9562         }
9563 #endif
9564
9565 #else
9566         /* Draft 4 pthreads */
9567         status = pthread_create( &t, pthread_attr_default, task, NULL );
9568         if( status ) return status;
9569
9570         if( detach ) {
9571                 /* give thread a chance to complete */
9572                 /* it should remain joinable and hence detachable */
9573                 sleep( 1 );
9574
9575                 status = pthread_detach( &t );
9576                 if( status ) return status;
9577         }
9578 #endif
9579
9580 #ifdef HAVE_LINUX_THREADS
9581         pthread_kill_other_threads_np();
9582 #endif
9583
9584         return 0;
9585
9586 ; return 0; }
9587 EOF
9588 if { (eval echo configure:9589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9589   rm -rf conftest*
9590   ol_cv_pthread_lpthread=yes
9591 else
9592   echo "configure: failed program was:" >&5
9593   cat conftest.$ac_ext >&5
9594   rm -rf conftest*
9595   ol_cv_pthread_lpthread=no
9596 fi
9597 rm -f conftest*
9598 else
9599   cat > conftest.$ac_ext <<EOF
9600 #line 9601 "configure"
9601 #include "confdefs.h"
9602 /* pthread test headers */
9603 #include <pthread.h>
9604 #ifndef NULL
9605 #define NULL (void*)0
9606 #endif
9607
9608 static void *task(p)
9609         void *p;
9610 {
9611         return (void *) (p == NULL);
9612 }
9613
9614
9615 int main(argc, argv)
9616         int argc;
9617         char **argv;
9618 {
9619
9620         /* pthread test function */
9621         pthread_t t;
9622         int status;
9623         int detach = 1;
9624
9625 #ifdef HAVE_PTHREADS_FINAL
9626         /* Final pthreads */
9627         pthread_attr_t attr;
9628
9629         status = pthread_attr_init(&attr);
9630         if( status ) return status;
9631
9632 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9633         if( !detach ) {
9634 #if defined( PTHREAD_CREATE_JOINABLE )
9635                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9636 #else
9637                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9638 #endif
9639
9640 #ifdef PTHREAD_CREATE_DETACHED
9641         } else {
9642                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9643 #endif
9644         }
9645         if( status ) return status;
9646 #endif
9647
9648         status = pthread_create( &t, &attr, task, NULL );
9649         if( status ) return status;
9650
9651 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9652         if( detach ) {
9653                 /* give thread a chance to complete */
9654                 /* it should remain joinable and hence detachable */
9655                 sleep( 1 );
9656
9657                 status = pthread_detach( t );
9658                 if( status ) return status;
9659         }
9660 #endif
9661
9662 #else
9663         /* Draft 4 pthreads */
9664         status = pthread_create( &t, pthread_attr_default, task, NULL );
9665         if( status ) return status;
9666
9667         if( detach ) {
9668                 /* give thread a chance to complete */
9669                 /* it should remain joinable and hence detachable */
9670                 sleep( 1 );
9671
9672                 status = pthread_detach( &t );
9673                 if( status ) return status;
9674         }
9675 #endif
9676
9677 #ifdef HAVE_LINUX_THREADS
9678         pthread_kill_other_threads_np();
9679 #endif
9680
9681         return 0;
9682
9683 }
9684
9685 EOF
9686 if { (eval echo configure:9687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9687 then
9688   ol_cv_pthread_lpthread=yes
9689 else
9690   echo "configure: failed program was:" >&5
9691   cat conftest.$ac_ext >&5
9692   rm -fr conftest*
9693   ol_cv_pthread_lpthread=no
9694 fi
9695 rm -fr conftest*
9696 fi
9697
9698
9699                 # restore the LIBS
9700                 LIBS="$ol_LIBS"
9701         
9702 fi
9703
9704 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9705
9706         if test $ol_cv_pthread_lpthread = yes ; then
9707                 ol_link_pthreads="-lpthread"
9708                 ol_link_threads=posix
9709         fi
9710 fi
9711
9712                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9713 if test "$ol_link_threads" = no ; then
9714         # try -lc_r
9715         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9716 echo "configure:9717: checking for pthread link with -lc_r" >&5
9717 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9718   echo $ac_n "(cached) $ac_c" 1>&6
9719 else
9720   
9721                 # save the flags
9722                 ol_LIBS="$LIBS"
9723                 LIBS="-lc_r $LIBS"
9724
9725                 if test "$cross_compiling" = yes; then
9726   cat > conftest.$ac_ext <<EOF
9727 #line 9728 "configure"
9728 #include "confdefs.h"
9729 /* pthread test headers */
9730 #include <pthread.h>
9731 #ifndef NULL
9732 #define NULL (void*)0
9733 #endif
9734
9735 static void *task(p)
9736         void *p;
9737 {
9738         return (void *) (p == NULL);
9739 }
9740
9741 int main() {
9742
9743         /* pthread test function */
9744         pthread_t t;
9745         int status;
9746         int detach = 1;
9747
9748 #ifdef HAVE_PTHREADS_FINAL
9749         /* Final pthreads */
9750         pthread_attr_t attr;
9751
9752         status = pthread_attr_init(&attr);
9753         if( status ) return status;
9754
9755 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9756         if( !detach ) {
9757 #if defined( PTHREAD_CREATE_JOINABLE )
9758                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9759 #else
9760                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9761 #endif
9762
9763 #ifdef PTHREAD_CREATE_DETACHED
9764         } else {
9765                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9766 #endif
9767         }
9768         if( status ) return status;
9769 #endif
9770
9771         status = pthread_create( &t, &attr, task, NULL );
9772         if( status ) return status;
9773
9774 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9775         if( detach ) {
9776                 /* give thread a chance to complete */
9777                 /* it should remain joinable and hence detachable */
9778                 sleep( 1 );
9779
9780                 status = pthread_detach( t );
9781                 if( status ) return status;
9782         }
9783 #endif
9784
9785 #else
9786         /* Draft 4 pthreads */
9787         status = pthread_create( &t, pthread_attr_default, task, NULL );
9788         if( status ) return status;
9789
9790         if( detach ) {
9791                 /* give thread a chance to complete */
9792                 /* it should remain joinable and hence detachable */
9793                 sleep( 1 );
9794
9795                 status = pthread_detach( &t );
9796                 if( status ) return status;
9797         }
9798 #endif
9799
9800 #ifdef HAVE_LINUX_THREADS
9801         pthread_kill_other_threads_np();
9802 #endif
9803
9804         return 0;
9805
9806 ; return 0; }
9807 EOF
9808 if { (eval echo configure:9809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9809   rm -rf conftest*
9810   ol_cv_pthread_lc_r=yes
9811 else
9812   echo "configure: failed program was:" >&5
9813   cat conftest.$ac_ext >&5
9814   rm -rf conftest*
9815   ol_cv_pthread_lc_r=no
9816 fi
9817 rm -f conftest*
9818 else
9819   cat > conftest.$ac_ext <<EOF
9820 #line 9821 "configure"
9821 #include "confdefs.h"
9822 /* pthread test headers */
9823 #include <pthread.h>
9824 #ifndef NULL
9825 #define NULL (void*)0
9826 #endif
9827
9828 static void *task(p)
9829         void *p;
9830 {
9831         return (void *) (p == NULL);
9832 }
9833
9834
9835 int main(argc, argv)
9836         int argc;
9837         char **argv;
9838 {
9839
9840         /* pthread test function */
9841         pthread_t t;
9842         int status;
9843         int detach = 1;
9844
9845 #ifdef HAVE_PTHREADS_FINAL
9846         /* Final pthreads */
9847         pthread_attr_t attr;
9848
9849         status = pthread_attr_init(&attr);
9850         if( status ) return status;
9851
9852 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9853         if( !detach ) {
9854 #if defined( PTHREAD_CREATE_JOINABLE )
9855                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9856 #else
9857                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9858 #endif
9859
9860 #ifdef PTHREAD_CREATE_DETACHED
9861         } else {
9862                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9863 #endif
9864         }
9865         if( status ) return status;
9866 #endif
9867
9868         status = pthread_create( &t, &attr, task, NULL );
9869         if( status ) return status;
9870
9871 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9872         if( detach ) {
9873                 /* give thread a chance to complete */
9874                 /* it should remain joinable and hence detachable */
9875                 sleep( 1 );
9876
9877                 status = pthread_detach( t );
9878                 if( status ) return status;
9879         }
9880 #endif
9881
9882 #else
9883         /* Draft 4 pthreads */
9884         status = pthread_create( &t, pthread_attr_default, task, NULL );
9885         if( status ) return status;
9886
9887         if( detach ) {
9888                 /* give thread a chance to complete */
9889                 /* it should remain joinable and hence detachable */
9890                 sleep( 1 );
9891
9892                 status = pthread_detach( &t );
9893                 if( status ) return status;
9894         }
9895 #endif
9896
9897 #ifdef HAVE_LINUX_THREADS
9898         pthread_kill_other_threads_np();
9899 #endif
9900
9901         return 0;
9902
9903 }
9904
9905 EOF
9906 if { (eval echo configure:9907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9907 then
9908   ol_cv_pthread_lc_r=yes
9909 else
9910   echo "configure: failed program was:" >&5
9911   cat conftest.$ac_ext >&5
9912   rm -fr conftest*
9913   ol_cv_pthread_lc_r=no
9914 fi
9915 rm -fr conftest*
9916 fi
9917
9918
9919                 # restore the LIBS
9920                 LIBS="$ol_LIBS"
9921         
9922 fi
9923
9924 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9925
9926         if test $ol_cv_pthread_lc_r = yes ; then
9927                 ol_link_pthreads="-lc_r"
9928                 ol_link_threads=posix
9929         fi
9930 fi
9931
9932
9933                 # Pthread try link: -threads (ol_cv_pthread_threads)
9934 if test "$ol_link_threads" = no ; then
9935         # try -threads
9936         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9937 echo "configure:9938: checking for pthread link with -threads" >&5
9938 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9939   echo $ac_n "(cached) $ac_c" 1>&6
9940 else
9941   
9942                 # save the flags
9943                 ol_LIBS="$LIBS"
9944                 LIBS="-threads $LIBS"
9945
9946                 if test "$cross_compiling" = yes; then
9947   cat > conftest.$ac_ext <<EOF
9948 #line 9949 "configure"
9949 #include "confdefs.h"
9950 /* pthread test headers */
9951 #include <pthread.h>
9952 #ifndef NULL
9953 #define NULL (void*)0
9954 #endif
9955
9956 static void *task(p)
9957         void *p;
9958 {
9959         return (void *) (p == NULL);
9960 }
9961
9962 int main() {
9963
9964         /* pthread test function */
9965         pthread_t t;
9966         int status;
9967         int detach = 1;
9968
9969 #ifdef HAVE_PTHREADS_FINAL
9970         /* Final pthreads */
9971         pthread_attr_t attr;
9972
9973         status = pthread_attr_init(&attr);
9974         if( status ) return status;
9975
9976 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9977         if( !detach ) {
9978 #if defined( PTHREAD_CREATE_JOINABLE )
9979                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9980 #else
9981                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9982 #endif
9983
9984 #ifdef PTHREAD_CREATE_DETACHED
9985         } else {
9986                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9987 #endif
9988         }
9989         if( status ) return status;
9990 #endif
9991
9992         status = pthread_create( &t, &attr, task, NULL );
9993         if( status ) return status;
9994
9995 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9996         if( detach ) {
9997                 /* give thread a chance to complete */
9998                 /* it should remain joinable and hence detachable */
9999                 sleep( 1 );
10000
10001                 status = pthread_detach( t );
10002                 if( status ) return status;
10003         }
10004 #endif
10005
10006 #else
10007         /* Draft 4 pthreads */
10008         status = pthread_create( &t, pthread_attr_default, task, NULL );
10009         if( status ) return status;
10010
10011         if( detach ) {
10012                 /* give thread a chance to complete */
10013                 /* it should remain joinable and hence detachable */
10014                 sleep( 1 );
10015
10016                 status = pthread_detach( &t );
10017                 if( status ) return status;
10018         }
10019 #endif
10020
10021 #ifdef HAVE_LINUX_THREADS
10022         pthread_kill_other_threads_np();
10023 #endif
10024
10025         return 0;
10026
10027 ; return 0; }
10028 EOF
10029 if { (eval echo configure:10030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10030   rm -rf conftest*
10031   ol_cv_pthread_threads=yes
10032 else
10033   echo "configure: failed program was:" >&5
10034   cat conftest.$ac_ext >&5
10035   rm -rf conftest*
10036   ol_cv_pthread_threads=no
10037 fi
10038 rm -f conftest*
10039 else
10040   cat > conftest.$ac_ext <<EOF
10041 #line 10042 "configure"
10042 #include "confdefs.h"
10043 /* pthread test headers */
10044 #include <pthread.h>
10045 #ifndef NULL
10046 #define NULL (void*)0
10047 #endif
10048
10049 static void *task(p)
10050         void *p;
10051 {
10052         return (void *) (p == NULL);
10053 }
10054
10055
10056 int main(argc, argv)
10057         int argc;
10058         char **argv;
10059 {
10060
10061         /* pthread test function */
10062         pthread_t t;
10063         int status;
10064         int detach = 1;
10065
10066 #ifdef HAVE_PTHREADS_FINAL
10067         /* Final pthreads */
10068         pthread_attr_t attr;
10069
10070         status = pthread_attr_init(&attr);
10071         if( status ) return status;
10072
10073 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10074         if( !detach ) {
10075 #if defined( PTHREAD_CREATE_JOINABLE )
10076                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10077 #else
10078                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10079 #endif
10080
10081 #ifdef PTHREAD_CREATE_DETACHED
10082         } else {
10083                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10084 #endif
10085         }
10086         if( status ) return status;
10087 #endif
10088
10089         status = pthread_create( &t, &attr, task, NULL );
10090         if( status ) return status;
10091
10092 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10093         if( detach ) {
10094                 /* give thread a chance to complete */
10095                 /* it should remain joinable and hence detachable */
10096                 sleep( 1 );
10097
10098                 status = pthread_detach( t );
10099                 if( status ) return status;
10100         }
10101 #endif
10102
10103 #else
10104         /* Draft 4 pthreads */
10105         status = pthread_create( &t, pthread_attr_default, task, NULL );
10106         if( status ) return status;
10107
10108         if( detach ) {
10109                 /* give thread a chance to complete */
10110                 /* it should remain joinable and hence detachable */
10111                 sleep( 1 );
10112
10113                 status = pthread_detach( &t );
10114                 if( status ) return status;
10115         }
10116 #endif
10117
10118 #ifdef HAVE_LINUX_THREADS
10119         pthread_kill_other_threads_np();
10120 #endif
10121
10122         return 0;
10123
10124 }
10125
10126 EOF
10127 if { (eval echo configure:10128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10128 then
10129   ol_cv_pthread_threads=yes
10130 else
10131   echo "configure: failed program was:" >&5
10132   cat conftest.$ac_ext >&5
10133   rm -fr conftest*
10134   ol_cv_pthread_threads=no
10135 fi
10136 rm -fr conftest*
10137 fi
10138
10139
10140                 # restore the LIBS
10141                 LIBS="$ol_LIBS"
10142         
10143 fi
10144
10145 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
10146
10147         if test $ol_cv_pthread_threads = yes ; then
10148                 ol_link_pthreads="-threads"
10149                 ol_link_threads=posix
10150         fi
10151 fi
10152
10153
10154                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
10155 if test "$ol_link_threads" = no ; then
10156         # try -lpthreads -lmach -lexc -lc_r
10157         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
10158 echo "configure:10159: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
10159 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
10160   echo $ac_n "(cached) $ac_c" 1>&6
10161 else
10162   
10163                 # save the flags
10164                 ol_LIBS="$LIBS"
10165                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
10166
10167                 if test "$cross_compiling" = yes; then
10168   cat > conftest.$ac_ext <<EOF
10169 #line 10170 "configure"
10170 #include "confdefs.h"
10171 /* pthread test headers */
10172 #include <pthread.h>
10173 #ifndef NULL
10174 #define NULL (void*)0
10175 #endif
10176
10177 static void *task(p)
10178         void *p;
10179 {
10180         return (void *) (p == NULL);
10181 }
10182
10183 int main() {
10184
10185         /* pthread test function */
10186         pthread_t t;
10187         int status;
10188         int detach = 1;
10189
10190 #ifdef HAVE_PTHREADS_FINAL
10191         /* Final pthreads */
10192         pthread_attr_t attr;
10193
10194         status = pthread_attr_init(&attr);
10195         if( status ) return status;
10196
10197 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10198         if( !detach ) {
10199 #if defined( PTHREAD_CREATE_JOINABLE )
10200                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10201 #else
10202                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10203 #endif
10204
10205 #ifdef PTHREAD_CREATE_DETACHED
10206         } else {
10207                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10208 #endif
10209         }
10210         if( status ) return status;
10211 #endif
10212
10213         status = pthread_create( &t, &attr, task, NULL );
10214         if( status ) return status;
10215
10216 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10217         if( detach ) {
10218                 /* give thread a chance to complete */
10219                 /* it should remain joinable and hence detachable */
10220                 sleep( 1 );
10221
10222                 status = pthread_detach( t );
10223                 if( status ) return status;
10224         }
10225 #endif
10226
10227 #else
10228         /* Draft 4 pthreads */
10229         status = pthread_create( &t, pthread_attr_default, task, NULL );
10230         if( status ) return status;
10231
10232         if( detach ) {
10233                 /* give thread a chance to complete */
10234                 /* it should remain joinable and hence detachable */
10235                 sleep( 1 );
10236
10237                 status = pthread_detach( &t );
10238                 if( status ) return status;
10239         }
10240 #endif
10241
10242 #ifdef HAVE_LINUX_THREADS
10243         pthread_kill_other_threads_np();
10244 #endif
10245
10246         return 0;
10247
10248 ; return 0; }
10249 EOF
10250 if { (eval echo configure:10251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10251   rm -rf conftest*
10252   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10253 else
10254   echo "configure: failed program was:" >&5
10255   cat conftest.$ac_ext >&5
10256   rm -rf conftest*
10257   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10258 fi
10259 rm -f conftest*
10260 else
10261   cat > conftest.$ac_ext <<EOF
10262 #line 10263 "configure"
10263 #include "confdefs.h"
10264 /* pthread test headers */
10265 #include <pthread.h>
10266 #ifndef NULL
10267 #define NULL (void*)0
10268 #endif
10269
10270 static void *task(p)
10271         void *p;
10272 {
10273         return (void *) (p == NULL);
10274 }
10275
10276
10277 int main(argc, argv)
10278         int argc;
10279         char **argv;
10280 {
10281
10282         /* pthread test function */
10283         pthread_t t;
10284         int status;
10285         int detach = 1;
10286
10287 #ifdef HAVE_PTHREADS_FINAL
10288         /* Final pthreads */
10289         pthread_attr_t attr;
10290
10291         status = pthread_attr_init(&attr);
10292         if( status ) return status;
10293
10294 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10295         if( !detach ) {
10296 #if defined( PTHREAD_CREATE_JOINABLE )
10297                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10298 #else
10299                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10300 #endif
10301
10302 #ifdef PTHREAD_CREATE_DETACHED
10303         } else {
10304                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10305 #endif
10306         }
10307         if( status ) return status;
10308 #endif
10309
10310         status = pthread_create( &t, &attr, task, NULL );
10311         if( status ) return status;
10312
10313 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10314         if( detach ) {
10315                 /* give thread a chance to complete */
10316                 /* it should remain joinable and hence detachable */
10317                 sleep( 1 );
10318
10319                 status = pthread_detach( t );
10320                 if( status ) return status;
10321         }
10322 #endif
10323
10324 #else
10325         /* Draft 4 pthreads */
10326         status = pthread_create( &t, pthread_attr_default, task, NULL );
10327         if( status ) return status;
10328
10329         if( detach ) {
10330                 /* give thread a chance to complete */
10331                 /* it should remain joinable and hence detachable */
10332                 sleep( 1 );
10333
10334                 status = pthread_detach( &t );
10335                 if( status ) return status;
10336         }
10337 #endif
10338
10339 #ifdef HAVE_LINUX_THREADS
10340         pthread_kill_other_threads_np();
10341 #endif
10342
10343         return 0;
10344
10345 }
10346
10347 EOF
10348 if { (eval echo configure:10349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10349 then
10350   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10351 else
10352   echo "configure: failed program was:" >&5
10353   cat conftest.$ac_ext >&5
10354   rm -fr conftest*
10355   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10356 fi
10357 rm -fr conftest*
10358 fi
10359
10360
10361                 # restore the LIBS
10362                 LIBS="$ol_LIBS"
10363         
10364 fi
10365
10366 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10367
10368         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10369                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10370                 ol_link_threads=posix
10371         fi
10372 fi
10373
10374                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10375 if test "$ol_link_threads" = no ; then
10376         # try -lpthreads -lmach -lexc
10377         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10378 echo "configure:10379: checking for pthread link with -lpthreads -lmach -lexc" >&5
10379 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10380   echo $ac_n "(cached) $ac_c" 1>&6
10381 else
10382   
10383                 # save the flags
10384                 ol_LIBS="$LIBS"
10385                 LIBS="-lpthreads -lmach -lexc $LIBS"
10386
10387                 if test "$cross_compiling" = yes; then
10388   cat > conftest.$ac_ext <<EOF
10389 #line 10390 "configure"
10390 #include "confdefs.h"
10391 /* pthread test headers */
10392 #include <pthread.h>
10393 #ifndef NULL
10394 #define NULL (void*)0
10395 #endif
10396
10397 static void *task(p)
10398         void *p;
10399 {
10400         return (void *) (p == NULL);
10401 }
10402
10403 int main() {
10404
10405         /* pthread test function */
10406         pthread_t t;
10407         int status;
10408         int detach = 1;
10409
10410 #ifdef HAVE_PTHREADS_FINAL
10411         /* Final pthreads */
10412         pthread_attr_t attr;
10413
10414         status = pthread_attr_init(&attr);
10415         if( status ) return status;
10416
10417 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10418         if( !detach ) {
10419 #if defined( PTHREAD_CREATE_JOINABLE )
10420                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10421 #else
10422                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10423 #endif
10424
10425 #ifdef PTHREAD_CREATE_DETACHED
10426         } else {
10427                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10428 #endif
10429         }
10430         if( status ) return status;
10431 #endif
10432
10433         status = pthread_create( &t, &attr, task, NULL );
10434         if( status ) return status;
10435
10436 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10437         if( detach ) {
10438                 /* give thread a chance to complete */
10439                 /* it should remain joinable and hence detachable */
10440                 sleep( 1 );
10441
10442                 status = pthread_detach( t );
10443                 if( status ) return status;
10444         }
10445 #endif
10446
10447 #else
10448         /* Draft 4 pthreads */
10449         status = pthread_create( &t, pthread_attr_default, task, NULL );
10450         if( status ) return status;
10451
10452         if( detach ) {
10453                 /* give thread a chance to complete */
10454                 /* it should remain joinable and hence detachable */
10455                 sleep( 1 );
10456
10457                 status = pthread_detach( &t );
10458                 if( status ) return status;
10459         }
10460 #endif
10461
10462 #ifdef HAVE_LINUX_THREADS
10463         pthread_kill_other_threads_np();
10464 #endif
10465
10466         return 0;
10467
10468 ; return 0; }
10469 EOF
10470 if { (eval echo configure:10471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10471   rm -rf conftest*
10472   ol_cv_pthread_lpthreads_lmach_lexc=yes
10473 else
10474   echo "configure: failed program was:" >&5
10475   cat conftest.$ac_ext >&5
10476   rm -rf conftest*
10477   ol_cv_pthread_lpthreads_lmach_lexc=no
10478 fi
10479 rm -f conftest*
10480 else
10481   cat > conftest.$ac_ext <<EOF
10482 #line 10483 "configure"
10483 #include "confdefs.h"
10484 /* pthread test headers */
10485 #include <pthread.h>
10486 #ifndef NULL
10487 #define NULL (void*)0
10488 #endif
10489
10490 static void *task(p)
10491         void *p;
10492 {
10493         return (void *) (p == NULL);
10494 }
10495
10496
10497 int main(argc, argv)
10498         int argc;
10499         char **argv;
10500 {
10501
10502         /* pthread test function */
10503         pthread_t t;
10504         int status;
10505         int detach = 1;
10506
10507 #ifdef HAVE_PTHREADS_FINAL
10508         /* Final pthreads */
10509         pthread_attr_t attr;
10510
10511         status = pthread_attr_init(&attr);
10512         if( status ) return status;
10513
10514 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10515         if( !detach ) {
10516 #if defined( PTHREAD_CREATE_JOINABLE )
10517                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10518 #else
10519                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10520 #endif
10521
10522 #ifdef PTHREAD_CREATE_DETACHED
10523         } else {
10524                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10525 #endif
10526         }
10527         if( status ) return status;
10528 #endif
10529
10530         status = pthread_create( &t, &attr, task, NULL );
10531         if( status ) return status;
10532
10533 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10534         if( detach ) {
10535                 /* give thread a chance to complete */
10536                 /* it should remain joinable and hence detachable */
10537                 sleep( 1 );
10538
10539                 status = pthread_detach( t );
10540                 if( status ) return status;
10541         }
10542 #endif
10543
10544 #else
10545         /* Draft 4 pthreads */
10546         status = pthread_create( &t, pthread_attr_default, task, NULL );
10547         if( status ) return status;
10548
10549         if( detach ) {
10550                 /* give thread a chance to complete */
10551                 /* it should remain joinable and hence detachable */
10552                 sleep( 1 );
10553
10554                 status = pthread_detach( &t );
10555                 if( status ) return status;
10556         }
10557 #endif
10558
10559 #ifdef HAVE_LINUX_THREADS
10560         pthread_kill_other_threads_np();
10561 #endif
10562
10563         return 0;
10564
10565 }
10566
10567 EOF
10568 if { (eval echo configure:10569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10569 then
10570   ol_cv_pthread_lpthreads_lmach_lexc=yes
10571 else
10572   echo "configure: failed program was:" >&5
10573   cat conftest.$ac_ext >&5
10574   rm -fr conftest*
10575   ol_cv_pthread_lpthreads_lmach_lexc=no
10576 fi
10577 rm -fr conftest*
10578 fi
10579
10580
10581                 # restore the LIBS
10582                 LIBS="$ol_LIBS"
10583         
10584 fi
10585
10586 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10587
10588         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10589                 ol_link_pthreads="-lpthreads -lmach -lexc"
10590                 ol_link_threads=posix
10591         fi
10592 fi
10593
10594                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10595 if test "$ol_link_threads" = no ; then
10596         # try -lpthreads -lexc
10597         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10598 echo "configure:10599: checking for pthread link with -lpthreads -lexc" >&5
10599 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10600   echo $ac_n "(cached) $ac_c" 1>&6
10601 else
10602   
10603                 # save the flags
10604                 ol_LIBS="$LIBS"
10605                 LIBS="-lpthreads -lexc $LIBS"
10606
10607                 if test "$cross_compiling" = yes; then
10608   cat > conftest.$ac_ext <<EOF
10609 #line 10610 "configure"
10610 #include "confdefs.h"
10611 /* pthread test headers */
10612 #include <pthread.h>
10613 #ifndef NULL
10614 #define NULL (void*)0
10615 #endif
10616
10617 static void *task(p)
10618         void *p;
10619 {
10620         return (void *) (p == NULL);
10621 }
10622
10623 int main() {
10624
10625         /* pthread test function */
10626         pthread_t t;
10627         int status;
10628         int detach = 1;
10629
10630 #ifdef HAVE_PTHREADS_FINAL
10631         /* Final pthreads */
10632         pthread_attr_t attr;
10633
10634         status = pthread_attr_init(&attr);
10635         if( status ) return status;
10636
10637 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10638         if( !detach ) {
10639 #if defined( PTHREAD_CREATE_JOINABLE )
10640                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10641 #else
10642                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10643 #endif
10644
10645 #ifdef PTHREAD_CREATE_DETACHED
10646         } else {
10647                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10648 #endif
10649         }
10650         if( status ) return status;
10651 #endif
10652
10653         status = pthread_create( &t, &attr, task, NULL );
10654         if( status ) return status;
10655
10656 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10657         if( detach ) {
10658                 /* give thread a chance to complete */
10659                 /* it should remain joinable and hence detachable */
10660                 sleep( 1 );
10661
10662                 status = pthread_detach( t );
10663                 if( status ) return status;
10664         }
10665 #endif
10666
10667 #else
10668         /* Draft 4 pthreads */
10669         status = pthread_create( &t, pthread_attr_default, task, NULL );
10670         if( status ) return status;
10671
10672         if( detach ) {
10673                 /* give thread a chance to complete */
10674                 /* it should remain joinable and hence detachable */
10675                 sleep( 1 );
10676
10677                 status = pthread_detach( &t );
10678                 if( status ) return status;
10679         }
10680 #endif
10681
10682 #ifdef HAVE_LINUX_THREADS
10683         pthread_kill_other_threads_np();
10684 #endif
10685
10686         return 0;
10687
10688 ; return 0; }
10689 EOF
10690 if { (eval echo configure:10691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10691   rm -rf conftest*
10692   ol_cv_pthread_lpthreads_lexc=yes
10693 else
10694   echo "configure: failed program was:" >&5
10695   cat conftest.$ac_ext >&5
10696   rm -rf conftest*
10697   ol_cv_pthread_lpthreads_lexc=no
10698 fi
10699 rm -f conftest*
10700 else
10701   cat > conftest.$ac_ext <<EOF
10702 #line 10703 "configure"
10703 #include "confdefs.h"
10704 /* pthread test headers */
10705 #include <pthread.h>
10706 #ifndef NULL
10707 #define NULL (void*)0
10708 #endif
10709
10710 static void *task(p)
10711         void *p;
10712 {
10713         return (void *) (p == NULL);
10714 }
10715
10716
10717 int main(argc, argv)
10718         int argc;
10719         char **argv;
10720 {
10721
10722         /* pthread test function */
10723         pthread_t t;
10724         int status;
10725         int detach = 1;
10726
10727 #ifdef HAVE_PTHREADS_FINAL
10728         /* Final pthreads */
10729         pthread_attr_t attr;
10730
10731         status = pthread_attr_init(&attr);
10732         if( status ) return status;
10733
10734 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10735         if( !detach ) {
10736 #if defined( PTHREAD_CREATE_JOINABLE )
10737                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10738 #else
10739                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10740 #endif
10741
10742 #ifdef PTHREAD_CREATE_DETACHED
10743         } else {
10744                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10745 #endif
10746         }
10747         if( status ) return status;
10748 #endif
10749
10750         status = pthread_create( &t, &attr, task, NULL );
10751         if( status ) return status;
10752
10753 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10754         if( detach ) {
10755                 /* give thread a chance to complete */
10756                 /* it should remain joinable and hence detachable */
10757                 sleep( 1 );
10758
10759                 status = pthread_detach( t );
10760                 if( status ) return status;
10761         }
10762 #endif
10763
10764 #else
10765         /* Draft 4 pthreads */
10766         status = pthread_create( &t, pthread_attr_default, task, NULL );
10767         if( status ) return status;
10768
10769         if( detach ) {
10770                 /* give thread a chance to complete */
10771                 /* it should remain joinable and hence detachable */
10772                 sleep( 1 );
10773
10774                 status = pthread_detach( &t );
10775                 if( status ) return status;
10776         }
10777 #endif
10778
10779 #ifdef HAVE_LINUX_THREADS
10780         pthread_kill_other_threads_np();
10781 #endif
10782
10783         return 0;
10784
10785 }
10786
10787 EOF
10788 if { (eval echo configure:10789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10789 then
10790   ol_cv_pthread_lpthreads_lexc=yes
10791 else
10792   echo "configure: failed program was:" >&5
10793   cat conftest.$ac_ext >&5
10794   rm -fr conftest*
10795   ol_cv_pthread_lpthreads_lexc=no
10796 fi
10797 rm -fr conftest*
10798 fi
10799
10800
10801                 # restore the LIBS
10802                 LIBS="$ol_LIBS"
10803         
10804 fi
10805
10806 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10807
10808         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10809                 ol_link_pthreads="-lpthreads -lexc"
10810                 ol_link_threads=posix
10811         fi
10812 fi
10813
10814
10815                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10816 if test "$ol_link_threads" = no ; then
10817         # try -lpthreads
10818         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10819 echo "configure:10820: checking for pthread link with -lpthreads" >&5
10820 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10821   echo $ac_n "(cached) $ac_c" 1>&6
10822 else
10823   
10824                 # save the flags
10825                 ol_LIBS="$LIBS"
10826                 LIBS="-lpthreads $LIBS"
10827
10828                 if test "$cross_compiling" = yes; then
10829   cat > conftest.$ac_ext <<EOF
10830 #line 10831 "configure"
10831 #include "confdefs.h"
10832 /* pthread test headers */
10833 #include <pthread.h>
10834 #ifndef NULL
10835 #define NULL (void*)0
10836 #endif
10837
10838 static void *task(p)
10839         void *p;
10840 {
10841         return (void *) (p == NULL);
10842 }
10843
10844 int main() {
10845
10846         /* pthread test function */
10847         pthread_t t;
10848         int status;
10849         int detach = 1;
10850
10851 #ifdef HAVE_PTHREADS_FINAL
10852         /* Final pthreads */
10853         pthread_attr_t attr;
10854
10855         status = pthread_attr_init(&attr);
10856         if( status ) return status;
10857
10858 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10859         if( !detach ) {
10860 #if defined( PTHREAD_CREATE_JOINABLE )
10861                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10862 #else
10863                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10864 #endif
10865
10866 #ifdef PTHREAD_CREATE_DETACHED
10867         } else {
10868                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10869 #endif
10870         }
10871         if( status ) return status;
10872 #endif
10873
10874         status = pthread_create( &t, &attr, task, NULL );
10875         if( status ) return status;
10876
10877 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10878         if( detach ) {
10879                 /* give thread a chance to complete */
10880                 /* it should remain joinable and hence detachable */
10881                 sleep( 1 );
10882
10883                 status = pthread_detach( t );
10884                 if( status ) return status;
10885         }
10886 #endif
10887
10888 #else
10889         /* Draft 4 pthreads */
10890         status = pthread_create( &t, pthread_attr_default, task, NULL );
10891         if( status ) return status;
10892
10893         if( detach ) {
10894                 /* give thread a chance to complete */
10895                 /* it should remain joinable and hence detachable */
10896                 sleep( 1 );
10897
10898                 status = pthread_detach( &t );
10899                 if( status ) return status;
10900         }
10901 #endif
10902
10903 #ifdef HAVE_LINUX_THREADS
10904         pthread_kill_other_threads_np();
10905 #endif
10906
10907         return 0;
10908
10909 ; return 0; }
10910 EOF
10911 if { (eval echo configure:10912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10912   rm -rf conftest*
10913   ol_cv_pthread_lib_lpthreads=yes
10914 else
10915   echo "configure: failed program was:" >&5
10916   cat conftest.$ac_ext >&5
10917   rm -rf conftest*
10918   ol_cv_pthread_lib_lpthreads=no
10919 fi
10920 rm -f conftest*
10921 else
10922   cat > conftest.$ac_ext <<EOF
10923 #line 10924 "configure"
10924 #include "confdefs.h"
10925 /* pthread test headers */
10926 #include <pthread.h>
10927 #ifndef NULL
10928 #define NULL (void*)0
10929 #endif
10930
10931 static void *task(p)
10932         void *p;
10933 {
10934         return (void *) (p == NULL);
10935 }
10936
10937
10938 int main(argc, argv)
10939         int argc;
10940         char **argv;
10941 {
10942
10943         /* pthread test function */
10944         pthread_t t;
10945         int status;
10946         int detach = 1;
10947
10948 #ifdef HAVE_PTHREADS_FINAL
10949         /* Final pthreads */
10950         pthread_attr_t attr;
10951
10952         status = pthread_attr_init(&attr);
10953         if( status ) return status;
10954
10955 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10956         if( !detach ) {
10957 #if defined( PTHREAD_CREATE_JOINABLE )
10958                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10959 #else
10960                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10961 #endif
10962
10963 #ifdef PTHREAD_CREATE_DETACHED
10964         } else {
10965                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10966 #endif
10967         }
10968         if( status ) return status;
10969 #endif
10970
10971         status = pthread_create( &t, &attr, task, NULL );
10972         if( status ) return status;
10973
10974 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10975         if( detach ) {
10976                 /* give thread a chance to complete */
10977                 /* it should remain joinable and hence detachable */
10978                 sleep( 1 );
10979
10980                 status = pthread_detach( t );
10981                 if( status ) return status;
10982         }
10983 #endif
10984
10985 #else
10986         /* Draft 4 pthreads */
10987         status = pthread_create( &t, pthread_attr_default, task, NULL );
10988         if( status ) return status;
10989
10990         if( detach ) {
10991                 /* give thread a chance to complete */
10992                 /* it should remain joinable and hence detachable */
10993                 sleep( 1 );
10994
10995                 status = pthread_detach( &t );
10996                 if( status ) return status;
10997         }
10998 #endif
10999
11000 #ifdef HAVE_LINUX_THREADS
11001         pthread_kill_other_threads_np();
11002 #endif
11003
11004         return 0;
11005
11006 }
11007
11008 EOF
11009 if { (eval echo configure:11010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11010 then
11011   ol_cv_pthread_lib_lpthreads=yes
11012 else
11013   echo "configure: failed program was:" >&5
11014   cat conftest.$ac_ext >&5
11015   rm -fr conftest*
11016   ol_cv_pthread_lib_lpthreads=no
11017 fi
11018 rm -fr conftest*
11019 fi
11020
11021
11022                 # restore the LIBS
11023                 LIBS="$ol_LIBS"
11024         
11025 fi
11026
11027 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
11028
11029         if test $ol_cv_pthread_lib_lpthreads = yes ; then
11030                 ol_link_pthreads="-lpthreads"
11031                 ol_link_threads=posix
11032         fi
11033 fi
11034
11035
11036                 if test $ol_link_threads != no ; then
11037                         cat >> confdefs.h <<\EOF
11038 #define HAVE_PTHREADS 1
11039 EOF
11040
11041
11042                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
11043
11044                                                 save_CPPFLAGS="$CPPFLAGS"
11045                         save_LIBS="$LIBS"
11046                         LIBS="$LTHREAD_LIBS $LIBS"
11047
11048                                                                                                 for ac_func in sched_yield pthread_yield
11049 do
11050 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11051 echo "configure:11052: checking for $ac_func" >&5
11052 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11053   echo $ac_n "(cached) $ac_c" 1>&6
11054 else
11055   cat > conftest.$ac_ext <<EOF
11056 #line 11057 "configure"
11057 #include "confdefs.h"
11058 /* System header to define __stub macros and hopefully few prototypes,
11059     which can conflict with char $ac_func(); below.  */
11060 #include <assert.h>
11061 /* Override any gcc2 internal prototype to avoid an error.  */
11062 /* We use char because int might match the return type of a gcc2
11063     builtin and then its argument prototype would still apply.  */
11064 char $ac_func();
11065 char (*f)();
11066
11067 int main() {
11068
11069 /* The GNU C library defines this for functions which it implements
11070     to always fail with ENOSYS.  Some functions are actually named
11071     something starting with __ and the normal name is an alias.  */
11072 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11073 choke me
11074 #else
11075 f = $ac_func;
11076 #endif
11077
11078 ; return 0; }
11079 EOF
11080 if { (eval echo configure:11081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11081   rm -rf conftest*
11082   eval "ac_cv_func_$ac_func=yes"
11083 else
11084   echo "configure: failed program was:" >&5
11085   cat conftest.$ac_ext >&5
11086   rm -rf conftest*
11087   eval "ac_cv_func_$ac_func=no"
11088 fi
11089 rm -f conftest*
11090 fi
11091
11092 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11093   echo "$ac_t""yes" 1>&6
11094     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11095   cat >> confdefs.h <<EOF
11096 #define $ac_tr_func 1
11097 EOF
11098  
11099 else
11100   echo "$ac_t""no" 1>&6
11101 fi
11102 done
11103
11104
11105                         if test $ac_cv_func_sched_yield = no -a \
11106                                 $ac_cv_func_pthread_yield = no ; then
11107                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
11108 echo "configure:11109: checking for sched_yield in -lrt" >&5
11109 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
11110 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11111   echo $ac_n "(cached) $ac_c" 1>&6
11112 else
11113   ac_save_LIBS="$LIBS"
11114 LIBS="-lrt  $LIBS"
11115 cat > conftest.$ac_ext <<EOF
11116 #line 11117 "configure"
11117 #include "confdefs.h"
11118 /* Override any gcc2 internal prototype to avoid an error.  */
11119 /* We use char because int might match the return type of a gcc2
11120     builtin and then its argument prototype would still apply.  */
11121 char sched_yield();
11122
11123 int main() {
11124 sched_yield()
11125 ; return 0; }
11126 EOF
11127 if { (eval echo configure:11128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11128   rm -rf conftest*
11129   eval "ac_cv_lib_$ac_lib_var=yes"
11130 else
11131   echo "configure: failed program was:" >&5
11132   cat conftest.$ac_ext >&5
11133   rm -rf conftest*
11134   eval "ac_cv_lib_$ac_lib_var=no"
11135 fi
11136 rm -f conftest*
11137 LIBS="$ac_save_LIBS"
11138
11139 fi
11140 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11141   echo "$ac_t""yes" 1>&6
11142   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
11143                                         cat >> confdefs.h <<\EOF
11144 #define HAVE_SCHED_YIELD 1
11145 EOF
11146
11147                                         ac_cv_func_sched_yield=yes
11148 else
11149   echo "$ac_t""no" 1>&6
11150 ac_cv_func_sched_yield=no
11151 fi
11152
11153                         fi
11154                         if test $ac_cv_func_sched_yield = no -a \
11155                                 $ac_cv_func_pthread_yield = no ; then
11156                                                                                                 for ac_func in thr_yield
11157 do
11158 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11159 echo "configure:11160: checking for $ac_func" >&5
11160 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11161   echo $ac_n "(cached) $ac_c" 1>&6
11162 else
11163   cat > conftest.$ac_ext <<EOF
11164 #line 11165 "configure"
11165 #include "confdefs.h"
11166 /* System header to define __stub macros and hopefully few prototypes,
11167     which can conflict with char $ac_func(); below.  */
11168 #include <assert.h>
11169 /* Override any gcc2 internal prototype to avoid an error.  */
11170 /* We use char because int might match the return type of a gcc2
11171     builtin and then its argument prototype would still apply.  */
11172 char $ac_func();
11173 char (*f)();
11174
11175 int main() {
11176
11177 /* The GNU C library defines this for functions which it implements
11178     to always fail with ENOSYS.  Some functions are actually named
11179     something starting with __ and the normal name is an alias.  */
11180 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11181 choke me
11182 #else
11183 f = $ac_func;
11184 #endif
11185
11186 ; return 0; }
11187 EOF
11188 if { (eval echo configure:11189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11189   rm -rf conftest*
11190   eval "ac_cv_func_$ac_func=yes"
11191 else
11192   echo "configure: failed program was:" >&5
11193   cat conftest.$ac_ext >&5
11194   rm -rf conftest*
11195   eval "ac_cv_func_$ac_func=no"
11196 fi
11197 rm -f conftest*
11198 fi
11199
11200 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11201   echo "$ac_t""yes" 1>&6
11202     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11203   cat >> confdefs.h <<EOF
11204 #define $ac_tr_func 1
11205 EOF
11206  
11207 else
11208   echo "$ac_t""no" 1>&6
11209 fi
11210 done
11211
11212                         fi
11213                         if test $ac_cv_func_sched_yield = no -a \
11214                                 $ac_cv_func_pthread_yield = no -a \
11215                                 "$ac_cv_func_thr_yield" = no ; then
11216                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
11217                         fi
11218
11219                                                 for ac_func in pthread_kill pthread_rwlock_destroy
11220 do
11221 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11222 echo "configure:11223: checking for $ac_func" >&5
11223 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11224   echo $ac_n "(cached) $ac_c" 1>&6
11225 else
11226   cat > conftest.$ac_ext <<EOF
11227 #line 11228 "configure"
11228 #include "confdefs.h"
11229 /* System header to define __stub macros and hopefully few prototypes,
11230     which can conflict with char $ac_func(); below.  */
11231 #include <assert.h>
11232 /* Override any gcc2 internal prototype to avoid an error.  */
11233 /* We use char because int might match the return type of a gcc2
11234     builtin and then its argument prototype would still apply.  */
11235 char $ac_func();
11236 char (*f)();
11237
11238 int main() {
11239
11240 /* The GNU C library defines this for functions which it implements
11241     to always fail with ENOSYS.  Some functions are actually named
11242     something starting with __ and the normal name is an alias.  */
11243 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11244 choke me
11245 #else
11246 f = $ac_func;
11247 #endif
11248
11249 ; return 0; }
11250 EOF
11251 if { (eval echo configure:11252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11252   rm -rf conftest*
11253   eval "ac_cv_func_$ac_func=yes"
11254 else
11255   echo "configure: failed program was:" >&5
11256   cat conftest.$ac_ext >&5
11257   rm -rf conftest*
11258   eval "ac_cv_func_$ac_func=no"
11259 fi
11260 rm -f conftest*
11261 fi
11262
11263 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11264   echo "$ac_t""yes" 1>&6
11265     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11266   cat >> confdefs.h <<EOF
11267 #define $ac_tr_func 1
11268 EOF
11269  
11270 else
11271   echo "$ac_t""no" 1>&6
11272 fi
11273 done
11274
11275
11276                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11277 echo "configure:11278: checking for pthread_detach with <pthread.h>" >&5
11278 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11279   echo $ac_n "(cached) $ac_c" 1>&6
11280 else
11281   
11282                                                                 cat > conftest.$ac_ext <<EOF
11283 #line 11284 "configure"
11284 #include "confdefs.h"
11285
11286 #include <pthread.h>
11287 #ifndef NULL
11288 #define NULL (void*)0
11289 #endif
11290
11291 int main() {
11292 pthread_detach(NULL);
11293 ; return 0; }
11294 EOF
11295 if { (eval echo configure:11296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11296   rm -rf conftest*
11297   ol_cv_func_pthread_detach=yes
11298 else
11299   echo "configure: failed program was:" >&5
11300   cat conftest.$ac_ext >&5
11301   rm -rf conftest*
11302   ol_cv_func_pthread_detach=no
11303 fi
11304 rm -f conftest*
11305                         
11306 fi
11307
11308 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11309
11310                         if test $ol_cv_func_pthread_detach = no ; then
11311                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11312                         fi
11313
11314                         cat >> confdefs.h <<\EOF
11315 #define HAVE_PTHREAD_DETACH 1
11316 EOF
11317
11318
11319                                                 for ac_func in \
11320                                 pthread_setconcurrency \
11321                                 pthread_getconcurrency \
11322                                 thr_setconcurrency \
11323                                 thr_getconcurrency \
11324                         
11325 do
11326 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11327 echo "configure:11328: checking for $ac_func" >&5
11328 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11329   echo $ac_n "(cached) $ac_c" 1>&6
11330 else
11331   cat > conftest.$ac_ext <<EOF
11332 #line 11333 "configure"
11333 #include "confdefs.h"
11334 /* System header to define __stub macros and hopefully few prototypes,
11335     which can conflict with char $ac_func(); below.  */
11336 #include <assert.h>
11337 /* Override any gcc2 internal prototype to avoid an error.  */
11338 /* We use char because int might match the return type of a gcc2
11339     builtin and then its argument prototype would still apply.  */
11340 char $ac_func();
11341 char (*f)();
11342
11343 int main() {
11344
11345 /* The GNU C library defines this for functions which it implements
11346     to always fail with ENOSYS.  Some functions are actually named
11347     something starting with __ and the normal name is an alias.  */
11348 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11349 choke me
11350 #else
11351 f = $ac_func;
11352 #endif
11353
11354 ; return 0; }
11355 EOF
11356 if { (eval echo configure:11357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11357   rm -rf conftest*
11358   eval "ac_cv_func_$ac_func=yes"
11359 else
11360   echo "configure: failed program was:" >&5
11361   cat conftest.$ac_ext >&5
11362   rm -rf conftest*
11363   eval "ac_cv_func_$ac_func=no"
11364 fi
11365 rm -f conftest*
11366 fi
11367
11368 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11369   echo "$ac_t""yes" 1>&6
11370     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11371   cat >> confdefs.h <<EOF
11372 #define $ac_tr_func 1
11373 EOF
11374  
11375 else
11376   echo "$ac_t""no" 1>&6
11377 fi
11378 done
11379
11380
11381                         
11382         for ac_func in pthread_kill_other_threads_np
11383 do
11384 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11385 echo "configure:11386: checking for $ac_func" >&5
11386 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11387   echo $ac_n "(cached) $ac_c" 1>&6
11388 else
11389   cat > conftest.$ac_ext <<EOF
11390 #line 11391 "configure"
11391 #include "confdefs.h"
11392 /* System header to define __stub macros and hopefully few prototypes,
11393     which can conflict with char $ac_func(); below.  */
11394 #include <assert.h>
11395 /* Override any gcc2 internal prototype to avoid an error.  */
11396 /* We use char because int might match the return type of a gcc2
11397     builtin and then its argument prototype would still apply.  */
11398 char $ac_func();
11399 char (*f)();
11400
11401 int main() {
11402
11403 /* The GNU C library defines this for functions which it implements
11404     to always fail with ENOSYS.  Some functions are actually named
11405     something starting with __ and the normal name is an alias.  */
11406 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11407 choke me
11408 #else
11409 f = $ac_func;
11410 #endif
11411
11412 ; return 0; }
11413 EOF
11414 if { (eval echo configure:11415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11415   rm -rf conftest*
11416   eval "ac_cv_func_$ac_func=yes"
11417 else
11418   echo "configure: failed program was:" >&5
11419   cat conftest.$ac_ext >&5
11420   rm -rf conftest*
11421   eval "ac_cv_func_$ac_func=no"
11422 fi
11423 rm -f conftest*
11424 fi
11425
11426 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11427   echo "$ac_t""yes" 1>&6
11428     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11429   cat >> confdefs.h <<EOF
11430 #define $ac_tr_func 1
11431 EOF
11432  
11433 else
11434   echo "$ac_t""no" 1>&6
11435 fi
11436 done
11437
11438         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11439 echo "configure:11440: checking for LinuxThreads implementation" >&5
11440 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11441   echo $ac_n "(cached) $ac_c" 1>&6
11442 else
11443   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11444 fi
11445
11446 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11447
11448                         
11449         
11450         
11451         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11452 echo "configure:11453: checking for LinuxThreads consistency" >&5
11453 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11454   echo $ac_n "(cached) $ac_c" 1>&6
11455 else
11456   
11457                 if test $ol_cv_header_linux_threads = yes -a \
11458                         $ol_cv_sys_linux_threads = yes; then
11459                         ol_cv_linux_threads=yes
11460                 elif test $ol_cv_header_linux_threads = no -a \
11461                         $ol_cv_sys_linux_threads = no; then
11462                         ol_cv_linux_threads=no
11463                 else
11464                         ol_cv_linux_threads=error
11465                 fi
11466         
11467 fi
11468
11469 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11470
11471
11472                         if test $ol_cv_linux_threads = error; then
11473                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11474                         fi
11475
11476                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11477 echo "configure:11478: checking if pthread_create() works" >&5
11478 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11479   echo $ac_n "(cached) $ac_c" 1>&6
11480 else
11481   
11482                         if test "$cross_compiling" = yes; then
11483                                 ol_cv_pthread_create_works=yes
11484 else
11485   cat > conftest.$ac_ext <<EOF
11486 #line 11487 "configure"
11487 #include "confdefs.h"
11488 /* pthread test headers */
11489 #include <pthread.h>
11490 #ifndef NULL
11491 #define NULL (void*)0
11492 #endif
11493
11494 static void *task(p)
11495         void *p;
11496 {
11497         return (void *) (p == NULL);
11498 }
11499
11500
11501 int main(argc, argv)
11502         int argc;
11503         char **argv;
11504 {
11505
11506         /* pthread test function */
11507         pthread_t t;
11508         int status;
11509         int detach = 1;
11510
11511 #ifdef HAVE_PTHREADS_FINAL
11512         /* Final pthreads */
11513         pthread_attr_t attr;
11514
11515         status = pthread_attr_init(&attr);
11516         if( status ) return status;
11517
11518 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11519         if( !detach ) {
11520 #if defined( PTHREAD_CREATE_JOINABLE )
11521                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11522 #else
11523                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11524 #endif
11525
11526 #ifdef PTHREAD_CREATE_DETACHED
11527         } else {
11528                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11529 #endif
11530         }
11531         if( status ) return status;
11532 #endif
11533
11534         status = pthread_create( &t, &attr, task, NULL );
11535         if( status ) return status;
11536
11537 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11538         if( detach ) {
11539                 /* give thread a chance to complete */
11540                 /* it should remain joinable and hence detachable */
11541                 sleep( 1 );
11542
11543                 status = pthread_detach( t );
11544                 if( status ) return status;
11545         }
11546 #endif
11547
11548 #else
11549         /* Draft 4 pthreads */
11550         status = pthread_create( &t, pthread_attr_default, task, NULL );
11551         if( status ) return status;
11552
11553         if( detach ) {
11554                 /* give thread a chance to complete */
11555                 /* it should remain joinable and hence detachable */
11556                 sleep( 1 );
11557
11558                 status = pthread_detach( &t );
11559                 if( status ) return status;
11560         }
11561 #endif
11562
11563 #ifdef HAVE_LINUX_THREADS
11564         pthread_kill_other_threads_np();
11565 #endif
11566
11567         return 0;
11568
11569 }
11570
11571 EOF
11572 if { (eval echo configure:11573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11573 then
11574   ol_cv_pthread_create_works=yes
11575 else
11576   echo "configure: failed program was:" >&5
11577   cat conftest.$ac_ext >&5
11578   rm -fr conftest*
11579   ol_cv_pthread_create_works=no
11580 fi
11581 rm -fr conftest*
11582 fi
11583
11584 fi
11585
11586 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11587
11588                         if test $ol_cv_pthread_create_works = no ; then
11589                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11590                         fi
11591
11592                                                 if test $ol_with_yielding_select = auto ; then
11593                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11594 echo "configure:11595: checking if select yields when using pthreads" >&5
11595 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11596   echo $ac_n "(cached) $ac_c" 1>&6
11597 else
11598   
11599                                 if test "$cross_compiling" = yes; then
11600   ol_cv_pthread_select_yields=cross
11601 else
11602   cat > conftest.$ac_ext <<EOF
11603 #line 11604 "configure"
11604 #include "confdefs.h"
11605
11606 #include <sys/types.h>
11607 #include <sys/time.h>
11608 #include <unistd.h>
11609 #include <pthread.h>
11610 #ifndef NULL
11611 #define NULL (void*) 0
11612 #endif
11613
11614 static int fildes[2];
11615
11616 static void *task(p)
11617         void *p;
11618 {
11619         int i;
11620         struct timeval tv;
11621
11622         fd_set rfds;
11623
11624         tv.tv_sec=10;
11625         tv.tv_usec=0;
11626
11627         FD_ZERO(&rfds);
11628         FD_SET(fildes[0], &rfds);
11629
11630         /* we're not interested in any fds */
11631         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11632
11633         if(i < 0) {
11634                 perror("select");
11635                 exit(10);
11636         }
11637
11638         exit(0); /* if we exit here, the select blocked the whole process */
11639 }
11640
11641 int main(argc, argv)
11642         int argc;
11643         char **argv;
11644 {
11645         pthread_t t;
11646
11647         /* create a pipe to select */
11648         if(pipe(&fildes[0])) {
11649                 perror("select");
11650                 exit(1);
11651         }
11652
11653 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11654         (void) pthread_setconcurrency(2);
11655 #else
11656 #ifdef HAVE_THR_SETCONCURRENCY
11657         /* Set Solaris LWP concurrency to 2 */
11658         thr_setconcurrency(2);
11659 #endif
11660 #endif
11661
11662 #if HAVE_PTHREADS_D4
11663         pthread_create(&t, pthread_attr_default, task, NULL);
11664 #else
11665         pthread_create(&t, NULL, task, NULL);
11666 #endif
11667
11668 #if HAVE_SCHED_YIELD
11669         sched_yield();  /* make sure task runs first */
11670 #else
11671 #ifdef HAVE_PTHREAD_YIELD
11672         pthread_yield();        /* make sure task runs first */
11673 #endif
11674 #endif
11675
11676         exit(2);
11677 }
11678 EOF
11679 if { (eval echo configure:11680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11680 then
11681   ol_cv_pthread_select_yields=no
11682 else
11683   echo "configure: failed program was:" >&5
11684   cat conftest.$ac_ext >&5
11685   rm -fr conftest*
11686   ol_cv_pthread_select_yields=yes
11687 fi
11688 rm -fr conftest*
11689 fi
11690
11691 fi
11692
11693 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11694
11695                                 if test $ol_cv_pthread_select_yields = cross ; then
11696                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11697                                 fi
11698
11699                                 if test $ol_cv_pthread_select_yields = yes ; then
11700                                         ol_with_yielding_select=yes
11701                                 fi
11702                         fi
11703
11704                                                 CPPFLAGS="$save_CPPFLAGS"
11705                         LIBS="$save_LIBS"
11706                 else
11707                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
11708                 fi
11709         fi
11710
11711         if test $ol_with_threads = posix ; then
11712                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11713         fi
11714 fi
11715
11716 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11717         -o $ol_with_threads = mach ; then
11718
11719                 for ac_hdr in mach/cthreads.h
11720 do
11721 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11722 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11723 echo "configure:11724: checking for $ac_hdr" >&5
11724 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11725   echo $ac_n "(cached) $ac_c" 1>&6
11726 else
11727   cat > conftest.$ac_ext <<EOF
11728 #line 11729 "configure"
11729 #include "confdefs.h"
11730 #include <$ac_hdr>
11731 EOF
11732 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11733 { (eval echo configure:11734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11734 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11735 if test -z "$ac_err"; then
11736   rm -rf conftest*
11737   eval "ac_cv_header_$ac_safe=yes"
11738 else
11739   echo "$ac_err" >&5
11740   echo "configure: failed program was:" >&5
11741   cat conftest.$ac_ext >&5
11742   rm -rf conftest*
11743   eval "ac_cv_header_$ac_safe=no"
11744 fi
11745 rm -f conftest*
11746 fi
11747 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11748   echo "$ac_t""yes" 1>&6
11749     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11750   cat >> confdefs.h <<EOF
11751 #define $ac_tr_hdr 1
11752 EOF
11753  
11754 else
11755   echo "$ac_t""no" 1>&6
11756 fi
11757 done
11758
11759         if test $ac_cv_header_mach_cthreads_h = yes ; then
11760                 ol_with_threads=found
11761
11762                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11763 echo "configure:11764: checking for cthread_fork" >&5
11764 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11765   echo $ac_n "(cached) $ac_c" 1>&6
11766 else
11767   cat > conftest.$ac_ext <<EOF
11768 #line 11769 "configure"
11769 #include "confdefs.h"
11770 /* System header to define __stub macros and hopefully few prototypes,
11771     which can conflict with char cthread_fork(); below.  */
11772 #include <assert.h>
11773 /* Override any gcc2 internal prototype to avoid an error.  */
11774 /* We use char because int might match the return type of a gcc2
11775     builtin and then its argument prototype would still apply.  */
11776 char cthread_fork();
11777 char (*f)();
11778
11779 int main() {
11780
11781 /* The GNU C library defines this for functions which it implements
11782     to always fail with ENOSYS.  Some functions are actually named
11783     something starting with __ and the normal name is an alias.  */
11784 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11785 choke me
11786 #else
11787 f = cthread_fork;
11788 #endif
11789
11790 ; return 0; }
11791 EOF
11792 if { (eval echo configure:11793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11793   rm -rf conftest*
11794   eval "ac_cv_func_cthread_fork=yes"
11795 else
11796   echo "configure: failed program was:" >&5
11797   cat conftest.$ac_ext >&5
11798   rm -rf conftest*
11799   eval "ac_cv_func_cthread_fork=no"
11800 fi
11801 rm -f conftest*
11802 fi
11803
11804 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11805   echo "$ac_t""yes" 1>&6
11806   ol_link_threads=yes
11807 else
11808   echo "$ac_t""no" 1>&6
11809 fi
11810
11811
11812                 if test $ol_link_threads = no ; then
11813                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11814 echo "configure:11815: checking for cthread_fork with -all_load" >&5
11815 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11816   echo $ac_n "(cached) $ac_c" 1>&6
11817 else
11818   
11819                                                                 save_LIBS="$LIBS"
11820                                 LIBS="-all_load $LIBS"
11821                                 cat > conftest.$ac_ext <<EOF
11822 #line 11823 "configure"
11823 #include "confdefs.h"
11824 #include <mach/cthreads.h>
11825 int main() {
11826
11827                                         cthread_fork((void *)0, (void *)0);
11828                                         
11829 ; return 0; }
11830 EOF
11831 if { (eval echo configure:11832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11832   rm -rf conftest*
11833   ol_cv_cthread_all_load=yes
11834 else
11835   echo "configure: failed program was:" >&5
11836   cat conftest.$ac_ext >&5
11837   rm -rf conftest*
11838   ol_cv_cthread_all_load=no
11839 fi
11840 rm -f conftest*
11841                                                                 LIBS="$save_LIBS"
11842                         
11843 fi
11844
11845 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11846
11847                         if test $ol_cv_cthread_all_load = yes ; then
11848                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11849                                 ol_link_threads=mach
11850                         fi
11851                 fi
11852
11853                 if test $ol_link_threads != no ; then
11854                         : check for cthread specific functionality here
11855                         cat >> confdefs.h <<\EOF
11856 #define HAVE_MACH_CTHREADS 1
11857 EOF
11858
11859                 else
11860                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11861                 fi
11862         fi
11863
11864         if test $ol_with_threads = mach ; then
11865                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11866         fi
11867 fi
11868
11869 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11870         -o $ol_with_threads = pth ; then
11871
11872         for ac_hdr in pth.h
11873 do
11874 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11875 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11876 echo "configure:11877: checking for $ac_hdr" >&5
11877 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11878   echo $ac_n "(cached) $ac_c" 1>&6
11879 else
11880   cat > conftest.$ac_ext <<EOF
11881 #line 11882 "configure"
11882 #include "confdefs.h"
11883 #include <$ac_hdr>
11884 EOF
11885 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11886 { (eval echo configure:11887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11887 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11888 if test -z "$ac_err"; then
11889   rm -rf conftest*
11890   eval "ac_cv_header_$ac_safe=yes"
11891 else
11892   echo "$ac_err" >&5
11893   echo "configure: failed program was:" >&5
11894   cat conftest.$ac_ext >&5
11895   rm -rf conftest*
11896   eval "ac_cv_header_$ac_safe=no"
11897 fi
11898 rm -f conftest*
11899 fi
11900 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11901   echo "$ac_t""yes" 1>&6
11902     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11903   cat >> confdefs.h <<EOF
11904 #define $ac_tr_hdr 1
11905 EOF
11906  
11907 else
11908   echo "$ac_t""no" 1>&6
11909 fi
11910 done
11911
11912
11913         if test $ac_cv_header_pth_h = yes ; then
11914                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11915 echo "configure:11916: checking for pth_version in -lpth" >&5
11916 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11917 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11918   echo $ac_n "(cached) $ac_c" 1>&6
11919 else
11920   ac_save_LIBS="$LIBS"
11921 LIBS="-lpth  $LIBS"
11922 cat > conftest.$ac_ext <<EOF
11923 #line 11924 "configure"
11924 #include "confdefs.h"
11925 /* Override any gcc2 internal prototype to avoid an error.  */
11926 /* We use char because int might match the return type of a gcc2
11927     builtin and then its argument prototype would still apply.  */
11928 char pth_version();
11929
11930 int main() {
11931 pth_version()
11932 ; return 0; }
11933 EOF
11934 if { (eval echo configure:11935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11935   rm -rf conftest*
11936   eval "ac_cv_lib_$ac_lib_var=yes"
11937 else
11938   echo "configure: failed program was:" >&5
11939   cat conftest.$ac_ext >&5
11940   rm -rf conftest*
11941   eval "ac_cv_lib_$ac_lib_var=no"
11942 fi
11943 rm -f conftest*
11944 LIBS="$ac_save_LIBS"
11945
11946 fi
11947 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11948   echo "$ac_t""yes" 1>&6
11949   have_pth=yes
11950 else
11951   echo "$ac_t""no" 1>&6
11952 have_pth=no
11953 fi
11954
11955
11956                 if test $have_pth = yes ; then
11957                         cat >> confdefs.h <<\EOF
11958 #define HAVE_GNU_PTH 1
11959 EOF
11960
11961                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11962                         ol_link_threads=pth
11963
11964                         if test $ol_with_yielding_select = auto ; then
11965                                 ol_with_yielding_select=yes
11966                         fi
11967                 fi
11968         fi
11969 fi
11970
11971 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11972         -o $ol_with_threads = lwp ; then
11973
11974                 for ac_hdr in thread.h synch.h
11975 do
11976 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11977 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11978 echo "configure:11979: checking for $ac_hdr" >&5
11979 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11980   echo $ac_n "(cached) $ac_c" 1>&6
11981 else
11982   cat > conftest.$ac_ext <<EOF
11983 #line 11984 "configure"
11984 #include "confdefs.h"
11985 #include <$ac_hdr>
11986 EOF
11987 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11988 { (eval echo configure:11989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11989 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11990 if test -z "$ac_err"; then
11991   rm -rf conftest*
11992   eval "ac_cv_header_$ac_safe=yes"
11993 else
11994   echo "$ac_err" >&5
11995   echo "configure: failed program was:" >&5
11996   cat conftest.$ac_ext >&5
11997   rm -rf conftest*
11998   eval "ac_cv_header_$ac_safe=no"
11999 fi
12000 rm -f conftest*
12001 fi
12002 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12003   echo "$ac_t""yes" 1>&6
12004     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12005   cat >> confdefs.h <<EOF
12006 #define $ac_tr_hdr 1
12007 EOF
12008  
12009 else
12010   echo "$ac_t""no" 1>&6
12011 fi
12012 done
12013
12014         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
12015                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
12016 echo "configure:12017: checking for thr_create in -lthread" >&5
12017 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
12018 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12019   echo $ac_n "(cached) $ac_c" 1>&6
12020 else
12021   ac_save_LIBS="$LIBS"
12022 LIBS="-lthread  $LIBS"
12023 cat > conftest.$ac_ext <<EOF
12024 #line 12025 "configure"
12025 #include "confdefs.h"
12026 /* Override any gcc2 internal prototype to avoid an error.  */
12027 /* We use char because int might match the return type of a gcc2
12028     builtin and then its argument prototype would still apply.  */
12029 char thr_create();
12030
12031 int main() {
12032 thr_create()
12033 ; return 0; }
12034 EOF
12035 if { (eval echo configure:12036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12036   rm -rf conftest*
12037   eval "ac_cv_lib_$ac_lib_var=yes"
12038 else
12039   echo "configure: failed program was:" >&5
12040   cat conftest.$ac_ext >&5
12041   rm -rf conftest*
12042   eval "ac_cv_lib_$ac_lib_var=no"
12043 fi
12044 rm -f conftest*
12045 LIBS="$ac_save_LIBS"
12046
12047 fi
12048 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12049   echo "$ac_t""yes" 1>&6
12050   have_thr=yes
12051 else
12052   echo "$ac_t""no" 1>&6
12053 have_thr=no
12054 fi
12055
12056
12057                 if test $have_thr = yes ; then
12058                         cat >> confdefs.h <<\EOF
12059 #define HAVE_THR 1
12060 EOF
12061
12062                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
12063                         ol_link_threads=thr
12064
12065                         if test $ol_with_yielding_select = auto ; then
12066                                 ol_with_yielding_select=yes
12067                         fi
12068
12069                                                 for ac_func in \
12070                                 thr_setconcurrency \
12071                                 thr_getconcurrency \
12072                         
12073 do
12074 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12075 echo "configure:12076: checking for $ac_func" >&5
12076 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12077   echo $ac_n "(cached) $ac_c" 1>&6
12078 else
12079   cat > conftest.$ac_ext <<EOF
12080 #line 12081 "configure"
12081 #include "confdefs.h"
12082 /* System header to define __stub macros and hopefully few prototypes,
12083     which can conflict with char $ac_func(); below.  */
12084 #include <assert.h>
12085 /* Override any gcc2 internal prototype to avoid an error.  */
12086 /* We use char because int might match the return type of a gcc2
12087     builtin and then its argument prototype would still apply.  */
12088 char $ac_func();
12089 char (*f)();
12090
12091 int main() {
12092
12093 /* The GNU C library defines this for functions which it implements
12094     to always fail with ENOSYS.  Some functions are actually named
12095     something starting with __ and the normal name is an alias.  */
12096 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12097 choke me
12098 #else
12099 f = $ac_func;
12100 #endif
12101
12102 ; return 0; }
12103 EOF
12104 if { (eval echo configure:12105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12105   rm -rf conftest*
12106   eval "ac_cv_func_$ac_func=yes"
12107 else
12108   echo "configure: failed program was:" >&5
12109   cat conftest.$ac_ext >&5
12110   rm -rf conftest*
12111   eval "ac_cv_func_$ac_func=no"
12112 fi
12113 rm -f conftest*
12114 fi
12115
12116 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12117   echo "$ac_t""yes" 1>&6
12118     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12119   cat >> confdefs.h <<EOF
12120 #define $ac_tr_func 1
12121 EOF
12122  
12123 else
12124   echo "$ac_t""no" 1>&6
12125 fi
12126 done
12127
12128                 fi
12129         fi
12130
12131                 for ac_hdr in lwp/lwp.h
12132 do
12133 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12134 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12135 echo "configure:12136: checking for $ac_hdr" >&5
12136 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12137   echo $ac_n "(cached) $ac_c" 1>&6
12138 else
12139   cat > conftest.$ac_ext <<EOF
12140 #line 12141 "configure"
12141 #include "confdefs.h"
12142 #include <$ac_hdr>
12143 EOF
12144 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12145 { (eval echo configure:12146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12146 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12147 if test -z "$ac_err"; then
12148   rm -rf conftest*
12149   eval "ac_cv_header_$ac_safe=yes"
12150 else
12151   echo "$ac_err" >&5
12152   echo "configure: failed program was:" >&5
12153   cat conftest.$ac_ext >&5
12154   rm -rf conftest*
12155   eval "ac_cv_header_$ac_safe=no"
12156 fi
12157 rm -f conftest*
12158 fi
12159 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12160   echo "$ac_t""yes" 1>&6
12161     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12162   cat >> confdefs.h <<EOF
12163 #define $ac_tr_hdr 1
12164 EOF
12165  
12166 else
12167   echo "$ac_t""no" 1>&6
12168 fi
12169 done
12170
12171         if test $ac_cv_header_lwp_lwp_h = yes ; then
12172                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
12173 echo "configure:12174: checking for lwp_create in -llwp" >&5
12174 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
12175 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12176   echo $ac_n "(cached) $ac_c" 1>&6
12177 else
12178   ac_save_LIBS="$LIBS"
12179 LIBS="-llwp  $LIBS"
12180 cat > conftest.$ac_ext <<EOF
12181 #line 12182 "configure"
12182 #include "confdefs.h"
12183 /* Override any gcc2 internal prototype to avoid an error.  */
12184 /* We use char because int might match the return type of a gcc2
12185     builtin and then its argument prototype would still apply.  */
12186 char lwp_create();
12187
12188 int main() {
12189 lwp_create()
12190 ; return 0; }
12191 EOF
12192 if { (eval echo configure:12193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12193   rm -rf conftest*
12194   eval "ac_cv_lib_$ac_lib_var=yes"
12195 else
12196   echo "configure: failed program was:" >&5
12197   cat conftest.$ac_ext >&5
12198   rm -rf conftest*
12199   eval "ac_cv_lib_$ac_lib_var=no"
12200 fi
12201 rm -f conftest*
12202 LIBS="$ac_save_LIBS"
12203
12204 fi
12205 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12206   echo "$ac_t""yes" 1>&6
12207   have_lwp=yes
12208 else
12209   echo "$ac_t""no" 1>&6
12210 have_lwp=no
12211 fi
12212
12213
12214                 if test $have_lwp = yes ; then
12215                         cat >> confdefs.h <<\EOF
12216 #define HAVE_LWP 1
12217 EOF
12218
12219                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12220                         ol_link_threads=lwp
12221
12222                         if test $ol_with_yielding_select = auto ; then
12223                                 ol_with_yielding_select=no
12224                         fi
12225                 fi
12226         fi
12227 fi
12228
12229 if test $ol_with_yielding_select = yes ; then
12230         cat >> confdefs.h <<\EOF
12231 #define HAVE_YIELDING_SELECT 1
12232 EOF
12233
12234 fi
12235
12236 if test $ol_with_threads = manual ; then
12237                 ol_link_threads=yes
12238
12239         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12240
12241         for ac_hdr in pthread.h sched.h
12242 do
12243 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12244 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12245 echo "configure:12246: checking for $ac_hdr" >&5
12246 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12247   echo $ac_n "(cached) $ac_c" 1>&6
12248 else
12249   cat > conftest.$ac_ext <<EOF
12250 #line 12251 "configure"
12251 #include "confdefs.h"
12252 #include <$ac_hdr>
12253 EOF
12254 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12255 { (eval echo configure:12256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12256 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12257 if test -z "$ac_err"; then
12258   rm -rf conftest*
12259   eval "ac_cv_header_$ac_safe=yes"
12260 else
12261   echo "$ac_err" >&5
12262   echo "configure: failed program was:" >&5
12263   cat conftest.$ac_ext >&5
12264   rm -rf conftest*
12265   eval "ac_cv_header_$ac_safe=no"
12266 fi
12267 rm -f conftest*
12268 fi
12269 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12270   echo "$ac_t""yes" 1>&6
12271     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12272   cat >> confdefs.h <<EOF
12273 #define $ac_tr_hdr 1
12274 EOF
12275  
12276 else
12277   echo "$ac_t""no" 1>&6
12278 fi
12279 done
12280
12281         for ac_func in sched_yield pthread_yield
12282 do
12283 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12284 echo "configure:12285: checking for $ac_func" >&5
12285 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12286   echo $ac_n "(cached) $ac_c" 1>&6
12287 else
12288   cat > conftest.$ac_ext <<EOF
12289 #line 12290 "configure"
12290 #include "confdefs.h"
12291 /* System header to define __stub macros and hopefully few prototypes,
12292     which can conflict with char $ac_func(); below.  */
12293 #include <assert.h>
12294 /* Override any gcc2 internal prototype to avoid an error.  */
12295 /* We use char because int might match the return type of a gcc2
12296     builtin and then its argument prototype would still apply.  */
12297 char $ac_func();
12298 char (*f)();
12299
12300 int main() {
12301
12302 /* The GNU C library defines this for functions which it implements
12303     to always fail with ENOSYS.  Some functions are actually named
12304     something starting with __ and the normal name is an alias.  */
12305 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12306 choke me
12307 #else
12308 f = $ac_func;
12309 #endif
12310
12311 ; return 0; }
12312 EOF
12313 if { (eval echo configure:12314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12314   rm -rf conftest*
12315   eval "ac_cv_func_$ac_func=yes"
12316 else
12317   echo "configure: failed program was:" >&5
12318   cat conftest.$ac_ext >&5
12319   rm -rf conftest*
12320   eval "ac_cv_func_$ac_func=no"
12321 fi
12322 rm -f conftest*
12323 fi
12324
12325 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12326   echo "$ac_t""yes" 1>&6
12327     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12328   cat >> confdefs.h <<EOF
12329 #define $ac_tr_func 1
12330 EOF
12331  
12332 else
12333   echo "$ac_t""no" 1>&6
12334 fi
12335 done
12336
12337         
12338         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12339 echo "configure:12340: checking for LinuxThreads pthread.h" >&5
12340 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12341   echo $ac_n "(cached) $ac_c" 1>&6
12342 else
12343   cat > conftest.$ac_ext <<EOF
12344 #line 12345 "configure"
12345 #include "confdefs.h"
12346 #include <pthread.h>
12347 EOF
12348 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12349   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12350   rm -rf conftest*
12351   ol_cv_header_linux_threads=yes
12352 else
12353   rm -rf conftest*
12354   ol_cv_header_linux_threads=no
12355 fi
12356 rm -f conftest*
12357
12358                 
12359 fi
12360
12361 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12362         if test $ol_cv_header_linux_threads = yes; then
12363                 cat >> confdefs.h <<\EOF
12364 #define HAVE_LINUX_THREADS 1
12365 EOF
12366
12367         fi
12368
12369
12370         for ac_hdr in mach/cthreads.h
12371 do
12372 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12373 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12374 echo "configure:12375: checking for $ac_hdr" >&5
12375 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12376   echo $ac_n "(cached) $ac_c" 1>&6
12377 else
12378   cat > conftest.$ac_ext <<EOF
12379 #line 12380 "configure"
12380 #include "confdefs.h"
12381 #include <$ac_hdr>
12382 EOF
12383 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12384 { (eval echo configure:12385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12385 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12386 if test -z "$ac_err"; then
12387   rm -rf conftest*
12388   eval "ac_cv_header_$ac_safe=yes"
12389 else
12390   echo "$ac_err" >&5
12391   echo "configure: failed program was:" >&5
12392   cat conftest.$ac_ext >&5
12393   rm -rf conftest*
12394   eval "ac_cv_header_$ac_safe=no"
12395 fi
12396 rm -f conftest*
12397 fi
12398 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12399   echo "$ac_t""yes" 1>&6
12400     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12401   cat >> confdefs.h <<EOF
12402 #define $ac_tr_hdr 1
12403 EOF
12404  
12405 else
12406   echo "$ac_t""no" 1>&6
12407 fi
12408 done
12409
12410         for ac_hdr in lwp/lwp.h
12411 do
12412 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12413 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12414 echo "configure:12415: checking for $ac_hdr" >&5
12415 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12416   echo $ac_n "(cached) $ac_c" 1>&6
12417 else
12418   cat > conftest.$ac_ext <<EOF
12419 #line 12420 "configure"
12420 #include "confdefs.h"
12421 #include <$ac_hdr>
12422 EOF
12423 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12424 { (eval echo configure:12425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12425 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12426 if test -z "$ac_err"; then
12427   rm -rf conftest*
12428   eval "ac_cv_header_$ac_safe=yes"
12429 else
12430   echo "$ac_err" >&5
12431   echo "configure: failed program was:" >&5
12432   cat conftest.$ac_ext >&5
12433   rm -rf conftest*
12434   eval "ac_cv_header_$ac_safe=no"
12435 fi
12436 rm -f conftest*
12437 fi
12438 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12439   echo "$ac_t""yes" 1>&6
12440     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12441   cat >> confdefs.h <<EOF
12442 #define $ac_tr_hdr 1
12443 EOF
12444  
12445 else
12446   echo "$ac_t""no" 1>&6
12447 fi
12448 done
12449
12450         for ac_hdr in thread.h synch.h
12451 do
12452 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12453 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12454 echo "configure:12455: checking for $ac_hdr" >&5
12455 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12456   echo $ac_n "(cached) $ac_c" 1>&6
12457 else
12458   cat > conftest.$ac_ext <<EOF
12459 #line 12460 "configure"
12460 #include "confdefs.h"
12461 #include <$ac_hdr>
12462 EOF
12463 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12464 { (eval echo configure:12465: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12465 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12466 if test -z "$ac_err"; then
12467   rm -rf conftest*
12468   eval "ac_cv_header_$ac_safe=yes"
12469 else
12470   echo "$ac_err" >&5
12471   echo "configure: failed program was:" >&5
12472   cat conftest.$ac_ext >&5
12473   rm -rf conftest*
12474   eval "ac_cv_header_$ac_safe=no"
12475 fi
12476 rm -f conftest*
12477 fi
12478 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12479   echo "$ac_t""yes" 1>&6
12480     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12481   cat >> confdefs.h <<EOF
12482 #define $ac_tr_hdr 1
12483 EOF
12484  
12485 else
12486   echo "$ac_t""no" 1>&6
12487 fi
12488 done
12489
12490 fi
12491
12492 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12493                         cat >> confdefs.h <<\EOF
12494 #define REENTRANT 1
12495 EOF
12496
12497         cat >> confdefs.h <<\EOF
12498 #define _REENTRANT 1
12499 EOF
12500
12501         cat >> confdefs.h <<\EOF
12502 #define THREAD_SAFE 1
12503 EOF
12504
12505         cat >> confdefs.h <<\EOF
12506 #define _THREAD_SAFE 1
12507 EOF
12508
12509         cat >> confdefs.h <<\EOF
12510 #define THREADSAFE 1
12511 EOF
12512
12513         cat >> confdefs.h <<\EOF
12514 #define _THREADSAFE 1
12515 EOF
12516
12517         cat >> confdefs.h <<\EOF
12518 #define _SGI_MP_SOURCE 1
12519 EOF
12520
12521
12522                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12523 echo "configure:12524: checking for thread specific errno" >&5
12524 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12525   echo $ac_n "(cached) $ac_c" 1>&6
12526 else
12527   
12528                 cat > conftest.$ac_ext <<EOF
12529 #line 12530 "configure"
12530 #include "confdefs.h"
12531 #include <errno.h>
12532 int main() {
12533 errno = 0;
12534 ; return 0; }
12535 EOF
12536 if { (eval echo configure:12537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12537   rm -rf conftest*
12538   ol_cv_errno_thread_specific=yes
12539 else
12540   echo "configure: failed program was:" >&5
12541   cat conftest.$ac_ext >&5
12542   rm -rf conftest*
12543   ol_cv_errno_thread_specific=no
12544 fi
12545 rm -f conftest*
12546         
12547 fi
12548
12549 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12550
12551                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12552 echo "configure:12553: checking for thread specific h_errno" >&5
12553 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12554   echo $ac_n "(cached) $ac_c" 1>&6
12555 else
12556   
12557                 cat > conftest.$ac_ext <<EOF
12558 #line 12559 "configure"
12559 #include "confdefs.h"
12560 #include <netdb.h>
12561 int main() {
12562 h_errno = 0;
12563 ; return 0; }
12564 EOF
12565 if { (eval echo configure:12566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12566   rm -rf conftest*
12567   ol_cv_h_errno_thread_specific=yes
12568 else
12569   echo "configure: failed program was:" >&5
12570   cat conftest.$ac_ext >&5
12571   rm -rf conftest*
12572   ol_cv_h_errno_thread_specific=no
12573 fi
12574 rm -f conftest*
12575         
12576 fi
12577
12578 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12579
12580         if test $ol_cv_errno_thread_specific != yes \
12581                 -o $ol_cv_h_errno_thread_specific != yes ; then
12582                 LIBS="$LTHREAD_LIBS $LIBS"
12583                 LTHREAD_LIBS=""
12584         fi
12585
12586 fi  
12587
12588 if test $ol_link_threads = no ; then
12589         if test $ol_with_threads = yes ; then
12590                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12591         fi
12592
12593         if test $ol_with_threads = auto ; then
12594                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12595                 ol_with_threads=no
12596         fi
12597
12598         cat >> confdefs.h <<\EOF
12599 #define NO_THREADS 1
12600 EOF
12601
12602         LTHREAD_LIBS=""
12603 fi
12604
12605 if test $ol_link_threads != no ; then
12606         cat >> confdefs.h <<\EOF
12607 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12608 EOF
12609
12610 fi
12611
12612 ol_link_ldbm=no 
12613
12614 if test $ol_with_ldbm_api = auto \
12615         -o $ol_with_ldbm_api = berkeley \
12616         -o $ol_with_ldbm_api = bcompat ; then
12617
12618         if test $ol_with_ldbm_api = bcompat; then \
12619                 ol_cv_berkeley_db=no
12620 for ac_hdr in db_185.h db.h
12621 do
12622 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12623 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12624 echo "configure:12625: checking for $ac_hdr" >&5
12625 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12626   echo $ac_n "(cached) $ac_c" 1>&6
12627 else
12628   cat > conftest.$ac_ext <<EOF
12629 #line 12630 "configure"
12630 #include "confdefs.h"
12631 #include <$ac_hdr>
12632 EOF
12633 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12634 { (eval echo configure:12635: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12635 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12636 if test -z "$ac_err"; then
12637   rm -rf conftest*
12638   eval "ac_cv_header_$ac_safe=yes"
12639 else
12640   echo "$ac_err" >&5
12641   echo "configure: failed program was:" >&5
12642   cat conftest.$ac_ext >&5
12643   rm -rf conftest*
12644   eval "ac_cv_header_$ac_safe=no"
12645 fi
12646 rm -f conftest*
12647 fi
12648 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12649   echo "$ac_t""yes" 1>&6
12650     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12651   cat >> confdefs.h <<EOF
12652 #define $ac_tr_hdr 1
12653 EOF
12654  
12655 else
12656   echo "$ac_t""no" 1>&6
12657 fi
12658 done
12659
12660 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12661         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12662 echo "configure:12663: checking if Berkeley DB header compatibility" >&5
12663 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12664   echo $ac_n "(cached) $ac_c" 1>&6
12665 else
12666   
12667                 cat > conftest.$ac_ext <<EOF
12668 #line 12669 "configure"
12669 #include "confdefs.h"
12670
12671 #if HAVE_DB_185_H
12672 #       include <db_185.h>
12673 #else
12674 #       include <db.h>
12675 #endif
12676
12677  /* this check could be improved */
12678 #ifndef DB_VERSION_MAJOR
12679 #       define DB_VERSION_MAJOR 1
12680 #endif
12681
12682 #if DB_VERSION_MAJOR == 1 
12683         __db_version_1
12684 #endif
12685
12686 EOF
12687 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12688   egrep "__db_version_1" >/dev/null 2>&1; then
12689   rm -rf conftest*
12690   ol_cv_header_db1=yes
12691 else
12692   rm -rf conftest*
12693   ol_cv_header_db1=no
12694 fi
12695 rm -f conftest*
12696
12697 fi
12698
12699 echo "$ac_t""$ol_cv_header_db1" 1>&6
12700
12701         if test ol_cv_header_db1=yes ; then
12702                 ol_cv_lib_db=no
12703 if test $ol_cv_lib_db = no ; then
12704         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12705 echo "configure:12706: checking for Berkeley DB link (default)" >&5
12706 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12707   echo $ac_n "(cached) $ac_c" 1>&6
12708 else
12709   
12710         ol_DB_LIB=
12711         ol_LIBS=$LIBS
12712         LIBS="$ol_DB_LIB $LIBS"
12713
12714         cat > conftest.$ac_ext <<EOF
12715 #line 12716 "configure"
12716 #include "confdefs.h"
12717
12718 #ifdef HAVE_DB_185_H
12719 # include <db_185.h>
12720 #else
12721 # include <db.h>
12722 #endif
12723
12724 #ifndef DB_VERSION_MAJOR
12725 # define DB_VERSION_MAJOR 1
12726 #endif
12727
12728 #ifndef NULL
12729 #define NULL ((void*)0)
12730 #endif
12731
12732 int main() {
12733
12734 #if DB_VERSION_MAJOR > 1
12735         {
12736                 char *version;
12737                 int major, minor, patch;
12738
12739                 version = db_version( &major, &minor, &patch );
12740
12741                 if( major != DB_VERSION_MAJOR ||
12742                         minor < DB_VERSION_MINOR )
12743                 {
12744                         printf("Berkeley DB version mismatch\n"
12745                                 "\texpected: %s\n\tgot: %s\n",
12746                                 DB_VERSION_STRING, version);
12747                         return 1;
12748                 }
12749         }
12750 #endif
12751
12752 #if DB_VERSION_MAJOR > 2
12753         db_env_create( NULL, 0 );
12754 #elif DB_VERSION_MAJOR > 1
12755         db_appexit( NULL );
12756 #else
12757         (void) dbopen( NULL, 0, 0, 0, NULL);
12758 #endif
12759
12760 ; return 0; }
12761 EOF
12762 if { (eval echo configure:12763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12763   rm -rf conftest*
12764   ol_cv_db_none=yes
12765 else
12766   echo "configure: failed program was:" >&5
12767   cat conftest.$ac_ext >&5
12768   rm -rf conftest*
12769   ol_cv_db_none=no
12770 fi
12771 rm -f conftest*
12772
12773         LIBS="$ol_LIBS"
12774
12775 fi
12776
12777 echo "$ac_t""$ol_cv_db_none" 1>&6
12778
12779         if test $ol_cv_db_none = yes ; then
12780                 ol_cv_lib_db=yes
12781         fi
12782 fi
12783
12784 if test $ol_cv_lib_db = no ; then
12785         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12786 echo "configure:12787: checking for Berkeley DB link (-ldb)" >&5
12787 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12788   echo $ac_n "(cached) $ac_c" 1>&6
12789 else
12790   
12791         ol_DB_LIB=-ldb
12792         ol_LIBS=$LIBS
12793         LIBS="$ol_DB_LIB $LIBS"
12794
12795         cat > conftest.$ac_ext <<EOF
12796 #line 12797 "configure"
12797 #include "confdefs.h"
12798
12799 #ifdef HAVE_DB_185_H
12800 # include <db_185.h>
12801 #else
12802 # include <db.h>
12803 #endif
12804
12805 #ifndef DB_VERSION_MAJOR
12806 # define DB_VERSION_MAJOR 1
12807 #endif
12808
12809 #ifndef NULL
12810 #define NULL ((void*)0)
12811 #endif
12812
12813 int main() {
12814
12815 #if DB_VERSION_MAJOR > 1
12816         {
12817                 char *version;
12818                 int major, minor, patch;
12819
12820                 version = db_version( &major, &minor, &patch );
12821
12822                 if( major != DB_VERSION_MAJOR ||
12823                         minor < DB_VERSION_MINOR )
12824                 {
12825                         printf("Berkeley DB version mismatch\n"
12826                                 "\texpected: %s\n\tgot: %s\n",
12827                                 DB_VERSION_STRING, version);
12828                         return 1;
12829                 }
12830         }
12831 #endif
12832
12833 #if DB_VERSION_MAJOR > 2
12834         db_env_create( NULL, 0 );
12835 #elif DB_VERSION_MAJOR > 1
12836         db_appexit( NULL );
12837 #else
12838         (void) dbopen( NULL, 0, 0, 0, NULL);
12839 #endif
12840
12841 ; return 0; }
12842 EOF
12843 if { (eval echo configure:12844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12844   rm -rf conftest*
12845   ol_cv_db_db=yes
12846 else
12847   echo "configure: failed program was:" >&5
12848   cat conftest.$ac_ext >&5
12849   rm -rf conftest*
12850   ol_cv_db_db=no
12851 fi
12852 rm -f conftest*
12853
12854         LIBS="$ol_LIBS"
12855
12856 fi
12857
12858 echo "$ac_t""$ol_cv_db_db" 1>&6
12859
12860         if test $ol_cv_db_db = yes ; then
12861                 ol_cv_lib_db=-ldb
12862         fi
12863 fi
12864
12865 if test $ol_cv_lib_db = no ; then
12866         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12867 echo "configure:12868: checking for Berkeley DB link (-ldb3)" >&5
12868 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12869   echo $ac_n "(cached) $ac_c" 1>&6
12870 else
12871   
12872         ol_DB_LIB=-ldb3
12873         ol_LIBS=$LIBS
12874         LIBS="$ol_DB_LIB $LIBS"
12875
12876         cat > conftest.$ac_ext <<EOF
12877 #line 12878 "configure"
12878 #include "confdefs.h"
12879
12880 #ifdef HAVE_DB_185_H
12881 # include <db_185.h>
12882 #else
12883 # include <db.h>
12884 #endif
12885
12886 #ifndef DB_VERSION_MAJOR
12887 # define DB_VERSION_MAJOR 1
12888 #endif
12889
12890 #ifndef NULL
12891 #define NULL ((void*)0)
12892 #endif
12893
12894 int main() {
12895
12896 #if DB_VERSION_MAJOR > 1
12897         {
12898                 char *version;
12899                 int major, minor, patch;
12900
12901                 version = db_version( &major, &minor, &patch );
12902
12903                 if( major != DB_VERSION_MAJOR ||
12904                         minor < DB_VERSION_MINOR )
12905                 {
12906                         printf("Berkeley DB version mismatch\n"
12907                                 "\texpected: %s\n\tgot: %s\n",
12908                                 DB_VERSION_STRING, version);
12909                         return 1;
12910                 }
12911         }
12912 #endif
12913
12914 #if DB_VERSION_MAJOR > 2
12915         db_env_create( NULL, 0 );
12916 #elif DB_VERSION_MAJOR > 1
12917         db_appexit( NULL );
12918 #else
12919         (void) dbopen( NULL, 0, 0, 0, NULL);
12920 #endif
12921
12922 ; return 0; }
12923 EOF
12924 if { (eval echo configure:12925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12925   rm -rf conftest*
12926   ol_cv_db_db3=yes
12927 else
12928   echo "configure: failed program was:" >&5
12929   cat conftest.$ac_ext >&5
12930   rm -rf conftest*
12931   ol_cv_db_db3=no
12932 fi
12933 rm -f conftest*
12934
12935         LIBS="$ol_LIBS"
12936
12937 fi
12938
12939 echo "$ac_t""$ol_cv_db_db3" 1>&6
12940
12941         if test $ol_cv_db_db3 = yes ; then
12942                 ol_cv_lib_db=-ldb3
12943         fi
12944 fi
12945
12946 if test $ol_cv_lib_db = no ; then
12947         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12948 echo "configure:12949: checking for Berkeley DB link (-ldb2)" >&5
12949 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12950   echo $ac_n "(cached) $ac_c" 1>&6
12951 else
12952   
12953         ol_DB_LIB=-ldb2
12954         ol_LIBS=$LIBS
12955         LIBS="$ol_DB_LIB $LIBS"
12956
12957         cat > conftest.$ac_ext <<EOF
12958 #line 12959 "configure"
12959 #include "confdefs.h"
12960
12961 #ifdef HAVE_DB_185_H
12962 # include <db_185.h>
12963 #else
12964 # include <db.h>
12965 #endif
12966
12967 #ifndef DB_VERSION_MAJOR
12968 # define DB_VERSION_MAJOR 1
12969 #endif
12970
12971 #ifndef NULL
12972 #define NULL ((void*)0)
12973 #endif
12974
12975 int main() {
12976
12977 #if DB_VERSION_MAJOR > 1
12978         {
12979                 char *version;
12980                 int major, minor, patch;
12981
12982                 version = db_version( &major, &minor, &patch );
12983
12984                 if( major != DB_VERSION_MAJOR ||
12985                         minor < DB_VERSION_MINOR )
12986                 {
12987                         printf("Berkeley DB version mismatch\n"
12988                                 "\texpected: %s\n\tgot: %s\n",
12989                                 DB_VERSION_STRING, version);
12990                         return 1;
12991                 }
12992         }
12993 #endif
12994
12995 #if DB_VERSION_MAJOR > 2
12996         db_env_create( NULL, 0 );
12997 #elif DB_VERSION_MAJOR > 1
12998         db_appexit( NULL );
12999 #else
13000         (void) dbopen( NULL, 0, 0, 0, NULL);
13001 #endif
13002
13003 ; return 0; }
13004 EOF
13005 if { (eval echo configure:13006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13006   rm -rf conftest*
13007   ol_cv_db_db2=yes
13008 else
13009   echo "configure: failed program was:" >&5
13010   cat conftest.$ac_ext >&5
13011   rm -rf conftest*
13012   ol_cv_db_db2=no
13013 fi
13014 rm -f conftest*
13015
13016         LIBS="$ol_LIBS"
13017
13018 fi
13019
13020 echo "$ac_t""$ol_cv_db_db2" 1>&6
13021
13022         if test $ol_cv_db_db2 = yes ; then
13023                 ol_cv_lib_db=-ldb2
13024         fi
13025 fi
13026
13027 if test $ol_cv_lib_db = no ; then
13028         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13029 echo "configure:13030: checking for Berkeley DB link (-ldb1)" >&5
13030 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13031   echo $ac_n "(cached) $ac_c" 1>&6
13032 else
13033   
13034         ol_DB_LIB=-ldb1
13035         ol_LIBS=$LIBS
13036         LIBS="$ol_DB_LIB $LIBS"
13037
13038         cat > conftest.$ac_ext <<EOF
13039 #line 13040 "configure"
13040 #include "confdefs.h"
13041
13042 #ifdef HAVE_DB_185_H
13043 # include <db_185.h>
13044 #else
13045 # include <db.h>
13046 #endif
13047
13048 #ifndef DB_VERSION_MAJOR
13049 # define DB_VERSION_MAJOR 1
13050 #endif
13051
13052 #ifndef NULL
13053 #define NULL ((void*)0)
13054 #endif
13055
13056 int main() {
13057
13058 #if DB_VERSION_MAJOR > 1
13059         {
13060                 char *version;
13061                 int major, minor, patch;
13062
13063                 version = db_version( &major, &minor, &patch );
13064
13065                 if( major != DB_VERSION_MAJOR ||
13066                         minor < DB_VERSION_MINOR )
13067                 {
13068                         printf("Berkeley DB version mismatch\n"
13069                                 "\texpected: %s\n\tgot: %s\n",
13070                                 DB_VERSION_STRING, version);
13071                         return 1;
13072                 }
13073         }
13074 #endif
13075
13076 #if DB_VERSION_MAJOR > 2
13077         db_env_create( NULL, 0 );
13078 #elif DB_VERSION_MAJOR > 1
13079         db_appexit( NULL );
13080 #else
13081         (void) dbopen( NULL, 0, 0, 0, NULL);
13082 #endif
13083
13084 ; return 0; }
13085 EOF
13086 if { (eval echo configure:13087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13087   rm -rf conftest*
13088   ol_cv_db_db1=yes
13089 else
13090   echo "configure: failed program was:" >&5
13091   cat conftest.$ac_ext >&5
13092   rm -rf conftest*
13093   ol_cv_db_db1=no
13094 fi
13095 rm -f conftest*
13096
13097         LIBS="$ol_LIBS"
13098
13099 fi
13100
13101 echo "$ac_t""$ol_cv_db_db1" 1>&6
13102
13103         if test $ol_cv_db_db1 = yes ; then
13104                 ol_cv_lib_db=-ldb1
13105         fi
13106 fi
13107
13108
13109                 if test "$ol_cv_lib_db" != no ; then
13110                         ol_cv_berkeley_db=yes
13111                 fi
13112         fi
13113 fi
13114
13115         else
13116                 ol_cv_berkeley_db=no
13117 for ac_hdr in db.h
13118 do
13119 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13120 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13121 echo "configure:13122: checking for $ac_hdr" >&5
13122 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13123   echo $ac_n "(cached) $ac_c" 1>&6
13124 else
13125   cat > conftest.$ac_ext <<EOF
13126 #line 13127 "configure"
13127 #include "confdefs.h"
13128 #include <$ac_hdr>
13129 EOF
13130 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13131 { (eval echo configure:13132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13132 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13133 if test -z "$ac_err"; then
13134   rm -rf conftest*
13135   eval "ac_cv_header_$ac_safe=yes"
13136 else
13137   echo "$ac_err" >&5
13138   echo "configure: failed program was:" >&5
13139   cat conftest.$ac_ext >&5
13140   rm -rf conftest*
13141   eval "ac_cv_header_$ac_safe=no"
13142 fi
13143 rm -f conftest*
13144 fi
13145 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13146   echo "$ac_t""yes" 1>&6
13147     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13148   cat >> confdefs.h <<EOF
13149 #define $ac_tr_hdr 1
13150 EOF
13151  
13152 else
13153   echo "$ac_t""no" 1>&6
13154 fi
13155 done
13156
13157 if test $ac_cv_header_db_h = yes; then
13158         ol_cv_lib_db=no
13159 if test $ol_cv_lib_db = no ; then
13160         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13161 echo "configure:13162: checking for Berkeley DB link (default)" >&5
13162 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13163   echo $ac_n "(cached) $ac_c" 1>&6
13164 else
13165   
13166         ol_DB_LIB=
13167         ol_LIBS=$LIBS
13168         LIBS="$ol_DB_LIB $LIBS"
13169
13170         cat > conftest.$ac_ext <<EOF
13171 #line 13172 "configure"
13172 #include "confdefs.h"
13173
13174 #ifdef HAVE_DB_185_H
13175 # include <db_185.h>
13176 #else
13177 # include <db.h>
13178 #endif
13179
13180 #ifndef DB_VERSION_MAJOR
13181 # define DB_VERSION_MAJOR 1
13182 #endif
13183
13184 #ifndef NULL
13185 #define NULL ((void*)0)
13186 #endif
13187
13188 int main() {
13189
13190 #if DB_VERSION_MAJOR > 1
13191         {
13192                 char *version;
13193                 int major, minor, patch;
13194
13195                 version = db_version( &major, &minor, &patch );
13196
13197                 if( major != DB_VERSION_MAJOR ||
13198                         minor < DB_VERSION_MINOR )
13199                 {
13200                         printf("Berkeley DB version mismatch\n"
13201                                 "\texpected: %s\n\tgot: %s\n",
13202                                 DB_VERSION_STRING, version);
13203                         return 1;
13204                 }
13205         }
13206 #endif
13207
13208 #if DB_VERSION_MAJOR > 2
13209         db_env_create( NULL, 0 );
13210 #elif DB_VERSION_MAJOR > 1
13211         db_appexit( NULL );
13212 #else
13213         (void) dbopen( NULL, 0, 0, 0, NULL);
13214 #endif
13215
13216 ; return 0; }
13217 EOF
13218 if { (eval echo configure:13219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13219   rm -rf conftest*
13220   ol_cv_db_none=yes
13221 else
13222   echo "configure: failed program was:" >&5
13223   cat conftest.$ac_ext >&5
13224   rm -rf conftest*
13225   ol_cv_db_none=no
13226 fi
13227 rm -f conftest*
13228
13229         LIBS="$ol_LIBS"
13230
13231 fi
13232
13233 echo "$ac_t""$ol_cv_db_none" 1>&6
13234
13235         if test $ol_cv_db_none = yes ; then
13236                 ol_cv_lib_db=yes
13237         fi
13238 fi
13239
13240 if test $ol_cv_lib_db = no ; then
13241         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13242 echo "configure:13243: checking for Berkeley DB link (-ldb)" >&5
13243 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13244   echo $ac_n "(cached) $ac_c" 1>&6
13245 else
13246   
13247         ol_DB_LIB=-ldb
13248         ol_LIBS=$LIBS
13249         LIBS="$ol_DB_LIB $LIBS"
13250
13251         cat > conftest.$ac_ext <<EOF
13252 #line 13253 "configure"
13253 #include "confdefs.h"
13254
13255 #ifdef HAVE_DB_185_H
13256 # include <db_185.h>
13257 #else
13258 # include <db.h>
13259 #endif
13260
13261 #ifndef DB_VERSION_MAJOR
13262 # define DB_VERSION_MAJOR 1
13263 #endif
13264
13265 #ifndef NULL
13266 #define NULL ((void*)0)
13267 #endif
13268
13269 int main() {
13270
13271 #if DB_VERSION_MAJOR > 1
13272         {
13273                 char *version;
13274                 int major, minor, patch;
13275
13276                 version = db_version( &major, &minor, &patch );
13277
13278                 if( major != DB_VERSION_MAJOR ||
13279                         minor < DB_VERSION_MINOR )
13280                 {
13281                         printf("Berkeley DB version mismatch\n"
13282                                 "\texpected: %s\n\tgot: %s\n",
13283                                 DB_VERSION_STRING, version);
13284                         return 1;
13285                 }
13286         }
13287 #endif
13288
13289 #if DB_VERSION_MAJOR > 2
13290         db_env_create( NULL, 0 );
13291 #elif DB_VERSION_MAJOR > 1
13292         db_appexit( NULL );
13293 #else
13294         (void) dbopen( NULL, 0, 0, 0, NULL);
13295 #endif
13296
13297 ; return 0; }
13298 EOF
13299 if { (eval echo configure:13300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13300   rm -rf conftest*
13301   ol_cv_db_db=yes
13302 else
13303   echo "configure: failed program was:" >&5
13304   cat conftest.$ac_ext >&5
13305   rm -rf conftest*
13306   ol_cv_db_db=no
13307 fi
13308 rm -f conftest*
13309
13310         LIBS="$ol_LIBS"
13311
13312 fi
13313
13314 echo "$ac_t""$ol_cv_db_db" 1>&6
13315
13316         if test $ol_cv_db_db = yes ; then
13317                 ol_cv_lib_db=-ldb
13318         fi
13319 fi
13320
13321 if test $ol_cv_lib_db = no ; then
13322         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13323 echo "configure:13324: checking for Berkeley DB link (-ldb3)" >&5
13324 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13325   echo $ac_n "(cached) $ac_c" 1>&6
13326 else
13327   
13328         ol_DB_LIB=-ldb3
13329         ol_LIBS=$LIBS
13330         LIBS="$ol_DB_LIB $LIBS"
13331
13332         cat > conftest.$ac_ext <<EOF
13333 #line 13334 "configure"
13334 #include "confdefs.h"
13335
13336 #ifdef HAVE_DB_185_H
13337 # include <db_185.h>
13338 #else
13339 # include <db.h>
13340 #endif
13341
13342 #ifndef DB_VERSION_MAJOR
13343 # define DB_VERSION_MAJOR 1
13344 #endif
13345
13346 #ifndef NULL
13347 #define NULL ((void*)0)
13348 #endif
13349
13350 int main() {
13351
13352 #if DB_VERSION_MAJOR > 1
13353         {
13354                 char *version;
13355                 int major, minor, patch;
13356
13357                 version = db_version( &major, &minor, &patch );
13358
13359                 if( major != DB_VERSION_MAJOR ||
13360                         minor < DB_VERSION_MINOR )
13361                 {
13362                         printf("Berkeley DB version mismatch\n"
13363                                 "\texpected: %s\n\tgot: %s\n",
13364                                 DB_VERSION_STRING, version);
13365                         return 1;
13366                 }
13367         }
13368 #endif
13369
13370 #if DB_VERSION_MAJOR > 2
13371         db_env_create( NULL, 0 );
13372 #elif DB_VERSION_MAJOR > 1
13373         db_appexit( NULL );
13374 #else
13375         (void) dbopen( NULL, 0, 0, 0, NULL);
13376 #endif
13377
13378 ; return 0; }
13379 EOF
13380 if { (eval echo configure:13381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13381   rm -rf conftest*
13382   ol_cv_db_db3=yes
13383 else
13384   echo "configure: failed program was:" >&5
13385   cat conftest.$ac_ext >&5
13386   rm -rf conftest*
13387   ol_cv_db_db3=no
13388 fi
13389 rm -f conftest*
13390
13391         LIBS="$ol_LIBS"
13392
13393 fi
13394
13395 echo "$ac_t""$ol_cv_db_db3" 1>&6
13396
13397         if test $ol_cv_db_db3 = yes ; then
13398                 ol_cv_lib_db=-ldb3
13399         fi
13400 fi
13401
13402 if test $ol_cv_lib_db = no ; then
13403         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13404 echo "configure:13405: checking for Berkeley DB link (-ldb2)" >&5
13405 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13406   echo $ac_n "(cached) $ac_c" 1>&6
13407 else
13408   
13409         ol_DB_LIB=-ldb2
13410         ol_LIBS=$LIBS
13411         LIBS="$ol_DB_LIB $LIBS"
13412
13413         cat > conftest.$ac_ext <<EOF
13414 #line 13415 "configure"
13415 #include "confdefs.h"
13416
13417 #ifdef HAVE_DB_185_H
13418 # include <db_185.h>
13419 #else
13420 # include <db.h>
13421 #endif
13422
13423 #ifndef DB_VERSION_MAJOR
13424 # define DB_VERSION_MAJOR 1
13425 #endif
13426
13427 #ifndef NULL
13428 #define NULL ((void*)0)
13429 #endif
13430
13431 int main() {
13432
13433 #if DB_VERSION_MAJOR > 1
13434         {
13435                 char *version;
13436                 int major, minor, patch;
13437
13438                 version = db_version( &major, &minor, &patch );
13439
13440                 if( major != DB_VERSION_MAJOR ||
13441                         minor < DB_VERSION_MINOR )
13442                 {
13443                         printf("Berkeley DB version mismatch\n"
13444                                 "\texpected: %s\n\tgot: %s\n",
13445                                 DB_VERSION_STRING, version);
13446                         return 1;
13447                 }
13448         }
13449 #endif
13450
13451 #if DB_VERSION_MAJOR > 2
13452         db_env_create( NULL, 0 );
13453 #elif DB_VERSION_MAJOR > 1
13454         db_appexit( NULL );
13455 #else
13456         (void) dbopen( NULL, 0, 0, 0, NULL);
13457 #endif
13458
13459 ; return 0; }
13460 EOF
13461 if { (eval echo configure:13462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13462   rm -rf conftest*
13463   ol_cv_db_db2=yes
13464 else
13465   echo "configure: failed program was:" >&5
13466   cat conftest.$ac_ext >&5
13467   rm -rf conftest*
13468   ol_cv_db_db2=no
13469 fi
13470 rm -f conftest*
13471
13472         LIBS="$ol_LIBS"
13473
13474 fi
13475
13476 echo "$ac_t""$ol_cv_db_db2" 1>&6
13477
13478         if test $ol_cv_db_db2 = yes ; then
13479                 ol_cv_lib_db=-ldb2
13480         fi
13481 fi
13482
13483 if test $ol_cv_lib_db = no ; then
13484         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13485 echo "configure:13486: checking for Berkeley DB link (-ldb1)" >&5
13486 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13487   echo $ac_n "(cached) $ac_c" 1>&6
13488 else
13489   
13490         ol_DB_LIB=-ldb1
13491         ol_LIBS=$LIBS
13492         LIBS="$ol_DB_LIB $LIBS"
13493
13494         cat > conftest.$ac_ext <<EOF
13495 #line 13496 "configure"
13496 #include "confdefs.h"
13497
13498 #ifdef HAVE_DB_185_H
13499 # include <db_185.h>
13500 #else
13501 # include <db.h>
13502 #endif
13503
13504 #ifndef DB_VERSION_MAJOR
13505 # define DB_VERSION_MAJOR 1
13506 #endif
13507
13508 #ifndef NULL
13509 #define NULL ((void*)0)
13510 #endif
13511
13512 int main() {
13513
13514 #if DB_VERSION_MAJOR > 1
13515         {
13516                 char *version;
13517                 int major, minor, patch;
13518
13519                 version = db_version( &major, &minor, &patch );
13520
13521                 if( major != DB_VERSION_MAJOR ||
13522                         minor < DB_VERSION_MINOR )
13523                 {
13524                         printf("Berkeley DB version mismatch\n"
13525                                 "\texpected: %s\n\tgot: %s\n",
13526                                 DB_VERSION_STRING, version);
13527                         return 1;
13528                 }
13529         }
13530 #endif
13531
13532 #if DB_VERSION_MAJOR > 2
13533         db_env_create( NULL, 0 );
13534 #elif DB_VERSION_MAJOR > 1
13535         db_appexit( NULL );
13536 #else
13537         (void) dbopen( NULL, 0, 0, 0, NULL);
13538 #endif
13539
13540 ; return 0; }
13541 EOF
13542 if { (eval echo configure:13543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13543   rm -rf conftest*
13544   ol_cv_db_db1=yes
13545 else
13546   echo "configure: failed program was:" >&5
13547   cat conftest.$ac_ext >&5
13548   rm -rf conftest*
13549   ol_cv_db_db1=no
13550 fi
13551 rm -f conftest*
13552
13553         LIBS="$ol_LIBS"
13554
13555 fi
13556
13557 echo "$ac_t""$ol_cv_db_db1" 1>&6
13558
13559         if test $ol_cv_db_db1 = yes ; then
13560                 ol_cv_lib_db=-ldb1
13561         fi
13562 fi
13563
13564
13565         if test "$ol_cv_lib_db" != no ; then
13566                 ol_cv_berkeley_db=yes
13567                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13568 echo "configure:13569: checking for Berkeley DB thread support" >&5
13569 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13570   echo $ac_n "(cached) $ac_c" 1>&6
13571 else
13572   
13573         ol_LIBS="$LIBS"
13574         if test $ol_cv_lib_db != yes ; then
13575                 LIBS="$ol_cv_lib_db"
13576         fi
13577
13578         if test "$cross_compiling" = yes; then
13579   ol_cv_berkeley_db_thread=cross
13580 else
13581   cat > conftest.$ac_ext <<EOF
13582 #line 13583 "configure"
13583 #include "confdefs.h"
13584
13585 #ifdef HAVE_DB_185_H
13586         choke me;
13587 #else
13588 #include <db.h>
13589 #endif
13590 #ifndef NULL
13591 #define NULL ((void *)0)
13592 #endif
13593 main()
13594 {
13595         int rc;
13596         u_int32_t flags = DB_CREATE | DB_INIT_CDB | DB_INIT_MPOOL |
13597 #ifdef DB_PRIVATE
13598                 DB_PRIVATE |
13599 #endif
13600 #ifdef DB_MPOOL_PRIVATE
13601                 DB_MPOOL_PRIVATE |
13602 #endif
13603                 DB_THREAD;
13604
13605 #if DB_VERSION_MAJOR > 2
13606         DB_ENV *env = NULL;
13607
13608         rc = db_env_create( &env, 0 );
13609
13610         if( rc ) {
13611                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13612                 return rc;
13613         }
13614
13615 #ifdef DB_CDB_ALLDB
13616         rc = env->set_flags( env, DB_CDB_ALLDB, 1 );
13617
13618         if( rc ) {
13619                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13620                 return rc;
13621         }
13622 #endif
13623
13624 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13625         rc = env->open( env, NULL, flags, 0 );
13626 #else
13627         rc = env->open( env, NULL, NULL, flags, 0 );
13628 #endif
13629
13630         if ( rc == 0 ) {
13631                 rc = env->close( env, 0 );
13632         }
13633
13634         if( rc ) {
13635                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13636                 return rc;
13637         }
13638
13639 #else
13640         DB_ENV env;
13641         memset( &env, '\0', sizeof(env) );
13642
13643         rc = db_appinit( NULL, NULL, &env, flags );
13644
13645         if( rc == 0 ) {
13646                 db_appexit( &env );
13647         }
13648
13649         unlink("__db_mpool.share");
13650         unlink("__db_lock.share");
13651 #endif
13652
13653         return rc;
13654 }
13655 EOF
13656 if { (eval echo configure:13657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13657 then
13658   ol_cv_berkeley_db_thread=yes
13659 else
13660   echo "configure: failed program was:" >&5
13661   cat conftest.$ac_ext >&5
13662   rm -fr conftest*
13663   ol_cv_berkeley_db_thread=no
13664 fi
13665 rm -fr conftest*
13666 fi
13667
13668
13669         LIBS="$ol_LIBS"
13670
13671         if test $ol_cv_berkeley_db_thread != no ; then
13672                 cat >> confdefs.h <<\EOF
13673 #define HAVE_BERKELEY_DB_THREAD 1
13674 EOF
13675
13676         fi
13677
13678 fi
13679
13680 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13681         fi
13682 fi
13683
13684         fi
13685
13686         if test $ol_cv_berkeley_db != no ; then
13687                 cat >> confdefs.h <<\EOF
13688 #define HAVE_BERKELEY_DB 1
13689 EOF
13690
13691
13692                 ol_link_ldbm=berkeley
13693                 ol_with_ldbm_api=db
13694
13695                 if test $ol_with_ldbm_type = hash ; then
13696                         cat >> confdefs.h <<\EOF
13697 #define LDBM_USE_DBHASH 1
13698 EOF
13699
13700                 else
13701                         cat >> confdefs.h <<\EOF
13702 #define LDBM_USE_DBBTREE 1
13703 EOF
13704
13705                 fi
13706
13707                                                 if test $ol_cv_lib_db != yes ; then
13708                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13709                 fi
13710         fi
13711 fi
13712
13713 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13714         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13715         ol_with_ldbm_api=none
13716 fi
13717
13718 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13719         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13720 echo "configure:13721: checking for MDBM library" >&5
13721 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13722   echo $ac_n "(cached) $ac_c" 1>&6
13723 else
13724         ol_LIBS="$LIBS"
13725         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13726 echo "configure:13727: checking for mdbm_set_chain" >&5
13727 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13728   echo $ac_n "(cached) $ac_c" 1>&6
13729 else
13730   cat > conftest.$ac_ext <<EOF
13731 #line 13732 "configure"
13732 #include "confdefs.h"
13733 /* System header to define __stub macros and hopefully few prototypes,
13734     which can conflict with char mdbm_set_chain(); below.  */
13735 #include <assert.h>
13736 /* Override any gcc2 internal prototype to avoid an error.  */
13737 /* We use char because int might match the return type of a gcc2
13738     builtin and then its argument prototype would still apply.  */
13739 char mdbm_set_chain();
13740 char (*f)();
13741
13742 int main() {
13743
13744 /* The GNU C library defines this for functions which it implements
13745     to always fail with ENOSYS.  Some functions are actually named
13746     something starting with __ and the normal name is an alias.  */
13747 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13748 choke me
13749 #else
13750 f = mdbm_set_chain;
13751 #endif
13752
13753 ; return 0; }
13754 EOF
13755 if { (eval echo configure:13756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13756   rm -rf conftest*
13757   eval "ac_cv_func_mdbm_set_chain=yes"
13758 else
13759   echo "configure: failed program was:" >&5
13760   cat conftest.$ac_ext >&5
13761   rm -rf conftest*
13762   eval "ac_cv_func_mdbm_set_chain=no"
13763 fi
13764 rm -f conftest*
13765 fi
13766
13767 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13768   echo "$ac_t""yes" 1>&6
13769   ol_cv_lib_mdbm=yes
13770 else
13771   echo "$ac_t""no" 1>&6
13772
13773                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13774 echo "configure:13775: checking for mdbm_set_chain in -lmdbm" >&5
13775 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13776 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13777   echo $ac_n "(cached) $ac_c" 1>&6
13778 else
13779   ac_save_LIBS="$LIBS"
13780 LIBS="-lmdbm  $LIBS"
13781 cat > conftest.$ac_ext <<EOF
13782 #line 13783 "configure"
13783 #include "confdefs.h"
13784 /* Override any gcc2 internal prototype to avoid an error.  */
13785 /* We use char because int might match the return type of a gcc2
13786     builtin and then its argument prototype would still apply.  */
13787 char mdbm_set_chain();
13788
13789 int main() {
13790 mdbm_set_chain()
13791 ; return 0; }
13792 EOF
13793 if { (eval echo configure:13794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13794   rm -rf conftest*
13795   eval "ac_cv_lib_$ac_lib_var=yes"
13796 else
13797   echo "configure: failed program was:" >&5
13798   cat conftest.$ac_ext >&5
13799   rm -rf conftest*
13800   eval "ac_cv_lib_$ac_lib_var=no"
13801 fi
13802 rm -f conftest*
13803 LIBS="$ac_save_LIBS"
13804
13805 fi
13806 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13807   echo "$ac_t""yes" 1>&6
13808   ol_cv_lib_mdbm=-lmdbm
13809 else
13810   echo "$ac_t""no" 1>&6
13811 ol_cv_lib_mdbm=no
13812 fi
13813
13814         
13815 fi
13816
13817         LIBS="$ol_LIBS"
13818
13819 fi
13820
13821 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13822
13823
13824  for ac_hdr in mdbm.h
13825 do
13826 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13827 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13828 echo "configure:13829: checking for $ac_hdr" >&5
13829 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13830   echo $ac_n "(cached) $ac_c" 1>&6
13831 else
13832   cat > conftest.$ac_ext <<EOF
13833 #line 13834 "configure"
13834 #include "confdefs.h"
13835 #include <$ac_hdr>
13836 EOF
13837 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13838 { (eval echo configure:13839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13839 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13840 if test -z "$ac_err"; then
13841   rm -rf conftest*
13842   eval "ac_cv_header_$ac_safe=yes"
13843 else
13844   echo "$ac_err" >&5
13845   echo "configure: failed program was:" >&5
13846   cat conftest.$ac_ext >&5
13847   rm -rf conftest*
13848   eval "ac_cv_header_$ac_safe=no"
13849 fi
13850 rm -f conftest*
13851 fi
13852 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13853   echo "$ac_t""yes" 1>&6
13854     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13855   cat >> confdefs.h <<EOF
13856 #define $ac_tr_hdr 1
13857 EOF
13858  
13859 else
13860   echo "$ac_t""no" 1>&6
13861 fi
13862 done
13863
13864  echo $ac_n "checking for db""... $ac_c" 1>&6
13865 echo "configure:13866: checking for db" >&5
13866 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13867   echo $ac_n "(cached) $ac_c" 1>&6
13868 else
13869   
13870         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13871                 ol_cv_mdbm=no
13872         else
13873                 ol_cv_mdbm=yes
13874         fi
13875
13876 fi
13877
13878 echo "$ac_t""$ol_cv_mdbm" 1>&6
13879  if test $ol_cv_mdbm = yes ; then
13880         cat >> confdefs.h <<\EOF
13881 #define HAVE_MDBM 1
13882 EOF
13883
13884  fi
13885
13886
13887         if test $ol_cv_mdbm = yes ; then
13888                 ol_link_ldbm=mdbm
13889                 ol_with_ldbm_api=mdbm
13890                 if test $ol_cv_lib_mdbm != yes ; then
13891                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13892                 fi
13893         fi
13894 fi
13895
13896 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13897         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13898 echo "configure:13899: checking for GDBM library" >&5
13899 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13900   echo $ac_n "(cached) $ac_c" 1>&6
13901 else
13902         ol_LIBS="$LIBS"
13903         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13904 echo "configure:13905: checking for gdbm_open" >&5
13905 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13906   echo $ac_n "(cached) $ac_c" 1>&6
13907 else
13908   cat > conftest.$ac_ext <<EOF
13909 #line 13910 "configure"
13910 #include "confdefs.h"
13911 /* System header to define __stub macros and hopefully few prototypes,
13912     which can conflict with char gdbm_open(); below.  */
13913 #include <assert.h>
13914 /* Override any gcc2 internal prototype to avoid an error.  */
13915 /* We use char because int might match the return type of a gcc2
13916     builtin and then its argument prototype would still apply.  */
13917 char gdbm_open();
13918 char (*f)();
13919
13920 int main() {
13921
13922 /* The GNU C library defines this for functions which it implements
13923     to always fail with ENOSYS.  Some functions are actually named
13924     something starting with __ and the normal name is an alias.  */
13925 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13926 choke me
13927 #else
13928 f = gdbm_open;
13929 #endif
13930
13931 ; return 0; }
13932 EOF
13933 if { (eval echo configure:13934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13934   rm -rf conftest*
13935   eval "ac_cv_func_gdbm_open=yes"
13936 else
13937   echo "configure: failed program was:" >&5
13938   cat conftest.$ac_ext >&5
13939   rm -rf conftest*
13940   eval "ac_cv_func_gdbm_open=no"
13941 fi
13942 rm -f conftest*
13943 fi
13944
13945 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13946   echo "$ac_t""yes" 1>&6
13947   ol_cv_lib_gdbm=yes
13948 else
13949   echo "$ac_t""no" 1>&6
13950
13951                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13952 echo "configure:13953: checking for gdbm_open in -lgdbm" >&5
13953 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13954 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13955   echo $ac_n "(cached) $ac_c" 1>&6
13956 else
13957   ac_save_LIBS="$LIBS"
13958 LIBS="-lgdbm  $LIBS"
13959 cat > conftest.$ac_ext <<EOF
13960 #line 13961 "configure"
13961 #include "confdefs.h"
13962 /* Override any gcc2 internal prototype to avoid an error.  */
13963 /* We use char because int might match the return type of a gcc2
13964     builtin and then its argument prototype would still apply.  */
13965 char gdbm_open();
13966
13967 int main() {
13968 gdbm_open()
13969 ; return 0; }
13970 EOF
13971 if { (eval echo configure:13972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13972   rm -rf conftest*
13973   eval "ac_cv_lib_$ac_lib_var=yes"
13974 else
13975   echo "configure: failed program was:" >&5
13976   cat conftest.$ac_ext >&5
13977   rm -rf conftest*
13978   eval "ac_cv_lib_$ac_lib_var=no"
13979 fi
13980 rm -f conftest*
13981 LIBS="$ac_save_LIBS"
13982
13983 fi
13984 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13985   echo "$ac_t""yes" 1>&6
13986   ol_cv_lib_gdbm=-lgdbm
13987 else
13988   echo "$ac_t""no" 1>&6
13989 ol_cv_lib_gdbm=no
13990 fi
13991
13992         
13993 fi
13994
13995         LIBS="$ol_LIBS"
13996
13997 fi
13998
13999 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
14000
14001
14002  for ac_hdr in gdbm.h
14003 do
14004 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14005 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14006 echo "configure:14007: checking for $ac_hdr" >&5
14007 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14008   echo $ac_n "(cached) $ac_c" 1>&6
14009 else
14010   cat > conftest.$ac_ext <<EOF
14011 #line 14012 "configure"
14012 #include "confdefs.h"
14013 #include <$ac_hdr>
14014 EOF
14015 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14016 { (eval echo configure:14017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14017 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14018 if test -z "$ac_err"; then
14019   rm -rf conftest*
14020   eval "ac_cv_header_$ac_safe=yes"
14021 else
14022   echo "$ac_err" >&5
14023   echo "configure: failed program was:" >&5
14024   cat conftest.$ac_ext >&5
14025   rm -rf conftest*
14026   eval "ac_cv_header_$ac_safe=no"
14027 fi
14028 rm -f conftest*
14029 fi
14030 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14031   echo "$ac_t""yes" 1>&6
14032     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14033   cat >> confdefs.h <<EOF
14034 #define $ac_tr_hdr 1
14035 EOF
14036  
14037 else
14038   echo "$ac_t""no" 1>&6
14039 fi
14040 done
14041
14042  echo $ac_n "checking for db""... $ac_c" 1>&6
14043 echo "configure:14044: checking for db" >&5
14044 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
14045   echo $ac_n "(cached) $ac_c" 1>&6
14046 else
14047   
14048         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
14049                 ol_cv_gdbm=no
14050         else
14051                 ol_cv_gdbm=yes
14052         fi
14053
14054 fi
14055
14056 echo "$ac_t""$ol_cv_gdbm" 1>&6
14057  if test $ol_cv_gdbm = yes ; then
14058         cat >> confdefs.h <<\EOF
14059 #define HAVE_GDBM 1
14060 EOF
14061
14062  fi
14063
14064
14065         if test $ol_cv_gdbm = yes ; then
14066                 ol_link_ldbm=gdbm
14067                 ol_with_ldbm_api=gdbm
14068
14069                 if test $ol_cv_lib_gdbm != yes ; then
14070                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14071                 fi
14072         fi
14073 fi
14074
14075 if test $ol_with_ldbm_api = ndbm ; then
14076         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14077 echo "configure:14078: checking for NDBM library" >&5
14078 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14079   echo $ac_n "(cached) $ac_c" 1>&6
14080 else
14081         ol_LIBS="$LIBS"
14082         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14083 echo "configure:14084: checking for dbm_open" >&5
14084 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14085   echo $ac_n "(cached) $ac_c" 1>&6
14086 else
14087   cat > conftest.$ac_ext <<EOF
14088 #line 14089 "configure"
14089 #include "confdefs.h"
14090 /* System header to define __stub macros and hopefully few prototypes,
14091     which can conflict with char dbm_open(); below.  */
14092 #include <assert.h>
14093 /* Override any gcc2 internal prototype to avoid an error.  */
14094 /* We use char because int might match the return type of a gcc2
14095     builtin and then its argument prototype would still apply.  */
14096 char dbm_open();
14097 char (*f)();
14098
14099 int main() {
14100
14101 /* The GNU C library defines this for functions which it implements
14102     to always fail with ENOSYS.  Some functions are actually named
14103     something starting with __ and the normal name is an alias.  */
14104 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14105 choke me
14106 #else
14107 f = dbm_open;
14108 #endif
14109
14110 ; return 0; }
14111 EOF
14112 if { (eval echo configure:14113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14113   rm -rf conftest*
14114   eval "ac_cv_func_dbm_open=yes"
14115 else
14116   echo "configure: failed program was:" >&5
14117   cat conftest.$ac_ext >&5
14118   rm -rf conftest*
14119   eval "ac_cv_func_dbm_open=no"
14120 fi
14121 rm -f conftest*
14122 fi
14123
14124 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14125   echo "$ac_t""yes" 1>&6
14126   ol_cv_lib_ndbm=yes
14127 else
14128   echo "$ac_t""no" 1>&6
14129
14130                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14131 echo "configure:14132: checking for dbm_open in -lndbm" >&5
14132 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14133 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14134   echo $ac_n "(cached) $ac_c" 1>&6
14135 else
14136   ac_save_LIBS="$LIBS"
14137 LIBS="-lndbm  $LIBS"
14138 cat > conftest.$ac_ext <<EOF
14139 #line 14140 "configure"
14140 #include "confdefs.h"
14141 /* Override any gcc2 internal prototype to avoid an error.  */
14142 /* We use char because int might match the return type of a gcc2
14143     builtin and then its argument prototype would still apply.  */
14144 char dbm_open();
14145
14146 int main() {
14147 dbm_open()
14148 ; return 0; }
14149 EOF
14150 if { (eval echo configure:14151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14151   rm -rf conftest*
14152   eval "ac_cv_lib_$ac_lib_var=yes"
14153 else
14154   echo "configure: failed program was:" >&5
14155   cat conftest.$ac_ext >&5
14156   rm -rf conftest*
14157   eval "ac_cv_lib_$ac_lib_var=no"
14158 fi
14159 rm -f conftest*
14160 LIBS="$ac_save_LIBS"
14161
14162 fi
14163 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14164   echo "$ac_t""yes" 1>&6
14165   ol_cv_lib_ndbm=-lndbm
14166 else
14167   echo "$ac_t""no" 1>&6
14168
14169                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14170 echo "configure:14171: checking for dbm_open in -ldbm" >&5
14171 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14172 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14173   echo $ac_n "(cached) $ac_c" 1>&6
14174 else
14175   ac_save_LIBS="$LIBS"
14176 LIBS="-ldbm  $LIBS"
14177 cat > conftest.$ac_ext <<EOF
14178 #line 14179 "configure"
14179 #include "confdefs.h"
14180 /* Override any gcc2 internal prototype to avoid an error.  */
14181 /* We use char because int might match the return type of a gcc2
14182     builtin and then its argument prototype would still apply.  */
14183 char dbm_open();
14184
14185 int main() {
14186 dbm_open()
14187 ; return 0; }
14188 EOF
14189 if { (eval echo configure:14190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14190   rm -rf conftest*
14191   eval "ac_cv_lib_$ac_lib_var=yes"
14192 else
14193   echo "configure: failed program was:" >&5
14194   cat conftest.$ac_ext >&5
14195   rm -rf conftest*
14196   eval "ac_cv_lib_$ac_lib_var=no"
14197 fi
14198 rm -f conftest*
14199 LIBS="$ac_save_LIBS"
14200
14201 fi
14202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14203   echo "$ac_t""yes" 1>&6
14204   ol_cv_lib_ndbm=-ldbm
14205 else
14206   echo "$ac_t""no" 1>&6
14207 ol_cv_lib_ndbm=no
14208 fi
14209                 
14210 fi
14211
14212         
14213 fi
14214
14215         LIBS="$ol_LIBS"
14216
14217 fi
14218
14219 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14220
14221
14222  for ac_hdr in ndbm.h
14223 do
14224 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14225 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14226 echo "configure:14227: checking for $ac_hdr" >&5
14227 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14228   echo $ac_n "(cached) $ac_c" 1>&6
14229 else
14230   cat > conftest.$ac_ext <<EOF
14231 #line 14232 "configure"
14232 #include "confdefs.h"
14233 #include <$ac_hdr>
14234 EOF
14235 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14236 { (eval echo configure:14237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14237 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14238 if test -z "$ac_err"; then
14239   rm -rf conftest*
14240   eval "ac_cv_header_$ac_safe=yes"
14241 else
14242   echo "$ac_err" >&5
14243   echo "configure: failed program was:" >&5
14244   cat conftest.$ac_ext >&5
14245   rm -rf conftest*
14246   eval "ac_cv_header_$ac_safe=no"
14247 fi
14248 rm -f conftest*
14249 fi
14250 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14251   echo "$ac_t""yes" 1>&6
14252     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14253   cat >> confdefs.h <<EOF
14254 #define $ac_tr_hdr 1
14255 EOF
14256  
14257 else
14258   echo "$ac_t""no" 1>&6
14259 fi
14260 done
14261
14262  echo $ac_n "checking for db""... $ac_c" 1>&6
14263 echo "configure:14264: checking for db" >&5
14264 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14265   echo $ac_n "(cached) $ac_c" 1>&6
14266 else
14267   
14268         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14269                 ol_cv_ndbm=no
14270         else
14271                 ol_cv_ndbm=yes
14272         fi
14273
14274 fi
14275
14276 echo "$ac_t""$ol_cv_ndbm" 1>&6
14277  if test $ol_cv_ndbm = yes ; then
14278         cat >> confdefs.h <<\EOF
14279 #define HAVE_NDBM 1
14280 EOF
14281
14282  fi
14283
14284
14285         if test $ol_cv_ndbm = yes ; then
14286                 ol_link_ldbm=ndbm
14287                 ol_with_ldbm_api=ndbm
14288
14289                 if test $ol_cv_lib_ndbm != yes ; then
14290                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14291                 fi
14292         fi
14293 fi
14294
14295 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14296         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14297         if test $ol_enable_ldbm = yes ; then
14298                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14299         fi
14300
14301         echo "configure: warning: disabling LDBM" 1>&2
14302         ol_enable_ldbm=no
14303 fi
14304
14305 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14306         LINK_BINS_DYNAMIC="yes"
14307 else
14308         LINK_BINS_DYNAMIC="no"
14309 fi
14310
14311 if test $ol_enable_wrappers != no ; then
14312         for ac_hdr in tcpd.h
14313 do
14314 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14315 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14316 echo "configure:14317: checking for $ac_hdr" >&5
14317 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14318   echo $ac_n "(cached) $ac_c" 1>&6
14319 else
14320   cat > conftest.$ac_ext <<EOF
14321 #line 14322 "configure"
14322 #include "confdefs.h"
14323 #include <$ac_hdr>
14324 EOF
14325 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14326 { (eval echo configure:14327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14327 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14328 if test -z "$ac_err"; then
14329   rm -rf conftest*
14330   eval "ac_cv_header_$ac_safe=yes"
14331 else
14332   echo "$ac_err" >&5
14333   echo "configure: failed program was:" >&5
14334   cat conftest.$ac_ext >&5
14335   rm -rf conftest*
14336   eval "ac_cv_header_$ac_safe=no"
14337 fi
14338 rm -f conftest*
14339 fi
14340 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14341   echo "$ac_t""yes" 1>&6
14342     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14343   cat >> confdefs.h <<EOF
14344 #define $ac_tr_hdr 1
14345 EOF
14346  
14347 else
14348   echo "$ac_t""no" 1>&6
14349 fi
14350 done
14351
14352
14353         if test $ac_cv_header_tcpd_h != yes ; then
14354                 have_wrappers=no
14355         else
14356                 cat > conftest.$ac_ext <<EOF
14357 #line 14358 "configure"
14358 #include "confdefs.h"
14359
14360 int allow_severity = 0;
14361 int deny_severity  = 0;
14362                 
14363 int main() {
14364 hosts_access()
14365 ; return 0; }
14366 EOF
14367 if { (eval echo configure:14368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14368   rm -rf conftest*
14369   have_wrappers=yes
14370 else
14371   echo "configure: failed program was:" >&5
14372   cat conftest.$ac_ext >&5
14373   rm -rf conftest*
14374   have_wrappers=no
14375 fi
14376 rm -f conftest*
14377         fi
14378
14379         if test $have_wrappers = yes ; then
14380                 cat >> confdefs.h <<\EOF
14381 #define HAVE_TCPD 1
14382 EOF
14383
14384                 WRAP_LIBS="-lwrap"
14385
14386                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14387 echo "configure:14388: checking for main in -lnsl" >&5
14388 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14389 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14390   echo $ac_n "(cached) $ac_c" 1>&6
14391 else
14392   ac_save_LIBS="$LIBS"
14393 LIBS="-lnsl  $LIBS"
14394 cat > conftest.$ac_ext <<EOF
14395 #line 14396 "configure"
14396 #include "confdefs.h"
14397
14398 int main() {
14399 main()
14400 ; return 0; }
14401 EOF
14402 if { (eval echo configure:14403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14403   rm -rf conftest*
14404   eval "ac_cv_lib_$ac_lib_var=yes"
14405 else
14406   echo "configure: failed program was:" >&5
14407   cat conftest.$ac_ext >&5
14408   rm -rf conftest*
14409   eval "ac_cv_lib_$ac_lib_var=no"
14410 fi
14411 rm -f conftest*
14412 LIBS="$ac_save_LIBS"
14413
14414 fi
14415 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14416   echo "$ac_t""yes" 1>&6
14417     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14418     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14419   cat >> confdefs.h <<EOF
14420 #define $ac_tr_lib 1
14421 EOF
14422
14423   LIBS="-lnsl $LIBS"
14424
14425 else
14426   echo "$ac_t""no" 1>&6
14427 fi
14428
14429         else
14430                 echo "configure: warning: could not find -lwrap" 1>&2
14431                 if test $ol_enable_wrappers = yes ; then
14432                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14433                 fi
14434
14435                 echo "configure: warning: disabling wrappers support" 1>&2
14436                 ol_enable_wrappers=no
14437                 WRAP_LIBS=""
14438         fi
14439 fi
14440
14441 if test $ol_enable_syslog != no ; then
14442         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14443 echo "configure:14444: checking for openlog" >&5
14444 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14445   echo $ac_n "(cached) $ac_c" 1>&6
14446 else
14447   cat > conftest.$ac_ext <<EOF
14448 #line 14449 "configure"
14449 #include "confdefs.h"
14450 /* System header to define __stub macros and hopefully few prototypes,
14451     which can conflict with char openlog(); below.  */
14452 #include <assert.h>
14453 /* Override any gcc2 internal prototype to avoid an error.  */
14454 /* We use char because int might match the return type of a gcc2
14455     builtin and then its argument prototype would still apply.  */
14456 char openlog();
14457 char (*f)();
14458
14459 int main() {
14460
14461 /* The GNU C library defines this for functions which it implements
14462     to always fail with ENOSYS.  Some functions are actually named
14463     something starting with __ and the normal name is an alias.  */
14464 #if defined (__stub_openlog) || defined (__stub___openlog)
14465 choke me
14466 #else
14467 f = openlog;
14468 #endif
14469
14470 ; return 0; }
14471 EOF
14472 if { (eval echo configure:14473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14473   rm -rf conftest*
14474   eval "ac_cv_func_openlog=yes"
14475 else
14476   echo "configure: failed program was:" >&5
14477   cat conftest.$ac_ext >&5
14478   rm -rf conftest*
14479   eval "ac_cv_func_openlog=no"
14480 fi
14481 rm -f conftest*
14482 fi
14483
14484 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14485   echo "$ac_t""yes" 1>&6
14486   :
14487 else
14488   echo "$ac_t""no" 1>&6
14489 fi
14490
14491         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14492                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14493         fi
14494         ol_enable_syslog=$ac_cv_func_openlog
14495 fi
14496
14497
14498 ol_link_sql=no
14499 if test $ol_enable_sql != no ; then
14500         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14501 echo "configure:14502: checking for SQLDriverConnect in -liodbc" >&5
14502 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14503 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14504   echo $ac_n "(cached) $ac_c" 1>&6
14505 else
14506   ac_save_LIBS="$LIBS"
14507 LIBS="-liodbc  $LIBS"
14508 cat > conftest.$ac_ext <<EOF
14509 #line 14510 "configure"
14510 #include "confdefs.h"
14511 /* Override any gcc2 internal prototype to avoid an error.  */
14512 /* We use char because int might match the return type of a gcc2
14513     builtin and then its argument prototype would still apply.  */
14514 char SQLDriverConnect();
14515
14516 int main() {
14517 SQLDriverConnect()
14518 ; return 0; }
14519 EOF
14520 if { (eval echo configure:14521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14521   rm -rf conftest*
14522   eval "ac_cv_lib_$ac_lib_var=yes"
14523 else
14524   echo "configure: failed program was:" >&5
14525   cat conftest.$ac_ext >&5
14526   rm -rf conftest*
14527   eval "ac_cv_lib_$ac_lib_var=no"
14528 fi
14529 rm -f conftest*
14530 LIBS="$ac_save_LIBS"
14531
14532 fi
14533 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14534   echo "$ac_t""yes" 1>&6
14535   have_iodbc=yes
14536 else
14537   echo "$ac_t""no" 1>&6
14538 have_iodbc=no
14539 fi
14540
14541         if test $have_iodbc = yes ; then
14542                 ol_link_sql="-liodbc"
14543         else
14544                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14545 echo "configure:14546: checking for SQLDriverConnect in -lodbc" >&5
14546 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14547 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14548   echo $ac_n "(cached) $ac_c" 1>&6
14549 else
14550   ac_save_LIBS="$LIBS"
14551 LIBS="-lodbc  $LIBS"
14552 cat > conftest.$ac_ext <<EOF
14553 #line 14554 "configure"
14554 #include "confdefs.h"
14555 /* Override any gcc2 internal prototype to avoid an error.  */
14556 /* We use char because int might match the return type of a gcc2
14557     builtin and then its argument prototype would still apply.  */
14558 char SQLDriverConnect();
14559
14560 int main() {
14561 SQLDriverConnect()
14562 ; return 0; }
14563 EOF
14564 if { (eval echo configure:14565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14565   rm -rf conftest*
14566   eval "ac_cv_lib_$ac_lib_var=yes"
14567 else
14568   echo "configure: failed program was:" >&5
14569   cat conftest.$ac_ext >&5
14570   rm -rf conftest*
14571   eval "ac_cv_lib_$ac_lib_var=no"
14572 fi
14573 rm -f conftest*
14574 LIBS="$ac_save_LIBS"
14575
14576 fi
14577 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14578   echo "$ac_t""yes" 1>&6
14579   have_odbc=yes
14580 else
14581   echo "$ac_t""no" 1>&6
14582 have_odbc=no
14583 fi
14584
14585                 if test $have_odbc = yes ; then
14586                         ol_link_sql="-lodbc"
14587                 fi
14588         fi
14589
14590         if test $ol_link_sql != no ; then
14591                 SLAPD_SQL_LIBS="$ol_link_sql"
14592
14593         elif test $ol_enable_sql != auto ; then
14594                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14595         fi
14596 fi
14597
14598 if test $ol_enable_tcl != no ; then
14599         for ac_hdr in tcl.h
14600 do
14601 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14602 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14603 echo "configure:14604: checking for $ac_hdr" >&5
14604 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14605   echo $ac_n "(cached) $ac_c" 1>&6
14606 else
14607   cat > conftest.$ac_ext <<EOF
14608 #line 14609 "configure"
14609 #include "confdefs.h"
14610 #include <$ac_hdr>
14611 EOF
14612 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14613 { (eval echo configure:14614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14614 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14615 if test -z "$ac_err"; then
14616   rm -rf conftest*
14617   eval "ac_cv_header_$ac_safe=yes"
14618 else
14619   echo "$ac_err" >&5
14620   echo "configure: failed program was:" >&5
14621   cat conftest.$ac_ext >&5
14622   rm -rf conftest*
14623   eval "ac_cv_header_$ac_safe=no"
14624 fi
14625 rm -f conftest*
14626 fi
14627 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14628   echo "$ac_t""yes" 1>&6
14629     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14630   cat >> confdefs.h <<EOF
14631 #define $ac_tr_hdr 1
14632 EOF
14633  
14634 else
14635   echo "$ac_t""no" 1>&6
14636 fi
14637 done
14638
14639
14640         if test $ac_cv_header_tcl_h != yes ; then
14641                 have_tcl=no
14642         else
14643                 for lib in tcl tcl7.6 tcl8.0 tcl8.2 ; do
14644                         echo $ac_n "checking for main in -l$lib""... $ac_c" 1>&6
14645 echo "configure:14646: checking for main in -l$lib" >&5
14646 ac_lib_var=`echo $lib'_'main | sed 'y%./+-:%__p__%'`
14647 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14648   echo $ac_n "(cached) $ac_c" 1>&6
14649 else
14650   ac_save_LIBS="$LIBS"
14651 LIBS="-l$lib  $LIBS"
14652 cat > conftest.$ac_ext <<EOF
14653 #line 14654 "configure"
14654 #include "confdefs.h"
14655
14656 int main() {
14657 main()
14658 ; return 0; }
14659 EOF
14660 if { (eval echo configure:14661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14661   rm -rf conftest*
14662   eval "ac_cv_lib_$ac_lib_var=yes"
14663 else
14664   echo "configure: failed program was:" >&5
14665   cat conftest.$ac_ext >&5
14666   rm -rf conftest*
14667   eval "ac_cv_lib_$ac_lib_var=no"
14668 fi
14669 rm -f conftest*
14670 LIBS="$ac_save_LIBS"
14671
14672 fi
14673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14674   echo "$ac_t""yes" 1>&6
14675   have_tcl=yes
14676                            if test x"$ol_with_tcl_module" = "xstatic" ; then
14677                                SLAPD_LIBS="$SLAPD_LIBS -l${lib}"
14678                            else
14679                                MOD_TCL_LIB="-l${lib}"
14680                            fi;break
14681 else
14682   echo "$ac_t""no" 1>&6
14683 have_tcl=no
14684 fi
14685
14686                 done
14687         fi
14688
14689         if test $have_tcl != yes ; then
14690                 echo "configure: warning: could not find -ltcl" 1>&2
14691                 if test $ol_enable_tcl = yes ; then
14692                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
14693                 fi
14694
14695                 ol_enable_tcl=no
14696         fi
14697 fi
14698
14699 ol_link_termcap=no
14700 for ac_hdr in termcap.h ncurses.h
14701 do
14702 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14703 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14704 echo "configure:14705: checking for $ac_hdr" >&5
14705 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14706   echo $ac_n "(cached) $ac_c" 1>&6
14707 else
14708   cat > conftest.$ac_ext <<EOF
14709 #line 14710 "configure"
14710 #include "confdefs.h"
14711 #include <$ac_hdr>
14712 EOF
14713 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14714 { (eval echo configure:14715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14715 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14716 if test -z "$ac_err"; then
14717   rm -rf conftest*
14718   eval "ac_cv_header_$ac_safe=yes"
14719 else
14720   echo "$ac_err" >&5
14721   echo "configure: failed program was:" >&5
14722   cat conftest.$ac_ext >&5
14723   rm -rf conftest*
14724   eval "ac_cv_header_$ac_safe=no"
14725 fi
14726 rm -f conftest*
14727 fi
14728 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14729   echo "$ac_t""yes" 1>&6
14730     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14731   cat >> confdefs.h <<EOF
14732 #define $ac_tr_hdr 1
14733 EOF
14734  
14735 else
14736   echo "$ac_t""no" 1>&6
14737 fi
14738 done
14739
14740
14741 if test $ol_link_termcap = no ; then
14742         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14743 echo "configure:14744: checking for tputs in -ltermcap" >&5
14744 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14745 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14746   echo $ac_n "(cached) $ac_c" 1>&6
14747 else
14748   ac_save_LIBS="$LIBS"
14749 LIBS="-ltermcap  $LIBS"
14750 cat > conftest.$ac_ext <<EOF
14751 #line 14752 "configure"
14752 #include "confdefs.h"
14753 /* Override any gcc2 internal prototype to avoid an error.  */
14754 /* We use char because int might match the return type of a gcc2
14755     builtin and then its argument prototype would still apply.  */
14756 char tputs();
14757
14758 int main() {
14759 tputs()
14760 ; return 0; }
14761 EOF
14762 if { (eval echo configure:14763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14763   rm -rf conftest*
14764   eval "ac_cv_lib_$ac_lib_var=yes"
14765 else
14766   echo "configure: failed program was:" >&5
14767   cat conftest.$ac_ext >&5
14768   rm -rf conftest*
14769   eval "ac_cv_lib_$ac_lib_var=no"
14770 fi
14771 rm -f conftest*
14772 LIBS="$ac_save_LIBS"
14773
14774 fi
14775 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14776   echo "$ac_t""yes" 1>&6
14777   have_termcap=yes
14778 else
14779   echo "$ac_t""no" 1>&6
14780 have_termcap=no
14781 fi
14782
14783         if test $have_termcap = yes ; then
14784                 cat >> confdefs.h <<\EOF
14785 #define HAVE_TERMCAP 1
14786 EOF
14787
14788                 ol_link_termcap=yes
14789                 TERMCAP_LIBS=-ltermcap
14790         fi
14791 fi
14792
14793 if test $ol_link_termcap = no ; then
14794         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14795 echo "configure:14796: checking for initscr in -lncurses" >&5
14796 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14797 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14798   echo $ac_n "(cached) $ac_c" 1>&6
14799 else
14800   ac_save_LIBS="$LIBS"
14801 LIBS="-lncurses  $LIBS"
14802 cat > conftest.$ac_ext <<EOF
14803 #line 14804 "configure"
14804 #include "confdefs.h"
14805 /* Override any gcc2 internal prototype to avoid an error.  */
14806 /* We use char because int might match the return type of a gcc2
14807     builtin and then its argument prototype would still apply.  */
14808 char initscr();
14809
14810 int main() {
14811 initscr()
14812 ; return 0; }
14813 EOF
14814 if { (eval echo configure:14815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14815   rm -rf conftest*
14816   eval "ac_cv_lib_$ac_lib_var=yes"
14817 else
14818   echo "configure: failed program was:" >&5
14819   cat conftest.$ac_ext >&5
14820   rm -rf conftest*
14821   eval "ac_cv_lib_$ac_lib_var=no"
14822 fi
14823 rm -f conftest*
14824 LIBS="$ac_save_LIBS"
14825
14826 fi
14827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14828   echo "$ac_t""yes" 1>&6
14829   have_ncurses=yes
14830 else
14831   echo "$ac_t""no" 1>&6
14832 have_ncurses=no
14833 fi
14834
14835         if test $have_ncurses = yes ; then
14836                 cat >> confdefs.h <<\EOF
14837 #define HAVE_NCURSES 1
14838 EOF
14839
14840                 ol_link_termcap=yes
14841                 TERMCAP_LIBS=-lncurses
14842         fi
14843 fi
14844
14845 if test $ol_link_termcap = no ; then
14846         cat >> confdefs.h <<\EOF
14847 #define NO_TERMCAP 1
14848 EOF
14849
14850         TERMCAP_LIBS=
14851 fi
14852
14853 ol_link_sasl=no
14854 ol_link_spasswd=no
14855 if test $ol_with_cyrus_sasl != no ; then
14856         for ac_hdr in sasl.h
14857 do
14858 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14859 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14860 echo "configure:14861: checking for $ac_hdr" >&5
14861 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14862   echo $ac_n "(cached) $ac_c" 1>&6
14863 else
14864   cat > conftest.$ac_ext <<EOF
14865 #line 14866 "configure"
14866 #include "confdefs.h"
14867 #include <$ac_hdr>
14868 EOF
14869 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14870 { (eval echo configure:14871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14871 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14872 if test -z "$ac_err"; then
14873   rm -rf conftest*
14874   eval "ac_cv_header_$ac_safe=yes"
14875 else
14876   echo "$ac_err" >&5
14877   echo "configure: failed program was:" >&5
14878   cat conftest.$ac_ext >&5
14879   rm -rf conftest*
14880   eval "ac_cv_header_$ac_safe=no"
14881 fi
14882 rm -f conftest*
14883 fi
14884 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14885   echo "$ac_t""yes" 1>&6
14886     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14887   cat >> confdefs.h <<EOF
14888 #define $ac_tr_hdr 1
14889 EOF
14890  
14891 else
14892   echo "$ac_t""no" 1>&6
14893 fi
14894 done
14895
14896
14897         if test $ac_cv_header_sasl_h = yes ; then
14898                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14899 echo "configure:14900: checking for sasl_client_init in -lsasl" >&5
14900 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14901 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14902   echo $ac_n "(cached) $ac_c" 1>&6
14903 else
14904   ac_save_LIBS="$LIBS"
14905 LIBS="-lsasl  $LIBS"
14906 cat > conftest.$ac_ext <<EOF
14907 #line 14908 "configure"
14908 #include "confdefs.h"
14909 /* Override any gcc2 internal prototype to avoid an error.  */
14910 /* We use char because int might match the return type of a gcc2
14911     builtin and then its argument prototype would still apply.  */
14912 char sasl_client_init();
14913
14914 int main() {
14915 sasl_client_init()
14916 ; return 0; }
14917 EOF
14918 if { (eval echo configure:14919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14919   rm -rf conftest*
14920   eval "ac_cv_lib_$ac_lib_var=yes"
14921 else
14922   echo "configure: failed program was:" >&5
14923   cat conftest.$ac_ext >&5
14924   rm -rf conftest*
14925   eval "ac_cv_lib_$ac_lib_var=no"
14926 fi
14927 rm -f conftest*
14928 LIBS="$ac_save_LIBS"
14929
14930 fi
14931 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14932   echo "$ac_t""yes" 1>&6
14933   have_cyrus_sasl=yes
14934 else
14935   echo "$ac_t""no" 1>&6
14936 have_cyrus_sasl=no
14937 fi
14938
14939
14940                 if test $have_cyrus_sasl != no ; then
14941                         SASL_LIBS="-lsasl"
14942                         cat >> confdefs.h <<\EOF
14943 #define HAVE_CYRUS_SASL 1
14944 EOF
14945
14946                         ol_link_sasl=yes
14947                 fi
14948         fi
14949
14950         if test $ol_link_sasl = no ; then
14951                 if test $ol_with_cyrus_sasl != auto ; then
14952                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14953                 else
14954                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14955                         echo "configure: warning: SASL authentication not supported!" 1>&2
14956                         if test $ol_link_tls = no ; then
14957                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14958                         fi
14959                 fi
14960
14961         elif test $ol_enable_spasswd != no ; then
14962                 ol_link_spasswd=yes
14963         fi
14964
14965 else
14966         echo "configure: warning: SASL authentication not supported!" 1>&2
14967         if test $ol_link_tls = no ; then
14968                 echo "configure: warning: Strong authentication not supported!" 1>&2
14969         fi
14970 fi
14971
14972 if test $cross_compiling != yes ; then
14973         dev=no
14974         if test -r /dev/urandom ; then
14975                 dev="/dev/urandom";
14976         elif test -r /idev/urandom ; then
14977                 dev="/idev/urandom";
14978         elif test -r /dev/srandom ; then
14979                 dev="/dev/srandom";
14980         elif test -r /dev/random ; then
14981                 dev="/dev/random";
14982         elif test -r /idev/random ; then
14983                 dev="/idev/random";
14984         fi
14985
14986         if test $dev != no ; then
14987                 cat >> confdefs.h <<EOF
14988 #define URANDOM_DEVICE "$dev"
14989 EOF
14990
14991         fi
14992 fi
14993
14994 ol_link_fetch=no
14995 if test $ol_with_fetch != no ; then
14996         ol_LIBS=$LIBS
14997 LIBS="-lfetch -lcom_err $LIBS"
14998 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14999 echo "configure:15000: checking fetch(3) library" >&5
15000 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
15001   echo $ac_n "(cached) $ac_c" 1>&6
15002 else
15003   
15004         cat > conftest.$ac_ext <<EOF
15005 #line 15006 "configure"
15006 #include "confdefs.h"
15007
15008 #include <sys/param.h>
15009 #include <stdio.h>
15010 #include <fetch.h>
15011 int main() {
15012 struct url *u = fetchParseURL("file:///"); 
15013 ; return 0; }
15014 EOF
15015 if { (eval echo configure:15016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15016   rm -rf conftest*
15017   ol_cv_lib_fetch=yes
15018 else
15019   echo "configure: failed program was:" >&5
15020   cat conftest.$ac_ext >&5
15021   rm -rf conftest*
15022   ol_cv_lib_fetch=no
15023 fi
15024 rm -f conftest*
15025 fi
15026
15027 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
15028 LIBS=$ol_LIBS
15029 if test $ol_cv_lib_fetch != no ; then
15030         ol_link_fetch="-lfetch -lcom_err"
15031         cat >> confdefs.h <<\EOF
15032 #define HAVE_FETCH 1
15033 EOF
15034
15035 fi
15036
15037
15038         if test $ol_cv_lib_fetch != no ; then
15039                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
15040                 ol_link_fetch=freebsd
15041
15042         elif test $ol_with_fetch != auto ; then
15043                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
15044         fi 
15045 fi
15046
15047 ol_link_readline=no
15048 if test $ol_with_readline != no ; then
15049         for ac_hdr in readline/readline.h readline/history.h
15050 do
15051 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15052 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15053 echo "configure:15054: checking for $ac_hdr" >&5
15054 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15055   echo $ac_n "(cached) $ac_c" 1>&6
15056 else
15057   cat > conftest.$ac_ext <<EOF
15058 #line 15059 "configure"
15059 #include "confdefs.h"
15060 #include <$ac_hdr>
15061 EOF
15062 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15063 { (eval echo configure:15064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15064 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15065 if test -z "$ac_err"; then
15066   rm -rf conftest*
15067   eval "ac_cv_header_$ac_safe=yes"
15068 else
15069   echo "$ac_err" >&5
15070   echo "configure: failed program was:" >&5
15071   cat conftest.$ac_ext >&5
15072   rm -rf conftest*
15073   eval "ac_cv_header_$ac_safe=no"
15074 fi
15075 rm -f conftest*
15076 fi
15077 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15078   echo "$ac_t""yes" 1>&6
15079     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15080   cat >> confdefs.h <<EOF
15081 #define $ac_tr_hdr 1
15082 EOF
15083  
15084 else
15085   echo "$ac_t""no" 1>&6
15086 fi
15087 done
15088
15089
15090         if test $ac_cv_header_readline_readline_h = yes ; then
15091                 save_LIBS="$LIBS"
15092                 LIBS="$TERMCAP_LIBS $LIBS"
15093                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
15094 echo "configure:15095: checking for readline in -lreadline" >&5
15095 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
15096 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15097   echo $ac_n "(cached) $ac_c" 1>&6
15098 else
15099   ac_save_LIBS="$LIBS"
15100 LIBS="-lreadline  $LIBS"
15101 cat > conftest.$ac_ext <<EOF
15102 #line 15103 "configure"
15103 #include "confdefs.h"
15104 /* Override any gcc2 internal prototype to avoid an error.  */
15105 /* We use char because int might match the return type of a gcc2
15106     builtin and then its argument prototype would still apply.  */
15107 char readline();
15108
15109 int main() {
15110 readline()
15111 ; return 0; }
15112 EOF
15113 if { (eval echo configure:15114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15114   rm -rf conftest*
15115   eval "ac_cv_lib_$ac_lib_var=yes"
15116 else
15117   echo "configure: failed program was:" >&5
15118   cat conftest.$ac_ext >&5
15119   rm -rf conftest*
15120   eval "ac_cv_lib_$ac_lib_var=no"
15121 fi
15122 rm -f conftest*
15123 LIBS="$ac_save_LIBS"
15124
15125 fi
15126 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15127   echo "$ac_t""yes" 1>&6
15128   have_readline=yes
15129 else
15130   echo "$ac_t""no" 1>&6
15131 have_readline=no
15132 fi
15133
15134                 LIBS="$save_LIBS"
15135                         
15136                 if test $have_readline = yes ; then
15137                         ol_with_readline=found
15138                         ol_link_readline=yes
15139
15140                         READLINE_LIBS="-lreadline"
15141                 fi
15142         fi
15143 fi
15144
15145 if test $ol_link_readline = yes ; then
15146         cat >> confdefs.h <<\EOF
15147 #define HAVE_READLINE 1
15148 EOF
15149
15150 fi
15151
15152
15153 if test $ol_enable_crypt != no ; then
15154         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15155 echo "configure:15156: checking for crypt" >&5
15156 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15157   echo $ac_n "(cached) $ac_c" 1>&6
15158 else
15159   cat > conftest.$ac_ext <<EOF
15160 #line 15161 "configure"
15161 #include "confdefs.h"
15162 /* System header to define __stub macros and hopefully few prototypes,
15163     which can conflict with char crypt(); below.  */
15164 #include <assert.h>
15165 /* Override any gcc2 internal prototype to avoid an error.  */
15166 /* We use char because int might match the return type of a gcc2
15167     builtin and then its argument prototype would still apply.  */
15168 char crypt();
15169 char (*f)();
15170
15171 int main() {
15172
15173 /* The GNU C library defines this for functions which it implements
15174     to always fail with ENOSYS.  Some functions are actually named
15175     something starting with __ and the normal name is an alias.  */
15176 #if defined (__stub_crypt) || defined (__stub___crypt)
15177 choke me
15178 #else
15179 f = crypt;
15180 #endif
15181
15182 ; return 0; }
15183 EOF
15184 if { (eval echo configure:15185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15185   rm -rf conftest*
15186   eval "ac_cv_func_crypt=yes"
15187 else
15188   echo "configure: failed program was:" >&5
15189   cat conftest.$ac_ext >&5
15190   rm -rf conftest*
15191   eval "ac_cv_func_crypt=no"
15192 fi
15193 rm -f conftest*
15194 fi
15195
15196 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15197   echo "$ac_t""yes" 1>&6
15198   have_crypt=yes
15199 else
15200   echo "$ac_t""no" 1>&6
15201
15202                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15203 echo "configure:15204: checking for crypt in -lcrypt" >&5
15204 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15205 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15206   echo $ac_n "(cached) $ac_c" 1>&6
15207 else
15208   ac_save_LIBS="$LIBS"
15209 LIBS="-lcrypt  $LIBS"
15210 cat > conftest.$ac_ext <<EOF
15211 #line 15212 "configure"
15212 #include "confdefs.h"
15213 /* Override any gcc2 internal prototype to avoid an error.  */
15214 /* We use char because int might match the return type of a gcc2
15215     builtin and then its argument prototype would still apply.  */
15216 char crypt();
15217
15218 int main() {
15219 crypt()
15220 ; return 0; }
15221 EOF
15222 if { (eval echo configure:15223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15223   rm -rf conftest*
15224   eval "ac_cv_lib_$ac_lib_var=yes"
15225 else
15226   echo "configure: failed program was:" >&5
15227   cat conftest.$ac_ext >&5
15228   rm -rf conftest*
15229   eval "ac_cv_lib_$ac_lib_var=no"
15230 fi
15231 rm -f conftest*
15232 LIBS="$ac_save_LIBS"
15233
15234 fi
15235 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15236   echo "$ac_t""yes" 1>&6
15237   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15238                         have_crypt=yes
15239 else
15240   echo "$ac_t""no" 1>&6
15241 have_crypt=no
15242 fi
15243
15244 fi
15245
15246
15247         if test $have_crypt = yes ; then
15248                 cat >> confdefs.h <<\EOF
15249 #define HAVE_CRYPT 1
15250 EOF
15251
15252         else
15253                 echo "configure: warning: could not find crypt" 1>&2
15254                 if test $ol_enable_crypt = yes ; then
15255                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15256                 fi
15257
15258                 echo "configure: warning: disabling crypt support" 1>&2
15259                 ol_enable_crypt=no
15260         fi
15261 fi
15262
15263 if test $ol_enable_proctitle != no ; then
15264         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15265 echo "configure:15266: checking for setproctitle" >&5
15266 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15267   echo $ac_n "(cached) $ac_c" 1>&6
15268 else
15269   cat > conftest.$ac_ext <<EOF
15270 #line 15271 "configure"
15271 #include "confdefs.h"
15272 /* System header to define __stub macros and hopefully few prototypes,
15273     which can conflict with char setproctitle(); below.  */
15274 #include <assert.h>
15275 /* Override any gcc2 internal prototype to avoid an error.  */
15276 /* We use char because int might match the return type of a gcc2
15277     builtin and then its argument prototype would still apply.  */
15278 char setproctitle();
15279 char (*f)();
15280
15281 int main() {
15282
15283 /* The GNU C library defines this for functions which it implements
15284     to always fail with ENOSYS.  Some functions are actually named
15285     something starting with __ and the normal name is an alias.  */
15286 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15287 choke me
15288 #else
15289 f = setproctitle;
15290 #endif
15291
15292 ; return 0; }
15293 EOF
15294 if { (eval echo configure:15295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15295   rm -rf conftest*
15296   eval "ac_cv_func_setproctitle=yes"
15297 else
15298   echo "configure: failed program was:" >&5
15299   cat conftest.$ac_ext >&5
15300   rm -rf conftest*
15301   eval "ac_cv_func_setproctitle=no"
15302 fi
15303 rm -f conftest*
15304 fi
15305
15306 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15307   echo "$ac_t""yes" 1>&6
15308   have_setproctitle=yes
15309 else
15310   echo "$ac_t""no" 1>&6
15311
15312                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15313 echo "configure:15314: checking for setproctitle in -lutil" >&5
15314 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15315 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15316   echo $ac_n "(cached) $ac_c" 1>&6
15317 else
15318   ac_save_LIBS="$LIBS"
15319 LIBS="-lutil  $LIBS"
15320 cat > conftest.$ac_ext <<EOF
15321 #line 15322 "configure"
15322 #include "confdefs.h"
15323 /* Override any gcc2 internal prototype to avoid an error.  */
15324 /* We use char because int might match the return type of a gcc2
15325     builtin and then its argument prototype would still apply.  */
15326 char setproctitle();
15327
15328 int main() {
15329 setproctitle()
15330 ; return 0; }
15331 EOF
15332 if { (eval echo configure:15333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15333   rm -rf conftest*
15334   eval "ac_cv_lib_$ac_lib_var=yes"
15335 else
15336   echo "configure: failed program was:" >&5
15337   cat conftest.$ac_ext >&5
15338   rm -rf conftest*
15339   eval "ac_cv_lib_$ac_lib_var=no"
15340 fi
15341 rm -f conftest*
15342 LIBS="$ac_save_LIBS"
15343
15344 fi
15345 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15346   echo "$ac_t""yes" 1>&6
15347   have_setproctitle=yes
15348                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15349 else
15350   echo "$ac_t""no" 1>&6
15351 have_setproctitle=no
15352                         LIBOBJS="$LIBOBJS setproctitle.o"
15353                         LIBSRCS="$LIBSRCS setproctitle.c"
15354 fi
15355
15356 fi
15357
15358
15359         if test $have_setproctitle = yes ; then
15360                 cat >> confdefs.h <<\EOF
15361 #define HAVE_SETPROCTITLE 1
15362 EOF
15363
15364         fi
15365 fi
15366
15367 if test $ol_enable_slp != no ; then
15368         for ac_hdr in slp.h 
15369 do
15370 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
15371 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
15372 echo "configure:15373: checking for $ac_hdr" >&5
15373 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
15374   echo $ac_n "(cached) $ac_c" 1>&6
15375 else
15376   cat > conftest.$ac_ext <<EOF
15377 #line 15378 "configure"
15378 #include "confdefs.h"
15379 #include <$ac_hdr>
15380 EOF
15381 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15382 { (eval echo configure:15383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15383 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15384 if test -z "$ac_err"; then
15385   rm -rf conftest*
15386   eval "ac_cv_header_$ac_safe=yes"
15387 else
15388   echo "$ac_err" >&5
15389   echo "configure: failed program was:" >&5
15390   cat conftest.$ac_ext >&5
15391   rm -rf conftest*
15392   eval "ac_cv_header_$ac_safe=no"
15393 fi
15394 rm -f conftest*
15395 fi
15396 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
15397   echo "$ac_t""yes" 1>&6
15398     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
15399   cat >> confdefs.h <<EOF
15400 #define $ac_tr_hdr 1
15401 EOF
15402  
15403 else
15404   echo "$ac_t""no" 1>&6
15405 fi
15406 done
15407
15408
15409         if test $ac_cv_header_slp_h = yes ; then
15410                 echo $ac_n "checking for SLPOpen in -lslp""... $ac_c" 1>&6
15411 echo "configure:15412: checking for SLPOpen in -lslp" >&5
15412 ac_lib_var=`echo slp'_'SLPOpen | sed 'y%./+-:%__p__%'`
15413 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15414   echo $ac_n "(cached) $ac_c" 1>&6
15415 else
15416   ac_save_LIBS="$LIBS"
15417 LIBS="-lslp  $LIBS"
15418 cat > conftest.$ac_ext <<EOF
15419 #line 15420 "configure"
15420 #include "confdefs.h"
15421 /* Override any gcc2 internal prototype to avoid an error.  */
15422 /* We use char because int might match the return type of a gcc2
15423     builtin and then its argument prototype would still apply.  */
15424 char SLPOpen();
15425
15426 int main() {
15427 SLPOpen()
15428 ; return 0; }
15429 EOF
15430 if { (eval echo configure:15431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15431   rm -rf conftest*
15432   eval "ac_cv_lib_$ac_lib_var=yes"
15433 else
15434   echo "configure: failed program was:" >&5
15435   cat conftest.$ac_ext >&5
15436   rm -rf conftest*
15437   eval "ac_cv_lib_$ac_lib_var=no"
15438 fi
15439 rm -f conftest*
15440 LIBS="$ac_save_LIBS"
15441
15442 fi
15443 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15444   echo "$ac_t""yes" 1>&6
15445   have_slp=yes
15446 else
15447   echo "$ac_t""no" 1>&6
15448 have_slp=no
15449 fi
15450
15451                 if test $have_slp = yes ; then
15452                         cat >> confdefs.h <<\EOF
15453 #define HAVE_SLP 1
15454 EOF
15455
15456                         SLAPD_SLP_LIBS=-lslp
15457                 fi
15458
15459         elif test $ol_enable_slp = yes ; then
15460                 { echo "configure: error: SLP not found" 1>&2; exit 1; }
15461         fi
15462 fi
15463
15464 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15465 echo "configure:15466: checking for ANSI C header files" >&5
15466 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15467   echo $ac_n "(cached) $ac_c" 1>&6
15468 else
15469   cat > conftest.$ac_ext <<EOF
15470 #line 15471 "configure"
15471 #include "confdefs.h"
15472 #include <stdlib.h>
15473 #include <stdarg.h>
15474 #include <string.h>
15475 #include <float.h>
15476 EOF
15477 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15478 { (eval echo configure:15479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15479 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15480 if test -z "$ac_err"; then
15481   rm -rf conftest*
15482   ac_cv_header_stdc=yes
15483 else
15484   echo "$ac_err" >&5
15485   echo "configure: failed program was:" >&5
15486   cat conftest.$ac_ext >&5
15487   rm -rf conftest*
15488   ac_cv_header_stdc=no
15489 fi
15490 rm -f conftest*
15491
15492 if test $ac_cv_header_stdc = yes; then
15493   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15494 cat > conftest.$ac_ext <<EOF
15495 #line 15496 "configure"
15496 #include "confdefs.h"
15497 #include <string.h>
15498 EOF
15499 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15500   egrep "memchr" >/dev/null 2>&1; then
15501   :
15502 else
15503   rm -rf conftest*
15504   ac_cv_header_stdc=no
15505 fi
15506 rm -f conftest*
15507
15508 fi
15509
15510 if test $ac_cv_header_stdc = yes; then
15511   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15512 cat > conftest.$ac_ext <<EOF
15513 #line 15514 "configure"
15514 #include "confdefs.h"
15515 #include <stdlib.h>
15516 EOF
15517 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15518   egrep "free" >/dev/null 2>&1; then
15519   :
15520 else
15521   rm -rf conftest*
15522   ac_cv_header_stdc=no
15523 fi
15524 rm -f conftest*
15525
15526 fi
15527
15528 if test $ac_cv_header_stdc = yes; then
15529   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15530 if test "$cross_compiling" = yes; then
15531   :
15532 else
15533   cat > conftest.$ac_ext <<EOF
15534 #line 15535 "configure"
15535 #include "confdefs.h"
15536 #include <ctype.h>
15537 #if ((' ' & 0x0FF) == 0x020)
15538 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15539 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15540 #else
15541 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15542  || ('j' <= (c) && (c) <= 'r') \
15543  || ('s' <= (c) && (c) <= 'z'))
15544 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15545 #endif
15546 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15547 int main () { int i; for (i = 0; i < 256; i++)
15548 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15549 exit (0); }
15550
15551 EOF
15552 if { (eval echo configure:15553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15553 then
15554   :
15555 else
15556   echo "configure: failed program was:" >&5
15557   cat conftest.$ac_ext >&5
15558   rm -fr conftest*
15559   ac_cv_header_stdc=no
15560 fi
15561 rm -fr conftest*
15562 fi
15563
15564 fi
15565 fi
15566
15567 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15568 if test $ac_cv_header_stdc = yes; then
15569   cat >> confdefs.h <<\EOF
15570 #define STDC_HEADERS 1
15571 EOF
15572
15573 fi
15574
15575 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15576 echo "configure:15577: checking for mode_t" >&5
15577 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15578   echo $ac_n "(cached) $ac_c" 1>&6
15579 else
15580   cat > conftest.$ac_ext <<EOF
15581 #line 15582 "configure"
15582 #include "confdefs.h"
15583 #include <sys/types.h>
15584 #if STDC_HEADERS
15585 #include <stdlib.h>
15586 #include <stddef.h>
15587 #endif
15588
15589 EOF
15590 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15591   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15592   rm -rf conftest*
15593   eval "ac_cv_type_mode_t=yes"
15594 else
15595   rm -rf conftest*
15596   eval "ac_cv_type_mode_t=no"
15597 fi
15598 rm -f conftest*
15599
15600 fi
15601 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15602   echo "$ac_t""yes" 1>&6
15603 else
15604   echo "$ac_t""no" 1>&6
15605   cat >> confdefs.h <<EOF
15606 #define mode_t int
15607 EOF
15608
15609 fi
15610
15611 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15612 echo "configure:15613: checking for off_t" >&5
15613 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15614   echo $ac_n "(cached) $ac_c" 1>&6
15615 else
15616   cat > conftest.$ac_ext <<EOF
15617 #line 15618 "configure"
15618 #include "confdefs.h"
15619 #include <sys/types.h>
15620 #if STDC_HEADERS
15621 #include <stdlib.h>
15622 #include <stddef.h>
15623 #endif
15624
15625 EOF
15626 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15627   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15628   rm -rf conftest*
15629   eval "ac_cv_type_off_t=yes"
15630 else
15631   rm -rf conftest*
15632   eval "ac_cv_type_off_t=no"
15633 fi
15634 rm -f conftest*
15635
15636 fi
15637 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15638   echo "$ac_t""yes" 1>&6
15639 else
15640   echo "$ac_t""no" 1>&6
15641   cat >> confdefs.h <<EOF
15642 #define off_t long
15643 EOF
15644
15645 fi
15646
15647 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15648 echo "configure:15649: checking for pid_t" >&5
15649 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15650   echo $ac_n "(cached) $ac_c" 1>&6
15651 else
15652   cat > conftest.$ac_ext <<EOF
15653 #line 15654 "configure"
15654 #include "confdefs.h"
15655 #include <sys/types.h>
15656 #if STDC_HEADERS
15657 #include <stdlib.h>
15658 #include <stddef.h>
15659 #endif
15660
15661 EOF
15662 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15663   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15664   rm -rf conftest*
15665   eval "ac_cv_type_pid_t=yes"
15666 else
15667   rm -rf conftest*
15668   eval "ac_cv_type_pid_t=no"
15669 fi
15670 rm -f conftest*
15671
15672 fi
15673 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15674   echo "$ac_t""yes" 1>&6
15675 else
15676   echo "$ac_t""no" 1>&6
15677   cat >> confdefs.h <<EOF
15678 #define pid_t int
15679 EOF
15680
15681 fi
15682
15683 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15684 echo "configure:15685: checking for ptrdiff_t" >&5
15685 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15686   echo $ac_n "(cached) $ac_c" 1>&6
15687 else
15688   cat > conftest.$ac_ext <<EOF
15689 #line 15690 "configure"
15690 #include "confdefs.h"
15691 #include <stddef.h>
15692 int main() {
15693 ptrdiff_t p
15694 ; return 0; }
15695 EOF
15696 if { (eval echo configure:15697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15697   rm -rf conftest*
15698   am_cv_type_ptrdiff_t=yes
15699 else
15700   echo "configure: failed program was:" >&5
15701   cat conftest.$ac_ext >&5
15702   rm -rf conftest*
15703   am_cv_type_ptrdiff_t=no
15704 fi
15705 rm -f conftest*
15706 fi
15707
15708 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15709    if test $am_cv_type_ptrdiff_t = yes; then
15710      cat >> confdefs.h <<\EOF
15711 #define HAVE_PTRDIFF_T 1
15712 EOF
15713
15714    fi
15715
15716 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15717 echo "configure:15718: checking return type of signal handlers" >&5
15718 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15719   echo $ac_n "(cached) $ac_c" 1>&6
15720 else
15721   cat > conftest.$ac_ext <<EOF
15722 #line 15723 "configure"
15723 #include "confdefs.h"
15724 #include <sys/types.h>
15725 #include <signal.h>
15726 #ifdef signal
15727 #undef signal
15728 #endif
15729 #ifdef __cplusplus
15730 extern "C" void (*signal (int, void (*)(int)))(int);
15731 #else
15732 void (*signal ()) ();
15733 #endif
15734
15735 int main() {
15736 int i;
15737 ; return 0; }
15738 EOF
15739 if { (eval echo configure:15740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15740   rm -rf conftest*
15741   ac_cv_type_signal=void
15742 else
15743   echo "configure: failed program was:" >&5
15744   cat conftest.$ac_ext >&5
15745   rm -rf conftest*
15746   ac_cv_type_signal=int
15747 fi
15748 rm -f conftest*
15749 fi
15750
15751 echo "$ac_t""$ac_cv_type_signal" 1>&6
15752 cat >> confdefs.h <<EOF
15753 #define RETSIGTYPE $ac_cv_type_signal
15754 EOF
15755
15756
15757 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15758 echo "configure:15759: checking for size_t" >&5
15759 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15760   echo $ac_n "(cached) $ac_c" 1>&6
15761 else
15762   cat > conftest.$ac_ext <<EOF
15763 #line 15764 "configure"
15764 #include "confdefs.h"
15765 #include <sys/types.h>
15766 #if STDC_HEADERS
15767 #include <stdlib.h>
15768 #include <stddef.h>
15769 #endif
15770
15771 EOF
15772 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15773   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15774   rm -rf conftest*
15775   eval "ac_cv_type_size_t=yes"
15776 else
15777   rm -rf conftest*
15778   eval "ac_cv_type_size_t=no"
15779 fi
15780 rm -f conftest*
15781
15782 fi
15783 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15784   echo "$ac_t""yes" 1>&6
15785 else
15786   echo "$ac_t""no" 1>&6
15787   cat >> confdefs.h <<EOF
15788 #define size_t unsigned
15789 EOF
15790
15791 fi
15792
15793
15794 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15795 echo "configure:15796: checking for ssize_t" >&5
15796 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15797   echo $ac_n "(cached) $ac_c" 1>&6
15798 else
15799   cat > conftest.$ac_ext <<EOF
15800 #line 15801 "configure"
15801 #include "confdefs.h"
15802 #include <sys/types.h>
15803 #if STDC_HEADERS
15804 #include <stdlib.h>
15805 #include <stddef.h>
15806 #endif
15807
15808 EOF
15809 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15810   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15811   rm -rf conftest*
15812   eval "ac_cv_type_ssize_t=yes"
15813 else
15814   rm -rf conftest*
15815   eval "ac_cv_type_ssize_t=no"
15816 fi
15817 rm -f conftest*
15818
15819 fi
15820 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15821   echo "$ac_t""yes" 1>&6
15822 else
15823   echo "$ac_t""no" 1>&6
15824   cat >> confdefs.h <<EOF
15825 #define ssize_t signed int
15826 EOF
15827
15828 fi
15829
15830 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15831 echo "configure:15832: checking for caddr_t" >&5
15832 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15833   echo $ac_n "(cached) $ac_c" 1>&6
15834 else
15835   cat > conftest.$ac_ext <<EOF
15836 #line 15837 "configure"
15837 #include "confdefs.h"
15838 #include <sys/types.h>
15839 #if STDC_HEADERS
15840 #include <stdlib.h>
15841 #include <stddef.h>
15842 #endif
15843
15844 EOF
15845 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15846   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15847   rm -rf conftest*
15848   eval "ac_cv_type_caddr_t=yes"
15849 else
15850   rm -rf conftest*
15851   eval "ac_cv_type_caddr_t=no"
15852 fi
15853 rm -f conftest*
15854
15855 fi
15856 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15857   echo "$ac_t""yes" 1>&6
15858 else
15859   echo "$ac_t""no" 1>&6
15860   cat >> confdefs.h <<EOF
15861 #define caddr_t char *
15862 EOF
15863
15864 fi
15865
15866
15867 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15868 echo "configure:15869: checking for socklen_t" >&5
15869 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15870   echo $ac_n "(cached) $ac_c" 1>&6
15871 else
15872   cat > conftest.$ac_ext <<EOF
15873 #line 15874 "configure"
15874 #include "confdefs.h"
15875
15876 #ifdef HAVE_SYS_TYPES_H
15877 #include <sys/types.h>
15878 #endif
15879 #ifdef HAVE_SYS_SOCKET_H
15880 #include <sys/socket.h>
15881 #endif
15882
15883 int main() {
15884 socklen_t len;
15885 ; return 0; }
15886 EOF
15887 if { (eval echo configure:15888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15888   rm -rf conftest*
15889   ol_cv_type_socklen_t=yes
15890 else
15891   echo "configure: failed program was:" >&5
15892   cat conftest.$ac_ext >&5
15893   rm -rf conftest*
15894   ol_cv_type_socklen_t=no
15895 fi
15896 rm -f conftest*
15897 fi
15898
15899 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15900   if test $ol_cv_type_socklen_t = no; then
15901     cat >> confdefs.h <<\EOF
15902 #define socklen_t int
15903 EOF
15904
15905   fi
15906  
15907 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15908 echo "configure:15909: checking for member st_blksize in aggregate type struct stat" >&5
15909 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15910   echo $ac_n "(cached) $ac_c" 1>&6
15911 else
15912   cat > conftest.$ac_ext <<EOF
15913 #line 15914 "configure"
15914 #include "confdefs.h"
15915 #include <sys/types.h>
15916 #include <sys/stat.h>
15917 int main() {
15918 struct stat foo; foo.st_blksize;
15919 ; return 0; }
15920 EOF
15921 if { (eval echo configure:15922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15922   rm -rf conftest*
15923   ac_cv_c_struct_member_st_blksize=yes
15924 else
15925   echo "configure: failed program was:" >&5
15926   cat conftest.$ac_ext >&5
15927   rm -rf conftest*
15928   ac_cv_c_struct_member_st_blksize=no
15929 fi
15930 rm -f conftest*
15931 fi
15932
15933 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15934 st_blksize="$ac_cv_c_struct_member_st_blksize"
15935 if test $ac_cv_c_struct_member_st_blksize = yes; then
15936   cat >> confdefs.h <<\EOF
15937 #define HAVE_ST_BLKSIZE 1
15938 EOF
15939
15940 fi
15941
15942 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15943 echo "configure:15944: checking whether time.h and sys/time.h may both be included" >&5
15944 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15945   echo $ac_n "(cached) $ac_c" 1>&6
15946 else
15947   cat > conftest.$ac_ext <<EOF
15948 #line 15949 "configure"
15949 #include "confdefs.h"
15950 #include <sys/types.h>
15951 #include <sys/time.h>
15952 #include <time.h>
15953 int main() {
15954 struct tm *tp;
15955 ; return 0; }
15956 EOF
15957 if { (eval echo configure:15958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15958   rm -rf conftest*
15959   ac_cv_header_time=yes
15960 else
15961   echo "configure: failed program was:" >&5
15962   cat conftest.$ac_ext >&5
15963   rm -rf conftest*
15964   ac_cv_header_time=no
15965 fi
15966 rm -f conftest*
15967 fi
15968
15969 echo "$ac_t""$ac_cv_header_time" 1>&6
15970 if test $ac_cv_header_time = yes; then
15971   cat >> confdefs.h <<\EOF
15972 #define TIME_WITH_SYS_TIME 1
15973 EOF
15974
15975 fi
15976
15977 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15978 echo "configure:15979: checking whether struct tm is in sys/time.h or time.h" >&5
15979 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15980   echo $ac_n "(cached) $ac_c" 1>&6
15981 else
15982   cat > conftest.$ac_ext <<EOF
15983 #line 15984 "configure"
15984 #include "confdefs.h"
15985 #include <sys/types.h>
15986 #include <time.h>
15987 int main() {
15988 struct tm *tp; tp->tm_sec;
15989 ; return 0; }
15990 EOF
15991 if { (eval echo configure:15992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15992   rm -rf conftest*
15993   ac_cv_struct_tm=time.h
15994 else
15995   echo "configure: failed program was:" >&5
15996   cat conftest.$ac_ext >&5
15997   rm -rf conftest*
15998   ac_cv_struct_tm=sys/time.h
15999 fi
16000 rm -f conftest*
16001 fi
16002
16003 echo "$ac_t""$ac_cv_struct_tm" 1>&6
16004 if test $ac_cv_struct_tm = sys/time.h; then
16005   cat >> confdefs.h <<\EOF
16006 #define TM_IN_SYS_TIME 1
16007 EOF
16008
16009 fi
16010
16011 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
16012 echo "configure:16013: checking for uid_t in sys/types.h" >&5
16013 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
16014   echo $ac_n "(cached) $ac_c" 1>&6
16015 else
16016   cat > conftest.$ac_ext <<EOF
16017 #line 16018 "configure"
16018 #include "confdefs.h"
16019 #include <sys/types.h>
16020 EOF
16021 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16022   egrep "uid_t" >/dev/null 2>&1; then
16023   rm -rf conftest*
16024   ac_cv_type_uid_t=yes
16025 else
16026   rm -rf conftest*
16027   ac_cv_type_uid_t=no
16028 fi
16029 rm -f conftest*
16030
16031 fi
16032
16033 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
16034 if test $ac_cv_type_uid_t = no; then
16035   cat >> confdefs.h <<\EOF
16036 #define uid_t int
16037 EOF
16038
16039   cat >> confdefs.h <<\EOF
16040 #define gid_t int
16041 EOF
16042
16043 fi
16044
16045 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
16046 echo "configure:16047: checking for sig_atomic_t" >&5
16047 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
16048   echo $ac_n "(cached) $ac_c" 1>&6
16049 else
16050   cat > conftest.$ac_ext <<EOF
16051 #line 16052 "configure"
16052 #include "confdefs.h"
16053 #include <signal.h>
16054 int main() {
16055 sig_atomic_t atomic;
16056 ; return 0; }
16057 EOF
16058 if { (eval echo configure:16059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16059   rm -rf conftest*
16060   ol_cv_type_sig_atomic_t=yes
16061 else
16062   echo "configure: failed program was:" >&5
16063   cat conftest.$ac_ext >&5
16064   rm -rf conftest*
16065   ol_cv_type_sig_atomic_t=no
16066 fi
16067 rm -f conftest*
16068 fi
16069
16070 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
16071   if test $ol_cv_type_sig_atomic_t = no; then
16072     cat >> confdefs.h <<\EOF
16073 #define sig_atomic_t int
16074 EOF
16075
16076   fi
16077  
16078
16079
16080 # test for pw_gecos in struct passwd
16081 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
16082 echo "configure:16083: checking struct passwd for pw_gecos" >&5
16083 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
16084   echo $ac_n "(cached) $ac_c" 1>&6
16085 else
16086   
16087         cat > conftest.$ac_ext <<EOF
16088 #line 16089 "configure"
16089 #include "confdefs.h"
16090 #include <pwd.h>
16091 int main() {
16092
16093         struct passwd pwd;
16094         pwd.pw_gecos = pwd.pw_name;
16095
16096 ; return 0; }
16097 EOF
16098 if { (eval echo configure:16099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16099   rm -rf conftest*
16100   ol_cv_struct_passwd_pw_gecos=yes
16101 else
16102   echo "configure: failed program was:" >&5
16103   cat conftest.$ac_ext >&5
16104   rm -rf conftest*
16105   ol_cv_struct_passwd_pw_gecos=no
16106 fi
16107 rm -f conftest*
16108 fi
16109
16110 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
16111 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
16112         cat >> confdefs.h <<\EOF
16113 #define HAVE_PW_GECOS 1
16114 EOF
16115
16116 fi
16117
16118 # test for pw_passwd in struct passwd
16119 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
16120 echo "configure:16121: checking struct passwd for pw_passwd" >&5
16121 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
16122   echo $ac_n "(cached) $ac_c" 1>&6
16123 else
16124   
16125         cat > conftest.$ac_ext <<EOF
16126 #line 16127 "configure"
16127 #include "confdefs.h"
16128 #include <pwd.h>
16129 int main() {
16130
16131         struct passwd pwd;
16132         pwd.pw_passwd = pwd.pw_name;
16133
16134 ; return 0; }
16135 EOF
16136 if { (eval echo configure:16137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16137   rm -rf conftest*
16138   ol_cv_struct_passwd_pw_passwd=yes
16139 else
16140   echo "configure: failed program was:" >&5
16141   cat conftest.$ac_ext >&5
16142   rm -rf conftest*
16143   ol_cv_struct_passwd_pw_passwd=no
16144 fi
16145 rm -f conftest*
16146 fi
16147
16148 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
16149 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
16150         cat >> confdefs.h <<\EOF
16151 #define HAVE_PW_PASSWD 1
16152 EOF
16153
16154 fi
16155
16156
16157 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
16158 echo "configure:16159: checking if toupper() requires islower()" >&5
16159 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
16160   echo $ac_n "(cached) $ac_c" 1>&6
16161 else
16162   
16163         if test "$cross_compiling" = yes; then
16164   ol_cv_c_upper_lower=safe
16165 else
16166   cat > conftest.$ac_ext <<EOF
16167 #line 16168 "configure"
16168 #include "confdefs.h"
16169
16170 #include <ctype.h>
16171 main()
16172 {
16173         if ('C' == toupper('C'))
16174                 exit(0);
16175         else
16176                 exit(1);
16177 }
16178 EOF
16179 if { (eval echo configure:16180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16180 then
16181   ol_cv_c_upper_lower=no
16182 else
16183   echo "configure: failed program was:" >&5
16184   cat conftest.$ac_ext >&5
16185   rm -fr conftest*
16186   ol_cv_c_upper_lower=yes
16187 fi
16188 rm -fr conftest*
16189 fi
16190
16191 fi
16192
16193 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
16194 if test $ol_cv_c_upper_lower != no ; then
16195         cat >> confdefs.h <<\EOF
16196 #define C_UPPER_LOWER 1
16197 EOF
16198
16199 fi
16200
16201 echo $ac_n "checking for working const""... $ac_c" 1>&6
16202 echo "configure:16203: checking for working const" >&5
16203 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
16204   echo $ac_n "(cached) $ac_c" 1>&6
16205 else
16206   cat > conftest.$ac_ext <<EOF
16207 #line 16208 "configure"
16208 #include "confdefs.h"
16209
16210 int main() {
16211
16212 /* Ultrix mips cc rejects this.  */
16213 typedef int charset[2]; const charset x;
16214 /* SunOS 4.1.1 cc rejects this.  */
16215 char const *const *ccp;
16216 char **p;
16217 /* NEC SVR4.0.2 mips cc rejects this.  */
16218 struct point {int x, y;};
16219 static struct point const zero = {0,0};
16220 /* AIX XL C 1.02.0.0 rejects this.
16221    It does not let you subtract one const X* pointer from another in an arm
16222    of an if-expression whose if-part is not a constant expression */
16223 const char *g = "string";
16224 ccp = &g + (g ? g-g : 0);
16225 /* HPUX 7.0 cc rejects these. */
16226 ++ccp;
16227 p = (char**) ccp;
16228 ccp = (char const *const *) p;
16229 { /* SCO 3.2v4 cc rejects this.  */
16230   char *t;
16231   char const *s = 0 ? (char *) 0 : (char const *) 0;
16232
16233   *t++ = 0;
16234 }
16235 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16236   int x[] = {25, 17};
16237   const int *foo = &x[0];
16238   ++foo;
16239 }
16240 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16241   typedef const int *iptr;
16242   iptr p = 0;
16243   ++p;
16244 }
16245 { /* AIX XL C 1.02.0.0 rejects this saying
16246      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16247   struct s { int j; const int *ap[3]; };
16248   struct s *b; b->j = 5;
16249 }
16250 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16251   const int foo = 10;
16252 }
16253
16254 ; return 0; }
16255 EOF
16256 if { (eval echo configure:16257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16257   rm -rf conftest*
16258   ac_cv_c_const=yes
16259 else
16260   echo "configure: failed program was:" >&5
16261   cat conftest.$ac_ext >&5
16262   rm -rf conftest*
16263   ac_cv_c_const=no
16264 fi
16265 rm -f conftest*
16266 fi
16267
16268 echo "$ac_t""$ac_cv_c_const" 1>&6
16269 if test $ac_cv_c_const = no; then
16270   cat >> confdefs.h <<\EOF
16271 #define const 
16272 EOF
16273
16274 fi
16275
16276 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16277 echo "configure:16278: checking if compiler understands volatile" >&5
16278 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16279   echo $ac_n "(cached) $ac_c" 1>&6
16280 else
16281   cat > conftest.$ac_ext <<EOF
16282 #line 16283 "configure"
16283 #include "confdefs.h"
16284 int x, y, z;
16285 int main() {
16286 volatile int a; int * volatile b = x ? &y : &z;
16287       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16288       *b = 0;
16289 ; return 0; }
16290 EOF
16291 if { (eval echo configure:16292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16292   rm -rf conftest*
16293   ol_cv_c_volatile=yes
16294 else
16295   echo "configure: failed program was:" >&5
16296   cat conftest.$ac_ext >&5
16297   rm -rf conftest*
16298   ol_cv_c_volatile=no
16299 fi
16300 rm -f conftest*
16301 fi
16302
16303 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16304   if test $ol_cv_c_volatile = yes; then
16305     : 
16306   else
16307     cat >> confdefs.h <<\EOF
16308 #define volatile 
16309 EOF
16310
16311   fi
16312  
16313
16314 if test $cross_compiling = yes ; then
16315         cat >> confdefs.h <<\EOF
16316 #define CROSS_COMPILING 1
16317 EOF
16318
16319 else
16320         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16321 echo "configure:16322: checking whether byte ordering is bigendian" >&5
16322 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16323   echo $ac_n "(cached) $ac_c" 1>&6
16324 else
16325   ac_cv_c_bigendian=unknown
16326 # See if sys/param.h defines the BYTE_ORDER macro.
16327 cat > conftest.$ac_ext <<EOF
16328 #line 16329 "configure"
16329 #include "confdefs.h"
16330 #include <sys/types.h>
16331 #include <sys/param.h>
16332 int main() {
16333
16334 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16335  bogus endian macros
16336 #endif
16337 ; return 0; }
16338 EOF
16339 if { (eval echo configure:16340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16340   rm -rf conftest*
16341   # It does; now see whether it defined to BIG_ENDIAN or not.
16342 cat > conftest.$ac_ext <<EOF
16343 #line 16344 "configure"
16344 #include "confdefs.h"
16345 #include <sys/types.h>
16346 #include <sys/param.h>
16347 int main() {
16348
16349 #if BYTE_ORDER != BIG_ENDIAN
16350  not big endian
16351 #endif
16352 ; return 0; }
16353 EOF
16354 if { (eval echo configure:16355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16355   rm -rf conftest*
16356   ac_cv_c_bigendian=yes
16357 else
16358   echo "configure: failed program was:" >&5
16359   cat conftest.$ac_ext >&5
16360   rm -rf conftest*
16361   ac_cv_c_bigendian=no
16362 fi
16363 rm -f conftest*
16364 else
16365   echo "configure: failed program was:" >&5
16366   cat conftest.$ac_ext >&5
16367 fi
16368 rm -f conftest*
16369 if test $ac_cv_c_bigendian = unknown; then
16370 if test "$cross_compiling" = yes; then
16371     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16372 else
16373   cat > conftest.$ac_ext <<EOF
16374 #line 16375 "configure"
16375 #include "confdefs.h"
16376 main () {
16377   /* Are we little or big endian?  From Harbison&Steele.  */
16378   union
16379   {
16380     long l;
16381     char c[sizeof (long)];
16382   } u;
16383   u.l = 1;
16384   exit (u.c[sizeof (long) - 1] == 1);
16385 }
16386 EOF
16387 if { (eval echo configure:16388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16388 then
16389   ac_cv_c_bigendian=no
16390 else
16391   echo "configure: failed program was:" >&5
16392   cat conftest.$ac_ext >&5
16393   rm -fr conftest*
16394   ac_cv_c_bigendian=yes
16395 fi
16396 rm -fr conftest*
16397 fi
16398
16399 fi
16400 fi
16401
16402 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16403 if test $ac_cv_c_bigendian = yes; then
16404   cat >> confdefs.h <<\EOF
16405 #define WORDS_BIGENDIAN 1
16406 EOF
16407
16408 fi
16409
16410 fi
16411
16412 echo $ac_n "checking size of short""... $ac_c" 1>&6
16413 echo "configure:16414: checking size of short" >&5 
16414 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16415   echo $ac_n "(cached) $ac_c" 1>&6
16416 else
16417   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16418   cat > conftest.$ac_ext <<EOF
16419 #line 16420 "configure"
16420 #include "confdefs.h"
16421 #include "confdefs.h" 
16422 #include <sys/types.h> 
16423  
16424
16425 int main() {
16426 switch (0) case 0: case (sizeof (short) == $ac_size):;
16427 ; return 0; }
16428 EOF
16429 if { (eval echo configure:16430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16430   rm -rf conftest*
16431   ac_cv_sizeof_short=$ac_size
16432 else
16433   echo "configure: failed program was:" >&5
16434   cat conftest.$ac_ext >&5
16435 fi
16436 rm -f conftest* 
16437   if test x$ac_cv_sizeof_short != x ; then break; fi 
16438 done 
16439
16440 fi
16441  
16442 if test x$ac_cv_sizeof_short = x ; then 
16443   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16444 fi 
16445 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16446 cat >> confdefs.h <<EOF
16447 #define SIZEOF_SHORT $ac_cv_sizeof_short
16448 EOF
16449  
16450  
16451 echo $ac_n "checking size of int""... $ac_c" 1>&6
16452 echo "configure:16453: checking size of int" >&5 
16453 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16454   echo $ac_n "(cached) $ac_c" 1>&6
16455 else
16456   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16457   cat > conftest.$ac_ext <<EOF
16458 #line 16459 "configure"
16459 #include "confdefs.h"
16460 #include "confdefs.h" 
16461 #include <sys/types.h> 
16462  
16463
16464 int main() {
16465 switch (0) case 0: case (sizeof (int) == $ac_size):;
16466 ; return 0; }
16467 EOF
16468 if { (eval echo configure:16469: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16469   rm -rf conftest*
16470   ac_cv_sizeof_int=$ac_size
16471 else
16472   echo "configure: failed program was:" >&5
16473   cat conftest.$ac_ext >&5
16474 fi
16475 rm -f conftest* 
16476   if test x$ac_cv_sizeof_int != x ; then break; fi 
16477 done 
16478
16479 fi
16480  
16481 if test x$ac_cv_sizeof_int = x ; then 
16482   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16483 fi 
16484 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16485 cat >> confdefs.h <<EOF
16486 #define SIZEOF_INT $ac_cv_sizeof_int
16487 EOF
16488  
16489  
16490 echo $ac_n "checking size of long""... $ac_c" 1>&6
16491 echo "configure:16492: checking size of long" >&5 
16492 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16493   echo $ac_n "(cached) $ac_c" 1>&6
16494 else
16495   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16496   cat > conftest.$ac_ext <<EOF
16497 #line 16498 "configure"
16498 #include "confdefs.h"
16499 #include "confdefs.h" 
16500 #include <sys/types.h> 
16501  
16502
16503 int main() {
16504 switch (0) case 0: case (sizeof (long) == $ac_size):;
16505 ; return 0; }
16506 EOF
16507 if { (eval echo configure:16508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16508   rm -rf conftest*
16509   ac_cv_sizeof_long=$ac_size
16510 else
16511   echo "configure: failed program was:" >&5
16512   cat conftest.$ac_ext >&5
16513 fi
16514 rm -f conftest* 
16515   if test x$ac_cv_sizeof_long != x ; then break; fi 
16516 done 
16517
16518 fi
16519  
16520 if test x$ac_cv_sizeof_long = x ; then 
16521   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16522 fi 
16523 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16524 cat >> confdefs.h <<EOF
16525 #define SIZEOF_LONG $ac_cv_sizeof_long
16526 EOF
16527  
16528
16529
16530 if test "$ac_cv_sizeof_int" -lt 4 ; then
16531         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16532
16533         cat >> confdefs.h <<\EOF
16534 #define LBER_INT_T long
16535 EOF
16536
16537 else
16538         cat >> confdefs.h <<\EOF
16539 #define LBER_INT_T int
16540 EOF
16541
16542 fi
16543
16544 cat >> confdefs.h <<\EOF
16545 #define LBER_LEN_T long
16546 EOF
16547
16548 cat >> confdefs.h <<\EOF
16549 #define LBER_SOCKET_T int
16550 EOF
16551
16552 cat >> confdefs.h <<\EOF
16553 #define LBER_TAG_T long
16554 EOF
16555
16556
16557 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16558 echo "configure:16559: checking for 8-bit clean memcmp" >&5
16559 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16560   echo $ac_n "(cached) $ac_c" 1>&6
16561 else
16562   if test "$cross_compiling" = yes; then
16563   ac_cv_func_memcmp_clean=no
16564 else
16565   cat > conftest.$ac_ext <<EOF
16566 #line 16567 "configure"
16567 #include "confdefs.h"
16568
16569 main()
16570 {
16571   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16572   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16573 }
16574
16575 EOF
16576 if { (eval echo configure:16577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16577 then
16578   ac_cv_func_memcmp_clean=yes
16579 else
16580   echo "configure: failed program was:" >&5
16581   cat conftest.$ac_ext >&5
16582   rm -fr conftest*
16583   ac_cv_func_memcmp_clean=no
16584 fi
16585 rm -fr conftest*
16586 fi
16587
16588 fi
16589
16590 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16591 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16592
16593 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16594 echo "configure:16595: checking for strftime" >&5
16595 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16596   echo $ac_n "(cached) $ac_c" 1>&6
16597 else
16598   cat > conftest.$ac_ext <<EOF
16599 #line 16600 "configure"
16600 #include "confdefs.h"
16601 /* System header to define __stub macros and hopefully few prototypes,
16602     which can conflict with char strftime(); below.  */
16603 #include <assert.h>
16604 /* Override any gcc2 internal prototype to avoid an error.  */
16605 /* We use char because int might match the return type of a gcc2
16606     builtin and then its argument prototype would still apply.  */
16607 char strftime();
16608 char (*f)();
16609
16610 int main() {
16611
16612 /* The GNU C library defines this for functions which it implements
16613     to always fail with ENOSYS.  Some functions are actually named
16614     something starting with __ and the normal name is an alias.  */
16615 #if defined (__stub_strftime) || defined (__stub___strftime)
16616 choke me
16617 #else
16618 f = strftime;
16619 #endif
16620
16621 ; return 0; }
16622 EOF
16623 if { (eval echo configure:16624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16624   rm -rf conftest*
16625   eval "ac_cv_func_strftime=yes"
16626 else
16627   echo "configure: failed program was:" >&5
16628   cat conftest.$ac_ext >&5
16629   rm -rf conftest*
16630   eval "ac_cv_func_strftime=no"
16631 fi
16632 rm -f conftest*
16633 fi
16634
16635 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16636   echo "$ac_t""yes" 1>&6
16637   cat >> confdefs.h <<\EOF
16638 #define HAVE_STRFTIME 1
16639 EOF
16640
16641 else
16642   echo "$ac_t""no" 1>&6
16643 # strftime is in -lintl on SCO UNIX.
16644 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16645 echo "configure:16646: checking for strftime in -lintl" >&5
16646 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16647 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16648   echo $ac_n "(cached) $ac_c" 1>&6
16649 else
16650   ac_save_LIBS="$LIBS"
16651 LIBS="-lintl  $LIBS"
16652 cat > conftest.$ac_ext <<EOF
16653 #line 16654 "configure"
16654 #include "confdefs.h"
16655 /* Override any gcc2 internal prototype to avoid an error.  */
16656 /* We use char because int might match the return type of a gcc2
16657     builtin and then its argument prototype would still apply.  */
16658 char strftime();
16659
16660 int main() {
16661 strftime()
16662 ; return 0; }
16663 EOF
16664 if { (eval echo configure:16665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16665   rm -rf conftest*
16666   eval "ac_cv_lib_$ac_lib_var=yes"
16667 else
16668   echo "configure: failed program was:" >&5
16669   cat conftest.$ac_ext >&5
16670   rm -rf conftest*
16671   eval "ac_cv_lib_$ac_lib_var=no"
16672 fi
16673 rm -f conftest*
16674 LIBS="$ac_save_LIBS"
16675
16676 fi
16677 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16678   echo "$ac_t""yes" 1>&6
16679   cat >> confdefs.h <<\EOF
16680 #define HAVE_STRFTIME 1
16681 EOF
16682
16683 LIBS="-lintl $LIBS"
16684 else
16685   echo "$ac_t""no" 1>&6
16686 fi
16687
16688 fi
16689
16690
16691 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16692 echo "configure:16693: checking for inet_aton()" >&5
16693 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16694   echo $ac_n "(cached) $ac_c" 1>&6
16695 else
16696   cat > conftest.$ac_ext <<EOF
16697 #line 16698 "configure"
16698 #include "confdefs.h"
16699
16700 #ifdef HAVE_SYS_TYPES_H
16701 #       include <sys/types.h>
16702 #endif
16703 #ifdef HAVE_SYS_SOCKET_H
16704 #       include <sys/socket.h>
16705 #       ifdef HAVE_SYS_SELECT_H
16706 #               include <sys/select.h>
16707 #       endif
16708 #       include <netinet/in.h>
16709 #       ifdef HAVE_ARPA_INET_H
16710 #               include <arpa/inet.h>
16711 #       endif
16712 #endif
16713
16714 int main() {
16715 struct in_addr in;
16716 int rc = inet_aton( "255.255.255.255", &in );
16717 ; return 0; }
16718 EOF
16719 if { (eval echo configure:16720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16720   rm -rf conftest*
16721   ol_cv_func_inet_aton=yes
16722 else
16723   echo "configure: failed program was:" >&5
16724   cat conftest.$ac_ext >&5
16725   rm -rf conftest*
16726   ol_cv_func_inet_aton=no
16727 fi
16728 rm -f conftest*
16729 fi
16730
16731 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16732   if test $ol_cv_func_inet_aton != no; then
16733     cat >> confdefs.h <<\EOF
16734 #define HAVE_INET_ATON 1
16735 EOF
16736
16737   fi
16738  
16739
16740 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16741 echo "configure:16742: checking for _spawnlp" >&5
16742 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16743   echo $ac_n "(cached) $ac_c" 1>&6
16744 else
16745   cat > conftest.$ac_ext <<EOF
16746 #line 16747 "configure"
16747 #include "confdefs.h"
16748 /* System header to define __stub macros and hopefully few prototypes,
16749     which can conflict with char _spawnlp(); below.  */
16750 #include <assert.h>
16751 /* Override any gcc2 internal prototype to avoid an error.  */
16752 /* We use char because int might match the return type of a gcc2
16753     builtin and then its argument prototype would still apply.  */
16754 char _spawnlp();
16755 char (*f)();
16756
16757 int main() {
16758
16759 /* The GNU C library defines this for functions which it implements
16760     to always fail with ENOSYS.  Some functions are actually named
16761     something starting with __ and the normal name is an alias.  */
16762 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16763 choke me
16764 #else
16765 f = _spawnlp;
16766 #endif
16767
16768 ; return 0; }
16769 EOF
16770 if { (eval echo configure:16771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16771   rm -rf conftest*
16772   eval "ac_cv_func__spawnlp=yes"
16773 else
16774   echo "configure: failed program was:" >&5
16775   cat conftest.$ac_ext >&5
16776   rm -rf conftest*
16777   eval "ac_cv_func__spawnlp=no"
16778 fi
16779 rm -f conftest*
16780 fi
16781
16782 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16783   echo "$ac_t""yes" 1>&6
16784   cat >> confdefs.h <<\EOF
16785 #define HAVE_SPAWNLP 1
16786 EOF
16787
16788 else
16789   echo "$ac_t""no" 1>&6
16790 fi
16791
16792
16793 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16794 echo "configure:16795: checking for _snprintf" >&5
16795 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16796   echo $ac_n "(cached) $ac_c" 1>&6
16797 else
16798   cat > conftest.$ac_ext <<EOF
16799 #line 16800 "configure"
16800 #include "confdefs.h"
16801 /* System header to define __stub macros and hopefully few prototypes,
16802     which can conflict with char _snprintf(); below.  */
16803 #include <assert.h>
16804 /* Override any gcc2 internal prototype to avoid an error.  */
16805 /* We use char because int might match the return type of a gcc2
16806     builtin and then its argument prototype would still apply.  */
16807 char _snprintf();
16808 char (*f)();
16809
16810 int main() {
16811
16812 /* The GNU C library defines this for functions which it implements
16813     to always fail with ENOSYS.  Some functions are actually named
16814     something starting with __ and the normal name is an alias.  */
16815 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16816 choke me
16817 #else
16818 f = _snprintf;
16819 #endif
16820
16821 ; return 0; }
16822 EOF
16823 if { (eval echo configure:16824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16824   rm -rf conftest*
16825   eval "ac_cv_func__snprintf=yes"
16826 else
16827   echo "configure: failed program was:" >&5
16828   cat conftest.$ac_ext >&5
16829   rm -rf conftest*
16830   eval "ac_cv_func__snprintf=no"
16831 fi
16832 rm -f conftest*
16833 fi
16834
16835 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16836   echo "$ac_t""yes" 1>&6
16837   ac_cv_func_snprintf=yes
16838         cat >> confdefs.h <<\EOF
16839 #define snprintf _snprintf
16840 EOF
16841
16842
16843 else
16844   echo "$ac_t""no" 1>&6
16845 fi
16846
16847
16848 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16849 echo "configure:16850: checking for _vsnprintf" >&5
16850 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16851   echo $ac_n "(cached) $ac_c" 1>&6
16852 else
16853   cat > conftest.$ac_ext <<EOF
16854 #line 16855 "configure"
16855 #include "confdefs.h"
16856 /* System header to define __stub macros and hopefully few prototypes,
16857     which can conflict with char _vsnprintf(); below.  */
16858 #include <assert.h>
16859 /* Override any gcc2 internal prototype to avoid an error.  */
16860 /* We use char because int might match the return type of a gcc2
16861     builtin and then its argument prototype would still apply.  */
16862 char _vsnprintf();
16863 char (*f)();
16864
16865 int main() {
16866
16867 /* The GNU C library defines this for functions which it implements
16868     to always fail with ENOSYS.  Some functions are actually named
16869     something starting with __ and the normal name is an alias.  */
16870 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16871 choke me
16872 #else
16873 f = _vsnprintf;
16874 #endif
16875
16876 ; return 0; }
16877 EOF
16878 if { (eval echo configure:16879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16879   rm -rf conftest*
16880   eval "ac_cv_func__vsnprintf=yes"
16881 else
16882   echo "configure: failed program was:" >&5
16883   cat conftest.$ac_ext >&5
16884   rm -rf conftest*
16885   eval "ac_cv_func__vsnprintf=no"
16886 fi
16887 rm -f conftest*
16888 fi
16889
16890 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16891   echo "$ac_t""yes" 1>&6
16892   ac_cv_func_vsnprintf=yes
16893         cat >> confdefs.h <<\EOF
16894 #define vsnprintf _vsnprintf
16895 EOF
16896
16897
16898 else
16899   echo "$ac_t""no" 1>&6
16900 fi
16901
16902
16903 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16904 echo "configure:16905: checking for vprintf" >&5
16905 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16906   echo $ac_n "(cached) $ac_c" 1>&6
16907 else
16908   cat > conftest.$ac_ext <<EOF
16909 #line 16910 "configure"
16910 #include "confdefs.h"
16911 /* System header to define __stub macros and hopefully few prototypes,
16912     which can conflict with char vprintf(); below.  */
16913 #include <assert.h>
16914 /* Override any gcc2 internal prototype to avoid an error.  */
16915 /* We use char because int might match the return type of a gcc2
16916     builtin and then its argument prototype would still apply.  */
16917 char vprintf();
16918 char (*f)();
16919
16920 int main() {
16921
16922 /* The GNU C library defines this for functions which it implements
16923     to always fail with ENOSYS.  Some functions are actually named
16924     something starting with __ and the normal name is an alias.  */
16925 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16926 choke me
16927 #else
16928 f = vprintf;
16929 #endif
16930
16931 ; return 0; }
16932 EOF
16933 if { (eval echo configure:16934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16934   rm -rf conftest*
16935   eval "ac_cv_func_vprintf=yes"
16936 else
16937   echo "configure: failed program was:" >&5
16938   cat conftest.$ac_ext >&5
16939   rm -rf conftest*
16940   eval "ac_cv_func_vprintf=no"
16941 fi
16942 rm -f conftest*
16943 fi
16944
16945 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16946   echo "$ac_t""yes" 1>&6
16947   cat >> confdefs.h <<\EOF
16948 #define HAVE_VPRINTF 1
16949 EOF
16950
16951 else
16952   echo "$ac_t""no" 1>&6
16953 fi
16954
16955 if test "$ac_cv_func_vprintf" != yes; then
16956 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16957 echo "configure:16958: checking for _doprnt" >&5
16958 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16959   echo $ac_n "(cached) $ac_c" 1>&6
16960 else
16961   cat > conftest.$ac_ext <<EOF
16962 #line 16963 "configure"
16963 #include "confdefs.h"
16964 /* System header to define __stub macros and hopefully few prototypes,
16965     which can conflict with char _doprnt(); below.  */
16966 #include <assert.h>
16967 /* Override any gcc2 internal prototype to avoid an error.  */
16968 /* We use char because int might match the return type of a gcc2
16969     builtin and then its argument prototype would still apply.  */
16970 char _doprnt();
16971 char (*f)();
16972
16973 int main() {
16974
16975 /* The GNU C library defines this for functions which it implements
16976     to always fail with ENOSYS.  Some functions are actually named
16977     something starting with __ and the normal name is an alias.  */
16978 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16979 choke me
16980 #else
16981 f = _doprnt;
16982 #endif
16983
16984 ; return 0; }
16985 EOF
16986 if { (eval echo configure:16987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16987   rm -rf conftest*
16988   eval "ac_cv_func__doprnt=yes"
16989 else
16990   echo "configure: failed program was:" >&5
16991   cat conftest.$ac_ext >&5
16992   rm -rf conftest*
16993   eval "ac_cv_func__doprnt=no"
16994 fi
16995 rm -f conftest*
16996 fi
16997
16998 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16999   echo "$ac_t""yes" 1>&6
17000   cat >> confdefs.h <<\EOF
17001 #define HAVE_DOPRNT 1
17002 EOF
17003
17004 else
17005   echo "$ac_t""no" 1>&6
17006 fi
17007
17008 fi
17009
17010
17011 if test $ac_cv_func_vprintf = yes ; then
17012                 for ac_func in vsnprintf vsprintf
17013 do
17014 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17015 echo "configure:17016: checking for $ac_func" >&5
17016 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17017   echo $ac_n "(cached) $ac_c" 1>&6
17018 else
17019   cat > conftest.$ac_ext <<EOF
17020 #line 17021 "configure"
17021 #include "confdefs.h"
17022 /* System header to define __stub macros and hopefully few prototypes,
17023     which can conflict with char $ac_func(); below.  */
17024 #include <assert.h>
17025 /* Override any gcc2 internal prototype to avoid an error.  */
17026 /* We use char because int might match the return type of a gcc2
17027     builtin and then its argument prototype would still apply.  */
17028 char $ac_func();
17029 char (*f)();
17030
17031 int main() {
17032
17033 /* The GNU C library defines this for functions which it implements
17034     to always fail with ENOSYS.  Some functions are actually named
17035     something starting with __ and the normal name is an alias.  */
17036 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17037 choke me
17038 #else
17039 f = $ac_func;
17040 #endif
17041
17042 ; return 0; }
17043 EOF
17044 if { (eval echo configure:17045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17045   rm -rf conftest*
17046   eval "ac_cv_func_$ac_func=yes"
17047 else
17048   echo "configure: failed program was:" >&5
17049   cat conftest.$ac_ext >&5
17050   rm -rf conftest*
17051   eval "ac_cv_func_$ac_func=no"
17052 fi
17053 rm -f conftest*
17054 fi
17055
17056 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17057   echo "$ac_t""yes" 1>&6
17058     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17059   cat >> confdefs.h <<EOF
17060 #define $ac_tr_func 1
17061 EOF
17062  
17063 else
17064   echo "$ac_t""no" 1>&6
17065 fi
17066 done
17067
17068 fi
17069
17070 for ac_func in \
17071         bcopy                   \
17072         closesocket             \
17073         chroot                  \
17074         endgrent                \
17075         endpwent                \
17076         fcntl                   \
17077         flock                   \
17078         getdtablesize   \
17079         getgrgid                \
17080         gethostname             \
17081         getpass                 \
17082         getpassphrase   \
17083         getpwuid                \
17084         getpwnam                \
17085         getspnam                \
17086         gettimeofday    \
17087         initgroups              \
17088         lockf                   \
17089         memcpy                  \
17090         memmove                 \
17091         pipe                    \
17092         read                    \
17093         recv                    \
17094         recvfrom                \
17095         setpwfile               \
17096         setgid                  \
17097         setegid                 \
17098         setsid                  \
17099         setuid                  \
17100         seteuid                 \
17101         sigaction               \
17102         signal                  \
17103         sigset                  \
17104         strdup                  \
17105         strerror                \
17106         strpbrk                 \
17107         strrchr                 \
17108         strsep                  \
17109         strstr                  \
17110         strtol                  \
17111         strtoul                 \
17112         strspn                  \
17113         sysconf                 \
17114         waitpid                 \
17115         wait4                   \
17116         write                   \
17117         send                    \
17118         sendto                  \
17119
17120 do
17121 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17122 echo "configure:17123: checking for $ac_func" >&5
17123 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17124   echo $ac_n "(cached) $ac_c" 1>&6
17125 else
17126   cat > conftest.$ac_ext <<EOF
17127 #line 17128 "configure"
17128 #include "confdefs.h"
17129 /* System header to define __stub macros and hopefully few prototypes,
17130     which can conflict with char $ac_func(); below.  */
17131 #include <assert.h>
17132 /* Override any gcc2 internal prototype to avoid an error.  */
17133 /* We use char because int might match the return type of a gcc2
17134     builtin and then its argument prototype would still apply.  */
17135 char $ac_func();
17136 char (*f)();
17137
17138 int main() {
17139
17140 /* The GNU C library defines this for functions which it implements
17141     to always fail with ENOSYS.  Some functions are actually named
17142     something starting with __ and the normal name is an alias.  */
17143 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17144 choke me
17145 #else
17146 f = $ac_func;
17147 #endif
17148
17149 ; return 0; }
17150 EOF
17151 if { (eval echo configure:17152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17152   rm -rf conftest*
17153   eval "ac_cv_func_$ac_func=yes"
17154 else
17155   echo "configure: failed program was:" >&5
17156   cat conftest.$ac_ext >&5
17157   rm -rf conftest*
17158   eval "ac_cv_func_$ac_func=no"
17159 fi
17160 rm -f conftest*
17161 fi
17162
17163 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17164   echo "$ac_t""yes" 1>&6
17165     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17166   cat >> confdefs.h <<EOF
17167 #define $ac_tr_func 1
17168 EOF
17169  
17170 else
17171   echo "$ac_t""no" 1>&6
17172 fi
17173 done
17174
17175
17176 for ac_func in getopt
17177 do
17178 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
17179 echo "configure:17180: checking for $ac_func" >&5
17180 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
17181   echo $ac_n "(cached) $ac_c" 1>&6
17182 else
17183   cat > conftest.$ac_ext <<EOF
17184 #line 17185 "configure"
17185 #include "confdefs.h"
17186 /* System header to define __stub macros and hopefully few prototypes,
17187     which can conflict with char $ac_func(); below.  */
17188 #include <assert.h>
17189 /* Override any gcc2 internal prototype to avoid an error.  */
17190 /* We use char because int might match the return type of a gcc2
17191     builtin and then its argument prototype would still apply.  */
17192 char $ac_func();
17193 char (*f)();
17194
17195 int main() {
17196
17197 /* The GNU C library defines this for functions which it implements
17198     to always fail with ENOSYS.  Some functions are actually named
17199     something starting with __ and the normal name is an alias.  */
17200 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17201 choke me
17202 #else
17203 f = $ac_func;
17204 #endif
17205
17206 ; return 0; }
17207 EOF
17208 if { (eval echo configure:17209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17209   rm -rf conftest*
17210   eval "ac_cv_func_$ac_func=yes"
17211 else
17212   echo "configure: failed program was:" >&5
17213   cat conftest.$ac_ext >&5
17214   rm -rf conftest*
17215   eval "ac_cv_func_$ac_func=no"
17216 fi
17217 rm -f conftest*
17218 fi
17219
17220 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17221   echo "$ac_t""yes" 1>&6
17222     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17223   cat >> confdefs.h <<EOF
17224 #define $ac_tr_func 1
17225 EOF
17226  
17227 else
17228   echo "$ac_t""no" 1>&6
17229 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17230 fi
17231 done
17232
17233
17234
17235 if test "$ac_cv_func_getopt" != yes; then
17236     LIBSRCS="$LIBSRCS getopt.c"
17237 fi
17238
17239 # Check Configuration
17240 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17241 echo "configure:17242: checking declaration of sys_errlist" >&5
17242 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17243   echo $ac_n "(cached) $ac_c" 1>&6
17244 else
17245   
17246         cat > conftest.$ac_ext <<EOF
17247 #line 17248 "configure"
17248 #include "confdefs.h"
17249
17250 #include <stdio.h>
17251 #include <sys/types.h>
17252 #include <errno.h>
17253 #ifdef WINNT
17254 #include <stdlib.h>
17255 #endif 
17256 int main() {
17257 char *c = (char *) *sys_errlist
17258 ; return 0; }
17259 EOF
17260 if { (eval echo configure:17261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17261   rm -rf conftest*
17262   ol_cv_dcl_sys_errlist=yes
17263         ol_cv_have_sys_errlist=yes
17264 else
17265   echo "configure: failed program was:" >&5
17266   cat conftest.$ac_ext >&5
17267   rm -rf conftest*
17268   ol_cv_dcl_sys_errlist=no
17269 fi
17270 rm -f conftest*
17271 fi
17272
17273 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17274 #
17275 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17276 if test $ol_cv_dcl_sys_errlist = no ; then
17277         cat >> confdefs.h <<\EOF
17278 #define DECL_SYS_ERRLIST 1
17279 EOF
17280
17281
17282         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17283 echo "configure:17284: checking existence of sys_errlist" >&5
17284 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17285   echo $ac_n "(cached) $ac_c" 1>&6
17286 else
17287   
17288                 cat > conftest.$ac_ext <<EOF
17289 #line 17290 "configure"
17290 #include "confdefs.h"
17291 #include <errno.h>
17292 int main() {
17293 char *c = (char *) *sys_errlist
17294 ; return 0; }
17295 EOF
17296 if { (eval echo configure:17297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17297   rm -rf conftest*
17298   ol_cv_have_sys_errlist=yes
17299 else
17300   echo "configure: failed program was:" >&5
17301   cat conftest.$ac_ext >&5
17302   rm -rf conftest*
17303   ol_cv_have_sys_errlist=no
17304 fi
17305 rm -f conftest*
17306 fi
17307
17308 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17309 fi
17310 if test $ol_cv_have_sys_errlist = yes ; then
17311         cat >> confdefs.h <<\EOF
17312 #define HAVE_SYS_ERRLIST 1
17313 EOF
17314
17315 fi
17316
17317
17318
17319 if test "$ol_enable_debug" != no ; then
17320         cat >> confdefs.h <<\EOF
17321 #define LDAP_DEBUG 1
17322 EOF
17323
17324 fi
17325 if test "$ol_enable_syslog" = yes ; then
17326         cat >> confdefs.h <<\EOF
17327 #define LDAP_SYSLOG 1
17328 EOF
17329
17330 fi
17331 if test "$ol_enable_cache" = no ; then
17332         cat >> confdefs.h <<\EOF
17333 #define LDAP_NOCACHE 1
17334 EOF
17335
17336 fi
17337 if test "$ol_link_kbind" != no ; then
17338         cat >> confdefs.h <<\EOF
17339 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17340 EOF
17341
17342 fi
17343 if test "$ol_enable_proctitle" != no ; then
17344         cat >> confdefs.h <<\EOF
17345 #define LDAP_PROCTITLE 1
17346 EOF
17347
17348 fi
17349 if test "$ol_enable_referrals" != no ; then
17350         cat >> confdefs.h <<\EOF
17351 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17352 EOF
17353
17354 fi
17355 if test "$ol_enable_local" != no; then
17356         cat >> confdefs.h <<\EOF
17357 #define LDAP_PF_LOCAL 1
17358 EOF
17359
17360 fi
17361 if test "$ol_link_ipv6" != no; then
17362         cat >> confdefs.h <<\EOF
17363 #define LDAP_PF_INET6 1
17364 EOF
17365
17366 fi
17367 if test "$ol_enable_cleartext" != no ; then
17368         cat >> confdefs.h <<\EOF
17369 #define SLAPD_CLEARTEXT 1
17370 EOF
17371
17372 fi
17373 if test "$ol_enable_crypt" != no ; then
17374         cat >> confdefs.h <<\EOF
17375 #define SLAPD_CRYPT 1
17376 EOF
17377
17378 fi
17379 if test "$ol_link_kpasswd" != no ; then
17380         cat >> confdefs.h <<\EOF
17381 #define SLAPD_KPASSWD 1
17382 EOF
17383
17384 fi
17385 if test "$ol_link_spasswd" != no ; then
17386         cat >> confdefs.h <<\EOF
17387 #define SLAPD_SPASSWD 1
17388 EOF
17389
17390 fi
17391 if test "$ol_enable_phonetic" != no ; then
17392         cat >> confdefs.h <<\EOF
17393 #define SLAPD_PHONETIC 1
17394 EOF
17395
17396 fi
17397 if test "$ol_enable_rlookups" != no ; then
17398         cat >> confdefs.h <<\EOF
17399 #define SLAPD_RLOOKUPS 1
17400 EOF
17401
17402 fi
17403 if test "$ol_enable_aci" != no ; then
17404         cat >> confdefs.h <<\EOF
17405 #define SLAPD_ACI_ENABLED 1
17406 EOF
17407
17408 fi
17409
17410 if test "$ol_link_modules" != no ; then
17411         cat >> confdefs.h <<\EOF
17412 #define SLAPD_MODULES 1
17413 EOF
17414
17415         BUILD_SLAPD=yes
17416         SLAPD_MODULES_LDFLAGS="-dlopen self"
17417 fi
17418
17419 if test "$ol_enable_bdb" != no ; then
17420         cat >> confdefs.h <<\EOF
17421 #define SLAPD_BDB 1
17422 EOF
17423
17424         BUILD_SLAPD=yes
17425         BUILD_BDB=yes
17426         if test "$ol_with_bdb_module" != static ; then
17427                 cat >> confdefs.h <<\EOF
17428 #define SLAPD_BDB_DYNAMIC 1
17429 EOF
17430
17431                 BUILD_BDB=mod
17432                 BUILD_BDB_DYNAMIC=shared
17433                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-bdb/back_bdb.la"
17434         fi
17435 fi
17436
17437 if test "$ol_link_dnssrv" != no ; then
17438         cat >> confdefs.h <<\EOF
17439 #define SLAPD_DNSSRV 1
17440 EOF
17441
17442         BUILD_SLAPD=yes
17443         BUILD_DNSSRV=yes
17444         if test "$ol_with_dnssrv_module" != static ; then
17445                 cat >> confdefs.h <<\EOF
17446 #define SLAPD_DNSSRV_DYNAMIC 1
17447 EOF
17448
17449                 BUILD_DNSSRV=mod
17450                 BUILD_DNSSRV_DYNAMIC=shared
17451                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17452         fi
17453 fi
17454
17455 if test "$ol_enable_ldap" != no ; then
17456         cat >> confdefs.h <<\EOF
17457 #define SLAPD_LDAP 1
17458 EOF
17459
17460         BUILD_SLAPD=yes
17461         BUILD_LDAP=yes
17462         if test "$ol_with_ldap_module" != static ; then
17463                 cat >> confdefs.h <<\EOF
17464 #define SLAPD_LDAP_DYNAMIC 1
17465 EOF
17466
17467                 BUILD_LDAP=mod
17468                 BUILD_LDAP_DYNAMIC=shared
17469                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17470         fi
17471 fi
17472
17473 if test "$ol_link_ldbm" != no ; then
17474         cat >> confdefs.h <<\EOF
17475 #define SLAPD_LDBM 1
17476 EOF
17477
17478         BUILD_SLAPD=yes
17479         BUILD_LDBM=yes
17480         if test "$ol_with_ldbm_module" != static ; then
17481                 cat >> confdefs.h <<\EOF
17482 #define SLAPD_LDBM_DYNAMIC 1
17483 EOF
17484
17485                 BUILD_LDBM=mod
17486                 BUILD_LDBM_DYNAMIC=shared
17487                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17488         fi
17489 fi
17490
17491 if test "$ol_enable_meta" != no ; then
17492         if test "$ol_enable_ldap" = no ; then
17493                 { echo "configure: error: need --enable-ldap to use --enable-meta" 1>&2; exit 1; }
17494         fi
17495         if test "$ol_enable_rewrite" = no ; then
17496                 { echo "configure: error: need --enable-rewrite to use --enable-meta" 1>&2; exit 1; }
17497         fi
17498         cat >> confdefs.h <<\EOF
17499 #define SLAPD_META 1
17500 EOF
17501
17502         BUILD_SLAPD=yes
17503         BUILD_META=yes
17504         if test "$ol_with_meta_module" != static ; then
17505                 cat >> confdefs.h <<\EOF
17506 #define SLAPD_META_DYNAMIC 1
17507 EOF
17508
17509                 BUILD_META=mod
17510                 BUILD_META_DYNAMIC=shared
17511                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-meta/back_meta.la"
17512         fi
17513 fi
17514
17515 if test "$ol_enable_passwd" != no ; then
17516         cat >> confdefs.h <<\EOF
17517 #define SLAPD_PASSWD 1
17518 EOF
17519
17520         BUILD_SLAPD=yes
17521         BUILD_PASSWD=yes
17522         if test "$ol_with_passwd_module" != static ; then
17523                 cat >> confdefs.h <<\EOF
17524 #define SLAPD_PASSWD_DYNAMIC 1
17525 EOF
17526
17527                 BUILD_PASSWD=mod
17528                 BUILD_PASSWD_DYNAMIC=shared
17529                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17530         fi
17531 fi
17532
17533 if test "$ol_link_perl" != no ; then
17534         cat >> confdefs.h <<\EOF
17535 #define SLAPD_PERL 1
17536 EOF
17537
17538         BUILD_SLAPD=yes
17539         BUILD_PERL=yes
17540         if test "$ol_with_perl_module" != static ; then
17541                 cat >> confdefs.h <<\EOF
17542 #define SLAPD_PERL_DYNAMIC 1
17543 EOF
17544
17545                 BUILD_PERL=mod
17546                 BUILD_PERL_DYNAMIC=shared
17547                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-perl/back_perl.la"
17548         fi
17549 fi
17550
17551 if test "$ol_enable_shell" != no ; then
17552         cat >> confdefs.h <<\EOF
17553 #define SLAPD_SHELL 1
17554 EOF
17555
17556         BUILD_SLAPD=yes
17557         BUILD_SHELL=yes
17558         if test "$ol_with_shell_module" != static ; then
17559                 cat >> confdefs.h <<\EOF
17560 #define SLAPD_SHELL_DYNAMIC 1
17561 EOF
17562
17563                 BUILD_SHELL=mod
17564                 BUILD_SHELL_DYNAMIC=shared
17565                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17566         fi
17567 fi
17568
17569 if test "$ol_enable_tcl" != no ; then
17570         cat >> confdefs.h <<\EOF
17571 #define SLAPD_TCL 1
17572 EOF
17573
17574         BUILD_SLAPD=yes
17575         BUILD_TCL=yes
17576         if test "$ol_with_tcl_module" != static; then
17577                 cat >> confdefs.h <<\EOF
17578 #define SLAPD_TCL_DYNAMIC 1
17579 EOF
17580
17581                 BUILD_TCL=mod
17582                 BUILD_TCL_DYNAMIC=shared
17583                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-tcl/back_tcl.la"
17584         fi
17585 fi
17586
17587 if test "$ol_link_sql" != no ; then
17588         cat >> confdefs.h <<\EOF
17589 #define SLAPD_SQL 1
17590 EOF
17591
17592         BUILD_SLAPD=yes
17593         BUILD_SQL=yes
17594         if test "$ol_with_sql_module" != static; then
17595                 cat >> confdefs.h <<\EOF
17596 #define SLAPD_SQL_DYNAMIC 1
17597 EOF
17598
17599                 BUILD_SQL=mod
17600                 BUILD_SQL_DYNAMIC=shared
17601                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17602         fi
17603 fi
17604
17605 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17606         $BUILD_SLAPD = yes ; then
17607         BUILD_SLURPD=yes
17608 fi
17609
17610 if test "$ol_enable_rewrite" != no ; then
17611         cat >> confdefs.h <<\EOF
17612 #define ENABLE_REWRITE 1
17613 EOF
17614
17615         BUILD_REWRITE=yes
17616         SLAPD_LIBS="$SLAPD_LIBS -lrewrite"
17617 fi
17618
17619
17620 if test "$LINK_BINS_DYNAMIC" = yes; then
17621     LIB_LINKAGE=DYN
17622     LT_LIB_LINKAGE=shared
17623 else
17624     LIB_LINKAGE=STAT
17625     LT_LIB_LINKAGE=static
17626 fi
17627
17628 if test "$ac_cv_mingw32" = yes ; then
17629     PLAT=NT
17630     DYN_EXT=dll
17631 else
17632     PLAT=UNIX
17633     DYN_EXT=so
17634 fi
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644   
17645   
17646   
17647   
17648   
17649   
17650   
17651   
17652   
17653   
17654   
17655   
17656   
17657   
17658   
17659   
17660   
17661   
17662   
17663   
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701 trap '' 1 2 15
17702
17703 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17704
17705 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17706 # Let make expand exec_prefix.
17707 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17708
17709 # Any assignment to VPATH causes Sun make to only execute
17710 # the first set of double-colon rules, so remove it if not needed.
17711 # If there is a colon in the path, we need to keep it.
17712 if test "x$srcdir" = x.; then
17713   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17714 fi
17715
17716 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17717
17718 DEFS=-DHAVE_CONFIG_H
17719
17720 # Without the "./", some shells look in PATH for config.status.
17721 : ${CONFIG_STATUS=./config.status}
17722
17723 echo creating $CONFIG_STATUS
17724 rm -f $CONFIG_STATUS
17725 cat > $CONFIG_STATUS <<EOF
17726 #! /bin/sh
17727 # Generated automatically by configure.
17728 # Run this file to recreate the current configuration.
17729 # This directory was configured as follows,
17730 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17731 #
17732 # $0 $ac_configure_args
17733 #
17734 # Compiler output produced by configure, useful for debugging
17735 # configure, is in ./config.log if it exists.
17736
17737 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17738 for ac_option
17739 do
17740   case "\$ac_option" in
17741   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17742     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17743     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17744   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17745     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17746     exit 0 ;;
17747   -help | --help | --hel | --he | --h)
17748     echo "\$ac_cs_usage"; exit 0 ;;
17749   *) echo "\$ac_cs_usage"; exit 1 ;;
17750   esac
17751 done
17752
17753 ac_given_srcdir=$srcdir
17754 ac_given_INSTALL="$INSTALL"
17755
17756 trap 'rm -fr `echo "\
17757 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17758 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17759 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17760 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17761 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17762 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17763 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17764 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17765 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17766 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17767 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17768 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17769 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17770 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17771 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17772 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17773 include/Makefile:build/top.mk:include/Makefile.in \
17774 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17775 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17776 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17777 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17778 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17779 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17780 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17781 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
17782 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17783 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
17784 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17785 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17786 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
17787 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17788 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17789 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17790 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
17791 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17792 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
17793 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17794 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17795 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
17796 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17797 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17798 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17799 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17800 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17801 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17802 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17803 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
17804  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17805 EOF
17806 cat >> $CONFIG_STATUS <<EOF
17807
17808 # Protect against being on the right side of a sed subst in config.status.
17809 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17810  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17811 $ac_vpsub
17812 $extrasub
17813 s%@SHELL@%$SHELL%g
17814 s%@CFLAGS@%$CFLAGS%g
17815 s%@CPPFLAGS@%$CPPFLAGS%g
17816 s%@CXXFLAGS@%$CXXFLAGS%g
17817 s%@FFLAGS@%$FFLAGS%g
17818 s%@DEFS@%$DEFS%g
17819 s%@LDFLAGS@%$LDFLAGS%g
17820 s%@LIBS@%$LIBS%g
17821 s%@exec_prefix@%$exec_prefix%g
17822 s%@prefix@%$prefix%g
17823 s%@program_transform_name@%$program_transform_name%g
17824 s%@bindir@%$bindir%g
17825 s%@sbindir@%$sbindir%g
17826 s%@libexecdir@%$libexecdir%g
17827 s%@datadir@%$datadir%g
17828 s%@sysconfdir@%$sysconfdir%g
17829 s%@sharedstatedir@%$sharedstatedir%g
17830 s%@localstatedir@%$localstatedir%g
17831 s%@libdir@%$libdir%g
17832 s%@includedir@%$includedir%g
17833 s%@oldincludedir@%$oldincludedir%g
17834 s%@infodir@%$infodir%g
17835 s%@mandir@%$mandir%g
17836 s%@host@%$host%g
17837 s%@host_alias@%$host_alias%g
17838 s%@host_cpu@%$host_cpu%g
17839 s%@host_vendor@%$host_vendor%g
17840 s%@host_os@%$host_os%g
17841 s%@target@%$target%g
17842 s%@target_alias@%$target_alias%g
17843 s%@target_cpu@%$target_cpu%g
17844 s%@target_vendor@%$target_vendor%g
17845 s%@target_os@%$target_os%g
17846 s%@build@%$build%g
17847 s%@build_alias@%$build_alias%g
17848 s%@build_cpu@%$build_cpu%g
17849 s%@build_vendor@%$build_vendor%g
17850 s%@build_os@%$build_os%g
17851 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17852 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17853 s%@INSTALL_DATA@%$INSTALL_DATA%g
17854 s%@PACKAGE@%$PACKAGE%g
17855 s%@VERSION@%$VERSION%g
17856 s%@ACLOCAL@%$ACLOCAL%g
17857 s%@AUTOCONF@%$AUTOCONF%g
17858 s%@AUTOMAKE@%$AUTOMAKE%g
17859 s%@AUTOHEADER@%$AUTOHEADER%g
17860 s%@MAKEINFO@%$MAKEINFO%g
17861 s%@install_sh@%$install_sh%g
17862 s%@AMTAR@%$AMTAR%g
17863 s%@AWK@%$AWK%g
17864 s%@AMTARFLAGS@%$AMTARFLAGS%g
17865 s%@SET_MAKE@%$SET_MAKE%g
17866 s%@OPENLDAP_LIBVERSION@%$OPENLDAP_LIBVERSION%g
17867 s%@top_builddir@%$top_builddir%g
17868 s%@ldap_subdir@%$ldap_subdir%g
17869 s%@CC@%$CC%g
17870 s%@RANLIB@%$RANLIB%g
17871 s%@LN_S@%$LN_S%g
17872 s%@DLLTOOL@%$DLLTOOL%g
17873 s%@AS@%$AS%g
17874 s%@OBJDUMP@%$OBJDUMP%g
17875 s%@LIBTOOL@%$LIBTOOL%g
17876 s%@LN_H@%$LN_H%g
17877 s%@SENDMAIL@%$SENDMAIL%g
17878 s%@EDITOR@%$EDITOR%g
17879 s%@FINGER@%$FINGER%g
17880 s%@PERLBIN@%$PERLBIN%g
17881 s%@CPP@%$CPP%g
17882 s%@EXEEXT@%$EXEEXT%g
17883 s%@OBJEXT@%$OBJEXT%g
17884 s%@OL_MKDEP@%$OL_MKDEP%g
17885 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17886 s%@LIBOBJS@%$LIBOBJS%g
17887 s%@LIBSRCS@%$LIBSRCS%g
17888 s%@PLAT@%$PLAT%g
17889 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17890 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17891 s%@DYN_EXT@%$DYN_EXT%g
17892 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17893 s%@BUILD_BDB@%$BUILD_BDB%g
17894 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17895 s%@BUILD_LDAP@%$BUILD_LDAP%g
17896 s%@BUILD_LDBM@%$BUILD_LDBM%g
17897 s%@BUILD_META@%$BUILD_META%g
17898 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17899 s%@BUILD_PERL@%$BUILD_PERL%g
17900 s%@BUILD_SHELL@%$BUILD_SHELL%g
17901 s%@BUILD_SQL@%$BUILD_SQL%g
17902 s%@BUILD_TCL@%$BUILD_TCL%g
17903 s%@BUILD_BDB_DYNAMIC@%$BUILD_BDB_DYNAMIC%g
17904 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17905 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17906 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17907 s%@BUILD_META_DYNAMIC@%$BUILD_META_DYNAMIC%g
17908 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17909 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
17910 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17911 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17912 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
17913 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17914 s%@LDAP_LIBS@%$LDAP_LIBS%g
17915 s%@LDIF_LIBS@%$LDIF_LIBS%g
17916 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17917 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17918 s%@LDBM_LIBS@%$LDBM_LIBS%g
17919 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17920 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17921 s%@WRAP_LIBS@%$WRAP_LIBS%g
17922 s%@MOD_TCL_LIB@%$MOD_TCL_LIB%g
17923 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17924 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17925 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17926 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17927 s%@PERL_CPPFLAGS@%$PERL_CPPFLAGS%g
17928 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
17929 s%@MOD_PERL_LDFLAGS@%$MOD_PERL_LDFLAGS%g
17930 s%@KRB4_LIBS@%$KRB4_LIBS%g
17931 s%@KRB5_LIBS@%$KRB5_LIBS%g
17932 s%@READLINE_LIBS@%$READLINE_LIBS%g
17933 s%@SASL_LIBS@%$SASL_LIBS%g
17934 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17935 s%@TLS_LIBS@%$TLS_LIBS%g
17936 s%@MODULES_LIBS@%$MODULES_LIBS%g
17937 s%@AUTH_LIBS@%$AUTH_LIBS%g
17938 s%@SLAPD_SLP_LIBS@%$SLAPD_SLP_LIBS%g
17939 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17940 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17941 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17942
17943 CEOF
17944 EOF
17945
17946 cat >> $CONFIG_STATUS <<\EOF
17947
17948 # Split the substitutions into bite-sized pieces for seds with
17949 # small command number limits, like on Digital OSF/1 and HP-UX.
17950 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17951 ac_file=1 # Number of current file.
17952 ac_beg=1 # First line for current file.
17953 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17954 ac_more_lines=:
17955 ac_sed_cmds=""
17956 while $ac_more_lines; do
17957   if test $ac_beg -gt 1; then
17958     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17959   else
17960     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17961   fi
17962   if test ! -s conftest.s$ac_file; then
17963     ac_more_lines=false
17964     rm -f conftest.s$ac_file
17965   else
17966     if test -z "$ac_sed_cmds"; then
17967       ac_sed_cmds="sed -f conftest.s$ac_file"
17968     else
17969       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17970     fi
17971     ac_file=`expr $ac_file + 1`
17972     ac_beg=$ac_end
17973     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17974   fi
17975 done
17976 if test -z "$ac_sed_cmds"; then
17977   ac_sed_cmds=cat
17978 fi
17979 EOF
17980
17981 cat >> $CONFIG_STATUS <<EOF
17982
17983 CONFIG_FILES=\${CONFIG_FILES-"\
17984 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17985 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17986 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17987 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17988 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17989 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17990 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17991 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17992 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17993 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17994 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17995 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17996 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17997 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17998 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17999 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
18000 include/Makefile:build/top.mk:include/Makefile.in \
18001 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
18002 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
18003 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18004 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
18005 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
18006 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
18007 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
18008 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
18009 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
18010 libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk    \
18011 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
18012 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
18013 servers/slapd/back-bdb/Makefile:build/top.mk:servers/slapd/back-bdb/Makefile.in:build/mod.mk \
18014 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
18015 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
18016 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
18017 servers/slapd/back-meta/Makefile:build/top.mk:servers/slapd/back-meta/Makefile.in:build/mod.mk \
18018 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
18019 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/mod.mk \
18020 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
18021 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
18022 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/mod.mk \
18023 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
18024 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
18025 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
18026 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
18027 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
18028 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
18029 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
18030 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
18031 "}
18032 EOF
18033 cat >> $CONFIG_STATUS <<\EOF
18034 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
18035   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18036   case "$ac_file" in
18037   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18038        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18039   *) ac_file_in="${ac_file}.in" ;;
18040   esac
18041
18042   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
18043
18044   # Remove last slash and all that follows it.  Not all systems have dirname.
18045   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18046   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18047     # The file is in a subdirectory.
18048     test ! -d "$ac_dir" && mkdir "$ac_dir"
18049     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
18050     # A "../" for each directory in $ac_dir_suffix.
18051     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
18052   else
18053     ac_dir_suffix= ac_dots=
18054   fi
18055
18056   case "$ac_given_srcdir" in
18057   .)  srcdir=.
18058       if test -z "$ac_dots"; then top_srcdir=.
18059       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
18060   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
18061   *) # Relative path.
18062     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
18063     top_srcdir="$ac_dots$ac_given_srcdir" ;;
18064   esac
18065
18066   case "$ac_given_INSTALL" in
18067   [/$]*) INSTALL="$ac_given_INSTALL" ;;
18068   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
18069   esac
18070
18071   echo creating "$ac_file"
18072   rm -f "$ac_file"
18073   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
18074   case "$ac_file" in
18075   *[Mm]akefile*) ac_comsub="1i\\
18076 # $configure_input" ;;
18077   *) ac_comsub= ;;
18078   esac
18079
18080   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18081   sed -e "$ac_comsub
18082 s%@configure_input@%$configure_input%g
18083 s%@srcdir@%$srcdir%g
18084 s%@top_srcdir@%$top_srcdir%g
18085 s%@INSTALL@%$INSTALL%g
18086 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
18087 fi; done
18088 rm -f conftest.s*
18089
18090 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18091 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18092 #
18093 # ac_d sets the value in "#define NAME VALUE" lines.
18094 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18095 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
18096 ac_dC='\3'
18097 ac_dD='%g'
18098 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18099 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18100 ac_uB='\([      ]\)%\1#\2define\3'
18101 ac_uC=' '
18102 ac_uD='\4%g'
18103 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18104 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18105 ac_eB='$%\1#\2define\3'
18106 ac_eC=' '
18107 ac_eD='%g'
18108
18109 if test "${CONFIG_HEADERS+set}" != set; then
18110 EOF
18111 cat >> $CONFIG_STATUS <<EOF
18112   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
18113 EOF
18114 cat >> $CONFIG_STATUS <<\EOF
18115 fi
18116 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
18117   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18118   case "$ac_file" in
18119   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
18120        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
18121   *) ac_file_in="${ac_file}.in" ;;
18122   esac
18123
18124   echo creating $ac_file
18125
18126   rm -f conftest.frag conftest.in conftest.out
18127   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
18128   cat $ac_file_inputs > conftest.in
18129
18130 EOF
18131
18132 # Transform confdefs.h into a sed script conftest.vals that substitutes
18133 # the proper values into config.h.in to produce config.h.  And first:
18134 # Protect against being on the right side of a sed subst in config.status.
18135 # Protect against being in an unquoted here document in config.status.
18136 rm -f conftest.vals
18137 cat > conftest.hdr <<\EOF
18138 s/[\\&%]/\\&/g
18139 s%[\\$`]%\\&%g
18140 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
18141 s%ac_d%ac_u%gp
18142 s%ac_u%ac_e%gp
18143 EOF
18144 sed -n -f conftest.hdr confdefs.h > conftest.vals
18145 rm -f conftest.hdr
18146
18147 # This sed command replaces #undef with comments.  This is necessary, for
18148 # example, in the case of _POSIX_SOURCE, which is predefined and required
18149 # on some systems where configure will not decide to define it.
18150 cat >> conftest.vals <<\EOF
18151 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
18152 EOF
18153
18154 # Break up conftest.vals because some shells have a limit on
18155 # the size of here documents, and old seds have small limits too.
18156
18157 rm -f conftest.tail
18158 while :
18159 do
18160   ac_lines=`grep -c . conftest.vals`
18161   # grep -c gives empty output for an empty file on some AIX systems.
18162   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
18163   # Write a limited-size here document to conftest.frag.
18164   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
18165   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
18166   echo 'CEOF
18167   sed -f conftest.frag conftest.in > conftest.out
18168   rm -f conftest.in
18169   mv conftest.out conftest.in
18170 ' >> $CONFIG_STATUS
18171   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18172   rm -f conftest.vals
18173   mv conftest.tail conftest.vals
18174 done
18175 rm -f conftest.vals
18176
18177 cat >> $CONFIG_STATUS <<\EOF
18178   rm -f conftest.frag conftest.h
18179   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
18180   cat conftest.in >> conftest.h
18181   rm -f conftest.in
18182   if cmp -s $ac_file conftest.h 2>/dev/null; then
18183     echo "$ac_file is unchanged"
18184     rm -f conftest.h
18185   else
18186     # Remove last slash and all that follows it.  Not all systems have dirname.
18187       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
18188       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18189       # The file is in a subdirectory.
18190       test ! -d "$ac_dir" && mkdir "$ac_dir"
18191     fi
18192     rm -f $ac_file
18193     mv conftest.h $ac_file
18194   fi
18195 fi; done
18196
18197 EOF
18198 cat >> $CONFIG_STATUS <<EOF
18199
18200 EOF
18201 cat >> $CONFIG_STATUS <<\EOF
18202
18203 date > stamp-h
18204 echo Please \"make depend\" to build dependencies
18205
18206 exit 0
18207 EOF
18208 chmod +x $CONFIG_STATUS
18209 rm -fr confdefs* $ac_clean_files
18210 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
18211