]> git.sur5r.net Git - openldap/blob - configure
back-ldap modify bug
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.37 2002/01/04 20:38:05 kurt Exp  
4
5 # Copyright 1998-2002 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2002 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-x-compile      enable cross compiling [no]"
48 ac_help="$ac_help
49   --with-cyrus-sasl       with Cyrus SASL support [auto]"
50 ac_help="$ac_help
51   --with-fetch            with fetch URL support [auto]"
52 ac_help="$ac_help
53   --with-kerberos         with Kerberos support [auto]"
54 ac_help="$ac_help
55   --with-readline         with readline support [auto]"
56 ac_help="$ac_help
57   --with-threads          with threads [auto]"
58 ac_help="$ac_help
59   --with-tls              with TLS/SSL support [auto]"
60 ac_help="$ac_help
61   --with-yielding-select  with implicitly yielding select [auto]"
62 ac_help="$ac_help
63 SLAPD (Standalone LDAP Daemon) Options:"
64 ac_help="$ac_help
65   --enable-slapd          enable building slapd [yes]"
66 ac_help="$ac_help
67     --enable-cleartext    enable cleartext passwords [yes]"
68 ac_help="$ac_help
69     --enable-crypt        enable crypt(3) passwords [auto]"
70 ac_help="$ac_help
71     --enable-kpasswd      enable kerberos password verification [no]"
72 ac_help="$ac_help
73     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
74 ac_help="$ac_help
75     --enable-modules      enable dynamic module support [no]"
76 ac_help="$ac_help
77     --enable-phonetic     enable phonetic/soundex [no]"
78 ac_help="$ac_help
79     --enable-rlookups     enable reverse lookups [no]"
80 ac_help="$ac_help
81     --enable-aci          enable per-object ACIs [no]"
82 ac_help="$ac_help
83     --enable-wrappers     enable tcp wrapper support [no]"
84 ac_help="$ac_help
85     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
86 ac_help="$ac_help
87     --enable-dnssrv       enable dnssrv backend [no]"
88 ac_help="$ac_help
89     --with-dnssrv-module  module type [static]"
90 ac_help="$ac_help
91     --enable-ldap         enable ldap backend [no]"
92 ac_help="$ac_help
93     --with-ldap-module    module type [static]"
94 ac_help="$ac_help
95     --enable-ldbm         enable ldbm backend [yes]"
96 ac_help="$ac_help
97     --with-ldbm-api       with LDBM API [auto]"
98 ac_help="$ac_help
99     --with-ldbm-module    module type [static]"
100 ac_help="$ac_help
101     --with-ldbm-type      use LDBM type [auto]"
102 ac_help="$ac_help
103     --enable-passwd       enable passwd backend [no]"
104 ac_help="$ac_help
105     --with-passwd-module  module type [static]"
106 ac_help="$ac_help
107     --enable-shell        enable shell backend [no]"
108 ac_help="$ac_help
109     --with-shell-module   module type [static]"
110 ac_help="$ac_help
111     --enable-sql          enable sql backend [no]"
112 ac_help="$ac_help
113     --with-sql-module     module type [static]"
114 ac_help="$ac_help
115 SLURPD (Replication Daemon) Options:"
116 ac_help="$ac_help
117   --enable-slurpd         enable building slurpd [auto]"
118 ac_help="$ac_help
119 Library Generation & Linking Options"
120 ac_help="$ac_help
121   --enable-static[=PKGS]  build static libraries [default=yes]"
122 ac_help="$ac_help
123   --enable-shared[=PKGS]  build shared libraries [default=yes]"
124 ac_help="$ac_help
125   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
126 ac_help="$ac_help
127   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
128 ac_help="$ac_help
129   --disable-libtool-lock  avoid locking (might break parallel builds)"
130
131 # Initialize some variables set by options.
132 # The variables have the same names as the options, with
133 # dashes changed to underlines.
134 build=NONE
135 cache_file=./config.cache
136 exec_prefix=NONE
137 host=NONE
138 no_create=
139 nonopt=NONE
140 no_recursion=
141 prefix=NONE
142 program_prefix=NONE
143 program_suffix=NONE
144 program_transform_name=s,x,x,
145 silent=
146 site=
147 srcdir=
148 target=NONE
149 verbose=
150 x_includes=NONE
151 x_libraries=NONE
152 bindir='${exec_prefix}/bin'
153 sbindir='${exec_prefix}/sbin'
154 libexecdir='${exec_prefix}/libexec'
155 datadir='${prefix}/share'
156 sysconfdir='${prefix}/etc'
157 sharedstatedir='${prefix}/com'
158 localstatedir='${prefix}/var'
159 libdir='${exec_prefix}/lib'
160 includedir='${prefix}/include'
161 oldincludedir='/usr/include'
162 infodir='${prefix}/info'
163 mandir='${prefix}/man'
164
165 # Initialize some other variables.
166 subdirs=
167 MFLAGS= MAKEFLAGS=
168 SHELL=${CONFIG_SHELL-/bin/sh}
169 # Maximum number of lines to put in a shell here document.
170 ac_max_here_lines=12
171
172 ac_prev=
173 for ac_option
174 do
175
176   # If the previous option needs an argument, assign it.
177   if test -n "$ac_prev"; then
178     eval "$ac_prev=\$ac_option"
179     ac_prev=
180     continue
181   fi
182
183   case "$ac_option" in
184   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
185   *) ac_optarg= ;;
186   esac
187
188   # Accept the important Cygnus configure options, so we can diagnose typos.
189
190   case "$ac_option" in
191
192   -bindir | --bindir | --bindi | --bind | --bin | --bi)
193     ac_prev=bindir ;;
194   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
195     bindir="$ac_optarg" ;;
196
197   -build | --build | --buil | --bui | --bu)
198     ac_prev=build ;;
199   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
200     build="$ac_optarg" ;;
201
202   -cache-file | --cache-file | --cache-fil | --cache-fi \
203   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
204     ac_prev=cache_file ;;
205   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
206   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
207     cache_file="$ac_optarg" ;;
208
209   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
210     ac_prev=datadir ;;
211   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
212   | --da=*)
213     datadir="$ac_optarg" ;;
214
215   -disable-* | --disable-*)
216     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
217     # Reject names that are not valid shell variable names.
218     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
219       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
220     fi
221     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
222     eval "enable_${ac_feature}=no" ;;
223
224   -enable-* | --enable-*)
225     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
226     # Reject names that are not valid shell variable names.
227     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
228       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
229     fi
230     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
231     case "$ac_option" in
232       *=*) ;;
233       *) ac_optarg=yes ;;
234     esac
235     eval "enable_${ac_feature}='$ac_optarg'" ;;
236
237   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
238   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
239   | --exec | --exe | --ex)
240     ac_prev=exec_prefix ;;
241   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
242   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
243   | --exec=* | --exe=* | --ex=*)
244     exec_prefix="$ac_optarg" ;;
245
246   -gas | --gas | --ga | --g)
247     # Obsolete; use --with-gas.
248     with_gas=yes ;;
249
250   -help | --help | --hel | --he)
251     # Omit some internal or obsolete options to make the list less imposing.
252     # This message is too long to be a string in the A/UX 3.1 sh.
253     cat << EOF
254 Usage: configure [options] [host]
255 Options: [defaults in brackets after descriptions]
256 Configuration:
257   --cache-file=FILE       cache test results in FILE
258   --help                  print this message
259   --no-create             do not create output files
260   --quiet, --silent       do not print \`checking...' messages
261   --version               print the version of autoconf that created configure
262 Directory and file names:
263   --prefix=PREFIX         install architecture-independent files in PREFIX
264                           [$ac_default_prefix]
265   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
266                           [same as prefix]
267   --bindir=DIR            user executables in DIR [EPREFIX/bin]
268   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
269   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
270   --datadir=DIR           read-only architecture-independent data in DIR
271                           [PREFIX/share]
272   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
273   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
274                           [PREFIX/com]
275   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
276   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
277   --includedir=DIR        C header files in DIR [PREFIX/include]
278   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
279   --infodir=DIR           info documentation in DIR [PREFIX/info]
280   --mandir=DIR            man documentation in DIR [PREFIX/man]
281   --srcdir=DIR            find the sources in DIR [configure dir or ..]
282   --program-prefix=PREFIX prepend PREFIX to installed program names
283   --program-suffix=SUFFIX append SUFFIX to installed program names
284   --program-transform-name=PROGRAM
285                           run sed PROGRAM on installed program names
286 EOF
287     cat << EOF
288 Host type:
289   --build=BUILD           configure for building on BUILD [BUILD=HOST]
290   --host=HOST             configure for HOST [guessed]
291   --target=TARGET         configure for TARGET [TARGET=HOST]
292 Features and packages:
293   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
294   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
295   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
296   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
297   --x-includes=DIR        X include files are in DIR
298   --x-libraries=DIR       X library files are in DIR
299 EOF
300     if test -n "$ac_help"; then
301       echo "--enable and --with options recognized:$ac_help"
302     fi
303     exit 0 ;;
304
305   -host | --host | --hos | --ho)
306     ac_prev=host ;;
307   -host=* | --host=* | --hos=* | --ho=*)
308     host="$ac_optarg" ;;
309
310   -includedir | --includedir | --includedi | --included | --include \
311   | --includ | --inclu | --incl | --inc)
312     ac_prev=includedir ;;
313   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
314   | --includ=* | --inclu=* | --incl=* | --inc=*)
315     includedir="$ac_optarg" ;;
316
317   -infodir | --infodir | --infodi | --infod | --info | --inf)
318     ac_prev=infodir ;;
319   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
320     infodir="$ac_optarg" ;;
321
322   -libdir | --libdir | --libdi | --libd)
323     ac_prev=libdir ;;
324   -libdir=* | --libdir=* | --libdi=* | --libd=*)
325     libdir="$ac_optarg" ;;
326
327   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
328   | --libexe | --libex | --libe)
329     ac_prev=libexecdir ;;
330   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
331   | --libexe=* | --libex=* | --libe=*)
332     libexecdir="$ac_optarg" ;;
333
334   -localstatedir | --localstatedir | --localstatedi | --localstated \
335   | --localstate | --localstat | --localsta | --localst \
336   | --locals | --local | --loca | --loc | --lo)
337     ac_prev=localstatedir ;;
338   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
339   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
340   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
341     localstatedir="$ac_optarg" ;;
342
343   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
344     ac_prev=mandir ;;
345   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
346     mandir="$ac_optarg" ;;
347
348   -nfp | --nfp | --nf)
349     # Obsolete; use --without-fp.
350     with_fp=no ;;
351
352   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
353   | --no-cr | --no-c)
354     no_create=yes ;;
355
356   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
357   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
358     no_recursion=yes ;;
359
360   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
361   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
362   | --oldin | --oldi | --old | --ol | --o)
363     ac_prev=oldincludedir ;;
364   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
365   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
366   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
367     oldincludedir="$ac_optarg" ;;
368
369   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
370     ac_prev=prefix ;;
371   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
372     prefix="$ac_optarg" ;;
373
374   -program-prefix | --program-prefix | --program-prefi | --program-pref \
375   | --program-pre | --program-pr | --program-p)
376     ac_prev=program_prefix ;;
377   -program-prefix=* | --program-prefix=* | --program-prefi=* \
378   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
379     program_prefix="$ac_optarg" ;;
380
381   -program-suffix | --program-suffix | --program-suffi | --program-suff \
382   | --program-suf | --program-su | --program-s)
383     ac_prev=program_suffix ;;
384   -program-suffix=* | --program-suffix=* | --program-suffi=* \
385   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
386     program_suffix="$ac_optarg" ;;
387
388   -program-transform-name | --program-transform-name \
389   | --program-transform-nam | --program-transform-na \
390   | --program-transform-n | --program-transform- \
391   | --program-transform | --program-transfor \
392   | --program-transfo | --program-transf \
393   | --program-trans | --program-tran \
394   | --progr-tra | --program-tr | --program-t)
395     ac_prev=program_transform_name ;;
396   -program-transform-name=* | --program-transform-name=* \
397   | --program-transform-nam=* | --program-transform-na=* \
398   | --program-transform-n=* | --program-transform-=* \
399   | --program-transform=* | --program-transfor=* \
400   | --program-transfo=* | --program-transf=* \
401   | --program-trans=* | --program-tran=* \
402   | --progr-tra=* | --program-tr=* | --program-t=*)
403     program_transform_name="$ac_optarg" ;;
404
405   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
406   | -silent | --silent | --silen | --sile | --sil)
407     silent=yes ;;
408
409   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
410     ac_prev=sbindir ;;
411   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
412   | --sbi=* | --sb=*)
413     sbindir="$ac_optarg" ;;
414
415   -sharedstatedir | --sharedstatedir | --sharedstatedi \
416   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
417   | --sharedst | --shareds | --shared | --share | --shar \
418   | --sha | --sh)
419     ac_prev=sharedstatedir ;;
420   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
421   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
422   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
423   | --sha=* | --sh=*)
424     sharedstatedir="$ac_optarg" ;;
425
426   -site | --site | --sit)
427     ac_prev=site ;;
428   -site=* | --site=* | --sit=*)
429     site="$ac_optarg" ;;
430
431   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
432     ac_prev=srcdir ;;
433   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
434     srcdir="$ac_optarg" ;;
435
436   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
437   | --syscon | --sysco | --sysc | --sys | --sy)
438     ac_prev=sysconfdir ;;
439   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
440   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
441     sysconfdir="$ac_optarg" ;;
442
443   -target | --target | --targe | --targ | --tar | --ta | --t)
444     ac_prev=target ;;
445   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
446     target="$ac_optarg" ;;
447
448   -v | -verbose | --verbose | --verbos | --verbo | --verb)
449     verbose=yes ;;
450
451   -version | --version | --versio | --versi | --vers)
452     echo "configure generated by autoconf version 2.13.1"
453     exit 0 ;;
454
455   -with-* | --with-*)
456     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
457     # Reject names that are not valid shell variable names.
458     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
459       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
460     fi
461     ac_package=`echo $ac_package| sed 's/-/_/g'`
462     case "$ac_option" in
463       *=*) ;;
464       *) ac_optarg=yes ;;
465     esac
466     eval "with_${ac_package}='$ac_optarg'" ;;
467
468   -without-* | --without-*)
469     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
470     # Reject names that are not valid shell variable names.
471     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
472       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
473     fi
474     ac_package=`echo $ac_package| sed 's/-/_/g'`
475     eval "with_${ac_package}=no" ;;
476
477   --x)
478     # Obsolete; use --with-x.
479     with_x=yes ;;
480
481   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
482   | --x-incl | --x-inc | --x-in | --x-i)
483     ac_prev=x_includes ;;
484   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
485   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
486     x_includes="$ac_optarg" ;;
487
488   -x-libraries | --x-libraries | --x-librarie | --x-librari \
489   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
490     ac_prev=x_libraries ;;
491   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
492   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
493     x_libraries="$ac_optarg" ;;
494
495   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
496     ;;
497
498   *)
499     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
500       echo "configure: warning: $ac_option: invalid host type" 1>&2
501     fi
502     if test "x$nonopt" != xNONE; then
503       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
504     fi
505     nonopt="$ac_option"
506     ;;
507
508   esac
509 done
510
511 if test -n "$ac_prev"; then
512   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
513 fi
514
515 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
516
517 # File descriptor usage:
518 # 0 standard input
519 # 1 file creation
520 # 2 errors and warnings
521 # 3 some systems may open it to /dev/tty
522 # 4 used on the Kubota Titan
523 # 6 checking for... messages and results
524 # 5 compiler messages saved in config.log
525 if test "$silent" = yes; then
526   exec 6>/dev/null
527 else
528   exec 6>&1
529 fi
530 exec 5>./config.log
531
532 echo "\
533 This file contains any messages produced by compilers while
534 running configure, to aid debugging if configure makes a mistake.
535 " 1>&5
536
537 # Strip out --no-create and --no-recursion so they do not pile up.
538 # Also quote any args containing shell metacharacters.
539 ac_configure_args=
540 for ac_arg
541 do
542   case "$ac_arg" in
543   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
544   | --no-cr | --no-c) ;;
545   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
546   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
547   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
548   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
549   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
550   esac
551 done
552
553 # NLS nuisances.
554 # Only set these to C if already set.  These must not be set unconditionally
555 # because not all systems understand e.g. LANG=C (notably SCO).
556 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
557 # Non-C LC_CTYPE values break the ctype check.
558 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
559 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
560 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
561 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
562
563 # confdefs.h avoids OS command line length limits that DEFS can exceed.
564 rm -rf conftest* confdefs.h
565 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
566 echo > confdefs.h
567
568 # A filename unique to this package, relative to the directory that
569 # configure is in, which we can look for to find out if srcdir is correct.
570 ac_unique_file=build/version
571
572 # Find the source files, if location was not specified.
573 if test -z "$srcdir"; then
574   ac_srcdir_defaulted=yes
575   # Try the directory containing this script, then its parent.
576   ac_prog=$0
577   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
578   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
579   srcdir=$ac_confdir
580   if test ! -r $srcdir/$ac_unique_file; then
581     srcdir=..
582   fi
583 else
584   ac_srcdir_defaulted=no
585 fi
586 if test ! -r $srcdir/$ac_unique_file; then
587   if test "$ac_srcdir_defaulted" = yes; then
588     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
589   else
590     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
591   fi
592 fi
593 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
594
595 # Prefer explicitly selected file to automatically selected ones.
596 if test -z "$CONFIG_SITE"; then
597   if test "x$prefix" != xNONE; then
598     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
599   else
600     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
601   fi
602 fi
603 for ac_site_file in $CONFIG_SITE; do
604   if test -r "$ac_site_file"; then
605     echo "loading site script $ac_site_file"
606     . "$ac_site_file"
607   fi
608 done
609
610
611 ac_ext=c
612 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
613 ac_cpp='$CPP $CPPFLAGS'
614 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
615 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
616 cross_compiling=$ac_cv_prog_cc_cross
617
618 ac_exeext=
619 ac_objext=o
620 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
621   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
622   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
623     ac_n= ac_c='
624 ' ac_t='        '
625   else
626     ac_n=-n ac_c= ac_t=
627   fi
628 else
629   ac_n= ac_c='\c' ac_t=
630 fi
631
632
633 # set unset (borrowed from autoconf 2.49c)
634 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
635   ol_unset=unset
636 else
637   ol_unset=false
638 fi
639 # unset CDPATH
640 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
641
642 ac_aux_dir=
643 for ac_dir in build $srcdir/build; do
644   if test -f $ac_dir/install-sh; then
645     ac_aux_dir=$ac_dir
646     ac_install_sh="$ac_aux_dir/install-sh -c"
647     break
648   elif test -f $ac_dir/install.sh; then
649     ac_aux_dir=$ac_dir
650     ac_install_sh="$ac_aux_dir/install.sh -c"
651     break
652   elif test -f $ac_dir/shtool; then
653     ac_aux_dir=$ac_dir
654     ac_install_sh="$ac_aux_dir/shtool install -c"
655     break
656   fi
657 done
658 if test -z "$ac_aux_dir"; then
659   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
660 fi
661 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
662 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
663 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
664
665 OL_VERSION=`cat $ac_aux_dir/version`
666 if test -z "$OL_VERSION"; then
667         { echo "configure: error: could not determine version" 1>&2; exit 1; }
668 fi
669
670 echo "Configuring OpenLDAP $OL_VERSION ..."
671
672
673 echo $ac_n "checking host system type""... $ac_c" 1>&6
674 echo "configure:675: checking host system type" >&5
675 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
676
677 # Make sure we can run config.sub.
678   if $ac_config_sub sun4 >/dev/null 2>&1; then :
679     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
680   fi
681
682   ac_cv_host_alias=$host
683   case "$ac_cv_host_alias" in
684   NONE)
685     case $nonopt in
686     NONE)
687       if ac_cv_host_alias=`$ac_config_guess`; then :
688       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
689       fi ;;
690     *) ac_cv_host_alias=$nonopt ;;
691     esac ;;
692   esac
693
694   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
695   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
696   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
697   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
698 else
699   echo $ac_n "(cached) $ac_c" 1>&6
700 fi
701
702 echo "$ac_t""$ac_cv_host" 1>&6
703
704 host=$ac_cv_host
705 host_alias=$ac_cv_host_alias
706 host_cpu=$ac_cv_host_cpu
707 host_vendor=$ac_cv_host_vendor
708 host_os=$ac_cv_host_os
709
710
711
712
713
714 echo $ac_n "checking target system type""... $ac_c" 1>&6
715 echo "configure:716: checking target system type" >&5
716 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
717
718 # Make sure we can run config.sub.
719   if $ac_config_sub sun4 >/dev/null 2>&1; then :
720     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
721   fi
722
723   ac_cv_target_alias=$target
724   case "$ac_cv_target_alias" in
725   NONE)
726     case $nonopt in
727     NONE)
728       ac_cv_target_alias=$host_alias ;;
729
730     *) ac_cv_target_alias=$nonopt ;;
731     esac ;;
732   esac
733
734   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
735   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
736   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
737   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
738 else
739   echo $ac_n "(cached) $ac_c" 1>&6
740 fi
741
742 echo "$ac_t""$ac_cv_target" 1>&6
743
744 target=$ac_cv_target
745 target_alias=$ac_cv_target_alias
746 target_cpu=$ac_cv_target_cpu
747 target_vendor=$ac_cv_target_vendor
748 target_os=$ac_cv_target_os
749
750
751
752
753
754 echo $ac_n "checking build system type""... $ac_c" 1>&6
755 echo "configure:756: checking build system type" >&5
756 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
757
758 # Make sure we can run config.sub.
759   if $ac_config_sub sun4 >/dev/null 2>&1; then :
760     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
761   fi
762
763   ac_cv_build_alias=$build
764   case "$ac_cv_build_alias" in
765   NONE)
766     case $nonopt in
767     NONE)
768       ac_cv_build_alias=$host_alias ;;
769
770     *) ac_cv_build_alias=$nonopt ;;
771     esac ;;
772   esac
773
774   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
775   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
776   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
777   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
778 else
779   echo $ac_n "(cached) $ac_c" 1>&6
780 fi
781
782 echo "$ac_t""$ac_cv_build" 1>&6
783
784 build=$ac_cv_build
785 build_alias=$ac_cv_build_alias
786 build_cpu=$ac_cv_build_cpu
787 build_vendor=$ac_cv_build_vendor
788 build_os=$ac_cv_build_os
789
790
791
792
793
794 # Do some error checking and defaulting for the host and target type.
795 # The inputs are:
796 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
797 #
798 # The rules are:
799 # 1. You are not allowed to specify --host, --target, and nonopt at the
800 #    same time.
801 # 2. Host defaults to nonopt.
802 # 3. If nonopt is not specified, then host defaults to the current host,
803 #    as determined by config.guess.
804 # 4. Target and build default to nonopt.
805 # 5. If nonopt is not specified, then target and build default to host.
806
807 # The aliases save the names the user supplied, while $host etc.
808 # will get canonicalized.
809 case $host---$target---$nonopt in
810 NONE---*---* | *---NONE---* | *---*---NONE) ;;
811 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
812 esac
813
814 test "$host_alias" != "$target_alias" &&
815   test "$program_prefix$program_suffix$program_transform_name" = \
816     NONENONEs,x,x, &&
817   program_prefix=${target_alias}-
818
819
820 # Find a good install program.  We prefer a C program (faster),
821 # so one script is as good as another.  But avoid the broken or
822 # incompatible versions:
823 # SysV /etc/install, /usr/sbin/install
824 # SunOS /usr/etc/install
825 # IRIX /sbin/install
826 # AIX /bin/install
827 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
828 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
829 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
830 # ./install, which can be erroneously created by make from ./install.sh.
831 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
832 echo "configure:833: checking for a BSD compatible install" >&5
833 if test -z "$INSTALL"; then
834 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
835   echo $ac_n "(cached) $ac_c" 1>&6
836 else
837     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
838   for ac_dir in $PATH; do
839     # Account for people who put trailing slashes in PATH elements.
840     case "$ac_dir/" in
841     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
842     *)
843       # OSF1 and SCO ODT 3.0 have their own names for install.
844       # Don't use installbsd from OSF since it installs stuff as root
845       # by default.
846       for ac_prog in ginstall scoinst install; do
847         if test -f $ac_dir/$ac_prog; then
848           if test $ac_prog = install &&
849             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
850             # AIX install.  It has an incompatible calling convention.
851             :
852           elif test $ac_prog = install &&
853             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
854             # program-specific install script used by HP pwplus--don't use.
855             :
856           else
857             ac_cv_path_install="$ac_dir/$ac_prog -c"
858             break 2
859           fi
860         fi
861       done
862       ;;
863     esac
864   done
865   IFS="$ac_save_IFS"
866
867 fi
868   if test "${ac_cv_path_install+set}" = set; then
869     INSTALL="$ac_cv_path_install"
870   else
871     # As a last resort, use the slow shell script.  We don't cache a
872     # path for INSTALL within a source directory, because that will
873     # break other packages using the cache if that directory is
874     # removed, or if the path is relative.
875     INSTALL="$ac_install_sh"
876   fi
877 fi
878 echo "$ac_t""$INSTALL" 1>&6
879
880 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
881 # It thinks the first close brace ends the variable substitution.
882 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
883
884 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
885
886 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
887
888 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
889 echo "configure:890: checking whether build environment is sane" >&5
890 # Just in case
891 sleep 1
892 echo timestamp > conftestfile
893 # Do `set' in a subshell so we don't clobber the current shell's
894 # arguments.  Must try -L first in case configure is actually a
895 # symlink; some systems play weird games with the mod time of symlinks
896 # (eg FreeBSD returns the mod time of the symlink's containing
897 # directory).
898 if (
899    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
900    if test "$*" = "X"; then
901       # -L didn't work.
902       set X `ls -t $srcdir/configure conftestfile`
903    fi
904    if test "$*" != "X $srcdir/configure conftestfile" \
905       && test "$*" != "X conftestfile $srcdir/configure"; then
906
907       # If neither matched, then we have a broken ls.  This can happen
908       # if, for instance, CONFIG_SHELL is bash and it inherits a
909       # broken ls alias from the environment.  This has actually
910       # happened.  Such a system could not be considered "sane".
911       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
912 alias in your environment" 1>&2; exit 1; }
913    fi
914
915    test "$2" = conftestfile
916    )
917 then
918    # Ok.
919    :
920 else
921    { echo "configure: error: newly created file is older than distributed files!
922 Check your system clock" 1>&2; exit 1; }
923 fi
924 rm -f conftest*
925 echo "$ac_t""yes" 1>&6
926 if test "$program_transform_name" = s,x,x,; then
927   program_transform_name=
928 else
929   # Double any \ or $.  echo might interpret backslashes.
930   cat <<\EOF_SED > conftestsed
931 s,\\,\\\\,g; s,\$,$$,g
932 EOF_SED
933   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
934   rm -f conftestsed
935 fi
936 test "$program_prefix" != NONE &&
937   program_transform_name="s,^,${program_prefix},;$program_transform_name"
938 # Use a double $ so make ignores it.
939 test "$program_suffix" != NONE &&
940   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
941
942 # sed with no file args requires a program.
943 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
944
945 for ac_prog in mawk gawk nawk awk
946 do
947 # Extract the first word of "$ac_prog", so it can be a program name with args.
948 set dummy $ac_prog; ac_word=$2
949 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
950 echo "configure:951: checking for $ac_word" >&5
951 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
952   echo $ac_n "(cached) $ac_c" 1>&6
953 else
954   if test -n "$AWK"; then
955   ac_cv_prog_AWK="$AWK" # Let the user override the test.
956 else
957   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
958   ac_dummy="$PATH"
959   for ac_dir in $ac_dummy; do
960     test -z "$ac_dir" && ac_dir=.
961     if test -f $ac_dir/$ac_word; then
962       ac_cv_prog_AWK="$ac_prog"
963       break
964     fi
965   done
966   IFS="$ac_save_ifs"
967 fi
968 fi
969 AWK="$ac_cv_prog_AWK"
970 if test -n "$AWK"; then
971   echo "$ac_t""$AWK" 1>&6
972 else
973   echo "$ac_t""no" 1>&6
974 fi
975
976 test -n "$AWK" && break
977 done
978
979 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
980 echo "configure:981: checking whether ${MAKE-make} sets \${MAKE}" >&5
981 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
982 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
983   echo $ac_n "(cached) $ac_c" 1>&6
984 else
985   cat > conftestmake <<\EOF
986 all:
987         @echo 'ac_maketemp="${MAKE}"'
988 EOF
989 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
990 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
991 if test -n "$ac_maketemp"; then
992   eval ac_cv_prog_make_${ac_make}_set=yes
993 else
994   eval ac_cv_prog_make_${ac_make}_set=no
995 fi
996 rm -f conftestmake
997 fi
998 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
999   echo "$ac_t""yes" 1>&6
1000   SET_MAKE=
1001 else
1002   echo "$ac_t""no" 1>&6
1003   SET_MAKE="MAKE=${MAKE-make}"
1004 fi
1005
1006
1007
1008 PACKAGE=OpenLDAP
1009
1010 VERSION=$OL_VERSION
1011
1012 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1013   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1014 fi
1015
1016
1017
1018 missing_dir=`cd $ac_aux_dir && pwd`
1019 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1020 echo "configure:1021: checking for working aclocal" >&5
1021 # Run test in a subshell; some versions of sh will print an error if
1022 # an executable is not found, even if stderr is redirected.
1023 # Redirect stdin to placate older versions of autoconf.  Sigh.
1024 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1025    ACLOCAL=aclocal
1026    echo "$ac_t""found" 1>&6
1027 else
1028    ACLOCAL="$missing_dir/missing aclocal"
1029    echo "$ac_t""missing" 1>&6
1030 fi
1031
1032 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1033 echo "configure:1034: checking for working autoconf" >&5
1034 # Run test in a subshell; some versions of sh will print an error if
1035 # an executable is not found, even if stderr is redirected.
1036 # Redirect stdin to placate older versions of autoconf.  Sigh.
1037 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1038    AUTOCONF=autoconf
1039    echo "$ac_t""found" 1>&6
1040 else
1041    AUTOCONF="$missing_dir/missing autoconf"
1042    echo "$ac_t""missing" 1>&6
1043 fi
1044
1045 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1046 echo "configure:1047: checking for working automake" >&5
1047 # Run test in a subshell; some versions of sh will print an error if
1048 # an executable is not found, even if stderr is redirected.
1049 # Redirect stdin to placate older versions of autoconf.  Sigh.
1050 if (automake --version) < /dev/null > /dev/null 2>&1; then
1051    AUTOMAKE=automake
1052    echo "$ac_t""found" 1>&6
1053 else
1054    AUTOMAKE="$missing_dir/missing automake"
1055    echo "$ac_t""missing" 1>&6
1056 fi
1057
1058 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1059 echo "configure:1060: checking for working autoheader" >&5
1060 # Run test in a subshell; some versions of sh will print an error if
1061 # an executable is not found, even if stderr is redirected.
1062 # Redirect stdin to placate older versions of autoconf.  Sigh.
1063 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1064    AUTOHEADER=autoheader
1065    echo "$ac_t""found" 1>&6
1066 else
1067    AUTOHEADER="$missing_dir/missing autoheader"
1068    echo "$ac_t""missing" 1>&6
1069 fi
1070
1071 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1072 echo "configure:1073: checking for working makeinfo" >&5
1073 # Run test in a subshell; some versions of sh will print an error if
1074 # an executable is not found, even if stderr is redirected.
1075 # Redirect stdin to placate older versions of autoconf.  Sigh.
1076 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1077    MAKEINFO=makeinfo
1078    echo "$ac_t""found" 1>&6
1079 else
1080    MAKEINFO="$missing_dir/missing makeinfo"
1081    echo "$ac_t""missing" 1>&6
1082 fi
1083
1084 install_sh="$missing_dir/install-sh"
1085 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1086
1087 for ac_prog in gnutar gtar tar
1088 do
1089 # Extract the first word of "$ac_prog", so it can be a program name with args.
1090 set dummy $ac_prog; ac_word=$2
1091 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1092 echo "configure:1093: checking for $ac_word" >&5
1093 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1094   echo $ac_n "(cached) $ac_c" 1>&6
1095 else
1096   if test -n "$AMTAR"; then
1097   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1098 else
1099   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1100   ac_dummy="$PATH"
1101   for ac_dir in $ac_dummy; do
1102     test -z "$ac_dir" && ac_dir=.
1103     if test -f $ac_dir/$ac_word; then
1104       ac_cv_prog_AMTAR="$ac_prog"
1105       break
1106     fi
1107   done
1108   IFS="$ac_save_ifs"
1109 fi
1110 fi
1111 AMTAR="$ac_cv_prog_AMTAR"
1112 if test -n "$AMTAR"; then
1113   echo "$ac_t""$AMTAR" 1>&6
1114 else
1115   echo "$ac_t""no" 1>&6
1116 fi
1117
1118 test -n "$AMTAR" && break
1119 done
1120
1121
1122 AMTARFLAGS=
1123 if test -n "$AMTAR"; then
1124   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1125         AMTARFLAGS=o
1126   fi
1127 fi
1128
1129 cat >> confdefs.h <<EOF
1130 #define OPENLDAP_PACKAGE "$PACKAGE"
1131 EOF
1132
1133 cat >> confdefs.h <<EOF
1134 #define OPENLDAP_VERSION "$VERSION"
1135 EOF
1136
1137
1138
1139
1140 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1141 echo "configure:1142: checking configure arguments" >&5
1142
1143
1144 top_builddir=`pwd`
1145
1146 ldap_subdir="/openldap"
1147
1148 # Check whether --with-subdir or --without-subdir was given.
1149 if test "${with_subdir+set}" = set; then
1150   withval="$with_subdir"
1151   case "$withval" in
1152         no) ldap_subdir=""
1153                 ;;
1154         yes)
1155                 ;;
1156         /*|\\*)
1157                 ldap_subdir="$withval"
1158                 ;;
1159         *)
1160                 ldap_subdir="/$withval"
1161                 ;;
1162 esac
1163
1164 fi
1165
1166
1167 # OpenLDAP --enable-debug
1168         # Check whether --enable-debug or --disable-debug was given.
1169 if test "${enable_debug+set}" = set; then
1170   enableval="$enable_debug"
1171   
1172         ol_arg=invalid
1173         for ol_val in auto yes no ; do
1174                 if test "$enableval" = "$ol_val" ; then
1175                         ol_arg="$ol_val"
1176                 fi
1177         done
1178         if test "$ol_arg" = "invalid" ; then
1179                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1180         fi
1181         ol_enable_debug="$ol_arg"
1182
1183 else
1184         ol_enable_debug="yes"
1185 fi
1186 # end --enable-debug
1187 # OpenLDAP --enable-syslog
1188         # Check whether --enable-syslog or --disable-syslog was given.
1189 if test "${enable_syslog+set}" = set; then
1190   enableval="$enable_syslog"
1191   
1192         ol_arg=invalid
1193         for ol_val in auto yes no ; do
1194                 if test "$enableval" = "$ol_val" ; then
1195                         ol_arg="$ol_val"
1196                 fi
1197         done
1198         if test "$ol_arg" = "invalid" ; then
1199                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1200         fi
1201         ol_enable_syslog="$ol_arg"
1202
1203 else
1204         ol_enable_syslog="auto"
1205 fi
1206 # end --enable-syslog
1207 # OpenLDAP --enable-proctitle
1208         # Check whether --enable-proctitle or --disable-proctitle was given.
1209 if test "${enable_proctitle+set}" = set; then
1210   enableval="$enable_proctitle"
1211   
1212         ol_arg=invalid
1213         for ol_val in auto yes no ; do
1214                 if test "$enableval" = "$ol_val" ; then
1215                         ol_arg="$ol_val"
1216                 fi
1217         done
1218         if test "$ol_arg" = "invalid" ; then
1219                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1220         fi
1221         ol_enable_proctitle="$ol_arg"
1222
1223 else
1224         ol_enable_proctitle="yes"
1225 fi
1226 # end --enable-proctitle
1227 # OpenLDAP --enable-cache
1228         # Check whether --enable-cache or --disable-cache was given.
1229 if test "${enable_cache+set}" = set; then
1230   enableval="$enable_cache"
1231   
1232         ol_arg=invalid
1233         for ol_val in auto yes no ; do
1234                 if test "$enableval" = "$ol_val" ; then
1235                         ol_arg="$ol_val"
1236                 fi
1237         done
1238         if test "$ol_arg" = "invalid" ; then
1239                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1240         fi
1241         ol_enable_cache="$ol_arg"
1242
1243 else
1244         ol_enable_cache="no"
1245 fi
1246 # end --enable-cache
1247 # OpenLDAP --enable-referrals
1248         # Check whether --enable-referrals or --disable-referrals was given.
1249 if test "${enable_referrals+set}" = set; then
1250   enableval="$enable_referrals"
1251   
1252         ol_arg=invalid
1253         for ol_val in auto yes no ; do
1254                 if test "$enableval" = "$ol_val" ; then
1255                         ol_arg="$ol_val"
1256                 fi
1257         done
1258         if test "$ol_arg" = "invalid" ; then
1259                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1260         fi
1261         ol_enable_referrals="$ol_arg"
1262
1263 else
1264         ol_enable_referrals="no"
1265 fi
1266 # end --enable-referrals
1267 # OpenLDAP --enable-kbind
1268         # Check whether --enable-kbind or --disable-kbind was given.
1269 if test "${enable_kbind+set}" = set; then
1270   enableval="$enable_kbind"
1271   
1272         ol_arg=invalid
1273         for ol_val in auto yes no ; do
1274                 if test "$enableval" = "$ol_val" ; then
1275                         ol_arg="$ol_val"
1276                 fi
1277         done
1278         if test "$ol_arg" = "invalid" ; then
1279                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1280         fi
1281         ol_enable_kbind="$ol_arg"
1282
1283 else
1284         ol_enable_kbind="no"
1285 fi
1286 # end --enable-kbind
1287 # OpenLDAP --enable-ipv6
1288         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1289 if test "${enable_ipv6+set}" = set; then
1290   enableval="$enable_ipv6"
1291   
1292         ol_arg=invalid
1293         for ol_val in auto yes no ; do
1294                 if test "$enableval" = "$ol_val" ; then
1295                         ol_arg="$ol_val"
1296                 fi
1297         done
1298         if test "$ol_arg" = "invalid" ; then
1299                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1300         fi
1301         ol_enable_ipv6="$ol_arg"
1302
1303 else
1304         ol_enable_ipv6="auto"
1305 fi
1306 # end --enable-ipv6
1307 # OpenLDAP --enable-local
1308         # Check whether --enable-local or --disable-local was given.
1309 if test "${enable_local+set}" = set; then
1310   enableval="$enable_local"
1311   
1312         ol_arg=invalid
1313         for ol_val in auto yes no ; do
1314                 if test "$enableval" = "$ol_val" ; then
1315                         ol_arg="$ol_val"
1316                 fi
1317         done
1318         if test "$ol_arg" = "invalid" ; then
1319                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1320         fi
1321         ol_enable_local="$ol_arg"
1322
1323 else
1324         ol_enable_local="auto"
1325 fi
1326 # end --enable-local
1327 # OpenLDAP --enable-x_compile
1328         # Check whether --enable-x_compile or --disable-x_compile was given.
1329 if test "${enable_x_compile+set}" = set; then
1330   enableval="$enable_x_compile"
1331   
1332         ol_arg=invalid
1333         for ol_val in yes no ; do
1334                 if test "$enableval" = "$ol_val" ; then
1335                         ol_arg="$ol_val"
1336                 fi
1337         done
1338         if test "$ol_arg" = "invalid" ; then
1339                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1340         fi
1341         ol_enable_x_compile="$ol_arg"
1342
1343 else
1344         ol_enable_x_compile="no"
1345 fi
1346 # end --enable-x_compile
1347
1348
1349 # OpenLDAP --with-cyrus_sasl
1350         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1351 if test "${with_cyrus_sasl+set}" = set; then
1352   withval="$with_cyrus_sasl"
1353   
1354         ol_arg=invalid
1355         for ol_val in auto yes no  ; do
1356                 if test "$withval" = "$ol_val" ; then
1357                         ol_arg="$ol_val"
1358                 fi
1359         done
1360         if test "$ol_arg" = "invalid" ; then
1361                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1362         fi
1363         ol_with_cyrus_sasl="$ol_arg"
1364
1365 else
1366         ol_with_cyrus_sasl="auto"
1367 fi
1368 # end --with-cyrus_sasl
1369
1370 # OpenLDAP --with-fetch
1371         # Check whether --with-fetch or --without-fetch was given.
1372 if test "${with_fetch+set}" = set; then
1373   withval="$with_fetch"
1374   
1375         ol_arg=invalid
1376         for ol_val in auto yes no  ; do
1377                 if test "$withval" = "$ol_val" ; then
1378                         ol_arg="$ol_val"
1379                 fi
1380         done
1381         if test "$ol_arg" = "invalid" ; then
1382                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1383         fi
1384         ol_with_fetch="$ol_arg"
1385
1386 else
1387         ol_with_fetch="auto"
1388 fi
1389 # end --with-fetch
1390
1391 # OpenLDAP --with-kerberos
1392         # Check whether --with-kerberos or --without-kerberos was given.
1393 if test "${with_kerberos+set}" = set; then
1394   withval="$with_kerberos"
1395   
1396         ol_arg=invalid
1397         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1398                 if test "$withval" = "$ol_val" ; then
1399                         ol_arg="$ol_val"
1400                 fi
1401         done
1402         if test "$ol_arg" = "invalid" ; then
1403                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1404         fi
1405         ol_with_kerberos="$ol_arg"
1406
1407 else
1408         ol_with_kerberos="auto"
1409 fi
1410 # end --with-kerberos
1411
1412 # OpenLDAP --with-readline
1413         # Check whether --with-readline or --without-readline was given.
1414 if test "${with_readline+set}" = set; then
1415   withval="$with_readline"
1416   
1417         ol_arg=invalid
1418         for ol_val in auto yes no  ; do
1419                 if test "$withval" = "$ol_val" ; then
1420                         ol_arg="$ol_val"
1421                 fi
1422         done
1423         if test "$ol_arg" = "invalid" ; then
1424                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1425         fi
1426         ol_with_readline="$ol_arg"
1427
1428 else
1429         ol_with_readline="auto"
1430 fi
1431 # end --with-readline
1432
1433 # OpenLDAP --with-threads
1434         # Check whether --with-threads or --without-threads was given.
1435 if test "${with_threads+set}" = set; then
1436   withval="$with_threads"
1437   
1438         ol_arg=invalid
1439         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1440                 if test "$withval" = "$ol_val" ; then
1441                         ol_arg="$ol_val"
1442                 fi
1443         done
1444         if test "$ol_arg" = "invalid" ; then
1445                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1446         fi
1447         ol_with_threads="$ol_arg"
1448
1449 else
1450         ol_with_threads="auto"
1451 fi
1452 # end --with-threads
1453
1454 # OpenLDAP --with-tls
1455         # Check whether --with-tls or --without-tls was given.
1456 if test "${with_tls+set}" = set; then
1457   withval="$with_tls"
1458   
1459         ol_arg=invalid
1460         for ol_val in auto ssleay openssl yes no  ; do
1461                 if test "$withval" = "$ol_val" ; then
1462                         ol_arg="$ol_val"
1463                 fi
1464         done
1465         if test "$ol_arg" = "invalid" ; then
1466                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1467         fi
1468         ol_with_tls="$ol_arg"
1469
1470 else
1471         ol_with_tls="auto"
1472 fi
1473 # end --with-tls
1474
1475 # OpenLDAP --with-yielding_select
1476         # Check whether --with-yielding_select or --without-yielding_select was given.
1477 if test "${with_yielding_select+set}" = set; then
1478   withval="$with_yielding_select"
1479   
1480         ol_arg=invalid
1481         for ol_val in auto yes no manual  ; do
1482                 if test "$withval" = "$ol_val" ; then
1483                         ol_arg="$ol_val"
1484                 fi
1485         done
1486         if test "$ol_arg" = "invalid" ; then
1487                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1488         fi
1489         ol_with_yielding_select="$ol_arg"
1490
1491 else
1492         ol_with_yielding_select="auto"
1493 fi
1494 # end --with-yielding_select
1495
1496
1497
1498 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1499 if test "${with_xxslapdoptions+set}" = set; then
1500   withval="$with_xxslapdoptions"
1501   :
1502 fi
1503
1504 # OpenLDAP --enable-slapd
1505         # Check whether --enable-slapd or --disable-slapd was given.
1506 if test "${enable_slapd+set}" = set; then
1507   enableval="$enable_slapd"
1508   
1509         ol_arg=invalid
1510         for ol_val in auto yes no ; do
1511                 if test "$enableval" = "$ol_val" ; then
1512                         ol_arg="$ol_val"
1513                 fi
1514         done
1515         if test "$ol_arg" = "invalid" ; then
1516                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1517         fi
1518         ol_enable_slapd="$ol_arg"
1519
1520 else
1521         ol_enable_slapd="yes"
1522 fi
1523 # end --enable-slapd
1524 # OpenLDAP --enable-cleartext
1525         # Check whether --enable-cleartext or --disable-cleartext was given.
1526 if test "${enable_cleartext+set}" = set; then
1527   enableval="$enable_cleartext"
1528   
1529         ol_arg=invalid
1530         for ol_val in auto yes no ; do
1531                 if test "$enableval" = "$ol_val" ; then
1532                         ol_arg="$ol_val"
1533                 fi
1534         done
1535         if test "$ol_arg" = "invalid" ; then
1536                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1537         fi
1538         ol_enable_cleartext="$ol_arg"
1539
1540 else
1541         ol_enable_cleartext="yes"
1542 fi
1543 # end --enable-cleartext
1544 # OpenLDAP --enable-crypt
1545         # Check whether --enable-crypt or --disable-crypt was given.
1546 if test "${enable_crypt+set}" = set; then
1547   enableval="$enable_crypt"
1548   
1549         ol_arg=invalid
1550         for ol_val in auto yes no ; do
1551                 if test "$enableval" = "$ol_val" ; then
1552                         ol_arg="$ol_val"
1553                 fi
1554         done
1555         if test "$ol_arg" = "invalid" ; then
1556                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1557         fi
1558         ol_enable_crypt="$ol_arg"
1559
1560 else
1561         ol_enable_crypt="auto"
1562 fi
1563 # end --enable-crypt
1564 # OpenLDAP --enable-kpasswd
1565         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1566 if test "${enable_kpasswd+set}" = set; then
1567   enableval="$enable_kpasswd"
1568   
1569         ol_arg=invalid
1570         for ol_val in auto yes no ; do
1571                 if test "$enableval" = "$ol_val" ; then
1572                         ol_arg="$ol_val"
1573                 fi
1574         done
1575         if test "$ol_arg" = "invalid" ; then
1576                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1577         fi
1578         ol_enable_kpasswd="$ol_arg"
1579
1580 else
1581         ol_enable_kpasswd="no"
1582 fi
1583 # end --enable-kpasswd
1584 # OpenLDAP --enable-spasswd
1585         # Check whether --enable-spasswd or --disable-spasswd was given.
1586 if test "${enable_spasswd+set}" = set; then
1587   enableval="$enable_spasswd"
1588   
1589         ol_arg=invalid
1590         for ol_val in auto yes no ; do
1591                 if test "$enableval" = "$ol_val" ; then
1592                         ol_arg="$ol_val"
1593                 fi
1594         done
1595         if test "$ol_arg" = "invalid" ; then
1596                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1597         fi
1598         ol_enable_spasswd="$ol_arg"
1599
1600 else
1601         ol_enable_spasswd="no"
1602 fi
1603 # end --enable-spasswd
1604 # OpenLDAP --enable-modules
1605         # Check whether --enable-modules or --disable-modules was given.
1606 if test "${enable_modules+set}" = set; then
1607   enableval="$enable_modules"
1608   
1609         ol_arg=invalid
1610         for ol_val in auto yes no ; do
1611                 if test "$enableval" = "$ol_val" ; then
1612                         ol_arg="$ol_val"
1613                 fi
1614         done
1615         if test "$ol_arg" = "invalid" ; then
1616                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1617         fi
1618         ol_enable_modules="$ol_arg"
1619
1620 else
1621         ol_enable_modules="no"
1622 fi
1623 # end --enable-modules
1624 # OpenLDAP --enable-phonetic
1625         # Check whether --enable-phonetic or --disable-phonetic was given.
1626 if test "${enable_phonetic+set}" = set; then
1627   enableval="$enable_phonetic"
1628   
1629         ol_arg=invalid
1630         for ol_val in auto yes no ; do
1631                 if test "$enableval" = "$ol_val" ; then
1632                         ol_arg="$ol_val"
1633                 fi
1634         done
1635         if test "$ol_arg" = "invalid" ; then
1636                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1637         fi
1638         ol_enable_phonetic="$ol_arg"
1639
1640 else
1641         ol_enable_phonetic="no"
1642 fi
1643 # end --enable-phonetic
1644 # OpenLDAP --enable-rlookups
1645         # Check whether --enable-rlookups or --disable-rlookups was given.
1646 if test "${enable_rlookups+set}" = set; then
1647   enableval="$enable_rlookups"
1648   
1649         ol_arg=invalid
1650         for ol_val in auto yes no ; do
1651                 if test "$enableval" = "$ol_val" ; then
1652                         ol_arg="$ol_val"
1653                 fi
1654         done
1655         if test "$ol_arg" = "invalid" ; then
1656                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1657         fi
1658         ol_enable_rlookups="$ol_arg"
1659
1660 else
1661         ol_enable_rlookups="no"
1662 fi
1663 # end --enable-rlookups
1664 # OpenLDAP --enable-aci
1665         # Check whether --enable-aci or --disable-aci was given.
1666 if test "${enable_aci+set}" = set; then
1667   enableval="$enable_aci"
1668   
1669         ol_arg=invalid
1670         for ol_val in auto yes no ; do
1671                 if test "$enableval" = "$ol_val" ; then
1672                         ol_arg="$ol_val"
1673                 fi
1674         done
1675         if test "$ol_arg" = "invalid" ; then
1676                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1677         fi
1678         ol_enable_aci="$ol_arg"
1679
1680 else
1681         ol_enable_aci="no"
1682 fi
1683 # end --enable-aci
1684 # OpenLDAP --enable-wrappers
1685         # Check whether --enable-wrappers or --disable-wrappers was given.
1686 if test "${enable_wrappers+set}" = set; then
1687   enableval="$enable_wrappers"
1688   
1689         ol_arg=invalid
1690         for ol_val in auto yes no ; do
1691                 if test "$enableval" = "$ol_val" ; then
1692                         ol_arg="$ol_val"
1693                 fi
1694         done
1695         if test "$ol_arg" = "invalid" ; then
1696                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1697         fi
1698         ol_enable_wrappers="$ol_arg"
1699
1700 else
1701         ol_enable_wrappers="no"
1702 fi
1703 # end --enable-wrappers
1704 # OpenLDAP --enable-dynamic
1705         # Check whether --enable-dynamic or --disable-dynamic was given.
1706 if test "${enable_dynamic+set}" = set; then
1707   enableval="$enable_dynamic"
1708   
1709         ol_arg=invalid
1710         for ol_val in auto yes no ; do
1711                 if test "$enableval" = "$ol_val" ; then
1712                         ol_arg="$ol_val"
1713                 fi
1714         done
1715         if test "$ol_arg" = "invalid" ; then
1716                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1717         fi
1718         ol_enable_dynamic="$ol_arg"
1719
1720 else
1721         ol_enable_dynamic="no"
1722 fi
1723 # end --enable-dynamic
1724
1725 # OpenLDAP --enable-dnssrv
1726         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1727 if test "${enable_dnssrv+set}" = set; then
1728   enableval="$enable_dnssrv"
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-dnssrv" 1>&2; exit 1; }
1738         fi
1739         ol_enable_dnssrv="$ol_arg"
1740
1741 else
1742         ol_enable_dnssrv="no"
1743 fi
1744 # end --enable-dnssrv
1745 # OpenLDAP --with-dnssrv_module
1746         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1747 if test "${with_dnssrv_module+set}" = set; then
1748   withval="$with_dnssrv_module"
1749   
1750         ol_arg=invalid
1751         for ol_val in static dynamic ; do
1752                 if test "$withval" = "$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 $withval for --with-dnssrv_module" 1>&2; exit 1; }
1758         fi
1759         ol_with_dnssrv_module="$ol_arg"
1760
1761 else
1762         ol_with_dnssrv_module="static"
1763 fi
1764 # end --with-dnssrv_module
1765
1766 # OpenLDAP --enable-ldap
1767         # Check whether --enable-ldap or --disable-ldap was given.
1768 if test "${enable_ldap+set}" = set; then
1769   enableval="$enable_ldap"
1770   
1771         ol_arg=invalid
1772         for ol_val in auto yes no ; do
1773                 if test "$enableval" = "$ol_val" ; then
1774                         ol_arg="$ol_val"
1775                 fi
1776         done
1777         if test "$ol_arg" = "invalid" ; then
1778                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1779         fi
1780         ol_enable_ldap="$ol_arg"
1781
1782 else
1783         ol_enable_ldap="no"
1784 fi
1785 # end --enable-ldap
1786 # OpenLDAP --with-ldap_module
1787         # Check whether --with-ldap_module or --without-ldap_module was given.
1788 if test "${with_ldap_module+set}" = set; then
1789   withval="$with_ldap_module"
1790   
1791         ol_arg=invalid
1792         for ol_val in static dynamic ; do
1793                 if test "$withval" = "$ol_val" ; then
1794                         ol_arg="$ol_val"
1795                 fi
1796         done
1797         if test "$ol_arg" = "invalid" ; then
1798                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1799         fi
1800         ol_with_ldap_module="$ol_arg"
1801
1802 else
1803         ol_with_ldap_module="static"
1804 fi
1805 # end --with-ldap_module
1806
1807 # OpenLDAP --enable-ldbm
1808         # Check whether --enable-ldbm or --disable-ldbm was given.
1809 if test "${enable_ldbm+set}" = set; then
1810   enableval="$enable_ldbm"
1811   
1812         ol_arg=invalid
1813         for ol_val in auto yes no ; do
1814                 if test "$enableval" = "$ol_val" ; then
1815                         ol_arg="$ol_val"
1816                 fi
1817         done
1818         if test "$ol_arg" = "invalid" ; then
1819                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1820         fi
1821         ol_enable_ldbm="$ol_arg"
1822
1823 else
1824         ol_enable_ldbm="yes"
1825 fi
1826 # end --enable-ldbm
1827 # OpenLDAP --with-ldbm_api
1828         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1829 if test "${with_ldbm_api+set}" = set; then
1830   withval="$with_ldbm_api"
1831   
1832         ol_arg=invalid
1833         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1834                 if test "$withval" = "$ol_val" ; then
1835                         ol_arg="$ol_val"
1836                 fi
1837         done
1838         if test "$ol_arg" = "invalid" ; then
1839                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1840         fi
1841         ol_with_ldbm_api="$ol_arg"
1842
1843 else
1844         ol_with_ldbm_api="auto"
1845 fi
1846 # end --with-ldbm_api
1847
1848 # OpenLDAP --with-ldbm_module
1849         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1850 if test "${with_ldbm_module+set}" = set; then
1851   withval="$with_ldbm_module"
1852   
1853         ol_arg=invalid
1854         for ol_val in static dynamic ; do
1855                 if test "$withval" = "$ol_val" ; then
1856                         ol_arg="$ol_val"
1857                 fi
1858         done
1859         if test "$ol_arg" = "invalid" ; then
1860                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1861         fi
1862         ol_with_ldbm_module="$ol_arg"
1863
1864 else
1865         ol_with_ldbm_module="static"
1866 fi
1867 # end --with-ldbm_module
1868
1869 # OpenLDAP --with-ldbm_type
1870         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1871 if test "${with_ldbm_type+set}" = set; then
1872   withval="$with_ldbm_type"
1873   
1874         ol_arg=invalid
1875         for ol_val in auto btree hash ; do
1876                 if test "$withval" = "$ol_val" ; then
1877                         ol_arg="$ol_val"
1878                 fi
1879         done
1880         if test "$ol_arg" = "invalid" ; then
1881                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1882         fi
1883         ol_with_ldbm_type="$ol_arg"
1884
1885 else
1886         ol_with_ldbm_type="auto"
1887 fi
1888 # end --with-ldbm_type
1889
1890 # OpenLDAP --enable-passwd
1891         # Check whether --enable-passwd or --disable-passwd was given.
1892 if test "${enable_passwd+set}" = set; then
1893   enableval="$enable_passwd"
1894   
1895         ol_arg=invalid
1896         for ol_val in auto yes no ; do
1897                 if test "$enableval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1903         fi
1904         ol_enable_passwd="$ol_arg"
1905
1906 else
1907         ol_enable_passwd="no"
1908 fi
1909 # end --enable-passwd
1910 # OpenLDAP --with-passwd_module
1911         # Check whether --with-passwd_module or --without-passwd_module was given.
1912 if test "${with_passwd_module+set}" = set; then
1913   withval="$with_passwd_module"
1914   
1915         ol_arg=invalid
1916         for ol_val in static dynamic ; do
1917                 if test "$withval" = "$ol_val" ; then
1918                         ol_arg="$ol_val"
1919                 fi
1920         done
1921         if test "$ol_arg" = "invalid" ; then
1922                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1923         fi
1924         ol_with_passwd_module="$ol_arg"
1925
1926 else
1927         ol_with_passwd_module="static"
1928 fi
1929 # end --with-passwd_module
1930
1931 # OpenLDAP --enable-shell
1932         # Check whether --enable-shell or --disable-shell was given.
1933 if test "${enable_shell+set}" = set; then
1934   enableval="$enable_shell"
1935   
1936         ol_arg=invalid
1937         for ol_val in auto yes no ; do
1938                 if test "$enableval" = "$ol_val" ; then
1939                         ol_arg="$ol_val"
1940                 fi
1941         done
1942         if test "$ol_arg" = "invalid" ; then
1943                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1944         fi
1945         ol_enable_shell="$ol_arg"
1946
1947 else
1948         ol_enable_shell="no"
1949 fi
1950 # end --enable-shell
1951 # OpenLDAP --with-shell_module
1952         # Check whether --with-shell_module or --without-shell_module was given.
1953 if test "${with_shell_module+set}" = set; then
1954   withval="$with_shell_module"
1955   
1956         ol_arg=invalid
1957         for ol_val in static dynamic ; do
1958                 if test "$withval" = "$ol_val" ; then
1959                         ol_arg="$ol_val"
1960                 fi
1961         done
1962         if test "$ol_arg" = "invalid" ; then
1963                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1964         fi
1965         ol_with_shell_module="$ol_arg"
1966
1967 else
1968         ol_with_shell_module="static"
1969 fi
1970 # end --with-shell_module
1971
1972 # OpenLDAP --enable-sql
1973         # Check whether --enable-sql or --disable-sql was given.
1974 if test "${enable_sql+set}" = set; then
1975   enableval="$enable_sql"
1976   
1977         ol_arg=invalid
1978         for ol_val in auto yes no ; do
1979                 if test "$enableval" = "$ol_val" ; then
1980                         ol_arg="$ol_val"
1981                 fi
1982         done
1983         if test "$ol_arg" = "invalid" ; then
1984                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
1985         fi
1986         ol_enable_sql="$ol_arg"
1987
1988 else
1989         ol_enable_sql="no"
1990 fi
1991 # end --enable-sql
1992 # OpenLDAP --with-sql_module
1993         # Check whether --with-sql_module or --without-sql_module was given.
1994 if test "${with_sql_module+set}" = set; then
1995   withval="$with_sql_module"
1996   
1997         ol_arg=invalid
1998         for ol_val in static dynamic ; do
1999                 if test "$withval" = "$ol_val" ; then
2000                         ol_arg="$ol_val"
2001                 fi
2002         done
2003         if test "$ol_arg" = "invalid" ; then
2004                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2005         fi
2006         ol_with_sql_module="$ol_arg"
2007
2008 else
2009         ol_with_sql_module="static"
2010 fi
2011 # end --with-sql_module
2012
2013
2014 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2015 if test "${with_xxslurpdoptions+set}" = set; then
2016   withval="$with_xxslurpdoptions"
2017   :
2018 fi
2019
2020 # OpenLDAP --enable-slurpd
2021         # Check whether --enable-slurpd or --disable-slurpd was given.
2022 if test "${enable_slurpd+set}" = set; then
2023   enableval="$enable_slurpd"
2024   
2025         ol_arg=invalid
2026         for ol_val in auto yes no ; do
2027                 if test "$enableval" = "$ol_val" ; then
2028                         ol_arg="$ol_val"
2029                 fi
2030         done
2031         if test "$ol_arg" = "invalid" ; then
2032                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2033         fi
2034         ol_enable_slurpd="$ol_arg"
2035
2036 else
2037         ol_enable_slurpd="auto"
2038 fi
2039 # end --enable-slurpd
2040
2041 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2042 if test "${with_xxliboptions+set}" = set; then
2043   withval="$with_xxliboptions"
2044   :
2045 fi
2046
2047 # Check whether --enable-static or --disable-static was given.
2048 if test "${enable_static+set}" = set; then
2049   enableval="$enable_static"
2050   p=${PACKAGE-default}
2051 case "$enableval" in
2052 yes) enable_static=yes ;;
2053 no) enable_static=no ;;
2054 *)
2055   enable_static=no
2056   # Look at the argument we got.  We use all the common list separators.
2057   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2058   for pkg in $enableval; do
2059     if test "X$pkg" = "X$p"; then
2060       enable_static=yes
2061     fi
2062   done
2063   IFS="$ac_save_ifs"
2064   ;;
2065 esac
2066 else
2067   enable_static=yes
2068 fi
2069
2070 # Check whether --enable-shared or --disable-shared was given.
2071 if test "${enable_shared+set}" = set; then
2072   enableval="$enable_shared"
2073   p=${PACKAGE-default}
2074 case "$enableval" in
2075 yes) enable_shared=yes ;;
2076 no) enable_shared=no ;;
2077 *)
2078   enable_shared=no
2079   # Look at the argument we got.  We use all the common list separators.
2080   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2081   for pkg in $enableval; do
2082     if test "X$pkg" = "X$p"; then
2083       enable_shared=yes
2084     fi
2085   done
2086   IFS="$ac_save_ifs"
2087   ;;
2088 esac
2089 else
2090   enable_shared=yes
2091 fi
2092
2093
2094
2095 # validate options
2096 if test $ol_enable_slapd = no ; then
2097                 if test $ol_enable_dnssrv = yes ; then
2098                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2099         fi
2100         if test $ol_enable_ldap = yes ; then
2101                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2102         fi
2103         if test $ol_enable_ldbm = yes ; then
2104                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2105         fi
2106         if test $ol_enable_passwd = yes ; then
2107                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2108         fi
2109         if test $ol_enable_shell = yes ; then
2110                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2111         fi
2112         if test $ol_enable_sql = yes ; then
2113                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2114         fi
2115         if test $ol_enable_modules = yes ; then
2116                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2117         fi
2118         if test $ol_enable_wrappers = yes ; then
2119                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2120         fi
2121         if test $ol_enable_phonetic = yes ; then
2122                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2123         fi
2124         if test $ol_enable_rlookups = yes ; then
2125                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2126         fi
2127         if test $ol_enable_aci = yes ; then
2128                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2129         fi
2130         if test $ol_with_ldbm_api != auto ; then
2131                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2132         fi
2133         if test $ol_with_ldbm_type != auto ; then
2134                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2135         fi
2136         if test $ol_with_dnssrv_module != static ; then
2137                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2138         fi
2139         if test $ol_with_ldap_module != static ; then
2140                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2141         fi
2142         if test $ol_with_ldbm_module != static ; then
2143                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2144         fi
2145         if test $ol_with_passwd_module != static ; then
2146                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2147         fi
2148         if test $ol_with_shell_module != static ; then
2149                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2150         fi
2151         if test $ol_with_sql_module != static ; then
2152                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2153         fi
2154         if test $ol_enable_slurpd = yes ; then
2155                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2156         fi
2157
2158         # force settings to no
2159         ol_enable_dnssrv=no
2160         ol_enable_ldap=no
2161         ol_enable_ldbm=no
2162         ol_enable_passwd=no
2163         ol_enable_shell=no
2164         ol_enable_sql=no
2165
2166         ol_enable_modules=no
2167         ol_enable_phonetic=no
2168         ol_enable_rlookups=no
2169         ol_enable_aci=no
2170         ol_enable_wrappers=no
2171         ol_enable_dynamic=no
2172
2173         ol_with_ldbm_api=no
2174         ol_with_ldbm_type=no
2175
2176         ol_with_dnssrv_module=static
2177         ol_with_ldap_module=static
2178         ol_with_ldbm_module=static
2179         ol_with_passwd_module=static
2180         ol_with_shell_module=static
2181         ol_with_sql_module=static
2182
2183         ol_enable_slurpd=no
2184
2185 elif test $ol_enable_ldbm = no ; then
2186         
2187         if test $ol_with_ldbm_api != auto ; then
2188                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2189         fi
2190
2191         if test $ol_with_ldbm_type != auto ; then
2192                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2193         fi
2194
2195         if test $ol_with_ldbm_module != static ; then
2196                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2197         fi
2198
2199         if test $ol_enable_modules != yes -a \
2200                 $ol_enable_dnssrv = no -a \
2201                 $ol_enable_ldap = no -a \
2202                 $ol_enable_passwd = no -a \
2203                 $ol_enable_shell = no -a \
2204                 $ol_enable_sql = no ; then
2205                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2206         fi
2207
2208         ol_with_ldbm_api=no
2209         ol_with_ldbm_type=no
2210         ol_with_ldbm_module=static
2211
2212 else
2213                 if test $ol_with_ldbm_api = gdbm -a \
2214                 $ol_with_ldbm_type = btree ; then
2215                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2216         fi
2217         if test $ol_with_ldbm_api = mdbm -a \
2218                 $ol_with_ldbm_type = btree ; then
2219                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2220         fi
2221         if test $ol_with_ldbm_api = ndbm -a \
2222                 $ol_with_ldbm_type = btree ; then
2223                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2224         fi
2225 fi
2226
2227 if test $ol_enable_slurpd = yes ; then
2228                 if test $ol_with_threads = no ; then
2229                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2230         fi
2231 fi
2232
2233 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2234         if test $ol_with_kerberos = no ; then
2235                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2236         elif test $ol_with_kerberos = auto ; then
2237                 ol_with_kerberos=yes
2238         fi
2239
2240 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2241         if test $ol_with_kerberos = auto ; then
2242                 ol_with_kerberos=no
2243         elif test $ol_with_kerberos != no ; then
2244                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2245                 ol_with_kerberos=no
2246         fi
2247 fi
2248
2249 if test $ol_enable_spasswd = yes ; then
2250         if test $ol_with_cyrus_sasl = no ; then
2251                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2252         fi
2253         ol_with_cyrus_sasl=yes
2254 fi
2255
2256 echo "$ac_t""done" 1>&6
2257
2258 LDAP_LIBS=
2259 LDIF_LIBS=
2260 LDBM_LIBS=
2261 LTHREAD_LIBS=
2262 LUTIL_LIBS=
2263
2264 SLAPD_LIBS=
2265 SLURPD_LIBS=
2266
2267 BUILD_SLAPD=no
2268 BUILD_SLURPD=no
2269
2270 BUILD_THREAD=no
2271
2272 BUILD_DNSSRV=no
2273 BUILD_LDAP=no
2274 BUILD_LDBM=no
2275 BUILD_PASSWD=no
2276 BUILD_SHELL=no
2277 BUILD_SQL=no
2278
2279 BUILD_DNSSRV_DYNAMIC=static
2280 BUILD_LDAP_DYNAMIC=static
2281 BUILD_LDBM_DYNAMIC=static
2282 BUILD_PASSWD_DYNAMIC=static
2283 BUILD_SHELL_DYNAMIC=static
2284 BUILD_SQL_DYNAMIC=static
2285
2286 SLAPD_MODULES_LDFLAGS=
2287 SLAPD_MODULES_CPPFLAGS=
2288 SLAPD_MODULES_LIST=
2289
2290 SLAPD_SQL_LDFLAGS=
2291 SLAPD_SQL_LIBS=
2292 SLAPD_SQL_INCLUDES=
2293
2294 KRB4_LIBS=
2295 KRB5_LIBS=
2296 READLINE_LIBS=
2297 SASL_LIBS=
2298 TERMCAP_LIBS=
2299 TLS_LIBS=
2300 MODULES_LIBS=
2301 AUTH_LIBS=
2302
2303
2304
2305 cat >> confdefs.h <<\EOF
2306 #define HAVE_MKVERSION 1
2307 EOF
2308
2309
2310
2311
2312 ol_aix_threads=no
2313 case "$target" in
2314 *-*-aix*)       if test -z "$CC" ; then
2315                 case "$ol_with_threads" in
2316                 auto | yes |  posix) ol_aix_threads=yes ;;
2317                 esac
2318         fi
2319 ;;
2320 esac
2321
2322 if test $ol_aix_threads = yes ; then
2323         if test -z "${CC}" ; then
2324                 for ac_prog in cc_r xlc_r cc
2325 do
2326 # Extract the first word of "$ac_prog", so it can be a program name with args.
2327 set dummy $ac_prog; ac_word=$2
2328 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2329 echo "configure:2330: checking for $ac_word" >&5
2330 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2331   echo $ac_n "(cached) $ac_c" 1>&6
2332 else
2333   if test -n "$CC"; then
2334   ac_cv_prog_CC="$CC" # Let the user override the test.
2335 else
2336   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2337   ac_dummy="$PATH"
2338   for ac_dir in $ac_dummy; do
2339     test -z "$ac_dir" && ac_dir=.
2340     if test -f $ac_dir/$ac_word; then
2341       ac_cv_prog_CC="$ac_prog"
2342       break
2343     fi
2344   done
2345   IFS="$ac_save_ifs"
2346 fi
2347 fi
2348 CC="$ac_cv_prog_CC"
2349 if test -n "$CC"; then
2350   echo "$ac_t""$CC" 1>&6
2351 else
2352   echo "$ac_t""no" 1>&6
2353 fi
2354
2355 test -n "$CC" && break
2356 done
2357
2358
2359                 if test "$CC" = cc ; then
2360                                                 if test $ol_with_threads != auto ; then
2361                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2362                         else
2363                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2364                         fi
2365                         ol_with_threads=no
2366                 fi
2367         fi
2368
2369         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2370                 ol_with_threads=posix
2371                 ol_cv_pthread_create=yes
2372         fi
2373 fi
2374
2375 if test -z "${CC}"; then
2376         for ac_prog in cc
2377 do
2378 # Extract the first word of "$ac_prog", so it can be a program name with args.
2379 set dummy $ac_prog; ac_word=$2
2380 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2381 echo "configure:2382: checking for $ac_word" >&5
2382 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   if test -n "$CC"; then
2386   ac_cv_prog_CC="$CC" # Let the user override the test.
2387 else
2388   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2389   ac_dummy="$PATH"
2390   for ac_dir in $ac_dummy; do
2391     test -z "$ac_dir" && ac_dir=.
2392     if test -f $ac_dir/$ac_word; then
2393       ac_cv_prog_CC="$ac_prog"
2394       break
2395     fi
2396   done
2397   IFS="$ac_save_ifs"
2398 fi
2399 fi
2400 CC="$ac_cv_prog_CC"
2401 if test -n "$CC"; then
2402   echo "$ac_t""$CC" 1>&6
2403 else
2404   echo "$ac_t""no" 1>&6
2405 fi
2406
2407 test -n "$CC" && break
2408 done
2409
2410 fi
2411
2412
2413 for ac_prog in ar gar
2414 do
2415 # Extract the first word of "$ac_prog", so it can be a program name with args.
2416 set dummy $ac_prog; ac_word=$2
2417 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2418 echo "configure:2419: checking for $ac_word" >&5
2419 if eval "test \"\${ac_cv_prog_AR+set}\" = set"; then
2420   echo $ac_n "(cached) $ac_c" 1>&6
2421 else
2422   if test -n "$AR"; then
2423   ac_cv_prog_AR="$AR" # Let the user override the test.
2424 else
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2426   ac_dummy="$PATH"
2427   for ac_dir in $ac_dummy; do
2428     test -z "$ac_dir" && ac_dir=.
2429     if test -f $ac_dir/$ac_word; then
2430       ac_cv_prog_AR="$ac_prog"
2431       break
2432     fi
2433   done
2434   IFS="$ac_save_ifs"
2435 fi
2436 fi
2437 AR="$ac_cv_prog_AR"
2438 if test -n "$AR"; then
2439   echo "$ac_t""$AR" 1>&6
2440 else
2441   echo "$ac_t""no" 1>&6
2442 fi
2443
2444 test -n "$AR" && break
2445 done
2446
2447
2448
2449
2450 # Check whether --enable-fast-install or --disable-fast-install was given.
2451 if test "${enable_fast_install+set}" = set; then
2452   enableval="$enable_fast_install"
2453   p=${PACKAGE-default}
2454 case "$enableval" in
2455 yes) enable_fast_install=yes ;;
2456 no) enable_fast_install=no ;;
2457 *)
2458   enable_fast_install=no
2459   # Look at the argument we got.  We use all the common list separators.
2460   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2461   for pkg in $enableval; do
2462     if test "X$pkg" = "X$p"; then
2463       enable_fast_install=yes
2464     fi
2465   done
2466   IFS="$ac_save_ifs"
2467   ;;
2468 esac
2469 else
2470   enable_fast_install=yes
2471 fi
2472
2473 # Extract the first word of "ranlib", so it can be a program name with args.
2474 set dummy ranlib; ac_word=$2
2475 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2476 echo "configure:2477: checking for $ac_word" >&5
2477 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2478   echo $ac_n "(cached) $ac_c" 1>&6
2479 else
2480   if test -n "$RANLIB"; then
2481   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2482 else
2483   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2484   ac_dummy="$PATH"
2485   for ac_dir in $ac_dummy; do
2486     test -z "$ac_dir" && ac_dir=.
2487     if test -f $ac_dir/$ac_word; then
2488       ac_cv_prog_RANLIB="ranlib"
2489       break
2490     fi
2491   done
2492   IFS="$ac_save_ifs"
2493   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2494 fi
2495 fi
2496 RANLIB="$ac_cv_prog_RANLIB"
2497 if test -n "$RANLIB"; then
2498   echo "$ac_t""$RANLIB" 1>&6
2499 else
2500   echo "$ac_t""no" 1>&6
2501 fi
2502
2503 # Extract the first word of "gcc", so it can be a program name with args.
2504 set dummy gcc; ac_word=$2
2505 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2506 echo "configure:2507: checking for $ac_word" >&5
2507 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2508   echo $ac_n "(cached) $ac_c" 1>&6
2509 else
2510   if test -n "$CC"; then
2511   ac_cv_prog_CC="$CC" # Let the user override the test.
2512 else
2513   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2514   ac_dummy="$PATH"
2515   for ac_dir in $ac_dummy; do
2516     test -z "$ac_dir" && ac_dir=.
2517     if test -f $ac_dir/$ac_word; then
2518       ac_cv_prog_CC="gcc"
2519       break
2520     fi
2521   done
2522   IFS="$ac_save_ifs"
2523 fi
2524 fi
2525 CC="$ac_cv_prog_CC"
2526 if test -n "$CC"; then
2527   echo "$ac_t""$CC" 1>&6
2528 else
2529   echo "$ac_t""no" 1>&6
2530 fi
2531
2532 if test -z "$CC"; then
2533   # Extract the first word of "cc", so it can be a program name with args.
2534 set dummy cc; ac_word=$2
2535 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2536 echo "configure:2537: checking for $ac_word" >&5
2537 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2538   echo $ac_n "(cached) $ac_c" 1>&6
2539 else
2540   if test -n "$CC"; then
2541   ac_cv_prog_CC="$CC" # Let the user override the test.
2542 else
2543   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2544   ac_prog_rejected=no
2545   ac_dummy="$PATH"
2546   for ac_dir in $ac_dummy; do
2547     test -z "$ac_dir" && ac_dir=.
2548     if test -f $ac_dir/$ac_word; then
2549       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2550         ac_prog_rejected=yes
2551         continue
2552       fi
2553       ac_cv_prog_CC="cc"
2554       break
2555     fi
2556   done
2557   IFS="$ac_save_ifs"
2558 if test $ac_prog_rejected = yes; then
2559   # We found a bogon in the path, so make sure we never use it.
2560   set dummy $ac_cv_prog_CC
2561   shift
2562   if test $# -gt 0; then
2563     # We chose a different compiler from the bogus one.
2564     # However, it has the same basename, so the bogon will be chosen
2565     # first if we set CC to just the basename; use the full file name.
2566     shift
2567     set dummy "$ac_dir/$ac_word" "$@"
2568     shift
2569     ac_cv_prog_CC="$@"
2570   fi
2571 fi
2572 fi
2573 fi
2574 CC="$ac_cv_prog_CC"
2575 if test -n "$CC"; then
2576   echo "$ac_t""$CC" 1>&6
2577 else
2578   echo "$ac_t""no" 1>&6
2579 fi
2580
2581   if test -z "$CC"; then
2582     case "`uname -s`" in
2583     *win32* | *WIN32* | *CYGWIN*)
2584       # Extract the first word of "cl", so it can be a program name with args.
2585 set dummy cl; ac_word=$2
2586 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2587 echo "configure:2588: checking for $ac_word" >&5
2588 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2589   echo $ac_n "(cached) $ac_c" 1>&6
2590 else
2591   if test -n "$CC"; then
2592   ac_cv_prog_CC="$CC" # Let the user override the test.
2593 else
2594   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2595   ac_dummy="$PATH"
2596   for ac_dir in $ac_dummy; do
2597     test -z "$ac_dir" && ac_dir=.
2598     if test -f $ac_dir/$ac_word; then
2599       ac_cv_prog_CC="cl"
2600       break
2601     fi
2602   done
2603   IFS="$ac_save_ifs"
2604 fi
2605 fi
2606 CC="$ac_cv_prog_CC"
2607 if test -n "$CC"; then
2608   echo "$ac_t""$CC" 1>&6
2609 else
2610   echo "$ac_t""no" 1>&6
2611 fi
2612  ;;
2613     esac
2614   fi
2615   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2616 fi
2617
2618 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2619 echo "configure:2620: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2620
2621 ac_ext=c
2622 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2623 ac_cpp='$CPP $CPPFLAGS'
2624 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2625 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2626 cross_compiling=$ac_cv_prog_cc_cross
2627
2628 cat > conftest.$ac_ext << EOF
2629
2630 #line 2631 "configure"
2631 #include "confdefs.h"
2632
2633 main(){return(0);}
2634 EOF
2635 if { (eval echo configure:2636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2636   ac_cv_prog_cc_works=yes
2637   # If we can't run a trivial program, we are probably using a cross compiler.
2638   if (./conftest; exit) 2>/dev/null; then
2639     ac_cv_prog_cc_cross=no
2640   else
2641     ac_cv_prog_cc_cross=yes
2642   fi
2643 else
2644   echo "configure: failed program was:" >&5
2645   cat conftest.$ac_ext >&5
2646   ac_cv_prog_cc_works=no
2647 fi
2648 rm -fr conftest*
2649 ac_ext=c
2650 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2651 ac_cpp='$CPP $CPPFLAGS'
2652 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2653 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2654 cross_compiling=$ac_cv_prog_cc_cross
2655
2656 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2657 if test $ac_cv_prog_cc_works = no; then
2658   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2659 fi
2660 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2661 echo "configure:2662: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2662 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2663 cross_compiling=$ac_cv_prog_cc_cross
2664
2665 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2666 echo "configure:2667: checking whether we are using GNU C" >&5
2667 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2668   echo $ac_n "(cached) $ac_c" 1>&6
2669 else
2670   cat > conftest.c <<EOF
2671 #ifdef __GNUC__
2672   yes;
2673 #endif
2674 EOF
2675 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2676   ac_cv_prog_gcc=yes
2677 else
2678   ac_cv_prog_gcc=no
2679 fi
2680 fi
2681
2682 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2683
2684 if test $ac_cv_prog_gcc = yes; then
2685   GCC=yes
2686 else
2687   GCC=
2688 fi
2689
2690 ac_test_CFLAGS="${CFLAGS+set}"
2691 ac_save_CFLAGS="$CFLAGS"
2692 CFLAGS=
2693 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2694 echo "configure:2695: checking whether ${CC-cc} accepts -g" >&5
2695 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2696   echo $ac_n "(cached) $ac_c" 1>&6
2697 else
2698   echo 'void f(){}' > conftest.c
2699 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2700   ac_cv_prog_cc_g=yes
2701 else
2702   ac_cv_prog_cc_g=no
2703 fi
2704 rm -f conftest*
2705
2706 fi
2707
2708 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2709 if test "$ac_test_CFLAGS" = set; then
2710   CFLAGS="$ac_save_CFLAGS"
2711 elif test $ac_cv_prog_cc_g = yes; then
2712   if test "$GCC" = yes; then
2713     CFLAGS="-g -O2"
2714   else
2715     CFLAGS="-g"
2716   fi
2717 else
2718   if test "$GCC" = yes; then
2719     CFLAGS="-O2"
2720   else
2721     CFLAGS=
2722   fi
2723 fi
2724
2725 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2726 if test "${with_gnu_ld+set}" = set; then
2727   withval="$with_gnu_ld"
2728   test "$withval" = no || with_gnu_ld=yes
2729 else
2730   with_gnu_ld=no
2731 fi
2732
2733 ac_prog=ld
2734 if test "$ac_cv_prog_gcc" = yes; then
2735   # Check if gcc -print-prog-name=ld gives a path.
2736   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2737 echo "configure:2738: checking for ld used by GCC" >&5
2738   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2739   case "$ac_prog" in
2740     # Accept absolute paths.
2741     [\\/]* | [A-Za-z]:[\\/]*)
2742       re_direlt='/[^/][^/]*/\.\./'
2743       # Canonicalize the path of ld
2744       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2745       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2746         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2747       done
2748       test -z "$LD" && LD="$ac_prog"
2749       ;;
2750   "")
2751     # If it fails, then pretend we aren't using GCC.
2752     ac_prog=ld
2753     ;;
2754   *)
2755     # If it is relative, then search for the first ld in PATH.
2756     with_gnu_ld=unknown
2757     ;;
2758   esac
2759 elif test "$with_gnu_ld" = yes; then
2760   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2761 echo "configure:2762: checking for GNU ld" >&5
2762 else
2763   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2764 echo "configure:2765: checking for non-GNU ld" >&5
2765 fi
2766 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2767   echo $ac_n "(cached) $ac_c" 1>&6
2768 else
2769   if test -z "$LD"; then
2770   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2771   for ac_dir in $PATH; do
2772     test -z "$ac_dir" && ac_dir=.
2773     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2774       ac_cv_path_LD="$ac_dir/$ac_prog"
2775       # Check to see if the program is GNU ld.  I'd rather use --version,
2776       # but apparently some GNU ld's only accept -v.
2777       # Break only if it was the GNU/non-GNU ld that we prefer.
2778       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2779         test "$with_gnu_ld" != no && break
2780       else
2781         test "$with_gnu_ld" != yes && break
2782       fi
2783     fi
2784   done
2785   IFS="$ac_save_ifs"
2786 else
2787   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2788 fi
2789 fi
2790
2791 LD="$ac_cv_path_LD"
2792 if test -n "$LD"; then
2793   echo "$ac_t""$LD" 1>&6
2794 else
2795   echo "$ac_t""no" 1>&6
2796 fi
2797 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2798 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2799 echo "configure:2800: checking if the linker ($LD) is GNU ld" >&5
2800 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2801   echo $ac_n "(cached) $ac_c" 1>&6
2802 else
2803   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2804 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2805   ac_cv_prog_gnu_ld=yes
2806 else
2807   ac_cv_prog_gnu_ld=no
2808 fi
2809 fi
2810
2811 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2812
2813
2814 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2815 echo "configure:2816: checking for BSD-compatible nm" >&5
2816 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2817   echo $ac_n "(cached) $ac_c" 1>&6
2818 else
2819   if test -n "$NM"; then
2820   # Let the user override the test.
2821   ac_cv_path_NM="$NM"
2822 else
2823   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2824   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2825     test -z "$ac_dir" && ac_dir=.
2826     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2827       # Check to see if the nm accepts a BSD-compat flag.
2828       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2829       #   nm: unknown option "B" ignored
2830       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2831         ac_cv_path_NM="$ac_dir/nm -B"
2832         break
2833       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2834         ac_cv_path_NM="$ac_dir/nm -p"
2835         break
2836       else
2837         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2838         continue # so that we can try to find one that supports BSD flags
2839       fi
2840     fi
2841   done
2842   IFS="$ac_save_ifs"
2843   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2844 fi
2845 fi
2846
2847 NM="$ac_cv_path_NM"
2848 echo "$ac_t""$NM" 1>&6
2849
2850 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2851 echo "configure:2852: checking whether ln -s works" >&5
2852 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2853   echo $ac_n "(cached) $ac_c" 1>&6
2854 else
2855   rm -f conftestdata
2856 if ln -s X conftestdata 2>/dev/null
2857 then
2858   rm -f conftestdata
2859   ac_cv_prog_LN_S="ln -s"
2860 else
2861   ac_cv_prog_LN_S=ln
2862 fi
2863 fi
2864 LN_S="$ac_cv_prog_LN_S"
2865 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2866   echo "$ac_t""yes" 1>&6
2867 else
2868   echo "$ac_t""no" 1>&6
2869 fi
2870
2871 if test $host != $build; then
2872   ac_tool_prefix=${host_alias}-
2873 else
2874   ac_tool_prefix=
2875 fi
2876
2877
2878 case "$target" in
2879 NONE) lt_target="$host" ;;
2880 *) lt_target="$target" ;;
2881 esac
2882
2883 # Check for any special flags to pass to ltconfig.
2884 libtool_flags="--cache-file=$cache_file"
2885 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2886 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2887 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2888 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2889 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2890 libtool_flags="$libtool_flags --enable-dlopen"
2891 libtool_flags="$libtool_flags --enable-win32-dll"
2892 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2893 if test "${enable_libtool_lock+set}" = set; then
2894   enableval="$enable_libtool_lock"
2895   :
2896 fi
2897
2898 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2899 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2900
2901 # Some flags need to be propagated to the compiler or linker for good
2902 # libtool support.
2903 case "$lt_target" in
2904 *-*-irix6*)
2905   # Find out which ABI we are using.
2906   echo '#line 2907 "configure"' > conftest.$ac_ext
2907   if { (eval echo configure:2908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2908     case "`/usr/bin/file conftest.o`" in
2909     *32-bit*)
2910       LD="${LD-ld} -32"
2911       ;;
2912     *N32*)
2913       LD="${LD-ld} -n32"
2914       ;;
2915     *64-bit*)
2916       LD="${LD-ld} -64"
2917       ;;
2918     esac
2919   fi
2920   rm -rf conftest*
2921   ;;
2922
2923 *-*-sco3.2v5*)
2924   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2925   SAVE_CFLAGS="$CFLAGS"
2926   CFLAGS="$CFLAGS -belf"
2927   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2928 echo "configure:2929: checking whether the C compiler needs -belf" >&5
2929 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2930   echo $ac_n "(cached) $ac_c" 1>&6
2931 else
2932   cat > conftest.$ac_ext <<EOF
2933 #line 2934 "configure"
2934 #include "confdefs.h"
2935
2936 int main() {
2937
2938 ; return 0; }
2939 EOF
2940 if { (eval echo configure:2941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2941   rm -rf conftest*
2942   lt_cv_cc_needs_belf=yes
2943 else
2944   echo "configure: failed program was:" >&5
2945   cat conftest.$ac_ext >&5
2946   rm -rf conftest*
2947   lt_cv_cc_needs_belf=no
2948 fi
2949 rm -f conftest*
2950 fi
2951
2952 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2953   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2954     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2955     CFLAGS="$SAVE_CFLAGS"
2956   fi
2957   ;;
2958
2959 *-*-cygwin* | *-*-mingw*)
2960   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2961 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2962 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2963 echo "configure:2964: checking for $ac_word" >&5
2964 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2965   echo $ac_n "(cached) $ac_c" 1>&6
2966 else
2967   if test -n "$DLLTOOL"; then
2968   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2969 else
2970   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2971   ac_dummy="$PATH"
2972   for ac_dir in $ac_dummy; do
2973     test -z "$ac_dir" && ac_dir=.
2974     if test -f $ac_dir/$ac_word; then
2975       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2976       break
2977     fi
2978   done
2979   IFS="$ac_save_ifs"
2980 fi
2981 fi
2982 DLLTOOL="$ac_cv_prog_DLLTOOL"
2983 if test -n "$DLLTOOL"; then
2984   echo "$ac_t""$DLLTOOL" 1>&6
2985 else
2986   echo "$ac_t""no" 1>&6
2987 fi
2988
2989
2990 if test -z "$ac_cv_prog_DLLTOOL"; then
2991 if test -n "$ac_tool_prefix"; then
2992   # Extract the first word of "dlltool", so it can be a program name with args.
2993 set dummy dlltool; ac_word=$2
2994 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2995 echo "configure:2996: checking for $ac_word" >&5
2996 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   if test -n "$DLLTOOL"; then
3000   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3001 else
3002   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3003   ac_dummy="$PATH"
3004   for ac_dir in $ac_dummy; do
3005     test -z "$ac_dir" && ac_dir=.
3006     if test -f $ac_dir/$ac_word; then
3007       ac_cv_prog_DLLTOOL="dlltool"
3008       break
3009     fi
3010   done
3011   IFS="$ac_save_ifs"
3012   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3013 fi
3014 fi
3015 DLLTOOL="$ac_cv_prog_DLLTOOL"
3016 if test -n "$DLLTOOL"; then
3017   echo "$ac_t""$DLLTOOL" 1>&6
3018 else
3019   echo "$ac_t""no" 1>&6
3020 fi
3021
3022 else
3023   DLLTOOL="false"
3024 fi
3025 fi
3026
3027   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3028 set dummy ${ac_tool_prefix}as; ac_word=$2
3029 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3030 echo "configure:3031: checking for $ac_word" >&5
3031 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3032   echo $ac_n "(cached) $ac_c" 1>&6
3033 else
3034   if test -n "$AS"; then
3035   ac_cv_prog_AS="$AS" # Let the user override the test.
3036 else
3037   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3038   ac_dummy="$PATH"
3039   for ac_dir in $ac_dummy; do
3040     test -z "$ac_dir" && ac_dir=.
3041     if test -f $ac_dir/$ac_word; then
3042       ac_cv_prog_AS="${ac_tool_prefix}as"
3043       break
3044     fi
3045   done
3046   IFS="$ac_save_ifs"
3047 fi
3048 fi
3049 AS="$ac_cv_prog_AS"
3050 if test -n "$AS"; then
3051   echo "$ac_t""$AS" 1>&6
3052 else
3053   echo "$ac_t""no" 1>&6
3054 fi
3055
3056
3057 if test -z "$ac_cv_prog_AS"; then
3058 if test -n "$ac_tool_prefix"; then
3059   # Extract the first word of "as", so it can be a program name with args.
3060 set dummy as; ac_word=$2
3061 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3062 echo "configure:3063: checking for $ac_word" >&5
3063 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3064   echo $ac_n "(cached) $ac_c" 1>&6
3065 else
3066   if test -n "$AS"; then
3067   ac_cv_prog_AS="$AS" # Let the user override the test.
3068 else
3069   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3070   ac_dummy="$PATH"
3071   for ac_dir in $ac_dummy; do
3072     test -z "$ac_dir" && ac_dir=.
3073     if test -f $ac_dir/$ac_word; then
3074       ac_cv_prog_AS="as"
3075       break
3076     fi
3077   done
3078   IFS="$ac_save_ifs"
3079   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3080 fi
3081 fi
3082 AS="$ac_cv_prog_AS"
3083 if test -n "$AS"; then
3084   echo "$ac_t""$AS" 1>&6
3085 else
3086   echo "$ac_t""no" 1>&6
3087 fi
3088
3089 else
3090   AS="false"
3091 fi
3092 fi
3093
3094   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3095 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3096 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3097 echo "configure:3098: checking for $ac_word" >&5
3098 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3099   echo $ac_n "(cached) $ac_c" 1>&6
3100 else
3101   if test -n "$OBJDUMP"; then
3102   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3103 else
3104   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3105   ac_dummy="$PATH"
3106   for ac_dir in $ac_dummy; do
3107     test -z "$ac_dir" && ac_dir=.
3108     if test -f $ac_dir/$ac_word; then
3109       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3110       break
3111     fi
3112   done
3113   IFS="$ac_save_ifs"
3114 fi
3115 fi
3116 OBJDUMP="$ac_cv_prog_OBJDUMP"
3117 if test -n "$OBJDUMP"; then
3118   echo "$ac_t""$OBJDUMP" 1>&6
3119 else
3120   echo "$ac_t""no" 1>&6
3121 fi
3122
3123
3124 if test -z "$ac_cv_prog_OBJDUMP"; then
3125 if test -n "$ac_tool_prefix"; then
3126   # Extract the first word of "objdump", so it can be a program name with args.
3127 set dummy objdump; ac_word=$2
3128 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3129 echo "configure:3130: checking for $ac_word" >&5
3130 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3131   echo $ac_n "(cached) $ac_c" 1>&6
3132 else
3133   if test -n "$OBJDUMP"; then
3134   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3135 else
3136   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3137   ac_dummy="$PATH"
3138   for ac_dir in $ac_dummy; do
3139     test -z "$ac_dir" && ac_dir=.
3140     if test -f $ac_dir/$ac_word; then
3141       ac_cv_prog_OBJDUMP="objdump"
3142       break
3143     fi
3144   done
3145   IFS="$ac_save_ifs"
3146   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3147 fi
3148 fi
3149 OBJDUMP="$ac_cv_prog_OBJDUMP"
3150 if test -n "$OBJDUMP"; then
3151   echo "$ac_t""$OBJDUMP" 1>&6
3152 else
3153   echo "$ac_t""no" 1>&6
3154 fi
3155
3156 else
3157   OBJDUMP="false"
3158 fi
3159 fi
3160
3161   ;;
3162
3163 esac
3164
3165
3166 # Save cache, so that ltconfig can load it
3167
3168
3169 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3170 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3171 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3172 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3173 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3174 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3175 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3176 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3177
3178 # Reload cache, that may have been modified by ltconfig
3179
3180
3181 # This can be used to rebuild libtool when needed
3182 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3183
3184 # Always use our own libtool.
3185 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3186
3187 # Redirect the config.log output again, so that the ltconfig log is not
3188 # clobbered by the next message.
3189 exec 5>>./config.log
3190
3191
3192 for ac_prog in mawk gawk nawk awk
3193 do
3194 # Extract the first word of "$ac_prog", so it can be a program name with args.
3195 set dummy $ac_prog; ac_word=$2
3196 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3197 echo "configure:3198: checking for $ac_word" >&5
3198 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3199   echo $ac_n "(cached) $ac_c" 1>&6
3200 else
3201   if test -n "$AWK"; then
3202   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3203 else
3204   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3205   ac_dummy="$PATH"
3206   for ac_dir in $ac_dummy; do
3207     test -z "$ac_dir" && ac_dir=.
3208     if test -f $ac_dir/$ac_word; then
3209       ac_cv_prog_AWK="$ac_prog"
3210       break
3211     fi
3212   done
3213   IFS="$ac_save_ifs"
3214 fi
3215 fi
3216 AWK="$ac_cv_prog_AWK"
3217 if test -n "$AWK"; then
3218   echo "$ac_t""$AWK" 1>&6
3219 else
3220   echo "$ac_t""no" 1>&6
3221 fi
3222
3223 test -n "$AWK" && break
3224 done
3225
3226 # test for ln hardlink support
3227 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3228 echo "configure:3229: checking whether ln works" >&5
3229 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3230   echo $ac_n "(cached) $ac_c" 1>&6
3231 else
3232   rm -f conftest.src conftest.dst
3233 echo "conftest" > conftest.src
3234 if ln conftest.src conftest.dst 2>/dev/null
3235 then
3236   ol_cv_prog_LN_H="ln"
3237 else
3238   ol_cv_prog_LN_H="cp"
3239 fi
3240 rm -f conftest.src conftest.dst
3241
3242 fi
3243 LN_H="$ol_cv_prog_LN_H"
3244 if test "$ol_cv_prog_LN_H" = "ln"; then
3245         echo "$ac_t""yes" 1>&6
3246 else
3247         echo "$ac_t""no" 1>&6
3248 fi
3249
3250 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3251 echo "configure:3252: checking whether ln -s works" >&5
3252 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3253   echo $ac_n "(cached) $ac_c" 1>&6
3254 else
3255   rm -f conftestdata
3256 if ln -s X conftestdata 2>/dev/null
3257 then
3258   rm -f conftestdata
3259   ac_cv_prog_LN_S="ln -s"
3260 else
3261   ac_cv_prog_LN_S=ln
3262 fi
3263 fi
3264 LN_S="$ac_cv_prog_LN_S"
3265 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3266   echo "$ac_t""yes" 1>&6
3267 else
3268   echo "$ac_t""no" 1>&6
3269 fi
3270
3271
3272 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3273         LN_S="$LN_H"
3274 fi
3275
3276 # Extract the first word of "sendmail", so it can be a program name with args.
3277 set dummy sendmail; ac_word=$2
3278 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3279 echo "configure:3280: checking for $ac_word" >&5
3280 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3281   echo $ac_n "(cached) $ac_c" 1>&6
3282 else
3283   case "$SENDMAIL" in
3284   /*)
3285   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3286   ;;
3287   ?:/*)
3288   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3289   ;;
3290   *)
3291   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3292   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3293   for ac_dir in $ac_dummy; do 
3294     test -z "$ac_dir" && ac_dir=.
3295     if test -f $ac_dir/$ac_word; then
3296       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3297       break
3298     fi
3299   done
3300   IFS="$ac_save_ifs"
3301   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3302   ;;
3303 esac
3304 fi
3305 SENDMAIL="$ac_cv_path_SENDMAIL"
3306 if test -n "$SENDMAIL"; then
3307   echo "$ac_t""$SENDMAIL" 1>&6
3308 else
3309   echo "$ac_t""no" 1>&6
3310 fi
3311
3312 # Extract the first word of "vi", so it can be a program name with args.
3313 set dummy vi; ac_word=$2
3314 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3315 echo "configure:3316: checking for $ac_word" >&5
3316 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3317   echo $ac_n "(cached) $ac_c" 1>&6
3318 else
3319   case "$EDITOR" in
3320   /*)
3321   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3322   ;;
3323   ?:/*)
3324   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3325   ;;
3326   *)
3327   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3328   ac_dummy="$PATH:/usr/ucb"
3329   for ac_dir in $ac_dummy; do 
3330     test -z "$ac_dir" && ac_dir=.
3331     if test -f $ac_dir/$ac_word; then
3332       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3333       break
3334     fi
3335   done
3336   IFS="$ac_save_ifs"
3337   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3338   ;;
3339 esac
3340 fi
3341 EDITOR="$ac_cv_path_EDITOR"
3342 if test -n "$EDITOR"; then
3343   echo "$ac_t""$EDITOR" 1>&6
3344 else
3345   echo "$ac_t""no" 1>&6
3346 fi
3347
3348 # Extract the first word of "finger", so it can be a program name with args.
3349 set dummy finger; ac_word=$2
3350 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3351 echo "configure:3352: checking for $ac_word" >&5
3352 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3353   echo $ac_n "(cached) $ac_c" 1>&6
3354 else
3355   case "$FINGER" in
3356   /*)
3357   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3358   ;;
3359   ?:/*)
3360   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3361   ;;
3362   *)
3363   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3364   ac_dummy="$PATH:/usr/ucb"
3365   for ac_dir in $ac_dummy; do 
3366     test -z "$ac_dir" && ac_dir=.
3367     if test -f $ac_dir/$ac_word; then
3368       ac_cv_path_FINGER="$ac_dir/$ac_word"
3369       break
3370     fi
3371   done
3372   IFS="$ac_save_ifs"
3373   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3374   ;;
3375 esac
3376 fi
3377 FINGER="$ac_cv_path_FINGER"
3378 if test -n "$FINGER"; then
3379   echo "$ac_t""$FINGER" 1>&6
3380 else
3381   echo "$ac_t""no" 1>&6
3382 fi
3383
3384
3385 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3386 echo "configure:3387: checking how to run the C preprocessor" >&5
3387 # On Suns, sometimes $CPP names a directory.
3388 if test -n "$CPP" && test -d "$CPP"; then
3389   CPP=
3390 fi
3391 if test -z "$CPP"; then
3392 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3393   echo $ac_n "(cached) $ac_c" 1>&6
3394 else
3395     # This must be in double quotes, not single quotes, because CPP may get
3396   # substituted into the Makefile and "${CC-cc}" will confuse make.
3397   CPP="${CC-cc} -E"
3398   # On the NeXT, cc -E runs the code through the compiler's parser,
3399   # not just through cpp.
3400   cat > conftest.$ac_ext <<EOF
3401 #line 3402 "configure"
3402 #include "confdefs.h"
3403 #include <assert.h>
3404 Syntax Error
3405 EOF
3406 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3407 { (eval echo configure:3408: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3408 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3409 if test -z "$ac_err"; then
3410   :
3411 else
3412   echo "$ac_err" >&5
3413   echo "configure: failed program was:" >&5
3414   cat conftest.$ac_ext >&5
3415   rm -rf conftest*
3416   CPP="${CC-cc} -E -traditional-cpp"
3417   cat > conftest.$ac_ext <<EOF
3418 #line 3419 "configure"
3419 #include "confdefs.h"
3420 #include <assert.h>
3421 Syntax Error
3422 EOF
3423 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3424 { (eval echo configure:3425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3425 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3426 if test -z "$ac_err"; then
3427   :
3428 else
3429   echo "$ac_err" >&5
3430   echo "configure: failed program was:" >&5
3431   cat conftest.$ac_ext >&5
3432   rm -rf conftest*
3433   CPP="${CC-cc} -nologo -E"
3434   cat > conftest.$ac_ext <<EOF
3435 #line 3436 "configure"
3436 #include "confdefs.h"
3437 #include <assert.h>
3438 Syntax Error
3439 EOF
3440 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3441 { (eval echo configure:3442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3442 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3443 if test -z "$ac_err"; then
3444   :
3445 else
3446   echo "$ac_err" >&5
3447   echo "configure: failed program was:" >&5
3448   cat conftest.$ac_ext >&5
3449   rm -rf conftest*
3450   CPP=/lib/cpp
3451 fi
3452 rm -f conftest*
3453 fi
3454 rm -f conftest*
3455 fi
3456 rm -f conftest*
3457   ac_cv_prog_CPP="$CPP"
3458 fi
3459   CPP="$ac_cv_prog_CPP"
3460 else
3461   ac_cv_prog_CPP="$CPP"
3462 fi
3463 echo "$ac_t""$CPP" 1>&6
3464
3465
3466 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3467         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3468
3469 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3470         echo "configure: warning: programs compiled here do run here..." 1>&2
3471         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3472
3473 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3474         echo "configure: warning: programs compiled here do not run here..." 1>&2
3475         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3476 fi
3477
3478 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3479 echo "configure:3480: checking for AIX" >&5
3480 cat > conftest.$ac_ext <<EOF
3481 #line 3482 "configure"
3482 #include "confdefs.h"
3483 #ifdef _AIX
3484   yes
3485 #endif
3486
3487 EOF
3488 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3489   egrep "yes" >/dev/null 2>&1; then
3490   rm -rf conftest*
3491   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3492 #define _ALL_SOURCE 1
3493 EOF
3494
3495 else
3496   rm -rf conftest*
3497   echo "$ac_t""no" 1>&6
3498 fi
3499 rm -f conftest*
3500
3501
3502 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3503 echo "configure:3504: checking for POSIXized ISC" >&5
3504 if test -d /etc/conf/kconfig.d &&
3505   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3506 then
3507   echo "$ac_t""yes" 1>&6
3508   ISC=yes # If later tests want to check for ISC.
3509   cat >> confdefs.h <<\EOF
3510 #define _POSIX_SOURCE 1
3511 EOF
3512
3513   if test "$GCC" = yes; then
3514     CC="$CC -posix"
3515   else
3516     CC="$CC -Xp"
3517   fi
3518 else
3519   echo "$ac_t""no" 1>&6
3520   ISC=
3521 fi
3522
3523 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3524 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3525 echo "configure:3526: checking for minix/config.h" >&5
3526 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3527   echo $ac_n "(cached) $ac_c" 1>&6
3528 else
3529   cat > conftest.$ac_ext <<EOF
3530 #line 3531 "configure"
3531 #include "confdefs.h"
3532 #include <minix/config.h>
3533 EOF
3534 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3535 { (eval echo configure:3536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3536 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3537 if test -z "$ac_err"; then
3538   rm -rf conftest*
3539   eval "ac_cv_header_$ac_safe=yes"
3540 else
3541   echo "$ac_err" >&5
3542   echo "configure: failed program was:" >&5
3543   cat conftest.$ac_ext >&5
3544   rm -rf conftest*
3545   eval "ac_cv_header_$ac_safe=no"
3546 fi
3547 rm -f conftest*
3548 fi
3549 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3550   echo "$ac_t""yes" 1>&6
3551   MINIX=yes
3552 else
3553   echo "$ac_t""no" 1>&6
3554 MINIX=
3555 fi
3556
3557 if test "$MINIX" = yes; then
3558   cat >> confdefs.h <<\EOF
3559 #define _POSIX_SOURCE 1
3560 EOF
3561
3562   cat >> confdefs.h <<\EOF
3563 #define _POSIX_1_SOURCE 2
3564 EOF
3565
3566   cat >> confdefs.h <<\EOF
3567 #define _MINIX 1
3568 EOF
3569
3570 fi
3571
3572
3573 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3574 echo "configure:3575: checking for Cygwin environment" >&5
3575 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3576   echo $ac_n "(cached) $ac_c" 1>&6
3577 else
3578   cat > conftest.$ac_ext <<EOF
3579 #line 3580 "configure"
3580 #include "confdefs.h"
3581
3582 int main() {
3583
3584 #ifndef __CYGWIN__
3585 #define __CYGWIN__ __CYGWIN32__
3586 #endif
3587 return __CYGWIN__;
3588 ; return 0; }
3589 EOF
3590 if { (eval echo configure:3591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3591   rm -rf conftest*
3592   ac_cv_cygwin=yes
3593 else
3594   echo "configure: failed program was:" >&5
3595   cat conftest.$ac_ext >&5
3596   rm -rf conftest*
3597   ac_cv_cygwin=no
3598 fi
3599 rm -f conftest*
3600 fi
3601
3602 echo "$ac_t""$ac_cv_cygwin" 1>&6
3603 CYGWIN=
3604 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3605 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3606 echo "configure:3607: checking for mingw32 environment" >&5
3607 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3608   echo $ac_n "(cached) $ac_c" 1>&6
3609 else
3610   cat > conftest.$ac_ext <<EOF
3611 #line 3612 "configure"
3612 #include "confdefs.h"
3613
3614 int main() {
3615 return __MINGW32__;
3616 ; return 0; }
3617 EOF
3618 if { (eval echo configure:3619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3619   rm -rf conftest*
3620   ac_cv_mingw32=yes
3621 else
3622   echo "configure: failed program was:" >&5
3623   cat conftest.$ac_ext >&5
3624   rm -rf conftest*
3625   ac_cv_mingw32=no
3626 fi
3627 rm -f conftest*
3628 fi
3629
3630 echo "$ac_t""$ac_cv_mingw32" 1>&6
3631 MINGW32=
3632 test "$ac_cv_mingw32" = yes && MINGW32=yes
3633 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3634 echo "configure:3635: checking for EMX OS/2 environment" >&5
3635 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3636   echo $ac_n "(cached) $ac_c" 1>&6
3637 else
3638   cat > conftest.$ac_ext <<EOF
3639 #line 3640 "configure"
3640 #include "confdefs.h"
3641
3642 int main() {
3643 return __EMX__;
3644 ; return 0; }
3645 EOF
3646 if { (eval echo configure:3647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3647   rm -rf conftest*
3648   ac_cv_emxos2=yes
3649 else
3650   echo "configure: failed program was:" >&5
3651   cat conftest.$ac_ext >&5
3652   rm -rf conftest*
3653   ac_cv_emxos2=no
3654 fi
3655 rm -f conftest*
3656 fi
3657
3658 echo "$ac_t""$ac_cv_emxos2" 1>&6
3659 EMXOS2=
3660 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3661
3662
3663
3664 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3665 echo "configure:3666: checking for executable suffix" >&5
3666 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3667   echo $ac_n "(cached) $ac_c" 1>&6
3668 else
3669   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3670   ac_cv_exeext=.exe
3671 else
3672   rm -f conftest*
3673   echo 'int main () { return 0; }' > conftest.$ac_ext
3674   ac_cv_exeext=
3675   if { (eval echo configure:3676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3676     for file in conftest.*; do
3677       case $file in
3678       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3679       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3680       esac
3681     done
3682   else
3683     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3684   fi
3685   rm -f conftest*
3686   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3687 fi
3688 fi
3689
3690 EXEEXT=""
3691 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3692 echo "$ac_t""${ac_cv_exeext}" 1>&6
3693 ac_exeext=$EXEEXT
3694
3695 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3696 echo "configure:3697: checking for object suffix" >&5
3697 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3698   echo $ac_n "(cached) $ac_c" 1>&6
3699 else
3700   rm -f conftest*
3701 echo 'int i = 1;' > conftest.$ac_ext
3702 if { (eval echo configure:3703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3703   for ac_file in conftest.*; do
3704     case $ac_file in
3705     *.c) ;;
3706     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3707     esac
3708   done
3709 else
3710   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3711 fi
3712 rm -f conftest*
3713 fi
3714
3715 echo "$ac_t""$ac_cv_objext" 1>&6
3716 OBJEXT=$ac_cv_objext
3717 ac_objext=$ac_cv_objext
3718
3719
3720 cat >> confdefs.h <<EOF
3721 #define EXEEXT "${EXEEXT}"
3722 EOF
3723
3724
3725 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3726 echo "configure:3727: checking for be_app in -lbe" >&5
3727 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3728 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3729   echo $ac_n "(cached) $ac_c" 1>&6
3730 else
3731   ac_save_LIBS="$LIBS"
3732 LIBS="-lbe -lroot -lnet $LIBS"
3733 cat > conftest.$ac_ext <<EOF
3734 #line 3735 "configure"
3735 #include "confdefs.h"
3736 /* Override any gcc2 internal prototype to avoid an error.  */
3737 /* We use char because int might match the return type of a gcc2
3738     builtin and then its argument prototype would still apply.  */
3739 char be_app();
3740
3741 int main() {
3742 be_app()
3743 ; return 0; }
3744 EOF
3745 if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3746   rm -rf conftest*
3747   eval "ac_cv_lib_$ac_lib_var=yes"
3748 else
3749   echo "configure: failed program was:" >&5
3750   cat conftest.$ac_ext >&5
3751   rm -rf conftest*
3752   eval "ac_cv_lib_$ac_lib_var=no"
3753 fi
3754 rm -f conftest*
3755 LIBS="$ac_save_LIBS"
3756
3757 fi
3758 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3759   echo "$ac_t""yes" 1>&6
3760   LIBS="$LIBS -lbe -lroot -lnet"
3761 else
3762   echo "$ac_t""no" 1>&6
3763 :
3764 fi
3765
3766
3767
3768
3769
3770 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3771 echo "configure:3772: checking for ${CC-cc} option to accept ANSI C" >&5
3772 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3773   echo $ac_n "(cached) $ac_c" 1>&6
3774 else
3775   am_cv_prog_cc_stdc=no
3776 ac_save_CC="$CC"
3777 # Don't try gcc -ansi; that turns off useful extensions and
3778 # breaks some systems' header files.
3779 # AIX                   -qlanglvl=ansi
3780 # Ultrix and OSF/1      -std1
3781 # HP-UX 10.20 and later -Ae
3782 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3783 # SVR4                  -Xc -D__EXTENSIONS__
3784 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3785 do
3786   CC="$ac_save_CC $ac_arg"
3787   cat > conftest.$ac_ext <<EOF
3788 #line 3789 "configure"
3789 #include "confdefs.h"
3790 #include <stdarg.h>
3791 #include <stdio.h>
3792 #include <sys/types.h>
3793 #include <sys/stat.h>
3794 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3795 struct buf { int x; };
3796 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3797 static char *e (p, i)
3798      char **p;
3799      int i;
3800 {
3801   return p[i];
3802 }
3803 static char *f (char * (*g) (char **, int), char **p, ...)
3804 {
3805   char *s;
3806   va_list v;
3807   va_start (v,p);
3808   s = g (p, va_arg (v,int));
3809   va_end (v);
3810   return s;
3811 }
3812 int test (int i, double x);
3813 struct s1 {int (*f) (int a);};
3814 struct s2 {int (*f) (double a);};
3815 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3816 int argc;
3817 char **argv;
3818
3819 int main() {
3820
3821 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3822
3823 ; return 0; }
3824 EOF
3825 if { (eval echo configure:3826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3826   rm -rf conftest*
3827   am_cv_prog_cc_stdc="$ac_arg"; break
3828 else
3829   echo "configure: failed program was:" >&5
3830   cat conftest.$ac_ext >&5
3831 fi
3832 rm -f conftest*
3833 done
3834 CC="$ac_save_CC"
3835
3836 fi
3837
3838 if test -z "$am_cv_prog_cc_stdc"; then
3839   echo "$ac_t""none needed" 1>&6
3840 else
3841   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3842 fi
3843 case "x$am_cv_prog_cc_stdc" in
3844   x|xno) ;;
3845   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3846 esac
3847
3848 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3849         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3850 fi
3851
3852 # test for make depend flag
3853 OL_MKDEP=
3854 OL_MKDEP_FLAGS=
3855 if test -z "${MKDEP}"; then
3856         OL_MKDEP="${CC-cc}"
3857         if test -z "${MKDEP_FLAGS}"; then
3858                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3859 echo "configure:3860: checking for ${OL_MKDEP} depend flag" >&5
3860 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3861   echo $ac_n "(cached) $ac_c" 1>&6
3862 else
3863   
3864                         ol_cv_mkdep=no
3865                         for flag in "-M" "-xM"; do
3866                                 cat > conftest.c <<EOF
3867  noCode;
3868 EOF
3869                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3870                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3871                                 then
3872                                         if test ! -f conftest."${ac_object}" ; then
3873                                                 ol_cv_mkdep=$flag
3874                                                 OL_MKDEP_FLAGS="$flag"
3875                                                 break
3876                                         fi
3877                                 fi
3878                         done
3879                         rm -f conftest*
3880                 
3881 fi
3882
3883 echo "$ac_t""$ol_cv_mkdep" 1>&6
3884         else
3885                 cc_cv_mkdep=yes
3886                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3887         fi
3888 else
3889         cc_cv_mkdep=yes
3890         OL_MKDEP="${MKDEP}"
3891         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3892 fi
3893
3894
3895
3896 if test "${ol_cv_mkdep}" = no ; then
3897         # this will soon become an error
3898         echo "configure: warning: do not know how to generate dependencies" 1>&2
3899 fi
3900
3901 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3902 echo "configure:3903: checking for afopen in -ls" >&5
3903 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3904 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3905   echo $ac_n "(cached) $ac_c" 1>&6
3906 else
3907   ac_save_LIBS="$LIBS"
3908 LIBS="-ls  $LIBS"
3909 cat > conftest.$ac_ext <<EOF
3910 #line 3911 "configure"
3911 #include "confdefs.h"
3912 /* Override any gcc2 internal prototype to avoid an error.  */
3913 /* We use char because int might match the return type of a gcc2
3914     builtin and then its argument prototype would still apply.  */
3915 char afopen();
3916
3917 int main() {
3918 afopen()
3919 ; return 0; }
3920 EOF
3921 if { (eval echo configure:3922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3922   rm -rf conftest*
3923   eval "ac_cv_lib_$ac_lib_var=yes"
3924 else
3925   echo "configure: failed program was:" >&5
3926   cat conftest.$ac_ext >&5
3927   rm -rf conftest*
3928   eval "ac_cv_lib_$ac_lib_var=no"
3929 fi
3930 rm -f conftest*
3931 LIBS="$ac_save_LIBS"
3932
3933 fi
3934 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3935   echo "$ac_t""yes" 1>&6
3936   
3937         AUTH_LIBS=-ls
3938         cat >> confdefs.h <<\EOF
3939 #define HAVE_AIX_SECURITY 1
3940 EOF
3941
3942
3943 else
3944   echo "$ac_t""no" 1>&6
3945 fi
3946
3947
3948
3949 ol_link_modules=no
3950 if test $ol_enable_modules != no ; then
3951         for ac_hdr in ltdl.h
3952 do
3953 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3954 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3955 echo "configure:3956: checking for $ac_hdr" >&5
3956 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3957   echo $ac_n "(cached) $ac_c" 1>&6
3958 else
3959   cat > conftest.$ac_ext <<EOF
3960 #line 3961 "configure"
3961 #include "confdefs.h"
3962 #include <$ac_hdr>
3963 EOF
3964 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3965 { (eval echo configure:3966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3966 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3967 if test -z "$ac_err"; then
3968   rm -rf conftest*
3969   eval "ac_cv_header_$ac_safe=yes"
3970 else
3971   echo "$ac_err" >&5
3972   echo "configure: failed program was:" >&5
3973   cat conftest.$ac_ext >&5
3974   rm -rf conftest*
3975   eval "ac_cv_header_$ac_safe=no"
3976 fi
3977 rm -f conftest*
3978 fi
3979 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3980   echo "$ac_t""yes" 1>&6
3981     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3982   cat >> confdefs.h <<EOF
3983 #define $ac_tr_hdr 1
3984 EOF
3985  
3986 else
3987   echo "$ac_t""no" 1>&6
3988 fi
3989 done
3990
3991
3992         if test $ac_cv_header_ltdl_h = no ; then
3993                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3994         fi
3995
3996         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3997 echo "configure:3998: checking for lt_dlinit in -lltdl" >&5
3998 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3999 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4000   echo $ac_n "(cached) $ac_c" 1>&6
4001 else
4002   ac_save_LIBS="$LIBS"
4003 LIBS="-lltdl  $LIBS"
4004 cat > conftest.$ac_ext <<EOF
4005 #line 4006 "configure"
4006 #include "confdefs.h"
4007 /* Override any gcc2 internal prototype to avoid an error.  */
4008 /* We use char because int might match the return type of a gcc2
4009     builtin and then its argument prototype would still apply.  */
4010 char lt_dlinit();
4011
4012 int main() {
4013 lt_dlinit()
4014 ; return 0; }
4015 EOF
4016 if { (eval echo configure:4017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4017   rm -rf conftest*
4018   eval "ac_cv_lib_$ac_lib_var=yes"
4019 else
4020   echo "configure: failed program was:" >&5
4021   cat conftest.$ac_ext >&5
4022   rm -rf conftest*
4023   eval "ac_cv_lib_$ac_lib_var=no"
4024 fi
4025 rm -f conftest*
4026 LIBS="$ac_save_LIBS"
4027
4028 fi
4029 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4030   echo "$ac_t""yes" 1>&6
4031   
4032             MODULES_LIBS=-lltdl
4033             cat >> confdefs.h <<\EOF
4034 #define HAVE_LIBLTDL 1
4035 EOF
4036
4037         
4038 else
4039   echo "$ac_t""no" 1>&6
4040 fi
4041
4042
4043         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4044                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4045         fi
4046         ol_link_modules=yes
4047 else
4048         ol_with_dnssrv_module=static
4049         ol_with_ldap_module=static
4050         ol_with_ldbm_module=static
4051         ol_with_passwd_module=static
4052         ol_with_shell_module=static
4053         ol_with_sql_module=static
4054 fi
4055
4056 # test for EBCDIC
4057 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4058 echo "configure:4059: checking for EBCDIC" >&5
4059 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4060   echo $ac_n "(cached) $ac_c" 1>&6
4061 else
4062   
4063         cat > conftest.$ac_ext <<EOF
4064 #line 4065 "configure"
4065 #include "confdefs.h"
4066
4067 #if !('M' == 0xd4)
4068 #include <__ASCII__/generate_error.h>
4069 #endif
4070
4071 EOF
4072 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4073 { (eval echo configure:4074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4074 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4075 if test -z "$ac_err"; then
4076   rm -rf conftest*
4077   ol_cv_cpp_ebcdic=yes
4078 else
4079   echo "$ac_err" >&5
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   ol_cv_cpp_ebcdic=no
4084 fi
4085 rm -f conftest*
4086 fi
4087
4088 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4089 if test $ol_cv_cpp_ebcdic = yes ; then
4090         cat >> confdefs.h <<\EOF
4091 #define HAVE_EBCDIC 1
4092 EOF
4093
4094 fi
4095
4096 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4097 echo "configure:4098: checking for ANSI C header files" >&5
4098 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4099   echo $ac_n "(cached) $ac_c" 1>&6
4100 else
4101   cat > conftest.$ac_ext <<EOF
4102 #line 4103 "configure"
4103 #include "confdefs.h"
4104 #include <stdlib.h>
4105 #include <stdarg.h>
4106 #include <string.h>
4107 #include <float.h>
4108 EOF
4109 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4110 { (eval echo configure:4111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4111 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4112 if test -z "$ac_err"; then
4113   rm -rf conftest*
4114   ol_cv_header_stdc=yes
4115 else
4116   echo "$ac_err" >&5
4117   echo "configure: failed program was:" >&5
4118   cat conftest.$ac_ext >&5
4119   rm -rf conftest*
4120   ol_cv_header_stdc=no
4121 fi
4122 rm -f conftest*
4123
4124 if test $ol_cv_header_stdc = yes; then
4125   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4126 cat > conftest.$ac_ext <<EOF
4127 #line 4128 "configure"
4128 #include "confdefs.h"
4129 #include <string.h>
4130 EOF
4131 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4132   egrep "memchr" >/dev/null 2>&1; then
4133   :
4134 else
4135   rm -rf conftest*
4136   ol_cv_header_stdc=no
4137 fi
4138 rm -f conftest*
4139
4140 fi
4141
4142 if test $ol_cv_header_stdc = yes; then
4143   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4144 cat > conftest.$ac_ext <<EOF
4145 #line 4146 "configure"
4146 #include "confdefs.h"
4147 #include <stdlib.h>
4148 EOF
4149 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4150   egrep "free" >/dev/null 2>&1; then
4151   :
4152 else
4153   rm -rf conftest*
4154   ol_cv_header_stdc=no
4155 fi
4156 rm -f conftest*
4157
4158 fi
4159
4160 if test $ol_cv_header_stdc = yes; then
4161   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4162 if test "$cross_compiling" = yes; then
4163   :
4164 else
4165   cat > conftest.$ac_ext <<EOF
4166 #line 4167 "configure"
4167 #include "confdefs.h"
4168 #include <ctype.h>
4169 #ifndef HAVE_EBCDIC
4170 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4171 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4172 #else
4173 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4174                 || ('j' <= (c) && (c) <= 'r') \
4175                 || ('s' <= (c) && (c) <= 'z'))
4176 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4177 #endif
4178 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4179 int main () { int i; for (i = 0; i < 256; i++)
4180 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4181 exit (0); }
4182
4183 EOF
4184 if { (eval echo configure:4185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4185 then
4186   :
4187 else
4188   echo "configure: failed program was:" >&5
4189   cat conftest.$ac_ext >&5
4190   rm -fr conftest*
4191   ol_cv_header_stdc=no
4192 fi
4193 rm -fr conftest*
4194 fi
4195
4196 fi
4197 fi
4198
4199 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4200 if test $ol_cv_header_stdc = yes; then
4201   cat >> confdefs.h <<\EOF
4202 #define STDC_HEADERS 1
4203 EOF
4204
4205 fi
4206 ac_cv_header_stdc=disable
4207
4208
4209 if test $ol_cv_header_stdc != yes; then
4210         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4211 fi
4212
4213 ac_header_dirent=no
4214 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4215 do
4216 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4217 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4218 echo "configure:4219: checking for $ac_hdr that defines DIR" >&5
4219 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   cat > conftest.$ac_ext <<EOF
4223 #line 4224 "configure"
4224 #include "confdefs.h"
4225 #include <sys/types.h>
4226 #include <$ac_hdr>
4227 int main() {
4228 DIR *dirp = 0;
4229 ; return 0; }
4230 EOF
4231 if { (eval echo configure:4232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4232   rm -rf conftest*
4233   eval "ac_cv_header_dirent_$ac_safe=yes"
4234 else
4235   echo "configure: failed program was:" >&5
4236   cat conftest.$ac_ext >&5
4237   rm -rf conftest*
4238   eval "ac_cv_header_dirent_$ac_safe=no"
4239 fi
4240 rm -f conftest*
4241 fi
4242 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4243   echo "$ac_t""yes" 1>&6
4244     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4245   cat >> confdefs.h <<EOF
4246 #define $ac_tr_hdr 1
4247 EOF
4248  ac_header_dirent=$ac_hdr; break
4249 else
4250   echo "$ac_t""no" 1>&6
4251 fi
4252 done
4253 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4254 if test $ac_header_dirent = dirent.h; then
4255 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4256 echo "configure:4257: checking for opendir in -ldir" >&5
4257 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4259   echo $ac_n "(cached) $ac_c" 1>&6
4260 else
4261   ac_save_LIBS="$LIBS"
4262 LIBS="-ldir  $LIBS"
4263 cat > conftest.$ac_ext <<EOF
4264 #line 4265 "configure"
4265 #include "confdefs.h"
4266 /* Override any gcc2 internal prototype to avoid an error.  */
4267 /* We use char because int might match the return type of a gcc2
4268     builtin and then its argument prototype would still apply.  */
4269 char opendir();
4270
4271 int main() {
4272 opendir()
4273 ; return 0; }
4274 EOF
4275 if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4276   rm -rf conftest*
4277   eval "ac_cv_lib_$ac_lib_var=yes"
4278 else
4279   echo "configure: failed program was:" >&5
4280   cat conftest.$ac_ext >&5
4281   rm -rf conftest*
4282   eval "ac_cv_lib_$ac_lib_var=no"
4283 fi
4284 rm -f conftest*
4285 LIBS="$ac_save_LIBS"
4286
4287 fi
4288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4289   echo "$ac_t""yes" 1>&6
4290   LIBS="$LIBS -ldir"
4291 else
4292   echo "$ac_t""no" 1>&6
4293 fi
4294
4295 else
4296 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4297 echo "configure:4298: checking for opendir in -lx" >&5
4298 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4299 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4300   echo $ac_n "(cached) $ac_c" 1>&6
4301 else
4302   ac_save_LIBS="$LIBS"
4303 LIBS="-lx  $LIBS"
4304 cat > conftest.$ac_ext <<EOF
4305 #line 4306 "configure"
4306 #include "confdefs.h"
4307 /* Override any gcc2 internal prototype to avoid an error.  */
4308 /* We use char because int might match the return type of a gcc2
4309     builtin and then its argument prototype would still apply.  */
4310 char opendir();
4311
4312 int main() {
4313 opendir()
4314 ; return 0; }
4315 EOF
4316 if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4317   rm -rf conftest*
4318   eval "ac_cv_lib_$ac_lib_var=yes"
4319 else
4320   echo "configure: failed program was:" >&5
4321   cat conftest.$ac_ext >&5
4322   rm -rf conftest*
4323   eval "ac_cv_lib_$ac_lib_var=no"
4324 fi
4325 rm -f conftest*
4326 LIBS="$ac_save_LIBS"
4327
4328 fi
4329 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4330   echo "$ac_t""yes" 1>&6
4331   LIBS="$LIBS -lx"
4332 else
4333   echo "$ac_t""no" 1>&6
4334 fi
4335
4336 fi
4337
4338 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4339 echo "configure:4340: checking for sys/wait.h that is POSIX.1 compatible" >&5
4340 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4341   echo $ac_n "(cached) $ac_c" 1>&6
4342 else
4343   cat > conftest.$ac_ext <<EOF
4344 #line 4345 "configure"
4345 #include "confdefs.h"
4346 #include <sys/types.h>
4347 #include <sys/wait.h>
4348 #ifndef WEXITSTATUS
4349 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4350 #endif
4351 #ifndef WIFEXITED
4352 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4353 #endif
4354 int main() {
4355 int s;
4356 wait (&s);
4357 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4358 ; return 0; }
4359 EOF
4360 if { (eval echo configure:4361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4361   rm -rf conftest*
4362   ac_cv_header_sys_wait_h=yes
4363 else
4364   echo "configure: failed program was:" >&5
4365   cat conftest.$ac_ext >&5
4366   rm -rf conftest*
4367   ac_cv_header_sys_wait_h=no
4368 fi
4369 rm -f conftest*
4370 fi
4371
4372 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4373 if test $ac_cv_header_sys_wait_h = yes; then
4374   cat >> confdefs.h <<\EOF
4375 #define HAVE_SYS_WAIT_H 1
4376 EOF
4377
4378 fi
4379
4380 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4381 echo "configure:4382: checking POSIX termios" >&5
4382 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4383   echo $ac_n "(cached) $ac_c" 1>&6
4384 else
4385   cat > conftest.$ac_ext <<EOF
4386 #line 4387 "configure"
4387 #include "confdefs.h"
4388 #include <sys/types.h>
4389 #include <unistd.h>
4390 #include <termios.h>
4391 int main() {
4392 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4393    tcgetattr(0, 0);
4394 ; return 0; }
4395 EOF
4396 if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4397   rm -rf conftest*
4398   am_cv_sys_posix_termios=yes
4399 else
4400   echo "configure: failed program was:" >&5
4401   cat conftest.$ac_ext >&5
4402   rm -rf conftest*
4403   am_cv_sys_posix_termios=no
4404 fi
4405 rm -f conftest*
4406 fi
4407
4408 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4409
4410
4411  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4412 echo "configure:4413: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4413 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4414   echo $ac_n "(cached) $ac_c" 1>&6
4415 else
4416   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4417
4418   gwinsz_in_termios_h=no
4419   if test $am_cv_sys_posix_termios = yes; then
4420     cat > conftest.$ac_ext <<EOF
4421 #line 4422 "configure"
4422 #include "confdefs.h"
4423 #include <sys/types.h>
4424 #     include <termios.h>
4425 #     ifdef TIOCGWINSZ
4426         yes
4427 #     endif
4428     
4429 EOF
4430 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4431   egrep "yes" >/dev/null 2>&1; then
4432   rm -rf conftest*
4433   gwinsz_in_termios_h=yes
4434 fi
4435 rm -f conftest*
4436
4437   fi
4438
4439   if test $gwinsz_in_termios_h = no; then
4440     cat > conftest.$ac_ext <<EOF
4441 #line 4442 "configure"
4442 #include "confdefs.h"
4443 #include <sys/types.h>
4444 #     include <sys/ioctl.h>
4445 #     ifdef TIOCGWINSZ
4446         yes
4447 #     endif
4448     
4449 EOF
4450 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4451   egrep "yes" >/dev/null 2>&1; then
4452   rm -rf conftest*
4453   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4454 fi
4455 rm -f conftest*
4456
4457   fi
4458   
4459 fi
4460
4461 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4462   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4463     cat >> confdefs.h <<\EOF
4464 #define GWINSZ_IN_SYS_IOCTL 1
4465 EOF
4466
4467   fi
4468
4469 if test $am_cv_sys_posix_termios = yes ; then
4470         cat >> confdefs.h <<\EOF
4471 #define HAVE_POSIX_TERMIOS 1
4472 EOF
4473
4474 fi
4475
4476 for ac_hdr in \
4477         arpa/inet.h             \
4478         arpa/nameser.h  \
4479         assert.h                \
4480         conio.h                 \
4481         crypt.h                 \
4482         direct.h                \
4483         errno.h                 \
4484         fcntl.h                 \
4485         filio.h                 \
4486         getopt.h                \
4487         grp.h                   \
4488         io.h                    \
4489         libutil.h               \
4490         limits.h                \
4491         locale.h                \
4492         netinet/tcp.h   \
4493         malloc.h                \
4494         memory.h                \
4495         psap.h                  \
4496         pwd.h                   \
4497         process.h               \
4498         resolv.h                \
4499         sgtty.h                 \
4500         shadow.h                \
4501         stddef.h                \
4502         string.h                \
4503         strings.h               \
4504         sysexits.h              \
4505         sys/file.h              \
4506         sys/filio.h             \
4507         sys/errno.h             \
4508         sys/ioctl.h             \
4509         sys/param.h             \
4510         sys/resource.h  \
4511         sys/select.h    \
4512         sys/socket.h    \
4513         sys/syslog.h    \
4514         sys/time.h              \
4515         sys/types.h             \
4516         syslog.h                \
4517         termios.h               \
4518         unistd.h                \
4519         winsock.h               \
4520
4521 do
4522 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4523 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4524 echo "configure:4525: checking for $ac_hdr" >&5
4525 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4526   echo $ac_n "(cached) $ac_c" 1>&6
4527 else
4528   cat > conftest.$ac_ext <<EOF
4529 #line 4530 "configure"
4530 #include "confdefs.h"
4531 #include <$ac_hdr>
4532 EOF
4533 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4534 { (eval echo configure:4535: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4535 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4536 if test -z "$ac_err"; then
4537   rm -rf conftest*
4538   eval "ac_cv_header_$ac_safe=yes"
4539 else
4540   echo "$ac_err" >&5
4541   echo "configure: failed program was:" >&5
4542   cat conftest.$ac_ext >&5
4543   rm -rf conftest*
4544   eval "ac_cv_header_$ac_safe=no"
4545 fi
4546 rm -f conftest*
4547 fi
4548 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4549   echo "$ac_t""yes" 1>&6
4550     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4551   cat >> confdefs.h <<EOF
4552 #define $ac_tr_hdr 1
4553 EOF
4554  
4555 else
4556   echo "$ac_t""no" 1>&6
4557 fi
4558 done
4559
4560
4561
4562
4563 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4564 echo "configure:4565: checking for dlopen" >&5
4565 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4566   echo $ac_n "(cached) $ac_c" 1>&6
4567 else
4568   cat > conftest.$ac_ext <<EOF
4569 #line 4570 "configure"
4570 #include "confdefs.h"
4571 /* System header to define __stub macros and hopefully few prototypes,
4572     which can conflict with char dlopen(); below.  */
4573 #include <assert.h>
4574 /* Override any gcc2 internal prototype to avoid an error.  */
4575 /* We use char because int might match the return type of a gcc2
4576     builtin and then its argument prototype would still apply.  */
4577 char dlopen();
4578 char (*f)();
4579
4580 int main() {
4581
4582 /* The GNU C library defines this for functions which it implements
4583     to always fail with ENOSYS.  Some functions are actually named
4584     something starting with __ and the normal name is an alias.  */
4585 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4586 choke me
4587 #else
4588 f = dlopen;
4589 #endif
4590
4591 ; return 0; }
4592 EOF
4593 if { (eval echo configure:4594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4594   rm -rf conftest*
4595   eval "ac_cv_func_dlopen=yes"
4596 else
4597   echo "configure: failed program was:" >&5
4598   cat conftest.$ac_ext >&5
4599   rm -rf conftest*
4600   eval "ac_cv_func_dlopen=no"
4601 fi
4602 rm -f conftest*
4603 fi
4604
4605 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4606   echo "$ac_t""yes" 1>&6
4607   :
4608 else
4609   echo "$ac_t""no" 1>&6
4610 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4611 echo "configure:4612: checking for dlopen in -ldl" >&5
4612 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4613 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4614   echo $ac_n "(cached) $ac_c" 1>&6
4615 else
4616   ac_save_LIBS="$LIBS"
4617 LIBS="-ldl  $LIBS"
4618 cat > conftest.$ac_ext <<EOF
4619 #line 4620 "configure"
4620 #include "confdefs.h"
4621 /* Override any gcc2 internal prototype to avoid an error.  */
4622 /* We use char because int might match the return type of a gcc2
4623     builtin and then its argument prototype would still apply.  */
4624 char dlopen();
4625
4626 int main() {
4627 dlopen()
4628 ; return 0; }
4629 EOF
4630 if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4631   rm -rf conftest*
4632   eval "ac_cv_lib_$ac_lib_var=yes"
4633 else
4634   echo "configure: failed program was:" >&5
4635   cat conftest.$ac_ext >&5
4636   rm -rf conftest*
4637   eval "ac_cv_lib_$ac_lib_var=no"
4638 fi
4639 rm -f conftest*
4640 LIBS="$ac_save_LIBS"
4641
4642 fi
4643 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4644   echo "$ac_t""yes" 1>&6
4645     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4646     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4647   cat >> confdefs.h <<EOF
4648 #define $ac_tr_lib 1
4649 EOF
4650
4651   LIBS="-ldl $LIBS"
4652
4653 else
4654   echo "$ac_t""no" 1>&6
4655 fi
4656
4657 fi
4658
4659
4660 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4661 echo "configure:4662: checking for sigset in -lV3" >&5
4662 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4663 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4664   echo $ac_n "(cached) $ac_c" 1>&6
4665 else
4666   ac_save_LIBS="$LIBS"
4667 LIBS="-lV3  $LIBS"
4668 cat > conftest.$ac_ext <<EOF
4669 #line 4670 "configure"
4670 #include "confdefs.h"
4671 /* Override any gcc2 internal prototype to avoid an error.  */
4672 /* We use char because int might match the return type of a gcc2
4673     builtin and then its argument prototype would still apply.  */
4674 char sigset();
4675
4676 int main() {
4677 sigset()
4678 ; return 0; }
4679 EOF
4680 if { (eval echo configure:4681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4681   rm -rf conftest*
4682   eval "ac_cv_lib_$ac_lib_var=yes"
4683 else
4684   echo "configure: failed program was:" >&5
4685   cat conftest.$ac_ext >&5
4686   rm -rf conftest*
4687   eval "ac_cv_lib_$ac_lib_var=no"
4688 fi
4689 rm -f conftest*
4690 LIBS="$ac_save_LIBS"
4691
4692 fi
4693 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4694   echo "$ac_t""yes" 1>&6
4695     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4696     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4697   cat >> confdefs.h <<EOF
4698 #define $ac_tr_lib 1
4699 EOF
4700
4701   LIBS="-lV3 $LIBS"
4702
4703 else
4704   echo "$ac_t""no" 1>&6
4705 fi
4706
4707
4708 if test $ac_cv_header_winsock_h = yes; then
4709         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4710 echo "configure:4711: checking for winsock" >&5
4711 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4712   echo $ac_n "(cached) $ac_c" 1>&6
4713 else
4714   cat > conftest.$ac_ext <<EOF
4715 #line 4716 "configure"
4716 #include "confdefs.h"
4717 #include <winsock.h>
4718 int main() {
4719
4720                         socket(0,0,0);
4721                         select(0,NULL,NULL,NULL,NULL);
4722                         closesocket(0);
4723                         gethostname(NULL,0);
4724         
4725 ; return 0; }
4726 EOF
4727 if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4728   rm -rf conftest*
4729   ol_cv_winsock=yes
4730 else
4731   echo "configure: failed program was:" >&5
4732   cat conftest.$ac_ext >&5
4733   rm -rf conftest*
4734   ol_cv_winsock=no
4735 fi
4736 rm -f conftest*
4737 fi
4738
4739 echo "$ac_t""$ol_cv_winsock" 1>&6
4740
4741         if test $ol_cv_winsock = yes ; then
4742                 cat >> confdefs.h <<\EOF
4743 #define HAVE_WINSOCK 1
4744 EOF
4745
4746                 ac_cv_func_socket=yes
4747                 ac_cv_func_select=yes
4748                 ac_cv_func_closesocket=yes
4749                 ac_cv_func_gethostname=yes
4750         fi
4751 fi
4752
4753
4754 echo $ac_n "checking for socket""... $ac_c" 1>&6
4755 echo "configure:4756: checking for socket" >&5
4756 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4757   echo $ac_n "(cached) $ac_c" 1>&6
4758 else
4759   cat > conftest.$ac_ext <<EOF
4760 #line 4761 "configure"
4761 #include "confdefs.h"
4762 /* System header to define __stub macros and hopefully few prototypes,
4763     which can conflict with char socket(); below.  */
4764 #include <assert.h>
4765 /* Override any gcc2 internal prototype to avoid an error.  */
4766 /* We use char because int might match the return type of a gcc2
4767     builtin and then its argument prototype would still apply.  */
4768 char socket();
4769 char (*f)();
4770
4771 int main() {
4772
4773 /* The GNU C library defines this for functions which it implements
4774     to always fail with ENOSYS.  Some functions are actually named
4775     something starting with __ and the normal name is an alias.  */
4776 #if defined (__stub_socket) || defined (__stub___socket)
4777 choke me
4778 #else
4779 f = socket;
4780 #endif
4781
4782 ; return 0; }
4783 EOF
4784 if { (eval echo configure:4785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4785   rm -rf conftest*
4786   eval "ac_cv_func_socket=yes"
4787 else
4788   echo "configure: failed program was:" >&5
4789   cat conftest.$ac_ext >&5
4790   rm -rf conftest*
4791   eval "ac_cv_func_socket=no"
4792 fi
4793 rm -f conftest*
4794 fi
4795
4796 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4797   echo "$ac_t""yes" 1>&6
4798   :
4799 else
4800   echo "$ac_t""no" 1>&6
4801         
4802         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4803 echo "configure:4804: checking for main in -lsocket" >&5
4804 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4805 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4806   echo $ac_n "(cached) $ac_c" 1>&6
4807 else
4808   ac_save_LIBS="$LIBS"
4809 LIBS="-lsocket  $LIBS"
4810 cat > conftest.$ac_ext <<EOF
4811 #line 4812 "configure"
4812 #include "confdefs.h"
4813
4814 int main() {
4815 main()
4816 ; return 0; }
4817 EOF
4818 if { (eval echo configure:4819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4819   rm -rf conftest*
4820   eval "ac_cv_lib_$ac_lib_var=yes"
4821 else
4822   echo "configure: failed program was:" >&5
4823   cat conftest.$ac_ext >&5
4824   rm -rf conftest*
4825   eval "ac_cv_lib_$ac_lib_var=no"
4826 fi
4827 rm -f conftest*
4828 LIBS="$ac_save_LIBS"
4829
4830 fi
4831 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4832   echo "$ac_t""yes" 1>&6
4833     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4834     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4835   cat >> confdefs.h <<EOF
4836 #define $ac_tr_lib 1
4837 EOF
4838
4839   LIBS="-lsocket $LIBS"
4840
4841 else
4842   echo "$ac_t""no" 1>&6
4843 fi
4844
4845         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4846 echo "configure:4847: checking for main in -lnet" >&5
4847 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4848 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4849   echo $ac_n "(cached) $ac_c" 1>&6
4850 else
4851   ac_save_LIBS="$LIBS"
4852 LIBS="-lnet  $LIBS"
4853 cat > conftest.$ac_ext <<EOF
4854 #line 4855 "configure"
4855 #include "confdefs.h"
4856
4857 int main() {
4858 main()
4859 ; return 0; }
4860 EOF
4861 if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4862   rm -rf conftest*
4863   eval "ac_cv_lib_$ac_lib_var=yes"
4864 else
4865   echo "configure: failed program was:" >&5
4866   cat conftest.$ac_ext >&5
4867   rm -rf conftest*
4868   eval "ac_cv_lib_$ac_lib_var=no"
4869 fi
4870 rm -f conftest*
4871 LIBS="$ac_save_LIBS"
4872
4873 fi
4874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4875   echo "$ac_t""yes" 1>&6
4876     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4877     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4878   cat >> confdefs.h <<EOF
4879 #define $ac_tr_lib 1
4880 EOF
4881
4882   LIBS="-lnet $LIBS"
4883
4884 else
4885   echo "$ac_t""no" 1>&6
4886 fi
4887
4888         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4889 echo "configure:4890: checking for main in -lnsl_s" >&5
4890 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4891 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4892   echo $ac_n "(cached) $ac_c" 1>&6
4893 else
4894   ac_save_LIBS="$LIBS"
4895 LIBS="-lnsl_s  $LIBS"
4896 cat > conftest.$ac_ext <<EOF
4897 #line 4898 "configure"
4898 #include "confdefs.h"
4899
4900 int main() {
4901 main()
4902 ; return 0; }
4903 EOF
4904 if { (eval echo configure:4905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4905   rm -rf conftest*
4906   eval "ac_cv_lib_$ac_lib_var=yes"
4907 else
4908   echo "configure: failed program was:" >&5
4909   cat conftest.$ac_ext >&5
4910   rm -rf conftest*
4911   eval "ac_cv_lib_$ac_lib_var=no"
4912 fi
4913 rm -f conftest*
4914 LIBS="$ac_save_LIBS"
4915
4916 fi
4917 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4918   echo "$ac_t""yes" 1>&6
4919     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4920     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4921   cat >> confdefs.h <<EOF
4922 #define $ac_tr_lib 1
4923 EOF
4924
4925   LIBS="-lnsl_s $LIBS"
4926
4927 else
4928   echo "$ac_t""no" 1>&6
4929 fi
4930
4931         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4932 echo "configure:4933: checking for main in -lnsl" >&5
4933 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4934 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4935   echo $ac_n "(cached) $ac_c" 1>&6
4936 else
4937   ac_save_LIBS="$LIBS"
4938 LIBS="-lnsl  $LIBS"
4939 cat > conftest.$ac_ext <<EOF
4940 #line 4941 "configure"
4941 #include "confdefs.h"
4942
4943 int main() {
4944 main()
4945 ; return 0; }
4946 EOF
4947 if { (eval echo configure:4948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4948   rm -rf conftest*
4949   eval "ac_cv_lib_$ac_lib_var=yes"
4950 else
4951   echo "configure: failed program was:" >&5
4952   cat conftest.$ac_ext >&5
4953   rm -rf conftest*
4954   eval "ac_cv_lib_$ac_lib_var=no"
4955 fi
4956 rm -f conftest*
4957 LIBS="$ac_save_LIBS"
4958
4959 fi
4960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4961   echo "$ac_t""yes" 1>&6
4962     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4963     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4964   cat >> confdefs.h <<EOF
4965 #define $ac_tr_lib 1
4966 EOF
4967
4968   LIBS="-lnsl $LIBS"
4969
4970 else
4971   echo "$ac_t""no" 1>&6
4972 fi
4973
4974         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4975 echo "configure:4976: checking for socket in -linet" >&5
4976 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4977 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4978   echo $ac_n "(cached) $ac_c" 1>&6
4979 else
4980   ac_save_LIBS="$LIBS"
4981 LIBS="-linet  $LIBS"
4982 cat > conftest.$ac_ext <<EOF
4983 #line 4984 "configure"
4984 #include "confdefs.h"
4985 /* Override any gcc2 internal prototype to avoid an error.  */
4986 /* We use char because int might match the return type of a gcc2
4987     builtin and then its argument prototype would still apply.  */
4988 char socket();
4989
4990 int main() {
4991 socket()
4992 ; return 0; }
4993 EOF
4994 if { (eval echo configure:4995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4995   rm -rf conftest*
4996   eval "ac_cv_lib_$ac_lib_var=yes"
4997 else
4998   echo "configure: failed program was:" >&5
4999   cat conftest.$ac_ext >&5
5000   rm -rf conftest*
5001   eval "ac_cv_lib_$ac_lib_var=no"
5002 fi
5003 rm -f conftest*
5004 LIBS="$ac_save_LIBS"
5005
5006 fi
5007 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5008   echo "$ac_t""yes" 1>&6
5009     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5010     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5011   cat >> confdefs.h <<EOF
5012 #define $ac_tr_lib 1
5013 EOF
5014
5015   LIBS="-linet $LIBS"
5016
5017 else
5018   echo "$ac_t""no" 1>&6
5019 fi
5020
5021         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5022 echo "configure:5023: checking for main in -lgen" >&5
5023 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5024 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5025   echo $ac_n "(cached) $ac_c" 1>&6
5026 else
5027   ac_save_LIBS="$LIBS"
5028 LIBS="-lgen  $LIBS"
5029 cat > conftest.$ac_ext <<EOF
5030 #line 5031 "configure"
5031 #include "confdefs.h"
5032
5033 int main() {
5034 main()
5035 ; return 0; }
5036 EOF
5037 if { (eval echo configure:5038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5038   rm -rf conftest*
5039   eval "ac_cv_lib_$ac_lib_var=yes"
5040 else
5041   echo "configure: failed program was:" >&5
5042   cat conftest.$ac_ext >&5
5043   rm -rf conftest*
5044   eval "ac_cv_lib_$ac_lib_var=no"
5045 fi
5046 rm -f conftest*
5047 LIBS="$ac_save_LIBS"
5048
5049 fi
5050 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5051   echo "$ac_t""yes" 1>&6
5052     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5053     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5054   cat >> confdefs.h <<EOF
5055 #define $ac_tr_lib 1
5056 EOF
5057
5058   LIBS="-lgen $LIBS"
5059
5060 else
5061   echo "$ac_t""no" 1>&6
5062 fi
5063
5064
5065 fi
5066
5067
5068 echo $ac_n "checking for select""... $ac_c" 1>&6
5069 echo "configure:5070: checking for select" >&5
5070 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5071   echo $ac_n "(cached) $ac_c" 1>&6
5072 else
5073   cat > conftest.$ac_ext <<EOF
5074 #line 5075 "configure"
5075 #include "confdefs.h"
5076 /* System header to define __stub macros and hopefully few prototypes,
5077     which can conflict with char select(); below.  */
5078 #include <assert.h>
5079 /* Override any gcc2 internal prototype to avoid an error.  */
5080 /* We use char because int might match the return type of a gcc2
5081     builtin and then its argument prototype would still apply.  */
5082 char select();
5083 char (*f)();
5084
5085 int main() {
5086
5087 /* The GNU C library defines this for functions which it implements
5088     to always fail with ENOSYS.  Some functions are actually named
5089     something starting with __ and the normal name is an alias.  */
5090 #if defined (__stub_select) || defined (__stub___select)
5091 choke me
5092 #else
5093 f = select;
5094 #endif
5095
5096 ; return 0; }
5097 EOF
5098 if { (eval echo configure:5099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5099   rm -rf conftest*
5100   eval "ac_cv_func_select=yes"
5101 else
5102   echo "configure: failed program was:" >&5
5103   cat conftest.$ac_ext >&5
5104   rm -rf conftest*
5105   eval "ac_cv_func_select=no"
5106 fi
5107 rm -f conftest*
5108 fi
5109
5110 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5111   echo "$ac_t""yes" 1>&6
5112   :
5113 else
5114   echo "$ac_t""no" 1>&6
5115 { echo "configure: error: select() required." 1>&2; exit 1; }
5116 fi
5117
5118
5119 if test "${ac_cv_header_winsock_h}" != yes; then
5120                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5121 echo "configure:5122: checking types of arguments for select()" >&5
5122  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5123   echo $ac_n "(cached) $ac_c" 1>&6
5124 else
5125    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5126   echo $ac_n "(cached) $ac_c" 1>&6
5127 else
5128     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5129   echo $ac_n "(cached) $ac_c" 1>&6
5130 else
5131      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5132      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5133       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5134        cat > conftest.$ac_ext <<EOF
5135 #line 5136 "configure"
5136 #include "confdefs.h"
5137 #ifdef HAVE_SYS_TYPES_H
5138 #include <sys/types.h>
5139 #endif
5140 #ifdef HAVE_SYS_TIME_H
5141 #include <sys/time.h>
5142 #endif
5143 #ifdef HAVE_SYS_SELECT_H
5144 #include <sys/select.h>
5145 #endif
5146 #ifdef HAVE_SYS_SOCKET_H
5147 #include <sys/socket.h>
5148 #endif
5149 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);
5150 int main() {
5151
5152 ; return 0; }
5153 EOF
5154 if { (eval echo configure:5155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5155   rm -rf conftest*
5156           ac_not_found=no ; break 3
5157 else
5158   echo "configure: failed program was:" >&5
5159   cat conftest.$ac_ext >&5
5160   rm -rf conftest*
5161   ac_not_found=yes
5162 fi
5163 rm -f conftest*
5164       done
5165      done
5166     done
5167    
5168 fi
5169   
5170 fi
5171  
5172 fi
5173  if test "$ac_not_found" = yes; then
5174   ac_cv_func_select_arg1=int 
5175   ac_cv_func_select_arg234='int *' 
5176   ac_cv_func_select_arg5='struct timeval *'
5177  fi
5178  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5179  cat >> confdefs.h <<EOF
5180 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5181 EOF
5182
5183  cat >> confdefs.h <<EOF
5184 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5185 EOF
5186
5187  cat >> confdefs.h <<EOF
5188 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5189 EOF
5190
5191
5192 fi
5193
5194
5195 for ac_hdr in regex.h 
5196 do
5197 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5198 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5199 echo "configure:5200: checking for $ac_hdr" >&5
5200 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5201   echo $ac_n "(cached) $ac_c" 1>&6
5202 else
5203   cat > conftest.$ac_ext <<EOF
5204 #line 5205 "configure"
5205 #include "confdefs.h"
5206 #include <$ac_hdr>
5207 EOF
5208 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5209 { (eval echo configure:5210: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5210 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5211 if test -z "$ac_err"; then
5212   rm -rf conftest*
5213   eval "ac_cv_header_$ac_safe=yes"
5214 else
5215   echo "$ac_err" >&5
5216   echo "configure: failed program was:" >&5
5217   cat conftest.$ac_ext >&5
5218   rm -rf conftest*
5219   eval "ac_cv_header_$ac_safe=no"
5220 fi
5221 rm -f conftest*
5222 fi
5223 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5224   echo "$ac_t""yes" 1>&6
5225     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5226   cat >> confdefs.h <<EOF
5227 #define $ac_tr_hdr 1
5228 EOF
5229  
5230 else
5231   echo "$ac_t""no" 1>&6
5232 fi
5233 done
5234
5235 if test "$ac_cv_header_regex_h" != yes ; then
5236         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5237 fi
5238 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5239 echo "configure:5240: checking for regfree" >&5
5240 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5241   echo $ac_n "(cached) $ac_c" 1>&6
5242 else
5243   cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246 /* System header to define __stub macros and hopefully few prototypes,
5247     which can conflict with char regfree(); below.  */
5248 #include <assert.h>
5249 /* Override any gcc2 internal prototype to avoid an error.  */
5250 /* We use char because int might match the return type of a gcc2
5251     builtin and then its argument prototype would still apply.  */
5252 char regfree();
5253 char (*f)();
5254
5255 int main() {
5256
5257 /* The GNU C library defines this for functions which it implements
5258     to always fail with ENOSYS.  Some functions are actually named
5259     something starting with __ and the normal name is an alias.  */
5260 #if defined (__stub_regfree) || defined (__stub___regfree)
5261 choke me
5262 #else
5263 f = regfree;
5264 #endif
5265
5266 ; return 0; }
5267 EOF
5268 if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5269   rm -rf conftest*
5270   eval "ac_cv_func_regfree=yes"
5271 else
5272   echo "configure: failed program was:" >&5
5273   cat conftest.$ac_ext >&5
5274   rm -rf conftest*
5275   eval "ac_cv_func_regfree=no"
5276 fi
5277 rm -f conftest*
5278 fi
5279
5280 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5281   echo "$ac_t""yes" 1>&6
5282   :
5283 else
5284   echo "$ac_t""no" 1>&6
5285 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5286 fi
5287
5288
5289
5290 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5291 echo "configure:5292: checking for compatible POSIX regex" >&5
5292 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5293   echo $ac_n "(cached) $ac_c" 1>&6
5294 else
5295   
5296         if test "$cross_compiling" = yes; then
5297   ol_cv_c_posix_regex=cross
5298 else
5299   cat > conftest.$ac_ext <<EOF
5300 #line 5301 "configure"
5301 #include "confdefs.h"
5302
5303 #include <sys/types.h>
5304 #include <regex.h>
5305 static char *pattern, *string;
5306 main()
5307 {
5308         int rc;
5309         regex_t re;
5310
5311         pattern = "^A";
5312
5313         if(regcomp(&re, pattern, 0)) {
5314                 return -1;
5315         }
5316         
5317         string = "ALL MATCH";
5318         
5319         rc = regexec(&re, string, 0, (void*)0, 0);
5320
5321         regfree(&re);
5322
5323         return rc;
5324 }
5325 EOF
5326 if { (eval echo configure:5327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5327 then
5328   ol_cv_c_posix_regex=yes
5329 else
5330   echo "configure: failed program was:" >&5
5331   cat conftest.$ac_ext >&5
5332   rm -fr conftest*
5333   ol_cv_c_posix_regex=no
5334 fi
5335 rm -fr conftest*
5336 fi
5337
5338 fi
5339
5340 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5341
5342 if test "$ol_cv_c_posix_regex" = no ; then
5343         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5344 fi
5345
5346 ol_link_dnssrv=no
5347 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5348 echo "configure:5349: checking for res_query" >&5
5349 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5350   echo $ac_n "(cached) $ac_c" 1>&6
5351 else
5352   cat > conftest.$ac_ext <<EOF
5353 #line 5354 "configure"
5354 #include "confdefs.h"
5355 /* System header to define __stub macros and hopefully few prototypes,
5356     which can conflict with char res_query(); below.  */
5357 #include <assert.h>
5358 /* Override any gcc2 internal prototype to avoid an error.  */
5359 /* We use char because int might match the return type of a gcc2
5360     builtin and then its argument prototype would still apply.  */
5361 char res_query();
5362 char (*f)();
5363
5364 int main() {
5365
5366 /* The GNU C library defines this for functions which it implements
5367     to always fail with ENOSYS.  Some functions are actually named
5368     something starting with __ and the normal name is an alias.  */
5369 #if defined (__stub_res_query) || defined (__stub___res_query)
5370 choke me
5371 #else
5372 f = res_query;
5373 #endif
5374
5375 ; return 0; }
5376 EOF
5377 if { (eval echo configure:5378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5378   rm -rf conftest*
5379   eval "ac_cv_func_res_query=yes"
5380 else
5381   echo "configure: failed program was:" >&5
5382   cat conftest.$ac_ext >&5
5383   rm -rf conftest*
5384   eval "ac_cv_func_res_query=no"
5385 fi
5386 rm -f conftest*
5387 fi
5388
5389 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5390   echo "$ac_t""yes" 1>&6
5391   :
5392 else
5393   echo "$ac_t""no" 1>&6
5394 fi
5395
5396 if test $ac_cv_func_res_query = no ; then 
5397         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5398 echo "configure:5399: checking for __res_query" >&5
5399 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5400   echo $ac_n "(cached) $ac_c" 1>&6
5401 else
5402   cat > conftest.$ac_ext <<EOF
5403 #line 5404 "configure"
5404 #include "confdefs.h"
5405 /* System header to define __stub macros and hopefully few prototypes,
5406     which can conflict with char __res_query(); below.  */
5407 #include <assert.h>
5408 /* Override any gcc2 internal prototype to avoid an error.  */
5409 /* We use char because int might match the return type of a gcc2
5410     builtin and then its argument prototype would still apply.  */
5411 char __res_query();
5412 char (*f)();
5413
5414 int main() {
5415
5416 /* The GNU C library defines this for functions which it implements
5417     to always fail with ENOSYS.  Some functions are actually named
5418     something starting with __ and the normal name is an alias.  */
5419 #if defined (__stub___res_query) || defined (__stub_____res_query)
5420 choke me
5421 #else
5422 f = __res_query;
5423 #endif
5424
5425 ; return 0; }
5426 EOF
5427 if { (eval echo configure:5428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5428   rm -rf conftest*
5429   eval "ac_cv_func___res_query=yes"
5430 else
5431   echo "configure: failed program was:" >&5
5432   cat conftest.$ac_ext >&5
5433   rm -rf conftest*
5434   eval "ac_cv_func___res_query=no"
5435 fi
5436 rm -f conftest*
5437 fi
5438
5439 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5440   echo "$ac_t""yes" 1>&6
5441   :
5442 else
5443   echo "$ac_t""no" 1>&6
5444 fi
5445
5446         ac_cv_func_res_query=$ac_cv_func___res_query
5447 fi
5448
5449 if test $ac_cv_func_res_query = no ; then 
5450         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5451 echo "configure:5452: checking for res_query in -lbind" >&5
5452 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5453 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5454   echo $ac_n "(cached) $ac_c" 1>&6
5455 else
5456   ac_save_LIBS="$LIBS"
5457 LIBS="-lbind  $LIBS"
5458 cat > conftest.$ac_ext <<EOF
5459 #line 5460 "configure"
5460 #include "confdefs.h"
5461 /* Override any gcc2 internal prototype to avoid an error.  */
5462 /* We use char because int might match the return type of a gcc2
5463     builtin and then its argument prototype would still apply.  */
5464 char res_query();
5465
5466 int main() {
5467 res_query()
5468 ; return 0; }
5469 EOF
5470 if { (eval echo configure:5471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5471   rm -rf conftest*
5472   eval "ac_cv_lib_$ac_lib_var=yes"
5473 else
5474   echo "configure: failed program was:" >&5
5475   cat conftest.$ac_ext >&5
5476   rm -rf conftest*
5477   eval "ac_cv_lib_$ac_lib_var=no"
5478 fi
5479 rm -f conftest*
5480 LIBS="$ac_save_LIBS"
5481
5482 fi
5483 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5484   echo "$ac_t""yes" 1>&6
5485     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5486     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5487   cat >> confdefs.h <<EOF
5488 #define $ac_tr_lib 1
5489 EOF
5490
5491   LIBS="-lbind $LIBS"
5492
5493 else
5494   echo "$ac_t""no" 1>&6
5495 fi
5496
5497         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5498 fi
5499
5500 if test $ac_cv_func_res_query = no ; then 
5501         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5502 echo "configure:5503: checking for __res_query in -lbind" >&5
5503 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5504 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5505   echo $ac_n "(cached) $ac_c" 1>&6
5506 else
5507   ac_save_LIBS="$LIBS"
5508 LIBS="-lbind  $LIBS"
5509 cat > conftest.$ac_ext <<EOF
5510 #line 5511 "configure"
5511 #include "confdefs.h"
5512 /* Override any gcc2 internal prototype to avoid an error.  */
5513 /* We use char because int might match the return type of a gcc2
5514     builtin and then its argument prototype would still apply.  */
5515 char __res_query();
5516
5517 int main() {
5518 __res_query()
5519 ; return 0; }
5520 EOF
5521 if { (eval echo configure:5522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5522   rm -rf conftest*
5523   eval "ac_cv_lib_$ac_lib_var=yes"
5524 else
5525   echo "configure: failed program was:" >&5
5526   cat conftest.$ac_ext >&5
5527   rm -rf conftest*
5528   eval "ac_cv_lib_$ac_lib_var=no"
5529 fi
5530 rm -f conftest*
5531 LIBS="$ac_save_LIBS"
5532
5533 fi
5534 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5535   echo "$ac_t""yes" 1>&6
5536     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5537     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5538   cat >> confdefs.h <<EOF
5539 #define $ac_tr_lib 1
5540 EOF
5541
5542   LIBS="-lbind $LIBS"
5543
5544 else
5545   echo "$ac_t""no" 1>&6
5546 fi
5547
5548         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5549 fi
5550
5551 if test $ac_cv_func_res_query = no ; then 
5552         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5553 echo "configure:5554: checking for res_query in -lresolv" >&5
5554 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5555 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5556   echo $ac_n "(cached) $ac_c" 1>&6
5557 else
5558   ac_save_LIBS="$LIBS"
5559 LIBS="-lresolv  $LIBS"
5560 cat > conftest.$ac_ext <<EOF
5561 #line 5562 "configure"
5562 #include "confdefs.h"
5563 /* Override any gcc2 internal prototype to avoid an error.  */
5564 /* We use char because int might match the return type of a gcc2
5565     builtin and then its argument prototype would still apply.  */
5566 char res_query();
5567
5568 int main() {
5569 res_query()
5570 ; return 0; }
5571 EOF
5572 if { (eval echo configure:5573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5573   rm -rf conftest*
5574   eval "ac_cv_lib_$ac_lib_var=yes"
5575 else
5576   echo "configure: failed program was:" >&5
5577   cat conftest.$ac_ext >&5
5578   rm -rf conftest*
5579   eval "ac_cv_lib_$ac_lib_var=no"
5580 fi
5581 rm -f conftest*
5582 LIBS="$ac_save_LIBS"
5583
5584 fi
5585 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5586   echo "$ac_t""yes" 1>&6
5587     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5588     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5589   cat >> confdefs.h <<EOF
5590 #define $ac_tr_lib 1
5591 EOF
5592
5593   LIBS="-lresolv $LIBS"
5594
5595 else
5596   echo "$ac_t""no" 1>&6
5597 fi
5598
5599         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5600 fi
5601
5602 if test $ac_cv_func_res_query = no ; then 
5603         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
5604 echo "configure:5605: checking for __res_query in -lresolv" >&5
5605 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
5606 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5607   echo $ac_n "(cached) $ac_c" 1>&6
5608 else
5609   ac_save_LIBS="$LIBS"
5610 LIBS="-lresolv  $LIBS"
5611 cat > conftest.$ac_ext <<EOF
5612 #line 5613 "configure"
5613 #include "confdefs.h"
5614 /* Override any gcc2 internal prototype to avoid an error.  */
5615 /* We use char because int might match the return type of a gcc2
5616     builtin and then its argument prototype would still apply.  */
5617 char __res_query();
5618
5619 int main() {
5620 __res_query()
5621 ; return 0; }
5622 EOF
5623 if { (eval echo configure:5624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5624   rm -rf conftest*
5625   eval "ac_cv_lib_$ac_lib_var=yes"
5626 else
5627   echo "configure: failed program was:" >&5
5628   cat conftest.$ac_ext >&5
5629   rm -rf conftest*
5630   eval "ac_cv_lib_$ac_lib_var=no"
5631 fi
5632 rm -f conftest*
5633 LIBS="$ac_save_LIBS"
5634
5635 fi
5636 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5637   echo "$ac_t""yes" 1>&6
5638     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5639     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5640   cat >> confdefs.h <<EOF
5641 #define $ac_tr_lib 1
5642 EOF
5643
5644   LIBS="-lresolv $LIBS"
5645
5646 else
5647   echo "$ac_t""no" 1>&6
5648 fi
5649
5650         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
5651 fi
5652
5653 if test "$ac_cv_func_res_query" = yes ; then
5654         cat >> confdefs.h <<\EOF
5655 #define HAVE_RES_QUERY 1
5656 EOF
5657
5658
5659         if test $ol_enable_dnssrv != no ; then
5660                 ol_link_dnssrv=yes
5661         fi
5662 fi
5663
5664 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5665         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5666 fi
5667
5668 for ac_func in getaddrinfo gai_strerror inet_ntop 
5669 do
5670 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5671 echo "configure:5672: checking for $ac_func" >&5
5672 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5673   echo $ac_n "(cached) $ac_c" 1>&6
5674 else
5675   cat > conftest.$ac_ext <<EOF
5676 #line 5677 "configure"
5677 #include "confdefs.h"
5678 /* System header to define __stub macros and hopefully few prototypes,
5679     which can conflict with char $ac_func(); below.  */
5680 #include <assert.h>
5681 /* Override any gcc2 internal prototype to avoid an error.  */
5682 /* We use char because int might match the return type of a gcc2
5683     builtin and then its argument prototype would still apply.  */
5684 char $ac_func();
5685 char (*f)();
5686
5687 int main() {
5688
5689 /* The GNU C library defines this for functions which it implements
5690     to always fail with ENOSYS.  Some functions are actually named
5691     something starting with __ and the normal name is an alias.  */
5692 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5693 choke me
5694 #else
5695 f = $ac_func;
5696 #endif
5697
5698 ; return 0; }
5699 EOF
5700 if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5701   rm -rf conftest*
5702   eval "ac_cv_func_$ac_func=yes"
5703 else
5704   echo "configure: failed program was:" >&5
5705   cat conftest.$ac_ext >&5
5706   rm -rf conftest*
5707   eval "ac_cv_func_$ac_func=no"
5708 fi
5709 rm -f conftest*
5710 fi
5711
5712 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5713   echo "$ac_t""yes" 1>&6
5714     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5715   cat >> confdefs.h <<EOF
5716 #define $ac_tr_func 1
5717 EOF
5718  
5719 else
5720   echo "$ac_t""no" 1>&6
5721 fi
5722 done
5723
5724
5725 ol_link_ipv6=no
5726 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5727         if test $ol_enable_ipv6 = yes ; then
5728                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5729         fi
5730 elif test $ol_enable_ipv6 != no ; then
5731         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5732 echo "configure:5733: checking INET6_ADDRSTRLEN" >&5
5733 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5734   echo $ac_n "(cached) $ac_c" 1>&6
5735 else
5736   
5737                 cat > conftest.$ac_ext <<EOF
5738 #line 5739 "configure"
5739 #include "confdefs.h"
5740
5741 #                       include <netinet/in.h>
5742 #                       ifdef INET6_ADDRSTRLEN
5743                                 __has_inet6_addrstrlen__;
5744 #                       endif
5745                 
5746 EOF
5747 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5748   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5749   rm -rf conftest*
5750   ol_cv_inet6_addrstrlen=yes
5751 else
5752   rm -rf conftest*
5753   ol_cv_inet6_addrstrlen=no
5754 fi
5755 rm -f conftest*
5756
5757 fi
5758
5759 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5760
5761         if test $ol_cv_inet6_addrstrlen = yes ; then
5762                 ol_link_ipv6=yes
5763         elif test $ol_enable_ipv6 = yes ; then
5764                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5765         fi
5766 fi
5767
5768 if test $ol_enable_local != no ; then
5769         for ac_hdr in sys/un.h 
5770 do
5771 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5772 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5773 echo "configure:5774: checking for $ac_hdr" >&5
5774 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5775   echo $ac_n "(cached) $ac_c" 1>&6
5776 else
5777   cat > conftest.$ac_ext <<EOF
5778 #line 5779 "configure"
5779 #include "confdefs.h"
5780 #include <$ac_hdr>
5781 EOF
5782 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5783 { (eval echo configure:5784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5784 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5785 if test -z "$ac_err"; then
5786   rm -rf conftest*
5787   eval "ac_cv_header_$ac_safe=yes"
5788 else
5789   echo "$ac_err" >&5
5790   echo "configure: failed program was:" >&5
5791   cat conftest.$ac_ext >&5
5792   rm -rf conftest*
5793   eval "ac_cv_header_$ac_safe=no"
5794 fi
5795 rm -f conftest*
5796 fi
5797 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5798   echo "$ac_t""yes" 1>&6
5799     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5800   cat >> confdefs.h <<EOF
5801 #define $ac_tr_hdr 1
5802 EOF
5803  
5804 else
5805   echo "$ac_t""no" 1>&6
5806 fi
5807 done
5808
5809
5810         if test $ol_enable_local = auto ; then
5811                 ol_enable_local=$ac_cv_header_sys_un_h
5812         elif test $ac_cv_header_sys_un_h = no ; then
5813                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5814         fi
5815 fi
5816
5817 ol_link_kbind=no
5818 ol_link_kpasswd=no
5819 ol_link_krb5=no
5820 ol_link_krb4=no
5821
5822 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5823         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5824         -o $ol_with_kerberos = k425 ; then
5825
5826         for ac_hdr in krb5.h
5827 do
5828 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5829 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5830 echo "configure:5831: checking for $ac_hdr" >&5
5831 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5832   echo $ac_n "(cached) $ac_c" 1>&6
5833 else
5834   cat > conftest.$ac_ext <<EOF
5835 #line 5836 "configure"
5836 #include "confdefs.h"
5837 #include <$ac_hdr>
5838 EOF
5839 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5840 { (eval echo configure:5841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5841 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5842 if test -z "$ac_err"; then
5843   rm -rf conftest*
5844   eval "ac_cv_header_$ac_safe=yes"
5845 else
5846   echo "$ac_err" >&5
5847   echo "configure: failed program was:" >&5
5848   cat conftest.$ac_ext >&5
5849   rm -rf conftest*
5850   eval "ac_cv_header_$ac_safe=no"
5851 fi
5852 rm -f conftest*
5853 fi
5854 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5855   echo "$ac_t""yes" 1>&6
5856     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5857   cat >> confdefs.h <<EOF
5858 #define $ac_tr_hdr 1
5859 EOF
5860  
5861 else
5862   echo "$ac_t""no" 1>&6
5863 fi
5864 done
5865
5866
5867         if test $ac_cv_header_krb5_h = yes ; then
5868                                 for ac_hdr in heim_err.h
5869 do
5870 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5871 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5872 echo "configure:5873: checking for $ac_hdr" >&5
5873 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5874   echo $ac_n "(cached) $ac_c" 1>&6
5875 else
5876   cat > conftest.$ac_ext <<EOF
5877 #line 5878 "configure"
5878 #include "confdefs.h"
5879 #include <$ac_hdr>
5880 EOF
5881 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5882 { (eval echo configure:5883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5883 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5884 if test -z "$ac_err"; then
5885   rm -rf conftest*
5886   eval "ac_cv_header_$ac_safe=yes"
5887 else
5888   echo "$ac_err" >&5
5889   echo "configure: failed program was:" >&5
5890   cat conftest.$ac_ext >&5
5891   rm -rf conftest*
5892   eval "ac_cv_header_$ac_safe=no"
5893 fi
5894 rm -f conftest*
5895 fi
5896 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5897   echo "$ac_t""yes" 1>&6
5898     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5899   cat >> confdefs.h <<EOF
5900 #define $ac_tr_hdr 1
5901 EOF
5902  
5903 else
5904   echo "$ac_t""no" 1>&6
5905 fi
5906 done
5907
5908                 if test $ac_cv_header_heim_err_h = yes ; then
5909                         krb5_impl=heimdal
5910                 else
5911                         krb5_impl=mit
5912                 fi
5913
5914                 if test $krb5_impl = mit; then
5915                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
5916 echo "configure:5917: checking for main in -lk5crypto" >&5
5917 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
5918 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5919   echo $ac_n "(cached) $ac_c" 1>&6
5920 else
5921   ac_save_LIBS="$LIBS"
5922 LIBS="-lk5crypto  $LIBS"
5923 cat > conftest.$ac_ext <<EOF
5924 #line 5925 "configure"
5925 #include "confdefs.h"
5926
5927 int main() {
5928 main()
5929 ; return 0; }
5930 EOF
5931 if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5932   rm -rf conftest*
5933   eval "ac_cv_lib_$ac_lib_var=yes"
5934 else
5935   echo "configure: failed program was:" >&5
5936   cat conftest.$ac_ext >&5
5937   rm -rf conftest*
5938   eval "ac_cv_lib_$ac_lib_var=no"
5939 fi
5940 rm -f conftest*
5941 LIBS="$ac_save_LIBS"
5942
5943 fi
5944 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5945   echo "$ac_t""yes" 1>&6
5946   krb5crypto=k5crypto
5947 else
5948   echo "$ac_t""no" 1>&6
5949 krb5crypto=crypto
5950 fi
5951
5952
5953                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5954 echo "configure:5955: checking for main in -lkrb5" >&5
5955 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5956 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5957   echo $ac_n "(cached) $ac_c" 1>&6
5958 else
5959   ac_save_LIBS="$LIBS"
5960 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
5961 cat > conftest.$ac_ext <<EOF
5962 #line 5963 "configure"
5963 #include "confdefs.h"
5964
5965 int main() {
5966 main()
5967 ; return 0; }
5968 EOF
5969 if { (eval echo configure:5970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5970   rm -rf conftest*
5971   eval "ac_cv_lib_$ac_lib_var=yes"
5972 else
5973   echo "configure: failed program was:" >&5
5974   cat conftest.$ac_ext >&5
5975   rm -rf conftest*
5976   eval "ac_cv_lib_$ac_lib_var=no"
5977 fi
5978 rm -f conftest*
5979 LIBS="$ac_save_LIBS"
5980
5981 fi
5982 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5983   echo "$ac_t""yes" 1>&6
5984   have_krb5=yes
5985                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
5986 else
5987   echo "$ac_t""no" 1>&6
5988 have_krb5=no
5989 fi
5990
5991
5992                 elif test $krb5_impl = heimdal; then
5993                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5994 echo "configure:5995: checking for main in -lkrb5" >&5
5995 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5996 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5997   echo $ac_n "(cached) $ac_c" 1>&6
5998 else
5999   ac_save_LIBS="$LIBS"
6000 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6001 cat > conftest.$ac_ext <<EOF
6002 #line 6003 "configure"
6003 #include "confdefs.h"
6004
6005 int main() {
6006 main()
6007 ; return 0; }
6008 EOF
6009 if { (eval echo configure:6010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6010   rm -rf conftest*
6011   eval "ac_cv_lib_$ac_lib_var=yes"
6012 else
6013   echo "configure: failed program was:" >&5
6014   cat conftest.$ac_ext >&5
6015   rm -rf conftest*
6016   eval "ac_cv_lib_$ac_lib_var=no"
6017 fi
6018 rm -f conftest*
6019 LIBS="$ac_save_LIBS"
6020
6021 fi
6022 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6023   echo "$ac_t""yes" 1>&6
6024   have_krb5=yes
6025                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6026 else
6027   echo "$ac_t""no" 1>&6
6028 have_krb5=no
6029 fi
6030
6031
6032                         cat >> confdefs.h <<\EOF
6033 #define HAVE_HEIMDAL_KERBEROS 1
6034 EOF
6035
6036
6037                 else
6038                         have_krb5=no
6039                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6040                 fi
6041
6042                 if test $have_krb5 = yes ; then
6043                         ol_link_krb5=yes
6044
6045                         cat >> confdefs.h <<\EOF
6046 #define HAVE_KRB5 1
6047 EOF
6048
6049
6050                         if test $ol_enable_kpasswd != no ; then
6051                                 ol_link_kpasswd=yes;
6052                         fi
6053
6054                         if test $ol_with_kerberos = k5only ; then
6055                                 ol_with_kerberos=found
6056                         fi
6057
6058                 elif test $ol_with_kerberos != auto ; then
6059                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6060                 fi
6061
6062         fi
6063 fi
6064
6065 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6066         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6067
6068         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6069 do
6070 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6071 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6072 echo "configure:6073: checking for $ac_hdr" >&5
6073 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6074   echo $ac_n "(cached) $ac_c" 1>&6
6075 else
6076   cat > conftest.$ac_ext <<EOF
6077 #line 6078 "configure"
6078 #include "confdefs.h"
6079 #include <$ac_hdr>
6080 EOF
6081 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6082 { (eval echo configure:6083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6083 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6084 if test -z "$ac_err"; then
6085   rm -rf conftest*
6086   eval "ac_cv_header_$ac_safe=yes"
6087 else
6088   echo "$ac_err" >&5
6089   echo "configure: failed program was:" >&5
6090   cat conftest.$ac_ext >&5
6091   rm -rf conftest*
6092   eval "ac_cv_header_$ac_safe=no"
6093 fi
6094 rm -f conftest*
6095 fi
6096 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6097   echo "$ac_t""yes" 1>&6
6098     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6099   cat >> confdefs.h <<EOF
6100 #define $ac_tr_hdr 1
6101 EOF
6102  
6103 else
6104   echo "$ac_t""no" 1>&6
6105 fi
6106 done
6107
6108
6109         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6110                 if test $krb5_impl = mit; then
6111                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6112 echo "configure:6113: checking for main in -lkrb4" >&5
6113 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6114 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6115   echo $ac_n "(cached) $ac_c" 1>&6
6116 else
6117   ac_save_LIBS="$LIBS"
6118 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6119 cat > conftest.$ac_ext <<EOF
6120 #line 6121 "configure"
6121 #include "confdefs.h"
6122
6123 int main() {
6124 main()
6125 ; return 0; }
6126 EOF
6127 if { (eval echo configure:6128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6128   rm -rf conftest*
6129   eval "ac_cv_lib_$ac_lib_var=yes"
6130 else
6131   echo "configure: failed program was:" >&5
6132   cat conftest.$ac_ext >&5
6133   rm -rf conftest*
6134   eval "ac_cv_lib_$ac_lib_var=no"
6135 fi
6136 rm -f conftest*
6137 LIBS="$ac_save_LIBS"
6138
6139 fi
6140 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6141   echo "$ac_t""yes" 1>&6
6142   have_k425=yes
6143                                 KRB4_LIBS="-lkrb4 -ldes425"
6144 else
6145   echo "$ac_t""no" 1>&6
6146 have_k425=no
6147 fi
6148
6149
6150                 elif test $krb5_impl = heimdal; then
6151                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6152 echo "configure:6153: checking for main in -lkrb4" >&5
6153 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6154 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6155   echo $ac_n "(cached) $ac_c" 1>&6
6156 else
6157   ac_save_LIBS="$LIBS"
6158 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6159 cat > conftest.$ac_ext <<EOF
6160 #line 6161 "configure"
6161 #include "confdefs.h"
6162
6163 int main() {
6164 main()
6165 ; return 0; }
6166 EOF
6167 if { (eval echo configure:6168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6168   rm -rf conftest*
6169   eval "ac_cv_lib_$ac_lib_var=yes"
6170 else
6171   echo "configure: failed program was:" >&5
6172   cat conftest.$ac_ext >&5
6173   rm -rf conftest*
6174   eval "ac_cv_lib_$ac_lib_var=no"
6175 fi
6176 rm -f conftest*
6177 LIBS="$ac_save_LIBS"
6178
6179 fi
6180 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6181   echo "$ac_t""yes" 1>&6
6182   have_k425=yes
6183                                 KRB4_LIBS="-lkrb4"
6184 else
6185   echo "$ac_t""no" 1>&6
6186 have_k425=no
6187 fi
6188
6189
6190                 else
6191                         have_425=no
6192                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6193                 fi
6194
6195                 if test $have_k425 = yes ; then
6196                         ol_with_kerberos=found
6197                         ol_link_krb4=yes
6198
6199                         cat >> confdefs.h <<\EOF
6200 #define HAVE_KRB425 1
6201 EOF
6202
6203                         cat >> confdefs.h <<\EOF
6204 #define HAVE_KRB4 1
6205 EOF
6206
6207
6208                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6209 echo "configure:6210: checking for des_debug in Kerberos libraries" >&5
6210 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6211   echo $ac_n "(cached) $ac_c" 1>&6
6212 else
6213   
6214                                                                 save_LIBS="$LIBS"
6215                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6216                                 cat > conftest.$ac_ext <<EOF
6217 #line 6218 "configure"
6218 #include "confdefs.h"
6219
6220 #include <kerberosIV/krb.h>
6221 #include <kerberosIV/des.h>
6222 extern int des_debug;
6223
6224 int main() {
6225
6226 des_debug = 1;
6227
6228 ; return 0; }
6229 EOF
6230 if { (eval echo configure:6231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6231   rm -rf conftest*
6232   ol_cv_var_des_debug=yes
6233 else
6234   echo "configure: failed program was:" >&5
6235   cat conftest.$ac_ext >&5
6236   rm -rf conftest*
6237   ol_cv_var_des_debug=no
6238 fi
6239 rm -f conftest*
6240                                                                 LIBS="$save_LIBS"
6241                         
6242 fi
6243
6244 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6245
6246                         if test $ol_cv_var_des_debug = yes ; then
6247                                 cat >> confdefs.h <<\EOF
6248 #define HAVE_DES_DEBUG 1
6249 EOF
6250
6251                         fi
6252
6253                         LIBS="$save_LIBS"
6254                 fi
6255         fi
6256 fi
6257
6258 if test $ol_link_krb5 = yes ; then
6259         ol_with_kerberos=found
6260 fi
6261
6262 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6263         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6264
6265         for ac_hdr in krb.h des.h krb-archaeology.h 
6266 do
6267 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6268 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6269 echo "configure:6270: checking for $ac_hdr" >&5
6270 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6271   echo $ac_n "(cached) $ac_c" 1>&6
6272 else
6273   cat > conftest.$ac_ext <<EOF
6274 #line 6275 "configure"
6275 #include "confdefs.h"
6276 #include <$ac_hdr>
6277 EOF
6278 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6279 { (eval echo configure:6280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6280 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6281 if test -z "$ac_err"; then
6282   rm -rf conftest*
6283   eval "ac_cv_header_$ac_safe=yes"
6284 else
6285   echo "$ac_err" >&5
6286   echo "configure: failed program was:" >&5
6287   cat conftest.$ac_ext >&5
6288   rm -rf conftest*
6289   eval "ac_cv_header_$ac_safe=no"
6290 fi
6291 rm -f conftest*
6292 fi
6293 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6294   echo "$ac_t""yes" 1>&6
6295     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6296   cat >> confdefs.h <<EOF
6297 #define $ac_tr_hdr 1
6298 EOF
6299  
6300 else
6301   echo "$ac_t""no" 1>&6
6302 fi
6303 done
6304
6305
6306         if test $ac_cv_header_krb_h = yes ; then
6307                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6308 echo "configure:6309: checking for main in -lkrb" >&5
6309 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6310 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6311   echo $ac_n "(cached) $ac_c" 1>&6
6312 else
6313   ac_save_LIBS="$LIBS"
6314 LIBS="-lkrb -ldes $LIBS"
6315 cat > conftest.$ac_ext <<EOF
6316 #line 6317 "configure"
6317 #include "confdefs.h"
6318
6319 int main() {
6320 main()
6321 ; return 0; }
6322 EOF
6323 if { (eval echo configure:6324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6324   rm -rf conftest*
6325   eval "ac_cv_lib_$ac_lib_var=yes"
6326 else
6327   echo "configure: failed program was:" >&5
6328   cat conftest.$ac_ext >&5
6329   rm -rf conftest*
6330   eval "ac_cv_lib_$ac_lib_var=no"
6331 fi
6332 rm -f conftest*
6333 LIBS="$ac_save_LIBS"
6334
6335 fi
6336 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6337   echo "$ac_t""yes" 1>&6
6338   have_k4=yes
6339 else
6340   echo "$ac_t""no" 1>&6
6341 have_k4=no
6342 fi
6343
6344
6345                 if test $have_k4 = yes ; then
6346                         ol_with_kerberos=found
6347                         ol_link_krb4=yes
6348
6349                         cat >> confdefs.h <<\EOF
6350 #define HAVE_KRB4 1
6351 EOF
6352
6353
6354                         KRB4_LIBS="-lkrb -ldes"
6355
6356                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6357                                 cat >> confdefs.h <<\EOF
6358 #define HAVE_KTH_KERBEROS 1
6359 EOF
6360
6361                         fi
6362                 fi
6363         fi
6364 fi
6365
6366 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6367         ol_link_kpasswd=yes
6368 fi
6369
6370 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6371         ol_link_kbind=yes
6372
6373 elif test $ol_enable_kbind = yes ; then
6374         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6375 fi
6376
6377 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6378         cat >> confdefs.h <<\EOF
6379 #define HAVE_KERBEROS 1
6380 EOF
6381
6382
6383 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6384         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6385 fi
6386
6387 ol_link_tls=no
6388 if test $ol_with_tls != no ; then
6389         for ac_hdr in openssl/ssl.h ssl.h
6390 do
6391 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6392 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6393 echo "configure:6394: checking for $ac_hdr" >&5
6394 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6395   echo $ac_n "(cached) $ac_c" 1>&6
6396 else
6397   cat > conftest.$ac_ext <<EOF
6398 #line 6399 "configure"
6399 #include "confdefs.h"
6400 #include <$ac_hdr>
6401 EOF
6402 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6403 { (eval echo configure:6404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6404 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6405 if test -z "$ac_err"; then
6406   rm -rf conftest*
6407   eval "ac_cv_header_$ac_safe=yes"
6408 else
6409   echo "$ac_err" >&5
6410   echo "configure: failed program was:" >&5
6411   cat conftest.$ac_ext >&5
6412   rm -rf conftest*
6413   eval "ac_cv_header_$ac_safe=no"
6414 fi
6415 rm -f conftest*
6416 fi
6417 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6418   echo "$ac_t""yes" 1>&6
6419     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6420   cat >> confdefs.h <<EOF
6421 #define $ac_tr_hdr 1
6422 EOF
6423  
6424 else
6425   echo "$ac_t""no" 1>&6
6426 fi
6427 done
6428
6429         
6430         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6431                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6432 echo "configure:6433: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6433 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6434 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6435   echo $ac_n "(cached) $ac_c" 1>&6
6436 else
6437   ac_save_LIBS="$LIBS"
6438 LIBS="-lssl -lcrypto $LIBS"
6439 cat > conftest.$ac_ext <<EOF
6440 #line 6441 "configure"
6441 #include "confdefs.h"
6442 /* Override any gcc2 internal prototype to avoid an error.  */
6443 /* We use char because int might match the return type of a gcc2
6444     builtin and then its argument prototype would still apply.  */
6445 char SSLeay_add_ssl_algorithms();
6446
6447 int main() {
6448 SSLeay_add_ssl_algorithms()
6449 ; return 0; }
6450 EOF
6451 if { (eval echo configure:6452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6452   rm -rf conftest*
6453   eval "ac_cv_lib_$ac_lib_var=yes"
6454 else
6455   echo "configure: failed program was:" >&5
6456   cat conftest.$ac_ext >&5
6457   rm -rf conftest*
6458   eval "ac_cv_lib_$ac_lib_var=no"
6459 fi
6460 rm -f conftest*
6461 LIBS="$ac_save_LIBS"
6462
6463 fi
6464 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6465   echo "$ac_t""yes" 1>&6
6466   have_ssleay=yes
6467                         need_rsaref=no
6468 else
6469   echo "$ac_t""no" 1>&6
6470 have_ssleay=no
6471 fi
6472
6473                         
6474                 if test $have_ssleay = no ; then
6475                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6476 echo "configure:6477: checking for SSL_library_init in -lssl" >&5
6477 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6478 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6479   echo $ac_n "(cached) $ac_c" 1>&6
6480 else
6481   ac_save_LIBS="$LIBS"
6482 LIBS="-lssl -lcrypto $LIBS"
6483 cat > conftest.$ac_ext <<EOF
6484 #line 6485 "configure"
6485 #include "confdefs.h"
6486 /* Override any gcc2 internal prototype to avoid an error.  */
6487 /* We use char because int might match the return type of a gcc2
6488     builtin and then its argument prototype would still apply.  */
6489 char SSL_library_init();
6490
6491 int main() {
6492 SSL_library_init()
6493 ; return 0; }
6494 EOF
6495 if { (eval echo configure:6496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6496   rm -rf conftest*
6497   eval "ac_cv_lib_$ac_lib_var=yes"
6498 else
6499   echo "configure: failed program was:" >&5
6500   cat conftest.$ac_ext >&5
6501   rm -rf conftest*
6502   eval "ac_cv_lib_$ac_lib_var=no"
6503 fi
6504 rm -f conftest*
6505 LIBS="$ac_save_LIBS"
6506
6507 fi
6508 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6509   echo "$ac_t""yes" 1>&6
6510   have_ssleay=yes
6511                                 need_rsaref=no
6512 else
6513   echo "$ac_t""no" 1>&6
6514 have_ssleay=no
6515 fi
6516
6517                 fi
6518
6519                 if test $have_ssleay = no ; then
6520                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6521 echo "configure:6522: checking for ssl3_accept in -lssl" >&5
6522 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6523 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6524   echo $ac_n "(cached) $ac_c" 1>&6
6525 else
6526   ac_save_LIBS="$LIBS"
6527 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6528 cat > conftest.$ac_ext <<EOF
6529 #line 6530 "configure"
6530 #include "confdefs.h"
6531 /* Override any gcc2 internal prototype to avoid an error.  */
6532 /* We use char because int might match the return type of a gcc2
6533     builtin and then its argument prototype would still apply.  */
6534 char ssl3_accept();
6535
6536 int main() {
6537 ssl3_accept()
6538 ; return 0; }
6539 EOF
6540 if { (eval echo configure:6541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6541   rm -rf conftest*
6542   eval "ac_cv_lib_$ac_lib_var=yes"
6543 else
6544   echo "configure: failed program was:" >&5
6545   cat conftest.$ac_ext >&5
6546   rm -rf conftest*
6547   eval "ac_cv_lib_$ac_lib_var=no"
6548 fi
6549 rm -f conftest*
6550 LIBS="$ac_save_LIBS"
6551
6552 fi
6553 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6554   echo "$ac_t""yes" 1>&6
6555   have_ssleay=yes
6556                                 need_rsaref=yes
6557 else
6558   echo "$ac_t""no" 1>&6
6559 have_ssleay=no
6560 fi
6561
6562                 fi
6563
6564                 if test $have_ssleay = yes ; then
6565                         ol_with_tls=found
6566                         ol_link_tls=yes
6567
6568                         cat >> confdefs.h <<\EOF
6569 #define HAVE_SSLEAY 1
6570 EOF
6571
6572
6573                         if test $need_rsaref = yes; then
6574                                 cat >> confdefs.h <<\EOF
6575 #define HAVE_RSAREF 1
6576 EOF
6577
6578
6579                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6580                         else
6581                                 TLS_LIBS="-lssl -lcrypto"
6582                         fi
6583                 fi
6584         fi
6585
6586 else
6587         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6588 fi
6589
6590 if test $ol_link_tls = yes ; then
6591         cat >> confdefs.h <<\EOF
6592 #define HAVE_TLS 1
6593 EOF
6594
6595
6596 elif test $ol_with_tls = auto ; then
6597         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6598         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6599
6600 elif test $ol_with_tls != no ; then
6601         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6602 fi
6603
6604 for ac_func in \
6605         ctime_r                 \
6606         gethostbyname_r gethostbyaddr_r \
6607
6608 do
6609 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6610 echo "configure:6611: checking for $ac_func" >&5
6611 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6612   echo $ac_n "(cached) $ac_c" 1>&6
6613 else
6614   cat > conftest.$ac_ext <<EOF
6615 #line 6616 "configure"
6616 #include "confdefs.h"
6617 /* System header to define __stub macros and hopefully few prototypes,
6618     which can conflict with char $ac_func(); below.  */
6619 #include <assert.h>
6620 /* Override any gcc2 internal prototype to avoid an error.  */
6621 /* We use char because int might match the return type of a gcc2
6622     builtin and then its argument prototype would still apply.  */
6623 char $ac_func();
6624 char (*f)();
6625
6626 int main() {
6627
6628 /* The GNU C library defines this for functions which it implements
6629     to always fail with ENOSYS.  Some functions are actually named
6630     something starting with __ and the normal name is an alias.  */
6631 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6632 choke me
6633 #else
6634 f = $ac_func;
6635 #endif
6636
6637 ; return 0; }
6638 EOF
6639 if { (eval echo configure:6640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6640   rm -rf conftest*
6641   eval "ac_cv_func_$ac_func=yes"
6642 else
6643   echo "configure: failed program was:" >&5
6644   cat conftest.$ac_ext >&5
6645   rm -rf conftest*
6646   eval "ac_cv_func_$ac_func=no"
6647 fi
6648 rm -f conftest*
6649 fi
6650
6651 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6652   echo "$ac_t""yes" 1>&6
6653     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6654   cat >> confdefs.h <<EOF
6655 #define $ac_tr_func 1
6656 EOF
6657  
6658 else
6659   echo "$ac_t""no" 1>&6
6660 fi
6661 done
6662
6663
6664 if test "$ac_cv_func_ctime_r" = no ; then
6665         ol_cv_func_ctime_r_nargs=0
6666 else
6667         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6668 echo "configure:6669: checking number of arguments of ctime_r" >&5
6669 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6670   echo $ac_n "(cached) $ac_c" 1>&6
6671 else
6672   cat > conftest.$ac_ext <<EOF
6673 #line 6674 "configure"
6674 #include "confdefs.h"
6675 #include <time.h>
6676 int main() {
6677 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6678 ; return 0; }
6679 EOF
6680 if { (eval echo configure:6681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6681   rm -rf conftest*
6682   ol_cv_func_ctime_r_nargs3=yes
6683 else
6684   echo "configure: failed program was:" >&5
6685   cat conftest.$ac_ext >&5
6686   rm -rf conftest*
6687   ol_cv_func_ctime_r_nargs3=no
6688 fi
6689 rm -f conftest*
6690
6691         cat > conftest.$ac_ext <<EOF
6692 #line 6693 "configure"
6693 #include "confdefs.h"
6694 #include <time.h>
6695 int main() {
6696 time_t ti; char *buffer; ctime_r(&ti,buffer);
6697 ; return 0; }
6698 EOF
6699 if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6700   rm -rf conftest*
6701   ol_cv_func_ctime_r_nargs2=yes
6702 else
6703   echo "configure: failed program was:" >&5
6704   cat conftest.$ac_ext >&5
6705   rm -rf conftest*
6706   ol_cv_func_ctime_r_nargs2=no
6707 fi
6708 rm -f conftest*
6709
6710         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6711                 $ol_cv_func_ctime_r_nargs2 = no ; then
6712
6713                 ol_cv_func_ctime_r_nargs=3
6714
6715         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6716                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6717
6718                 ol_cv_func_ctime_r_nargs=2
6719
6720         else
6721                 ol_cv_func_ctime_r_nargs=0
6722         fi
6723   
6724 fi
6725
6726 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6727
6728   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6729         cat >> confdefs.h <<EOF
6730 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6731 EOF
6732
6733   fi
6734
6735 fi
6736
6737 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6738         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6739 echo "configure:6740: checking number of arguments of gethostbyname_r" >&5
6740 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6741   echo $ac_n "(cached) $ac_c" 1>&6
6742 else
6743   cat > conftest.$ac_ext <<EOF
6744 #line 6745 "configure"
6745 #include "confdefs.h"
6746 #include <sys/types.h>
6747 #include <sys/socket.h>
6748 #include <netinet/in.h>
6749 #include <netdb.h>
6750 #define BUFSIZE (sizeof(struct hostent)+10)
6751 int main() {
6752 struct hostent hent; char buffer[BUFSIZE];
6753                 int bufsize=BUFSIZE;int h_errno;
6754                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6755                         buffer, bufsize, &h_errno);
6756 ; return 0; }
6757 EOF
6758 if { (eval echo configure:6759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6759   rm -rf conftest*
6760   ol_cv_func_gethostbyname_r_nargs5=yes
6761 else
6762   echo "configure: failed program was:" >&5
6763   cat conftest.$ac_ext >&5
6764   rm -rf conftest*
6765   ol_cv_func_gethostbyname_r_nargs5=no
6766 fi
6767 rm -f conftest*
6768
6769         cat > conftest.$ac_ext <<EOF
6770 #line 6771 "configure"
6771 #include "confdefs.h"
6772 #include <sys/types.h>
6773 #include <sys/socket.h>
6774 #include <netinet/in.h>
6775 #include <netdb.h>
6776 #define BUFSIZE (sizeof(struct hostent)+10)
6777 int main() {
6778 struct hostent hent;struct hostent *rhent;
6779                 char buffer[BUFSIZE];
6780                 int bufsize=BUFSIZE;int h_errno;
6781                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6782                         &rhent, &h_errno);
6783 ; return 0; }
6784 EOF
6785 if { (eval echo configure:6786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6786   rm -rf conftest*
6787   ol_cv_func_gethostbyname_r_nargs6=yes
6788 else
6789   echo "configure: failed program was:" >&5
6790   cat conftest.$ac_ext >&5
6791   rm -rf conftest*
6792   ol_cv_func_gethostbyname_r_nargs6=no
6793 fi
6794 rm -f conftest*
6795
6796         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6797                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6798
6799                 ol_cv_func_gethostbyname_r_nargs=5
6800
6801         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6802                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6803
6804                 ol_cv_func_gethostbyname_r_nargs=6
6805
6806         else
6807                 ol_cv_func_gethostbyname_r_nargs=0
6808         fi
6809   
6810 fi
6811
6812 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6813   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6814         cat >> confdefs.h <<EOF
6815 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6816 EOF
6817
6818   fi
6819
6820 else
6821         ol_cv_func_gethostbyname_r_nargs=0
6822 fi
6823  
6824 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6825         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6826 echo "configure:6827: checking number of arguments of gethostbyaddr_r" >&5
6827 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6828   echo $ac_n "(cached) $ac_c" 1>&6
6829 else
6830   cat > conftest.$ac_ext <<EOF
6831 #line 6832 "configure"
6832 #include "confdefs.h"
6833 #include <sys/types.h>
6834 #include <sys/socket.h>
6835 #include <netinet/in.h>
6836 #include <netdb.h>
6837 #define BUFSIZE (sizeof(struct hostent)+10)
6838 int main() {
6839 struct hostent hent; char buffer[BUFSIZE]; 
6840             struct in_addr add;
6841             size_t alen=sizeof(struct in_addr);
6842             int bufsize=BUFSIZE;int h_errno;
6843                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6844                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6845 ; return 0; }
6846 EOF
6847 if { (eval echo configure:6848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6848   rm -rf conftest*
6849   ol_cv_func_gethostbyaddr_r_nargs7=yes
6850 else
6851   echo "configure: failed program was:" >&5
6852   cat conftest.$ac_ext >&5
6853   rm -rf conftest*
6854   ol_cv_func_gethostbyaddr_r_nargs7=no
6855 fi
6856 rm -f conftest*
6857
6858         cat > conftest.$ac_ext <<EOF
6859 #line 6860 "configure"
6860 #include "confdefs.h"
6861 #include <sys/types.h>
6862 #include <sys/socket.h>
6863 #include <netinet/in.h>
6864 #include <netdb.h>
6865 #define BUFSIZE (sizeof(struct hostent)+10)
6866 int main() {
6867 struct hostent hent;
6868                 struct hostent *rhent; char buffer[BUFSIZE]; 
6869                 struct in_addr add;
6870                 size_t alen=sizeof(struct in_addr);
6871                 int bufsize=BUFSIZE;int h_errno;
6872                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6873                         alen, AF_INET, &hent, buffer, bufsize, 
6874                         &rhent, &h_errno);
6875 ; return 0; }
6876 EOF
6877 if { (eval echo configure:6878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6878   rm -rf conftest*
6879   ol_cv_func_gethostbyaddr_r_nargs8=yes
6880 else
6881   echo "configure: failed program was:" >&5
6882   cat conftest.$ac_ext >&5
6883   rm -rf conftest*
6884   ol_cv_func_gethostbyaddr_r_nargs8=no
6885 fi
6886 rm -f conftest*
6887
6888         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6889                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6890
6891                 ol_cv_func_gethostbyaddr_r_nargs=7
6892
6893         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6894                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6895
6896                 ol_cv_func_gethostbyaddr_r_nargs=8
6897
6898         else
6899                 ol_cv_func_gethostbyaddr_r_nargs=0
6900         fi
6901   
6902 fi
6903
6904 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6905   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6906     cat >> confdefs.h <<EOF
6907 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6908 EOF
6909
6910   fi
6911
6912 else
6913         ol_cv_func_gethostbyaddr_r_nargs=0
6914 fi
6915
6916 if test "$ac_cv_func_ctime_r" = yes \
6917         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6918         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6919         -a "$ac_cv_func_gethostbyname_r" = yes \
6920         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6921         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6922         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6923         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6924         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6925         ; then
6926  
6927         cat >> confdefs.h <<\EOF
6928 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6929 EOF
6930
6931 fi
6932
6933 ol_link_threads=no
6934
6935 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6936         -o $ol_with_threads = nt ; then
6937
6938         
6939         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6940 echo "configure:6941: checking for _beginthread" >&5
6941 if eval "test \"\${ac_cv_func__beginthread+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 /* System header to define __stub macros and hopefully few prototypes,
6948     which can conflict with char _beginthread(); below.  */
6949 #include <assert.h>
6950 /* Override any gcc2 internal prototype to avoid an error.  */
6951 /* We use char because int might match the return type of a gcc2
6952     builtin and then its argument prototype would still apply.  */
6953 char _beginthread();
6954 char (*f)();
6955
6956 int main() {
6957
6958 /* The GNU C library defines this for functions which it implements
6959     to always fail with ENOSYS.  Some functions are actually named
6960     something starting with __ and the normal name is an alias.  */
6961 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6962 choke me
6963 #else
6964 f = _beginthread;
6965 #endif
6966
6967 ; return 0; }
6968 EOF
6969 if { (eval echo configure:6970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6970   rm -rf conftest*
6971   eval "ac_cv_func__beginthread=yes"
6972 else
6973   echo "configure: failed program was:" >&5
6974   cat conftest.$ac_ext >&5
6975   rm -rf conftest*
6976   eval "ac_cv_func__beginthread=no"
6977 fi
6978 rm -f conftest*
6979 fi
6980
6981 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6982   echo "$ac_t""yes" 1>&6
6983   :
6984 else
6985   echo "$ac_t""no" 1>&6
6986 fi
6987
6988
6989         if test $ac_cv_func__beginthread = yes ; then
6990                 cat >> confdefs.h <<\EOF
6991 #define HAVE_NT_THREADS 1
6992 EOF
6993
6994         fi
6995
6996
6997         if test "$ol_cv_nt_threads" = yes ; then
6998         ol_link_threads=nt
6999         ol_with_threads=found
7000         ol_with_yielding_select=yes
7001
7002                 cat >> confdefs.h <<\EOF
7003 #define HAVE_NT_SERVICE_MANAGER 1
7004 EOF
7005
7006                 cat >> confdefs.h <<\EOF
7007 #define HAVE_NT_EVENT_LOG 1
7008 EOF
7009
7010         fi
7011
7012         if test $ol_with_threads = nt ; then
7013                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7014         fi
7015 fi
7016
7017 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7018         -o $ol_with_threads = posix ; then
7019
7020         for ac_hdr in pthread.h
7021 do
7022 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7023 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7024 echo "configure:7025: checking for $ac_hdr" >&5
7025 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7026   echo $ac_n "(cached) $ac_c" 1>&6
7027 else
7028   cat > conftest.$ac_ext <<EOF
7029 #line 7030 "configure"
7030 #include "confdefs.h"
7031 #include <$ac_hdr>
7032 EOF
7033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7034 { (eval echo configure:7035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7036 if test -z "$ac_err"; then
7037   rm -rf conftest*
7038   eval "ac_cv_header_$ac_safe=yes"
7039 else
7040   echo "$ac_err" >&5
7041   echo "configure: failed program was:" >&5
7042   cat conftest.$ac_ext >&5
7043   rm -rf conftest*
7044   eval "ac_cv_header_$ac_safe=no"
7045 fi
7046 rm -f conftest*
7047 fi
7048 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7049   echo "$ac_t""yes" 1>&6
7050     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7051   cat >> confdefs.h <<EOF
7052 #define $ac_tr_hdr 1
7053 EOF
7054  
7055 else
7056   echo "$ac_t""no" 1>&6
7057 fi
7058 done
7059
7060
7061         if test $ac_cv_header_pthread_h = yes ; then
7062                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7063 echo "configure:7064: checking POSIX thread version" >&5
7064 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7065   echo $ac_n "(cached) $ac_c" 1>&6
7066 else
7067   
7068         cat > conftest.$ac_ext <<EOF
7069 #line 7070 "configure"
7070 #include "confdefs.h"
7071
7072 #               include <pthread.h>
7073                 /* this check could be improved */
7074 #               ifdef PTHREAD_ONCE_INIT
7075                         pthread_version_final;
7076 #               endif
7077         
7078 EOF
7079 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7080   egrep "pthread_version_final" >/dev/null 2>&1; then
7081   rm -rf conftest*
7082   ol_pthread_final=yes
7083 else
7084   rm -rf conftest*
7085   ol_pthread_final=no
7086 fi
7087 rm -f conftest*
7088
7089
7090         cat > conftest.$ac_ext <<EOF
7091 #line 7092 "configure"
7092 #include "confdefs.h"
7093
7094 #               include <pthread.h>
7095                 /* this check could be improved */
7096 #               ifdef pthread_once_init
7097                         pthread_version_draft4;
7098 #               endif
7099         
7100 EOF
7101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7102   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7103   rm -rf conftest*
7104   ol_pthread_draft4=yes
7105 else
7106   rm -rf conftest*
7107   ol_pthread_draft4=no
7108 fi
7109 rm -f conftest*
7110
7111
7112         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7113                 ol_cv_pthread_version=final
7114         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7115                 ol_cv_pthread_version=draft4
7116         else
7117                 ol_cv_pthread_version=unknown
7118         fi
7119
7120 fi
7121
7122 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7123
7124
7125                 if test $ol_cv_pthread_version = final ; then
7126                         cat >> confdefs.h <<\EOF
7127 #define HAVE_PTHREADS_FINAL 1
7128 EOF
7129
7130                 elif test $ol_cv_pthread_version = draft4 ; then
7131                         cat >> confdefs.h <<\EOF
7132 #define HAVE_PTHREADS_D4 1
7133 EOF
7134
7135                 else
7136                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7137                 fi
7138
7139                 # consider threads found
7140                 ol_with_threads=found
7141
7142                 
7143         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7144 echo "configure:7145: checking for LinuxThreads pthread.h" >&5
7145 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7146   echo $ac_n "(cached) $ac_c" 1>&6
7147 else
7148   cat > conftest.$ac_ext <<EOF
7149 #line 7150 "configure"
7150 #include "confdefs.h"
7151 #include <pthread.h>
7152 EOF
7153 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7154   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7155   rm -rf conftest*
7156   ol_cv_header_linux_threads=yes
7157 else
7158   rm -rf conftest*
7159   ol_cv_header_linux_threads=no
7160 fi
7161 rm -f conftest*
7162
7163                 
7164 fi
7165
7166 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7167         if test $ol_cv_header_linux_threads = yes; then
7168                 cat >> confdefs.h <<\EOF
7169 #define HAVE_LINUX_THREADS 1
7170 EOF
7171
7172         fi
7173
7174                 
7175         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7176 echo "configure:7177: checking for GNU Pth pthread.h" >&5
7177 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7178   echo $ac_n "(cached) $ac_c" 1>&6
7179 else
7180   cat > conftest.$ac_ext <<EOF
7181 #line 7182 "configure"
7182 #include "confdefs.h"
7183 #include <pthread.h>
7184 #ifdef _POSIX_THREAD_IS_GNU_PTH
7185         __gnu_pth__;
7186 #endif
7187
7188 EOF
7189 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7190   egrep "__gnu_pth__" >/dev/null 2>&1; then
7191   rm -rf conftest*
7192   ol_cv_header_gnu_pth_pthread_h=yes
7193 else
7194   rm -rf conftest*
7195   ol_cv_header_gnu_pth_pthread_h=no
7196 fi
7197 rm -f conftest*
7198
7199                 
7200 fi
7201
7202 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7203
7204
7205                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7206                         for ac_hdr in sched.h
7207 do
7208 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7209 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7210 echo "configure:7211: checking for $ac_hdr" >&5
7211 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7212   echo $ac_n "(cached) $ac_c" 1>&6
7213 else
7214   cat > conftest.$ac_ext <<EOF
7215 #line 7216 "configure"
7216 #include "confdefs.h"
7217 #include <$ac_hdr>
7218 EOF
7219 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7220 { (eval echo configure:7221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7221 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7222 if test -z "$ac_err"; then
7223   rm -rf conftest*
7224   eval "ac_cv_header_$ac_safe=yes"
7225 else
7226   echo "$ac_err" >&5
7227   echo "configure: failed program was:" >&5
7228   cat conftest.$ac_ext >&5
7229   rm -rf conftest*
7230   eval "ac_cv_header_$ac_safe=no"
7231 fi
7232 rm -f conftest*
7233 fi
7234 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7235   echo "$ac_t""yes" 1>&6
7236     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7237   cat >> confdefs.h <<EOF
7238 #define $ac_tr_hdr 1
7239 EOF
7240  
7241 else
7242   echo "$ac_t""no" 1>&6
7243 fi
7244 done
7245
7246                 fi
7247
7248                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7249                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7250 echo "configure:7251: checking for pthread_create in default libraries" >&5
7251 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7252   echo $ac_n "(cached) $ac_c" 1>&6
7253 else
7254   
7255                 if test "$cross_compiling" = yes; then
7256   cat > conftest.$ac_ext <<EOF
7257 #line 7258 "configure"
7258 #include "confdefs.h"
7259 /* pthread test headers */
7260 #include <pthread.h>
7261 #ifndef NULL
7262 #define NULL (void*)0
7263 #endif
7264
7265 static void *task(p)
7266         void *p;
7267 {
7268         return (void *) (p == NULL);
7269 }
7270
7271 int main() {
7272
7273         /* pthread test function */
7274         pthread_t t;
7275         int status;
7276         int detach = 1;
7277
7278 #ifdef HAVE_PTHREADS_FINAL
7279         /* Final pthreads */
7280         pthread_attr_t attr;
7281
7282         status = pthread_attr_init(&attr);
7283         if( status ) return status;
7284
7285 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7286         if( !detach ) {
7287 #if defined( PTHREAD_CREATE_JOINABLE )
7288                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7289 #else
7290                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7291 #endif
7292
7293 #ifdef PTHREAD_CREATE_DETACHED
7294         } else {
7295                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7296 #endif
7297         }
7298         if( status ) return status;
7299 #endif
7300
7301         status = pthread_create( &t, &attr, task, NULL );
7302         if( status ) return status;
7303
7304 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7305         if( detach ) {
7306                 /* give thread a chance to complete */
7307                 /* it should remain joinable and hence detachable */
7308                 sleep( 1 );
7309
7310                 status = pthread_detach( t );
7311                 if( status ) return status;
7312         }
7313 #endif
7314
7315 #else
7316         /* Draft 4 pthreads */
7317         status = pthread_create( &t, pthread_attr_default, task, NULL );
7318         if( status ) return status;
7319
7320         if( detach ) {
7321                 /* give thread a chance to complete */
7322                 /* it should remain joinable and hence detachable */
7323                 sleep( 1 );
7324
7325                 status = pthread_detach( &t );
7326                 if( status ) return status;
7327         }
7328 #endif
7329
7330 #ifdef HAVE_LINUX_THREADS
7331         pthread_kill_other_threads_np();
7332 #endif
7333
7334         return 0;
7335
7336 ; return 0; }
7337 EOF
7338 if { (eval echo configure:7339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7339   rm -rf conftest*
7340   ol_cv_pthread_create=yes
7341 else
7342   echo "configure: failed program was:" >&5
7343   cat conftest.$ac_ext >&5
7344   rm -rf conftest*
7345   ol_cv_pthread_create=no
7346 fi
7347 rm -f conftest*
7348 else
7349   cat > conftest.$ac_ext <<EOF
7350 #line 7351 "configure"
7351 #include "confdefs.h"
7352 /* pthread test headers */
7353 #include <pthread.h>
7354 #ifndef NULL
7355 #define NULL (void*)0
7356 #endif
7357
7358 static void *task(p)
7359         void *p;
7360 {
7361         return (void *) (p == NULL);
7362 }
7363
7364
7365 int main(argc, argv)
7366         int argc;
7367         char **argv;
7368 {
7369
7370         /* pthread test function */
7371         pthread_t t;
7372         int status;
7373         int detach = 1;
7374
7375 #ifdef HAVE_PTHREADS_FINAL
7376         /* Final pthreads */
7377         pthread_attr_t attr;
7378
7379         status = pthread_attr_init(&attr);
7380         if( status ) return status;
7381
7382 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7383         if( !detach ) {
7384 #if defined( PTHREAD_CREATE_JOINABLE )
7385                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7386 #else
7387                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7388 #endif
7389
7390 #ifdef PTHREAD_CREATE_DETACHED
7391         } else {
7392                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7393 #endif
7394         }
7395         if( status ) return status;
7396 #endif
7397
7398         status = pthread_create( &t, &attr, task, NULL );
7399         if( status ) return status;
7400
7401 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7402         if( detach ) {
7403                 /* give thread a chance to complete */
7404                 /* it should remain joinable and hence detachable */
7405                 sleep( 1 );
7406
7407                 status = pthread_detach( t );
7408                 if( status ) return status;
7409         }
7410 #endif
7411
7412 #else
7413         /* Draft 4 pthreads */
7414         status = pthread_create( &t, pthread_attr_default, task, NULL );
7415         if( status ) return status;
7416
7417         if( detach ) {
7418                 /* give thread a chance to complete */
7419                 /* it should remain joinable and hence detachable */
7420                 sleep( 1 );
7421
7422                 status = pthread_detach( &t );
7423                 if( status ) return status;
7424         }
7425 #endif
7426
7427 #ifdef HAVE_LINUX_THREADS
7428         pthread_kill_other_threads_np();
7429 #endif
7430
7431         return 0;
7432
7433 }
7434
7435 EOF
7436 if { (eval echo configure:7437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7437 then
7438   ol_cv_pthread_create=yes
7439 else
7440   echo "configure: failed program was:" >&5
7441   cat conftest.$ac_ext >&5
7442   rm -fr conftest*
7443   ol_cv_pthread_create=no
7444 fi
7445 rm -fr conftest*
7446 fi
7447
7448 fi
7449
7450 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7451
7452                 if test $ol_cv_pthread_create != no ; then
7453                         ol_link_threads=posix
7454                         ol_link_pthreads=""
7455                 fi
7456                 
7457                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7458 if test "$ol_link_threads" = no ; then
7459         # try -kthread
7460         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7461 echo "configure:7462: checking for pthread link with -kthread" >&5
7462 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7463   echo $ac_n "(cached) $ac_c" 1>&6
7464 else
7465   
7466                 # save the flags
7467                 ol_LIBS="$LIBS"
7468                 LIBS="-kthread $LIBS"
7469
7470                 if test "$cross_compiling" = yes; then
7471   cat > conftest.$ac_ext <<EOF
7472 #line 7473 "configure"
7473 #include "confdefs.h"
7474 /* pthread test headers */
7475 #include <pthread.h>
7476 #ifndef NULL
7477 #define NULL (void*)0
7478 #endif
7479
7480 static void *task(p)
7481         void *p;
7482 {
7483         return (void *) (p == NULL);
7484 }
7485
7486 int main() {
7487
7488         /* pthread test function */
7489         pthread_t t;
7490         int status;
7491         int detach = 1;
7492
7493 #ifdef HAVE_PTHREADS_FINAL
7494         /* Final pthreads */
7495         pthread_attr_t attr;
7496
7497         status = pthread_attr_init(&attr);
7498         if( status ) return status;
7499
7500 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7501         if( !detach ) {
7502 #if defined( PTHREAD_CREATE_JOINABLE )
7503                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7504 #else
7505                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7506 #endif
7507
7508 #ifdef PTHREAD_CREATE_DETACHED
7509         } else {
7510                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7511 #endif
7512         }
7513         if( status ) return status;
7514 #endif
7515
7516         status = pthread_create( &t, &attr, task, NULL );
7517         if( status ) return status;
7518
7519 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7520         if( detach ) {
7521                 /* give thread a chance to complete */
7522                 /* it should remain joinable and hence detachable */
7523                 sleep( 1 );
7524
7525                 status = pthread_detach( t );
7526                 if( status ) return status;
7527         }
7528 #endif
7529
7530 #else
7531         /* Draft 4 pthreads */
7532         status = pthread_create( &t, pthread_attr_default, task, NULL );
7533         if( status ) return status;
7534
7535         if( detach ) {
7536                 /* give thread a chance to complete */
7537                 /* it should remain joinable and hence detachable */
7538                 sleep( 1 );
7539
7540                 status = pthread_detach( &t );
7541                 if( status ) return status;
7542         }
7543 #endif
7544
7545 #ifdef HAVE_LINUX_THREADS
7546         pthread_kill_other_threads_np();
7547 #endif
7548
7549         return 0;
7550
7551 ; return 0; }
7552 EOF
7553 if { (eval echo configure:7554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7554   rm -rf conftest*
7555   ol_cv_pthread_kthread=yes
7556 else
7557   echo "configure: failed program was:" >&5
7558   cat conftest.$ac_ext >&5
7559   rm -rf conftest*
7560   ol_cv_pthread_kthread=no
7561 fi
7562 rm -f conftest*
7563 else
7564   cat > conftest.$ac_ext <<EOF
7565 #line 7566 "configure"
7566 #include "confdefs.h"
7567 /* pthread test headers */
7568 #include <pthread.h>
7569 #ifndef NULL
7570 #define NULL (void*)0
7571 #endif
7572
7573 static void *task(p)
7574         void *p;
7575 {
7576         return (void *) (p == NULL);
7577 }
7578
7579
7580 int main(argc, argv)
7581         int argc;
7582         char **argv;
7583 {
7584
7585         /* pthread test function */
7586         pthread_t t;
7587         int status;
7588         int detach = 1;
7589
7590 #ifdef HAVE_PTHREADS_FINAL
7591         /* Final pthreads */
7592         pthread_attr_t attr;
7593
7594         status = pthread_attr_init(&attr);
7595         if( status ) return status;
7596
7597 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7598         if( !detach ) {
7599 #if defined( PTHREAD_CREATE_JOINABLE )
7600                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7601 #else
7602                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7603 #endif
7604
7605 #ifdef PTHREAD_CREATE_DETACHED
7606         } else {
7607                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7608 #endif
7609         }
7610         if( status ) return status;
7611 #endif
7612
7613         status = pthread_create( &t, &attr, task, NULL );
7614         if( status ) return status;
7615
7616 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7617         if( detach ) {
7618                 /* give thread a chance to complete */
7619                 /* it should remain joinable and hence detachable */
7620                 sleep( 1 );
7621
7622                 status = pthread_detach( t );
7623                 if( status ) return status;
7624         }
7625 #endif
7626
7627 #else
7628         /* Draft 4 pthreads */
7629         status = pthread_create( &t, pthread_attr_default, task, NULL );
7630         if( status ) return status;
7631
7632         if( detach ) {
7633                 /* give thread a chance to complete */
7634                 /* it should remain joinable and hence detachable */
7635                 sleep( 1 );
7636
7637                 status = pthread_detach( &t );
7638                 if( status ) return status;
7639         }
7640 #endif
7641
7642 #ifdef HAVE_LINUX_THREADS
7643         pthread_kill_other_threads_np();
7644 #endif
7645
7646         return 0;
7647
7648 }
7649
7650 EOF
7651 if { (eval echo configure:7652: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7652 then
7653   ol_cv_pthread_kthread=yes
7654 else
7655   echo "configure: failed program was:" >&5
7656   cat conftest.$ac_ext >&5
7657   rm -fr conftest*
7658   ol_cv_pthread_kthread=no
7659 fi
7660 rm -fr conftest*
7661 fi
7662
7663
7664                 # restore the LIBS
7665                 LIBS="$ol_LIBS"
7666         
7667 fi
7668
7669 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7670
7671         if test $ol_cv_pthread_kthread = yes ; then
7672                 ol_link_pthreads="-kthread"
7673                 ol_link_threads=posix
7674         fi
7675 fi
7676
7677                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7678 if test "$ol_link_threads" = no ; then
7679         # try -pthread
7680         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7681 echo "configure:7682: checking for pthread link with -pthread" >&5
7682 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7683   echo $ac_n "(cached) $ac_c" 1>&6
7684 else
7685   
7686                 # save the flags
7687                 ol_LIBS="$LIBS"
7688                 LIBS="-pthread $LIBS"
7689
7690                 if test "$cross_compiling" = yes; then
7691   cat > conftest.$ac_ext <<EOF
7692 #line 7693 "configure"
7693 #include "confdefs.h"
7694 /* pthread test headers */
7695 #include <pthread.h>
7696 #ifndef NULL
7697 #define NULL (void*)0
7698 #endif
7699
7700 static void *task(p)
7701         void *p;
7702 {
7703         return (void *) (p == NULL);
7704 }
7705
7706 int main() {
7707
7708         /* pthread test function */
7709         pthread_t t;
7710         int status;
7711         int detach = 1;
7712
7713 #ifdef HAVE_PTHREADS_FINAL
7714         /* Final pthreads */
7715         pthread_attr_t attr;
7716
7717         status = pthread_attr_init(&attr);
7718         if( status ) return status;
7719
7720 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7721         if( !detach ) {
7722 #if defined( PTHREAD_CREATE_JOINABLE )
7723                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7724 #else
7725                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7726 #endif
7727
7728 #ifdef PTHREAD_CREATE_DETACHED
7729         } else {
7730                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7731 #endif
7732         }
7733         if( status ) return status;
7734 #endif
7735
7736         status = pthread_create( &t, &attr, task, NULL );
7737         if( status ) return status;
7738
7739 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7740         if( detach ) {
7741                 /* give thread a chance to complete */
7742                 /* it should remain joinable and hence detachable */
7743                 sleep( 1 );
7744
7745                 status = pthread_detach( t );
7746                 if( status ) return status;
7747         }
7748 #endif
7749
7750 #else
7751         /* Draft 4 pthreads */
7752         status = pthread_create( &t, pthread_attr_default, task, NULL );
7753         if( status ) return status;
7754
7755         if( detach ) {
7756                 /* give thread a chance to complete */
7757                 /* it should remain joinable and hence detachable */
7758                 sleep( 1 );
7759
7760                 status = pthread_detach( &t );
7761                 if( status ) return status;
7762         }
7763 #endif
7764
7765 #ifdef HAVE_LINUX_THREADS
7766         pthread_kill_other_threads_np();
7767 #endif
7768
7769         return 0;
7770
7771 ; return 0; }
7772 EOF
7773 if { (eval echo configure:7774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7774   rm -rf conftest*
7775   ol_cv_pthread_pthread=yes
7776 else
7777   echo "configure: failed program was:" >&5
7778   cat conftest.$ac_ext >&5
7779   rm -rf conftest*
7780   ol_cv_pthread_pthread=no
7781 fi
7782 rm -f conftest*
7783 else
7784   cat > conftest.$ac_ext <<EOF
7785 #line 7786 "configure"
7786 #include "confdefs.h"
7787 /* pthread test headers */
7788 #include <pthread.h>
7789 #ifndef NULL
7790 #define NULL (void*)0
7791 #endif
7792
7793 static void *task(p)
7794         void *p;
7795 {
7796         return (void *) (p == NULL);
7797 }
7798
7799
7800 int main(argc, argv)
7801         int argc;
7802         char **argv;
7803 {
7804
7805         /* pthread test function */
7806         pthread_t t;
7807         int status;
7808         int detach = 1;
7809
7810 #ifdef HAVE_PTHREADS_FINAL
7811         /* Final pthreads */
7812         pthread_attr_t attr;
7813
7814         status = pthread_attr_init(&attr);
7815         if( status ) return status;
7816
7817 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7818         if( !detach ) {
7819 #if defined( PTHREAD_CREATE_JOINABLE )
7820                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7821 #else
7822                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7823 #endif
7824
7825 #ifdef PTHREAD_CREATE_DETACHED
7826         } else {
7827                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7828 #endif
7829         }
7830         if( status ) return status;
7831 #endif
7832
7833         status = pthread_create( &t, &attr, task, NULL );
7834         if( status ) return status;
7835
7836 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7837         if( detach ) {
7838                 /* give thread a chance to complete */
7839                 /* it should remain joinable and hence detachable */
7840                 sleep( 1 );
7841
7842                 status = pthread_detach( t );
7843                 if( status ) return status;
7844         }
7845 #endif
7846
7847 #else
7848         /* Draft 4 pthreads */
7849         status = pthread_create( &t, pthread_attr_default, task, NULL );
7850         if( status ) return status;
7851
7852         if( detach ) {
7853                 /* give thread a chance to complete */
7854                 /* it should remain joinable and hence detachable */
7855                 sleep( 1 );
7856
7857                 status = pthread_detach( &t );
7858                 if( status ) return status;
7859         }
7860 #endif
7861
7862 #ifdef HAVE_LINUX_THREADS
7863         pthread_kill_other_threads_np();
7864 #endif
7865
7866         return 0;
7867
7868 }
7869
7870 EOF
7871 if { (eval echo configure:7872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7872 then
7873   ol_cv_pthread_pthread=yes
7874 else
7875   echo "configure: failed program was:" >&5
7876   cat conftest.$ac_ext >&5
7877   rm -fr conftest*
7878   ol_cv_pthread_pthread=no
7879 fi
7880 rm -fr conftest*
7881 fi
7882
7883
7884                 # restore the LIBS
7885                 LIBS="$ol_LIBS"
7886         
7887 fi
7888
7889 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7890
7891         if test $ol_cv_pthread_pthread = yes ; then
7892                 ol_link_pthreads="-pthread"
7893                 ol_link_threads=posix
7894         fi
7895 fi
7896
7897                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7898 if test "$ol_link_threads" = no ; then
7899         # try -pthreads
7900         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7901 echo "configure:7902: checking for pthread link with -pthreads" >&5
7902 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7903   echo $ac_n "(cached) $ac_c" 1>&6
7904 else
7905   
7906                 # save the flags
7907                 ol_LIBS="$LIBS"
7908                 LIBS="-pthreads $LIBS"
7909
7910                 if test "$cross_compiling" = yes; then
7911   cat > conftest.$ac_ext <<EOF
7912 #line 7913 "configure"
7913 #include "confdefs.h"
7914 /* pthread test headers */
7915 #include <pthread.h>
7916 #ifndef NULL
7917 #define NULL (void*)0
7918 #endif
7919
7920 static void *task(p)
7921         void *p;
7922 {
7923         return (void *) (p == NULL);
7924 }
7925
7926 int main() {
7927
7928         /* pthread test function */
7929         pthread_t t;
7930         int status;
7931         int detach = 1;
7932
7933 #ifdef HAVE_PTHREADS_FINAL
7934         /* Final pthreads */
7935         pthread_attr_t attr;
7936
7937         status = pthread_attr_init(&attr);
7938         if( status ) return status;
7939
7940 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7941         if( !detach ) {
7942 #if defined( PTHREAD_CREATE_JOINABLE )
7943                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7944 #else
7945                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7946 #endif
7947
7948 #ifdef PTHREAD_CREATE_DETACHED
7949         } else {
7950                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7951 #endif
7952         }
7953         if( status ) return status;
7954 #endif
7955
7956         status = pthread_create( &t, &attr, task, NULL );
7957         if( status ) return status;
7958
7959 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7960         if( detach ) {
7961                 /* give thread a chance to complete */
7962                 /* it should remain joinable and hence detachable */
7963                 sleep( 1 );
7964
7965                 status = pthread_detach( t );
7966                 if( status ) return status;
7967         }
7968 #endif
7969
7970 #else
7971         /* Draft 4 pthreads */
7972         status = pthread_create( &t, pthread_attr_default, task, NULL );
7973         if( status ) return status;
7974
7975         if( detach ) {
7976                 /* give thread a chance to complete */
7977                 /* it should remain joinable and hence detachable */
7978                 sleep( 1 );
7979
7980                 status = pthread_detach( &t );
7981                 if( status ) return status;
7982         }
7983 #endif
7984
7985 #ifdef HAVE_LINUX_THREADS
7986         pthread_kill_other_threads_np();
7987 #endif
7988
7989         return 0;
7990
7991 ; return 0; }
7992 EOF
7993 if { (eval echo configure:7994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7994   rm -rf conftest*
7995   ol_cv_pthread_pthreads=yes
7996 else
7997   echo "configure: failed program was:" >&5
7998   cat conftest.$ac_ext >&5
7999   rm -rf conftest*
8000   ol_cv_pthread_pthreads=no
8001 fi
8002 rm -f conftest*
8003 else
8004   cat > conftest.$ac_ext <<EOF
8005 #line 8006 "configure"
8006 #include "confdefs.h"
8007 /* pthread test headers */
8008 #include <pthread.h>
8009 #ifndef NULL
8010 #define NULL (void*)0
8011 #endif
8012
8013 static void *task(p)
8014         void *p;
8015 {
8016         return (void *) (p == NULL);
8017 }
8018
8019
8020 int main(argc, argv)
8021         int argc;
8022         char **argv;
8023 {
8024
8025         /* pthread test function */
8026         pthread_t t;
8027         int status;
8028         int detach = 1;
8029
8030 #ifdef HAVE_PTHREADS_FINAL
8031         /* Final pthreads */
8032         pthread_attr_t attr;
8033
8034         status = pthread_attr_init(&attr);
8035         if( status ) return status;
8036
8037 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8038         if( !detach ) {
8039 #if defined( PTHREAD_CREATE_JOINABLE )
8040                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8041 #else
8042                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8043 #endif
8044
8045 #ifdef PTHREAD_CREATE_DETACHED
8046         } else {
8047                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8048 #endif
8049         }
8050         if( status ) return status;
8051 #endif
8052
8053         status = pthread_create( &t, &attr, task, NULL );
8054         if( status ) return status;
8055
8056 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8057         if( detach ) {
8058                 /* give thread a chance to complete */
8059                 /* it should remain joinable and hence detachable */
8060                 sleep( 1 );
8061
8062                 status = pthread_detach( t );
8063                 if( status ) return status;
8064         }
8065 #endif
8066
8067 #else
8068         /* Draft 4 pthreads */
8069         status = pthread_create( &t, pthread_attr_default, task, NULL );
8070         if( status ) return status;
8071
8072         if( detach ) {
8073                 /* give thread a chance to complete */
8074                 /* it should remain joinable and hence detachable */
8075                 sleep( 1 );
8076
8077                 status = pthread_detach( &t );
8078                 if( status ) return status;
8079         }
8080 #endif
8081
8082 #ifdef HAVE_LINUX_THREADS
8083         pthread_kill_other_threads_np();
8084 #endif
8085
8086         return 0;
8087
8088 }
8089
8090 EOF
8091 if { (eval echo configure:8092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8092 then
8093   ol_cv_pthread_pthreads=yes
8094 else
8095   echo "configure: failed program was:" >&5
8096   cat conftest.$ac_ext >&5
8097   rm -fr conftest*
8098   ol_cv_pthread_pthreads=no
8099 fi
8100 rm -fr conftest*
8101 fi
8102
8103
8104                 # restore the LIBS
8105                 LIBS="$ol_LIBS"
8106         
8107 fi
8108
8109 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8110
8111         if test $ol_cv_pthread_pthreads = yes ; then
8112                 ol_link_pthreads="-pthreads"
8113                 ol_link_threads=posix
8114         fi
8115 fi
8116
8117                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8118 if test "$ol_link_threads" = no ; then
8119         # try -mthreads
8120         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8121 echo "configure:8122: checking for pthread link with -mthreads" >&5
8122 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8123   echo $ac_n "(cached) $ac_c" 1>&6
8124 else
8125   
8126                 # save the flags
8127                 ol_LIBS="$LIBS"
8128                 LIBS="-mthreads $LIBS"
8129
8130                 if test "$cross_compiling" = yes; then
8131   cat > conftest.$ac_ext <<EOF
8132 #line 8133 "configure"
8133 #include "confdefs.h"
8134 /* pthread test headers */
8135 #include <pthread.h>
8136 #ifndef NULL
8137 #define NULL (void*)0
8138 #endif
8139
8140 static void *task(p)
8141         void *p;
8142 {
8143         return (void *) (p == NULL);
8144 }
8145
8146 int main() {
8147
8148         /* pthread test function */
8149         pthread_t t;
8150         int status;
8151         int detach = 1;
8152
8153 #ifdef HAVE_PTHREADS_FINAL
8154         /* Final pthreads */
8155         pthread_attr_t attr;
8156
8157         status = pthread_attr_init(&attr);
8158         if( status ) return status;
8159
8160 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8161         if( !detach ) {
8162 #if defined( PTHREAD_CREATE_JOINABLE )
8163                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8164 #else
8165                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8166 #endif
8167
8168 #ifdef PTHREAD_CREATE_DETACHED
8169         } else {
8170                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8171 #endif
8172         }
8173         if( status ) return status;
8174 #endif
8175
8176         status = pthread_create( &t, &attr, task, NULL );
8177         if( status ) return status;
8178
8179 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8180         if( detach ) {
8181                 /* give thread a chance to complete */
8182                 /* it should remain joinable and hence detachable */
8183                 sleep( 1 );
8184
8185                 status = pthread_detach( t );
8186                 if( status ) return status;
8187         }
8188 #endif
8189
8190 #else
8191         /* Draft 4 pthreads */
8192         status = pthread_create( &t, pthread_attr_default, task, NULL );
8193         if( status ) return status;
8194
8195         if( detach ) {
8196                 /* give thread a chance to complete */
8197                 /* it should remain joinable and hence detachable */
8198                 sleep( 1 );
8199
8200                 status = pthread_detach( &t );
8201                 if( status ) return status;
8202         }
8203 #endif
8204
8205 #ifdef HAVE_LINUX_THREADS
8206         pthread_kill_other_threads_np();
8207 #endif
8208
8209         return 0;
8210
8211 ; return 0; }
8212 EOF
8213 if { (eval echo configure:8214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8214   rm -rf conftest*
8215   ol_cv_pthread_mthreads=yes
8216 else
8217   echo "configure: failed program was:" >&5
8218   cat conftest.$ac_ext >&5
8219   rm -rf conftest*
8220   ol_cv_pthread_mthreads=no
8221 fi
8222 rm -f conftest*
8223 else
8224   cat > conftest.$ac_ext <<EOF
8225 #line 8226 "configure"
8226 #include "confdefs.h"
8227 /* pthread test headers */
8228 #include <pthread.h>
8229 #ifndef NULL
8230 #define NULL (void*)0
8231 #endif
8232
8233 static void *task(p)
8234         void *p;
8235 {
8236         return (void *) (p == NULL);
8237 }
8238
8239
8240 int main(argc, argv)
8241         int argc;
8242         char **argv;
8243 {
8244
8245         /* pthread test function */
8246         pthread_t t;
8247         int status;
8248         int detach = 1;
8249
8250 #ifdef HAVE_PTHREADS_FINAL
8251         /* Final pthreads */
8252         pthread_attr_t attr;
8253
8254         status = pthread_attr_init(&attr);
8255         if( status ) return status;
8256
8257 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8258         if( !detach ) {
8259 #if defined( PTHREAD_CREATE_JOINABLE )
8260                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8261 #else
8262                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8263 #endif
8264
8265 #ifdef PTHREAD_CREATE_DETACHED
8266         } else {
8267                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8268 #endif
8269         }
8270         if( status ) return status;
8271 #endif
8272
8273         status = pthread_create( &t, &attr, task, NULL );
8274         if( status ) return status;
8275
8276 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8277         if( detach ) {
8278                 /* give thread a chance to complete */
8279                 /* it should remain joinable and hence detachable */
8280                 sleep( 1 );
8281
8282                 status = pthread_detach( t );
8283                 if( status ) return status;
8284         }
8285 #endif
8286
8287 #else
8288         /* Draft 4 pthreads */
8289         status = pthread_create( &t, pthread_attr_default, task, NULL );
8290         if( status ) return status;
8291
8292         if( detach ) {
8293                 /* give thread a chance to complete */
8294                 /* it should remain joinable and hence detachable */
8295                 sleep( 1 );
8296
8297                 status = pthread_detach( &t );
8298                 if( status ) return status;
8299         }
8300 #endif
8301
8302 #ifdef HAVE_LINUX_THREADS
8303         pthread_kill_other_threads_np();
8304 #endif
8305
8306         return 0;
8307
8308 }
8309
8310 EOF
8311 if { (eval echo configure:8312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8312 then
8313   ol_cv_pthread_mthreads=yes
8314 else
8315   echo "configure: failed program was:" >&5
8316   cat conftest.$ac_ext >&5
8317   rm -fr conftest*
8318   ol_cv_pthread_mthreads=no
8319 fi
8320 rm -fr conftest*
8321 fi
8322
8323
8324                 # restore the LIBS
8325                 LIBS="$ol_LIBS"
8326         
8327 fi
8328
8329 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8330
8331         if test $ol_cv_pthread_mthreads = yes ; then
8332                 ol_link_pthreads="-mthreads"
8333                 ol_link_threads=posix
8334         fi
8335 fi
8336
8337                 # Pthread try link: -thread (ol_cv_pthread_thread)
8338 if test "$ol_link_threads" = no ; then
8339         # try -thread
8340         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8341 echo "configure:8342: checking for pthread link with -thread" >&5
8342 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8343   echo $ac_n "(cached) $ac_c" 1>&6
8344 else
8345   
8346                 # save the flags
8347                 ol_LIBS="$LIBS"
8348                 LIBS="-thread $LIBS"
8349
8350                 if test "$cross_compiling" = yes; then
8351   cat > conftest.$ac_ext <<EOF
8352 #line 8353 "configure"
8353 #include "confdefs.h"
8354 /* pthread test headers */
8355 #include <pthread.h>
8356 #ifndef NULL
8357 #define NULL (void*)0
8358 #endif
8359
8360 static void *task(p)
8361         void *p;
8362 {
8363         return (void *) (p == NULL);
8364 }
8365
8366 int main() {
8367
8368         /* pthread test function */
8369         pthread_t t;
8370         int status;
8371         int detach = 1;
8372
8373 #ifdef HAVE_PTHREADS_FINAL
8374         /* Final pthreads */
8375         pthread_attr_t attr;
8376
8377         status = pthread_attr_init(&attr);
8378         if( status ) return status;
8379
8380 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8381         if( !detach ) {
8382 #if defined( PTHREAD_CREATE_JOINABLE )
8383                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8384 #else
8385                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8386 #endif
8387
8388 #ifdef PTHREAD_CREATE_DETACHED
8389         } else {
8390                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8391 #endif
8392         }
8393         if( status ) return status;
8394 #endif
8395
8396         status = pthread_create( &t, &attr, task, NULL );
8397         if( status ) return status;
8398
8399 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8400         if( detach ) {
8401                 /* give thread a chance to complete */
8402                 /* it should remain joinable and hence detachable */
8403                 sleep( 1 );
8404
8405                 status = pthread_detach( t );
8406                 if( status ) return status;
8407         }
8408 #endif
8409
8410 #else
8411         /* Draft 4 pthreads */
8412         status = pthread_create( &t, pthread_attr_default, task, NULL );
8413         if( status ) return status;
8414
8415         if( detach ) {
8416                 /* give thread a chance to complete */
8417                 /* it should remain joinable and hence detachable */
8418                 sleep( 1 );
8419
8420                 status = pthread_detach( &t );
8421                 if( status ) return status;
8422         }
8423 #endif
8424
8425 #ifdef HAVE_LINUX_THREADS
8426         pthread_kill_other_threads_np();
8427 #endif
8428
8429         return 0;
8430
8431 ; return 0; }
8432 EOF
8433 if { (eval echo configure:8434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8434   rm -rf conftest*
8435   ol_cv_pthread_thread=yes
8436 else
8437   echo "configure: failed program was:" >&5
8438   cat conftest.$ac_ext >&5
8439   rm -rf conftest*
8440   ol_cv_pthread_thread=no
8441 fi
8442 rm -f conftest*
8443 else
8444   cat > conftest.$ac_ext <<EOF
8445 #line 8446 "configure"
8446 #include "confdefs.h"
8447 /* pthread test headers */
8448 #include <pthread.h>
8449 #ifndef NULL
8450 #define NULL (void*)0
8451 #endif
8452
8453 static void *task(p)
8454         void *p;
8455 {
8456         return (void *) (p == NULL);
8457 }
8458
8459
8460 int main(argc, argv)
8461         int argc;
8462         char **argv;
8463 {
8464
8465         /* pthread test function */
8466         pthread_t t;
8467         int status;
8468         int detach = 1;
8469
8470 #ifdef HAVE_PTHREADS_FINAL
8471         /* Final pthreads */
8472         pthread_attr_t attr;
8473
8474         status = pthread_attr_init(&attr);
8475         if( status ) return status;
8476
8477 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8478         if( !detach ) {
8479 #if defined( PTHREAD_CREATE_JOINABLE )
8480                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8481 #else
8482                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8483 #endif
8484
8485 #ifdef PTHREAD_CREATE_DETACHED
8486         } else {
8487                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8488 #endif
8489         }
8490         if( status ) return status;
8491 #endif
8492
8493         status = pthread_create( &t, &attr, task, NULL );
8494         if( status ) return status;
8495
8496 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8497         if( detach ) {
8498                 /* give thread a chance to complete */
8499                 /* it should remain joinable and hence detachable */
8500                 sleep( 1 );
8501
8502                 status = pthread_detach( t );
8503                 if( status ) return status;
8504         }
8505 #endif
8506
8507 #else
8508         /* Draft 4 pthreads */
8509         status = pthread_create( &t, pthread_attr_default, task, NULL );
8510         if( status ) return status;
8511
8512         if( detach ) {
8513                 /* give thread a chance to complete */
8514                 /* it should remain joinable and hence detachable */
8515                 sleep( 1 );
8516
8517                 status = pthread_detach( &t );
8518                 if( status ) return status;
8519         }
8520 #endif
8521
8522 #ifdef HAVE_LINUX_THREADS
8523         pthread_kill_other_threads_np();
8524 #endif
8525
8526         return 0;
8527
8528 }
8529
8530 EOF
8531 if { (eval echo configure:8532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8532 then
8533   ol_cv_pthread_thread=yes
8534 else
8535   echo "configure: failed program was:" >&5
8536   cat conftest.$ac_ext >&5
8537   rm -fr conftest*
8538   ol_cv_pthread_thread=no
8539 fi
8540 rm -fr conftest*
8541 fi
8542
8543
8544                 # restore the LIBS
8545                 LIBS="$ol_LIBS"
8546         
8547 fi
8548
8549 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8550
8551         if test $ol_cv_pthread_thread = yes ; then
8552                 ol_link_pthreads="-thread"
8553                 ol_link_threads=posix
8554         fi
8555 fi
8556
8557
8558                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8559 if test "$ol_link_threads" = no ; then
8560         # try -lpthread -lmach -lexc -lc_r
8561         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8562 echo "configure:8563: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8563 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8564   echo $ac_n "(cached) $ac_c" 1>&6
8565 else
8566   
8567                 # save the flags
8568                 ol_LIBS="$LIBS"
8569                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8570
8571                 if test "$cross_compiling" = yes; then
8572   cat > conftest.$ac_ext <<EOF
8573 #line 8574 "configure"
8574 #include "confdefs.h"
8575 /* pthread test headers */
8576 #include <pthread.h>
8577 #ifndef NULL
8578 #define NULL (void*)0
8579 #endif
8580
8581 static void *task(p)
8582         void *p;
8583 {
8584         return (void *) (p == NULL);
8585 }
8586
8587 int main() {
8588
8589         /* pthread test function */
8590         pthread_t t;
8591         int status;
8592         int detach = 1;
8593
8594 #ifdef HAVE_PTHREADS_FINAL
8595         /* Final pthreads */
8596         pthread_attr_t attr;
8597
8598         status = pthread_attr_init(&attr);
8599         if( status ) return status;
8600
8601 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8602         if( !detach ) {
8603 #if defined( PTHREAD_CREATE_JOINABLE )
8604                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8605 #else
8606                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8607 #endif
8608
8609 #ifdef PTHREAD_CREATE_DETACHED
8610         } else {
8611                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8612 #endif
8613         }
8614         if( status ) return status;
8615 #endif
8616
8617         status = pthread_create( &t, &attr, task, NULL );
8618         if( status ) return status;
8619
8620 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8621         if( detach ) {
8622                 /* give thread a chance to complete */
8623                 /* it should remain joinable and hence detachable */
8624                 sleep( 1 );
8625
8626                 status = pthread_detach( t );
8627                 if( status ) return status;
8628         }
8629 #endif
8630
8631 #else
8632         /* Draft 4 pthreads */
8633         status = pthread_create( &t, pthread_attr_default, task, NULL );
8634         if( status ) return status;
8635
8636         if( detach ) {
8637                 /* give thread a chance to complete */
8638                 /* it should remain joinable and hence detachable */
8639                 sleep( 1 );
8640
8641                 status = pthread_detach( &t );
8642                 if( status ) return status;
8643         }
8644 #endif
8645
8646 #ifdef HAVE_LINUX_THREADS
8647         pthread_kill_other_threads_np();
8648 #endif
8649
8650         return 0;
8651
8652 ; return 0; }
8653 EOF
8654 if { (eval echo configure:8655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8655   rm -rf conftest*
8656   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8657 else
8658   echo "configure: failed program was:" >&5
8659   cat conftest.$ac_ext >&5
8660   rm -rf conftest*
8661   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8662 fi
8663 rm -f conftest*
8664 else
8665   cat > conftest.$ac_ext <<EOF
8666 #line 8667 "configure"
8667 #include "confdefs.h"
8668 /* pthread test headers */
8669 #include <pthread.h>
8670 #ifndef NULL
8671 #define NULL (void*)0
8672 #endif
8673
8674 static void *task(p)
8675         void *p;
8676 {
8677         return (void *) (p == NULL);
8678 }
8679
8680
8681 int main(argc, argv)
8682         int argc;
8683         char **argv;
8684 {
8685
8686         /* pthread test function */
8687         pthread_t t;
8688         int status;
8689         int detach = 1;
8690
8691 #ifdef HAVE_PTHREADS_FINAL
8692         /* Final pthreads */
8693         pthread_attr_t attr;
8694
8695         status = pthread_attr_init(&attr);
8696         if( status ) return status;
8697
8698 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8699         if( !detach ) {
8700 #if defined( PTHREAD_CREATE_JOINABLE )
8701                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8702 #else
8703                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8704 #endif
8705
8706 #ifdef PTHREAD_CREATE_DETACHED
8707         } else {
8708                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8709 #endif
8710         }
8711         if( status ) return status;
8712 #endif
8713
8714         status = pthread_create( &t, &attr, task, NULL );
8715         if( status ) return status;
8716
8717 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8718         if( detach ) {
8719                 /* give thread a chance to complete */
8720                 /* it should remain joinable and hence detachable */
8721                 sleep( 1 );
8722
8723                 status = pthread_detach( t );
8724                 if( status ) return status;
8725         }
8726 #endif
8727
8728 #else
8729         /* Draft 4 pthreads */
8730         status = pthread_create( &t, pthread_attr_default, task, NULL );
8731         if( status ) return status;
8732
8733         if( detach ) {
8734                 /* give thread a chance to complete */
8735                 /* it should remain joinable and hence detachable */
8736                 sleep( 1 );
8737
8738                 status = pthread_detach( &t );
8739                 if( status ) return status;
8740         }
8741 #endif
8742
8743 #ifdef HAVE_LINUX_THREADS
8744         pthread_kill_other_threads_np();
8745 #endif
8746
8747         return 0;
8748
8749 }
8750
8751 EOF
8752 if { (eval echo configure:8753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8753 then
8754   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8755 else
8756   echo "configure: failed program was:" >&5
8757   cat conftest.$ac_ext >&5
8758   rm -fr conftest*
8759   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8760 fi
8761 rm -fr conftest*
8762 fi
8763
8764
8765                 # restore the LIBS
8766                 LIBS="$ol_LIBS"
8767         
8768 fi
8769
8770 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8771
8772         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8773                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8774                 ol_link_threads=posix
8775         fi
8776 fi
8777
8778                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8779 if test "$ol_link_threads" = no ; then
8780         # try -lpthread -lmach -lexc
8781         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8782 echo "configure:8783: checking for pthread link with -lpthread -lmach -lexc" >&5
8783 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8784   echo $ac_n "(cached) $ac_c" 1>&6
8785 else
8786   
8787                 # save the flags
8788                 ol_LIBS="$LIBS"
8789                 LIBS="-lpthread -lmach -lexc $LIBS"
8790
8791                 if test "$cross_compiling" = yes; then
8792   cat > conftest.$ac_ext <<EOF
8793 #line 8794 "configure"
8794 #include "confdefs.h"
8795 /* pthread test headers */
8796 #include <pthread.h>
8797 #ifndef NULL
8798 #define NULL (void*)0
8799 #endif
8800
8801 static void *task(p)
8802         void *p;
8803 {
8804         return (void *) (p == NULL);
8805 }
8806
8807 int main() {
8808
8809         /* pthread test function */
8810         pthread_t t;
8811         int status;
8812         int detach = 1;
8813
8814 #ifdef HAVE_PTHREADS_FINAL
8815         /* Final pthreads */
8816         pthread_attr_t attr;
8817
8818         status = pthread_attr_init(&attr);
8819         if( status ) return status;
8820
8821 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8822         if( !detach ) {
8823 #if defined( PTHREAD_CREATE_JOINABLE )
8824                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8825 #else
8826                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8827 #endif
8828
8829 #ifdef PTHREAD_CREATE_DETACHED
8830         } else {
8831                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8832 #endif
8833         }
8834         if( status ) return status;
8835 #endif
8836
8837         status = pthread_create( &t, &attr, task, NULL );
8838         if( status ) return status;
8839
8840 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8841         if( detach ) {
8842                 /* give thread a chance to complete */
8843                 /* it should remain joinable and hence detachable */
8844                 sleep( 1 );
8845
8846                 status = pthread_detach( t );
8847                 if( status ) return status;
8848         }
8849 #endif
8850
8851 #else
8852         /* Draft 4 pthreads */
8853         status = pthread_create( &t, pthread_attr_default, task, NULL );
8854         if( status ) return status;
8855
8856         if( detach ) {
8857                 /* give thread a chance to complete */
8858                 /* it should remain joinable and hence detachable */
8859                 sleep( 1 );
8860
8861                 status = pthread_detach( &t );
8862                 if( status ) return status;
8863         }
8864 #endif
8865
8866 #ifdef HAVE_LINUX_THREADS
8867         pthread_kill_other_threads_np();
8868 #endif
8869
8870         return 0;
8871
8872 ; return 0; }
8873 EOF
8874 if { (eval echo configure:8875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8875   rm -rf conftest*
8876   ol_cv_pthread_lpthread_lmach_lexc=yes
8877 else
8878   echo "configure: failed program was:" >&5
8879   cat conftest.$ac_ext >&5
8880   rm -rf conftest*
8881   ol_cv_pthread_lpthread_lmach_lexc=no
8882 fi
8883 rm -f conftest*
8884 else
8885   cat > conftest.$ac_ext <<EOF
8886 #line 8887 "configure"
8887 #include "confdefs.h"
8888 /* pthread test headers */
8889 #include <pthread.h>
8890 #ifndef NULL
8891 #define NULL (void*)0
8892 #endif
8893
8894 static void *task(p)
8895         void *p;
8896 {
8897         return (void *) (p == NULL);
8898 }
8899
8900
8901 int main(argc, argv)
8902         int argc;
8903         char **argv;
8904 {
8905
8906         /* pthread test function */
8907         pthread_t t;
8908         int status;
8909         int detach = 1;
8910
8911 #ifdef HAVE_PTHREADS_FINAL
8912         /* Final pthreads */
8913         pthread_attr_t attr;
8914
8915         status = pthread_attr_init(&attr);
8916         if( status ) return status;
8917
8918 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8919         if( !detach ) {
8920 #if defined( PTHREAD_CREATE_JOINABLE )
8921                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8922 #else
8923                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8924 #endif
8925
8926 #ifdef PTHREAD_CREATE_DETACHED
8927         } else {
8928                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8929 #endif
8930         }
8931         if( status ) return status;
8932 #endif
8933
8934         status = pthread_create( &t, &attr, task, NULL );
8935         if( status ) return status;
8936
8937 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8938         if( detach ) {
8939                 /* give thread a chance to complete */
8940                 /* it should remain joinable and hence detachable */
8941                 sleep( 1 );
8942
8943                 status = pthread_detach( t );
8944                 if( status ) return status;
8945         }
8946 #endif
8947
8948 #else
8949         /* Draft 4 pthreads */
8950         status = pthread_create( &t, pthread_attr_default, task, NULL );
8951         if( status ) return status;
8952
8953         if( detach ) {
8954                 /* give thread a chance to complete */
8955                 /* it should remain joinable and hence detachable */
8956                 sleep( 1 );
8957
8958                 status = pthread_detach( &t );
8959                 if( status ) return status;
8960         }
8961 #endif
8962
8963 #ifdef HAVE_LINUX_THREADS
8964         pthread_kill_other_threads_np();
8965 #endif
8966
8967         return 0;
8968
8969 }
8970
8971 EOF
8972 if { (eval echo configure:8973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8973 then
8974   ol_cv_pthread_lpthread_lmach_lexc=yes
8975 else
8976   echo "configure: failed program was:" >&5
8977   cat conftest.$ac_ext >&5
8978   rm -fr conftest*
8979   ol_cv_pthread_lpthread_lmach_lexc=no
8980 fi
8981 rm -fr conftest*
8982 fi
8983
8984
8985                 # restore the LIBS
8986                 LIBS="$ol_LIBS"
8987         
8988 fi
8989
8990 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8991
8992         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8993                 ol_link_pthreads="-lpthread -lmach -lexc"
8994                 ol_link_threads=posix
8995         fi
8996 fi
8997
8998
8999                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9000 if test "$ol_link_threads" = no ; then
9001         # try -lpthread -Wl,-woff,85
9002         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9003 echo "configure:9004: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9004 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9005   echo $ac_n "(cached) $ac_c" 1>&6
9006 else
9007   
9008                 # save the flags
9009                 ol_LIBS="$LIBS"
9010                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9011
9012                 if test "$cross_compiling" = yes; then
9013   cat > conftest.$ac_ext <<EOF
9014 #line 9015 "configure"
9015 #include "confdefs.h"
9016 /* pthread test headers */
9017 #include <pthread.h>
9018 #ifndef NULL
9019 #define NULL (void*)0
9020 #endif
9021
9022 static void *task(p)
9023         void *p;
9024 {
9025         return (void *) (p == NULL);
9026 }
9027
9028 int main() {
9029
9030         /* pthread test function */
9031         pthread_t t;
9032         int status;
9033         int detach = 1;
9034
9035 #ifdef HAVE_PTHREADS_FINAL
9036         /* Final pthreads */
9037         pthread_attr_t attr;
9038
9039         status = pthread_attr_init(&attr);
9040         if( status ) return status;
9041
9042 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9043         if( !detach ) {
9044 #if defined( PTHREAD_CREATE_JOINABLE )
9045                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9046 #else
9047                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9048 #endif
9049
9050 #ifdef PTHREAD_CREATE_DETACHED
9051         } else {
9052                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9053 #endif
9054         }
9055         if( status ) return status;
9056 #endif
9057
9058         status = pthread_create( &t, &attr, task, NULL );
9059         if( status ) return status;
9060
9061 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9062         if( detach ) {
9063                 /* give thread a chance to complete */
9064                 /* it should remain joinable and hence detachable */
9065                 sleep( 1 );
9066
9067                 status = pthread_detach( t );
9068                 if( status ) return status;
9069         }
9070 #endif
9071
9072 #else
9073         /* Draft 4 pthreads */
9074         status = pthread_create( &t, pthread_attr_default, task, NULL );
9075         if( status ) return status;
9076
9077         if( detach ) {
9078                 /* give thread a chance to complete */
9079                 /* it should remain joinable and hence detachable */
9080                 sleep( 1 );
9081
9082                 status = pthread_detach( &t );
9083                 if( status ) return status;
9084         }
9085 #endif
9086
9087 #ifdef HAVE_LINUX_THREADS
9088         pthread_kill_other_threads_np();
9089 #endif
9090
9091         return 0;
9092
9093 ; return 0; }
9094 EOF
9095 if { (eval echo configure:9096: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9096   rm -rf conftest*
9097   ol_cv_pthread_lib_lpthread_woff=yes
9098 else
9099   echo "configure: failed program was:" >&5
9100   cat conftest.$ac_ext >&5
9101   rm -rf conftest*
9102   ol_cv_pthread_lib_lpthread_woff=no
9103 fi
9104 rm -f conftest*
9105 else
9106   cat > conftest.$ac_ext <<EOF
9107 #line 9108 "configure"
9108 #include "confdefs.h"
9109 /* pthread test headers */
9110 #include <pthread.h>
9111 #ifndef NULL
9112 #define NULL (void*)0
9113 #endif
9114
9115 static void *task(p)
9116         void *p;
9117 {
9118         return (void *) (p == NULL);
9119 }
9120
9121
9122 int main(argc, argv)
9123         int argc;
9124         char **argv;
9125 {
9126
9127         /* pthread test function */
9128         pthread_t t;
9129         int status;
9130         int detach = 1;
9131
9132 #ifdef HAVE_PTHREADS_FINAL
9133         /* Final pthreads */
9134         pthread_attr_t attr;
9135
9136         status = pthread_attr_init(&attr);
9137         if( status ) return status;
9138
9139 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9140         if( !detach ) {
9141 #if defined( PTHREAD_CREATE_JOINABLE )
9142                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9143 #else
9144                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9145 #endif
9146
9147 #ifdef PTHREAD_CREATE_DETACHED
9148         } else {
9149                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9150 #endif
9151         }
9152         if( status ) return status;
9153 #endif
9154
9155         status = pthread_create( &t, &attr, task, NULL );
9156         if( status ) return status;
9157
9158 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9159         if( detach ) {
9160                 /* give thread a chance to complete */
9161                 /* it should remain joinable and hence detachable */
9162                 sleep( 1 );
9163
9164                 status = pthread_detach( t );
9165                 if( status ) return status;
9166         }
9167 #endif
9168
9169 #else
9170         /* Draft 4 pthreads */
9171         status = pthread_create( &t, pthread_attr_default, task, NULL );
9172         if( status ) return status;
9173
9174         if( detach ) {
9175                 /* give thread a chance to complete */
9176                 /* it should remain joinable and hence detachable */
9177                 sleep( 1 );
9178
9179                 status = pthread_detach( &t );
9180                 if( status ) return status;
9181         }
9182 #endif
9183
9184 #ifdef HAVE_LINUX_THREADS
9185         pthread_kill_other_threads_np();
9186 #endif
9187
9188         return 0;
9189
9190 }
9191
9192 EOF
9193 if { (eval echo configure:9194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9194 then
9195   ol_cv_pthread_lib_lpthread_woff=yes
9196 else
9197   echo "configure: failed program was:" >&5
9198   cat conftest.$ac_ext >&5
9199   rm -fr conftest*
9200   ol_cv_pthread_lib_lpthread_woff=no
9201 fi
9202 rm -fr conftest*
9203 fi
9204
9205
9206                 # restore the LIBS
9207                 LIBS="$ol_LIBS"
9208         
9209 fi
9210
9211 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9212
9213         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9214                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9215                 ol_link_threads=posix
9216         fi
9217 fi
9218
9219
9220                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9221 if test "$ol_link_threads" = no ; then
9222         # try -lpthread
9223         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9224 echo "configure:9225: checking for pthread link with -lpthread" >&5
9225 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9226   echo $ac_n "(cached) $ac_c" 1>&6
9227 else
9228   
9229                 # save the flags
9230                 ol_LIBS="$LIBS"
9231                 LIBS="-lpthread $LIBS"
9232
9233                 if test "$cross_compiling" = yes; then
9234   cat > conftest.$ac_ext <<EOF
9235 #line 9236 "configure"
9236 #include "confdefs.h"
9237 /* pthread test headers */
9238 #include <pthread.h>
9239 #ifndef NULL
9240 #define NULL (void*)0
9241 #endif
9242
9243 static void *task(p)
9244         void *p;
9245 {
9246         return (void *) (p == NULL);
9247 }
9248
9249 int main() {
9250
9251         /* pthread test function */
9252         pthread_t t;
9253         int status;
9254         int detach = 1;
9255
9256 #ifdef HAVE_PTHREADS_FINAL
9257         /* Final pthreads */
9258         pthread_attr_t attr;
9259
9260         status = pthread_attr_init(&attr);
9261         if( status ) return status;
9262
9263 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9264         if( !detach ) {
9265 #if defined( PTHREAD_CREATE_JOINABLE )
9266                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9267 #else
9268                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9269 #endif
9270
9271 #ifdef PTHREAD_CREATE_DETACHED
9272         } else {
9273                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9274 #endif
9275         }
9276         if( status ) return status;
9277 #endif
9278
9279         status = pthread_create( &t, &attr, task, NULL );
9280         if( status ) return status;
9281
9282 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9283         if( detach ) {
9284                 /* give thread a chance to complete */
9285                 /* it should remain joinable and hence detachable */
9286                 sleep( 1 );
9287
9288                 status = pthread_detach( t );
9289                 if( status ) return status;
9290         }
9291 #endif
9292
9293 #else
9294         /* Draft 4 pthreads */
9295         status = pthread_create( &t, pthread_attr_default, task, NULL );
9296         if( status ) return status;
9297
9298         if( detach ) {
9299                 /* give thread a chance to complete */
9300                 /* it should remain joinable and hence detachable */
9301                 sleep( 1 );
9302
9303                 status = pthread_detach( &t );
9304                 if( status ) return status;
9305         }
9306 #endif
9307
9308 #ifdef HAVE_LINUX_THREADS
9309         pthread_kill_other_threads_np();
9310 #endif
9311
9312         return 0;
9313
9314 ; return 0; }
9315 EOF
9316 if { (eval echo configure:9317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9317   rm -rf conftest*
9318   ol_cv_pthread_lpthread=yes
9319 else
9320   echo "configure: failed program was:" >&5
9321   cat conftest.$ac_ext >&5
9322   rm -rf conftest*
9323   ol_cv_pthread_lpthread=no
9324 fi
9325 rm -f conftest*
9326 else
9327   cat > conftest.$ac_ext <<EOF
9328 #line 9329 "configure"
9329 #include "confdefs.h"
9330 /* pthread test headers */
9331 #include <pthread.h>
9332 #ifndef NULL
9333 #define NULL (void*)0
9334 #endif
9335
9336 static void *task(p)
9337         void *p;
9338 {
9339         return (void *) (p == NULL);
9340 }
9341
9342
9343 int main(argc, argv)
9344         int argc;
9345         char **argv;
9346 {
9347
9348         /* pthread test function */
9349         pthread_t t;
9350         int status;
9351         int detach = 1;
9352
9353 #ifdef HAVE_PTHREADS_FINAL
9354         /* Final pthreads */
9355         pthread_attr_t attr;
9356
9357         status = pthread_attr_init(&attr);
9358         if( status ) return status;
9359
9360 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9361         if( !detach ) {
9362 #if defined( PTHREAD_CREATE_JOINABLE )
9363                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9364 #else
9365                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9366 #endif
9367
9368 #ifdef PTHREAD_CREATE_DETACHED
9369         } else {
9370                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9371 #endif
9372         }
9373         if( status ) return status;
9374 #endif
9375
9376         status = pthread_create( &t, &attr, task, NULL );
9377         if( status ) return status;
9378
9379 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9380         if( detach ) {
9381                 /* give thread a chance to complete */
9382                 /* it should remain joinable and hence detachable */
9383                 sleep( 1 );
9384
9385                 status = pthread_detach( t );
9386                 if( status ) return status;
9387         }
9388 #endif
9389
9390 #else
9391         /* Draft 4 pthreads */
9392         status = pthread_create( &t, pthread_attr_default, task, NULL );
9393         if( status ) return status;
9394
9395         if( detach ) {
9396                 /* give thread a chance to complete */
9397                 /* it should remain joinable and hence detachable */
9398                 sleep( 1 );
9399
9400                 status = pthread_detach( &t );
9401                 if( status ) return status;
9402         }
9403 #endif
9404
9405 #ifdef HAVE_LINUX_THREADS
9406         pthread_kill_other_threads_np();
9407 #endif
9408
9409         return 0;
9410
9411 }
9412
9413 EOF
9414 if { (eval echo configure:9415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9415 then
9416   ol_cv_pthread_lpthread=yes
9417 else
9418   echo "configure: failed program was:" >&5
9419   cat conftest.$ac_ext >&5
9420   rm -fr conftest*
9421   ol_cv_pthread_lpthread=no
9422 fi
9423 rm -fr conftest*
9424 fi
9425
9426
9427                 # restore the LIBS
9428                 LIBS="$ol_LIBS"
9429         
9430 fi
9431
9432 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9433
9434         if test $ol_cv_pthread_lpthread = yes ; then
9435                 ol_link_pthreads="-lpthread"
9436                 ol_link_threads=posix
9437         fi
9438 fi
9439
9440                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9441 if test "$ol_link_threads" = no ; then
9442         # try -lc_r
9443         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9444 echo "configure:9445: checking for pthread link with -lc_r" >&5
9445 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9446   echo $ac_n "(cached) $ac_c" 1>&6
9447 else
9448   
9449                 # save the flags
9450                 ol_LIBS="$LIBS"
9451                 LIBS="-lc_r $LIBS"
9452
9453                 if test "$cross_compiling" = yes; then
9454   cat > conftest.$ac_ext <<EOF
9455 #line 9456 "configure"
9456 #include "confdefs.h"
9457 /* pthread test headers */
9458 #include <pthread.h>
9459 #ifndef NULL
9460 #define NULL (void*)0
9461 #endif
9462
9463 static void *task(p)
9464         void *p;
9465 {
9466         return (void *) (p == NULL);
9467 }
9468
9469 int main() {
9470
9471         /* pthread test function */
9472         pthread_t t;
9473         int status;
9474         int detach = 1;
9475
9476 #ifdef HAVE_PTHREADS_FINAL
9477         /* Final pthreads */
9478         pthread_attr_t attr;
9479
9480         status = pthread_attr_init(&attr);
9481         if( status ) return status;
9482
9483 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9484         if( !detach ) {
9485 #if defined( PTHREAD_CREATE_JOINABLE )
9486                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9487 #else
9488                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9489 #endif
9490
9491 #ifdef PTHREAD_CREATE_DETACHED
9492         } else {
9493                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9494 #endif
9495         }
9496         if( status ) return status;
9497 #endif
9498
9499         status = pthread_create( &t, &attr, task, NULL );
9500         if( status ) return status;
9501
9502 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9503         if( detach ) {
9504                 /* give thread a chance to complete */
9505                 /* it should remain joinable and hence detachable */
9506                 sleep( 1 );
9507
9508                 status = pthread_detach( t );
9509                 if( status ) return status;
9510         }
9511 #endif
9512
9513 #else
9514         /* Draft 4 pthreads */
9515         status = pthread_create( &t, pthread_attr_default, task, NULL );
9516         if( status ) return status;
9517
9518         if( detach ) {
9519                 /* give thread a chance to complete */
9520                 /* it should remain joinable and hence detachable */
9521                 sleep( 1 );
9522
9523                 status = pthread_detach( &t );
9524                 if( status ) return status;
9525         }
9526 #endif
9527
9528 #ifdef HAVE_LINUX_THREADS
9529         pthread_kill_other_threads_np();
9530 #endif
9531
9532         return 0;
9533
9534 ; return 0; }
9535 EOF
9536 if { (eval echo configure:9537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9537   rm -rf conftest*
9538   ol_cv_pthread_lc_r=yes
9539 else
9540   echo "configure: failed program was:" >&5
9541   cat conftest.$ac_ext >&5
9542   rm -rf conftest*
9543   ol_cv_pthread_lc_r=no
9544 fi
9545 rm -f conftest*
9546 else
9547   cat > conftest.$ac_ext <<EOF
9548 #line 9549 "configure"
9549 #include "confdefs.h"
9550 /* pthread test headers */
9551 #include <pthread.h>
9552 #ifndef NULL
9553 #define NULL (void*)0
9554 #endif
9555
9556 static void *task(p)
9557         void *p;
9558 {
9559         return (void *) (p == NULL);
9560 }
9561
9562
9563 int main(argc, argv)
9564         int argc;
9565         char **argv;
9566 {
9567
9568         /* pthread test function */
9569         pthread_t t;
9570         int status;
9571         int detach = 1;
9572
9573 #ifdef HAVE_PTHREADS_FINAL
9574         /* Final pthreads */
9575         pthread_attr_t attr;
9576
9577         status = pthread_attr_init(&attr);
9578         if( status ) return status;
9579
9580 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9581         if( !detach ) {
9582 #if defined( PTHREAD_CREATE_JOINABLE )
9583                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9584 #else
9585                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9586 #endif
9587
9588 #ifdef PTHREAD_CREATE_DETACHED
9589         } else {
9590                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9591 #endif
9592         }
9593         if( status ) return status;
9594 #endif
9595
9596         status = pthread_create( &t, &attr, task, NULL );
9597         if( status ) return status;
9598
9599 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9600         if( detach ) {
9601                 /* give thread a chance to complete */
9602                 /* it should remain joinable and hence detachable */
9603                 sleep( 1 );
9604
9605                 status = pthread_detach( t );
9606                 if( status ) return status;
9607         }
9608 #endif
9609
9610 #else
9611         /* Draft 4 pthreads */
9612         status = pthread_create( &t, pthread_attr_default, task, NULL );
9613         if( status ) return status;
9614
9615         if( detach ) {
9616                 /* give thread a chance to complete */
9617                 /* it should remain joinable and hence detachable */
9618                 sleep( 1 );
9619
9620                 status = pthread_detach( &t );
9621                 if( status ) return status;
9622         }
9623 #endif
9624
9625 #ifdef HAVE_LINUX_THREADS
9626         pthread_kill_other_threads_np();
9627 #endif
9628
9629         return 0;
9630
9631 }
9632
9633 EOF
9634 if { (eval echo configure:9635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9635 then
9636   ol_cv_pthread_lc_r=yes
9637 else
9638   echo "configure: failed program was:" >&5
9639   cat conftest.$ac_ext >&5
9640   rm -fr conftest*
9641   ol_cv_pthread_lc_r=no
9642 fi
9643 rm -fr conftest*
9644 fi
9645
9646
9647                 # restore the LIBS
9648                 LIBS="$ol_LIBS"
9649         
9650 fi
9651
9652 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9653
9654         if test $ol_cv_pthread_lc_r = yes ; then
9655                 ol_link_pthreads="-lc_r"
9656                 ol_link_threads=posix
9657         fi
9658 fi
9659
9660
9661                 # Pthread try link: -threads (ol_cv_pthread_threads)
9662 if test "$ol_link_threads" = no ; then
9663         # try -threads
9664         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9665 echo "configure:9666: checking for pthread link with -threads" >&5
9666 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9667   echo $ac_n "(cached) $ac_c" 1>&6
9668 else
9669   
9670                 # save the flags
9671                 ol_LIBS="$LIBS"
9672                 LIBS="-threads $LIBS"
9673
9674                 if test "$cross_compiling" = yes; then
9675   cat > conftest.$ac_ext <<EOF
9676 #line 9677 "configure"
9677 #include "confdefs.h"
9678 /* pthread test headers */
9679 #include <pthread.h>
9680 #ifndef NULL
9681 #define NULL (void*)0
9682 #endif
9683
9684 static void *task(p)
9685         void *p;
9686 {
9687         return (void *) (p == NULL);
9688 }
9689
9690 int main() {
9691
9692         /* pthread test function */
9693         pthread_t t;
9694         int status;
9695         int detach = 1;
9696
9697 #ifdef HAVE_PTHREADS_FINAL
9698         /* Final pthreads */
9699         pthread_attr_t attr;
9700
9701         status = pthread_attr_init(&attr);
9702         if( status ) return status;
9703
9704 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9705         if( !detach ) {
9706 #if defined( PTHREAD_CREATE_JOINABLE )
9707                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9708 #else
9709                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9710 #endif
9711
9712 #ifdef PTHREAD_CREATE_DETACHED
9713         } else {
9714                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9715 #endif
9716         }
9717         if( status ) return status;
9718 #endif
9719
9720         status = pthread_create( &t, &attr, task, NULL );
9721         if( status ) return status;
9722
9723 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9724         if( detach ) {
9725                 /* give thread a chance to complete */
9726                 /* it should remain joinable and hence detachable */
9727                 sleep( 1 );
9728
9729                 status = pthread_detach( t );
9730                 if( status ) return status;
9731         }
9732 #endif
9733
9734 #else
9735         /* Draft 4 pthreads */
9736         status = pthread_create( &t, pthread_attr_default, task, NULL );
9737         if( status ) return status;
9738
9739         if( detach ) {
9740                 /* give thread a chance to complete */
9741                 /* it should remain joinable and hence detachable */
9742                 sleep( 1 );
9743
9744                 status = pthread_detach( &t );
9745                 if( status ) return status;
9746         }
9747 #endif
9748
9749 #ifdef HAVE_LINUX_THREADS
9750         pthread_kill_other_threads_np();
9751 #endif
9752
9753         return 0;
9754
9755 ; return 0; }
9756 EOF
9757 if { (eval echo configure:9758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9758   rm -rf conftest*
9759   ol_cv_pthread_threads=yes
9760 else
9761   echo "configure: failed program was:" >&5
9762   cat conftest.$ac_ext >&5
9763   rm -rf conftest*
9764   ol_cv_pthread_threads=no
9765 fi
9766 rm -f conftest*
9767 else
9768   cat > conftest.$ac_ext <<EOF
9769 #line 9770 "configure"
9770 #include "confdefs.h"
9771 /* pthread test headers */
9772 #include <pthread.h>
9773 #ifndef NULL
9774 #define NULL (void*)0
9775 #endif
9776
9777 static void *task(p)
9778         void *p;
9779 {
9780         return (void *) (p == NULL);
9781 }
9782
9783
9784 int main(argc, argv)
9785         int argc;
9786         char **argv;
9787 {
9788
9789         /* pthread test function */
9790         pthread_t t;
9791         int status;
9792         int detach = 1;
9793
9794 #ifdef HAVE_PTHREADS_FINAL
9795         /* Final pthreads */
9796         pthread_attr_t attr;
9797
9798         status = pthread_attr_init(&attr);
9799         if( status ) return status;
9800
9801 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9802         if( !detach ) {
9803 #if defined( PTHREAD_CREATE_JOINABLE )
9804                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9805 #else
9806                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9807 #endif
9808
9809 #ifdef PTHREAD_CREATE_DETACHED
9810         } else {
9811                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9812 #endif
9813         }
9814         if( status ) return status;
9815 #endif
9816
9817         status = pthread_create( &t, &attr, task, NULL );
9818         if( status ) return status;
9819
9820 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9821         if( detach ) {
9822                 /* give thread a chance to complete */
9823                 /* it should remain joinable and hence detachable */
9824                 sleep( 1 );
9825
9826                 status = pthread_detach( t );
9827                 if( status ) return status;
9828         }
9829 #endif
9830
9831 #else
9832         /* Draft 4 pthreads */
9833         status = pthread_create( &t, pthread_attr_default, task, NULL );
9834         if( status ) return status;
9835
9836         if( detach ) {
9837                 /* give thread a chance to complete */
9838                 /* it should remain joinable and hence detachable */
9839                 sleep( 1 );
9840
9841                 status = pthread_detach( &t );
9842                 if( status ) return status;
9843         }
9844 #endif
9845
9846 #ifdef HAVE_LINUX_THREADS
9847         pthread_kill_other_threads_np();
9848 #endif
9849
9850         return 0;
9851
9852 }
9853
9854 EOF
9855 if { (eval echo configure:9856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9856 then
9857   ol_cv_pthread_threads=yes
9858 else
9859   echo "configure: failed program was:" >&5
9860   cat conftest.$ac_ext >&5
9861   rm -fr conftest*
9862   ol_cv_pthread_threads=no
9863 fi
9864 rm -fr conftest*
9865 fi
9866
9867
9868                 # restore the LIBS
9869                 LIBS="$ol_LIBS"
9870         
9871 fi
9872
9873 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9874
9875         if test $ol_cv_pthread_threads = yes ; then
9876                 ol_link_pthreads="-threads"
9877                 ol_link_threads=posix
9878         fi
9879 fi
9880
9881
9882                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9883 if test "$ol_link_threads" = no ; then
9884         # try -lpthreads -lmach -lexc -lc_r
9885         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9886 echo "configure:9887: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9887 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9888   echo $ac_n "(cached) $ac_c" 1>&6
9889 else
9890   
9891                 # save the flags
9892                 ol_LIBS="$LIBS"
9893                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9894
9895                 if test "$cross_compiling" = yes; then
9896   cat > conftest.$ac_ext <<EOF
9897 #line 9898 "configure"
9898 #include "confdefs.h"
9899 /* pthread test headers */
9900 #include <pthread.h>
9901 #ifndef NULL
9902 #define NULL (void*)0
9903 #endif
9904
9905 static void *task(p)
9906         void *p;
9907 {
9908         return (void *) (p == NULL);
9909 }
9910
9911 int main() {
9912
9913         /* pthread test function */
9914         pthread_t t;
9915         int status;
9916         int detach = 1;
9917
9918 #ifdef HAVE_PTHREADS_FINAL
9919         /* Final pthreads */
9920         pthread_attr_t attr;
9921
9922         status = pthread_attr_init(&attr);
9923         if( status ) return status;
9924
9925 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9926         if( !detach ) {
9927 #if defined( PTHREAD_CREATE_JOINABLE )
9928                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9929 #else
9930                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9931 #endif
9932
9933 #ifdef PTHREAD_CREATE_DETACHED
9934         } else {
9935                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9936 #endif
9937         }
9938         if( status ) return status;
9939 #endif
9940
9941         status = pthread_create( &t, &attr, task, NULL );
9942         if( status ) return status;
9943
9944 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9945         if( detach ) {
9946                 /* give thread a chance to complete */
9947                 /* it should remain joinable and hence detachable */
9948                 sleep( 1 );
9949
9950                 status = pthread_detach( t );
9951                 if( status ) return status;
9952         }
9953 #endif
9954
9955 #else
9956         /* Draft 4 pthreads */
9957         status = pthread_create( &t, pthread_attr_default, task, NULL );
9958         if( status ) return status;
9959
9960         if( detach ) {
9961                 /* give thread a chance to complete */
9962                 /* it should remain joinable and hence detachable */
9963                 sleep( 1 );
9964
9965                 status = pthread_detach( &t );
9966                 if( status ) return status;
9967         }
9968 #endif
9969
9970 #ifdef HAVE_LINUX_THREADS
9971         pthread_kill_other_threads_np();
9972 #endif
9973
9974         return 0;
9975
9976 ; return 0; }
9977 EOF
9978 if { (eval echo configure:9979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9979   rm -rf conftest*
9980   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9981 else
9982   echo "configure: failed program was:" >&5
9983   cat conftest.$ac_ext >&5
9984   rm -rf conftest*
9985   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9986 fi
9987 rm -f conftest*
9988 else
9989   cat > conftest.$ac_ext <<EOF
9990 #line 9991 "configure"
9991 #include "confdefs.h"
9992 /* pthread test headers */
9993 #include <pthread.h>
9994 #ifndef NULL
9995 #define NULL (void*)0
9996 #endif
9997
9998 static void *task(p)
9999         void *p;
10000 {
10001         return (void *) (p == NULL);
10002 }
10003
10004
10005 int main(argc, argv)
10006         int argc;
10007         char **argv;
10008 {
10009
10010         /* pthread test function */
10011         pthread_t t;
10012         int status;
10013         int detach = 1;
10014
10015 #ifdef HAVE_PTHREADS_FINAL
10016         /* Final pthreads */
10017         pthread_attr_t attr;
10018
10019         status = pthread_attr_init(&attr);
10020         if( status ) return status;
10021
10022 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10023         if( !detach ) {
10024 #if defined( PTHREAD_CREATE_JOINABLE )
10025                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10026 #else
10027                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10028 #endif
10029
10030 #ifdef PTHREAD_CREATE_DETACHED
10031         } else {
10032                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10033 #endif
10034         }
10035         if( status ) return status;
10036 #endif
10037
10038         status = pthread_create( &t, &attr, task, NULL );
10039         if( status ) return status;
10040
10041 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10042         if( detach ) {
10043                 /* give thread a chance to complete */
10044                 /* it should remain joinable and hence detachable */
10045                 sleep( 1 );
10046
10047                 status = pthread_detach( t );
10048                 if( status ) return status;
10049         }
10050 #endif
10051
10052 #else
10053         /* Draft 4 pthreads */
10054         status = pthread_create( &t, pthread_attr_default, task, NULL );
10055         if( status ) return status;
10056
10057         if( detach ) {
10058                 /* give thread a chance to complete */
10059                 /* it should remain joinable and hence detachable */
10060                 sleep( 1 );
10061
10062                 status = pthread_detach( &t );
10063                 if( status ) return status;
10064         }
10065 #endif
10066
10067 #ifdef HAVE_LINUX_THREADS
10068         pthread_kill_other_threads_np();
10069 #endif
10070
10071         return 0;
10072
10073 }
10074
10075 EOF
10076 if { (eval echo configure:10077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10077 then
10078   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10079 else
10080   echo "configure: failed program was:" >&5
10081   cat conftest.$ac_ext >&5
10082   rm -fr conftest*
10083   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10084 fi
10085 rm -fr conftest*
10086 fi
10087
10088
10089                 # restore the LIBS
10090                 LIBS="$ol_LIBS"
10091         
10092 fi
10093
10094 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10095
10096         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10097                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10098                 ol_link_threads=posix
10099         fi
10100 fi
10101
10102                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10103 if test "$ol_link_threads" = no ; then
10104         # try -lpthreads -lmach -lexc
10105         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10106 echo "configure:10107: checking for pthread link with -lpthreads -lmach -lexc" >&5
10107 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10108   echo $ac_n "(cached) $ac_c" 1>&6
10109 else
10110   
10111                 # save the flags
10112                 ol_LIBS="$LIBS"
10113                 LIBS="-lpthreads -lmach -lexc $LIBS"
10114
10115                 if test "$cross_compiling" = yes; then
10116   cat > conftest.$ac_ext <<EOF
10117 #line 10118 "configure"
10118 #include "confdefs.h"
10119 /* pthread test headers */
10120 #include <pthread.h>
10121 #ifndef NULL
10122 #define NULL (void*)0
10123 #endif
10124
10125 static void *task(p)
10126         void *p;
10127 {
10128         return (void *) (p == NULL);
10129 }
10130
10131 int main() {
10132
10133         /* pthread test function */
10134         pthread_t t;
10135         int status;
10136         int detach = 1;
10137
10138 #ifdef HAVE_PTHREADS_FINAL
10139         /* Final pthreads */
10140         pthread_attr_t attr;
10141
10142         status = pthread_attr_init(&attr);
10143         if( status ) return status;
10144
10145 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10146         if( !detach ) {
10147 #if defined( PTHREAD_CREATE_JOINABLE )
10148                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10149 #else
10150                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10151 #endif
10152
10153 #ifdef PTHREAD_CREATE_DETACHED
10154         } else {
10155                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10156 #endif
10157         }
10158         if( status ) return status;
10159 #endif
10160
10161         status = pthread_create( &t, &attr, task, NULL );
10162         if( status ) return status;
10163
10164 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10165         if( detach ) {
10166                 /* give thread a chance to complete */
10167                 /* it should remain joinable and hence detachable */
10168                 sleep( 1 );
10169
10170                 status = pthread_detach( t );
10171                 if( status ) return status;
10172         }
10173 #endif
10174
10175 #else
10176         /* Draft 4 pthreads */
10177         status = pthread_create( &t, pthread_attr_default, task, NULL );
10178         if( status ) return status;
10179
10180         if( detach ) {
10181                 /* give thread a chance to complete */
10182                 /* it should remain joinable and hence detachable */
10183                 sleep( 1 );
10184
10185                 status = pthread_detach( &t );
10186                 if( status ) return status;
10187         }
10188 #endif
10189
10190 #ifdef HAVE_LINUX_THREADS
10191         pthread_kill_other_threads_np();
10192 #endif
10193
10194         return 0;
10195
10196 ; return 0; }
10197 EOF
10198 if { (eval echo configure:10199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10199   rm -rf conftest*
10200   ol_cv_pthread_lpthreads_lmach_lexc=yes
10201 else
10202   echo "configure: failed program was:" >&5
10203   cat conftest.$ac_ext >&5
10204   rm -rf conftest*
10205   ol_cv_pthread_lpthreads_lmach_lexc=no
10206 fi
10207 rm -f conftest*
10208 else
10209   cat > conftest.$ac_ext <<EOF
10210 #line 10211 "configure"
10211 #include "confdefs.h"
10212 /* pthread test headers */
10213 #include <pthread.h>
10214 #ifndef NULL
10215 #define NULL (void*)0
10216 #endif
10217
10218 static void *task(p)
10219         void *p;
10220 {
10221         return (void *) (p == NULL);
10222 }
10223
10224
10225 int main(argc, argv)
10226         int argc;
10227         char **argv;
10228 {
10229
10230         /* pthread test function */
10231         pthread_t t;
10232         int status;
10233         int detach = 1;
10234
10235 #ifdef HAVE_PTHREADS_FINAL
10236         /* Final pthreads */
10237         pthread_attr_t attr;
10238
10239         status = pthread_attr_init(&attr);
10240         if( status ) return status;
10241
10242 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10243         if( !detach ) {
10244 #if defined( PTHREAD_CREATE_JOINABLE )
10245                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10246 #else
10247                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10248 #endif
10249
10250 #ifdef PTHREAD_CREATE_DETACHED
10251         } else {
10252                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10253 #endif
10254         }
10255         if( status ) return status;
10256 #endif
10257
10258         status = pthread_create( &t, &attr, task, NULL );
10259         if( status ) return status;
10260
10261 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10262         if( detach ) {
10263                 /* give thread a chance to complete */
10264                 /* it should remain joinable and hence detachable */
10265                 sleep( 1 );
10266
10267                 status = pthread_detach( t );
10268                 if( status ) return status;
10269         }
10270 #endif
10271
10272 #else
10273         /* Draft 4 pthreads */
10274         status = pthread_create( &t, pthread_attr_default, task, NULL );
10275         if( status ) return status;
10276
10277         if( detach ) {
10278                 /* give thread a chance to complete */
10279                 /* it should remain joinable and hence detachable */
10280                 sleep( 1 );
10281
10282                 status = pthread_detach( &t );
10283                 if( status ) return status;
10284         }
10285 #endif
10286
10287 #ifdef HAVE_LINUX_THREADS
10288         pthread_kill_other_threads_np();
10289 #endif
10290
10291         return 0;
10292
10293 }
10294
10295 EOF
10296 if { (eval echo configure:10297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10297 then
10298   ol_cv_pthread_lpthreads_lmach_lexc=yes
10299 else
10300   echo "configure: failed program was:" >&5
10301   cat conftest.$ac_ext >&5
10302   rm -fr conftest*
10303   ol_cv_pthread_lpthreads_lmach_lexc=no
10304 fi
10305 rm -fr conftest*
10306 fi
10307
10308
10309                 # restore the LIBS
10310                 LIBS="$ol_LIBS"
10311         
10312 fi
10313
10314 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10315
10316         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10317                 ol_link_pthreads="-lpthreads -lmach -lexc"
10318                 ol_link_threads=posix
10319         fi
10320 fi
10321
10322                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10323 if test "$ol_link_threads" = no ; then
10324         # try -lpthreads -lexc
10325         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10326 echo "configure:10327: checking for pthread link with -lpthreads -lexc" >&5
10327 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10328   echo $ac_n "(cached) $ac_c" 1>&6
10329 else
10330   
10331                 # save the flags
10332                 ol_LIBS="$LIBS"
10333                 LIBS="-lpthreads -lexc $LIBS"
10334
10335                 if test "$cross_compiling" = yes; then
10336   cat > conftest.$ac_ext <<EOF
10337 #line 10338 "configure"
10338 #include "confdefs.h"
10339 /* pthread test headers */
10340 #include <pthread.h>
10341 #ifndef NULL
10342 #define NULL (void*)0
10343 #endif
10344
10345 static void *task(p)
10346         void *p;
10347 {
10348         return (void *) (p == NULL);
10349 }
10350
10351 int main() {
10352
10353         /* pthread test function */
10354         pthread_t t;
10355         int status;
10356         int detach = 1;
10357
10358 #ifdef HAVE_PTHREADS_FINAL
10359         /* Final pthreads */
10360         pthread_attr_t attr;
10361
10362         status = pthread_attr_init(&attr);
10363         if( status ) return status;
10364
10365 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10366         if( !detach ) {
10367 #if defined( PTHREAD_CREATE_JOINABLE )
10368                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10369 #else
10370                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10371 #endif
10372
10373 #ifdef PTHREAD_CREATE_DETACHED
10374         } else {
10375                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10376 #endif
10377         }
10378         if( status ) return status;
10379 #endif
10380
10381         status = pthread_create( &t, &attr, task, NULL );
10382         if( status ) return status;
10383
10384 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10385         if( detach ) {
10386                 /* give thread a chance to complete */
10387                 /* it should remain joinable and hence detachable */
10388                 sleep( 1 );
10389
10390                 status = pthread_detach( t );
10391                 if( status ) return status;
10392         }
10393 #endif
10394
10395 #else
10396         /* Draft 4 pthreads */
10397         status = pthread_create( &t, pthread_attr_default, task, NULL );
10398         if( status ) return status;
10399
10400         if( detach ) {
10401                 /* give thread a chance to complete */
10402                 /* it should remain joinable and hence detachable */
10403                 sleep( 1 );
10404
10405                 status = pthread_detach( &t );
10406                 if( status ) return status;
10407         }
10408 #endif
10409
10410 #ifdef HAVE_LINUX_THREADS
10411         pthread_kill_other_threads_np();
10412 #endif
10413
10414         return 0;
10415
10416 ; return 0; }
10417 EOF
10418 if { (eval echo configure:10419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10419   rm -rf conftest*
10420   ol_cv_pthread_lpthreads_lexc=yes
10421 else
10422   echo "configure: failed program was:" >&5
10423   cat conftest.$ac_ext >&5
10424   rm -rf conftest*
10425   ol_cv_pthread_lpthreads_lexc=no
10426 fi
10427 rm -f conftest*
10428 else
10429   cat > conftest.$ac_ext <<EOF
10430 #line 10431 "configure"
10431 #include "confdefs.h"
10432 /* pthread test headers */
10433 #include <pthread.h>
10434 #ifndef NULL
10435 #define NULL (void*)0
10436 #endif
10437
10438 static void *task(p)
10439         void *p;
10440 {
10441         return (void *) (p == NULL);
10442 }
10443
10444
10445 int main(argc, argv)
10446         int argc;
10447         char **argv;
10448 {
10449
10450         /* pthread test function */
10451         pthread_t t;
10452         int status;
10453         int detach = 1;
10454
10455 #ifdef HAVE_PTHREADS_FINAL
10456         /* Final pthreads */
10457         pthread_attr_t attr;
10458
10459         status = pthread_attr_init(&attr);
10460         if( status ) return status;
10461
10462 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10463         if( !detach ) {
10464 #if defined( PTHREAD_CREATE_JOINABLE )
10465                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10466 #else
10467                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10468 #endif
10469
10470 #ifdef PTHREAD_CREATE_DETACHED
10471         } else {
10472                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10473 #endif
10474         }
10475         if( status ) return status;
10476 #endif
10477
10478         status = pthread_create( &t, &attr, task, NULL );
10479         if( status ) return status;
10480
10481 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10482         if( detach ) {
10483                 /* give thread a chance to complete */
10484                 /* it should remain joinable and hence detachable */
10485                 sleep( 1 );
10486
10487                 status = pthread_detach( t );
10488                 if( status ) return status;
10489         }
10490 #endif
10491
10492 #else
10493         /* Draft 4 pthreads */
10494         status = pthread_create( &t, pthread_attr_default, task, NULL );
10495         if( status ) return status;
10496
10497         if( detach ) {
10498                 /* give thread a chance to complete */
10499                 /* it should remain joinable and hence detachable */
10500                 sleep( 1 );
10501
10502                 status = pthread_detach( &t );
10503                 if( status ) return status;
10504         }
10505 #endif
10506
10507 #ifdef HAVE_LINUX_THREADS
10508         pthread_kill_other_threads_np();
10509 #endif
10510
10511         return 0;
10512
10513 }
10514
10515 EOF
10516 if { (eval echo configure:10517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10517 then
10518   ol_cv_pthread_lpthreads_lexc=yes
10519 else
10520   echo "configure: failed program was:" >&5
10521   cat conftest.$ac_ext >&5
10522   rm -fr conftest*
10523   ol_cv_pthread_lpthreads_lexc=no
10524 fi
10525 rm -fr conftest*
10526 fi
10527
10528
10529                 # restore the LIBS
10530                 LIBS="$ol_LIBS"
10531         
10532 fi
10533
10534 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10535
10536         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10537                 ol_link_pthreads="-lpthreads -lexc"
10538                 ol_link_threads=posix
10539         fi
10540 fi
10541
10542
10543                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10544 if test "$ol_link_threads" = no ; then
10545         # try -lpthreads
10546         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10547 echo "configure:10548: checking for pthread link with -lpthreads" >&5
10548 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10549   echo $ac_n "(cached) $ac_c" 1>&6
10550 else
10551   
10552                 # save the flags
10553                 ol_LIBS="$LIBS"
10554                 LIBS="-lpthreads $LIBS"
10555
10556                 if test "$cross_compiling" = yes; then
10557   cat > conftest.$ac_ext <<EOF
10558 #line 10559 "configure"
10559 #include "confdefs.h"
10560 /* pthread test headers */
10561 #include <pthread.h>
10562 #ifndef NULL
10563 #define NULL (void*)0
10564 #endif
10565
10566 static void *task(p)
10567         void *p;
10568 {
10569         return (void *) (p == NULL);
10570 }
10571
10572 int main() {
10573
10574         /* pthread test function */
10575         pthread_t t;
10576         int status;
10577         int detach = 1;
10578
10579 #ifdef HAVE_PTHREADS_FINAL
10580         /* Final pthreads */
10581         pthread_attr_t attr;
10582
10583         status = pthread_attr_init(&attr);
10584         if( status ) return status;
10585
10586 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10587         if( !detach ) {
10588 #if defined( PTHREAD_CREATE_JOINABLE )
10589                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10590 #else
10591                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10592 #endif
10593
10594 #ifdef PTHREAD_CREATE_DETACHED
10595         } else {
10596                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10597 #endif
10598         }
10599         if( status ) return status;
10600 #endif
10601
10602         status = pthread_create( &t, &attr, task, NULL );
10603         if( status ) return status;
10604
10605 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10606         if( detach ) {
10607                 /* give thread a chance to complete */
10608                 /* it should remain joinable and hence detachable */
10609                 sleep( 1 );
10610
10611                 status = pthread_detach( t );
10612                 if( status ) return status;
10613         }
10614 #endif
10615
10616 #else
10617         /* Draft 4 pthreads */
10618         status = pthread_create( &t, pthread_attr_default, task, NULL );
10619         if( status ) return status;
10620
10621         if( detach ) {
10622                 /* give thread a chance to complete */
10623                 /* it should remain joinable and hence detachable */
10624                 sleep( 1 );
10625
10626                 status = pthread_detach( &t );
10627                 if( status ) return status;
10628         }
10629 #endif
10630
10631 #ifdef HAVE_LINUX_THREADS
10632         pthread_kill_other_threads_np();
10633 #endif
10634
10635         return 0;
10636
10637 ; return 0; }
10638 EOF
10639 if { (eval echo configure:10640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10640   rm -rf conftest*
10641   ol_cv_pthread_lib_lpthreads=yes
10642 else
10643   echo "configure: failed program was:" >&5
10644   cat conftest.$ac_ext >&5
10645   rm -rf conftest*
10646   ol_cv_pthread_lib_lpthreads=no
10647 fi
10648 rm -f conftest*
10649 else
10650   cat > conftest.$ac_ext <<EOF
10651 #line 10652 "configure"
10652 #include "confdefs.h"
10653 /* pthread test headers */
10654 #include <pthread.h>
10655 #ifndef NULL
10656 #define NULL (void*)0
10657 #endif
10658
10659 static void *task(p)
10660         void *p;
10661 {
10662         return (void *) (p == NULL);
10663 }
10664
10665
10666 int main(argc, argv)
10667         int argc;
10668         char **argv;
10669 {
10670
10671         /* pthread test function */
10672         pthread_t t;
10673         int status;
10674         int detach = 1;
10675
10676 #ifdef HAVE_PTHREADS_FINAL
10677         /* Final pthreads */
10678         pthread_attr_t attr;
10679
10680         status = pthread_attr_init(&attr);
10681         if( status ) return status;
10682
10683 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10684         if( !detach ) {
10685 #if defined( PTHREAD_CREATE_JOINABLE )
10686                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10687 #else
10688                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10689 #endif
10690
10691 #ifdef PTHREAD_CREATE_DETACHED
10692         } else {
10693                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10694 #endif
10695         }
10696         if( status ) return status;
10697 #endif
10698
10699         status = pthread_create( &t, &attr, task, NULL );
10700         if( status ) return status;
10701
10702 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10703         if( detach ) {
10704                 /* give thread a chance to complete */
10705                 /* it should remain joinable and hence detachable */
10706                 sleep( 1 );
10707
10708                 status = pthread_detach( t );
10709                 if( status ) return status;
10710         }
10711 #endif
10712
10713 #else
10714         /* Draft 4 pthreads */
10715         status = pthread_create( &t, pthread_attr_default, task, NULL );
10716         if( status ) return status;
10717
10718         if( detach ) {
10719                 /* give thread a chance to complete */
10720                 /* it should remain joinable and hence detachable */
10721                 sleep( 1 );
10722
10723                 status = pthread_detach( &t );
10724                 if( status ) return status;
10725         }
10726 #endif
10727
10728 #ifdef HAVE_LINUX_THREADS
10729         pthread_kill_other_threads_np();
10730 #endif
10731
10732         return 0;
10733
10734 }
10735
10736 EOF
10737 if { (eval echo configure:10738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10738 then
10739   ol_cv_pthread_lib_lpthreads=yes
10740 else
10741   echo "configure: failed program was:" >&5
10742   cat conftest.$ac_ext >&5
10743   rm -fr conftest*
10744   ol_cv_pthread_lib_lpthreads=no
10745 fi
10746 rm -fr conftest*
10747 fi
10748
10749
10750                 # restore the LIBS
10751                 LIBS="$ol_LIBS"
10752         
10753 fi
10754
10755 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10756
10757         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10758                 ol_link_pthreads="-lpthreads"
10759                 ol_link_threads=posix
10760         fi
10761 fi
10762
10763
10764                 if test $ol_link_threads != no ; then
10765                         cat >> confdefs.h <<\EOF
10766 #define HAVE_PTHREADS 1
10767 EOF
10768
10769
10770                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10771
10772                                                 save_CPPFLAGS="$CPPFLAGS"
10773                         save_LIBS="$LIBS"
10774                         LIBS="$LTHREAD_LIBS $LIBS"
10775
10776                                                                                                 for ac_func in sched_yield pthread_yield
10777 do
10778 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10779 echo "configure:10780: checking for $ac_func" >&5
10780 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10781   echo $ac_n "(cached) $ac_c" 1>&6
10782 else
10783   cat > conftest.$ac_ext <<EOF
10784 #line 10785 "configure"
10785 #include "confdefs.h"
10786 /* System header to define __stub macros and hopefully few prototypes,
10787     which can conflict with char $ac_func(); below.  */
10788 #include <assert.h>
10789 /* Override any gcc2 internal prototype to avoid an error.  */
10790 /* We use char because int might match the return type of a gcc2
10791     builtin and then its argument prototype would still apply.  */
10792 char $ac_func();
10793 char (*f)();
10794
10795 int main() {
10796
10797 /* The GNU C library defines this for functions which it implements
10798     to always fail with ENOSYS.  Some functions are actually named
10799     something starting with __ and the normal name is an alias.  */
10800 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10801 choke me
10802 #else
10803 f = $ac_func;
10804 #endif
10805
10806 ; return 0; }
10807 EOF
10808 if { (eval echo configure:10809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10809   rm -rf conftest*
10810   eval "ac_cv_func_$ac_func=yes"
10811 else
10812   echo "configure: failed program was:" >&5
10813   cat conftest.$ac_ext >&5
10814   rm -rf conftest*
10815   eval "ac_cv_func_$ac_func=no"
10816 fi
10817 rm -f conftest*
10818 fi
10819
10820 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10821   echo "$ac_t""yes" 1>&6
10822     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10823   cat >> confdefs.h <<EOF
10824 #define $ac_tr_func 1
10825 EOF
10826  
10827 else
10828   echo "$ac_t""no" 1>&6
10829 fi
10830 done
10831
10832
10833                         if test $ac_cv_func_sched_yield = no -a \
10834                                 $ac_cv_func_pthread_yield = no ; then
10835                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10836 echo "configure:10837: checking for sched_yield in -lrt" >&5
10837 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10838 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10839   echo $ac_n "(cached) $ac_c" 1>&6
10840 else
10841   ac_save_LIBS="$LIBS"
10842 LIBS="-lrt  $LIBS"
10843 cat > conftest.$ac_ext <<EOF
10844 #line 10845 "configure"
10845 #include "confdefs.h"
10846 /* Override any gcc2 internal prototype to avoid an error.  */
10847 /* We use char because int might match the return type of a gcc2
10848     builtin and then its argument prototype would still apply.  */
10849 char sched_yield();
10850
10851 int main() {
10852 sched_yield()
10853 ; return 0; }
10854 EOF
10855 if { (eval echo configure:10856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10856   rm -rf conftest*
10857   eval "ac_cv_lib_$ac_lib_var=yes"
10858 else
10859   echo "configure: failed program was:" >&5
10860   cat conftest.$ac_ext >&5
10861   rm -rf conftest*
10862   eval "ac_cv_lib_$ac_lib_var=no"
10863 fi
10864 rm -f conftest*
10865 LIBS="$ac_save_LIBS"
10866
10867 fi
10868 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10869   echo "$ac_t""yes" 1>&6
10870   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10871                                         cat >> confdefs.h <<\EOF
10872 #define HAVE_SCHED_YIELD 1
10873 EOF
10874
10875                                         ac_cv_func_sched_yield=yes
10876 else
10877   echo "$ac_t""no" 1>&6
10878 ac_cv_func_sched_yield=no
10879 fi
10880
10881                         fi
10882                         if test $ac_cv_func_sched_yield = no -a \
10883                                 $ac_cv_func_pthread_yield = no ; then
10884                                                                                                 for ac_func in thr_yield
10885 do
10886 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10887 echo "configure:10888: checking for $ac_func" >&5
10888 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10889   echo $ac_n "(cached) $ac_c" 1>&6
10890 else
10891   cat > conftest.$ac_ext <<EOF
10892 #line 10893 "configure"
10893 #include "confdefs.h"
10894 /* System header to define __stub macros and hopefully few prototypes,
10895     which can conflict with char $ac_func(); below.  */
10896 #include <assert.h>
10897 /* Override any gcc2 internal prototype to avoid an error.  */
10898 /* We use char because int might match the return type of a gcc2
10899     builtin and then its argument prototype would still apply.  */
10900 char $ac_func();
10901 char (*f)();
10902
10903 int main() {
10904
10905 /* The GNU C library defines this for functions which it implements
10906     to always fail with ENOSYS.  Some functions are actually named
10907     something starting with __ and the normal name is an alias.  */
10908 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10909 choke me
10910 #else
10911 f = $ac_func;
10912 #endif
10913
10914 ; return 0; }
10915 EOF
10916 if { (eval echo configure:10917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10917   rm -rf conftest*
10918   eval "ac_cv_func_$ac_func=yes"
10919 else
10920   echo "configure: failed program was:" >&5
10921   cat conftest.$ac_ext >&5
10922   rm -rf conftest*
10923   eval "ac_cv_func_$ac_func=no"
10924 fi
10925 rm -f conftest*
10926 fi
10927
10928 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10929   echo "$ac_t""yes" 1>&6
10930     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10931   cat >> confdefs.h <<EOF
10932 #define $ac_tr_func 1
10933 EOF
10934  
10935 else
10936   echo "$ac_t""no" 1>&6
10937 fi
10938 done
10939
10940                         fi
10941                         if test $ac_cv_func_sched_yield = no -a \
10942                                 $ac_cv_func_pthread_yield = no -a \
10943                                 "$ac_cv_func_thr_yield" = no ; then
10944                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10945                         fi
10946
10947                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10948 do
10949 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10950 echo "configure:10951: checking for $ac_func" >&5
10951 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10952   echo $ac_n "(cached) $ac_c" 1>&6
10953 else
10954   cat > conftest.$ac_ext <<EOF
10955 #line 10956 "configure"
10956 #include "confdefs.h"
10957 /* System header to define __stub macros and hopefully few prototypes,
10958     which can conflict with char $ac_func(); below.  */
10959 #include <assert.h>
10960 /* Override any gcc2 internal prototype to avoid an error.  */
10961 /* We use char because int might match the return type of a gcc2
10962     builtin and then its argument prototype would still apply.  */
10963 char $ac_func();
10964 char (*f)();
10965
10966 int main() {
10967
10968 /* The GNU C library defines this for functions which it implements
10969     to always fail with ENOSYS.  Some functions are actually named
10970     something starting with __ and the normal name is an alias.  */
10971 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10972 choke me
10973 #else
10974 f = $ac_func;
10975 #endif
10976
10977 ; return 0; }
10978 EOF
10979 if { (eval echo configure:10980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10980   rm -rf conftest*
10981   eval "ac_cv_func_$ac_func=yes"
10982 else
10983   echo "configure: failed program was:" >&5
10984   cat conftest.$ac_ext >&5
10985   rm -rf conftest*
10986   eval "ac_cv_func_$ac_func=no"
10987 fi
10988 rm -f conftest*
10989 fi
10990
10991 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10992   echo "$ac_t""yes" 1>&6
10993     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10994   cat >> confdefs.h <<EOF
10995 #define $ac_tr_func 1
10996 EOF
10997  
10998 else
10999   echo "$ac_t""no" 1>&6
11000 fi
11001 done
11002
11003
11004                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11005 echo "configure:11006: checking for pthread_detach with <pthread.h>" >&5
11006 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11007   echo $ac_n "(cached) $ac_c" 1>&6
11008 else
11009   
11010                                                                 cat > conftest.$ac_ext <<EOF
11011 #line 11012 "configure"
11012 #include "confdefs.h"
11013
11014 #include <pthread.h>
11015 #ifndef NULL
11016 #define NULL (void*)0
11017 #endif
11018
11019 int main() {
11020 pthread_detach(NULL);
11021 ; return 0; }
11022 EOF
11023 if { (eval echo configure:11024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11024   rm -rf conftest*
11025   ol_cv_func_pthread_detach=yes
11026 else
11027   echo "configure: failed program was:" >&5
11028   cat conftest.$ac_ext >&5
11029   rm -rf conftest*
11030   ol_cv_func_pthread_detach=no
11031 fi
11032 rm -f conftest*
11033                         
11034 fi
11035
11036 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11037
11038                         if test $ol_cv_func_pthread_detach = no ; then
11039                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11040                         fi
11041
11042                         cat >> confdefs.h <<\EOF
11043 #define HAVE_PTHREAD_DETACH 1
11044 EOF
11045
11046
11047                                                 for ac_func in \
11048                                 pthread_setconcurrency \
11049                                 pthread_getconcurrency \
11050                                 thr_setconcurrency \
11051                                 thr_getconcurrency \
11052                         
11053 do
11054 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11055 echo "configure:11056: checking for $ac_func" >&5
11056 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11057   echo $ac_n "(cached) $ac_c" 1>&6
11058 else
11059   cat > conftest.$ac_ext <<EOF
11060 #line 11061 "configure"
11061 #include "confdefs.h"
11062 /* System header to define __stub macros and hopefully few prototypes,
11063     which can conflict with char $ac_func(); below.  */
11064 #include <assert.h>
11065 /* Override any gcc2 internal prototype to avoid an error.  */
11066 /* We use char because int might match the return type of a gcc2
11067     builtin and then its argument prototype would still apply.  */
11068 char $ac_func();
11069 char (*f)();
11070
11071 int main() {
11072
11073 /* The GNU C library defines this for functions which it implements
11074     to always fail with ENOSYS.  Some functions are actually named
11075     something starting with __ and the normal name is an alias.  */
11076 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11077 choke me
11078 #else
11079 f = $ac_func;
11080 #endif
11081
11082 ; return 0; }
11083 EOF
11084 if { (eval echo configure:11085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11085   rm -rf conftest*
11086   eval "ac_cv_func_$ac_func=yes"
11087 else
11088   echo "configure: failed program was:" >&5
11089   cat conftest.$ac_ext >&5
11090   rm -rf conftest*
11091   eval "ac_cv_func_$ac_func=no"
11092 fi
11093 rm -f conftest*
11094 fi
11095
11096 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11097   echo "$ac_t""yes" 1>&6
11098     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11099   cat >> confdefs.h <<EOF
11100 #define $ac_tr_func 1
11101 EOF
11102  
11103 else
11104   echo "$ac_t""no" 1>&6
11105 fi
11106 done
11107
11108
11109                         
11110         for ac_func in pthread_kill_other_threads_np
11111 do
11112 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11113 echo "configure:11114: checking for $ac_func" >&5
11114 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11115   echo $ac_n "(cached) $ac_c" 1>&6
11116 else
11117   cat > conftest.$ac_ext <<EOF
11118 #line 11119 "configure"
11119 #include "confdefs.h"
11120 /* System header to define __stub macros and hopefully few prototypes,
11121     which can conflict with char $ac_func(); below.  */
11122 #include <assert.h>
11123 /* Override any gcc2 internal prototype to avoid an error.  */
11124 /* We use char because int might match the return type of a gcc2
11125     builtin and then its argument prototype would still apply.  */
11126 char $ac_func();
11127 char (*f)();
11128
11129 int main() {
11130
11131 /* The GNU C library defines this for functions which it implements
11132     to always fail with ENOSYS.  Some functions are actually named
11133     something starting with __ and the normal name is an alias.  */
11134 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11135 choke me
11136 #else
11137 f = $ac_func;
11138 #endif
11139
11140 ; return 0; }
11141 EOF
11142 if { (eval echo configure:11143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11143   rm -rf conftest*
11144   eval "ac_cv_func_$ac_func=yes"
11145 else
11146   echo "configure: failed program was:" >&5
11147   cat conftest.$ac_ext >&5
11148   rm -rf conftest*
11149   eval "ac_cv_func_$ac_func=no"
11150 fi
11151 rm -f conftest*
11152 fi
11153
11154 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11155   echo "$ac_t""yes" 1>&6
11156     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11157   cat >> confdefs.h <<EOF
11158 #define $ac_tr_func 1
11159 EOF
11160  
11161 else
11162   echo "$ac_t""no" 1>&6
11163 fi
11164 done
11165
11166         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11167 echo "configure:11168: checking for LinuxThreads implementation" >&5
11168 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11169   echo $ac_n "(cached) $ac_c" 1>&6
11170 else
11171   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11172 fi
11173
11174 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11175
11176                         
11177         
11178         
11179         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11180 echo "configure:11181: checking for LinuxThreads consistency" >&5
11181 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11182   echo $ac_n "(cached) $ac_c" 1>&6
11183 else
11184   
11185                 if test $ol_cv_header_linux_threads = yes -a \
11186                         $ol_cv_sys_linux_threads = yes; then
11187                         ol_cv_linux_threads=yes
11188                 elif test $ol_cv_header_linux_threads = no -a \
11189                         $ol_cv_sys_linux_threads = no; then
11190                         ol_cv_linux_threads=no
11191                 else
11192                         ol_cv_linux_threads=error
11193                 fi
11194         
11195 fi
11196
11197 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11198
11199
11200                         if test $ol_cv_linux_threads = error; then
11201                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11202                         fi
11203
11204                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11205 echo "configure:11206: checking if pthread_create() works" >&5
11206 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11207   echo $ac_n "(cached) $ac_c" 1>&6
11208 else
11209   
11210                         if test "$cross_compiling" = yes; then
11211                                 ol_cv_pthread_create_works=yes
11212 else
11213   cat > conftest.$ac_ext <<EOF
11214 #line 11215 "configure"
11215 #include "confdefs.h"
11216 /* pthread test headers */
11217 #include <pthread.h>
11218 #ifndef NULL
11219 #define NULL (void*)0
11220 #endif
11221
11222 static void *task(p)
11223         void *p;
11224 {
11225         return (void *) (p == NULL);
11226 }
11227
11228
11229 int main(argc, argv)
11230         int argc;
11231         char **argv;
11232 {
11233
11234         /* pthread test function */
11235         pthread_t t;
11236         int status;
11237         int detach = 1;
11238
11239 #ifdef HAVE_PTHREADS_FINAL
11240         /* Final pthreads */
11241         pthread_attr_t attr;
11242
11243         status = pthread_attr_init(&attr);
11244         if( status ) return status;
11245
11246 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11247         if( !detach ) {
11248 #if defined( PTHREAD_CREATE_JOINABLE )
11249                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11250 #else
11251                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11252 #endif
11253
11254 #ifdef PTHREAD_CREATE_DETACHED
11255         } else {
11256                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11257 #endif
11258         }
11259         if( status ) return status;
11260 #endif
11261
11262         status = pthread_create( &t, &attr, task, NULL );
11263         if( status ) return status;
11264
11265 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11266         if( detach ) {
11267                 /* give thread a chance to complete */
11268                 /* it should remain joinable and hence detachable */
11269                 sleep( 1 );
11270
11271                 status = pthread_detach( t );
11272                 if( status ) return status;
11273         }
11274 #endif
11275
11276 #else
11277         /* Draft 4 pthreads */
11278         status = pthread_create( &t, pthread_attr_default, task, NULL );
11279         if( status ) return status;
11280
11281         if( detach ) {
11282                 /* give thread a chance to complete */
11283                 /* it should remain joinable and hence detachable */
11284                 sleep( 1 );
11285
11286                 status = pthread_detach( &t );
11287                 if( status ) return status;
11288         }
11289 #endif
11290
11291 #ifdef HAVE_LINUX_THREADS
11292         pthread_kill_other_threads_np();
11293 #endif
11294
11295         return 0;
11296
11297 }
11298
11299 EOF
11300 if { (eval echo configure:11301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11301 then
11302   ol_cv_pthread_create_works=yes
11303 else
11304   echo "configure: failed program was:" >&5
11305   cat conftest.$ac_ext >&5
11306   rm -fr conftest*
11307   ol_cv_pthread_create_works=no
11308 fi
11309 rm -fr conftest*
11310 fi
11311
11312 fi
11313
11314 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11315
11316                         if test $ol_cv_pthread_create_works = no ; then
11317                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11318                         fi
11319
11320                                                 if test $ol_with_yielding_select = auto ; then
11321                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11322 echo "configure:11323: checking if select yields when using pthreads" >&5
11323 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11324   echo $ac_n "(cached) $ac_c" 1>&6
11325 else
11326   
11327                                 if test "$cross_compiling" = yes; then
11328   ol_cv_pthread_select_yields=cross
11329 else
11330   cat > conftest.$ac_ext <<EOF
11331 #line 11332 "configure"
11332 #include "confdefs.h"
11333
11334 #include <sys/types.h>
11335 #include <sys/time.h>
11336 #include <unistd.h>
11337 #include <pthread.h>
11338 #ifndef NULL
11339 #define NULL (void*) 0
11340 #endif
11341
11342 static int fildes[2];
11343
11344 static void *task(p)
11345         void *p;
11346 {
11347         int i;
11348         struct timeval tv;
11349
11350         fd_set rfds;
11351
11352         tv.tv_sec=10;
11353         tv.tv_usec=0;
11354
11355         FD_ZERO(&rfds);
11356         FD_SET(fildes[0], &rfds);
11357
11358         /* we're not interested in any fds */
11359         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11360
11361         if(i < 0) {
11362                 perror("select");
11363                 exit(10);
11364         }
11365
11366         exit(0); /* if we exit here, the select blocked the whole process */
11367 }
11368
11369 int main(argc, argv)
11370         int argc;
11371         char **argv;
11372 {
11373         pthread_t t;
11374
11375         /* create a pipe to select */
11376         if(pipe(&fildes[0])) {
11377                 perror("select");
11378                 exit(1);
11379         }
11380
11381 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11382         (void) pthread_setconcurrency(2);
11383 #else
11384 #ifdef HAVE_THR_SETCONCURRENCY
11385         /* Set Solaris LWP concurrency to 2 */
11386         thr_setconcurrency(2);
11387 #endif
11388 #endif
11389
11390 #if HAVE_PTHREADS_D4
11391         pthread_create(&t, pthread_attr_default, task, NULL);
11392 #else
11393         pthread_create(&t, NULL, task, NULL);
11394 #endif
11395
11396 #if HAVE_SCHED_YIELD
11397         sched_yield();  /* make sure task runs first */
11398 #else
11399 #ifdef HAVE_PTHREAD_YIELD
11400         pthread_yield();        /* make sure task runs first */
11401 #endif
11402 #endif
11403
11404         exit(2);
11405 }
11406 EOF
11407 if { (eval echo configure:11408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11408 then
11409   ol_cv_pthread_select_yields=no
11410 else
11411   echo "configure: failed program was:" >&5
11412   cat conftest.$ac_ext >&5
11413   rm -fr conftest*
11414   ol_cv_pthread_select_yields=yes
11415 fi
11416 rm -fr conftest*
11417 fi
11418
11419 fi
11420
11421 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11422
11423                                 if test $ol_cv_pthread_select_yields = cross ; then
11424                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11425                                 fi
11426
11427                                 if test $ol_cv_pthread_select_yields = yes ; then
11428                                         ol_with_yielding_select=yes
11429                                 fi
11430                         fi
11431
11432                                                 CPPFLAGS="$save_CPPFLAGS"
11433                         LIBS="$save_LIBS"
11434                 else
11435                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11436                 fi
11437         fi
11438
11439         if test $ol_with_threads = posix ; then
11440                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11441         fi
11442 fi
11443
11444 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11445         -o $ol_with_threads = mach ; then
11446
11447                 for ac_hdr in mach/cthreads.h cthread.h
11448 do
11449 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11450 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11451 echo "configure:11452: checking for $ac_hdr" >&5
11452 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11453   echo $ac_n "(cached) $ac_c" 1>&6
11454 else
11455   cat > conftest.$ac_ext <<EOF
11456 #line 11457 "configure"
11457 #include "confdefs.h"
11458 #include <$ac_hdr>
11459 EOF
11460 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11461 { (eval echo configure:11462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11462 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11463 if test -z "$ac_err"; then
11464   rm -rf conftest*
11465   eval "ac_cv_header_$ac_safe=yes"
11466 else
11467   echo "$ac_err" >&5
11468   echo "configure: failed program was:" >&5
11469   cat conftest.$ac_ext >&5
11470   rm -rf conftest*
11471   eval "ac_cv_header_$ac_safe=no"
11472 fi
11473 rm -f conftest*
11474 fi
11475 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11476   echo "$ac_t""yes" 1>&6
11477     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11478   cat >> confdefs.h <<EOF
11479 #define $ac_tr_hdr 1
11480 EOF
11481  
11482 else
11483   echo "$ac_t""no" 1>&6
11484 fi
11485 done
11486
11487         if test $ac_cv_header_mach_cthreads_h = yes ; then
11488                 ol_with_threads=found
11489
11490                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11491 echo "configure:11492: checking for cthread_fork" >&5
11492 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11493   echo $ac_n "(cached) $ac_c" 1>&6
11494 else
11495   cat > conftest.$ac_ext <<EOF
11496 #line 11497 "configure"
11497 #include "confdefs.h"
11498 /* System header to define __stub macros and hopefully few prototypes,
11499     which can conflict with char cthread_fork(); below.  */
11500 #include <assert.h>
11501 /* Override any gcc2 internal prototype to avoid an error.  */
11502 /* We use char because int might match the return type of a gcc2
11503     builtin and then its argument prototype would still apply.  */
11504 char cthread_fork();
11505 char (*f)();
11506
11507 int main() {
11508
11509 /* The GNU C library defines this for functions which it implements
11510     to always fail with ENOSYS.  Some functions are actually named
11511     something starting with __ and the normal name is an alias.  */
11512 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11513 choke me
11514 #else
11515 f = cthread_fork;
11516 #endif
11517
11518 ; return 0; }
11519 EOF
11520 if { (eval echo configure:11521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11521   rm -rf conftest*
11522   eval "ac_cv_func_cthread_fork=yes"
11523 else
11524   echo "configure: failed program was:" >&5
11525   cat conftest.$ac_ext >&5
11526   rm -rf conftest*
11527   eval "ac_cv_func_cthread_fork=no"
11528 fi
11529 rm -f conftest*
11530 fi
11531
11532 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11533   echo "$ac_t""yes" 1>&6
11534   ol_link_threads=yes
11535 else
11536   echo "$ac_t""no" 1>&6
11537 fi
11538
11539
11540                 if test $ol_link_threads = no ; then
11541                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11542 echo "configure:11543: checking for cthread_fork with -all_load" >&5
11543 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11544   echo $ac_n "(cached) $ac_c" 1>&6
11545 else
11546   
11547                                                                 save_LIBS="$LIBS"
11548                                 LIBS="-all_load $LIBS"
11549                                 cat > conftest.$ac_ext <<EOF
11550 #line 11551 "configure"
11551 #include "confdefs.h"
11552 #include <mach/cthreads.h>
11553 int main() {
11554
11555                                         cthread_fork((void *)0, (void *)0);
11556                                         
11557 ; return 0; }
11558 EOF
11559 if { (eval echo configure:11560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11560   rm -rf conftest*
11561   ol_cv_cthread_all_load=yes
11562 else
11563   echo "configure: failed program was:" >&5
11564   cat conftest.$ac_ext >&5
11565   rm -rf conftest*
11566   ol_cv_cthread_all_load=no
11567 fi
11568 rm -f conftest*
11569                                                                 LIBS="$save_LIBS"
11570                         
11571 fi
11572
11573 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11574
11575                         if test $ol_cv_cthread_all_load = yes ; then
11576                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11577                                 ol_link_threads=mach
11578                         fi
11579                 fi
11580
11581     elif test $ac_cv_header_cthreads_h = yes ; then
11582                                 
11583                 ol_with_threads=found
11584  
11585                                 save_LIBS="$LIBS"
11586                 LIBS="$LIBS -lthreads"
11587                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11588 echo "configure:11589: checking for cthread_fork" >&5
11589 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11590   echo $ac_n "(cached) $ac_c" 1>&6
11591 else
11592   cat > conftest.$ac_ext <<EOF
11593 #line 11594 "configure"
11594 #include "confdefs.h"
11595 /* System header to define __stub macros and hopefully few prototypes,
11596     which can conflict with char cthread_fork(); below.  */
11597 #include <assert.h>
11598 /* Override any gcc2 internal prototype to avoid an error.  */
11599 /* We use char because int might match the return type of a gcc2
11600     builtin and then its argument prototype would still apply.  */
11601 char cthread_fork();
11602 char (*f)();
11603
11604 int main() {
11605
11606 /* The GNU C library defines this for functions which it implements
11607     to always fail with ENOSYS.  Some functions are actually named
11608     something starting with __ and the normal name is an alias.  */
11609 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11610 choke me
11611 #else
11612 f = cthread_fork;
11613 #endif
11614
11615 ; return 0; }
11616 EOF
11617 if { (eval echo configure:11618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11618   rm -rf conftest*
11619   eval "ac_cv_func_cthread_fork=yes"
11620 else
11621   echo "configure: failed program was:" >&5
11622   cat conftest.$ac_ext >&5
11623   rm -rf conftest*
11624   eval "ac_cv_func_cthread_fork=no"
11625 fi
11626 rm -f conftest*
11627 fi
11628
11629 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11630   echo "$ac_t""yes" 1>&6
11631   ol_link_threads=yes
11632 else
11633   echo "$ac_t""no" 1>&6
11634 fi
11635
11636                 LIBS="$save_LIBS"
11637
11638                 if test $ol_link_threads = yes ; then
11639                         LTHREAD_LIBS="-lthreads"
11640                         ol_link_threads=mach
11641                 else
11642                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11643                 fi
11644
11645         elif test $ol_with_threads = mach ; then
11646                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11647         fi
11648
11649         if test $ol_link_threads = mach ; then
11650                 cat >> confdefs.h <<\EOF
11651 #define HAVE_MACH_CTHREADS 1
11652 EOF
11653
11654         elif test $ol_with_threads = found ; then
11655                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11656         fi
11657 fi
11658
11659 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11660         -o $ol_with_threads = pth ; then
11661
11662         for ac_hdr in pth.h
11663 do
11664 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11665 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11666 echo "configure:11667: checking for $ac_hdr" >&5
11667 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11668   echo $ac_n "(cached) $ac_c" 1>&6
11669 else
11670   cat > conftest.$ac_ext <<EOF
11671 #line 11672 "configure"
11672 #include "confdefs.h"
11673 #include <$ac_hdr>
11674 EOF
11675 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11676 { (eval echo configure:11677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11677 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11678 if test -z "$ac_err"; then
11679   rm -rf conftest*
11680   eval "ac_cv_header_$ac_safe=yes"
11681 else
11682   echo "$ac_err" >&5
11683   echo "configure: failed program was:" >&5
11684   cat conftest.$ac_ext >&5
11685   rm -rf conftest*
11686   eval "ac_cv_header_$ac_safe=no"
11687 fi
11688 rm -f conftest*
11689 fi
11690 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11691   echo "$ac_t""yes" 1>&6
11692     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11693   cat >> confdefs.h <<EOF
11694 #define $ac_tr_hdr 1
11695 EOF
11696  
11697 else
11698   echo "$ac_t""no" 1>&6
11699 fi
11700 done
11701
11702
11703         if test $ac_cv_header_pth_h = yes ; then
11704                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11705 echo "configure:11706: checking for pth_version in -lpth" >&5
11706 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11707 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11708   echo $ac_n "(cached) $ac_c" 1>&6
11709 else
11710   ac_save_LIBS="$LIBS"
11711 LIBS="-lpth  $LIBS"
11712 cat > conftest.$ac_ext <<EOF
11713 #line 11714 "configure"
11714 #include "confdefs.h"
11715 /* Override any gcc2 internal prototype to avoid an error.  */
11716 /* We use char because int might match the return type of a gcc2
11717     builtin and then its argument prototype would still apply.  */
11718 char pth_version();
11719
11720 int main() {
11721 pth_version()
11722 ; return 0; }
11723 EOF
11724 if { (eval echo configure:11725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11725   rm -rf conftest*
11726   eval "ac_cv_lib_$ac_lib_var=yes"
11727 else
11728   echo "configure: failed program was:" >&5
11729   cat conftest.$ac_ext >&5
11730   rm -rf conftest*
11731   eval "ac_cv_lib_$ac_lib_var=no"
11732 fi
11733 rm -f conftest*
11734 LIBS="$ac_save_LIBS"
11735
11736 fi
11737 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11738   echo "$ac_t""yes" 1>&6
11739   have_pth=yes
11740 else
11741   echo "$ac_t""no" 1>&6
11742 have_pth=no
11743 fi
11744
11745
11746                 if test $have_pth = yes ; then
11747                         cat >> confdefs.h <<\EOF
11748 #define HAVE_GNU_PTH 1
11749 EOF
11750
11751                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11752                         ol_link_threads=pth
11753
11754                         if test $ol_with_yielding_select = auto ; then
11755                                 ol_with_yielding_select=yes
11756                         fi
11757                 fi
11758         fi
11759 fi
11760
11761 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11762         -o $ol_with_threads = lwp ; then
11763
11764                 for ac_hdr in thread.h synch.h
11765 do
11766 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11767 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11768 echo "configure:11769: checking for $ac_hdr" >&5
11769 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11770   echo $ac_n "(cached) $ac_c" 1>&6
11771 else
11772   cat > conftest.$ac_ext <<EOF
11773 #line 11774 "configure"
11774 #include "confdefs.h"
11775 #include <$ac_hdr>
11776 EOF
11777 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11778 { (eval echo configure:11779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11779 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11780 if test -z "$ac_err"; then
11781   rm -rf conftest*
11782   eval "ac_cv_header_$ac_safe=yes"
11783 else
11784   echo "$ac_err" >&5
11785   echo "configure: failed program was:" >&5
11786   cat conftest.$ac_ext >&5
11787   rm -rf conftest*
11788   eval "ac_cv_header_$ac_safe=no"
11789 fi
11790 rm -f conftest*
11791 fi
11792 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11793   echo "$ac_t""yes" 1>&6
11794     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11795   cat >> confdefs.h <<EOF
11796 #define $ac_tr_hdr 1
11797 EOF
11798  
11799 else
11800   echo "$ac_t""no" 1>&6
11801 fi
11802 done
11803
11804         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11805                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11806 echo "configure:11807: checking for thr_create in -lthread" >&5
11807 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11808 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11809   echo $ac_n "(cached) $ac_c" 1>&6
11810 else
11811   ac_save_LIBS="$LIBS"
11812 LIBS="-lthread  $LIBS"
11813 cat > conftest.$ac_ext <<EOF
11814 #line 11815 "configure"
11815 #include "confdefs.h"
11816 /* Override any gcc2 internal prototype to avoid an error.  */
11817 /* We use char because int might match the return type of a gcc2
11818     builtin and then its argument prototype would still apply.  */
11819 char thr_create();
11820
11821 int main() {
11822 thr_create()
11823 ; return 0; }
11824 EOF
11825 if { (eval echo configure:11826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11826   rm -rf conftest*
11827   eval "ac_cv_lib_$ac_lib_var=yes"
11828 else
11829   echo "configure: failed program was:" >&5
11830   cat conftest.$ac_ext >&5
11831   rm -rf conftest*
11832   eval "ac_cv_lib_$ac_lib_var=no"
11833 fi
11834 rm -f conftest*
11835 LIBS="$ac_save_LIBS"
11836
11837 fi
11838 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11839   echo "$ac_t""yes" 1>&6
11840   have_thr=yes
11841 else
11842   echo "$ac_t""no" 1>&6
11843 have_thr=no
11844 fi
11845
11846
11847                 if test $have_thr = yes ; then
11848                         cat >> confdefs.h <<\EOF
11849 #define HAVE_THR 1
11850 EOF
11851
11852                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11853                         ol_link_threads=thr
11854
11855                         if test $ol_with_yielding_select = auto ; then
11856                                 ol_with_yielding_select=yes
11857                         fi
11858
11859                                                 for ac_func in \
11860                                 thr_setconcurrency \
11861                                 thr_getconcurrency \
11862                         
11863 do
11864 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11865 echo "configure:11866: checking for $ac_func" >&5
11866 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11867   echo $ac_n "(cached) $ac_c" 1>&6
11868 else
11869   cat > conftest.$ac_ext <<EOF
11870 #line 11871 "configure"
11871 #include "confdefs.h"
11872 /* System header to define __stub macros and hopefully few prototypes,
11873     which can conflict with char $ac_func(); below.  */
11874 #include <assert.h>
11875 /* Override any gcc2 internal prototype to avoid an error.  */
11876 /* We use char because int might match the return type of a gcc2
11877     builtin and then its argument prototype would still apply.  */
11878 char $ac_func();
11879 char (*f)();
11880
11881 int main() {
11882
11883 /* The GNU C library defines this for functions which it implements
11884     to always fail with ENOSYS.  Some functions are actually named
11885     something starting with __ and the normal name is an alias.  */
11886 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11887 choke me
11888 #else
11889 f = $ac_func;
11890 #endif
11891
11892 ; return 0; }
11893 EOF
11894 if { (eval echo configure:11895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11895   rm -rf conftest*
11896   eval "ac_cv_func_$ac_func=yes"
11897 else
11898   echo "configure: failed program was:" >&5
11899   cat conftest.$ac_ext >&5
11900   rm -rf conftest*
11901   eval "ac_cv_func_$ac_func=no"
11902 fi
11903 rm -f conftest*
11904 fi
11905
11906 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11907   echo "$ac_t""yes" 1>&6
11908     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11909   cat >> confdefs.h <<EOF
11910 #define $ac_tr_func 1
11911 EOF
11912  
11913 else
11914   echo "$ac_t""no" 1>&6
11915 fi
11916 done
11917
11918                 fi
11919         fi
11920
11921                 for ac_hdr in lwp/lwp.h
11922 do
11923 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11924 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11925 echo "configure:11926: checking for $ac_hdr" >&5
11926 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11927   echo $ac_n "(cached) $ac_c" 1>&6
11928 else
11929   cat > conftest.$ac_ext <<EOF
11930 #line 11931 "configure"
11931 #include "confdefs.h"
11932 #include <$ac_hdr>
11933 EOF
11934 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11935 { (eval echo configure:11936: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11936 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11937 if test -z "$ac_err"; then
11938   rm -rf conftest*
11939   eval "ac_cv_header_$ac_safe=yes"
11940 else
11941   echo "$ac_err" >&5
11942   echo "configure: failed program was:" >&5
11943   cat conftest.$ac_ext >&5
11944   rm -rf conftest*
11945   eval "ac_cv_header_$ac_safe=no"
11946 fi
11947 rm -f conftest*
11948 fi
11949 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11950   echo "$ac_t""yes" 1>&6
11951     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11952   cat >> confdefs.h <<EOF
11953 #define $ac_tr_hdr 1
11954 EOF
11955  
11956 else
11957   echo "$ac_t""no" 1>&6
11958 fi
11959 done
11960
11961         if test $ac_cv_header_lwp_lwp_h = yes ; then
11962                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11963 echo "configure:11964: checking for lwp_create in -llwp" >&5
11964 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11965 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11966   echo $ac_n "(cached) $ac_c" 1>&6
11967 else
11968   ac_save_LIBS="$LIBS"
11969 LIBS="-llwp  $LIBS"
11970 cat > conftest.$ac_ext <<EOF
11971 #line 11972 "configure"
11972 #include "confdefs.h"
11973 /* Override any gcc2 internal prototype to avoid an error.  */
11974 /* We use char because int might match the return type of a gcc2
11975     builtin and then its argument prototype would still apply.  */
11976 char lwp_create();
11977
11978 int main() {
11979 lwp_create()
11980 ; return 0; }
11981 EOF
11982 if { (eval echo configure:11983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11983   rm -rf conftest*
11984   eval "ac_cv_lib_$ac_lib_var=yes"
11985 else
11986   echo "configure: failed program was:" >&5
11987   cat conftest.$ac_ext >&5
11988   rm -rf conftest*
11989   eval "ac_cv_lib_$ac_lib_var=no"
11990 fi
11991 rm -f conftest*
11992 LIBS="$ac_save_LIBS"
11993
11994 fi
11995 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11996   echo "$ac_t""yes" 1>&6
11997   have_lwp=yes
11998 else
11999   echo "$ac_t""no" 1>&6
12000 have_lwp=no
12001 fi
12002
12003
12004                 if test $have_lwp = yes ; then
12005                         cat >> confdefs.h <<\EOF
12006 #define HAVE_LWP 1
12007 EOF
12008
12009                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12010                         ol_link_threads=lwp
12011
12012                         if test $ol_with_yielding_select = auto ; then
12013                                 ol_with_yielding_select=no
12014                         fi
12015                 fi
12016         fi
12017 fi
12018
12019 if test $ol_with_yielding_select = yes ; then
12020         cat >> confdefs.h <<\EOF
12021 #define HAVE_YIELDING_SELECT 1
12022 EOF
12023
12024 fi
12025
12026 if test $ol_with_threads = manual ; then
12027                 ol_link_threads=yes
12028
12029         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12030
12031         for ac_hdr in pthread.h sched.h
12032 do
12033 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12034 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12035 echo "configure:12036: checking for $ac_hdr" >&5
12036 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12037   echo $ac_n "(cached) $ac_c" 1>&6
12038 else
12039   cat > conftest.$ac_ext <<EOF
12040 #line 12041 "configure"
12041 #include "confdefs.h"
12042 #include <$ac_hdr>
12043 EOF
12044 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12045 { (eval echo configure:12046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12046 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12047 if test -z "$ac_err"; then
12048   rm -rf conftest*
12049   eval "ac_cv_header_$ac_safe=yes"
12050 else
12051   echo "$ac_err" >&5
12052   echo "configure: failed program was:" >&5
12053   cat conftest.$ac_ext >&5
12054   rm -rf conftest*
12055   eval "ac_cv_header_$ac_safe=no"
12056 fi
12057 rm -f conftest*
12058 fi
12059 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12060   echo "$ac_t""yes" 1>&6
12061     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12062   cat >> confdefs.h <<EOF
12063 #define $ac_tr_hdr 1
12064 EOF
12065  
12066 else
12067   echo "$ac_t""no" 1>&6
12068 fi
12069 done
12070
12071         for ac_func in sched_yield pthread_yield
12072 do
12073 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12074 echo "configure:12075: checking for $ac_func" >&5
12075 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12076   echo $ac_n "(cached) $ac_c" 1>&6
12077 else
12078   cat > conftest.$ac_ext <<EOF
12079 #line 12080 "configure"
12080 #include "confdefs.h"
12081 /* System header to define __stub macros and hopefully few prototypes,
12082     which can conflict with char $ac_func(); below.  */
12083 #include <assert.h>
12084 /* Override any gcc2 internal prototype to avoid an error.  */
12085 /* We use char because int might match the return type of a gcc2
12086     builtin and then its argument prototype would still apply.  */
12087 char $ac_func();
12088 char (*f)();
12089
12090 int main() {
12091
12092 /* The GNU C library defines this for functions which it implements
12093     to always fail with ENOSYS.  Some functions are actually named
12094     something starting with __ and the normal name is an alias.  */
12095 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12096 choke me
12097 #else
12098 f = $ac_func;
12099 #endif
12100
12101 ; return 0; }
12102 EOF
12103 if { (eval echo configure:12104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12104   rm -rf conftest*
12105   eval "ac_cv_func_$ac_func=yes"
12106 else
12107   echo "configure: failed program was:" >&5
12108   cat conftest.$ac_ext >&5
12109   rm -rf conftest*
12110   eval "ac_cv_func_$ac_func=no"
12111 fi
12112 rm -f conftest*
12113 fi
12114
12115 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12116   echo "$ac_t""yes" 1>&6
12117     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12118   cat >> confdefs.h <<EOF
12119 #define $ac_tr_func 1
12120 EOF
12121  
12122 else
12123   echo "$ac_t""no" 1>&6
12124 fi
12125 done
12126
12127         
12128         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12129 echo "configure:12130: checking for LinuxThreads pthread.h" >&5
12130 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12131   echo $ac_n "(cached) $ac_c" 1>&6
12132 else
12133   cat > conftest.$ac_ext <<EOF
12134 #line 12135 "configure"
12135 #include "confdefs.h"
12136 #include <pthread.h>
12137 EOF
12138 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12139   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12140   rm -rf conftest*
12141   ol_cv_header_linux_threads=yes
12142 else
12143   rm -rf conftest*
12144   ol_cv_header_linux_threads=no
12145 fi
12146 rm -f conftest*
12147
12148                 
12149 fi
12150
12151 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12152         if test $ol_cv_header_linux_threads = yes; then
12153                 cat >> confdefs.h <<\EOF
12154 #define HAVE_LINUX_THREADS 1
12155 EOF
12156
12157         fi
12158
12159
12160         for ac_hdr in mach/cthreads.h
12161 do
12162 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12163 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12164 echo "configure:12165: checking for $ac_hdr" >&5
12165 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12166   echo $ac_n "(cached) $ac_c" 1>&6
12167 else
12168   cat > conftest.$ac_ext <<EOF
12169 #line 12170 "configure"
12170 #include "confdefs.h"
12171 #include <$ac_hdr>
12172 EOF
12173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12174 { (eval echo configure:12175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12176 if test -z "$ac_err"; then
12177   rm -rf conftest*
12178   eval "ac_cv_header_$ac_safe=yes"
12179 else
12180   echo "$ac_err" >&5
12181   echo "configure: failed program was:" >&5
12182   cat conftest.$ac_ext >&5
12183   rm -rf conftest*
12184   eval "ac_cv_header_$ac_safe=no"
12185 fi
12186 rm -f conftest*
12187 fi
12188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12189   echo "$ac_t""yes" 1>&6
12190     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12191   cat >> confdefs.h <<EOF
12192 #define $ac_tr_hdr 1
12193 EOF
12194  
12195 else
12196   echo "$ac_t""no" 1>&6
12197 fi
12198 done
12199
12200         for ac_hdr in lwp/lwp.h
12201 do
12202 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12203 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12204 echo "configure:12205: checking for $ac_hdr" >&5
12205 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12206   echo $ac_n "(cached) $ac_c" 1>&6
12207 else
12208   cat > conftest.$ac_ext <<EOF
12209 #line 12210 "configure"
12210 #include "confdefs.h"
12211 #include <$ac_hdr>
12212 EOF
12213 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12214 { (eval echo configure:12215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12215 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12216 if test -z "$ac_err"; then
12217   rm -rf conftest*
12218   eval "ac_cv_header_$ac_safe=yes"
12219 else
12220   echo "$ac_err" >&5
12221   echo "configure: failed program was:" >&5
12222   cat conftest.$ac_ext >&5
12223   rm -rf conftest*
12224   eval "ac_cv_header_$ac_safe=no"
12225 fi
12226 rm -f conftest*
12227 fi
12228 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12229   echo "$ac_t""yes" 1>&6
12230     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12231   cat >> confdefs.h <<EOF
12232 #define $ac_tr_hdr 1
12233 EOF
12234  
12235 else
12236   echo "$ac_t""no" 1>&6
12237 fi
12238 done
12239
12240         for ac_hdr in thread.h synch.h
12241 do
12242 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12243 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12244 echo "configure:12245: checking for $ac_hdr" >&5
12245 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12246   echo $ac_n "(cached) $ac_c" 1>&6
12247 else
12248   cat > conftest.$ac_ext <<EOF
12249 #line 12250 "configure"
12250 #include "confdefs.h"
12251 #include <$ac_hdr>
12252 EOF
12253 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12254 { (eval echo configure:12255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12255 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12256 if test -z "$ac_err"; then
12257   rm -rf conftest*
12258   eval "ac_cv_header_$ac_safe=yes"
12259 else
12260   echo "$ac_err" >&5
12261   echo "configure: failed program was:" >&5
12262   cat conftest.$ac_ext >&5
12263   rm -rf conftest*
12264   eval "ac_cv_header_$ac_safe=no"
12265 fi
12266 rm -f conftest*
12267 fi
12268 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12269   echo "$ac_t""yes" 1>&6
12270     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12271   cat >> confdefs.h <<EOF
12272 #define $ac_tr_hdr 1
12273 EOF
12274  
12275 else
12276   echo "$ac_t""no" 1>&6
12277 fi
12278 done
12279
12280 fi
12281
12282 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12283                         cat >> confdefs.h <<\EOF
12284 #define REENTRANT 1
12285 EOF
12286
12287         cat >> confdefs.h <<\EOF
12288 #define _REENTRANT 1
12289 EOF
12290
12291         cat >> confdefs.h <<\EOF
12292 #define THREAD_SAFE 1
12293 EOF
12294
12295         cat >> confdefs.h <<\EOF
12296 #define _THREAD_SAFE 1
12297 EOF
12298
12299         cat >> confdefs.h <<\EOF
12300 #define THREADSAFE 1
12301 EOF
12302
12303         cat >> confdefs.h <<\EOF
12304 #define _THREADSAFE 1
12305 EOF
12306
12307         cat >> confdefs.h <<\EOF
12308 #define _SGI_MP_SOURCE 1
12309 EOF
12310
12311
12312                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12313 echo "configure:12314: checking for thread specific errno" >&5
12314 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12315   echo $ac_n "(cached) $ac_c" 1>&6
12316 else
12317   
12318                 cat > conftest.$ac_ext <<EOF
12319 #line 12320 "configure"
12320 #include "confdefs.h"
12321 #include <errno.h>
12322 int main() {
12323 errno = 0;
12324 ; return 0; }
12325 EOF
12326 if { (eval echo configure:12327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12327   rm -rf conftest*
12328   ol_cv_errno_thread_specific=yes
12329 else
12330   echo "configure: failed program was:" >&5
12331   cat conftest.$ac_ext >&5
12332   rm -rf conftest*
12333   ol_cv_errno_thread_specific=no
12334 fi
12335 rm -f conftest*
12336         
12337 fi
12338
12339 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12340
12341                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12342 echo "configure:12343: checking for thread specific h_errno" >&5
12343 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12344   echo $ac_n "(cached) $ac_c" 1>&6
12345 else
12346   
12347                 cat > conftest.$ac_ext <<EOF
12348 #line 12349 "configure"
12349 #include "confdefs.h"
12350 #include <netdb.h>
12351 int main() {
12352 h_errno = 0;
12353 ; return 0; }
12354 EOF
12355 if { (eval echo configure:12356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12356   rm -rf conftest*
12357   ol_cv_h_errno_thread_specific=yes
12358 else
12359   echo "configure: failed program was:" >&5
12360   cat conftest.$ac_ext >&5
12361   rm -rf conftest*
12362   ol_cv_h_errno_thread_specific=no
12363 fi
12364 rm -f conftest*
12365         
12366 fi
12367
12368 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12369
12370         if test $ol_cv_errno_thread_specific != yes \
12371                 -o $ol_cv_h_errno_thread_specific != yes ; then
12372                 LIBS="$LTHREAD_LIBS $LIBS"
12373                 LTHREAD_LIBS=""
12374         fi
12375
12376 fi  
12377
12378 if test $ol_link_threads = no ; then
12379         if test $ol_with_threads = yes ; then
12380                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12381         fi
12382
12383         if test $ol_with_threads = auto ; then
12384                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12385                 ol_with_threads=no
12386         fi
12387
12388         cat >> confdefs.h <<\EOF
12389 #define NO_THREADS 1
12390 EOF
12391
12392         LTHREAD_LIBS=""
12393 fi
12394
12395 if test $ol_link_threads != no ; then
12396         cat >> confdefs.h <<\EOF
12397 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12398 EOF
12399
12400 fi
12401
12402 ol_link_ldbm=no 
12403
12404 if test $ol_with_ldbm_api = auto \
12405         -o $ol_with_ldbm_api = berkeley \
12406         -o $ol_with_ldbm_api = bcompat ; then
12407
12408         if test $ol_with_ldbm_api = bcompat; then \
12409                 ol_cv_berkeley_db=no
12410 for ac_hdr in db_185.h db.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 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12451         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12452 echo "configure:12453: checking if Berkeley DB header compatibility" >&5
12453 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12454   echo $ac_n "(cached) $ac_c" 1>&6
12455 else
12456   
12457                 cat > conftest.$ac_ext <<EOF
12458 #line 12459 "configure"
12459 #include "confdefs.h"
12460
12461 #if HAVE_DB_185_H
12462 #       include <db_185.h>
12463 #else
12464 #       include <db.h>
12465 #endif
12466
12467  /* this check could be improved */
12468 #ifndef DB_VERSION_MAJOR
12469 #       define DB_VERSION_MAJOR 1
12470 #endif
12471
12472 #if DB_VERSION_MAJOR == 1 
12473         __db_version_1
12474 #endif
12475
12476 EOF
12477 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12478   egrep "__db_version_1" >/dev/null 2>&1; then
12479   rm -rf conftest*
12480   ol_cv_header_db1=yes
12481 else
12482   rm -rf conftest*
12483   ol_cv_header_db1=no
12484 fi
12485 rm -f conftest*
12486
12487 fi
12488
12489 echo "$ac_t""$ol_cv_header_db1" 1>&6
12490
12491         if test $ol_cv_header_db1 = yes ; then
12492                 ol_cv_lib_db=no
12493 if test $ol_cv_lib_db = no ; then
12494         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12495 echo "configure:12496: checking for Berkeley DB link (default)" >&5
12496 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12497   echo $ac_n "(cached) $ac_c" 1>&6
12498 else
12499   
12500         ol_DB_LIB=
12501         ol_LIBS=$LIBS
12502         LIBS="$ol_DB_LIB $LIBS"
12503
12504         cat > conftest.$ac_ext <<EOF
12505 #line 12506 "configure"
12506 #include "confdefs.h"
12507
12508 #ifdef HAVE_DB_185_H
12509 # include <db_185.h>
12510 #else
12511 # include <db.h>
12512 #endif
12513
12514 #ifndef DB_VERSION_MAJOR
12515 # define DB_VERSION_MAJOR 1
12516 #endif
12517
12518 #ifndef NULL
12519 #define NULL ((void*)0)
12520 #endif
12521
12522 int main() {
12523
12524 #if DB_VERSION_MAJOR > 1
12525         {
12526                 char *version;
12527                 int major, minor, patch;
12528
12529                 version = db_version( &major, &minor, &patch );
12530
12531                 if( major != DB_VERSION_MAJOR ||
12532                         minor < DB_VERSION_MINOR )
12533                 {
12534                         printf("Berkeley DB version mismatch\n"
12535                                 "\texpected: %s\n\tgot: %s\n",
12536                                 DB_VERSION_STRING, version);
12537                         return 1;
12538                 }
12539         }
12540 #endif
12541
12542 #if DB_VERSION_MAJOR > 2
12543         db_env_create( NULL, 0 );
12544 #elif DB_VERSION_MAJOR > 1
12545         db_appexit( NULL );
12546 #else
12547         (void) dbopen( NULL, 0, 0, 0, NULL);
12548 #endif
12549
12550 ; return 0; }
12551 EOF
12552 if { (eval echo configure:12553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12553   rm -rf conftest*
12554   ol_cv_db_none=yes
12555 else
12556   echo "configure: failed program was:" >&5
12557   cat conftest.$ac_ext >&5
12558   rm -rf conftest*
12559   ol_cv_db_none=no
12560 fi
12561 rm -f conftest*
12562
12563         LIBS="$ol_LIBS"
12564
12565 fi
12566
12567 echo "$ac_t""$ol_cv_db_none" 1>&6
12568
12569         if test $ol_cv_db_none = yes ; then
12570                 ol_cv_lib_db=yes
12571         fi
12572 fi
12573
12574 if test $ol_cv_lib_db = no ; then
12575         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12576 echo "configure:12577: checking for Berkeley DB link (-ldb)" >&5
12577 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12578   echo $ac_n "(cached) $ac_c" 1>&6
12579 else
12580   
12581         ol_DB_LIB=-ldb
12582         ol_LIBS=$LIBS
12583         LIBS="$ol_DB_LIB $LIBS"
12584
12585         cat > conftest.$ac_ext <<EOF
12586 #line 12587 "configure"
12587 #include "confdefs.h"
12588
12589 #ifdef HAVE_DB_185_H
12590 # include <db_185.h>
12591 #else
12592 # include <db.h>
12593 #endif
12594
12595 #ifndef DB_VERSION_MAJOR
12596 # define DB_VERSION_MAJOR 1
12597 #endif
12598
12599 #ifndef NULL
12600 #define NULL ((void*)0)
12601 #endif
12602
12603 int main() {
12604
12605 #if DB_VERSION_MAJOR > 1
12606         {
12607                 char *version;
12608                 int major, minor, patch;
12609
12610                 version = db_version( &major, &minor, &patch );
12611
12612                 if( major != DB_VERSION_MAJOR ||
12613                         minor < DB_VERSION_MINOR )
12614                 {
12615                         printf("Berkeley DB version mismatch\n"
12616                                 "\texpected: %s\n\tgot: %s\n",
12617                                 DB_VERSION_STRING, version);
12618                         return 1;
12619                 }
12620         }
12621 #endif
12622
12623 #if DB_VERSION_MAJOR > 2
12624         db_env_create( NULL, 0 );
12625 #elif DB_VERSION_MAJOR > 1
12626         db_appexit( NULL );
12627 #else
12628         (void) dbopen( NULL, 0, 0, 0, NULL);
12629 #endif
12630
12631 ; return 0; }
12632 EOF
12633 if { (eval echo configure:12634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12634   rm -rf conftest*
12635   ol_cv_db_db=yes
12636 else
12637   echo "configure: failed program was:" >&5
12638   cat conftest.$ac_ext >&5
12639   rm -rf conftest*
12640   ol_cv_db_db=no
12641 fi
12642 rm -f conftest*
12643
12644         LIBS="$ol_LIBS"
12645
12646 fi
12647
12648 echo "$ac_t""$ol_cv_db_db" 1>&6
12649
12650         if test $ol_cv_db_db = yes ; then
12651                 ol_cv_lib_db=-ldb
12652         fi
12653 fi
12654
12655 if test $ol_cv_lib_db = no ; then
12656         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12657 echo "configure:12658: checking for Berkeley DB link (-ldb3)" >&5
12658 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12659   echo $ac_n "(cached) $ac_c" 1>&6
12660 else
12661   
12662         ol_DB_LIB=-ldb3
12663         ol_LIBS=$LIBS
12664         LIBS="$ol_DB_LIB $LIBS"
12665
12666         cat > conftest.$ac_ext <<EOF
12667 #line 12668 "configure"
12668 #include "confdefs.h"
12669
12670 #ifdef HAVE_DB_185_H
12671 # include <db_185.h>
12672 #else
12673 # include <db.h>
12674 #endif
12675
12676 #ifndef DB_VERSION_MAJOR
12677 # define DB_VERSION_MAJOR 1
12678 #endif
12679
12680 #ifndef NULL
12681 #define NULL ((void*)0)
12682 #endif
12683
12684 int main() {
12685
12686 #if DB_VERSION_MAJOR > 1
12687         {
12688                 char *version;
12689                 int major, minor, patch;
12690
12691                 version = db_version( &major, &minor, &patch );
12692
12693                 if( major != DB_VERSION_MAJOR ||
12694                         minor < DB_VERSION_MINOR )
12695                 {
12696                         printf("Berkeley DB version mismatch\n"
12697                                 "\texpected: %s\n\tgot: %s\n",
12698                                 DB_VERSION_STRING, version);
12699                         return 1;
12700                 }
12701         }
12702 #endif
12703
12704 #if DB_VERSION_MAJOR > 2
12705         db_env_create( NULL, 0 );
12706 #elif DB_VERSION_MAJOR > 1
12707         db_appexit( NULL );
12708 #else
12709         (void) dbopen( NULL, 0, 0, 0, NULL);
12710 #endif
12711
12712 ; return 0; }
12713 EOF
12714 if { (eval echo configure:12715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12715   rm -rf conftest*
12716   ol_cv_db_db3=yes
12717 else
12718   echo "configure: failed program was:" >&5
12719   cat conftest.$ac_ext >&5
12720   rm -rf conftest*
12721   ol_cv_db_db3=no
12722 fi
12723 rm -f conftest*
12724
12725         LIBS="$ol_LIBS"
12726
12727 fi
12728
12729 echo "$ac_t""$ol_cv_db_db3" 1>&6
12730
12731         if test $ol_cv_db_db3 = yes ; then
12732                 ol_cv_lib_db=-ldb3
12733         fi
12734 fi
12735
12736 if test $ol_cv_lib_db = no ; then
12737         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12738 echo "configure:12739: checking for Berkeley DB link (-ldb2)" >&5
12739 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12740   echo $ac_n "(cached) $ac_c" 1>&6
12741 else
12742   
12743         ol_DB_LIB=-ldb2
12744         ol_LIBS=$LIBS
12745         LIBS="$ol_DB_LIB $LIBS"
12746
12747         cat > conftest.$ac_ext <<EOF
12748 #line 12749 "configure"
12749 #include "confdefs.h"
12750
12751 #ifdef HAVE_DB_185_H
12752 # include <db_185.h>
12753 #else
12754 # include <db.h>
12755 #endif
12756
12757 #ifndef DB_VERSION_MAJOR
12758 # define DB_VERSION_MAJOR 1
12759 #endif
12760
12761 #ifndef NULL
12762 #define NULL ((void*)0)
12763 #endif
12764
12765 int main() {
12766
12767 #if DB_VERSION_MAJOR > 1
12768         {
12769                 char *version;
12770                 int major, minor, patch;
12771
12772                 version = db_version( &major, &minor, &patch );
12773
12774                 if( major != DB_VERSION_MAJOR ||
12775                         minor < DB_VERSION_MINOR )
12776                 {
12777                         printf("Berkeley DB version mismatch\n"
12778                                 "\texpected: %s\n\tgot: %s\n",
12779                                 DB_VERSION_STRING, version);
12780                         return 1;
12781                 }
12782         }
12783 #endif
12784
12785 #if DB_VERSION_MAJOR > 2
12786         db_env_create( NULL, 0 );
12787 #elif DB_VERSION_MAJOR > 1
12788         db_appexit( NULL );
12789 #else
12790         (void) dbopen( NULL, 0, 0, 0, NULL);
12791 #endif
12792
12793 ; return 0; }
12794 EOF
12795 if { (eval echo configure:12796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12796   rm -rf conftest*
12797   ol_cv_db_db2=yes
12798 else
12799   echo "configure: failed program was:" >&5
12800   cat conftest.$ac_ext >&5
12801   rm -rf conftest*
12802   ol_cv_db_db2=no
12803 fi
12804 rm -f conftest*
12805
12806         LIBS="$ol_LIBS"
12807
12808 fi
12809
12810 echo "$ac_t""$ol_cv_db_db2" 1>&6
12811
12812         if test $ol_cv_db_db2 = yes ; then
12813                 ol_cv_lib_db=-ldb2
12814         fi
12815 fi
12816
12817 if test $ol_cv_lib_db = no ; then
12818         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12819 echo "configure:12820: checking for Berkeley DB link (-ldb1)" >&5
12820 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12821   echo $ac_n "(cached) $ac_c" 1>&6
12822 else
12823   
12824         ol_DB_LIB=-ldb1
12825         ol_LIBS=$LIBS
12826         LIBS="$ol_DB_LIB $LIBS"
12827
12828         cat > conftest.$ac_ext <<EOF
12829 #line 12830 "configure"
12830 #include "confdefs.h"
12831
12832 #ifdef HAVE_DB_185_H
12833 # include <db_185.h>
12834 #else
12835 # include <db.h>
12836 #endif
12837
12838 #ifndef DB_VERSION_MAJOR
12839 # define DB_VERSION_MAJOR 1
12840 #endif
12841
12842 #ifndef NULL
12843 #define NULL ((void*)0)
12844 #endif
12845
12846 int main() {
12847
12848 #if DB_VERSION_MAJOR > 1
12849         {
12850                 char *version;
12851                 int major, minor, patch;
12852
12853                 version = db_version( &major, &minor, &patch );
12854
12855                 if( major != DB_VERSION_MAJOR ||
12856                         minor < DB_VERSION_MINOR )
12857                 {
12858                         printf("Berkeley DB version mismatch\n"
12859                                 "\texpected: %s\n\tgot: %s\n",
12860                                 DB_VERSION_STRING, version);
12861                         return 1;
12862                 }
12863         }
12864 #endif
12865
12866 #if DB_VERSION_MAJOR > 2
12867         db_env_create( NULL, 0 );
12868 #elif DB_VERSION_MAJOR > 1
12869         db_appexit( NULL );
12870 #else
12871         (void) dbopen( NULL, 0, 0, 0, NULL);
12872 #endif
12873
12874 ; return 0; }
12875 EOF
12876 if { (eval echo configure:12877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12877   rm -rf conftest*
12878   ol_cv_db_db1=yes
12879 else
12880   echo "configure: failed program was:" >&5
12881   cat conftest.$ac_ext >&5
12882   rm -rf conftest*
12883   ol_cv_db_db1=no
12884 fi
12885 rm -f conftest*
12886
12887         LIBS="$ol_LIBS"
12888
12889 fi
12890
12891 echo "$ac_t""$ol_cv_db_db1" 1>&6
12892
12893         if test $ol_cv_db_db1 = yes ; then
12894                 ol_cv_lib_db=-ldb1
12895         fi
12896 fi
12897
12898
12899                 if test "$ol_cv_lib_db" != no ; then
12900                         ol_cv_berkeley_db=yes
12901                 fi
12902         fi
12903 fi
12904
12905         else
12906                 ol_cv_berkeley_db=no
12907 for ac_hdr in db.h
12908 do
12909 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12910 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12911 echo "configure:12912: checking for $ac_hdr" >&5
12912 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12913   echo $ac_n "(cached) $ac_c" 1>&6
12914 else
12915   cat > conftest.$ac_ext <<EOF
12916 #line 12917 "configure"
12917 #include "confdefs.h"
12918 #include <$ac_hdr>
12919 EOF
12920 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12921 { (eval echo configure:12922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12922 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12923 if test -z "$ac_err"; then
12924   rm -rf conftest*
12925   eval "ac_cv_header_$ac_safe=yes"
12926 else
12927   echo "$ac_err" >&5
12928   echo "configure: failed program was:" >&5
12929   cat conftest.$ac_ext >&5
12930   rm -rf conftest*
12931   eval "ac_cv_header_$ac_safe=no"
12932 fi
12933 rm -f conftest*
12934 fi
12935 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12936   echo "$ac_t""yes" 1>&6
12937     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12938   cat >> confdefs.h <<EOF
12939 #define $ac_tr_hdr 1
12940 EOF
12941  
12942 else
12943   echo "$ac_t""no" 1>&6
12944 fi
12945 done
12946
12947 if test $ac_cv_header_db_h = yes; then
12948         ol_cv_lib_db=no
12949 if test $ol_cv_lib_db = no ; then
12950         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12951 echo "configure:12952: checking for Berkeley DB link (default)" >&5
12952 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12953   echo $ac_n "(cached) $ac_c" 1>&6
12954 else
12955   
12956         ol_DB_LIB=
12957         ol_LIBS=$LIBS
12958         LIBS="$ol_DB_LIB $LIBS"
12959
12960         cat > conftest.$ac_ext <<EOF
12961 #line 12962 "configure"
12962 #include "confdefs.h"
12963
12964 #ifdef HAVE_DB_185_H
12965 # include <db_185.h>
12966 #else
12967 # include <db.h>
12968 #endif
12969
12970 #ifndef DB_VERSION_MAJOR
12971 # define DB_VERSION_MAJOR 1
12972 #endif
12973
12974 #ifndef NULL
12975 #define NULL ((void*)0)
12976 #endif
12977
12978 int main() {
12979
12980 #if DB_VERSION_MAJOR > 1
12981         {
12982                 char *version;
12983                 int major, minor, patch;
12984
12985                 version = db_version( &major, &minor, &patch );
12986
12987                 if( major != DB_VERSION_MAJOR ||
12988                         minor < DB_VERSION_MINOR )
12989                 {
12990                         printf("Berkeley DB version mismatch\n"
12991                                 "\texpected: %s\n\tgot: %s\n",
12992                                 DB_VERSION_STRING, version);
12993                         return 1;
12994                 }
12995         }
12996 #endif
12997
12998 #if DB_VERSION_MAJOR > 2
12999         db_env_create( NULL, 0 );
13000 #elif DB_VERSION_MAJOR > 1
13001         db_appexit( NULL );
13002 #else
13003         (void) dbopen( NULL, 0, 0, 0, NULL);
13004 #endif
13005
13006 ; return 0; }
13007 EOF
13008 if { (eval echo configure:13009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13009   rm -rf conftest*
13010   ol_cv_db_none=yes
13011 else
13012   echo "configure: failed program was:" >&5
13013   cat conftest.$ac_ext >&5
13014   rm -rf conftest*
13015   ol_cv_db_none=no
13016 fi
13017 rm -f conftest*
13018
13019         LIBS="$ol_LIBS"
13020
13021 fi
13022
13023 echo "$ac_t""$ol_cv_db_none" 1>&6
13024
13025         if test $ol_cv_db_none = yes ; then
13026                 ol_cv_lib_db=yes
13027         fi
13028 fi
13029
13030 if test $ol_cv_lib_db = no ; then
13031         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13032 echo "configure:13033: checking for Berkeley DB link (-ldb)" >&5
13033 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13034   echo $ac_n "(cached) $ac_c" 1>&6
13035 else
13036   
13037         ol_DB_LIB=-ldb
13038         ol_LIBS=$LIBS
13039         LIBS="$ol_DB_LIB $LIBS"
13040
13041         cat > conftest.$ac_ext <<EOF
13042 #line 13043 "configure"
13043 #include "confdefs.h"
13044
13045 #ifdef HAVE_DB_185_H
13046 # include <db_185.h>
13047 #else
13048 # include <db.h>
13049 #endif
13050
13051 #ifndef DB_VERSION_MAJOR
13052 # define DB_VERSION_MAJOR 1
13053 #endif
13054
13055 #ifndef NULL
13056 #define NULL ((void*)0)
13057 #endif
13058
13059 int main() {
13060
13061 #if DB_VERSION_MAJOR > 1
13062         {
13063                 char *version;
13064                 int major, minor, patch;
13065
13066                 version = db_version( &major, &minor, &patch );
13067
13068                 if( major != DB_VERSION_MAJOR ||
13069                         minor < DB_VERSION_MINOR )
13070                 {
13071                         printf("Berkeley DB version mismatch\n"
13072                                 "\texpected: %s\n\tgot: %s\n",
13073                                 DB_VERSION_STRING, version);
13074                         return 1;
13075                 }
13076         }
13077 #endif
13078
13079 #if DB_VERSION_MAJOR > 2
13080         db_env_create( NULL, 0 );
13081 #elif DB_VERSION_MAJOR > 1
13082         db_appexit( NULL );
13083 #else
13084         (void) dbopen( NULL, 0, 0, 0, NULL);
13085 #endif
13086
13087 ; return 0; }
13088 EOF
13089 if { (eval echo configure:13090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13090   rm -rf conftest*
13091   ol_cv_db_db=yes
13092 else
13093   echo "configure: failed program was:" >&5
13094   cat conftest.$ac_ext >&5
13095   rm -rf conftest*
13096   ol_cv_db_db=no
13097 fi
13098 rm -f conftest*
13099
13100         LIBS="$ol_LIBS"
13101
13102 fi
13103
13104 echo "$ac_t""$ol_cv_db_db" 1>&6
13105
13106         if test $ol_cv_db_db = yes ; then
13107                 ol_cv_lib_db=-ldb
13108         fi
13109 fi
13110
13111 if test $ol_cv_lib_db = no ; then
13112         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13113 echo "configure:13114: checking for Berkeley DB link (-ldb3)" >&5
13114 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13115   echo $ac_n "(cached) $ac_c" 1>&6
13116 else
13117   
13118         ol_DB_LIB=-ldb3
13119         ol_LIBS=$LIBS
13120         LIBS="$ol_DB_LIB $LIBS"
13121
13122         cat > conftest.$ac_ext <<EOF
13123 #line 13124 "configure"
13124 #include "confdefs.h"
13125
13126 #ifdef HAVE_DB_185_H
13127 # include <db_185.h>
13128 #else
13129 # include <db.h>
13130 #endif
13131
13132 #ifndef DB_VERSION_MAJOR
13133 # define DB_VERSION_MAJOR 1
13134 #endif
13135
13136 #ifndef NULL
13137 #define NULL ((void*)0)
13138 #endif
13139
13140 int main() {
13141
13142 #if DB_VERSION_MAJOR > 1
13143         {
13144                 char *version;
13145                 int major, minor, patch;
13146
13147                 version = db_version( &major, &minor, &patch );
13148
13149                 if( major != DB_VERSION_MAJOR ||
13150                         minor < DB_VERSION_MINOR )
13151                 {
13152                         printf("Berkeley DB version mismatch\n"
13153                                 "\texpected: %s\n\tgot: %s\n",
13154                                 DB_VERSION_STRING, version);
13155                         return 1;
13156                 }
13157         }
13158 #endif
13159
13160 #if DB_VERSION_MAJOR > 2
13161         db_env_create( NULL, 0 );
13162 #elif DB_VERSION_MAJOR > 1
13163         db_appexit( NULL );
13164 #else
13165         (void) dbopen( NULL, 0, 0, 0, NULL);
13166 #endif
13167
13168 ; return 0; }
13169 EOF
13170 if { (eval echo configure:13171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13171   rm -rf conftest*
13172   ol_cv_db_db3=yes
13173 else
13174   echo "configure: failed program was:" >&5
13175   cat conftest.$ac_ext >&5
13176   rm -rf conftest*
13177   ol_cv_db_db3=no
13178 fi
13179 rm -f conftest*
13180
13181         LIBS="$ol_LIBS"
13182
13183 fi
13184
13185 echo "$ac_t""$ol_cv_db_db3" 1>&6
13186
13187         if test $ol_cv_db_db3 = yes ; then
13188                 ol_cv_lib_db=-ldb3
13189         fi
13190 fi
13191
13192 if test $ol_cv_lib_db = no ; then
13193         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13194 echo "configure:13195: checking for Berkeley DB link (-ldb2)" >&5
13195 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13196   echo $ac_n "(cached) $ac_c" 1>&6
13197 else
13198   
13199         ol_DB_LIB=-ldb2
13200         ol_LIBS=$LIBS
13201         LIBS="$ol_DB_LIB $LIBS"
13202
13203         cat > conftest.$ac_ext <<EOF
13204 #line 13205 "configure"
13205 #include "confdefs.h"
13206
13207 #ifdef HAVE_DB_185_H
13208 # include <db_185.h>
13209 #else
13210 # include <db.h>
13211 #endif
13212
13213 #ifndef DB_VERSION_MAJOR
13214 # define DB_VERSION_MAJOR 1
13215 #endif
13216
13217 #ifndef NULL
13218 #define NULL ((void*)0)
13219 #endif
13220
13221 int main() {
13222
13223 #if DB_VERSION_MAJOR > 1
13224         {
13225                 char *version;
13226                 int major, minor, patch;
13227
13228                 version = db_version( &major, &minor, &patch );
13229
13230                 if( major != DB_VERSION_MAJOR ||
13231                         minor < DB_VERSION_MINOR )
13232                 {
13233                         printf("Berkeley DB version mismatch\n"
13234                                 "\texpected: %s\n\tgot: %s\n",
13235                                 DB_VERSION_STRING, version);
13236                         return 1;
13237                 }
13238         }
13239 #endif
13240
13241 #if DB_VERSION_MAJOR > 2
13242         db_env_create( NULL, 0 );
13243 #elif DB_VERSION_MAJOR > 1
13244         db_appexit( NULL );
13245 #else
13246         (void) dbopen( NULL, 0, 0, 0, NULL);
13247 #endif
13248
13249 ; return 0; }
13250 EOF
13251 if { (eval echo configure:13252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13252   rm -rf conftest*
13253   ol_cv_db_db2=yes
13254 else
13255   echo "configure: failed program was:" >&5
13256   cat conftest.$ac_ext >&5
13257   rm -rf conftest*
13258   ol_cv_db_db2=no
13259 fi
13260 rm -f conftest*
13261
13262         LIBS="$ol_LIBS"
13263
13264 fi
13265
13266 echo "$ac_t""$ol_cv_db_db2" 1>&6
13267
13268         if test $ol_cv_db_db2 = yes ; then
13269                 ol_cv_lib_db=-ldb2
13270         fi
13271 fi
13272
13273 if test $ol_cv_lib_db = no ; then
13274         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13275 echo "configure:13276: checking for Berkeley DB link (-ldb1)" >&5
13276 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13277   echo $ac_n "(cached) $ac_c" 1>&6
13278 else
13279   
13280         ol_DB_LIB=-ldb1
13281         ol_LIBS=$LIBS
13282         LIBS="$ol_DB_LIB $LIBS"
13283
13284         cat > conftest.$ac_ext <<EOF
13285 #line 13286 "configure"
13286 #include "confdefs.h"
13287
13288 #ifdef HAVE_DB_185_H
13289 # include <db_185.h>
13290 #else
13291 # include <db.h>
13292 #endif
13293
13294 #ifndef DB_VERSION_MAJOR
13295 # define DB_VERSION_MAJOR 1
13296 #endif
13297
13298 #ifndef NULL
13299 #define NULL ((void*)0)
13300 #endif
13301
13302 int main() {
13303
13304 #if DB_VERSION_MAJOR > 1
13305         {
13306                 char *version;
13307                 int major, minor, patch;
13308
13309                 version = db_version( &major, &minor, &patch );
13310
13311                 if( major != DB_VERSION_MAJOR ||
13312                         minor < DB_VERSION_MINOR )
13313                 {
13314                         printf("Berkeley DB version mismatch\n"
13315                                 "\texpected: %s\n\tgot: %s\n",
13316                                 DB_VERSION_STRING, version);
13317                         return 1;
13318                 }
13319         }
13320 #endif
13321
13322 #if DB_VERSION_MAJOR > 2
13323         db_env_create( NULL, 0 );
13324 #elif DB_VERSION_MAJOR > 1
13325         db_appexit( NULL );
13326 #else
13327         (void) dbopen( NULL, 0, 0, 0, NULL);
13328 #endif
13329
13330 ; return 0; }
13331 EOF
13332 if { (eval echo configure:13333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13333   rm -rf conftest*
13334   ol_cv_db_db1=yes
13335 else
13336   echo "configure: failed program was:" >&5
13337   cat conftest.$ac_ext >&5
13338   rm -rf conftest*
13339   ol_cv_db_db1=no
13340 fi
13341 rm -f conftest*
13342
13343         LIBS="$ol_LIBS"
13344
13345 fi
13346
13347 echo "$ac_t""$ol_cv_db_db1" 1>&6
13348
13349         if test $ol_cv_db_db1 = yes ; then
13350                 ol_cv_lib_db=-ldb1
13351         fi
13352 fi
13353
13354
13355         if test "$ol_cv_lib_db" != no ; then
13356                 ol_cv_berkeley_db=yes
13357                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13358 echo "configure:13359: checking for Berkeley DB thread support" >&5
13359 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13360   echo $ac_n "(cached) $ac_c" 1>&6
13361 else
13362   
13363         ol_LIBS="$LIBS"
13364         if test $ol_cv_lib_db != yes ; then
13365                 LIBS="$ol_cv_lib_db"
13366         fi
13367
13368         if test "$cross_compiling" = yes; then
13369   ol_cv_berkeley_db_thread=cross
13370 else
13371   cat > conftest.$ac_ext <<EOF
13372 #line 13373 "configure"
13373 #include "confdefs.h"
13374
13375 #ifdef HAVE_DB_185_H
13376         choke me;
13377 #else
13378 #include <db.h>
13379 #endif
13380 #ifndef NULL
13381 #define NULL ((void *)0)
13382 #endif
13383 main()
13384 {
13385         int rc;
13386         u_int32_t flags = DB_CREATE |
13387 #ifdef DB_PRIVATE
13388                 DB_PRIVATE |
13389 #endif
13390                 DB_THREAD;
13391
13392 #if DB_VERSION_MAJOR > 2
13393         DB_ENV *env = NULL;
13394
13395         rc = db_env_create( &env, 0 );
13396
13397         flags |= DB_INIT_MPOOL;
13398 #ifdef DB_MPOOL_PRIVATE
13399         flags |= DB_MPOOL_PRIVATE;
13400 #endif
13401
13402         if( rc ) {
13403                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13404                 return rc;
13405         }
13406
13407 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13408         rc = env->open( env, NULL, flags, 0 );
13409 #else
13410         rc = env->open( env, NULL, NULL, flags, 0 );
13411 #endif
13412
13413         if ( rc == 0 ) {
13414                 rc = env->close( env, 0 );
13415         }
13416
13417         if( rc ) {
13418                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13419                 return rc;
13420         }
13421
13422 #else
13423         DB_ENV env;
13424         memset( &env, '\0', sizeof(env) );
13425
13426         rc = db_appinit( NULL, NULL, &env, flags );
13427
13428         if( rc == 0 ) {
13429                 db_appexit( &env );
13430         }
13431
13432         unlink("__db_mpool.share");
13433         unlink("__db_lock.share");
13434 #endif
13435
13436         return rc;
13437 }
13438 EOF
13439 if { (eval echo configure:13440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13440 then
13441   ol_cv_berkeley_db_thread=yes
13442 else
13443   echo "configure: failed program was:" >&5
13444   cat conftest.$ac_ext >&5
13445   rm -fr conftest*
13446   ol_cv_berkeley_db_thread=no
13447 fi
13448 rm -fr conftest*
13449 fi
13450
13451
13452         LIBS="$ol_LIBS"
13453
13454         if test $ol_cv_berkeley_db_thread != no ; then
13455                 cat >> confdefs.h <<\EOF
13456 #define HAVE_BERKELEY_DB_THREAD 1
13457 EOF
13458
13459         fi
13460
13461 fi
13462
13463 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13464         fi
13465 fi
13466
13467         fi
13468
13469         if test $ol_cv_berkeley_db != no ; then
13470                 cat >> confdefs.h <<\EOF
13471 #define HAVE_BERKELEY_DB 1
13472 EOF
13473
13474
13475                 ol_link_ldbm=berkeley
13476                 ol_with_ldbm_api=db
13477
13478                 if test $ol_with_ldbm_type = hash ; then
13479                         cat >> confdefs.h <<\EOF
13480 #define LDBM_USE_DBHASH 1
13481 EOF
13482
13483                 else
13484                         cat >> confdefs.h <<\EOF
13485 #define LDBM_USE_DBBTREE 1
13486 EOF
13487
13488                 fi
13489
13490                                                 if test $ol_cv_lib_db != yes ; then
13491                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13492                 fi
13493         fi
13494 fi
13495
13496 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13497         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13498         ol_with_ldbm_api=none
13499 fi
13500
13501 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13502         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13503 echo "configure:13504: checking for MDBM library" >&5
13504 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13505   echo $ac_n "(cached) $ac_c" 1>&6
13506 else
13507         ol_LIBS="$LIBS"
13508         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13509 echo "configure:13510: checking for mdbm_set_chain" >&5
13510 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13511   echo $ac_n "(cached) $ac_c" 1>&6
13512 else
13513   cat > conftest.$ac_ext <<EOF
13514 #line 13515 "configure"
13515 #include "confdefs.h"
13516 /* System header to define __stub macros and hopefully few prototypes,
13517     which can conflict with char mdbm_set_chain(); below.  */
13518 #include <assert.h>
13519 /* Override any gcc2 internal prototype to avoid an error.  */
13520 /* We use char because int might match the return type of a gcc2
13521     builtin and then its argument prototype would still apply.  */
13522 char mdbm_set_chain();
13523 char (*f)();
13524
13525 int main() {
13526
13527 /* The GNU C library defines this for functions which it implements
13528     to always fail with ENOSYS.  Some functions are actually named
13529     something starting with __ and the normal name is an alias.  */
13530 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13531 choke me
13532 #else
13533 f = mdbm_set_chain;
13534 #endif
13535
13536 ; return 0; }
13537 EOF
13538 if { (eval echo configure:13539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13539   rm -rf conftest*
13540   eval "ac_cv_func_mdbm_set_chain=yes"
13541 else
13542   echo "configure: failed program was:" >&5
13543   cat conftest.$ac_ext >&5
13544   rm -rf conftest*
13545   eval "ac_cv_func_mdbm_set_chain=no"
13546 fi
13547 rm -f conftest*
13548 fi
13549
13550 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13551   echo "$ac_t""yes" 1>&6
13552   ol_cv_lib_mdbm=yes
13553 else
13554   echo "$ac_t""no" 1>&6
13555
13556                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13557 echo "configure:13558: checking for mdbm_set_chain in -lmdbm" >&5
13558 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13559 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13560   echo $ac_n "(cached) $ac_c" 1>&6
13561 else
13562   ac_save_LIBS="$LIBS"
13563 LIBS="-lmdbm  $LIBS"
13564 cat > conftest.$ac_ext <<EOF
13565 #line 13566 "configure"
13566 #include "confdefs.h"
13567 /* Override any gcc2 internal prototype to avoid an error.  */
13568 /* We use char because int might match the return type of a gcc2
13569     builtin and then its argument prototype would still apply.  */
13570 char mdbm_set_chain();
13571
13572 int main() {
13573 mdbm_set_chain()
13574 ; return 0; }
13575 EOF
13576 if { (eval echo configure:13577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13577   rm -rf conftest*
13578   eval "ac_cv_lib_$ac_lib_var=yes"
13579 else
13580   echo "configure: failed program was:" >&5
13581   cat conftest.$ac_ext >&5
13582   rm -rf conftest*
13583   eval "ac_cv_lib_$ac_lib_var=no"
13584 fi
13585 rm -f conftest*
13586 LIBS="$ac_save_LIBS"
13587
13588 fi
13589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13590   echo "$ac_t""yes" 1>&6
13591   ol_cv_lib_mdbm=-lmdbm
13592 else
13593   echo "$ac_t""no" 1>&6
13594 ol_cv_lib_mdbm=no
13595 fi
13596
13597         
13598 fi
13599
13600         LIBS="$ol_LIBS"
13601
13602 fi
13603
13604 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13605
13606
13607  for ac_hdr in mdbm.h
13608 do
13609 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13610 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13611 echo "configure:13612: checking for $ac_hdr" >&5
13612 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13613   echo $ac_n "(cached) $ac_c" 1>&6
13614 else
13615   cat > conftest.$ac_ext <<EOF
13616 #line 13617 "configure"
13617 #include "confdefs.h"
13618 #include <$ac_hdr>
13619 EOF
13620 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13621 { (eval echo configure:13622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13622 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13623 if test -z "$ac_err"; then
13624   rm -rf conftest*
13625   eval "ac_cv_header_$ac_safe=yes"
13626 else
13627   echo "$ac_err" >&5
13628   echo "configure: failed program was:" >&5
13629   cat conftest.$ac_ext >&5
13630   rm -rf conftest*
13631   eval "ac_cv_header_$ac_safe=no"
13632 fi
13633 rm -f conftest*
13634 fi
13635 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13636   echo "$ac_t""yes" 1>&6
13637     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13638   cat >> confdefs.h <<EOF
13639 #define $ac_tr_hdr 1
13640 EOF
13641  
13642 else
13643   echo "$ac_t""no" 1>&6
13644 fi
13645 done
13646
13647  echo $ac_n "checking for db""... $ac_c" 1>&6
13648 echo "configure:13649: checking for db" >&5
13649 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13650   echo $ac_n "(cached) $ac_c" 1>&6
13651 else
13652   
13653         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13654                 ol_cv_mdbm=no
13655         else
13656                 ol_cv_mdbm=yes
13657         fi
13658
13659 fi
13660
13661 echo "$ac_t""$ol_cv_mdbm" 1>&6
13662  if test $ol_cv_mdbm = yes ; then
13663         cat >> confdefs.h <<\EOF
13664 #define HAVE_MDBM 1
13665 EOF
13666
13667  fi
13668
13669
13670         if test $ol_cv_mdbm = yes ; then
13671                 ol_link_ldbm=mdbm
13672                 ol_with_ldbm_api=mdbm
13673                 if test $ol_cv_lib_mdbm != yes ; then
13674                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13675                 fi
13676         fi
13677 fi
13678
13679 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13680         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13681 echo "configure:13682: checking for GDBM library" >&5
13682 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13683   echo $ac_n "(cached) $ac_c" 1>&6
13684 else
13685         ol_LIBS="$LIBS"
13686         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13687 echo "configure:13688: checking for gdbm_open" >&5
13688 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13689   echo $ac_n "(cached) $ac_c" 1>&6
13690 else
13691   cat > conftest.$ac_ext <<EOF
13692 #line 13693 "configure"
13693 #include "confdefs.h"
13694 /* System header to define __stub macros and hopefully few prototypes,
13695     which can conflict with char gdbm_open(); below.  */
13696 #include <assert.h>
13697 /* Override any gcc2 internal prototype to avoid an error.  */
13698 /* We use char because int might match the return type of a gcc2
13699     builtin and then its argument prototype would still apply.  */
13700 char gdbm_open();
13701 char (*f)();
13702
13703 int main() {
13704
13705 /* The GNU C library defines this for functions which it implements
13706     to always fail with ENOSYS.  Some functions are actually named
13707     something starting with __ and the normal name is an alias.  */
13708 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13709 choke me
13710 #else
13711 f = gdbm_open;
13712 #endif
13713
13714 ; return 0; }
13715 EOF
13716 if { (eval echo configure:13717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13717   rm -rf conftest*
13718   eval "ac_cv_func_gdbm_open=yes"
13719 else
13720   echo "configure: failed program was:" >&5
13721   cat conftest.$ac_ext >&5
13722   rm -rf conftest*
13723   eval "ac_cv_func_gdbm_open=no"
13724 fi
13725 rm -f conftest*
13726 fi
13727
13728 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13729   echo "$ac_t""yes" 1>&6
13730   ol_cv_lib_gdbm=yes
13731 else
13732   echo "$ac_t""no" 1>&6
13733
13734                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13735 echo "configure:13736: checking for gdbm_open in -lgdbm" >&5
13736 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13737 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13738   echo $ac_n "(cached) $ac_c" 1>&6
13739 else
13740   ac_save_LIBS="$LIBS"
13741 LIBS="-lgdbm  $LIBS"
13742 cat > conftest.$ac_ext <<EOF
13743 #line 13744 "configure"
13744 #include "confdefs.h"
13745 /* Override any gcc2 internal prototype to avoid an error.  */
13746 /* We use char because int might match the return type of a gcc2
13747     builtin and then its argument prototype would still apply.  */
13748 char gdbm_open();
13749
13750 int main() {
13751 gdbm_open()
13752 ; return 0; }
13753 EOF
13754 if { (eval echo configure:13755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13755   rm -rf conftest*
13756   eval "ac_cv_lib_$ac_lib_var=yes"
13757 else
13758   echo "configure: failed program was:" >&5
13759   cat conftest.$ac_ext >&5
13760   rm -rf conftest*
13761   eval "ac_cv_lib_$ac_lib_var=no"
13762 fi
13763 rm -f conftest*
13764 LIBS="$ac_save_LIBS"
13765
13766 fi
13767 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13768   echo "$ac_t""yes" 1>&6
13769   ol_cv_lib_gdbm=-lgdbm
13770 else
13771   echo "$ac_t""no" 1>&6
13772 ol_cv_lib_gdbm=no
13773 fi
13774
13775         
13776 fi
13777
13778         LIBS="$ol_LIBS"
13779
13780 fi
13781
13782 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13783
13784
13785  for ac_hdr in gdbm.h
13786 do
13787 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13788 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13789 echo "configure:13790: checking for $ac_hdr" >&5
13790 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13791   echo $ac_n "(cached) $ac_c" 1>&6
13792 else
13793   cat > conftest.$ac_ext <<EOF
13794 #line 13795 "configure"
13795 #include "confdefs.h"
13796 #include <$ac_hdr>
13797 EOF
13798 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13799 { (eval echo configure:13800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13800 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13801 if test -z "$ac_err"; then
13802   rm -rf conftest*
13803   eval "ac_cv_header_$ac_safe=yes"
13804 else
13805   echo "$ac_err" >&5
13806   echo "configure: failed program was:" >&5
13807   cat conftest.$ac_ext >&5
13808   rm -rf conftest*
13809   eval "ac_cv_header_$ac_safe=no"
13810 fi
13811 rm -f conftest*
13812 fi
13813 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13814   echo "$ac_t""yes" 1>&6
13815     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13816   cat >> confdefs.h <<EOF
13817 #define $ac_tr_hdr 1
13818 EOF
13819  
13820 else
13821   echo "$ac_t""no" 1>&6
13822 fi
13823 done
13824
13825  echo $ac_n "checking for db""... $ac_c" 1>&6
13826 echo "configure:13827: checking for db" >&5
13827 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13828   echo $ac_n "(cached) $ac_c" 1>&6
13829 else
13830   
13831         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13832                 ol_cv_gdbm=no
13833         else
13834                 ol_cv_gdbm=yes
13835         fi
13836
13837 fi
13838
13839 echo "$ac_t""$ol_cv_gdbm" 1>&6
13840  if test $ol_cv_gdbm = yes ; then
13841         cat >> confdefs.h <<\EOF
13842 #define HAVE_GDBM 1
13843 EOF
13844
13845  fi
13846
13847
13848         if test $ol_cv_gdbm = yes ; then
13849                 ol_link_ldbm=gdbm
13850                 ol_with_ldbm_api=gdbm
13851
13852                 if test $ol_cv_lib_gdbm != yes ; then
13853                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
13854                 fi
13855         fi
13856 fi
13857
13858 if test $ol_with_ldbm_api = ndbm ; then
13859         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
13860 echo "configure:13861: checking for NDBM library" >&5
13861 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
13862   echo $ac_n "(cached) $ac_c" 1>&6
13863 else
13864         ol_LIBS="$LIBS"
13865         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13866 echo "configure:13867: checking for dbm_open" >&5
13867 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
13868   echo $ac_n "(cached) $ac_c" 1>&6
13869 else
13870   cat > conftest.$ac_ext <<EOF
13871 #line 13872 "configure"
13872 #include "confdefs.h"
13873 /* System header to define __stub macros and hopefully few prototypes,
13874     which can conflict with char dbm_open(); below.  */
13875 #include <assert.h>
13876 /* Override any gcc2 internal prototype to avoid an error.  */
13877 /* We use char because int might match the return type of a gcc2
13878     builtin and then its argument prototype would still apply.  */
13879 char dbm_open();
13880 char (*f)();
13881
13882 int main() {
13883
13884 /* The GNU C library defines this for functions which it implements
13885     to always fail with ENOSYS.  Some functions are actually named
13886     something starting with __ and the normal name is an alias.  */
13887 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13888 choke me
13889 #else
13890 f = dbm_open;
13891 #endif
13892
13893 ; return 0; }
13894 EOF
13895 if { (eval echo configure:13896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13896   rm -rf conftest*
13897   eval "ac_cv_func_dbm_open=yes"
13898 else
13899   echo "configure: failed program was:" >&5
13900   cat conftest.$ac_ext >&5
13901   rm -rf conftest*
13902   eval "ac_cv_func_dbm_open=no"
13903 fi
13904 rm -f conftest*
13905 fi
13906
13907 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13908   echo "$ac_t""yes" 1>&6
13909   ol_cv_lib_ndbm=yes
13910 else
13911   echo "$ac_t""no" 1>&6
13912
13913                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
13914 echo "configure:13915: checking for dbm_open in -lndbm" >&5
13915 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13916 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13917   echo $ac_n "(cached) $ac_c" 1>&6
13918 else
13919   ac_save_LIBS="$LIBS"
13920 LIBS="-lndbm  $LIBS"
13921 cat > conftest.$ac_ext <<EOF
13922 #line 13923 "configure"
13923 #include "confdefs.h"
13924 /* Override any gcc2 internal prototype to avoid an error.  */
13925 /* We use char because int might match the return type of a gcc2
13926     builtin and then its argument prototype would still apply.  */
13927 char dbm_open();
13928
13929 int main() {
13930 dbm_open()
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_lib_$ac_lib_var=yes"
13936 else
13937   echo "configure: failed program was:" >&5
13938   cat conftest.$ac_ext >&5
13939   rm -rf conftest*
13940   eval "ac_cv_lib_$ac_lib_var=no"
13941 fi
13942 rm -f conftest*
13943 LIBS="$ac_save_LIBS"
13944
13945 fi
13946 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13947   echo "$ac_t""yes" 1>&6
13948   ol_cv_lib_ndbm=-lndbm
13949 else
13950   echo "$ac_t""no" 1>&6
13951
13952                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13953 echo "configure:13954: checking for dbm_open in -ldbm" >&5
13954 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13955 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13956   echo $ac_n "(cached) $ac_c" 1>&6
13957 else
13958   ac_save_LIBS="$LIBS"
13959 LIBS="-ldbm  $LIBS"
13960 cat > conftest.$ac_ext <<EOF
13961 #line 13962 "configure"
13962 #include "confdefs.h"
13963 /* Override any gcc2 internal prototype to avoid an error.  */
13964 /* We use char because int might match the return type of a gcc2
13965     builtin and then its argument prototype would still apply.  */
13966 char dbm_open();
13967
13968 int main() {
13969 dbm_open()
13970 ; return 0; }
13971 EOF
13972 if { (eval echo configure:13973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13973   rm -rf conftest*
13974   eval "ac_cv_lib_$ac_lib_var=yes"
13975 else
13976   echo "configure: failed program was:" >&5
13977   cat conftest.$ac_ext >&5
13978   rm -rf conftest*
13979   eval "ac_cv_lib_$ac_lib_var=no"
13980 fi
13981 rm -f conftest*
13982 LIBS="$ac_save_LIBS"
13983
13984 fi
13985 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13986   echo "$ac_t""yes" 1>&6
13987   ol_cv_lib_ndbm=-ldbm
13988 else
13989   echo "$ac_t""no" 1>&6
13990 ol_cv_lib_ndbm=no
13991 fi
13992                 
13993 fi
13994
13995         
13996 fi
13997
13998         LIBS="$ol_LIBS"
13999
14000 fi
14001
14002 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14003
14004
14005  for ac_hdr in ndbm.h
14006 do
14007 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14008 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14009 echo "configure:14010: checking for $ac_hdr" >&5
14010 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14011   echo $ac_n "(cached) $ac_c" 1>&6
14012 else
14013   cat > conftest.$ac_ext <<EOF
14014 #line 14015 "configure"
14015 #include "confdefs.h"
14016 #include <$ac_hdr>
14017 EOF
14018 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14019 { (eval echo configure:14020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14020 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14021 if test -z "$ac_err"; then
14022   rm -rf conftest*
14023   eval "ac_cv_header_$ac_safe=yes"
14024 else
14025   echo "$ac_err" >&5
14026   echo "configure: failed program was:" >&5
14027   cat conftest.$ac_ext >&5
14028   rm -rf conftest*
14029   eval "ac_cv_header_$ac_safe=no"
14030 fi
14031 rm -f conftest*
14032 fi
14033 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14034   echo "$ac_t""yes" 1>&6
14035     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14036   cat >> confdefs.h <<EOF
14037 #define $ac_tr_hdr 1
14038 EOF
14039  
14040 else
14041   echo "$ac_t""no" 1>&6
14042 fi
14043 done
14044
14045  echo $ac_n "checking for db""... $ac_c" 1>&6
14046 echo "configure:14047: checking for db" >&5
14047 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14048   echo $ac_n "(cached) $ac_c" 1>&6
14049 else
14050   
14051         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14052                 ol_cv_ndbm=no
14053         else
14054                 ol_cv_ndbm=yes
14055         fi
14056
14057 fi
14058
14059 echo "$ac_t""$ol_cv_ndbm" 1>&6
14060  if test $ol_cv_ndbm = yes ; then
14061         cat >> confdefs.h <<\EOF
14062 #define HAVE_NDBM 1
14063 EOF
14064
14065  fi
14066
14067
14068         if test $ol_cv_ndbm = yes ; then
14069                 ol_link_ldbm=ndbm
14070                 ol_with_ldbm_api=ndbm
14071
14072                 if test $ol_cv_lib_ndbm != yes ; then
14073                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14074                 fi
14075         fi
14076 fi
14077
14078 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14079         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14080         if test $ol_enable_ldbm = yes ; then
14081                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14082         fi
14083
14084         echo "configure: warning: disabling LDBM" 1>&2
14085         ol_enable_ldbm=no
14086 fi
14087
14088 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14089         LINK_BINS_DYNAMIC="yes"
14090 else
14091         LINK_BINS_DYNAMIC="no"
14092 fi
14093
14094 if test $ol_enable_wrappers != no ; then
14095         for ac_hdr in tcpd.h
14096 do
14097 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14098 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14099 echo "configure:14100: checking for $ac_hdr" >&5
14100 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14101   echo $ac_n "(cached) $ac_c" 1>&6
14102 else
14103   cat > conftest.$ac_ext <<EOF
14104 #line 14105 "configure"
14105 #include "confdefs.h"
14106 #include <$ac_hdr>
14107 EOF
14108 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14109 { (eval echo configure:14110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14110 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14111 if test -z "$ac_err"; then
14112   rm -rf conftest*
14113   eval "ac_cv_header_$ac_safe=yes"
14114 else
14115   echo "$ac_err" >&5
14116   echo "configure: failed program was:" >&5
14117   cat conftest.$ac_ext >&5
14118   rm -rf conftest*
14119   eval "ac_cv_header_$ac_safe=no"
14120 fi
14121 rm -f conftest*
14122 fi
14123 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14124   echo "$ac_t""yes" 1>&6
14125     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14126   cat >> confdefs.h <<EOF
14127 #define $ac_tr_hdr 1
14128 EOF
14129  
14130 else
14131   echo "$ac_t""no" 1>&6
14132 fi
14133 done
14134
14135
14136         if test $ac_cv_header_tcpd_h != yes ; then
14137                 have_wrappers=no
14138         else
14139                 cat > conftest.$ac_ext <<EOF
14140 #line 14141 "configure"
14141 #include "confdefs.h"
14142
14143 int allow_severity = 0;
14144 int deny_severity  = 0;
14145                 
14146 int main() {
14147 hosts_access()
14148 ; return 0; }
14149 EOF
14150 if { (eval echo configure:14151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14151   rm -rf conftest*
14152   have_wrappers=yes
14153 else
14154   echo "configure: failed program was:" >&5
14155   cat conftest.$ac_ext >&5
14156   rm -rf conftest*
14157   have_wrappers=no
14158 fi
14159 rm -f conftest*
14160         fi
14161
14162         if test $have_wrappers = yes ; then
14163                 cat >> confdefs.h <<\EOF
14164 #define HAVE_TCPD 1
14165 EOF
14166
14167                 WRAP_LIBS="-lwrap"
14168
14169                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14170 echo "configure:14171: checking for main in -lnsl" >&5
14171 ac_lib_var=`echo nsl'_'main | 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="-lnsl  $LIBS"
14177 cat > conftest.$ac_ext <<EOF
14178 #line 14179 "configure"
14179 #include "confdefs.h"
14180
14181 int main() {
14182 main()
14183 ; return 0; }
14184 EOF
14185 if { (eval echo configure:14186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14186   rm -rf conftest*
14187   eval "ac_cv_lib_$ac_lib_var=yes"
14188 else
14189   echo "configure: failed program was:" >&5
14190   cat conftest.$ac_ext >&5
14191   rm -rf conftest*
14192   eval "ac_cv_lib_$ac_lib_var=no"
14193 fi
14194 rm -f conftest*
14195 LIBS="$ac_save_LIBS"
14196
14197 fi
14198 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14199   echo "$ac_t""yes" 1>&6
14200     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14201     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14202   cat >> confdefs.h <<EOF
14203 #define $ac_tr_lib 1
14204 EOF
14205
14206   LIBS="-lnsl $LIBS"
14207
14208 else
14209   echo "$ac_t""no" 1>&6
14210 fi
14211
14212         else
14213                 echo "configure: warning: could not find -lwrap" 1>&2
14214                 if test $ol_enable_wrappers = yes ; then
14215                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14216                 fi
14217
14218                 echo "configure: warning: disabling wrappers support" 1>&2
14219                 ol_enable_wrappers=no
14220                 WRAP_LIBS=""
14221         fi
14222 fi
14223
14224 if test $ol_enable_syslog != no ; then
14225         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14226 echo "configure:14227: checking for openlog" >&5
14227 if eval "test \"\${ac_cv_func_openlog+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 /* System header to define __stub macros and hopefully few prototypes,
14234     which can conflict with char openlog(); below.  */
14235 #include <assert.h>
14236 /* Override any gcc2 internal prototype to avoid an error.  */
14237 /* We use char because int might match the return type of a gcc2
14238     builtin and then its argument prototype would still apply.  */
14239 char openlog();
14240 char (*f)();
14241
14242 int main() {
14243
14244 /* The GNU C library defines this for functions which it implements
14245     to always fail with ENOSYS.  Some functions are actually named
14246     something starting with __ and the normal name is an alias.  */
14247 #if defined (__stub_openlog) || defined (__stub___openlog)
14248 choke me
14249 #else
14250 f = openlog;
14251 #endif
14252
14253 ; return 0; }
14254 EOF
14255 if { (eval echo configure:14256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14256   rm -rf conftest*
14257   eval "ac_cv_func_openlog=yes"
14258 else
14259   echo "configure: failed program was:" >&5
14260   cat conftest.$ac_ext >&5
14261   rm -rf conftest*
14262   eval "ac_cv_func_openlog=no"
14263 fi
14264 rm -f conftest*
14265 fi
14266
14267 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14268   echo "$ac_t""yes" 1>&6
14269   :
14270 else
14271   echo "$ac_t""no" 1>&6
14272 fi
14273
14274         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14275                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14276         fi
14277         ol_enable_syslog=$ac_cv_func_openlog
14278 fi
14279
14280 ol_link_sql=no
14281 if test $ol_enable_sql != no ; then
14282         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14283 echo "configure:14284: checking for SQLDriverConnect in -liodbc" >&5
14284 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14285 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14286   echo $ac_n "(cached) $ac_c" 1>&6
14287 else
14288   ac_save_LIBS="$LIBS"
14289 LIBS="-liodbc  $LIBS"
14290 cat > conftest.$ac_ext <<EOF
14291 #line 14292 "configure"
14292 #include "confdefs.h"
14293 /* Override any gcc2 internal prototype to avoid an error.  */
14294 /* We use char because int might match the return type of a gcc2
14295     builtin and then its argument prototype would still apply.  */
14296 char SQLDriverConnect();
14297
14298 int main() {
14299 SQLDriverConnect()
14300 ; return 0; }
14301 EOF
14302 if { (eval echo configure:14303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14303   rm -rf conftest*
14304   eval "ac_cv_lib_$ac_lib_var=yes"
14305 else
14306   echo "configure: failed program was:" >&5
14307   cat conftest.$ac_ext >&5
14308   rm -rf conftest*
14309   eval "ac_cv_lib_$ac_lib_var=no"
14310 fi
14311 rm -f conftest*
14312 LIBS="$ac_save_LIBS"
14313
14314 fi
14315 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14316   echo "$ac_t""yes" 1>&6
14317   have_iodbc=yes
14318 else
14319   echo "$ac_t""no" 1>&6
14320 have_iodbc=no
14321 fi
14322
14323         if test $have_iodbc = yes ; then
14324                 ol_link_sql="-liodbc"
14325         else
14326                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14327 echo "configure:14328: checking for SQLDriverConnect in -lodbc" >&5
14328 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14329 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14330   echo $ac_n "(cached) $ac_c" 1>&6
14331 else
14332   ac_save_LIBS="$LIBS"
14333 LIBS="-lodbc  $LIBS"
14334 cat > conftest.$ac_ext <<EOF
14335 #line 14336 "configure"
14336 #include "confdefs.h"
14337 /* Override any gcc2 internal prototype to avoid an error.  */
14338 /* We use char because int might match the return type of a gcc2
14339     builtin and then its argument prototype would still apply.  */
14340 char SQLDriverConnect();
14341
14342 int main() {
14343 SQLDriverConnect()
14344 ; return 0; }
14345 EOF
14346 if { (eval echo configure:14347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14347   rm -rf conftest*
14348   eval "ac_cv_lib_$ac_lib_var=yes"
14349 else
14350   echo "configure: failed program was:" >&5
14351   cat conftest.$ac_ext >&5
14352   rm -rf conftest*
14353   eval "ac_cv_lib_$ac_lib_var=no"
14354 fi
14355 rm -f conftest*
14356 LIBS="$ac_save_LIBS"
14357
14358 fi
14359 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14360   echo "$ac_t""yes" 1>&6
14361   have_odbc=yes
14362 else
14363   echo "$ac_t""no" 1>&6
14364 have_odbc=no
14365 fi
14366
14367                 if test $have_odbc = yes ; then
14368                         ol_link_sql="-lodbc"
14369                 fi
14370         fi
14371
14372         if test $ol_link_sql != no ; then
14373                 SLAPD_SQL_LIBS="$ol_link_sql"
14374
14375         elif test $ol_enable_sql != auto ; then
14376                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14377         fi
14378 fi
14379
14380 ol_link_termcap=no
14381 for ac_hdr in termcap.h ncurses.h
14382 do
14383 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14384 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14385 echo "configure:14386: checking for $ac_hdr" >&5
14386 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14387   echo $ac_n "(cached) $ac_c" 1>&6
14388 else
14389   cat > conftest.$ac_ext <<EOF
14390 #line 14391 "configure"
14391 #include "confdefs.h"
14392 #include <$ac_hdr>
14393 EOF
14394 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14395 { (eval echo configure:14396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14396 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14397 if test -z "$ac_err"; then
14398   rm -rf conftest*
14399   eval "ac_cv_header_$ac_safe=yes"
14400 else
14401   echo "$ac_err" >&5
14402   echo "configure: failed program was:" >&5
14403   cat conftest.$ac_ext >&5
14404   rm -rf conftest*
14405   eval "ac_cv_header_$ac_safe=no"
14406 fi
14407 rm -f conftest*
14408 fi
14409 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14410   echo "$ac_t""yes" 1>&6
14411     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14412   cat >> confdefs.h <<EOF
14413 #define $ac_tr_hdr 1
14414 EOF
14415  
14416 else
14417   echo "$ac_t""no" 1>&6
14418 fi
14419 done
14420
14421
14422 if test $ol_link_termcap = no ; then
14423         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14424 echo "configure:14425: checking for tputs in -ltermcap" >&5
14425 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14426 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14427   echo $ac_n "(cached) $ac_c" 1>&6
14428 else
14429   ac_save_LIBS="$LIBS"
14430 LIBS="-ltermcap  $LIBS"
14431 cat > conftest.$ac_ext <<EOF
14432 #line 14433 "configure"
14433 #include "confdefs.h"
14434 /* Override any gcc2 internal prototype to avoid an error.  */
14435 /* We use char because int might match the return type of a gcc2
14436     builtin and then its argument prototype would still apply.  */
14437 char tputs();
14438
14439 int main() {
14440 tputs()
14441 ; return 0; }
14442 EOF
14443 if { (eval echo configure:14444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14444   rm -rf conftest*
14445   eval "ac_cv_lib_$ac_lib_var=yes"
14446 else
14447   echo "configure: failed program was:" >&5
14448   cat conftest.$ac_ext >&5
14449   rm -rf conftest*
14450   eval "ac_cv_lib_$ac_lib_var=no"
14451 fi
14452 rm -f conftest*
14453 LIBS="$ac_save_LIBS"
14454
14455 fi
14456 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14457   echo "$ac_t""yes" 1>&6
14458   have_termcap=yes
14459 else
14460   echo "$ac_t""no" 1>&6
14461 have_termcap=no
14462 fi
14463
14464         if test $have_termcap = yes ; then
14465                 cat >> confdefs.h <<\EOF
14466 #define HAVE_TERMCAP 1
14467 EOF
14468
14469                 ol_link_termcap=yes
14470                 TERMCAP_LIBS=-ltermcap
14471         fi
14472 fi
14473
14474 if test $ol_link_termcap = no ; then
14475         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14476 echo "configure:14477: checking for initscr in -lncurses" >&5
14477 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14478 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14479   echo $ac_n "(cached) $ac_c" 1>&6
14480 else
14481   ac_save_LIBS="$LIBS"
14482 LIBS="-lncurses  $LIBS"
14483 cat > conftest.$ac_ext <<EOF
14484 #line 14485 "configure"
14485 #include "confdefs.h"
14486 /* Override any gcc2 internal prototype to avoid an error.  */
14487 /* We use char because int might match the return type of a gcc2
14488     builtin and then its argument prototype would still apply.  */
14489 char initscr();
14490
14491 int main() {
14492 initscr()
14493 ; return 0; }
14494 EOF
14495 if { (eval echo configure:14496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14496   rm -rf conftest*
14497   eval "ac_cv_lib_$ac_lib_var=yes"
14498 else
14499   echo "configure: failed program was:" >&5
14500   cat conftest.$ac_ext >&5
14501   rm -rf conftest*
14502   eval "ac_cv_lib_$ac_lib_var=no"
14503 fi
14504 rm -f conftest*
14505 LIBS="$ac_save_LIBS"
14506
14507 fi
14508 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14509   echo "$ac_t""yes" 1>&6
14510   have_ncurses=yes
14511 else
14512   echo "$ac_t""no" 1>&6
14513 have_ncurses=no
14514 fi
14515
14516         if test $have_ncurses = yes ; then
14517                 cat >> confdefs.h <<\EOF
14518 #define HAVE_NCURSES 1
14519 EOF
14520
14521                 ol_link_termcap=yes
14522                 TERMCAP_LIBS=-lncurses
14523         fi
14524 fi
14525
14526 if test $ol_link_termcap = no ; then
14527         cat >> confdefs.h <<\EOF
14528 #define NO_TERMCAP 1
14529 EOF
14530
14531         TERMCAP_LIBS=
14532 fi
14533
14534 ol_link_sasl=no
14535 ol_link_spasswd=no
14536 if test $ol_with_cyrus_sasl != no ; then
14537         for ac_hdr in sasl.h
14538 do
14539 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14540 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14541 echo "configure:14542: checking for $ac_hdr" >&5
14542 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14543   echo $ac_n "(cached) $ac_c" 1>&6
14544 else
14545   cat > conftest.$ac_ext <<EOF
14546 #line 14547 "configure"
14547 #include "confdefs.h"
14548 #include <$ac_hdr>
14549 EOF
14550 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14551 { (eval echo configure:14552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14552 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14553 if test -z "$ac_err"; then
14554   rm -rf conftest*
14555   eval "ac_cv_header_$ac_safe=yes"
14556 else
14557   echo "$ac_err" >&5
14558   echo "configure: failed program was:" >&5
14559   cat conftest.$ac_ext >&5
14560   rm -rf conftest*
14561   eval "ac_cv_header_$ac_safe=no"
14562 fi
14563 rm -f conftest*
14564 fi
14565 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14566   echo "$ac_t""yes" 1>&6
14567     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14568   cat >> confdefs.h <<EOF
14569 #define $ac_tr_hdr 1
14570 EOF
14571  
14572 else
14573   echo "$ac_t""no" 1>&6
14574 fi
14575 done
14576
14577
14578         if test $ac_cv_header_sasl_h = yes ; then
14579                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14580 echo "configure:14581: checking for sasl_client_init in -lsasl" >&5
14581 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14582 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14583   echo $ac_n "(cached) $ac_c" 1>&6
14584 else
14585   ac_save_LIBS="$LIBS"
14586 LIBS="-lsasl  $LIBS"
14587 cat > conftest.$ac_ext <<EOF
14588 #line 14589 "configure"
14589 #include "confdefs.h"
14590 /* Override any gcc2 internal prototype to avoid an error.  */
14591 /* We use char because int might match the return type of a gcc2
14592     builtin and then its argument prototype would still apply.  */
14593 char sasl_client_init();
14594
14595 int main() {
14596 sasl_client_init()
14597 ; return 0; }
14598 EOF
14599 if { (eval echo configure:14600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14600   rm -rf conftest*
14601   eval "ac_cv_lib_$ac_lib_var=yes"
14602 else
14603   echo "configure: failed program was:" >&5
14604   cat conftest.$ac_ext >&5
14605   rm -rf conftest*
14606   eval "ac_cv_lib_$ac_lib_var=no"
14607 fi
14608 rm -f conftest*
14609 LIBS="$ac_save_LIBS"
14610
14611 fi
14612 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14613   echo "$ac_t""yes" 1>&6
14614   have_cyrus_sasl=yes
14615 else
14616   echo "$ac_t""no" 1>&6
14617 have_cyrus_sasl=no
14618 fi
14619
14620
14621                 if test $have_cyrus_sasl != no ; then
14622                         SASL_LIBS="-lsasl"
14623                         cat >> confdefs.h <<\EOF
14624 #define HAVE_CYRUS_SASL 1
14625 EOF
14626
14627                         ol_link_sasl=yes
14628                 fi
14629         fi
14630
14631         if test $ol_link_sasl = no ; then
14632                 if test $ol_with_cyrus_sasl != auto ; then
14633                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14634                 else
14635                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14636                         echo "configure: warning: SASL authentication not supported!" 1>&2
14637                         if test $ol_link_tls = no ; then
14638                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14639                         fi
14640                 fi
14641
14642         elif test $ol_enable_spasswd != no ; then
14643                 ol_link_spasswd=yes
14644         fi
14645
14646 else
14647         echo "configure: warning: SASL authentication not supported!" 1>&2
14648         if test $ol_link_tls = no ; then
14649                 echo "configure: warning: Strong authentication not supported!" 1>&2
14650         fi
14651 fi
14652
14653 if test $cross_compiling != yes ; then
14654         dev=no
14655         if test -r /dev/urandom ; then
14656                 dev="/dev/urandom";
14657         elif test -r /idev/urandom ; then
14658                 dev="/idev/urandom";
14659         elif test -r /dev/srandom ; then
14660                 dev="/dev/srandom";
14661         elif test -r /dev/random ; then
14662                 dev="/dev/random";
14663         elif test -r /idev/random ; then
14664                 dev="/idev/random";
14665         fi
14666
14667         if test $dev != no ; then
14668                 cat >> confdefs.h <<EOF
14669 #define URANDOM_DEVICE "$dev"
14670 EOF
14671
14672         fi
14673 fi
14674
14675 ol_link_fetch=no
14676 if test $ol_with_fetch != no ; then
14677         ol_LIBS=$LIBS
14678 LIBS="-lfetch -lcom_err $LIBS"
14679 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14680 echo "configure:14681: checking fetch(3) library" >&5
14681 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14682   echo $ac_n "(cached) $ac_c" 1>&6
14683 else
14684   
14685         cat > conftest.$ac_ext <<EOF
14686 #line 14687 "configure"
14687 #include "confdefs.h"
14688
14689 #include <sys/param.h>
14690 #include <stdio.h>
14691 #include <fetch.h>
14692 int main() {
14693 struct url *u = fetchParseURL("file:///"); 
14694 ; return 0; }
14695 EOF
14696 if { (eval echo configure:14697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14697   rm -rf conftest*
14698   ol_cv_lib_fetch=yes
14699 else
14700   echo "configure: failed program was:" >&5
14701   cat conftest.$ac_ext >&5
14702   rm -rf conftest*
14703   ol_cv_lib_fetch=no
14704 fi
14705 rm -f conftest*
14706 fi
14707
14708 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14709 LIBS=$ol_LIBS
14710 if test $ol_cv_lib_fetch != no ; then
14711         ol_link_fetch="-lfetch -lcom_err"
14712         cat >> confdefs.h <<\EOF
14713 #define HAVE_FETCH 1
14714 EOF
14715
14716 fi
14717
14718
14719         if test $ol_cv_lib_fetch != no ; then
14720                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14721                 ol_link_fetch=freebsd
14722
14723         elif test $ol_with_fetch != auto ; then
14724                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14725         fi 
14726 fi
14727
14728 ol_link_readline=no
14729 if test $ol_with_readline != no ; then
14730         for ac_hdr in readline/readline.h readline/history.h
14731 do
14732 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14733 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14734 echo "configure:14735: checking for $ac_hdr" >&5
14735 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14736   echo $ac_n "(cached) $ac_c" 1>&6
14737 else
14738   cat > conftest.$ac_ext <<EOF
14739 #line 14740 "configure"
14740 #include "confdefs.h"
14741 #include <$ac_hdr>
14742 EOF
14743 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14744 { (eval echo configure:14745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14745 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14746 if test -z "$ac_err"; then
14747   rm -rf conftest*
14748   eval "ac_cv_header_$ac_safe=yes"
14749 else
14750   echo "$ac_err" >&5
14751   echo "configure: failed program was:" >&5
14752   cat conftest.$ac_ext >&5
14753   rm -rf conftest*
14754   eval "ac_cv_header_$ac_safe=no"
14755 fi
14756 rm -f conftest*
14757 fi
14758 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14759   echo "$ac_t""yes" 1>&6
14760     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14761   cat >> confdefs.h <<EOF
14762 #define $ac_tr_hdr 1
14763 EOF
14764  
14765 else
14766   echo "$ac_t""no" 1>&6
14767 fi
14768 done
14769
14770
14771         if test $ac_cv_header_readline_readline_h = yes ; then
14772                 save_LIBS="$LIBS"
14773                 LIBS="$TERMCAP_LIBS $LIBS"
14774                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14775 echo "configure:14776: checking for readline in -lreadline" >&5
14776 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14777 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14778   echo $ac_n "(cached) $ac_c" 1>&6
14779 else
14780   ac_save_LIBS="$LIBS"
14781 LIBS="-lreadline  $LIBS"
14782 cat > conftest.$ac_ext <<EOF
14783 #line 14784 "configure"
14784 #include "confdefs.h"
14785 /* Override any gcc2 internal prototype to avoid an error.  */
14786 /* We use char because int might match the return type of a gcc2
14787     builtin and then its argument prototype would still apply.  */
14788 char readline();
14789
14790 int main() {
14791 readline()
14792 ; return 0; }
14793 EOF
14794 if { (eval echo configure:14795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14795   rm -rf conftest*
14796   eval "ac_cv_lib_$ac_lib_var=yes"
14797 else
14798   echo "configure: failed program was:" >&5
14799   cat conftest.$ac_ext >&5
14800   rm -rf conftest*
14801   eval "ac_cv_lib_$ac_lib_var=no"
14802 fi
14803 rm -f conftest*
14804 LIBS="$ac_save_LIBS"
14805
14806 fi
14807 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14808   echo "$ac_t""yes" 1>&6
14809   have_readline=yes
14810 else
14811   echo "$ac_t""no" 1>&6
14812 have_readline=no
14813 fi
14814
14815                 LIBS="$save_LIBS"
14816                         
14817                 if test $have_readline = yes ; then
14818                         ol_with_readline=found
14819                         ol_link_readline=yes
14820
14821                         READLINE_LIBS="-lreadline"
14822                 fi
14823         fi
14824 fi
14825
14826 if test $ol_link_readline = yes ; then
14827         cat >> confdefs.h <<\EOF
14828 #define HAVE_READLINE 1
14829 EOF
14830
14831 fi
14832
14833
14834 if test $ol_enable_crypt != no ; then
14835         echo $ac_n "checking for crypt""... $ac_c" 1>&6
14836 echo "configure:14837: checking for crypt" >&5
14837 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
14838   echo $ac_n "(cached) $ac_c" 1>&6
14839 else
14840   cat > conftest.$ac_ext <<EOF
14841 #line 14842 "configure"
14842 #include "confdefs.h"
14843 /* System header to define __stub macros and hopefully few prototypes,
14844     which can conflict with char crypt(); below.  */
14845 #include <assert.h>
14846 /* Override any gcc2 internal prototype to avoid an error.  */
14847 /* We use char because int might match the return type of a gcc2
14848     builtin and then its argument prototype would still apply.  */
14849 char crypt();
14850 char (*f)();
14851
14852 int main() {
14853
14854 /* The GNU C library defines this for functions which it implements
14855     to always fail with ENOSYS.  Some functions are actually named
14856     something starting with __ and the normal name is an alias.  */
14857 #if defined (__stub_crypt) || defined (__stub___crypt)
14858 choke me
14859 #else
14860 f = crypt;
14861 #endif
14862
14863 ; return 0; }
14864 EOF
14865 if { (eval echo configure:14866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14866   rm -rf conftest*
14867   eval "ac_cv_func_crypt=yes"
14868 else
14869   echo "configure: failed program was:" >&5
14870   cat conftest.$ac_ext >&5
14871   rm -rf conftest*
14872   eval "ac_cv_func_crypt=no"
14873 fi
14874 rm -f conftest*
14875 fi
14876
14877 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14878   echo "$ac_t""yes" 1>&6
14879   have_crypt=yes
14880 else
14881   echo "$ac_t""no" 1>&6
14882
14883                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14884 echo "configure:14885: checking for crypt in -lcrypt" >&5
14885 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14886 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14887   echo $ac_n "(cached) $ac_c" 1>&6
14888 else
14889   ac_save_LIBS="$LIBS"
14890 LIBS="-lcrypt  $LIBS"
14891 cat > conftest.$ac_ext <<EOF
14892 #line 14893 "configure"
14893 #include "confdefs.h"
14894 /* Override any gcc2 internal prototype to avoid an error.  */
14895 /* We use char because int might match the return type of a gcc2
14896     builtin and then its argument prototype would still apply.  */
14897 char crypt();
14898
14899 int main() {
14900 crypt()
14901 ; return 0; }
14902 EOF
14903 if { (eval echo configure:14904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14904   rm -rf conftest*
14905   eval "ac_cv_lib_$ac_lib_var=yes"
14906 else
14907   echo "configure: failed program was:" >&5
14908   cat conftest.$ac_ext >&5
14909   rm -rf conftest*
14910   eval "ac_cv_lib_$ac_lib_var=no"
14911 fi
14912 rm -f conftest*
14913 LIBS="$ac_save_LIBS"
14914
14915 fi
14916 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14917   echo "$ac_t""yes" 1>&6
14918   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14919                         have_crypt=yes
14920 else
14921   echo "$ac_t""no" 1>&6
14922 have_crypt=no
14923 fi
14924
14925 fi
14926
14927
14928         if test $have_crypt = yes ; then
14929                 cat >> confdefs.h <<\EOF
14930 #define HAVE_CRYPT 1
14931 EOF
14932
14933         else
14934                 echo "configure: warning: could not find crypt" 1>&2
14935                 if test $ol_enable_crypt = yes ; then
14936                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14937                 fi
14938
14939                 echo "configure: warning: disabling crypt support" 1>&2
14940                 ol_enable_crypt=no
14941         fi
14942 fi
14943
14944 if test $ol_enable_proctitle != no ; then
14945         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
14946 echo "configure:14947: checking for setproctitle" >&5
14947 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
14948   echo $ac_n "(cached) $ac_c" 1>&6
14949 else
14950   cat > conftest.$ac_ext <<EOF
14951 #line 14952 "configure"
14952 #include "confdefs.h"
14953 /* System header to define __stub macros and hopefully few prototypes,
14954     which can conflict with char setproctitle(); below.  */
14955 #include <assert.h>
14956 /* Override any gcc2 internal prototype to avoid an error.  */
14957 /* We use char because int might match the return type of a gcc2
14958     builtin and then its argument prototype would still apply.  */
14959 char setproctitle();
14960 char (*f)();
14961
14962 int main() {
14963
14964 /* The GNU C library defines this for functions which it implements
14965     to always fail with ENOSYS.  Some functions are actually named
14966     something starting with __ and the normal name is an alias.  */
14967 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
14968 choke me
14969 #else
14970 f = setproctitle;
14971 #endif
14972
14973 ; return 0; }
14974 EOF
14975 if { (eval echo configure:14976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14976   rm -rf conftest*
14977   eval "ac_cv_func_setproctitle=yes"
14978 else
14979   echo "configure: failed program was:" >&5
14980   cat conftest.$ac_ext >&5
14981   rm -rf conftest*
14982   eval "ac_cv_func_setproctitle=no"
14983 fi
14984 rm -f conftest*
14985 fi
14986
14987 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
14988   echo "$ac_t""yes" 1>&6
14989   have_setproctitle=yes
14990 else
14991   echo "$ac_t""no" 1>&6
14992
14993                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
14994 echo "configure:14995: checking for setproctitle in -lutil" >&5
14995 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
14996 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14997   echo $ac_n "(cached) $ac_c" 1>&6
14998 else
14999   ac_save_LIBS="$LIBS"
15000 LIBS="-lutil  $LIBS"
15001 cat > conftest.$ac_ext <<EOF
15002 #line 15003 "configure"
15003 #include "confdefs.h"
15004 /* Override any gcc2 internal prototype to avoid an error.  */
15005 /* We use char because int might match the return type of a gcc2
15006     builtin and then its argument prototype would still apply.  */
15007 char setproctitle();
15008
15009 int main() {
15010 setproctitle()
15011 ; return 0; }
15012 EOF
15013 if { (eval echo configure:15014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15014   rm -rf conftest*
15015   eval "ac_cv_lib_$ac_lib_var=yes"
15016 else
15017   echo "configure: failed program was:" >&5
15018   cat conftest.$ac_ext >&5
15019   rm -rf conftest*
15020   eval "ac_cv_lib_$ac_lib_var=no"
15021 fi
15022 rm -f conftest*
15023 LIBS="$ac_save_LIBS"
15024
15025 fi
15026 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15027   echo "$ac_t""yes" 1>&6
15028   have_setproctitle=yes
15029                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15030 else
15031   echo "$ac_t""no" 1>&6
15032 have_setproctitle=no
15033                         LIBOBJS="$LIBOBJS setproctitle.o"
15034                         LIBSRCS="$LIBSRCS setproctitle.c"
15035 fi
15036
15037 fi
15038
15039
15040         if test $have_setproctitle = yes ; then
15041                 cat >> confdefs.h <<\EOF
15042 #define HAVE_SETPROCTITLE 1
15043 EOF
15044
15045         fi
15046 fi
15047
15048 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15049 echo "configure:15050: checking for ANSI C header files" >&5
15050 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15051   echo $ac_n "(cached) $ac_c" 1>&6
15052 else
15053   cat > conftest.$ac_ext <<EOF
15054 #line 15055 "configure"
15055 #include "confdefs.h"
15056 #include <stdlib.h>
15057 #include <stdarg.h>
15058 #include <string.h>
15059 #include <float.h>
15060 EOF
15061 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15062 { (eval echo configure:15063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15063 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15064 if test -z "$ac_err"; then
15065   rm -rf conftest*
15066   ac_cv_header_stdc=yes
15067 else
15068   echo "$ac_err" >&5
15069   echo "configure: failed program was:" >&5
15070   cat conftest.$ac_ext >&5
15071   rm -rf conftest*
15072   ac_cv_header_stdc=no
15073 fi
15074 rm -f conftest*
15075
15076 if test $ac_cv_header_stdc = yes; then
15077   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15078 cat > conftest.$ac_ext <<EOF
15079 #line 15080 "configure"
15080 #include "confdefs.h"
15081 #include <string.h>
15082 EOF
15083 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15084   egrep "memchr" >/dev/null 2>&1; then
15085   :
15086 else
15087   rm -rf conftest*
15088   ac_cv_header_stdc=no
15089 fi
15090 rm -f conftest*
15091
15092 fi
15093
15094 if test $ac_cv_header_stdc = yes; then
15095   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15096 cat > conftest.$ac_ext <<EOF
15097 #line 15098 "configure"
15098 #include "confdefs.h"
15099 #include <stdlib.h>
15100 EOF
15101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15102   egrep "free" >/dev/null 2>&1; then
15103   :
15104 else
15105   rm -rf conftest*
15106   ac_cv_header_stdc=no
15107 fi
15108 rm -f conftest*
15109
15110 fi
15111
15112 if test $ac_cv_header_stdc = yes; then
15113   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15114 if test "$cross_compiling" = yes; then
15115   :
15116 else
15117   cat > conftest.$ac_ext <<EOF
15118 #line 15119 "configure"
15119 #include "confdefs.h"
15120 #include <ctype.h>
15121 #if ((' ' & 0x0FF) == 0x020)
15122 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15123 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15124 #else
15125 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15126  || ('j' <= (c) && (c) <= 'r') \
15127  || ('s' <= (c) && (c) <= 'z'))
15128 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15129 #endif
15130 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15131 int main () { int i; for (i = 0; i < 256; i++)
15132 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15133 exit (0); }
15134
15135 EOF
15136 if { (eval echo configure:15137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15137 then
15138   :
15139 else
15140   echo "configure: failed program was:" >&5
15141   cat conftest.$ac_ext >&5
15142   rm -fr conftest*
15143   ac_cv_header_stdc=no
15144 fi
15145 rm -fr conftest*
15146 fi
15147
15148 fi
15149 fi
15150
15151 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15152 if test $ac_cv_header_stdc = yes; then
15153   cat >> confdefs.h <<\EOF
15154 #define STDC_HEADERS 1
15155 EOF
15156
15157 fi
15158
15159 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15160 echo "configure:15161: checking for mode_t" >&5
15161 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15162   echo $ac_n "(cached) $ac_c" 1>&6
15163 else
15164   cat > conftest.$ac_ext <<EOF
15165 #line 15166 "configure"
15166 #include "confdefs.h"
15167 #include <sys/types.h>
15168 #if STDC_HEADERS
15169 #include <stdlib.h>
15170 #include <stddef.h>
15171 #endif
15172
15173 EOF
15174 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15175   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15176   rm -rf conftest*
15177   eval "ac_cv_type_mode_t=yes"
15178 else
15179   rm -rf conftest*
15180   eval "ac_cv_type_mode_t=no"
15181 fi
15182 rm -f conftest*
15183
15184 fi
15185 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15186   echo "$ac_t""yes" 1>&6
15187 else
15188   echo "$ac_t""no" 1>&6
15189   cat >> confdefs.h <<EOF
15190 #define mode_t int
15191 EOF
15192
15193 fi
15194
15195 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15196 echo "configure:15197: checking for off_t" >&5
15197 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15198   echo $ac_n "(cached) $ac_c" 1>&6
15199 else
15200   cat > conftest.$ac_ext <<EOF
15201 #line 15202 "configure"
15202 #include "confdefs.h"
15203 #include <sys/types.h>
15204 #if STDC_HEADERS
15205 #include <stdlib.h>
15206 #include <stddef.h>
15207 #endif
15208
15209 EOF
15210 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15211   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15212   rm -rf conftest*
15213   eval "ac_cv_type_off_t=yes"
15214 else
15215   rm -rf conftest*
15216   eval "ac_cv_type_off_t=no"
15217 fi
15218 rm -f conftest*
15219
15220 fi
15221 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15222   echo "$ac_t""yes" 1>&6
15223 else
15224   echo "$ac_t""no" 1>&6
15225   cat >> confdefs.h <<EOF
15226 #define off_t long
15227 EOF
15228
15229 fi
15230
15231 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15232 echo "configure:15233: checking for pid_t" >&5
15233 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15234   echo $ac_n "(cached) $ac_c" 1>&6
15235 else
15236   cat > conftest.$ac_ext <<EOF
15237 #line 15238 "configure"
15238 #include "confdefs.h"
15239 #include <sys/types.h>
15240 #if STDC_HEADERS
15241 #include <stdlib.h>
15242 #include <stddef.h>
15243 #endif
15244
15245 EOF
15246 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15247   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15248   rm -rf conftest*
15249   eval "ac_cv_type_pid_t=yes"
15250 else
15251   rm -rf conftest*
15252   eval "ac_cv_type_pid_t=no"
15253 fi
15254 rm -f conftest*
15255
15256 fi
15257 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15258   echo "$ac_t""yes" 1>&6
15259 else
15260   echo "$ac_t""no" 1>&6
15261   cat >> confdefs.h <<EOF
15262 #define pid_t int
15263 EOF
15264
15265 fi
15266
15267 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15268 echo "configure:15269: checking for ptrdiff_t" >&5
15269 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15270   echo $ac_n "(cached) $ac_c" 1>&6
15271 else
15272   cat > conftest.$ac_ext <<EOF
15273 #line 15274 "configure"
15274 #include "confdefs.h"
15275 #include <stddef.h>
15276 int main() {
15277 ptrdiff_t p
15278 ; return 0; }
15279 EOF
15280 if { (eval echo configure:15281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15281   rm -rf conftest*
15282   am_cv_type_ptrdiff_t=yes
15283 else
15284   echo "configure: failed program was:" >&5
15285   cat conftest.$ac_ext >&5
15286   rm -rf conftest*
15287   am_cv_type_ptrdiff_t=no
15288 fi
15289 rm -f conftest*
15290 fi
15291
15292 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15293    if test $am_cv_type_ptrdiff_t = yes; then
15294      cat >> confdefs.h <<\EOF
15295 #define HAVE_PTRDIFF_T 1
15296 EOF
15297
15298    fi
15299
15300 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15301 echo "configure:15302: checking return type of signal handlers" >&5
15302 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15303   echo $ac_n "(cached) $ac_c" 1>&6
15304 else
15305   cat > conftest.$ac_ext <<EOF
15306 #line 15307 "configure"
15307 #include "confdefs.h"
15308 #include <sys/types.h>
15309 #include <signal.h>
15310 #ifdef signal
15311 #undef signal
15312 #endif
15313 #ifdef __cplusplus
15314 extern "C" void (*signal (int, void (*)(int)))(int);
15315 #else
15316 void (*signal ()) ();
15317 #endif
15318
15319 int main() {
15320 int i;
15321 ; return 0; }
15322 EOF
15323 if { (eval echo configure:15324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15324   rm -rf conftest*
15325   ac_cv_type_signal=void
15326 else
15327   echo "configure: failed program was:" >&5
15328   cat conftest.$ac_ext >&5
15329   rm -rf conftest*
15330   ac_cv_type_signal=int
15331 fi
15332 rm -f conftest*
15333 fi
15334
15335 echo "$ac_t""$ac_cv_type_signal" 1>&6
15336 cat >> confdefs.h <<EOF
15337 #define RETSIGTYPE $ac_cv_type_signal
15338 EOF
15339
15340
15341 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15342 echo "configure:15343: checking for size_t" >&5
15343 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15344   echo $ac_n "(cached) $ac_c" 1>&6
15345 else
15346   cat > conftest.$ac_ext <<EOF
15347 #line 15348 "configure"
15348 #include "confdefs.h"
15349 #include <sys/types.h>
15350 #if STDC_HEADERS
15351 #include <stdlib.h>
15352 #include <stddef.h>
15353 #endif
15354
15355 EOF
15356 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15357   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15358   rm -rf conftest*
15359   eval "ac_cv_type_size_t=yes"
15360 else
15361   rm -rf conftest*
15362   eval "ac_cv_type_size_t=no"
15363 fi
15364 rm -f conftest*
15365
15366 fi
15367 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15368   echo "$ac_t""yes" 1>&6
15369 else
15370   echo "$ac_t""no" 1>&6
15371   cat >> confdefs.h <<EOF
15372 #define size_t unsigned
15373 EOF
15374
15375 fi
15376
15377
15378 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15379 echo "configure:15380: checking for ssize_t" >&5
15380 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15381   echo $ac_n "(cached) $ac_c" 1>&6
15382 else
15383   cat > conftest.$ac_ext <<EOF
15384 #line 15385 "configure"
15385 #include "confdefs.h"
15386 #include <sys/types.h>
15387 #if STDC_HEADERS
15388 #include <stdlib.h>
15389 #include <stddef.h>
15390 #endif
15391
15392 EOF
15393 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15394   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15395   rm -rf conftest*
15396   eval "ac_cv_type_ssize_t=yes"
15397 else
15398   rm -rf conftest*
15399   eval "ac_cv_type_ssize_t=no"
15400 fi
15401 rm -f conftest*
15402
15403 fi
15404 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15405   echo "$ac_t""yes" 1>&6
15406 else
15407   echo "$ac_t""no" 1>&6
15408   cat >> confdefs.h <<EOF
15409 #define ssize_t signed int
15410 EOF
15411
15412 fi
15413
15414 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15415 echo "configure:15416: checking for caddr_t" >&5
15416 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15417   echo $ac_n "(cached) $ac_c" 1>&6
15418 else
15419   cat > conftest.$ac_ext <<EOF
15420 #line 15421 "configure"
15421 #include "confdefs.h"
15422 #include <sys/types.h>
15423 #if STDC_HEADERS
15424 #include <stdlib.h>
15425 #include <stddef.h>
15426 #endif
15427
15428 EOF
15429 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15430   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15431   rm -rf conftest*
15432   eval "ac_cv_type_caddr_t=yes"
15433 else
15434   rm -rf conftest*
15435   eval "ac_cv_type_caddr_t=no"
15436 fi
15437 rm -f conftest*
15438
15439 fi
15440 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15441   echo "$ac_t""yes" 1>&6
15442 else
15443   echo "$ac_t""no" 1>&6
15444   cat >> confdefs.h <<EOF
15445 #define caddr_t char *
15446 EOF
15447
15448 fi
15449
15450
15451 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15452 echo "configure:15453: checking for socklen_t" >&5
15453 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15454   echo $ac_n "(cached) $ac_c" 1>&6
15455 else
15456   cat > conftest.$ac_ext <<EOF
15457 #line 15458 "configure"
15458 #include "confdefs.h"
15459
15460 #ifdef HAVE_SYS_TYPES_H
15461 #include <sys/types.h>
15462 #endif
15463 #ifdef HAVE_SYS_SOCKET_H
15464 #include <sys/socket.h>
15465 #endif
15466
15467 int main() {
15468 socklen_t len;
15469 ; return 0; }
15470 EOF
15471 if { (eval echo configure:15472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15472   rm -rf conftest*
15473   ol_cv_type_socklen_t=yes
15474 else
15475   echo "configure: failed program was:" >&5
15476   cat conftest.$ac_ext >&5
15477   rm -rf conftest*
15478   ol_cv_type_socklen_t=no
15479 fi
15480 rm -f conftest*
15481 fi
15482
15483 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15484   if test $ol_cv_type_socklen_t = no; then
15485     cat >> confdefs.h <<\EOF
15486 #define socklen_t int
15487 EOF
15488
15489   fi
15490  
15491 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15492 echo "configure:15493: checking for member st_blksize in aggregate type struct stat" >&5
15493 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15494   echo $ac_n "(cached) $ac_c" 1>&6
15495 else
15496   cat > conftest.$ac_ext <<EOF
15497 #line 15498 "configure"
15498 #include "confdefs.h"
15499 #include <sys/types.h>
15500 #include <sys/stat.h>
15501 int main() {
15502 struct stat foo; foo.st_blksize;
15503 ; return 0; }
15504 EOF
15505 if { (eval echo configure:15506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15506   rm -rf conftest*
15507   ac_cv_c_struct_member_st_blksize=yes
15508 else
15509   echo "configure: failed program was:" >&5
15510   cat conftest.$ac_ext >&5
15511   rm -rf conftest*
15512   ac_cv_c_struct_member_st_blksize=no
15513 fi
15514 rm -f conftest*
15515 fi
15516
15517 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15518 st_blksize="$ac_cv_c_struct_member_st_blksize"
15519 if test $ac_cv_c_struct_member_st_blksize = yes; then
15520   cat >> confdefs.h <<\EOF
15521 #define HAVE_ST_BLKSIZE 1
15522 EOF
15523
15524 fi
15525
15526 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15527 echo "configure:15528: checking whether time.h and sys/time.h may both be included" >&5
15528 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15529   echo $ac_n "(cached) $ac_c" 1>&6
15530 else
15531   cat > conftest.$ac_ext <<EOF
15532 #line 15533 "configure"
15533 #include "confdefs.h"
15534 #include <sys/types.h>
15535 #include <sys/time.h>
15536 #include <time.h>
15537 int main() {
15538 struct tm *tp;
15539 ; return 0; }
15540 EOF
15541 if { (eval echo configure:15542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15542   rm -rf conftest*
15543   ac_cv_header_time=yes
15544 else
15545   echo "configure: failed program was:" >&5
15546   cat conftest.$ac_ext >&5
15547   rm -rf conftest*
15548   ac_cv_header_time=no
15549 fi
15550 rm -f conftest*
15551 fi
15552
15553 echo "$ac_t""$ac_cv_header_time" 1>&6
15554 if test $ac_cv_header_time = yes; then
15555   cat >> confdefs.h <<\EOF
15556 #define TIME_WITH_SYS_TIME 1
15557 EOF
15558
15559 fi
15560
15561 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15562 echo "configure:15563: checking whether struct tm is in sys/time.h or time.h" >&5
15563 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15564   echo $ac_n "(cached) $ac_c" 1>&6
15565 else
15566   cat > conftest.$ac_ext <<EOF
15567 #line 15568 "configure"
15568 #include "confdefs.h"
15569 #include <sys/types.h>
15570 #include <time.h>
15571 int main() {
15572 struct tm *tp; tp->tm_sec;
15573 ; return 0; }
15574 EOF
15575 if { (eval echo configure:15576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15576   rm -rf conftest*
15577   ac_cv_struct_tm=time.h
15578 else
15579   echo "configure: failed program was:" >&5
15580   cat conftest.$ac_ext >&5
15581   rm -rf conftest*
15582   ac_cv_struct_tm=sys/time.h
15583 fi
15584 rm -f conftest*
15585 fi
15586
15587 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15588 if test $ac_cv_struct_tm = sys/time.h; then
15589   cat >> confdefs.h <<\EOF
15590 #define TM_IN_SYS_TIME 1
15591 EOF
15592
15593 fi
15594
15595 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15596 echo "configure:15597: checking for uid_t in sys/types.h" >&5
15597 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15598   echo $ac_n "(cached) $ac_c" 1>&6
15599 else
15600   cat > conftest.$ac_ext <<EOF
15601 #line 15602 "configure"
15602 #include "confdefs.h"
15603 #include <sys/types.h>
15604 EOF
15605 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15606   egrep "uid_t" >/dev/null 2>&1; then
15607   rm -rf conftest*
15608   ac_cv_type_uid_t=yes
15609 else
15610   rm -rf conftest*
15611   ac_cv_type_uid_t=no
15612 fi
15613 rm -f conftest*
15614
15615 fi
15616
15617 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15618 if test $ac_cv_type_uid_t = no; then
15619   cat >> confdefs.h <<\EOF
15620 #define uid_t int
15621 EOF
15622
15623   cat >> confdefs.h <<\EOF
15624 #define gid_t int
15625 EOF
15626
15627 fi
15628
15629 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15630 echo "configure:15631: checking for sig_atomic_t" >&5
15631 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15632   echo $ac_n "(cached) $ac_c" 1>&6
15633 else
15634   cat > conftest.$ac_ext <<EOF
15635 #line 15636 "configure"
15636 #include "confdefs.h"
15637 #include <signal.h>
15638 int main() {
15639 sig_atomic_t atomic;
15640 ; return 0; }
15641 EOF
15642 if { (eval echo configure:15643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15643   rm -rf conftest*
15644   ol_cv_type_sig_atomic_t=yes
15645 else
15646   echo "configure: failed program was:" >&5
15647   cat conftest.$ac_ext >&5
15648   rm -rf conftest*
15649   ol_cv_type_sig_atomic_t=no
15650 fi
15651 rm -f conftest*
15652 fi
15653
15654 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15655   if test $ol_cv_type_sig_atomic_t = no; then
15656     cat >> confdefs.h <<\EOF
15657 #define sig_atomic_t int
15658 EOF
15659
15660   fi
15661  
15662
15663
15664 # test for pw_gecos in struct passwd
15665 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15666 echo "configure:15667: checking struct passwd for pw_gecos" >&5
15667 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15668   echo $ac_n "(cached) $ac_c" 1>&6
15669 else
15670   
15671         cat > conftest.$ac_ext <<EOF
15672 #line 15673 "configure"
15673 #include "confdefs.h"
15674 #include <pwd.h>
15675 int main() {
15676
15677         struct passwd pwd;
15678         pwd.pw_gecos = pwd.pw_name;
15679
15680 ; return 0; }
15681 EOF
15682 if { (eval echo configure:15683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15683   rm -rf conftest*
15684   ol_cv_struct_passwd_pw_gecos=yes
15685 else
15686   echo "configure: failed program was:" >&5
15687   cat conftest.$ac_ext >&5
15688   rm -rf conftest*
15689   ol_cv_struct_passwd_pw_gecos=no
15690 fi
15691 rm -f conftest*
15692 fi
15693
15694 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15695 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15696         cat >> confdefs.h <<\EOF
15697 #define HAVE_PW_GECOS 1
15698 EOF
15699
15700 fi
15701
15702 # test for pw_passwd in struct passwd
15703 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15704 echo "configure:15705: checking struct passwd for pw_passwd" >&5
15705 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15706   echo $ac_n "(cached) $ac_c" 1>&6
15707 else
15708   
15709         cat > conftest.$ac_ext <<EOF
15710 #line 15711 "configure"
15711 #include "confdefs.h"
15712 #include <pwd.h>
15713 int main() {
15714
15715         struct passwd pwd;
15716         pwd.pw_passwd = pwd.pw_name;
15717
15718 ; return 0; }
15719 EOF
15720 if { (eval echo configure:15721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15721   rm -rf conftest*
15722   ol_cv_struct_passwd_pw_passwd=yes
15723 else
15724   echo "configure: failed program was:" >&5
15725   cat conftest.$ac_ext >&5
15726   rm -rf conftest*
15727   ol_cv_struct_passwd_pw_passwd=no
15728 fi
15729 rm -f conftest*
15730 fi
15731
15732 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15733 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15734         cat >> confdefs.h <<\EOF
15735 #define HAVE_PW_PASSWD 1
15736 EOF
15737
15738 fi
15739
15740
15741 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15742 echo "configure:15743: checking if toupper() requires islower()" >&5
15743 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15744   echo $ac_n "(cached) $ac_c" 1>&6
15745 else
15746   
15747         if test "$cross_compiling" = yes; then
15748   ol_cv_c_upper_lower=safe
15749 else
15750   cat > conftest.$ac_ext <<EOF
15751 #line 15752 "configure"
15752 #include "confdefs.h"
15753
15754 #include <ctype.h>
15755 main()
15756 {
15757         if ('C' == toupper('C'))
15758                 exit(0);
15759         else
15760                 exit(1);
15761 }
15762 EOF
15763 if { (eval echo configure:15764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15764 then
15765   ol_cv_c_upper_lower=no
15766 else
15767   echo "configure: failed program was:" >&5
15768   cat conftest.$ac_ext >&5
15769   rm -fr conftest*
15770   ol_cv_c_upper_lower=yes
15771 fi
15772 rm -fr conftest*
15773 fi
15774
15775 fi
15776
15777 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15778 if test $ol_cv_c_upper_lower != no ; then
15779         cat >> confdefs.h <<\EOF
15780 #define C_UPPER_LOWER 1
15781 EOF
15782
15783 fi
15784
15785 echo $ac_n "checking for working const""... $ac_c" 1>&6
15786 echo "configure:15787: checking for working const" >&5
15787 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15788   echo $ac_n "(cached) $ac_c" 1>&6
15789 else
15790   cat > conftest.$ac_ext <<EOF
15791 #line 15792 "configure"
15792 #include "confdefs.h"
15793
15794 int main() {
15795
15796 /* Ultrix mips cc rejects this.  */
15797 typedef int charset[2]; const charset x;
15798 /* SunOS 4.1.1 cc rejects this.  */
15799 char const *const *ccp;
15800 char **p;
15801 /* NEC SVR4.0.2 mips cc rejects this.  */
15802 struct point {int x, y;};
15803 static struct point const zero = {0,0};
15804 /* AIX XL C 1.02.0.0 rejects this.
15805    It does not let you subtract one const X* pointer from another in an arm
15806    of an if-expression whose if-part is not a constant expression */
15807 const char *g = "string";
15808 ccp = &g + (g ? g-g : 0);
15809 /* HPUX 7.0 cc rejects these. */
15810 ++ccp;
15811 p = (char**) ccp;
15812 ccp = (char const *const *) p;
15813 { /* SCO 3.2v4 cc rejects this.  */
15814   char *t;
15815   char const *s = 0 ? (char *) 0 : (char const *) 0;
15816
15817   *t++ = 0;
15818 }
15819 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15820   int x[] = {25, 17};
15821   const int *foo = &x[0];
15822   ++foo;
15823 }
15824 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15825   typedef const int *iptr;
15826   iptr p = 0;
15827   ++p;
15828 }
15829 { /* AIX XL C 1.02.0.0 rejects this saying
15830      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15831   struct s { int j; const int *ap[3]; };
15832   struct s *b; b->j = 5;
15833 }
15834 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15835   const int foo = 10;
15836 }
15837
15838 ; return 0; }
15839 EOF
15840 if { (eval echo configure:15841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15841   rm -rf conftest*
15842   ac_cv_c_const=yes
15843 else
15844   echo "configure: failed program was:" >&5
15845   cat conftest.$ac_ext >&5
15846   rm -rf conftest*
15847   ac_cv_c_const=no
15848 fi
15849 rm -f conftest*
15850 fi
15851
15852 echo "$ac_t""$ac_cv_c_const" 1>&6
15853 if test $ac_cv_c_const = no; then
15854   cat >> confdefs.h <<\EOF
15855 #define const 
15856 EOF
15857
15858 fi
15859
15860 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15861 echo "configure:15862: checking if compiler understands volatile" >&5
15862 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15863   echo $ac_n "(cached) $ac_c" 1>&6
15864 else
15865   cat > conftest.$ac_ext <<EOF
15866 #line 15867 "configure"
15867 #include "confdefs.h"
15868 int x, y, z;
15869 int main() {
15870 volatile int a; int * volatile b = x ? &y : &z;
15871       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15872       *b = 0;
15873 ; return 0; }
15874 EOF
15875 if { (eval echo configure:15876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15876   rm -rf conftest*
15877   ol_cv_c_volatile=yes
15878 else
15879   echo "configure: failed program was:" >&5
15880   cat conftest.$ac_ext >&5
15881   rm -rf conftest*
15882   ol_cv_c_volatile=no
15883 fi
15884 rm -f conftest*
15885 fi
15886
15887 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15888   if test $ol_cv_c_volatile = yes; then
15889     : 
15890   else
15891     cat >> confdefs.h <<\EOF
15892 #define volatile 
15893 EOF
15894
15895   fi
15896  
15897
15898 if test $cross_compiling = yes ; then
15899         cat >> confdefs.h <<\EOF
15900 #define CROSS_COMPILING 1
15901 EOF
15902
15903 else
15904         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15905 echo "configure:15906: checking whether byte ordering is bigendian" >&5
15906 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15907   echo $ac_n "(cached) $ac_c" 1>&6
15908 else
15909   ac_cv_c_bigendian=unknown
15910 # See if sys/param.h defines the BYTE_ORDER macro.
15911 cat > conftest.$ac_ext <<EOF
15912 #line 15913 "configure"
15913 #include "confdefs.h"
15914 #include <sys/types.h>
15915 #include <sys/param.h>
15916 int main() {
15917
15918 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15919  bogus endian macros
15920 #endif
15921 ; return 0; }
15922 EOF
15923 if { (eval echo configure:15924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15924   rm -rf conftest*
15925   # It does; now see whether it defined to BIG_ENDIAN or not.
15926 cat > conftest.$ac_ext <<EOF
15927 #line 15928 "configure"
15928 #include "confdefs.h"
15929 #include <sys/types.h>
15930 #include <sys/param.h>
15931 int main() {
15932
15933 #if BYTE_ORDER != BIG_ENDIAN
15934  not big endian
15935 #endif
15936 ; return 0; }
15937 EOF
15938 if { (eval echo configure:15939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15939   rm -rf conftest*
15940   ac_cv_c_bigendian=yes
15941 else
15942   echo "configure: failed program was:" >&5
15943   cat conftest.$ac_ext >&5
15944   rm -rf conftest*
15945   ac_cv_c_bigendian=no
15946 fi
15947 rm -f conftest*
15948 else
15949   echo "configure: failed program was:" >&5
15950   cat conftest.$ac_ext >&5
15951 fi
15952 rm -f conftest*
15953 if test $ac_cv_c_bigendian = unknown; then
15954 if test "$cross_compiling" = yes; then
15955     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
15956 else
15957   cat > conftest.$ac_ext <<EOF
15958 #line 15959 "configure"
15959 #include "confdefs.h"
15960 main () {
15961   /* Are we little or big endian?  From Harbison&Steele.  */
15962   union
15963   {
15964     long l;
15965     char c[sizeof (long)];
15966   } u;
15967   u.l = 1;
15968   exit (u.c[sizeof (long) - 1] == 1);
15969 }
15970 EOF
15971 if { (eval echo configure:15972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15972 then
15973   ac_cv_c_bigendian=no
15974 else
15975   echo "configure: failed program was:" >&5
15976   cat conftest.$ac_ext >&5
15977   rm -fr conftest*
15978   ac_cv_c_bigendian=yes
15979 fi
15980 rm -fr conftest*
15981 fi
15982
15983 fi
15984 fi
15985
15986 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
15987 if test $ac_cv_c_bigendian = yes; then
15988   cat >> confdefs.h <<\EOF
15989 #define WORDS_BIGENDIAN 1
15990 EOF
15991
15992 fi
15993
15994 fi
15995
15996 echo $ac_n "checking size of short""... $ac_c" 1>&6
15997 echo "configure:15998: checking size of short" >&5 
15998 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
15999   echo $ac_n "(cached) $ac_c" 1>&6
16000 else
16001   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16002   cat > conftest.$ac_ext <<EOF
16003 #line 16004 "configure"
16004 #include "confdefs.h"
16005 #include "confdefs.h" 
16006 #include <sys/types.h> 
16007  
16008
16009 int main() {
16010 switch (0) case 0: case (sizeof (short) == $ac_size):;
16011 ; return 0; }
16012 EOF
16013 if { (eval echo configure:16014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16014   rm -rf conftest*
16015   ac_cv_sizeof_short=$ac_size
16016 else
16017   echo "configure: failed program was:" >&5
16018   cat conftest.$ac_ext >&5
16019 fi
16020 rm -f conftest* 
16021   if test x$ac_cv_sizeof_short != x ; then break; fi 
16022 done 
16023
16024 fi
16025  
16026 if test x$ac_cv_sizeof_short = x ; then 
16027   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16028 fi 
16029 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16030 cat >> confdefs.h <<EOF
16031 #define SIZEOF_SHORT $ac_cv_sizeof_short
16032 EOF
16033  
16034  
16035 echo $ac_n "checking size of int""... $ac_c" 1>&6
16036 echo "configure:16037: checking size of int" >&5 
16037 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16038   echo $ac_n "(cached) $ac_c" 1>&6
16039 else
16040   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16041   cat > conftest.$ac_ext <<EOF
16042 #line 16043 "configure"
16043 #include "confdefs.h"
16044 #include "confdefs.h" 
16045 #include <sys/types.h> 
16046  
16047
16048 int main() {
16049 switch (0) case 0: case (sizeof (int) == $ac_size):;
16050 ; return 0; }
16051 EOF
16052 if { (eval echo configure:16053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16053   rm -rf conftest*
16054   ac_cv_sizeof_int=$ac_size
16055 else
16056   echo "configure: failed program was:" >&5
16057   cat conftest.$ac_ext >&5
16058 fi
16059 rm -f conftest* 
16060   if test x$ac_cv_sizeof_int != x ; then break; fi 
16061 done 
16062
16063 fi
16064  
16065 if test x$ac_cv_sizeof_int = x ; then 
16066   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16067 fi 
16068 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16069 cat >> confdefs.h <<EOF
16070 #define SIZEOF_INT $ac_cv_sizeof_int
16071 EOF
16072  
16073  
16074 echo $ac_n "checking size of long""... $ac_c" 1>&6
16075 echo "configure:16076: checking size of long" >&5 
16076 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16077   echo $ac_n "(cached) $ac_c" 1>&6
16078 else
16079   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16080   cat > conftest.$ac_ext <<EOF
16081 #line 16082 "configure"
16082 #include "confdefs.h"
16083 #include "confdefs.h" 
16084 #include <sys/types.h> 
16085  
16086
16087 int main() {
16088 switch (0) case 0: case (sizeof (long) == $ac_size):;
16089 ; return 0; }
16090 EOF
16091 if { (eval echo configure:16092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16092   rm -rf conftest*
16093   ac_cv_sizeof_long=$ac_size
16094 else
16095   echo "configure: failed program was:" >&5
16096   cat conftest.$ac_ext >&5
16097 fi
16098 rm -f conftest* 
16099   if test x$ac_cv_sizeof_long != x ; then break; fi 
16100 done 
16101
16102 fi
16103  
16104 if test x$ac_cv_sizeof_long = x ; then 
16105   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16106 fi 
16107 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16108 cat >> confdefs.h <<EOF
16109 #define SIZEOF_LONG $ac_cv_sizeof_long
16110 EOF
16111  
16112
16113
16114 if test "$ac_cv_sizeof_int" -lt 4 ; then
16115         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16116
16117         cat >> confdefs.h <<\EOF
16118 #define LBER_INT_T long
16119 EOF
16120
16121 else
16122         cat >> confdefs.h <<\EOF
16123 #define LBER_INT_T int
16124 EOF
16125
16126 fi
16127
16128 cat >> confdefs.h <<\EOF
16129 #define LBER_LEN_T long
16130 EOF
16131
16132 cat >> confdefs.h <<\EOF
16133 #define LBER_SOCKET_T int
16134 EOF
16135
16136 cat >> confdefs.h <<\EOF
16137 #define LBER_TAG_T long
16138 EOF
16139
16140
16141 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16142 echo "configure:16143: checking for 8-bit clean memcmp" >&5
16143 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16144   echo $ac_n "(cached) $ac_c" 1>&6
16145 else
16146   if test "$cross_compiling" = yes; then
16147   ac_cv_func_memcmp_clean=no
16148 else
16149   cat > conftest.$ac_ext <<EOF
16150 #line 16151 "configure"
16151 #include "confdefs.h"
16152
16153 main()
16154 {
16155   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16156   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16157 }
16158
16159 EOF
16160 if { (eval echo configure:16161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16161 then
16162   ac_cv_func_memcmp_clean=yes
16163 else
16164   echo "configure: failed program was:" >&5
16165   cat conftest.$ac_ext >&5
16166   rm -fr conftest*
16167   ac_cv_func_memcmp_clean=no
16168 fi
16169 rm -fr conftest*
16170 fi
16171
16172 fi
16173
16174 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16175 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16176
16177 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16178 echo "configure:16179: checking for strftime" >&5
16179 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16180   echo $ac_n "(cached) $ac_c" 1>&6
16181 else
16182   cat > conftest.$ac_ext <<EOF
16183 #line 16184 "configure"
16184 #include "confdefs.h"
16185 /* System header to define __stub macros and hopefully few prototypes,
16186     which can conflict with char strftime(); below.  */
16187 #include <assert.h>
16188 /* Override any gcc2 internal prototype to avoid an error.  */
16189 /* We use char because int might match the return type of a gcc2
16190     builtin and then its argument prototype would still apply.  */
16191 char strftime();
16192 char (*f)();
16193
16194 int main() {
16195
16196 /* The GNU C library defines this for functions which it implements
16197     to always fail with ENOSYS.  Some functions are actually named
16198     something starting with __ and the normal name is an alias.  */
16199 #if defined (__stub_strftime) || defined (__stub___strftime)
16200 choke me
16201 #else
16202 f = strftime;
16203 #endif
16204
16205 ; return 0; }
16206 EOF
16207 if { (eval echo configure:16208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16208   rm -rf conftest*
16209   eval "ac_cv_func_strftime=yes"
16210 else
16211   echo "configure: failed program was:" >&5
16212   cat conftest.$ac_ext >&5
16213   rm -rf conftest*
16214   eval "ac_cv_func_strftime=no"
16215 fi
16216 rm -f conftest*
16217 fi
16218
16219 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16220   echo "$ac_t""yes" 1>&6
16221   cat >> confdefs.h <<\EOF
16222 #define HAVE_STRFTIME 1
16223 EOF
16224
16225 else
16226   echo "$ac_t""no" 1>&6
16227 # strftime is in -lintl on SCO UNIX.
16228 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16229 echo "configure:16230: checking for strftime in -lintl" >&5
16230 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16231 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16232   echo $ac_n "(cached) $ac_c" 1>&6
16233 else
16234   ac_save_LIBS="$LIBS"
16235 LIBS="-lintl  $LIBS"
16236 cat > conftest.$ac_ext <<EOF
16237 #line 16238 "configure"
16238 #include "confdefs.h"
16239 /* Override any gcc2 internal prototype to avoid an error.  */
16240 /* We use char because int might match the return type of a gcc2
16241     builtin and then its argument prototype would still apply.  */
16242 char strftime();
16243
16244 int main() {
16245 strftime()
16246 ; return 0; }
16247 EOF
16248 if { (eval echo configure:16249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16249   rm -rf conftest*
16250   eval "ac_cv_lib_$ac_lib_var=yes"
16251 else
16252   echo "configure: failed program was:" >&5
16253   cat conftest.$ac_ext >&5
16254   rm -rf conftest*
16255   eval "ac_cv_lib_$ac_lib_var=no"
16256 fi
16257 rm -f conftest*
16258 LIBS="$ac_save_LIBS"
16259
16260 fi
16261 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16262   echo "$ac_t""yes" 1>&6
16263   cat >> confdefs.h <<\EOF
16264 #define HAVE_STRFTIME 1
16265 EOF
16266
16267 LIBS="-lintl $LIBS"
16268 else
16269   echo "$ac_t""no" 1>&6
16270 fi
16271
16272 fi
16273
16274
16275 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16276 echo "configure:16277: checking for inet_aton()" >&5
16277 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16278   echo $ac_n "(cached) $ac_c" 1>&6
16279 else
16280   cat > conftest.$ac_ext <<EOF
16281 #line 16282 "configure"
16282 #include "confdefs.h"
16283
16284 #ifdef HAVE_SYS_TYPES_H
16285 #       include <sys/types.h>
16286 #endif
16287 #ifdef HAVE_SYS_SOCKET_H
16288 #       include <sys/socket.h>
16289 #       ifdef HAVE_SYS_SELECT_H
16290 #               include <sys/select.h>
16291 #       endif
16292 #       include <netinet/in.h>
16293 #       ifdef HAVE_ARPA_INET_H
16294 #               include <arpa/inet.h>
16295 #       endif
16296 #endif
16297
16298 int main() {
16299 struct in_addr in;
16300 int rc = inet_aton( "255.255.255.255", &in );
16301 ; return 0; }
16302 EOF
16303 if { (eval echo configure:16304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16304   rm -rf conftest*
16305   ol_cv_func_inet_aton=yes
16306 else
16307   echo "configure: failed program was:" >&5
16308   cat conftest.$ac_ext >&5
16309   rm -rf conftest*
16310   ol_cv_func_inet_aton=no
16311 fi
16312 rm -f conftest*
16313 fi
16314
16315 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16316   if test $ol_cv_func_inet_aton != no; then
16317     cat >> confdefs.h <<\EOF
16318 #define HAVE_INET_ATON 1
16319 EOF
16320
16321   fi
16322  
16323
16324 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16325 echo "configure:16326: checking for _spawnlp" >&5
16326 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16327   echo $ac_n "(cached) $ac_c" 1>&6
16328 else
16329   cat > conftest.$ac_ext <<EOF
16330 #line 16331 "configure"
16331 #include "confdefs.h"
16332 /* System header to define __stub macros and hopefully few prototypes,
16333     which can conflict with char _spawnlp(); below.  */
16334 #include <assert.h>
16335 /* Override any gcc2 internal prototype to avoid an error.  */
16336 /* We use char because int might match the return type of a gcc2
16337     builtin and then its argument prototype would still apply.  */
16338 char _spawnlp();
16339 char (*f)();
16340
16341 int main() {
16342
16343 /* The GNU C library defines this for functions which it implements
16344     to always fail with ENOSYS.  Some functions are actually named
16345     something starting with __ and the normal name is an alias.  */
16346 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16347 choke me
16348 #else
16349 f = _spawnlp;
16350 #endif
16351
16352 ; return 0; }
16353 EOF
16354 if { (eval echo configure:16355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16355   rm -rf conftest*
16356   eval "ac_cv_func__spawnlp=yes"
16357 else
16358   echo "configure: failed program was:" >&5
16359   cat conftest.$ac_ext >&5
16360   rm -rf conftest*
16361   eval "ac_cv_func__spawnlp=no"
16362 fi
16363 rm -f conftest*
16364 fi
16365
16366 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16367   echo "$ac_t""yes" 1>&6
16368   cat >> confdefs.h <<\EOF
16369 #define HAVE_SPAWNLP 1
16370 EOF
16371
16372 else
16373   echo "$ac_t""no" 1>&6
16374 fi
16375
16376
16377 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16378 echo "configure:16379: checking for _snprintf" >&5
16379 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16380   echo $ac_n "(cached) $ac_c" 1>&6
16381 else
16382   cat > conftest.$ac_ext <<EOF
16383 #line 16384 "configure"
16384 #include "confdefs.h"
16385 /* System header to define __stub macros and hopefully few prototypes,
16386     which can conflict with char _snprintf(); below.  */
16387 #include <assert.h>
16388 /* Override any gcc2 internal prototype to avoid an error.  */
16389 /* We use char because int might match the return type of a gcc2
16390     builtin and then its argument prototype would still apply.  */
16391 char _snprintf();
16392 char (*f)();
16393
16394 int main() {
16395
16396 /* The GNU C library defines this for functions which it implements
16397     to always fail with ENOSYS.  Some functions are actually named
16398     something starting with __ and the normal name is an alias.  */
16399 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16400 choke me
16401 #else
16402 f = _snprintf;
16403 #endif
16404
16405 ; return 0; }
16406 EOF
16407 if { (eval echo configure:16408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16408   rm -rf conftest*
16409   eval "ac_cv_func__snprintf=yes"
16410 else
16411   echo "configure: failed program was:" >&5
16412   cat conftest.$ac_ext >&5
16413   rm -rf conftest*
16414   eval "ac_cv_func__snprintf=no"
16415 fi
16416 rm -f conftest*
16417 fi
16418
16419 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16420   echo "$ac_t""yes" 1>&6
16421   ac_cv_func_snprintf=yes
16422         cat >> confdefs.h <<\EOF
16423 #define snprintf _snprintf
16424 EOF
16425
16426
16427 else
16428   echo "$ac_t""no" 1>&6
16429 fi
16430
16431
16432 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16433 echo "configure:16434: checking for _vsnprintf" >&5
16434 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16435   echo $ac_n "(cached) $ac_c" 1>&6
16436 else
16437   cat > conftest.$ac_ext <<EOF
16438 #line 16439 "configure"
16439 #include "confdefs.h"
16440 /* System header to define __stub macros and hopefully few prototypes,
16441     which can conflict with char _vsnprintf(); below.  */
16442 #include <assert.h>
16443 /* Override any gcc2 internal prototype to avoid an error.  */
16444 /* We use char because int might match the return type of a gcc2
16445     builtin and then its argument prototype would still apply.  */
16446 char _vsnprintf();
16447 char (*f)();
16448
16449 int main() {
16450
16451 /* The GNU C library defines this for functions which it implements
16452     to always fail with ENOSYS.  Some functions are actually named
16453     something starting with __ and the normal name is an alias.  */
16454 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16455 choke me
16456 #else
16457 f = _vsnprintf;
16458 #endif
16459
16460 ; return 0; }
16461 EOF
16462 if { (eval echo configure:16463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16463   rm -rf conftest*
16464   eval "ac_cv_func__vsnprintf=yes"
16465 else
16466   echo "configure: failed program was:" >&5
16467   cat conftest.$ac_ext >&5
16468   rm -rf conftest*
16469   eval "ac_cv_func__vsnprintf=no"
16470 fi
16471 rm -f conftest*
16472 fi
16473
16474 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16475   echo "$ac_t""yes" 1>&6
16476   ac_cv_func_vsnprintf=yes
16477         cat >> confdefs.h <<\EOF
16478 #define vsnprintf _vsnprintf
16479 EOF
16480
16481
16482 else
16483   echo "$ac_t""no" 1>&6
16484 fi
16485
16486
16487 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16488 echo "configure:16489: checking for vprintf" >&5
16489 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16490   echo $ac_n "(cached) $ac_c" 1>&6
16491 else
16492   cat > conftest.$ac_ext <<EOF
16493 #line 16494 "configure"
16494 #include "confdefs.h"
16495 /* System header to define __stub macros and hopefully few prototypes,
16496     which can conflict with char vprintf(); below.  */
16497 #include <assert.h>
16498 /* Override any gcc2 internal prototype to avoid an error.  */
16499 /* We use char because int might match the return type of a gcc2
16500     builtin and then its argument prototype would still apply.  */
16501 char vprintf();
16502 char (*f)();
16503
16504 int main() {
16505
16506 /* The GNU C library defines this for functions which it implements
16507     to always fail with ENOSYS.  Some functions are actually named
16508     something starting with __ and the normal name is an alias.  */
16509 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16510 choke me
16511 #else
16512 f = vprintf;
16513 #endif
16514
16515 ; return 0; }
16516 EOF
16517 if { (eval echo configure:16518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16518   rm -rf conftest*
16519   eval "ac_cv_func_vprintf=yes"
16520 else
16521   echo "configure: failed program was:" >&5
16522   cat conftest.$ac_ext >&5
16523   rm -rf conftest*
16524   eval "ac_cv_func_vprintf=no"
16525 fi
16526 rm -f conftest*
16527 fi
16528
16529 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16530   echo "$ac_t""yes" 1>&6
16531   cat >> confdefs.h <<\EOF
16532 #define HAVE_VPRINTF 1
16533 EOF
16534
16535 else
16536   echo "$ac_t""no" 1>&6
16537 fi
16538
16539 if test "$ac_cv_func_vprintf" != yes; then
16540 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16541 echo "configure:16542: checking for _doprnt" >&5
16542 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16543   echo $ac_n "(cached) $ac_c" 1>&6
16544 else
16545   cat > conftest.$ac_ext <<EOF
16546 #line 16547 "configure"
16547 #include "confdefs.h"
16548 /* System header to define __stub macros and hopefully few prototypes,
16549     which can conflict with char _doprnt(); below.  */
16550 #include <assert.h>
16551 /* Override any gcc2 internal prototype to avoid an error.  */
16552 /* We use char because int might match the return type of a gcc2
16553     builtin and then its argument prototype would still apply.  */
16554 char _doprnt();
16555 char (*f)();
16556
16557 int main() {
16558
16559 /* The GNU C library defines this for functions which it implements
16560     to always fail with ENOSYS.  Some functions are actually named
16561     something starting with __ and the normal name is an alias.  */
16562 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16563 choke me
16564 #else
16565 f = _doprnt;
16566 #endif
16567
16568 ; return 0; }
16569 EOF
16570 if { (eval echo configure:16571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16571   rm -rf conftest*
16572   eval "ac_cv_func__doprnt=yes"
16573 else
16574   echo "configure: failed program was:" >&5
16575   cat conftest.$ac_ext >&5
16576   rm -rf conftest*
16577   eval "ac_cv_func__doprnt=no"
16578 fi
16579 rm -f conftest*
16580 fi
16581
16582 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16583   echo "$ac_t""yes" 1>&6
16584   cat >> confdefs.h <<\EOF
16585 #define HAVE_DOPRNT 1
16586 EOF
16587
16588 else
16589   echo "$ac_t""no" 1>&6
16590 fi
16591
16592 fi
16593
16594
16595 if test $ac_cv_func_vprintf = yes ; then
16596                 for ac_func in vsnprintf vsprintf
16597 do
16598 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16599 echo "configure:16600: checking for $ac_func" >&5
16600 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16601   echo $ac_n "(cached) $ac_c" 1>&6
16602 else
16603   cat > conftest.$ac_ext <<EOF
16604 #line 16605 "configure"
16605 #include "confdefs.h"
16606 /* System header to define __stub macros and hopefully few prototypes,
16607     which can conflict with char $ac_func(); below.  */
16608 #include <assert.h>
16609 /* Override any gcc2 internal prototype to avoid an error.  */
16610 /* We use char because int might match the return type of a gcc2
16611     builtin and then its argument prototype would still apply.  */
16612 char $ac_func();
16613 char (*f)();
16614
16615 int main() {
16616
16617 /* The GNU C library defines this for functions which it implements
16618     to always fail with ENOSYS.  Some functions are actually named
16619     something starting with __ and the normal name is an alias.  */
16620 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16621 choke me
16622 #else
16623 f = $ac_func;
16624 #endif
16625
16626 ; return 0; }
16627 EOF
16628 if { (eval echo configure:16629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16629   rm -rf conftest*
16630   eval "ac_cv_func_$ac_func=yes"
16631 else
16632   echo "configure: failed program was:" >&5
16633   cat conftest.$ac_ext >&5
16634   rm -rf conftest*
16635   eval "ac_cv_func_$ac_func=no"
16636 fi
16637 rm -f conftest*
16638 fi
16639
16640 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16641   echo "$ac_t""yes" 1>&6
16642     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16643   cat >> confdefs.h <<EOF
16644 #define $ac_tr_func 1
16645 EOF
16646  
16647 else
16648   echo "$ac_t""no" 1>&6
16649 fi
16650 done
16651
16652 fi
16653
16654 for ac_func in \
16655         bcopy                   \
16656         closesocket             \
16657         chroot                  \
16658         endgrent                \
16659         endpwent                \
16660         fcntl                   \
16661         flock                   \
16662         getdtablesize   \
16663         getgrgid                \
16664         gethostname             \
16665         getpass                 \
16666         getpassphrase   \
16667         getpwuid                \
16668         getpwnam                \
16669         getspnam                \
16670         gettimeofday    \
16671         initgroups              \
16672         lockf                   \
16673         memcpy                  \
16674         memmove                 \
16675         mkstemp                 \
16676         pipe                    \
16677         read                    \
16678         recv                    \
16679         recvfrom                \
16680         setpwfile               \
16681         setgid                  \
16682         setegid                 \
16683         setsid                  \
16684         setuid                  \
16685         seteuid                 \
16686         sigaction               \
16687         signal                  \
16688         sigset                  \
16689         strdup                  \
16690         strerror                \
16691         strpbrk                 \
16692         strrchr                 \
16693         strsep                  \
16694         strstr                  \
16695         strtol                  \
16696         strtoul                 \
16697         strspn                  \
16698         sysconf                 \
16699         usleep                  \
16700         waitpid                 \
16701         wait4                   \
16702         write                   \
16703         send                    \
16704         sendto                  \
16705
16706 do
16707 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16708 echo "configure:16709: checking for $ac_func" >&5
16709 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16710   echo $ac_n "(cached) $ac_c" 1>&6
16711 else
16712   cat > conftest.$ac_ext <<EOF
16713 #line 16714 "configure"
16714 #include "confdefs.h"
16715 /* System header to define __stub macros and hopefully few prototypes,
16716     which can conflict with char $ac_func(); below.  */
16717 #include <assert.h>
16718 /* Override any gcc2 internal prototype to avoid an error.  */
16719 /* We use char because int might match the return type of a gcc2
16720     builtin and then its argument prototype would still apply.  */
16721 char $ac_func();
16722 char (*f)();
16723
16724 int main() {
16725
16726 /* The GNU C library defines this for functions which it implements
16727     to always fail with ENOSYS.  Some functions are actually named
16728     something starting with __ and the normal name is an alias.  */
16729 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16730 choke me
16731 #else
16732 f = $ac_func;
16733 #endif
16734
16735 ; return 0; }
16736 EOF
16737 if { (eval echo configure:16738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16738   rm -rf conftest*
16739   eval "ac_cv_func_$ac_func=yes"
16740 else
16741   echo "configure: failed program was:" >&5
16742   cat conftest.$ac_ext >&5
16743   rm -rf conftest*
16744   eval "ac_cv_func_$ac_func=no"
16745 fi
16746 rm -f conftest*
16747 fi
16748
16749 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16750   echo "$ac_t""yes" 1>&6
16751     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16752   cat >> confdefs.h <<EOF
16753 #define $ac_tr_func 1
16754 EOF
16755  
16756 else
16757   echo "$ac_t""no" 1>&6
16758 fi
16759 done
16760
16761
16762 for ac_func in getopt tempnam
16763 do
16764 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16765 echo "configure:16766: checking for $ac_func" >&5
16766 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16767   echo $ac_n "(cached) $ac_c" 1>&6
16768 else
16769   cat > conftest.$ac_ext <<EOF
16770 #line 16771 "configure"
16771 #include "confdefs.h"
16772 /* System header to define __stub macros and hopefully few prototypes,
16773     which can conflict with char $ac_func(); below.  */
16774 #include <assert.h>
16775 /* Override any gcc2 internal prototype to avoid an error.  */
16776 /* We use char because int might match the return type of a gcc2
16777     builtin and then its argument prototype would still apply.  */
16778 char $ac_func();
16779 char (*f)();
16780
16781 int main() {
16782
16783 /* The GNU C library defines this for functions which it implements
16784     to always fail with ENOSYS.  Some functions are actually named
16785     something starting with __ and the normal name is an alias.  */
16786 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16787 choke me
16788 #else
16789 f = $ac_func;
16790 #endif
16791
16792 ; return 0; }
16793 EOF
16794 if { (eval echo configure:16795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16795   rm -rf conftest*
16796   eval "ac_cv_func_$ac_func=yes"
16797 else
16798   echo "configure: failed program was:" >&5
16799   cat conftest.$ac_ext >&5
16800   rm -rf conftest*
16801   eval "ac_cv_func_$ac_func=no"
16802 fi
16803 rm -f conftest*
16804 fi
16805
16806 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16807   echo "$ac_t""yes" 1>&6
16808     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16809   cat >> confdefs.h <<EOF
16810 #define $ac_tr_func 1
16811 EOF
16812  
16813 else
16814   echo "$ac_t""no" 1>&6
16815 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
16816 fi
16817 done
16818
16819
16820
16821 if test "$ac_cv_func_getopt" != yes; then
16822     LIBSRCS="$LIBSRCS getopt.c"
16823 fi
16824
16825 if test "$ac_cv_func_tempnam" != yes; then
16826     LIBSRCS="$LIBSRCS tempnam.c"
16827 fi
16828
16829 # Check Configuration
16830 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
16831 echo "configure:16832: checking declaration of sys_errlist" >&5
16832 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
16833   echo $ac_n "(cached) $ac_c" 1>&6
16834 else
16835   
16836         cat > conftest.$ac_ext <<EOF
16837 #line 16838 "configure"
16838 #include "confdefs.h"
16839
16840 #include <stdio.h>
16841 #include <sys/types.h>
16842 #include <errno.h>
16843 #ifdef WINNT
16844 #include <stdlib.h>
16845 #endif 
16846 int main() {
16847 char *c = (char *) *sys_errlist
16848 ; return 0; }
16849 EOF
16850 if { (eval echo configure:16851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16851   rm -rf conftest*
16852   ol_cv_dcl_sys_errlist=yes
16853         ol_cv_have_sys_errlist=yes
16854 else
16855   echo "configure: failed program was:" >&5
16856   cat conftest.$ac_ext >&5
16857   rm -rf conftest*
16858   ol_cv_dcl_sys_errlist=no
16859 fi
16860 rm -f conftest*
16861 fi
16862
16863 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16864 #
16865 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16866 if test $ol_cv_dcl_sys_errlist = no ; then
16867         cat >> confdefs.h <<\EOF
16868 #define DECL_SYS_ERRLIST 1
16869 EOF
16870
16871
16872         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16873 echo "configure:16874: checking existence of sys_errlist" >&5
16874 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16875   echo $ac_n "(cached) $ac_c" 1>&6
16876 else
16877   
16878                 cat > conftest.$ac_ext <<EOF
16879 #line 16880 "configure"
16880 #include "confdefs.h"
16881 #include <errno.h>
16882 int main() {
16883 char *c = (char *) *sys_errlist
16884 ; return 0; }
16885 EOF
16886 if { (eval echo configure:16887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16887   rm -rf conftest*
16888   ol_cv_have_sys_errlist=yes
16889 else
16890   echo "configure: failed program was:" >&5
16891   cat conftest.$ac_ext >&5
16892   rm -rf conftest*
16893   ol_cv_have_sys_errlist=no
16894 fi
16895 rm -f conftest*
16896 fi
16897
16898 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16899 fi
16900 if test $ol_cv_have_sys_errlist = yes ; then
16901         cat >> confdefs.h <<\EOF
16902 #define HAVE_SYS_ERRLIST 1
16903 EOF
16904
16905 fi
16906
16907
16908
16909 if test "$ol_enable_debug" != no ; then
16910         cat >> confdefs.h <<\EOF
16911 #define LDAP_DEBUG 1
16912 EOF
16913
16914 fi
16915 if test "$ol_enable_syslog" = yes ; then
16916         cat >> confdefs.h <<\EOF
16917 #define LDAP_SYSLOG 1
16918 EOF
16919
16920 fi
16921 if test "$ol_enable_cache" = no ; then
16922         cat >> confdefs.h <<\EOF
16923 #define LDAP_NOCACHE 1
16924 EOF
16925
16926 fi
16927 if test "$ol_link_kbind" != no ; then
16928         cat >> confdefs.h <<\EOF
16929 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16930 EOF
16931
16932 fi
16933 if test "$ol_enable_proctitle" != no ; then
16934         cat >> confdefs.h <<\EOF
16935 #define LDAP_PROCTITLE 1
16936 EOF
16937
16938 fi
16939 if test "$ol_enable_referrals" != no ; then
16940         cat >> confdefs.h <<\EOF
16941 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16942 EOF
16943
16944 fi
16945 if test "$ol_enable_local" != no; then
16946         cat >> confdefs.h <<\EOF
16947 #define LDAP_PF_LOCAL 1
16948 EOF
16949
16950 fi
16951 if test "$ol_link_ipv6" != no; then
16952         cat >> confdefs.h <<\EOF
16953 #define LDAP_PF_INET6 1
16954 EOF
16955
16956 fi
16957 if test "$ol_enable_cleartext" != no ; then
16958         cat >> confdefs.h <<\EOF
16959 #define SLAPD_CLEARTEXT 1
16960 EOF
16961
16962 fi
16963 if test "$ol_enable_crypt" != no ; then
16964         cat >> confdefs.h <<\EOF
16965 #define SLAPD_CRYPT 1
16966 EOF
16967
16968 fi
16969 if test "$ol_link_kpasswd" != no ; then
16970         cat >> confdefs.h <<\EOF
16971 #define SLAPD_KPASSWD 1
16972 EOF
16973
16974 fi
16975 if test "$ol_link_spasswd" != no ; then
16976         cat >> confdefs.h <<\EOF
16977 #define SLAPD_SPASSWD 1
16978 EOF
16979
16980 fi
16981 if test "$ol_enable_phonetic" != no ; then
16982         cat >> confdefs.h <<\EOF
16983 #define SLAPD_PHONETIC 1
16984 EOF
16985
16986 fi
16987 if test "$ol_enable_rlookups" != no ; then
16988         cat >> confdefs.h <<\EOF
16989 #define SLAPD_RLOOKUPS 1
16990 EOF
16991
16992 fi
16993 if test "$ol_enable_aci" != no ; then
16994         cat >> confdefs.h <<\EOF
16995 #define SLAPD_ACI_ENABLED 1
16996 EOF
16997
16998 fi
16999
17000 if test "$ol_link_modules" != no ; then
17001         cat >> confdefs.h <<\EOF
17002 #define SLAPD_MODULES 1
17003 EOF
17004
17005         BUILD_SLAPD=yes
17006         SLAPD_MODULES_LDFLAGS="-dlopen self"
17007 fi
17008
17009 if test "$ol_link_dnssrv" != no ; then
17010         cat >> confdefs.h <<\EOF
17011 #define SLAPD_DNSSRV 1
17012 EOF
17013
17014         BUILD_SLAPD=yes
17015         BUILD_DNSSRV=yes
17016         if test "$ol_with_dnssrv_module" != static ; then
17017                 cat >> confdefs.h <<\EOF
17018 #define SLAPD_DNSSRV_DYNAMIC 1
17019 EOF
17020
17021                 BUILD_DNSSRV=mod
17022                 BUILD_DNSSRV_DYNAMIC=shared
17023                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17024         fi
17025 fi
17026
17027 if test "$ol_enable_ldap" != no ; then
17028         cat >> confdefs.h <<\EOF
17029 #define SLAPD_LDAP 1
17030 EOF
17031
17032         BUILD_SLAPD=yes
17033         BUILD_LDAP=yes
17034         if test "$ol_with_ldap_module" != static ; then
17035                 cat >> confdefs.h <<\EOF
17036 #define SLAPD_LDAP_DYNAMIC 1
17037 EOF
17038
17039                 BUILD_LDAP=mod
17040                 BUILD_LDAP_DYNAMIC=shared
17041                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17042         fi
17043 fi
17044
17045 if test "$ol_link_ldbm" != no ; then
17046         cat >> confdefs.h <<\EOF
17047 #define SLAPD_LDBM 1
17048 EOF
17049
17050         BUILD_SLAPD=yes
17051         BUILD_LDBM=yes
17052         if test "$ol_with_ldbm_module" != static ; then
17053                 cat >> confdefs.h <<\EOF
17054 #define SLAPD_LDBM_DYNAMIC 1
17055 EOF
17056
17057                 BUILD_LDBM=mod
17058                 BUILD_LDBM_DYNAMIC=shared
17059                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17060         fi
17061 fi
17062
17063 if test "$ol_enable_passwd" != no ; then
17064         cat >> confdefs.h <<\EOF
17065 #define SLAPD_PASSWD 1
17066 EOF
17067
17068         BUILD_SLAPD=yes
17069         BUILD_PASSWD=yes
17070         if test "$ol_with_passwd_module" != static ; then
17071                 cat >> confdefs.h <<\EOF
17072 #define SLAPD_PASSWD_DYNAMIC 1
17073 EOF
17074
17075                 BUILD_PASSWD=mod
17076                 BUILD_PASSWD_DYNAMIC=shared
17077                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17078         fi
17079 fi
17080
17081 if test "$ol_enable_shell" != no ; then
17082         cat >> confdefs.h <<\EOF
17083 #define SLAPD_SHELL 1
17084 EOF
17085
17086         BUILD_SLAPD=yes
17087         BUILD_SHELL=yes
17088         if test "$ol_with_shell_module" != static ; then
17089                 cat >> confdefs.h <<\EOF
17090 #define SLAPD_SHELL_DYNAMIC 1
17091 EOF
17092
17093                 BUILD_SHELL=mod
17094                 BUILD_SHELL_DYNAMIC=shared
17095                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17096         fi
17097 fi
17098
17099 if test "$ol_enable_sql" != no ; then
17100         cat >> confdefs.h <<\EOF
17101 #define SLAPD_SQL 1
17102 EOF
17103
17104         BUILD_SLAPD=yes
17105         BUILD_SQL=yes
17106         if test "$ol_with_sql_module" != static; then
17107                 cat >> confdefs.h <<\EOF
17108 #define SLAPD_SQL_DYNAMIC 1
17109 EOF
17110
17111                 BUILD_SQL=mod
17112                 BUILD_SQL_DYNAMIC=shared
17113                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17114         fi
17115 fi
17116
17117 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17118         $BUILD_SLAPD = yes ; then
17119         BUILD_SLURPD=yes
17120 fi
17121
17122
17123 if test "$LINK_BINS_DYNAMIC" = yes; then
17124     LIB_LINKAGE=DYN
17125     LT_LIB_LINKAGE=shared
17126 else
17127     LIB_LINKAGE=STAT
17128     LT_LIB_LINKAGE=static
17129 fi
17130
17131 if test "$ac_cv_mingw32" = yes ; then
17132     PLAT=NT
17133     DYN_EXT=dll
17134 else
17135     PLAT=UNIX
17136     DYN_EXT=so
17137 fi
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147   
17148   
17149   
17150   
17151   
17152   
17153   
17154   
17155   
17156   
17157   
17158   
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189 trap '' 1 2 15
17190
17191 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17192
17193 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17194 # Let make expand exec_prefix.
17195 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17196
17197 # Any assignment to VPATH causes Sun make to only execute
17198 # the first set of double-colon rules, so remove it if not needed.
17199 # If there is a colon in the path, we need to keep it.
17200 if test "x$srcdir" = x.; then
17201   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17202 fi
17203
17204 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17205
17206 DEFS=-DHAVE_CONFIG_H
17207
17208 # Without the "./", some shells look in PATH for config.status.
17209 : ${CONFIG_STATUS=./config.status}
17210
17211 echo creating $CONFIG_STATUS
17212 rm -f $CONFIG_STATUS
17213 cat > $CONFIG_STATUS <<EOF
17214 #! /bin/sh
17215 # Generated automatically by configure.
17216 # Run this file to recreate the current configuration.
17217 # This directory was configured as follows,
17218 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17219 #
17220 # $0 $ac_configure_args
17221 #
17222 # Compiler output produced by configure, useful for debugging
17223 # configure, is in ./config.log if it exists.
17224
17225 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17226 for ac_option
17227 do
17228   case "\$ac_option" in
17229   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17230     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17231     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17232   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17233     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17234     exit 0 ;;
17235   -help | --help | --hel | --he | --h)
17236     echo "\$ac_cs_usage"; exit 0 ;;
17237   *) echo "\$ac_cs_usage"; exit 1 ;;
17238   esac
17239 done
17240
17241 ac_given_srcdir=$srcdir
17242 ac_given_INSTALL="$INSTALL"
17243
17244 trap 'rm -fr `echo "\
17245 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17246 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17247 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17248 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17249 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17250 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17251 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17252 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17253 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17254 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17255 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17256 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17257 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17258 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17259 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17260 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17261 include/Makefile:build/top.mk:include/Makefile.in \
17262 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17263 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17264 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17265 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17266 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17267 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17268 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17269 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17270 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17271 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17272 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17273 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17274 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17275 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17276 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17277 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17278 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17279 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17280 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17281 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17282 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17283 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17284 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17285  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17286 EOF
17287 cat >> $CONFIG_STATUS <<EOF
17288
17289 # Protect against being on the right side of a sed subst in config.status.
17290 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17291  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17292 $ac_vpsub
17293 $extrasub
17294 s%@SHELL@%$SHELL%g
17295 s%@CFLAGS@%$CFLAGS%g
17296 s%@CPPFLAGS@%$CPPFLAGS%g
17297 s%@CXXFLAGS@%$CXXFLAGS%g
17298 s%@FFLAGS@%$FFLAGS%g
17299 s%@DEFS@%$DEFS%g
17300 s%@LDFLAGS@%$LDFLAGS%g
17301 s%@LIBS@%$LIBS%g
17302 s%@exec_prefix@%$exec_prefix%g
17303 s%@prefix@%$prefix%g
17304 s%@program_transform_name@%$program_transform_name%g
17305 s%@bindir@%$bindir%g
17306 s%@sbindir@%$sbindir%g
17307 s%@libexecdir@%$libexecdir%g
17308 s%@datadir@%$datadir%g
17309 s%@sysconfdir@%$sysconfdir%g
17310 s%@sharedstatedir@%$sharedstatedir%g
17311 s%@localstatedir@%$localstatedir%g
17312 s%@libdir@%$libdir%g
17313 s%@includedir@%$includedir%g
17314 s%@oldincludedir@%$oldincludedir%g
17315 s%@infodir@%$infodir%g
17316 s%@mandir@%$mandir%g
17317 s%@host@%$host%g
17318 s%@host_alias@%$host_alias%g
17319 s%@host_cpu@%$host_cpu%g
17320 s%@host_vendor@%$host_vendor%g
17321 s%@host_os@%$host_os%g
17322 s%@target@%$target%g
17323 s%@target_alias@%$target_alias%g
17324 s%@target_cpu@%$target_cpu%g
17325 s%@target_vendor@%$target_vendor%g
17326 s%@target_os@%$target_os%g
17327 s%@build@%$build%g
17328 s%@build_alias@%$build_alias%g
17329 s%@build_cpu@%$build_cpu%g
17330 s%@build_vendor@%$build_vendor%g
17331 s%@build_os@%$build_os%g
17332 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17333 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17334 s%@INSTALL_DATA@%$INSTALL_DATA%g
17335 s%@PACKAGE@%$PACKAGE%g
17336 s%@VERSION@%$VERSION%g
17337 s%@ACLOCAL@%$ACLOCAL%g
17338 s%@AUTOCONF@%$AUTOCONF%g
17339 s%@AUTOMAKE@%$AUTOMAKE%g
17340 s%@AUTOHEADER@%$AUTOHEADER%g
17341 s%@MAKEINFO@%$MAKEINFO%g
17342 s%@install_sh@%$install_sh%g
17343 s%@AMTAR@%$AMTAR%g
17344 s%@AWK@%$AWK%g
17345 s%@AMTARFLAGS@%$AMTARFLAGS%g
17346 s%@SET_MAKE@%$SET_MAKE%g
17347 s%@top_builddir@%$top_builddir%g
17348 s%@ldap_subdir@%$ldap_subdir%g
17349 s%@CC@%$CC%g
17350 s%@AR@%$AR%g
17351 s%@RANLIB@%$RANLIB%g
17352 s%@LN_S@%$LN_S%g
17353 s%@DLLTOOL@%$DLLTOOL%g
17354 s%@AS@%$AS%g
17355 s%@OBJDUMP@%$OBJDUMP%g
17356 s%@LIBTOOL@%$LIBTOOL%g
17357 s%@LN_H@%$LN_H%g
17358 s%@SENDMAIL@%$SENDMAIL%g
17359 s%@EDITOR@%$EDITOR%g
17360 s%@FINGER@%$FINGER%g
17361 s%@CPP@%$CPP%g
17362 s%@EXEEXT@%$EXEEXT%g
17363 s%@OBJEXT@%$OBJEXT%g
17364 s%@OL_MKDEP@%$OL_MKDEP%g
17365 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17366 s%@LIBOBJS@%$LIBOBJS%g
17367 s%@LIBSRCS@%$LIBSRCS%g
17368 s%@PLAT@%$PLAT%g
17369 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17370 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17371 s%@DYN_EXT@%$DYN_EXT%g
17372 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17373 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17374 s%@BUILD_LDAP@%$BUILD_LDAP%g
17375 s%@BUILD_LDBM@%$BUILD_LDBM%g
17376 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17377 s%@BUILD_SHELL@%$BUILD_SHELL%g
17378 s%@BUILD_SQL@%$BUILD_SQL%g
17379 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17380 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17381 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17382 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17383 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17384 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17385 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17386 s%@LDAP_LIBS@%$LDAP_LIBS%g
17387 s%@LDIF_LIBS@%$LDIF_LIBS%g
17388 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17389 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17390 s%@LDBM_LIBS@%$LDBM_LIBS%g
17391 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17392 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17393 s%@WRAP_LIBS@%$WRAP_LIBS%g
17394 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17395 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17396 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17397 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17398 s%@KRB4_LIBS@%$KRB4_LIBS%g
17399 s%@KRB5_LIBS@%$KRB5_LIBS%g
17400 s%@READLINE_LIBS@%$READLINE_LIBS%g
17401 s%@SASL_LIBS@%$SASL_LIBS%g
17402 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17403 s%@TLS_LIBS@%$TLS_LIBS%g
17404 s%@MODULES_LIBS@%$MODULES_LIBS%g
17405 s%@AUTH_LIBS@%$AUTH_LIBS%g
17406 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17407 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17408 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17409
17410 CEOF
17411 EOF
17412
17413 cat >> $CONFIG_STATUS <<\EOF
17414
17415 # Split the substitutions into bite-sized pieces for seds with
17416 # small command number limits, like on Digital OSF/1 and HP-UX.
17417 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17418 ac_file=1 # Number of current file.
17419 ac_beg=1 # First line for current file.
17420 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17421 ac_more_lines=:
17422 ac_sed_cmds=""
17423 while $ac_more_lines; do
17424   if test $ac_beg -gt 1; then
17425     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17426   else
17427     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17428   fi
17429   if test ! -s conftest.s$ac_file; then
17430     ac_more_lines=false
17431     rm -f conftest.s$ac_file
17432   else
17433     if test -z "$ac_sed_cmds"; then
17434       ac_sed_cmds="sed -f conftest.s$ac_file"
17435     else
17436       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17437     fi
17438     ac_file=`expr $ac_file + 1`
17439     ac_beg=$ac_end
17440     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17441   fi
17442 done
17443 if test -z "$ac_sed_cmds"; then
17444   ac_sed_cmds=cat
17445 fi
17446 EOF
17447
17448 cat >> $CONFIG_STATUS <<EOF
17449
17450 CONFIG_FILES=\${CONFIG_FILES-"\
17451 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17452 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17453 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17454 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17455 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17456 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17457 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17458 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17459 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17460 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17461 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17462 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17463 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17464 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17465 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17466 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17467 include/Makefile:build/top.mk:include/Makefile.in \
17468 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17469 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17470 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17471 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17472 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17473 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17474 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17475 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17476 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17477 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17478 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17479 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17480 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17481 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17482 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17483 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17484 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17485 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17486 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17487 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17488 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17489 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17490 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17491 "}
17492 EOF
17493 cat >> $CONFIG_STATUS <<\EOF
17494 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17495   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17496   case "$ac_file" in
17497   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17498        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17499   *) ac_file_in="${ac_file}.in" ;;
17500   esac
17501
17502   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17503
17504   # Remove last slash and all that follows it.  Not all systems have dirname.
17505   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17506   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17507     # The file is in a subdirectory.
17508     test ! -d "$ac_dir" && mkdir "$ac_dir"
17509     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17510     # A "../" for each directory in $ac_dir_suffix.
17511     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17512   else
17513     ac_dir_suffix= ac_dots=
17514   fi
17515
17516   case "$ac_given_srcdir" in
17517   .)  srcdir=.
17518       if test -z "$ac_dots"; then top_srcdir=.
17519       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17520   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17521   *) # Relative path.
17522     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17523     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17524   esac
17525
17526   case "$ac_given_INSTALL" in
17527   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17528   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17529   esac
17530
17531   echo creating "$ac_file"
17532   rm -f "$ac_file"
17533   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17534   case "$ac_file" in
17535   *[Mm]akefile*) ac_comsub="1i\\
17536 # $configure_input" ;;
17537   *) ac_comsub= ;;
17538   esac
17539
17540   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17541   sed -e "$ac_comsub
17542 s%@configure_input@%$configure_input%g
17543 s%@srcdir@%$srcdir%g
17544 s%@top_srcdir@%$top_srcdir%g
17545 s%@INSTALL@%$INSTALL%g
17546 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17547 fi; done
17548 rm -f conftest.s*
17549
17550 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17551 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17552 #
17553 # ac_d sets the value in "#define NAME VALUE" lines.
17554 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17555 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17556 ac_dC='\3'
17557 ac_dD='%g'
17558 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17559 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17560 ac_uB='\([      ]\)%\1#\2define\3'
17561 ac_uC=' '
17562 ac_uD='\4%g'
17563 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17564 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17565 ac_eB='$%\1#\2define\3'
17566 ac_eC=' '
17567 ac_eD='%g'
17568
17569 if test "${CONFIG_HEADERS+set}" != set; then
17570 EOF
17571 cat >> $CONFIG_STATUS <<EOF
17572   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17573 EOF
17574 cat >> $CONFIG_STATUS <<\EOF
17575 fi
17576 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17577   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17578   case "$ac_file" in
17579   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17580        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17581   *) ac_file_in="${ac_file}.in" ;;
17582   esac
17583
17584   echo creating $ac_file
17585
17586   rm -f conftest.frag conftest.in conftest.out
17587   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17588   cat $ac_file_inputs > conftest.in
17589
17590 EOF
17591
17592 # Transform confdefs.h into a sed script conftest.vals that substitutes
17593 # the proper values into config.h.in to produce config.h.  And first:
17594 # Protect against being on the right side of a sed subst in config.status.
17595 # Protect against being in an unquoted here document in config.status.
17596 rm -f conftest.vals
17597 cat > conftest.hdr <<\EOF
17598 s/[\\&%]/\\&/g
17599 s%[\\$`]%\\&%g
17600 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17601 s%ac_d%ac_u%gp
17602 s%ac_u%ac_e%gp
17603 EOF
17604 sed -n -f conftest.hdr confdefs.h > conftest.vals
17605 rm -f conftest.hdr
17606
17607 # This sed command replaces #undef with comments.  This is necessary, for
17608 # example, in the case of _POSIX_SOURCE, which is predefined and required
17609 # on some systems where configure will not decide to define it.
17610 cat >> conftest.vals <<\EOF
17611 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17612 EOF
17613
17614 # Break up conftest.vals because some shells have a limit on
17615 # the size of here documents, and old seds have small limits too.
17616
17617 rm -f conftest.tail
17618 while :
17619 do
17620   ac_lines=`grep -c . conftest.vals`
17621   # grep -c gives empty output for an empty file on some AIX systems.
17622   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17623   # Write a limited-size here document to conftest.frag.
17624   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17625   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17626   echo 'CEOF
17627   sed -f conftest.frag conftest.in > conftest.out
17628   rm -f conftest.in
17629   mv conftest.out conftest.in
17630 ' >> $CONFIG_STATUS
17631   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17632   rm -f conftest.vals
17633   mv conftest.tail conftest.vals
17634 done
17635 rm -f conftest.vals
17636
17637 cat >> $CONFIG_STATUS <<\EOF
17638   rm -f conftest.frag conftest.h
17639   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17640   cat conftest.in >> conftest.h
17641   rm -f conftest.in
17642   if cmp -s $ac_file conftest.h 2>/dev/null; then
17643     echo "$ac_file is unchanged"
17644     rm -f conftest.h
17645   else
17646     # Remove last slash and all that follows it.  Not all systems have dirname.
17647       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17648       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17649       # The file is in a subdirectory.
17650       test ! -d "$ac_dir" && mkdir "$ac_dir"
17651     fi
17652     rm -f $ac_file
17653     mv conftest.h $ac_file
17654   fi
17655 fi; done
17656
17657 EOF
17658 cat >> $CONFIG_STATUS <<EOF
17659
17660 EOF
17661 cat >> $CONFIG_STATUS <<\EOF
17662
17663 date > stamp-h
17664 echo Please \"make depend\" to build dependencies
17665
17666 exit 0
17667 EOF
17668 chmod +x $CONFIG_STATUS
17669 rm -fr confdefs* $ac_clean_files
17670 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17671