]> git.sur5r.net Git - openldap/blob - configure
rebuild
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.42 2002/09/20 17:09:47 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 cthreads.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                                 ol_with_threads=found
11579                         fi
11580                 fi
11581
11582     elif test $ac_cv_header_cthreads_h = yes ; then
11583                                 
11584                 ol_with_threads=found
11585  
11586                                 save_LIBS="$LIBS"
11587                 LIBS="$LIBS -lthreads"
11588                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11589 echo "configure:11590: checking for cthread_fork" >&5
11590 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11591   echo $ac_n "(cached) $ac_c" 1>&6
11592 else
11593   cat > conftest.$ac_ext <<EOF
11594 #line 11595 "configure"
11595 #include "confdefs.h"
11596 /* System header to define __stub macros and hopefully few prototypes,
11597     which can conflict with char cthread_fork(); below.  */
11598 #include <assert.h>
11599 /* Override any gcc2 internal prototype to avoid an error.  */
11600 /* We use char because int might match the return type of a gcc2
11601     builtin and then its argument prototype would still apply.  */
11602 char cthread_fork();
11603 char (*f)();
11604
11605 int main() {
11606
11607 /* The GNU C library defines this for functions which it implements
11608     to always fail with ENOSYS.  Some functions are actually named
11609     something starting with __ and the normal name is an alias.  */
11610 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11611 choke me
11612 #else
11613 f = cthread_fork;
11614 #endif
11615
11616 ; return 0; }
11617 EOF
11618 if { (eval echo configure:11619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11619   rm -rf conftest*
11620   eval "ac_cv_func_cthread_fork=yes"
11621 else
11622   echo "configure: failed program was:" >&5
11623   cat conftest.$ac_ext >&5
11624   rm -rf conftest*
11625   eval "ac_cv_func_cthread_fork=no"
11626 fi
11627 rm -f conftest*
11628 fi
11629
11630 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11631   echo "$ac_t""yes" 1>&6
11632   ol_link_threads=yes
11633 else
11634   echo "$ac_t""no" 1>&6
11635 fi
11636
11637                 LIBS="$save_LIBS"
11638
11639                 if test $ol_link_threads = yes ; then
11640                         LTHREAD_LIBS="-lthreads"
11641                         ol_link_threads=mach
11642                         ol_with_threads=found
11643                 else
11644                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11645                 fi
11646
11647         elif test $ol_with_threads = mach ; then
11648                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11649         fi
11650
11651         if test $ol_link_threads = mach ; then
11652                 cat >> confdefs.h <<\EOF
11653 #define HAVE_MACH_CTHREADS 1
11654 EOF
11655
11656         elif test $ol_with_threads = found ; then
11657                 { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11658         fi
11659 fi
11660
11661 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11662         -o $ol_with_threads = pth ; then
11663
11664         for ac_hdr in pth.h
11665 do
11666 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11667 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11668 echo "configure:11669: checking for $ac_hdr" >&5
11669 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11670   echo $ac_n "(cached) $ac_c" 1>&6
11671 else
11672   cat > conftest.$ac_ext <<EOF
11673 #line 11674 "configure"
11674 #include "confdefs.h"
11675 #include <$ac_hdr>
11676 EOF
11677 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11678 { (eval echo configure:11679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11679 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11680 if test -z "$ac_err"; then
11681   rm -rf conftest*
11682   eval "ac_cv_header_$ac_safe=yes"
11683 else
11684   echo "$ac_err" >&5
11685   echo "configure: failed program was:" >&5
11686   cat conftest.$ac_ext >&5
11687   rm -rf conftest*
11688   eval "ac_cv_header_$ac_safe=no"
11689 fi
11690 rm -f conftest*
11691 fi
11692 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11693   echo "$ac_t""yes" 1>&6
11694     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11695   cat >> confdefs.h <<EOF
11696 #define $ac_tr_hdr 1
11697 EOF
11698  
11699 else
11700   echo "$ac_t""no" 1>&6
11701 fi
11702 done
11703
11704
11705         if test $ac_cv_header_pth_h = yes ; then
11706                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11707 echo "configure:11708: checking for pth_version in -lpth" >&5
11708 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11709 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11710   echo $ac_n "(cached) $ac_c" 1>&6
11711 else
11712   ac_save_LIBS="$LIBS"
11713 LIBS="-lpth  $LIBS"
11714 cat > conftest.$ac_ext <<EOF
11715 #line 11716 "configure"
11716 #include "confdefs.h"
11717 /* Override any gcc2 internal prototype to avoid an error.  */
11718 /* We use char because int might match the return type of a gcc2
11719     builtin and then its argument prototype would still apply.  */
11720 char pth_version();
11721
11722 int main() {
11723 pth_version()
11724 ; return 0; }
11725 EOF
11726 if { (eval echo configure:11727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11727   rm -rf conftest*
11728   eval "ac_cv_lib_$ac_lib_var=yes"
11729 else
11730   echo "configure: failed program was:" >&5
11731   cat conftest.$ac_ext >&5
11732   rm -rf conftest*
11733   eval "ac_cv_lib_$ac_lib_var=no"
11734 fi
11735 rm -f conftest*
11736 LIBS="$ac_save_LIBS"
11737
11738 fi
11739 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11740   echo "$ac_t""yes" 1>&6
11741   have_pth=yes
11742 else
11743   echo "$ac_t""no" 1>&6
11744 have_pth=no
11745 fi
11746
11747
11748                 if test $have_pth = yes ; then
11749                         cat >> confdefs.h <<\EOF
11750 #define HAVE_GNU_PTH 1
11751 EOF
11752
11753                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11754                         ol_link_threads=pth
11755                         ol_with_threads=found
11756
11757                         if test $ol_with_yielding_select = auto ; then
11758                                 ol_with_yielding_select=yes
11759                         fi
11760                 fi
11761         fi
11762 fi
11763
11764 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11765         -o $ol_with_threads = lwp ; then
11766
11767                 for ac_hdr in thread.h synch.h
11768 do
11769 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11770 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11771 echo "configure:11772: checking for $ac_hdr" >&5
11772 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11773   echo $ac_n "(cached) $ac_c" 1>&6
11774 else
11775   cat > conftest.$ac_ext <<EOF
11776 #line 11777 "configure"
11777 #include "confdefs.h"
11778 #include <$ac_hdr>
11779 EOF
11780 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11781 { (eval echo configure:11782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11782 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11783 if test -z "$ac_err"; then
11784   rm -rf conftest*
11785   eval "ac_cv_header_$ac_safe=yes"
11786 else
11787   echo "$ac_err" >&5
11788   echo "configure: failed program was:" >&5
11789   cat conftest.$ac_ext >&5
11790   rm -rf conftest*
11791   eval "ac_cv_header_$ac_safe=no"
11792 fi
11793 rm -f conftest*
11794 fi
11795 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11796   echo "$ac_t""yes" 1>&6
11797     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11798   cat >> confdefs.h <<EOF
11799 #define $ac_tr_hdr 1
11800 EOF
11801  
11802 else
11803   echo "$ac_t""no" 1>&6
11804 fi
11805 done
11806
11807         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11808                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11809 echo "configure:11810: checking for thr_create in -lthread" >&5
11810 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11811 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11812   echo $ac_n "(cached) $ac_c" 1>&6
11813 else
11814   ac_save_LIBS="$LIBS"
11815 LIBS="-lthread  $LIBS"
11816 cat > conftest.$ac_ext <<EOF
11817 #line 11818 "configure"
11818 #include "confdefs.h"
11819 /* Override any gcc2 internal prototype to avoid an error.  */
11820 /* We use char because int might match the return type of a gcc2
11821     builtin and then its argument prototype would still apply.  */
11822 char thr_create();
11823
11824 int main() {
11825 thr_create()
11826 ; return 0; }
11827 EOF
11828 if { (eval echo configure:11829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11829   rm -rf conftest*
11830   eval "ac_cv_lib_$ac_lib_var=yes"
11831 else
11832   echo "configure: failed program was:" >&5
11833   cat conftest.$ac_ext >&5
11834   rm -rf conftest*
11835   eval "ac_cv_lib_$ac_lib_var=no"
11836 fi
11837 rm -f conftest*
11838 LIBS="$ac_save_LIBS"
11839
11840 fi
11841 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11842   echo "$ac_t""yes" 1>&6
11843   have_thr=yes
11844 else
11845   echo "$ac_t""no" 1>&6
11846 have_thr=no
11847 fi
11848
11849
11850                 if test $have_thr = yes ; then
11851                         cat >> confdefs.h <<\EOF
11852 #define HAVE_THR 1
11853 EOF
11854
11855                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11856                         ol_link_threads=thr
11857
11858                         if test $ol_with_yielding_select = auto ; then
11859                                 ol_with_yielding_select=yes
11860                         fi
11861
11862                                                 for ac_func in \
11863                                 thr_setconcurrency \
11864                                 thr_getconcurrency \
11865                         
11866 do
11867 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11868 echo "configure:11869: checking for $ac_func" >&5
11869 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11870   echo $ac_n "(cached) $ac_c" 1>&6
11871 else
11872   cat > conftest.$ac_ext <<EOF
11873 #line 11874 "configure"
11874 #include "confdefs.h"
11875 /* System header to define __stub macros and hopefully few prototypes,
11876     which can conflict with char $ac_func(); below.  */
11877 #include <assert.h>
11878 /* Override any gcc2 internal prototype to avoid an error.  */
11879 /* We use char because int might match the return type of a gcc2
11880     builtin and then its argument prototype would still apply.  */
11881 char $ac_func();
11882 char (*f)();
11883
11884 int main() {
11885
11886 /* The GNU C library defines this for functions which it implements
11887     to always fail with ENOSYS.  Some functions are actually named
11888     something starting with __ and the normal name is an alias.  */
11889 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11890 choke me
11891 #else
11892 f = $ac_func;
11893 #endif
11894
11895 ; return 0; }
11896 EOF
11897 if { (eval echo configure:11898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11898   rm -rf conftest*
11899   eval "ac_cv_func_$ac_func=yes"
11900 else
11901   echo "configure: failed program was:" >&5
11902   cat conftest.$ac_ext >&5
11903   rm -rf conftest*
11904   eval "ac_cv_func_$ac_func=no"
11905 fi
11906 rm -f conftest*
11907 fi
11908
11909 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11910   echo "$ac_t""yes" 1>&6
11911     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11912   cat >> confdefs.h <<EOF
11913 #define $ac_tr_func 1
11914 EOF
11915  
11916 else
11917   echo "$ac_t""no" 1>&6
11918 fi
11919 done
11920
11921                 fi
11922         fi
11923
11924                 for ac_hdr in lwp/lwp.h
11925 do
11926 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11927 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11928 echo "configure:11929: checking for $ac_hdr" >&5
11929 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11930   echo $ac_n "(cached) $ac_c" 1>&6
11931 else
11932   cat > conftest.$ac_ext <<EOF
11933 #line 11934 "configure"
11934 #include "confdefs.h"
11935 #include <$ac_hdr>
11936 EOF
11937 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11938 { (eval echo configure:11939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11939 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11940 if test -z "$ac_err"; then
11941   rm -rf conftest*
11942   eval "ac_cv_header_$ac_safe=yes"
11943 else
11944   echo "$ac_err" >&5
11945   echo "configure: failed program was:" >&5
11946   cat conftest.$ac_ext >&5
11947   rm -rf conftest*
11948   eval "ac_cv_header_$ac_safe=no"
11949 fi
11950 rm -f conftest*
11951 fi
11952 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11953   echo "$ac_t""yes" 1>&6
11954     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11955   cat >> confdefs.h <<EOF
11956 #define $ac_tr_hdr 1
11957 EOF
11958  
11959 else
11960   echo "$ac_t""no" 1>&6
11961 fi
11962 done
11963
11964         if test $ac_cv_header_lwp_lwp_h = yes ; then
11965                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11966 echo "configure:11967: checking for lwp_create in -llwp" >&5
11967 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11968 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11969   echo $ac_n "(cached) $ac_c" 1>&6
11970 else
11971   ac_save_LIBS="$LIBS"
11972 LIBS="-llwp  $LIBS"
11973 cat > conftest.$ac_ext <<EOF
11974 #line 11975 "configure"
11975 #include "confdefs.h"
11976 /* Override any gcc2 internal prototype to avoid an error.  */
11977 /* We use char because int might match the return type of a gcc2
11978     builtin and then its argument prototype would still apply.  */
11979 char lwp_create();
11980
11981 int main() {
11982 lwp_create()
11983 ; return 0; }
11984 EOF
11985 if { (eval echo configure:11986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11986   rm -rf conftest*
11987   eval "ac_cv_lib_$ac_lib_var=yes"
11988 else
11989   echo "configure: failed program was:" >&5
11990   cat conftest.$ac_ext >&5
11991   rm -rf conftest*
11992   eval "ac_cv_lib_$ac_lib_var=no"
11993 fi
11994 rm -f conftest*
11995 LIBS="$ac_save_LIBS"
11996
11997 fi
11998 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11999   echo "$ac_t""yes" 1>&6
12000   have_lwp=yes
12001 else
12002   echo "$ac_t""no" 1>&6
12003 have_lwp=no
12004 fi
12005
12006
12007                 if test $have_lwp = yes ; then
12008                         cat >> confdefs.h <<\EOF
12009 #define HAVE_LWP 1
12010 EOF
12011
12012                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
12013                         ol_link_threads=lwp
12014
12015                         if test $ol_with_yielding_select = auto ; then
12016                                 ol_with_yielding_select=no
12017                         fi
12018                 fi
12019         fi
12020 fi
12021
12022 if test $ol_with_yielding_select = yes ; then
12023         cat >> confdefs.h <<\EOF
12024 #define HAVE_YIELDING_SELECT 1
12025 EOF
12026
12027 fi
12028
12029 if test $ol_with_threads = manual ; then
12030                 ol_link_threads=yes
12031
12032         echo "configure: warning: thread defines and link options must be set manually" 1>&2
12033
12034         for ac_hdr in pthread.h sched.h
12035 do
12036 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12037 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12038 echo "configure:12039: checking for $ac_hdr" >&5
12039 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12040   echo $ac_n "(cached) $ac_c" 1>&6
12041 else
12042   cat > conftest.$ac_ext <<EOF
12043 #line 12044 "configure"
12044 #include "confdefs.h"
12045 #include <$ac_hdr>
12046 EOF
12047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12048 { (eval echo configure:12049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12049 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12050 if test -z "$ac_err"; then
12051   rm -rf conftest*
12052   eval "ac_cv_header_$ac_safe=yes"
12053 else
12054   echo "$ac_err" >&5
12055   echo "configure: failed program was:" >&5
12056   cat conftest.$ac_ext >&5
12057   rm -rf conftest*
12058   eval "ac_cv_header_$ac_safe=no"
12059 fi
12060 rm -f conftest*
12061 fi
12062 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12063   echo "$ac_t""yes" 1>&6
12064     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12065   cat >> confdefs.h <<EOF
12066 #define $ac_tr_hdr 1
12067 EOF
12068  
12069 else
12070   echo "$ac_t""no" 1>&6
12071 fi
12072 done
12073
12074         for ac_func in sched_yield pthread_yield
12075 do
12076 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12077 echo "configure:12078: checking for $ac_func" >&5
12078 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12079   echo $ac_n "(cached) $ac_c" 1>&6
12080 else
12081   cat > conftest.$ac_ext <<EOF
12082 #line 12083 "configure"
12083 #include "confdefs.h"
12084 /* System header to define __stub macros and hopefully few prototypes,
12085     which can conflict with char $ac_func(); below.  */
12086 #include <assert.h>
12087 /* Override any gcc2 internal prototype to avoid an error.  */
12088 /* We use char because int might match the return type of a gcc2
12089     builtin and then its argument prototype would still apply.  */
12090 char $ac_func();
12091 char (*f)();
12092
12093 int main() {
12094
12095 /* The GNU C library defines this for functions which it implements
12096     to always fail with ENOSYS.  Some functions are actually named
12097     something starting with __ and the normal name is an alias.  */
12098 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12099 choke me
12100 #else
12101 f = $ac_func;
12102 #endif
12103
12104 ; return 0; }
12105 EOF
12106 if { (eval echo configure:12107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12107   rm -rf conftest*
12108   eval "ac_cv_func_$ac_func=yes"
12109 else
12110   echo "configure: failed program was:" >&5
12111   cat conftest.$ac_ext >&5
12112   rm -rf conftest*
12113   eval "ac_cv_func_$ac_func=no"
12114 fi
12115 rm -f conftest*
12116 fi
12117
12118 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12119   echo "$ac_t""yes" 1>&6
12120     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12121   cat >> confdefs.h <<EOF
12122 #define $ac_tr_func 1
12123 EOF
12124  
12125 else
12126   echo "$ac_t""no" 1>&6
12127 fi
12128 done
12129
12130         
12131         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12132 echo "configure:12133: checking for LinuxThreads pthread.h" >&5
12133 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12134   echo $ac_n "(cached) $ac_c" 1>&6
12135 else
12136   cat > conftest.$ac_ext <<EOF
12137 #line 12138 "configure"
12138 #include "confdefs.h"
12139 #include <pthread.h>
12140 EOF
12141 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12142   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12143   rm -rf conftest*
12144   ol_cv_header_linux_threads=yes
12145 else
12146   rm -rf conftest*
12147   ol_cv_header_linux_threads=no
12148 fi
12149 rm -f conftest*
12150
12151                 
12152 fi
12153
12154 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12155         if test $ol_cv_header_linux_threads = yes; then
12156                 cat >> confdefs.h <<\EOF
12157 #define HAVE_LINUX_THREADS 1
12158 EOF
12159
12160         fi
12161
12162
12163         for ac_hdr in mach/cthreads.h
12164 do
12165 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12166 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12167 echo "configure:12168: checking for $ac_hdr" >&5
12168 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12169   echo $ac_n "(cached) $ac_c" 1>&6
12170 else
12171   cat > conftest.$ac_ext <<EOF
12172 #line 12173 "configure"
12173 #include "confdefs.h"
12174 #include <$ac_hdr>
12175 EOF
12176 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12177 { (eval echo configure:12178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12178 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12179 if test -z "$ac_err"; then
12180   rm -rf conftest*
12181   eval "ac_cv_header_$ac_safe=yes"
12182 else
12183   echo "$ac_err" >&5
12184   echo "configure: failed program was:" >&5
12185   cat conftest.$ac_ext >&5
12186   rm -rf conftest*
12187   eval "ac_cv_header_$ac_safe=no"
12188 fi
12189 rm -f conftest*
12190 fi
12191 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12192   echo "$ac_t""yes" 1>&6
12193     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12194   cat >> confdefs.h <<EOF
12195 #define $ac_tr_hdr 1
12196 EOF
12197  
12198 else
12199   echo "$ac_t""no" 1>&6
12200 fi
12201 done
12202
12203         for ac_hdr in lwp/lwp.h
12204 do
12205 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12206 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12207 echo "configure:12208: checking for $ac_hdr" >&5
12208 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12209   echo $ac_n "(cached) $ac_c" 1>&6
12210 else
12211   cat > conftest.$ac_ext <<EOF
12212 #line 12213 "configure"
12213 #include "confdefs.h"
12214 #include <$ac_hdr>
12215 EOF
12216 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12217 { (eval echo configure:12218: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12218 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12219 if test -z "$ac_err"; then
12220   rm -rf conftest*
12221   eval "ac_cv_header_$ac_safe=yes"
12222 else
12223   echo "$ac_err" >&5
12224   echo "configure: failed program was:" >&5
12225   cat conftest.$ac_ext >&5
12226   rm -rf conftest*
12227   eval "ac_cv_header_$ac_safe=no"
12228 fi
12229 rm -f conftest*
12230 fi
12231 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12232   echo "$ac_t""yes" 1>&6
12233     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12234   cat >> confdefs.h <<EOF
12235 #define $ac_tr_hdr 1
12236 EOF
12237  
12238 else
12239   echo "$ac_t""no" 1>&6
12240 fi
12241 done
12242
12243         for ac_hdr in thread.h synch.h
12244 do
12245 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12246 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12247 echo "configure:12248: checking for $ac_hdr" >&5
12248 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12249   echo $ac_n "(cached) $ac_c" 1>&6
12250 else
12251   cat > conftest.$ac_ext <<EOF
12252 #line 12253 "configure"
12253 #include "confdefs.h"
12254 #include <$ac_hdr>
12255 EOF
12256 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12257 { (eval echo configure:12258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12258 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12259 if test -z "$ac_err"; then
12260   rm -rf conftest*
12261   eval "ac_cv_header_$ac_safe=yes"
12262 else
12263   echo "$ac_err" >&5
12264   echo "configure: failed program was:" >&5
12265   cat conftest.$ac_ext >&5
12266   rm -rf conftest*
12267   eval "ac_cv_header_$ac_safe=no"
12268 fi
12269 rm -f conftest*
12270 fi
12271 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12272   echo "$ac_t""yes" 1>&6
12273     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12274   cat >> confdefs.h <<EOF
12275 #define $ac_tr_hdr 1
12276 EOF
12277  
12278 else
12279   echo "$ac_t""no" 1>&6
12280 fi
12281 done
12282
12283 fi
12284
12285 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12286                         cat >> confdefs.h <<\EOF
12287 #define REENTRANT 1
12288 EOF
12289
12290         cat >> confdefs.h <<\EOF
12291 #define _REENTRANT 1
12292 EOF
12293
12294         cat >> confdefs.h <<\EOF
12295 #define THREAD_SAFE 1
12296 EOF
12297
12298         cat >> confdefs.h <<\EOF
12299 #define _THREAD_SAFE 1
12300 EOF
12301
12302         cat >> confdefs.h <<\EOF
12303 #define THREADSAFE 1
12304 EOF
12305
12306         cat >> confdefs.h <<\EOF
12307 #define _THREADSAFE 1
12308 EOF
12309
12310         cat >> confdefs.h <<\EOF
12311 #define _SGI_MP_SOURCE 1
12312 EOF
12313
12314
12315                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12316 echo "configure:12317: checking for thread specific errno" >&5
12317 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12318   echo $ac_n "(cached) $ac_c" 1>&6
12319 else
12320   
12321                 cat > conftest.$ac_ext <<EOF
12322 #line 12323 "configure"
12323 #include "confdefs.h"
12324 #include <errno.h>
12325 int main() {
12326 errno = 0;
12327 ; return 0; }
12328 EOF
12329 if { (eval echo configure:12330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12330   rm -rf conftest*
12331   ol_cv_errno_thread_specific=yes
12332 else
12333   echo "configure: failed program was:" >&5
12334   cat conftest.$ac_ext >&5
12335   rm -rf conftest*
12336   ol_cv_errno_thread_specific=no
12337 fi
12338 rm -f conftest*
12339         
12340 fi
12341
12342 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12343
12344                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12345 echo "configure:12346: checking for thread specific h_errno" >&5
12346 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12347   echo $ac_n "(cached) $ac_c" 1>&6
12348 else
12349   
12350                 cat > conftest.$ac_ext <<EOF
12351 #line 12352 "configure"
12352 #include "confdefs.h"
12353 #include <netdb.h>
12354 int main() {
12355 h_errno = 0;
12356 ; return 0; }
12357 EOF
12358 if { (eval echo configure:12359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12359   rm -rf conftest*
12360   ol_cv_h_errno_thread_specific=yes
12361 else
12362   echo "configure: failed program was:" >&5
12363   cat conftest.$ac_ext >&5
12364   rm -rf conftest*
12365   ol_cv_h_errno_thread_specific=no
12366 fi
12367 rm -f conftest*
12368         
12369 fi
12370
12371 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12372
12373         if test $ol_cv_errno_thread_specific != yes \
12374                 -o $ol_cv_h_errno_thread_specific != yes ; then
12375                 LIBS="$LTHREAD_LIBS $LIBS"
12376                 LTHREAD_LIBS=""
12377         fi
12378
12379 fi  
12380
12381 if test $ol_link_threads = no ; then
12382         if test $ol_with_threads = yes ; then
12383                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12384         fi
12385
12386         if test $ol_with_threads = auto ; then
12387                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12388                 ol_with_threads=no
12389         fi
12390
12391         cat >> confdefs.h <<\EOF
12392 #define NO_THREADS 1
12393 EOF
12394
12395         LTHREAD_LIBS=""
12396 fi
12397
12398 if test $ol_link_threads != no ; then
12399         cat >> confdefs.h <<\EOF
12400 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12401 EOF
12402
12403 fi
12404
12405 ol_link_ldbm=no 
12406
12407 if test $ol_with_ldbm_api = auto \
12408         -o $ol_with_ldbm_api = berkeley \
12409         -o $ol_with_ldbm_api = bcompat ; then
12410
12411         if test $ol_with_ldbm_api = bcompat; then \
12412                 ol_cv_berkeley_db=no
12413 for ac_hdr in db_185.h db.h
12414 do
12415 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12416 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12417 echo "configure:12418: checking for $ac_hdr" >&5
12418 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12419   echo $ac_n "(cached) $ac_c" 1>&6
12420 else
12421   cat > conftest.$ac_ext <<EOF
12422 #line 12423 "configure"
12423 #include "confdefs.h"
12424 #include <$ac_hdr>
12425 EOF
12426 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12427 { (eval echo configure:12428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12428 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12429 if test -z "$ac_err"; then
12430   rm -rf conftest*
12431   eval "ac_cv_header_$ac_safe=yes"
12432 else
12433   echo "$ac_err" >&5
12434   echo "configure: failed program was:" >&5
12435   cat conftest.$ac_ext >&5
12436   rm -rf conftest*
12437   eval "ac_cv_header_$ac_safe=no"
12438 fi
12439 rm -f conftest*
12440 fi
12441 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12442   echo "$ac_t""yes" 1>&6
12443     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12444   cat >> confdefs.h <<EOF
12445 #define $ac_tr_hdr 1
12446 EOF
12447  
12448 else
12449   echo "$ac_t""no" 1>&6
12450 fi
12451 done
12452
12453 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12454         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12455 echo "configure:12456: checking if Berkeley DB header compatibility" >&5
12456 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12457   echo $ac_n "(cached) $ac_c" 1>&6
12458 else
12459   
12460                 cat > conftest.$ac_ext <<EOF
12461 #line 12462 "configure"
12462 #include "confdefs.h"
12463
12464 #if HAVE_DB_185_H
12465 #       include <db_185.h>
12466 #else
12467 #       include <db.h>
12468 #endif
12469
12470  /* this check could be improved */
12471 #ifndef DB_VERSION_MAJOR
12472 #       define DB_VERSION_MAJOR 1
12473 #endif
12474
12475 #if DB_VERSION_MAJOR == 1 
12476         __db_version_1
12477 #endif
12478
12479 EOF
12480 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12481   egrep "__db_version_1" >/dev/null 2>&1; then
12482   rm -rf conftest*
12483   ol_cv_header_db1=yes
12484 else
12485   rm -rf conftest*
12486   ol_cv_header_db1=no
12487 fi
12488 rm -f conftest*
12489
12490 fi
12491
12492 echo "$ac_t""$ol_cv_header_db1" 1>&6
12493
12494         if test $ol_cv_header_db1 = yes ; then
12495                 ol_cv_lib_db=no
12496 if test $ol_cv_lib_db = no ; then
12497         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12498 echo "configure:12499: checking for Berkeley DB link (default)" >&5
12499 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12500   echo $ac_n "(cached) $ac_c" 1>&6
12501 else
12502   
12503         ol_DB_LIB=
12504         ol_LIBS=$LIBS
12505         LIBS="$ol_DB_LIB $LIBS"
12506
12507         cat > conftest.$ac_ext <<EOF
12508 #line 12509 "configure"
12509 #include "confdefs.h"
12510
12511 #ifdef HAVE_DB_185_H
12512 # include <db_185.h>
12513 #else
12514 # include <db.h>
12515 #endif
12516
12517 #ifndef DB_VERSION_MAJOR
12518 # define DB_VERSION_MAJOR 1
12519 #endif
12520
12521 #ifndef NULL
12522 #define NULL ((void*)0)
12523 #endif
12524
12525 int main() {
12526
12527 #if DB_VERSION_MAJOR > 1
12528         {
12529                 char *version;
12530                 int major, minor, patch;
12531
12532                 version = db_version( &major, &minor, &patch );
12533
12534                 if( major != DB_VERSION_MAJOR ||
12535                         minor < DB_VERSION_MINOR )
12536                 {
12537                         printf("Berkeley DB version mismatch\n"
12538                                 "\texpected: %s\n\tgot: %s\n",
12539                                 DB_VERSION_STRING, version);
12540                         return 1;
12541                 }
12542         }
12543 #endif
12544
12545 #if DB_VERSION_MAJOR > 2
12546         db_env_create( NULL, 0 );
12547 #elif DB_VERSION_MAJOR > 1
12548         db_appexit( NULL );
12549 #else
12550         (void) dbopen( NULL, 0, 0, 0, NULL);
12551 #endif
12552
12553 ; return 0; }
12554 EOF
12555 if { (eval echo configure:12556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12556   rm -rf conftest*
12557   ol_cv_db_none=yes
12558 else
12559   echo "configure: failed program was:" >&5
12560   cat conftest.$ac_ext >&5
12561   rm -rf conftest*
12562   ol_cv_db_none=no
12563 fi
12564 rm -f conftest*
12565
12566         LIBS="$ol_LIBS"
12567
12568 fi
12569
12570 echo "$ac_t""$ol_cv_db_none" 1>&6
12571
12572         if test $ol_cv_db_none = yes ; then
12573                 ol_cv_lib_db=yes
12574         fi
12575 fi
12576
12577 if test $ol_cv_lib_db = no ; then
12578         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12579 echo "configure:12580: checking for Berkeley DB link (-ldb)" >&5
12580 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12581   echo $ac_n "(cached) $ac_c" 1>&6
12582 else
12583   
12584         ol_DB_LIB=-ldb
12585         ol_LIBS=$LIBS
12586         LIBS="$ol_DB_LIB $LIBS"
12587
12588         cat > conftest.$ac_ext <<EOF
12589 #line 12590 "configure"
12590 #include "confdefs.h"
12591
12592 #ifdef HAVE_DB_185_H
12593 # include <db_185.h>
12594 #else
12595 # include <db.h>
12596 #endif
12597
12598 #ifndef DB_VERSION_MAJOR
12599 # define DB_VERSION_MAJOR 1
12600 #endif
12601
12602 #ifndef NULL
12603 #define NULL ((void*)0)
12604 #endif
12605
12606 int main() {
12607
12608 #if DB_VERSION_MAJOR > 1
12609         {
12610                 char *version;
12611                 int major, minor, patch;
12612
12613                 version = db_version( &major, &minor, &patch );
12614
12615                 if( major != DB_VERSION_MAJOR ||
12616                         minor < DB_VERSION_MINOR )
12617                 {
12618                         printf("Berkeley DB version mismatch\n"
12619                                 "\texpected: %s\n\tgot: %s\n",
12620                                 DB_VERSION_STRING, version);
12621                         return 1;
12622                 }
12623         }
12624 #endif
12625
12626 #if DB_VERSION_MAJOR > 2
12627         db_env_create( NULL, 0 );
12628 #elif DB_VERSION_MAJOR > 1
12629         db_appexit( NULL );
12630 #else
12631         (void) dbopen( NULL, 0, 0, 0, NULL);
12632 #endif
12633
12634 ; return 0; }
12635 EOF
12636 if { (eval echo configure:12637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12637   rm -rf conftest*
12638   ol_cv_db_db=yes
12639 else
12640   echo "configure: failed program was:" >&5
12641   cat conftest.$ac_ext >&5
12642   rm -rf conftest*
12643   ol_cv_db_db=no
12644 fi
12645 rm -f conftest*
12646
12647         LIBS="$ol_LIBS"
12648
12649 fi
12650
12651 echo "$ac_t""$ol_cv_db_db" 1>&6
12652
12653         if test $ol_cv_db_db = yes ; then
12654                 ol_cv_lib_db=-ldb
12655         fi
12656 fi
12657
12658 if test $ol_cv_lib_db = no ; then
12659         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
12660 echo "configure:12661: checking for Berkeley DB link (-ldb4)" >&5
12661 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
12662   echo $ac_n "(cached) $ac_c" 1>&6
12663 else
12664   
12665         ol_DB_LIB=-ldb4
12666         ol_LIBS=$LIBS
12667         LIBS="$ol_DB_LIB $LIBS"
12668
12669         cat > conftest.$ac_ext <<EOF
12670 #line 12671 "configure"
12671 #include "confdefs.h"
12672
12673 #ifdef HAVE_DB_185_H
12674 # include <db_185.h>
12675 #else
12676 # include <db.h>
12677 #endif
12678
12679 #ifndef DB_VERSION_MAJOR
12680 # define DB_VERSION_MAJOR 1
12681 #endif
12682
12683 #ifndef NULL
12684 #define NULL ((void*)0)
12685 #endif
12686
12687 int main() {
12688
12689 #if DB_VERSION_MAJOR > 1
12690         {
12691                 char *version;
12692                 int major, minor, patch;
12693
12694                 version = db_version( &major, &minor, &patch );
12695
12696                 if( major != DB_VERSION_MAJOR ||
12697                         minor < DB_VERSION_MINOR )
12698                 {
12699                         printf("Berkeley DB version mismatch\n"
12700                                 "\texpected: %s\n\tgot: %s\n",
12701                                 DB_VERSION_STRING, version);
12702                         return 1;
12703                 }
12704         }
12705 #endif
12706
12707 #if DB_VERSION_MAJOR > 2
12708         db_env_create( NULL, 0 );
12709 #elif DB_VERSION_MAJOR > 1
12710         db_appexit( NULL );
12711 #else
12712         (void) dbopen( NULL, 0, 0, 0, NULL);
12713 #endif
12714
12715 ; return 0; }
12716 EOF
12717 if { (eval echo configure:12718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12718   rm -rf conftest*
12719   ol_cv_db_db4=yes
12720 else
12721   echo "configure: failed program was:" >&5
12722   cat conftest.$ac_ext >&5
12723   rm -rf conftest*
12724   ol_cv_db_db4=no
12725 fi
12726 rm -f conftest*
12727
12728         LIBS="$ol_LIBS"
12729
12730 fi
12731
12732 echo "$ac_t""$ol_cv_db_db4" 1>&6
12733
12734         if test $ol_cv_db_db4 = yes ; then
12735                 ol_cv_lib_db=-ldb4
12736         fi
12737 fi
12738
12739 if test $ol_cv_lib_db = no ; then
12740         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12741 echo "configure:12742: checking for Berkeley DB link (-ldb3)" >&5
12742 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12743   echo $ac_n "(cached) $ac_c" 1>&6
12744 else
12745   
12746         ol_DB_LIB=-ldb3
12747         ol_LIBS=$LIBS
12748         LIBS="$ol_DB_LIB $LIBS"
12749
12750         cat > conftest.$ac_ext <<EOF
12751 #line 12752 "configure"
12752 #include "confdefs.h"
12753
12754 #ifdef HAVE_DB_185_H
12755 # include <db_185.h>
12756 #else
12757 # include <db.h>
12758 #endif
12759
12760 #ifndef DB_VERSION_MAJOR
12761 # define DB_VERSION_MAJOR 1
12762 #endif
12763
12764 #ifndef NULL
12765 #define NULL ((void*)0)
12766 #endif
12767
12768 int main() {
12769
12770 #if DB_VERSION_MAJOR > 1
12771         {
12772                 char *version;
12773                 int major, minor, patch;
12774
12775                 version = db_version( &major, &minor, &patch );
12776
12777                 if( major != DB_VERSION_MAJOR ||
12778                         minor < DB_VERSION_MINOR )
12779                 {
12780                         printf("Berkeley DB version mismatch\n"
12781                                 "\texpected: %s\n\tgot: %s\n",
12782                                 DB_VERSION_STRING, version);
12783                         return 1;
12784                 }
12785         }
12786 #endif
12787
12788 #if DB_VERSION_MAJOR > 2
12789         db_env_create( NULL, 0 );
12790 #elif DB_VERSION_MAJOR > 1
12791         db_appexit( NULL );
12792 #else
12793         (void) dbopen( NULL, 0, 0, 0, NULL);
12794 #endif
12795
12796 ; return 0; }
12797 EOF
12798 if { (eval echo configure:12799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12799   rm -rf conftest*
12800   ol_cv_db_db3=yes
12801 else
12802   echo "configure: failed program was:" >&5
12803   cat conftest.$ac_ext >&5
12804   rm -rf conftest*
12805   ol_cv_db_db3=no
12806 fi
12807 rm -f conftest*
12808
12809         LIBS="$ol_LIBS"
12810
12811 fi
12812
12813 echo "$ac_t""$ol_cv_db_db3" 1>&6
12814
12815         if test $ol_cv_db_db3 = yes ; then
12816                 ol_cv_lib_db=-ldb3
12817         fi
12818 fi
12819
12820 if test $ol_cv_lib_db = no ; then
12821         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12822 echo "configure:12823: checking for Berkeley DB link (-ldb2)" >&5
12823 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12824   echo $ac_n "(cached) $ac_c" 1>&6
12825 else
12826   
12827         ol_DB_LIB=-ldb2
12828         ol_LIBS=$LIBS
12829         LIBS="$ol_DB_LIB $LIBS"
12830
12831         cat > conftest.$ac_ext <<EOF
12832 #line 12833 "configure"
12833 #include "confdefs.h"
12834
12835 #ifdef HAVE_DB_185_H
12836 # include <db_185.h>
12837 #else
12838 # include <db.h>
12839 #endif
12840
12841 #ifndef DB_VERSION_MAJOR
12842 # define DB_VERSION_MAJOR 1
12843 #endif
12844
12845 #ifndef NULL
12846 #define NULL ((void*)0)
12847 #endif
12848
12849 int main() {
12850
12851 #if DB_VERSION_MAJOR > 1
12852         {
12853                 char *version;
12854                 int major, minor, patch;
12855
12856                 version = db_version( &major, &minor, &patch );
12857
12858                 if( major != DB_VERSION_MAJOR ||
12859                         minor < DB_VERSION_MINOR )
12860                 {
12861                         printf("Berkeley DB version mismatch\n"
12862                                 "\texpected: %s\n\tgot: %s\n",
12863                                 DB_VERSION_STRING, version);
12864                         return 1;
12865                 }
12866         }
12867 #endif
12868
12869 #if DB_VERSION_MAJOR > 2
12870         db_env_create( NULL, 0 );
12871 #elif DB_VERSION_MAJOR > 1
12872         db_appexit( NULL );
12873 #else
12874         (void) dbopen( NULL, 0, 0, 0, NULL);
12875 #endif
12876
12877 ; return 0; }
12878 EOF
12879 if { (eval echo configure:12880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12880   rm -rf conftest*
12881   ol_cv_db_db2=yes
12882 else
12883   echo "configure: failed program was:" >&5
12884   cat conftest.$ac_ext >&5
12885   rm -rf conftest*
12886   ol_cv_db_db2=no
12887 fi
12888 rm -f conftest*
12889
12890         LIBS="$ol_LIBS"
12891
12892 fi
12893
12894 echo "$ac_t""$ol_cv_db_db2" 1>&6
12895
12896         if test $ol_cv_db_db2 = yes ; then
12897                 ol_cv_lib_db=-ldb2
12898         fi
12899 fi
12900
12901 if test $ol_cv_lib_db = no ; then
12902         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12903 echo "configure:12904: checking for Berkeley DB link (-ldb1)" >&5
12904 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12905   echo $ac_n "(cached) $ac_c" 1>&6
12906 else
12907   
12908         ol_DB_LIB=-ldb1
12909         ol_LIBS=$LIBS
12910         LIBS="$ol_DB_LIB $LIBS"
12911
12912         cat > conftest.$ac_ext <<EOF
12913 #line 12914 "configure"
12914 #include "confdefs.h"
12915
12916 #ifdef HAVE_DB_185_H
12917 # include <db_185.h>
12918 #else
12919 # include <db.h>
12920 #endif
12921
12922 #ifndef DB_VERSION_MAJOR
12923 # define DB_VERSION_MAJOR 1
12924 #endif
12925
12926 #ifndef NULL
12927 #define NULL ((void*)0)
12928 #endif
12929
12930 int main() {
12931
12932 #if DB_VERSION_MAJOR > 1
12933         {
12934                 char *version;
12935                 int major, minor, patch;
12936
12937                 version = db_version( &major, &minor, &patch );
12938
12939                 if( major != DB_VERSION_MAJOR ||
12940                         minor < DB_VERSION_MINOR )
12941                 {
12942                         printf("Berkeley DB version mismatch\n"
12943                                 "\texpected: %s\n\tgot: %s\n",
12944                                 DB_VERSION_STRING, version);
12945                         return 1;
12946                 }
12947         }
12948 #endif
12949
12950 #if DB_VERSION_MAJOR > 2
12951         db_env_create( NULL, 0 );
12952 #elif DB_VERSION_MAJOR > 1
12953         db_appexit( NULL );
12954 #else
12955         (void) dbopen( NULL, 0, 0, 0, NULL);
12956 #endif
12957
12958 ; return 0; }
12959 EOF
12960 if { (eval echo configure:12961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12961   rm -rf conftest*
12962   ol_cv_db_db1=yes
12963 else
12964   echo "configure: failed program was:" >&5
12965   cat conftest.$ac_ext >&5
12966   rm -rf conftest*
12967   ol_cv_db_db1=no
12968 fi
12969 rm -f conftest*
12970
12971         LIBS="$ol_LIBS"
12972
12973 fi
12974
12975 echo "$ac_t""$ol_cv_db_db1" 1>&6
12976
12977         if test $ol_cv_db_db1 = yes ; then
12978                 ol_cv_lib_db=-ldb1
12979         fi
12980 fi
12981
12982
12983                 if test "$ol_cv_lib_db" != no ; then
12984                         ol_cv_berkeley_db=yes
12985                 fi
12986         fi
12987 fi
12988
12989         else
12990                 ol_cv_berkeley_db=no
12991 for ac_hdr in db.h
12992 do
12993 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12994 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12995 echo "configure:12996: checking for $ac_hdr" >&5
12996 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12997   echo $ac_n "(cached) $ac_c" 1>&6
12998 else
12999   cat > conftest.$ac_ext <<EOF
13000 #line 13001 "configure"
13001 #include "confdefs.h"
13002 #include <$ac_hdr>
13003 EOF
13004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13005 { (eval echo configure:13006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13007 if test -z "$ac_err"; then
13008   rm -rf conftest*
13009   eval "ac_cv_header_$ac_safe=yes"
13010 else
13011   echo "$ac_err" >&5
13012   echo "configure: failed program was:" >&5
13013   cat conftest.$ac_ext >&5
13014   rm -rf conftest*
13015   eval "ac_cv_header_$ac_safe=no"
13016 fi
13017 rm -f conftest*
13018 fi
13019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13020   echo "$ac_t""yes" 1>&6
13021     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13022   cat >> confdefs.h <<EOF
13023 #define $ac_tr_hdr 1
13024 EOF
13025  
13026 else
13027   echo "$ac_t""no" 1>&6
13028 fi
13029 done
13030
13031 if test $ac_cv_header_db_h = yes; then
13032         ol_cv_lib_db=no
13033 if test $ol_cv_lib_db = no ; then
13034         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
13035 echo "configure:13036: checking for Berkeley DB link (default)" >&5
13036 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
13037   echo $ac_n "(cached) $ac_c" 1>&6
13038 else
13039   
13040         ol_DB_LIB=
13041         ol_LIBS=$LIBS
13042         LIBS="$ol_DB_LIB $LIBS"
13043
13044         cat > conftest.$ac_ext <<EOF
13045 #line 13046 "configure"
13046 #include "confdefs.h"
13047
13048 #ifdef HAVE_DB_185_H
13049 # include <db_185.h>
13050 #else
13051 # include <db.h>
13052 #endif
13053
13054 #ifndef DB_VERSION_MAJOR
13055 # define DB_VERSION_MAJOR 1
13056 #endif
13057
13058 #ifndef NULL
13059 #define NULL ((void*)0)
13060 #endif
13061
13062 int main() {
13063
13064 #if DB_VERSION_MAJOR > 1
13065         {
13066                 char *version;
13067                 int major, minor, patch;
13068
13069                 version = db_version( &major, &minor, &patch );
13070
13071                 if( major != DB_VERSION_MAJOR ||
13072                         minor < DB_VERSION_MINOR )
13073                 {
13074                         printf("Berkeley DB version mismatch\n"
13075                                 "\texpected: %s\n\tgot: %s\n",
13076                                 DB_VERSION_STRING, version);
13077                         return 1;
13078                 }
13079         }
13080 #endif
13081
13082 #if DB_VERSION_MAJOR > 2
13083         db_env_create( NULL, 0 );
13084 #elif DB_VERSION_MAJOR > 1
13085         db_appexit( NULL );
13086 #else
13087         (void) dbopen( NULL, 0, 0, 0, NULL);
13088 #endif
13089
13090 ; return 0; }
13091 EOF
13092 if { (eval echo configure:13093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13093   rm -rf conftest*
13094   ol_cv_db_none=yes
13095 else
13096   echo "configure: failed program was:" >&5
13097   cat conftest.$ac_ext >&5
13098   rm -rf conftest*
13099   ol_cv_db_none=no
13100 fi
13101 rm -f conftest*
13102
13103         LIBS="$ol_LIBS"
13104
13105 fi
13106
13107 echo "$ac_t""$ol_cv_db_none" 1>&6
13108
13109         if test $ol_cv_db_none = yes ; then
13110                 ol_cv_lib_db=yes
13111         fi
13112 fi
13113
13114 if test $ol_cv_lib_db = no ; then
13115         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
13116 echo "configure:13117: checking for Berkeley DB link (-ldb)" >&5
13117 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
13118   echo $ac_n "(cached) $ac_c" 1>&6
13119 else
13120   
13121         ol_DB_LIB=-ldb
13122         ol_LIBS=$LIBS
13123         LIBS="$ol_DB_LIB $LIBS"
13124
13125         cat > conftest.$ac_ext <<EOF
13126 #line 13127 "configure"
13127 #include "confdefs.h"
13128
13129 #ifdef HAVE_DB_185_H
13130 # include <db_185.h>
13131 #else
13132 # include <db.h>
13133 #endif
13134
13135 #ifndef DB_VERSION_MAJOR
13136 # define DB_VERSION_MAJOR 1
13137 #endif
13138
13139 #ifndef NULL
13140 #define NULL ((void*)0)
13141 #endif
13142
13143 int main() {
13144
13145 #if DB_VERSION_MAJOR > 1
13146         {
13147                 char *version;
13148                 int major, minor, patch;
13149
13150                 version = db_version( &major, &minor, &patch );
13151
13152                 if( major != DB_VERSION_MAJOR ||
13153                         minor < DB_VERSION_MINOR )
13154                 {
13155                         printf("Berkeley DB version mismatch\n"
13156                                 "\texpected: %s\n\tgot: %s\n",
13157                                 DB_VERSION_STRING, version);
13158                         return 1;
13159                 }
13160         }
13161 #endif
13162
13163 #if DB_VERSION_MAJOR > 2
13164         db_env_create( NULL, 0 );
13165 #elif DB_VERSION_MAJOR > 1
13166         db_appexit( NULL );
13167 #else
13168         (void) dbopen( NULL, 0, 0, 0, NULL);
13169 #endif
13170
13171 ; return 0; }
13172 EOF
13173 if { (eval echo configure:13174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13174   rm -rf conftest*
13175   ol_cv_db_db=yes
13176 else
13177   echo "configure: failed program was:" >&5
13178   cat conftest.$ac_ext >&5
13179   rm -rf conftest*
13180   ol_cv_db_db=no
13181 fi
13182 rm -f conftest*
13183
13184         LIBS="$ol_LIBS"
13185
13186 fi
13187
13188 echo "$ac_t""$ol_cv_db_db" 1>&6
13189
13190         if test $ol_cv_db_db = yes ; then
13191                 ol_cv_lib_db=-ldb
13192         fi
13193 fi
13194
13195 if test $ol_cv_lib_db = no ; then
13196         echo $ac_n "checking for Berkeley DB link (-ldb4)""... $ac_c" 1>&6
13197 echo "configure:13198: checking for Berkeley DB link (-ldb4)" >&5
13198 if eval "test \"\${ol_cv_db_db4+set}\" = set"; then
13199   echo $ac_n "(cached) $ac_c" 1>&6
13200 else
13201   
13202         ol_DB_LIB=-ldb4
13203         ol_LIBS=$LIBS
13204         LIBS="$ol_DB_LIB $LIBS"
13205
13206         cat > conftest.$ac_ext <<EOF
13207 #line 13208 "configure"
13208 #include "confdefs.h"
13209
13210 #ifdef HAVE_DB_185_H
13211 # include <db_185.h>
13212 #else
13213 # include <db.h>
13214 #endif
13215
13216 #ifndef DB_VERSION_MAJOR
13217 # define DB_VERSION_MAJOR 1
13218 #endif
13219
13220 #ifndef NULL
13221 #define NULL ((void*)0)
13222 #endif
13223
13224 int main() {
13225
13226 #if DB_VERSION_MAJOR > 1
13227         {
13228                 char *version;
13229                 int major, minor, patch;
13230
13231                 version = db_version( &major, &minor, &patch );
13232
13233                 if( major != DB_VERSION_MAJOR ||
13234                         minor < DB_VERSION_MINOR )
13235                 {
13236                         printf("Berkeley DB version mismatch\n"
13237                                 "\texpected: %s\n\tgot: %s\n",
13238                                 DB_VERSION_STRING, version);
13239                         return 1;
13240                 }
13241         }
13242 #endif
13243
13244 #if DB_VERSION_MAJOR > 2
13245         db_env_create( NULL, 0 );
13246 #elif DB_VERSION_MAJOR > 1
13247         db_appexit( NULL );
13248 #else
13249         (void) dbopen( NULL, 0, 0, 0, NULL);
13250 #endif
13251
13252 ; return 0; }
13253 EOF
13254 if { (eval echo configure:13255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13255   rm -rf conftest*
13256   ol_cv_db_db4=yes
13257 else
13258   echo "configure: failed program was:" >&5
13259   cat conftest.$ac_ext >&5
13260   rm -rf conftest*
13261   ol_cv_db_db4=no
13262 fi
13263 rm -f conftest*
13264
13265         LIBS="$ol_LIBS"
13266
13267 fi
13268
13269 echo "$ac_t""$ol_cv_db_db4" 1>&6
13270
13271         if test $ol_cv_db_db4 = yes ; then
13272                 ol_cv_lib_db=-ldb4
13273         fi
13274 fi
13275
13276 if test $ol_cv_lib_db = no ; then
13277         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13278 echo "configure:13279: checking for Berkeley DB link (-ldb3)" >&5
13279 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13280   echo $ac_n "(cached) $ac_c" 1>&6
13281 else
13282   
13283         ol_DB_LIB=-ldb3
13284         ol_LIBS=$LIBS
13285         LIBS="$ol_DB_LIB $LIBS"
13286
13287         cat > conftest.$ac_ext <<EOF
13288 #line 13289 "configure"
13289 #include "confdefs.h"
13290
13291 #ifdef HAVE_DB_185_H
13292 # include <db_185.h>
13293 #else
13294 # include <db.h>
13295 #endif
13296
13297 #ifndef DB_VERSION_MAJOR
13298 # define DB_VERSION_MAJOR 1
13299 #endif
13300
13301 #ifndef NULL
13302 #define NULL ((void*)0)
13303 #endif
13304
13305 int main() {
13306
13307 #if DB_VERSION_MAJOR > 1
13308         {
13309                 char *version;
13310                 int major, minor, patch;
13311
13312                 version = db_version( &major, &minor, &patch );
13313
13314                 if( major != DB_VERSION_MAJOR ||
13315                         minor < DB_VERSION_MINOR )
13316                 {
13317                         printf("Berkeley DB version mismatch\n"
13318                                 "\texpected: %s\n\tgot: %s\n",
13319                                 DB_VERSION_STRING, version);
13320                         return 1;
13321                 }
13322         }
13323 #endif
13324
13325 #if DB_VERSION_MAJOR > 2
13326         db_env_create( NULL, 0 );
13327 #elif DB_VERSION_MAJOR > 1
13328         db_appexit( NULL );
13329 #else
13330         (void) dbopen( NULL, 0, 0, 0, NULL);
13331 #endif
13332
13333 ; return 0; }
13334 EOF
13335 if { (eval echo configure:13336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13336   rm -rf conftest*
13337   ol_cv_db_db3=yes
13338 else
13339   echo "configure: failed program was:" >&5
13340   cat conftest.$ac_ext >&5
13341   rm -rf conftest*
13342   ol_cv_db_db3=no
13343 fi
13344 rm -f conftest*
13345
13346         LIBS="$ol_LIBS"
13347
13348 fi
13349
13350 echo "$ac_t""$ol_cv_db_db3" 1>&6
13351
13352         if test $ol_cv_db_db3 = yes ; then
13353                 ol_cv_lib_db=-ldb3
13354         fi
13355 fi
13356
13357 if test $ol_cv_lib_db = no ; then
13358         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13359 echo "configure:13360: checking for Berkeley DB link (-ldb2)" >&5
13360 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13361   echo $ac_n "(cached) $ac_c" 1>&6
13362 else
13363   
13364         ol_DB_LIB=-ldb2
13365         ol_LIBS=$LIBS
13366         LIBS="$ol_DB_LIB $LIBS"
13367
13368         cat > conftest.$ac_ext <<EOF
13369 #line 13370 "configure"
13370 #include "confdefs.h"
13371
13372 #ifdef HAVE_DB_185_H
13373 # include <db_185.h>
13374 #else
13375 # include <db.h>
13376 #endif
13377
13378 #ifndef DB_VERSION_MAJOR
13379 # define DB_VERSION_MAJOR 1
13380 #endif
13381
13382 #ifndef NULL
13383 #define NULL ((void*)0)
13384 #endif
13385
13386 int main() {
13387
13388 #if DB_VERSION_MAJOR > 1
13389         {
13390                 char *version;
13391                 int major, minor, patch;
13392
13393                 version = db_version( &major, &minor, &patch );
13394
13395                 if( major != DB_VERSION_MAJOR ||
13396                         minor < DB_VERSION_MINOR )
13397                 {
13398                         printf("Berkeley DB version mismatch\n"
13399                                 "\texpected: %s\n\tgot: %s\n",
13400                                 DB_VERSION_STRING, version);
13401                         return 1;
13402                 }
13403         }
13404 #endif
13405
13406 #if DB_VERSION_MAJOR > 2
13407         db_env_create( NULL, 0 );
13408 #elif DB_VERSION_MAJOR > 1
13409         db_appexit( NULL );
13410 #else
13411         (void) dbopen( NULL, 0, 0, 0, NULL);
13412 #endif
13413
13414 ; return 0; }
13415 EOF
13416 if { (eval echo configure:13417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13417   rm -rf conftest*
13418   ol_cv_db_db2=yes
13419 else
13420   echo "configure: failed program was:" >&5
13421   cat conftest.$ac_ext >&5
13422   rm -rf conftest*
13423   ol_cv_db_db2=no
13424 fi
13425 rm -f conftest*
13426
13427         LIBS="$ol_LIBS"
13428
13429 fi
13430
13431 echo "$ac_t""$ol_cv_db_db2" 1>&6
13432
13433         if test $ol_cv_db_db2 = yes ; then
13434                 ol_cv_lib_db=-ldb2
13435         fi
13436 fi
13437
13438 if test $ol_cv_lib_db = no ; then
13439         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13440 echo "configure:13441: checking for Berkeley DB link (-ldb1)" >&5
13441 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13442   echo $ac_n "(cached) $ac_c" 1>&6
13443 else
13444   
13445         ol_DB_LIB=-ldb1
13446         ol_LIBS=$LIBS
13447         LIBS="$ol_DB_LIB $LIBS"
13448
13449         cat > conftest.$ac_ext <<EOF
13450 #line 13451 "configure"
13451 #include "confdefs.h"
13452
13453 #ifdef HAVE_DB_185_H
13454 # include <db_185.h>
13455 #else
13456 # include <db.h>
13457 #endif
13458
13459 #ifndef DB_VERSION_MAJOR
13460 # define DB_VERSION_MAJOR 1
13461 #endif
13462
13463 #ifndef NULL
13464 #define NULL ((void*)0)
13465 #endif
13466
13467 int main() {
13468
13469 #if DB_VERSION_MAJOR > 1
13470         {
13471                 char *version;
13472                 int major, minor, patch;
13473
13474                 version = db_version( &major, &minor, &patch );
13475
13476                 if( major != DB_VERSION_MAJOR ||
13477                         minor < DB_VERSION_MINOR )
13478                 {
13479                         printf("Berkeley DB version mismatch\n"
13480                                 "\texpected: %s\n\tgot: %s\n",
13481                                 DB_VERSION_STRING, version);
13482                         return 1;
13483                 }
13484         }
13485 #endif
13486
13487 #if DB_VERSION_MAJOR > 2
13488         db_env_create( NULL, 0 );
13489 #elif DB_VERSION_MAJOR > 1
13490         db_appexit( NULL );
13491 #else
13492         (void) dbopen( NULL, 0, 0, 0, NULL);
13493 #endif
13494
13495 ; return 0; }
13496 EOF
13497 if { (eval echo configure:13498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13498   rm -rf conftest*
13499   ol_cv_db_db1=yes
13500 else
13501   echo "configure: failed program was:" >&5
13502   cat conftest.$ac_ext >&5
13503   rm -rf conftest*
13504   ol_cv_db_db1=no
13505 fi
13506 rm -f conftest*
13507
13508         LIBS="$ol_LIBS"
13509
13510 fi
13511
13512 echo "$ac_t""$ol_cv_db_db1" 1>&6
13513
13514         if test $ol_cv_db_db1 = yes ; then
13515                 ol_cv_lib_db=-ldb1
13516         fi
13517 fi
13518
13519
13520         if test "$ol_cv_lib_db" != no ; then
13521                 ol_cv_berkeley_db=yes
13522                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13523 echo "configure:13524: checking for Berkeley DB thread support" >&5
13524 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13525   echo $ac_n "(cached) $ac_c" 1>&6
13526 else
13527   
13528         ol_LIBS="$LIBS"
13529         if test $ol_cv_lib_db != yes ; then
13530                 LIBS="$ol_cv_lib_db"
13531         fi
13532
13533         if test "$cross_compiling" = yes; then
13534   ol_cv_berkeley_db_thread=cross
13535 else
13536   cat > conftest.$ac_ext <<EOF
13537 #line 13538 "configure"
13538 #include "confdefs.h"
13539
13540 #ifdef HAVE_DB_185_H
13541         choke me;
13542 #else
13543 #include <db.h>
13544 #endif
13545 #ifndef NULL
13546 #define NULL ((void *)0)
13547 #endif
13548 main()
13549 {
13550         int rc;
13551         u_int32_t flags = DB_CREATE |
13552 #ifdef DB_PRIVATE
13553                 DB_PRIVATE |
13554 #endif
13555                 DB_THREAD;
13556
13557 #if DB_VERSION_MAJOR > 2
13558         DB_ENV *env = NULL;
13559
13560         rc = db_env_create( &env, 0 );
13561
13562         flags |= DB_INIT_MPOOL;
13563 #ifdef DB_MPOOL_PRIVATE
13564         flags |= DB_MPOOL_PRIVATE;
13565 #endif
13566
13567         if( rc ) {
13568                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13569                 return rc;
13570         }
13571
13572 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13573         rc = env->open( env, NULL, flags, 0 );
13574 #else
13575         rc = env->open( env, NULL, NULL, flags, 0 );
13576 #endif
13577
13578         if ( rc == 0 ) {
13579                 rc = env->close( env, 0 );
13580         }
13581
13582         if( rc ) {
13583                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13584                 return rc;
13585         }
13586
13587 #else
13588         DB_ENV env;
13589         memset( &env, '\0', sizeof(env) );
13590
13591         rc = db_appinit( NULL, NULL, &env, flags );
13592
13593         if( rc == 0 ) {
13594                 db_appexit( &env );
13595         }
13596
13597         unlink("__db_mpool.share");
13598         unlink("__db_lock.share");
13599 #endif
13600
13601         return rc;
13602 }
13603 EOF
13604 if { (eval echo configure:13605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13605 then
13606   ol_cv_berkeley_db_thread=yes
13607 else
13608   echo "configure: failed program was:" >&5
13609   cat conftest.$ac_ext >&5
13610   rm -fr conftest*
13611   ol_cv_berkeley_db_thread=no
13612 fi
13613 rm -fr conftest*
13614 fi
13615
13616
13617         LIBS="$ol_LIBS"
13618
13619         if test $ol_cv_berkeley_db_thread != no ; then
13620                 cat >> confdefs.h <<\EOF
13621 #define HAVE_BERKELEY_DB_THREAD 1
13622 EOF
13623
13624         fi
13625
13626 fi
13627
13628 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13629         fi
13630 fi
13631
13632         fi
13633
13634         if test $ol_cv_berkeley_db != no ; then
13635                 cat >> confdefs.h <<\EOF
13636 #define HAVE_BERKELEY_DB 1
13637 EOF
13638
13639
13640                 ol_link_ldbm=berkeley
13641                 ol_with_ldbm_api=db
13642
13643                 if test $ol_with_ldbm_type = hash ; then
13644                         cat >> confdefs.h <<\EOF
13645 #define LDBM_USE_DBHASH 1
13646 EOF
13647
13648                 else
13649                         cat >> confdefs.h <<\EOF
13650 #define LDBM_USE_DBBTREE 1
13651 EOF
13652
13653                 fi
13654
13655                                                 if test $ol_cv_lib_db != yes ; then
13656                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13657                 fi
13658         fi
13659 fi
13660
13661 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13662         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13663         ol_with_ldbm_api=none
13664 fi
13665
13666 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13667         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13668 echo "configure:13669: checking for MDBM library" >&5
13669 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13670   echo $ac_n "(cached) $ac_c" 1>&6
13671 else
13672         ol_LIBS="$LIBS"
13673         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13674 echo "configure:13675: checking for mdbm_set_chain" >&5
13675 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13676   echo $ac_n "(cached) $ac_c" 1>&6
13677 else
13678   cat > conftest.$ac_ext <<EOF
13679 #line 13680 "configure"
13680 #include "confdefs.h"
13681 /* System header to define __stub macros and hopefully few prototypes,
13682     which can conflict with char mdbm_set_chain(); below.  */
13683 #include <assert.h>
13684 /* Override any gcc2 internal prototype to avoid an error.  */
13685 /* We use char because int might match the return type of a gcc2
13686     builtin and then its argument prototype would still apply.  */
13687 char mdbm_set_chain();
13688 char (*f)();
13689
13690 int main() {
13691
13692 /* The GNU C library defines this for functions which it implements
13693     to always fail with ENOSYS.  Some functions are actually named
13694     something starting with __ and the normal name is an alias.  */
13695 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13696 choke me
13697 #else
13698 f = mdbm_set_chain;
13699 #endif
13700
13701 ; return 0; }
13702 EOF
13703 if { (eval echo configure:13704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13704   rm -rf conftest*
13705   eval "ac_cv_func_mdbm_set_chain=yes"
13706 else
13707   echo "configure: failed program was:" >&5
13708   cat conftest.$ac_ext >&5
13709   rm -rf conftest*
13710   eval "ac_cv_func_mdbm_set_chain=no"
13711 fi
13712 rm -f conftest*
13713 fi
13714
13715 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13716   echo "$ac_t""yes" 1>&6
13717   ol_cv_lib_mdbm=yes
13718 else
13719   echo "$ac_t""no" 1>&6
13720
13721                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13722 echo "configure:13723: checking for mdbm_set_chain in -lmdbm" >&5
13723 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13724 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13725   echo $ac_n "(cached) $ac_c" 1>&6
13726 else
13727   ac_save_LIBS="$LIBS"
13728 LIBS="-lmdbm  $LIBS"
13729 cat > conftest.$ac_ext <<EOF
13730 #line 13731 "configure"
13731 #include "confdefs.h"
13732 /* Override any gcc2 internal prototype to avoid an error.  */
13733 /* We use char because int might match the return type of a gcc2
13734     builtin and then its argument prototype would still apply.  */
13735 char mdbm_set_chain();
13736
13737 int main() {
13738 mdbm_set_chain()
13739 ; return 0; }
13740 EOF
13741 if { (eval echo configure:13742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13742   rm -rf conftest*
13743   eval "ac_cv_lib_$ac_lib_var=yes"
13744 else
13745   echo "configure: failed program was:" >&5
13746   cat conftest.$ac_ext >&5
13747   rm -rf conftest*
13748   eval "ac_cv_lib_$ac_lib_var=no"
13749 fi
13750 rm -f conftest*
13751 LIBS="$ac_save_LIBS"
13752
13753 fi
13754 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13755   echo "$ac_t""yes" 1>&6
13756   ol_cv_lib_mdbm=-lmdbm
13757 else
13758   echo "$ac_t""no" 1>&6
13759 ol_cv_lib_mdbm=no
13760 fi
13761
13762         
13763 fi
13764
13765         LIBS="$ol_LIBS"
13766
13767 fi
13768
13769 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13770
13771
13772  for ac_hdr in mdbm.h
13773 do
13774 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13775 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13776 echo "configure:13777: checking for $ac_hdr" >&5
13777 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13778   echo $ac_n "(cached) $ac_c" 1>&6
13779 else
13780   cat > conftest.$ac_ext <<EOF
13781 #line 13782 "configure"
13782 #include "confdefs.h"
13783 #include <$ac_hdr>
13784 EOF
13785 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13786 { (eval echo configure:13787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13787 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13788 if test -z "$ac_err"; then
13789   rm -rf conftest*
13790   eval "ac_cv_header_$ac_safe=yes"
13791 else
13792   echo "$ac_err" >&5
13793   echo "configure: failed program was:" >&5
13794   cat conftest.$ac_ext >&5
13795   rm -rf conftest*
13796   eval "ac_cv_header_$ac_safe=no"
13797 fi
13798 rm -f conftest*
13799 fi
13800 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13801   echo "$ac_t""yes" 1>&6
13802     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13803   cat >> confdefs.h <<EOF
13804 #define $ac_tr_hdr 1
13805 EOF
13806  
13807 else
13808   echo "$ac_t""no" 1>&6
13809 fi
13810 done
13811
13812  echo $ac_n "checking for db""... $ac_c" 1>&6
13813 echo "configure:13814: checking for db" >&5
13814 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13815   echo $ac_n "(cached) $ac_c" 1>&6
13816 else
13817   
13818         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13819                 ol_cv_mdbm=no
13820         else
13821                 ol_cv_mdbm=yes
13822         fi
13823
13824 fi
13825
13826 echo "$ac_t""$ol_cv_mdbm" 1>&6
13827  if test $ol_cv_mdbm = yes ; then
13828         cat >> confdefs.h <<\EOF
13829 #define HAVE_MDBM 1
13830 EOF
13831
13832  fi
13833
13834
13835         if test $ol_cv_mdbm = yes ; then
13836                 ol_link_ldbm=mdbm
13837                 ol_with_ldbm_api=mdbm
13838                 if test $ol_cv_lib_mdbm != yes ; then
13839                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13840                 fi
13841         fi
13842 fi
13843
13844 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13845         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13846 echo "configure:13847: checking for GDBM library" >&5
13847 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13848   echo $ac_n "(cached) $ac_c" 1>&6
13849 else
13850         ol_LIBS="$LIBS"
13851         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13852 echo "configure:13853: checking for gdbm_open" >&5
13853 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13854   echo $ac_n "(cached) $ac_c" 1>&6
13855 else
13856   cat > conftest.$ac_ext <<EOF
13857 #line 13858 "configure"
13858 #include "confdefs.h"
13859 /* System header to define __stub macros and hopefully few prototypes,
13860     which can conflict with char gdbm_open(); below.  */
13861 #include <assert.h>
13862 /* Override any gcc2 internal prototype to avoid an error.  */
13863 /* We use char because int might match the return type of a gcc2
13864     builtin and then its argument prototype would still apply.  */
13865 char gdbm_open();
13866 char (*f)();
13867
13868 int main() {
13869
13870 /* The GNU C library defines this for functions which it implements
13871     to always fail with ENOSYS.  Some functions are actually named
13872     something starting with __ and the normal name is an alias.  */
13873 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13874 choke me
13875 #else
13876 f = gdbm_open;
13877 #endif
13878
13879 ; return 0; }
13880 EOF
13881 if { (eval echo configure:13882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13882   rm -rf conftest*
13883   eval "ac_cv_func_gdbm_open=yes"
13884 else
13885   echo "configure: failed program was:" >&5
13886   cat conftest.$ac_ext >&5
13887   rm -rf conftest*
13888   eval "ac_cv_func_gdbm_open=no"
13889 fi
13890 rm -f conftest*
13891 fi
13892
13893 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13894   echo "$ac_t""yes" 1>&6
13895   ol_cv_lib_gdbm=yes
13896 else
13897   echo "$ac_t""no" 1>&6
13898
13899                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13900 echo "configure:13901: checking for gdbm_open in -lgdbm" >&5
13901 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13902 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13903   echo $ac_n "(cached) $ac_c" 1>&6
13904 else
13905   ac_save_LIBS="$LIBS"
13906 LIBS="-lgdbm  $LIBS"
13907 cat > conftest.$ac_ext <<EOF
13908 #line 13909 "configure"
13909 #include "confdefs.h"
13910 /* Override any gcc2 internal prototype to avoid an error.  */
13911 /* We use char because int might match the return type of a gcc2
13912     builtin and then its argument prototype would still apply.  */
13913 char gdbm_open();
13914
13915 int main() {
13916 gdbm_open()
13917 ; return 0; }
13918 EOF
13919 if { (eval echo configure:13920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13920   rm -rf conftest*
13921   eval "ac_cv_lib_$ac_lib_var=yes"
13922 else
13923   echo "configure: failed program was:" >&5
13924   cat conftest.$ac_ext >&5
13925   rm -rf conftest*
13926   eval "ac_cv_lib_$ac_lib_var=no"
13927 fi
13928 rm -f conftest*
13929 LIBS="$ac_save_LIBS"
13930
13931 fi
13932 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13933   echo "$ac_t""yes" 1>&6
13934   ol_cv_lib_gdbm=-lgdbm
13935 else
13936   echo "$ac_t""no" 1>&6
13937 ol_cv_lib_gdbm=no
13938 fi
13939
13940         
13941 fi
13942
13943         LIBS="$ol_LIBS"
13944
13945 fi
13946
13947 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13948
13949
13950  for ac_hdr in gdbm.h
13951 do
13952 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13953 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13954 echo "configure:13955: checking for $ac_hdr" >&5
13955 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13956   echo $ac_n "(cached) $ac_c" 1>&6
13957 else
13958   cat > conftest.$ac_ext <<EOF
13959 #line 13960 "configure"
13960 #include "confdefs.h"
13961 #include <$ac_hdr>
13962 EOF
13963 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13964 { (eval echo configure:13965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13965 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13966 if test -z "$ac_err"; then
13967   rm -rf conftest*
13968   eval "ac_cv_header_$ac_safe=yes"
13969 else
13970   echo "$ac_err" >&5
13971   echo "configure: failed program was:" >&5
13972   cat conftest.$ac_ext >&5
13973   rm -rf conftest*
13974   eval "ac_cv_header_$ac_safe=no"
13975 fi
13976 rm -f conftest*
13977 fi
13978 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13979   echo "$ac_t""yes" 1>&6
13980     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13981   cat >> confdefs.h <<EOF
13982 #define $ac_tr_hdr 1
13983 EOF
13984  
13985 else
13986   echo "$ac_t""no" 1>&6
13987 fi
13988 done
13989
13990  echo $ac_n "checking for db""... $ac_c" 1>&6
13991 echo "configure:13992: checking for db" >&5
13992 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13993   echo $ac_n "(cached) $ac_c" 1>&6
13994 else
13995   
13996         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13997                 ol_cv_gdbm=no
13998         else
13999                 ol_cv_gdbm=yes
14000         fi
14001
14002 fi
14003
14004 echo "$ac_t""$ol_cv_gdbm" 1>&6
14005  if test $ol_cv_gdbm = yes ; then
14006         cat >> confdefs.h <<\EOF
14007 #define HAVE_GDBM 1
14008 EOF
14009
14010  fi
14011
14012
14013         if test $ol_cv_gdbm = yes ; then
14014                 ol_link_ldbm=gdbm
14015                 ol_with_ldbm_api=gdbm
14016
14017                 if test $ol_cv_lib_gdbm != yes ; then
14018                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
14019                 fi
14020         fi
14021 fi
14022
14023 if test $ol_with_ldbm_api = ndbm ; then
14024         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
14025 echo "configure:14026: checking for NDBM library" >&5
14026 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
14027   echo $ac_n "(cached) $ac_c" 1>&6
14028 else
14029         ol_LIBS="$LIBS"
14030         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
14031 echo "configure:14032: checking for dbm_open" >&5
14032 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
14033   echo $ac_n "(cached) $ac_c" 1>&6
14034 else
14035   cat > conftest.$ac_ext <<EOF
14036 #line 14037 "configure"
14037 #include "confdefs.h"
14038 /* System header to define __stub macros and hopefully few prototypes,
14039     which can conflict with char dbm_open(); below.  */
14040 #include <assert.h>
14041 /* Override any gcc2 internal prototype to avoid an error.  */
14042 /* We use char because int might match the return type of a gcc2
14043     builtin and then its argument prototype would still apply.  */
14044 char dbm_open();
14045 char (*f)();
14046
14047 int main() {
14048
14049 /* The GNU C library defines this for functions which it implements
14050     to always fail with ENOSYS.  Some functions are actually named
14051     something starting with __ and the normal name is an alias.  */
14052 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
14053 choke me
14054 #else
14055 f = dbm_open;
14056 #endif
14057
14058 ; return 0; }
14059 EOF
14060 if { (eval echo configure:14061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14061   rm -rf conftest*
14062   eval "ac_cv_func_dbm_open=yes"
14063 else
14064   echo "configure: failed program was:" >&5
14065   cat conftest.$ac_ext >&5
14066   rm -rf conftest*
14067   eval "ac_cv_func_dbm_open=no"
14068 fi
14069 rm -f conftest*
14070 fi
14071
14072 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
14073   echo "$ac_t""yes" 1>&6
14074   ol_cv_lib_ndbm=yes
14075 else
14076   echo "$ac_t""no" 1>&6
14077
14078                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
14079 echo "configure:14080: checking for dbm_open in -lndbm" >&5
14080 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14081 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14082   echo $ac_n "(cached) $ac_c" 1>&6
14083 else
14084   ac_save_LIBS="$LIBS"
14085 LIBS="-lndbm  $LIBS"
14086 cat > conftest.$ac_ext <<EOF
14087 #line 14088 "configure"
14088 #include "confdefs.h"
14089 /* Override any gcc2 internal prototype to avoid an error.  */
14090 /* We use char because int might match the return type of a gcc2
14091     builtin and then its argument prototype would still apply.  */
14092 char dbm_open();
14093
14094 int main() {
14095 dbm_open()
14096 ; return 0; }
14097 EOF
14098 if { (eval echo configure:14099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14099   rm -rf conftest*
14100   eval "ac_cv_lib_$ac_lib_var=yes"
14101 else
14102   echo "configure: failed program was:" >&5
14103   cat conftest.$ac_ext >&5
14104   rm -rf conftest*
14105   eval "ac_cv_lib_$ac_lib_var=no"
14106 fi
14107 rm -f conftest*
14108 LIBS="$ac_save_LIBS"
14109
14110 fi
14111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14112   echo "$ac_t""yes" 1>&6
14113   ol_cv_lib_ndbm=-lndbm
14114 else
14115   echo "$ac_t""no" 1>&6
14116
14117                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
14118 echo "configure:14119: checking for dbm_open in -ldbm" >&5
14119 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
14120 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14121   echo $ac_n "(cached) $ac_c" 1>&6
14122 else
14123   ac_save_LIBS="$LIBS"
14124 LIBS="-ldbm  $LIBS"
14125 cat > conftest.$ac_ext <<EOF
14126 #line 14127 "configure"
14127 #include "confdefs.h"
14128 /* Override any gcc2 internal prototype to avoid an error.  */
14129 /* We use char because int might match the return type of a gcc2
14130     builtin and then its argument prototype would still apply.  */
14131 char dbm_open();
14132
14133 int main() {
14134 dbm_open()
14135 ; return 0; }
14136 EOF
14137 if { (eval echo configure:14138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14138   rm -rf conftest*
14139   eval "ac_cv_lib_$ac_lib_var=yes"
14140 else
14141   echo "configure: failed program was:" >&5
14142   cat conftest.$ac_ext >&5
14143   rm -rf conftest*
14144   eval "ac_cv_lib_$ac_lib_var=no"
14145 fi
14146 rm -f conftest*
14147 LIBS="$ac_save_LIBS"
14148
14149 fi
14150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14151   echo "$ac_t""yes" 1>&6
14152   ol_cv_lib_ndbm=-ldbm
14153 else
14154   echo "$ac_t""no" 1>&6
14155 ol_cv_lib_ndbm=no
14156 fi
14157                 
14158 fi
14159
14160         
14161 fi
14162
14163         LIBS="$ol_LIBS"
14164
14165 fi
14166
14167 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
14168
14169
14170  for ac_hdr in ndbm.h
14171 do
14172 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14173 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14174 echo "configure:14175: checking for $ac_hdr" >&5
14175 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14176   echo $ac_n "(cached) $ac_c" 1>&6
14177 else
14178   cat > conftest.$ac_ext <<EOF
14179 #line 14180 "configure"
14180 #include "confdefs.h"
14181 #include <$ac_hdr>
14182 EOF
14183 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14184 { (eval echo configure:14185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14185 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14186 if test -z "$ac_err"; then
14187   rm -rf conftest*
14188   eval "ac_cv_header_$ac_safe=yes"
14189 else
14190   echo "$ac_err" >&5
14191   echo "configure: failed program was:" >&5
14192   cat conftest.$ac_ext >&5
14193   rm -rf conftest*
14194   eval "ac_cv_header_$ac_safe=no"
14195 fi
14196 rm -f conftest*
14197 fi
14198 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14199   echo "$ac_t""yes" 1>&6
14200     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14201   cat >> confdefs.h <<EOF
14202 #define $ac_tr_hdr 1
14203 EOF
14204  
14205 else
14206   echo "$ac_t""no" 1>&6
14207 fi
14208 done
14209
14210  echo $ac_n "checking for db""... $ac_c" 1>&6
14211 echo "configure:14212: checking for db" >&5
14212 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14213   echo $ac_n "(cached) $ac_c" 1>&6
14214 else
14215   
14216         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14217                 ol_cv_ndbm=no
14218         else
14219                 ol_cv_ndbm=yes
14220         fi
14221
14222 fi
14223
14224 echo "$ac_t""$ol_cv_ndbm" 1>&6
14225  if test $ol_cv_ndbm = yes ; then
14226         cat >> confdefs.h <<\EOF
14227 #define HAVE_NDBM 1
14228 EOF
14229
14230  fi
14231
14232
14233         if test $ol_cv_ndbm = yes ; then
14234                 ol_link_ldbm=ndbm
14235                 ol_with_ldbm_api=ndbm
14236
14237                 if test $ol_cv_lib_ndbm != yes ; then
14238                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14239                 fi
14240         fi
14241 fi
14242
14243 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14244         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14245         if test $ol_enable_ldbm = yes ; then
14246                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14247         fi
14248
14249         echo "configure: warning: disabling LDBM" 1>&2
14250         ol_enable_ldbm=no
14251 fi
14252
14253 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14254         LINK_BINS_DYNAMIC="yes"
14255 else
14256         LINK_BINS_DYNAMIC="no"
14257 fi
14258
14259 if test $ol_enable_wrappers != no ; then
14260         for ac_hdr in tcpd.h
14261 do
14262 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14263 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14264 echo "configure:14265: checking for $ac_hdr" >&5
14265 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14266   echo $ac_n "(cached) $ac_c" 1>&6
14267 else
14268   cat > conftest.$ac_ext <<EOF
14269 #line 14270 "configure"
14270 #include "confdefs.h"
14271 #include <$ac_hdr>
14272 EOF
14273 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14274 { (eval echo configure:14275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14275 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14276 if test -z "$ac_err"; then
14277   rm -rf conftest*
14278   eval "ac_cv_header_$ac_safe=yes"
14279 else
14280   echo "$ac_err" >&5
14281   echo "configure: failed program was:" >&5
14282   cat conftest.$ac_ext >&5
14283   rm -rf conftest*
14284   eval "ac_cv_header_$ac_safe=no"
14285 fi
14286 rm -f conftest*
14287 fi
14288 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14289   echo "$ac_t""yes" 1>&6
14290     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14291   cat >> confdefs.h <<EOF
14292 #define $ac_tr_hdr 1
14293 EOF
14294  
14295 else
14296   echo "$ac_t""no" 1>&6
14297 fi
14298 done
14299
14300
14301         if test $ac_cv_header_tcpd_h != yes ; then
14302                 have_wrappers=no
14303         else
14304                 cat > conftest.$ac_ext <<EOF
14305 #line 14306 "configure"
14306 #include "confdefs.h"
14307
14308 int allow_severity = 0;
14309 int deny_severity  = 0;
14310                 
14311 int main() {
14312 hosts_access()
14313 ; return 0; }
14314 EOF
14315 if { (eval echo configure:14316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14316   rm -rf conftest*
14317   have_wrappers=yes
14318 else
14319   echo "configure: failed program was:" >&5
14320   cat conftest.$ac_ext >&5
14321   rm -rf conftest*
14322   have_wrappers=no
14323 fi
14324 rm -f conftest*
14325         fi
14326
14327         if test $have_wrappers = yes ; then
14328                 cat >> confdefs.h <<\EOF
14329 #define HAVE_TCPD 1
14330 EOF
14331
14332                 WRAP_LIBS="-lwrap"
14333
14334                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14335 echo "configure:14336: checking for main in -lnsl" >&5
14336 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14337 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14338   echo $ac_n "(cached) $ac_c" 1>&6
14339 else
14340   ac_save_LIBS="$LIBS"
14341 LIBS="-lnsl  $LIBS"
14342 cat > conftest.$ac_ext <<EOF
14343 #line 14344 "configure"
14344 #include "confdefs.h"
14345
14346 int main() {
14347 main()
14348 ; return 0; }
14349 EOF
14350 if { (eval echo configure:14351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14351   rm -rf conftest*
14352   eval "ac_cv_lib_$ac_lib_var=yes"
14353 else
14354   echo "configure: failed program was:" >&5
14355   cat conftest.$ac_ext >&5
14356   rm -rf conftest*
14357   eval "ac_cv_lib_$ac_lib_var=no"
14358 fi
14359 rm -f conftest*
14360 LIBS="$ac_save_LIBS"
14361
14362 fi
14363 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14364   echo "$ac_t""yes" 1>&6
14365     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14366     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14367   cat >> confdefs.h <<EOF
14368 #define $ac_tr_lib 1
14369 EOF
14370
14371   LIBS="-lnsl $LIBS"
14372
14373 else
14374   echo "$ac_t""no" 1>&6
14375 fi
14376
14377         else
14378                 echo "configure: warning: could not find -lwrap" 1>&2
14379                 if test $ol_enable_wrappers = yes ; then
14380                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14381                 fi
14382
14383                 echo "configure: warning: disabling wrappers support" 1>&2
14384                 ol_enable_wrappers=no
14385                 WRAP_LIBS=""
14386         fi
14387 fi
14388
14389 if test $ol_enable_syslog != no ; then
14390         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14391 echo "configure:14392: checking for openlog" >&5
14392 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14393   echo $ac_n "(cached) $ac_c" 1>&6
14394 else
14395   cat > conftest.$ac_ext <<EOF
14396 #line 14397 "configure"
14397 #include "confdefs.h"
14398 /* System header to define __stub macros and hopefully few prototypes,
14399     which can conflict with char openlog(); below.  */
14400 #include <assert.h>
14401 /* Override any gcc2 internal prototype to avoid an error.  */
14402 /* We use char because int might match the return type of a gcc2
14403     builtin and then its argument prototype would still apply.  */
14404 char openlog();
14405 char (*f)();
14406
14407 int main() {
14408
14409 /* The GNU C library defines this for functions which it implements
14410     to always fail with ENOSYS.  Some functions are actually named
14411     something starting with __ and the normal name is an alias.  */
14412 #if defined (__stub_openlog) || defined (__stub___openlog)
14413 choke me
14414 #else
14415 f = openlog;
14416 #endif
14417
14418 ; return 0; }
14419 EOF
14420 if { (eval echo configure:14421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14421   rm -rf conftest*
14422   eval "ac_cv_func_openlog=yes"
14423 else
14424   echo "configure: failed program was:" >&5
14425   cat conftest.$ac_ext >&5
14426   rm -rf conftest*
14427   eval "ac_cv_func_openlog=no"
14428 fi
14429 rm -f conftest*
14430 fi
14431
14432 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14433   echo "$ac_t""yes" 1>&6
14434   :
14435 else
14436   echo "$ac_t""no" 1>&6
14437 fi
14438
14439         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14440                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14441         fi
14442         ol_enable_syslog=$ac_cv_func_openlog
14443 fi
14444
14445 ol_link_sql=no
14446 if test $ol_enable_sql != no ; then
14447         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14448 echo "configure:14449: checking for SQLDriverConnect in -liodbc" >&5
14449 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14450 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14451   echo $ac_n "(cached) $ac_c" 1>&6
14452 else
14453   ac_save_LIBS="$LIBS"
14454 LIBS="-liodbc  $LIBS"
14455 cat > conftest.$ac_ext <<EOF
14456 #line 14457 "configure"
14457 #include "confdefs.h"
14458 /* Override any gcc2 internal prototype to avoid an error.  */
14459 /* We use char because int might match the return type of a gcc2
14460     builtin and then its argument prototype would still apply.  */
14461 char SQLDriverConnect();
14462
14463 int main() {
14464 SQLDriverConnect()
14465 ; return 0; }
14466 EOF
14467 if { (eval echo configure:14468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14468   rm -rf conftest*
14469   eval "ac_cv_lib_$ac_lib_var=yes"
14470 else
14471   echo "configure: failed program was:" >&5
14472   cat conftest.$ac_ext >&5
14473   rm -rf conftest*
14474   eval "ac_cv_lib_$ac_lib_var=no"
14475 fi
14476 rm -f conftest*
14477 LIBS="$ac_save_LIBS"
14478
14479 fi
14480 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14481   echo "$ac_t""yes" 1>&6
14482   have_iodbc=yes
14483 else
14484   echo "$ac_t""no" 1>&6
14485 have_iodbc=no
14486 fi
14487
14488         if test $have_iodbc = yes ; then
14489                 ol_link_sql="-liodbc"
14490         else
14491                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14492 echo "configure:14493: checking for SQLDriverConnect in -lodbc" >&5
14493 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14494 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14495   echo $ac_n "(cached) $ac_c" 1>&6
14496 else
14497   ac_save_LIBS="$LIBS"
14498 LIBS="-lodbc  $LIBS"
14499 cat > conftest.$ac_ext <<EOF
14500 #line 14501 "configure"
14501 #include "confdefs.h"
14502 /* Override any gcc2 internal prototype to avoid an error.  */
14503 /* We use char because int might match the return type of a gcc2
14504     builtin and then its argument prototype would still apply.  */
14505 char SQLDriverConnect();
14506
14507 int main() {
14508 SQLDriverConnect()
14509 ; return 0; }
14510 EOF
14511 if { (eval echo configure:14512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14512   rm -rf conftest*
14513   eval "ac_cv_lib_$ac_lib_var=yes"
14514 else
14515   echo "configure: failed program was:" >&5
14516   cat conftest.$ac_ext >&5
14517   rm -rf conftest*
14518   eval "ac_cv_lib_$ac_lib_var=no"
14519 fi
14520 rm -f conftest*
14521 LIBS="$ac_save_LIBS"
14522
14523 fi
14524 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14525   echo "$ac_t""yes" 1>&6
14526   have_odbc=yes
14527 else
14528   echo "$ac_t""no" 1>&6
14529 have_odbc=no
14530 fi
14531
14532                 if test $have_odbc = yes ; then
14533                         ol_link_sql="-lodbc"
14534                 fi
14535         fi
14536
14537         if test $ol_link_sql != no ; then
14538                 SLAPD_SQL_LIBS="$ol_link_sql"
14539
14540         elif test $ol_enable_sql != auto ; then
14541                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14542         fi
14543 fi
14544
14545 ol_link_termcap=no
14546 for ac_hdr in termcap.h ncurses.h
14547 do
14548 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14549 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14550 echo "configure:14551: checking for $ac_hdr" >&5
14551 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14552   echo $ac_n "(cached) $ac_c" 1>&6
14553 else
14554   cat > conftest.$ac_ext <<EOF
14555 #line 14556 "configure"
14556 #include "confdefs.h"
14557 #include <$ac_hdr>
14558 EOF
14559 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14560 { (eval echo configure:14561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14561 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14562 if test -z "$ac_err"; then
14563   rm -rf conftest*
14564   eval "ac_cv_header_$ac_safe=yes"
14565 else
14566   echo "$ac_err" >&5
14567   echo "configure: failed program was:" >&5
14568   cat conftest.$ac_ext >&5
14569   rm -rf conftest*
14570   eval "ac_cv_header_$ac_safe=no"
14571 fi
14572 rm -f conftest*
14573 fi
14574 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14575   echo "$ac_t""yes" 1>&6
14576     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14577   cat >> confdefs.h <<EOF
14578 #define $ac_tr_hdr 1
14579 EOF
14580  
14581 else
14582   echo "$ac_t""no" 1>&6
14583 fi
14584 done
14585
14586
14587 if test $ol_link_termcap = no ; then
14588         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14589 echo "configure:14590: checking for tputs in -ltermcap" >&5
14590 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14591 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14592   echo $ac_n "(cached) $ac_c" 1>&6
14593 else
14594   ac_save_LIBS="$LIBS"
14595 LIBS="-ltermcap  $LIBS"
14596 cat > conftest.$ac_ext <<EOF
14597 #line 14598 "configure"
14598 #include "confdefs.h"
14599 /* Override any gcc2 internal prototype to avoid an error.  */
14600 /* We use char because int might match the return type of a gcc2
14601     builtin and then its argument prototype would still apply.  */
14602 char tputs();
14603
14604 int main() {
14605 tputs()
14606 ; return 0; }
14607 EOF
14608 if { (eval echo configure:14609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14609   rm -rf conftest*
14610   eval "ac_cv_lib_$ac_lib_var=yes"
14611 else
14612   echo "configure: failed program was:" >&5
14613   cat conftest.$ac_ext >&5
14614   rm -rf conftest*
14615   eval "ac_cv_lib_$ac_lib_var=no"
14616 fi
14617 rm -f conftest*
14618 LIBS="$ac_save_LIBS"
14619
14620 fi
14621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14622   echo "$ac_t""yes" 1>&6
14623   have_termcap=yes
14624 else
14625   echo "$ac_t""no" 1>&6
14626 have_termcap=no
14627 fi
14628
14629         if test $have_termcap = yes ; then
14630                 cat >> confdefs.h <<\EOF
14631 #define HAVE_TERMCAP 1
14632 EOF
14633
14634                 ol_link_termcap=yes
14635                 TERMCAP_LIBS=-ltermcap
14636         fi
14637 fi
14638
14639 if test $ol_link_termcap = no ; then
14640         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14641 echo "configure:14642: checking for initscr in -lncurses" >&5
14642 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14643 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14644   echo $ac_n "(cached) $ac_c" 1>&6
14645 else
14646   ac_save_LIBS="$LIBS"
14647 LIBS="-lncurses  $LIBS"
14648 cat > conftest.$ac_ext <<EOF
14649 #line 14650 "configure"
14650 #include "confdefs.h"
14651 /* Override any gcc2 internal prototype to avoid an error.  */
14652 /* We use char because int might match the return type of a gcc2
14653     builtin and then its argument prototype would still apply.  */
14654 char initscr();
14655
14656 int main() {
14657 initscr()
14658 ; return 0; }
14659 EOF
14660 if { (eval echo configure:14661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14661   rm -rf conftest*
14662   eval "ac_cv_lib_$ac_lib_var=yes"
14663 else
14664   echo "configure: failed program was:" >&5
14665   cat conftest.$ac_ext >&5
14666   rm -rf conftest*
14667   eval "ac_cv_lib_$ac_lib_var=no"
14668 fi
14669 rm -f conftest*
14670 LIBS="$ac_save_LIBS"
14671
14672 fi
14673 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14674   echo "$ac_t""yes" 1>&6
14675   have_ncurses=yes
14676 else
14677   echo "$ac_t""no" 1>&6
14678 have_ncurses=no
14679 fi
14680
14681         if test $have_ncurses = yes ; then
14682                 cat >> confdefs.h <<\EOF
14683 #define HAVE_NCURSES 1
14684 EOF
14685
14686                 ol_link_termcap=yes
14687                 TERMCAP_LIBS=-lncurses
14688         fi
14689 fi
14690
14691 if test $ol_link_termcap = no ; then
14692         cat >> confdefs.h <<\EOF
14693 #define NO_TERMCAP 1
14694 EOF
14695
14696         TERMCAP_LIBS=
14697 fi
14698
14699 ol_link_sasl=no
14700 ol_link_spasswd=no
14701 if test $ol_with_cyrus_sasl != no ; then
14702         for ac_hdr in sasl.h
14703 do
14704 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14705 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14706 echo "configure:14707: checking for $ac_hdr" >&5
14707 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14708   echo $ac_n "(cached) $ac_c" 1>&6
14709 else
14710   cat > conftest.$ac_ext <<EOF
14711 #line 14712 "configure"
14712 #include "confdefs.h"
14713 #include <$ac_hdr>
14714 EOF
14715 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14716 { (eval echo configure:14717: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14717 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14718 if test -z "$ac_err"; then
14719   rm -rf conftest*
14720   eval "ac_cv_header_$ac_safe=yes"
14721 else
14722   echo "$ac_err" >&5
14723   echo "configure: failed program was:" >&5
14724   cat conftest.$ac_ext >&5
14725   rm -rf conftest*
14726   eval "ac_cv_header_$ac_safe=no"
14727 fi
14728 rm -f conftest*
14729 fi
14730 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14731   echo "$ac_t""yes" 1>&6
14732     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14733   cat >> confdefs.h <<EOF
14734 #define $ac_tr_hdr 1
14735 EOF
14736  
14737 else
14738   echo "$ac_t""no" 1>&6
14739 fi
14740 done
14741
14742
14743         if test $ac_cv_header_sasl_h = yes ; then
14744                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14745 echo "configure:14746: checking for sasl_client_init in -lsasl" >&5
14746 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14747 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14748   echo $ac_n "(cached) $ac_c" 1>&6
14749 else
14750   ac_save_LIBS="$LIBS"
14751 LIBS="-lsasl  $LIBS"
14752 cat > conftest.$ac_ext <<EOF
14753 #line 14754 "configure"
14754 #include "confdefs.h"
14755 /* Override any gcc2 internal prototype to avoid an error.  */
14756 /* We use char because int might match the return type of a gcc2
14757     builtin and then its argument prototype would still apply.  */
14758 char sasl_client_init();
14759
14760 int main() {
14761 sasl_client_init()
14762 ; return 0; }
14763 EOF
14764 if { (eval echo configure:14765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14765   rm -rf conftest*
14766   eval "ac_cv_lib_$ac_lib_var=yes"
14767 else
14768   echo "configure: failed program was:" >&5
14769   cat conftest.$ac_ext >&5
14770   rm -rf conftest*
14771   eval "ac_cv_lib_$ac_lib_var=no"
14772 fi
14773 rm -f conftest*
14774 LIBS="$ac_save_LIBS"
14775
14776 fi
14777 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14778   echo "$ac_t""yes" 1>&6
14779   have_cyrus_sasl=yes
14780 else
14781   echo "$ac_t""no" 1>&6
14782 have_cyrus_sasl=no
14783 fi
14784
14785
14786                 if test $have_cyrus_sasl != no ; then
14787                         SASL_LIBS="-lsasl"
14788                         cat >> confdefs.h <<\EOF
14789 #define HAVE_CYRUS_SASL 1
14790 EOF
14791
14792                         echo $ac_n "checking Cyrus SASL library version""... $ac_c" 1>&6
14793 echo "configure:14794: checking Cyrus SASL library version" >&5
14794 if eval "test \"\${ol_cv_sasl_compat+set}\" = set"; then
14795   echo $ac_n "(cached) $ac_c" 1>&6
14796 else
14797   
14798         cat > conftest.$ac_ext <<EOF
14799 #line 14800 "configure"
14800 #include "confdefs.h"
14801
14802 #ifdef HAVE_SASL_SASL_H
14803 #include <sasl/sasl.h>
14804 #else
14805 #include <sasl.h>
14806 #endif
14807
14808 /* require 1.5.x, unable to use 2.x */
14809 #if SASL_VERSION_MAJOR == 1  && SASL_VERSION_MINOR >= 5
14810         char *__sasl_compat = "1.5.x okay";
14811 #endif
14812         
14813 EOF
14814 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14815   egrep "__sasl_compat" >/dev/null 2>&1; then
14816   rm -rf conftest*
14817   ol_cv_sasl_compat=yes
14818 else
14819   rm -rf conftest*
14820   ol_cv_sasl_compat=no
14821 fi
14822 rm -f conftest*
14823
14824 fi
14825
14826 echo "$ac_t""$ol_cv_sasl_compat" 1>&6
14827
14828                         if test $ol_cv_sasl_compat = no ; then
14829                                 ol_link_sasl=no
14830                                 { echo "configure: error: Cyrus SASL library located but incompatible" 1>&2; exit 1; }
14831                         fi
14832                         ol_link_sasl=yes
14833                 fi
14834         fi
14835
14836         if test $ol_link_sasl = no ; then
14837                 if test $ol_with_cyrus_sasl != auto ; then
14838                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14839                 else
14840                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14841                         echo "configure: warning: SASL authentication not supported!" 1>&2
14842                         if test $ol_link_tls = no ; then
14843                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14844                         fi
14845                 fi
14846
14847         elif test $ol_enable_spasswd != no ; then
14848                 ol_link_spasswd=yes
14849         fi
14850
14851 else
14852         echo "configure: warning: SASL authentication not supported!" 1>&2
14853         if test $ol_link_tls = no ; then
14854                 echo "configure: warning: Strong authentication not supported!" 1>&2
14855         fi
14856 fi
14857
14858 if test $cross_compiling != yes ; then
14859         dev=no
14860         if test -r /dev/urandom ; then
14861                 dev="/dev/urandom";
14862         elif test -r /idev/urandom ; then
14863                 dev="/idev/urandom";
14864         elif test -r /dev/srandom ; then
14865                 dev="/dev/srandom";
14866         elif test -r /dev/random ; then
14867                 dev="/dev/random";
14868         elif test -r /idev/random ; then
14869                 dev="/idev/random";
14870         fi
14871
14872         if test $dev != no ; then
14873                 cat >> confdefs.h <<EOF
14874 #define URANDOM_DEVICE "$dev"
14875 EOF
14876
14877         fi
14878 fi
14879
14880 ol_link_fetch=no
14881 if test $ol_with_fetch != no ; then
14882         ol_LIBS=$LIBS
14883 LIBS="-lfetch -lcom_err $LIBS"
14884 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14885 echo "configure:14886: checking fetch(3) library" >&5
14886 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14887   echo $ac_n "(cached) $ac_c" 1>&6
14888 else
14889   
14890         cat > conftest.$ac_ext <<EOF
14891 #line 14892 "configure"
14892 #include "confdefs.h"
14893
14894 #include <sys/param.h>
14895 #include <stdio.h>
14896 #include <fetch.h>
14897 int main() {
14898 struct url *u = fetchParseURL("file:///"); 
14899 ; return 0; }
14900 EOF
14901 if { (eval echo configure:14902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14902   rm -rf conftest*
14903   ol_cv_lib_fetch=yes
14904 else
14905   echo "configure: failed program was:" >&5
14906   cat conftest.$ac_ext >&5
14907   rm -rf conftest*
14908   ol_cv_lib_fetch=no
14909 fi
14910 rm -f conftest*
14911 fi
14912
14913 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14914 LIBS=$ol_LIBS
14915 if test $ol_cv_lib_fetch != no ; then
14916         ol_link_fetch="-lfetch -lcom_err"
14917         cat >> confdefs.h <<\EOF
14918 #define HAVE_FETCH 1
14919 EOF
14920
14921 fi
14922
14923
14924         if test $ol_cv_lib_fetch != no ; then
14925                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14926                 ol_link_fetch=freebsd
14927
14928         elif test $ol_with_fetch != auto ; then
14929                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14930         fi 
14931 fi
14932
14933 ol_link_readline=no
14934 if test $ol_with_readline != no ; then
14935         for ac_hdr in readline/readline.h readline/history.h
14936 do
14937 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14938 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14939 echo "configure:14940: checking for $ac_hdr" >&5
14940 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14941   echo $ac_n "(cached) $ac_c" 1>&6
14942 else
14943   cat > conftest.$ac_ext <<EOF
14944 #line 14945 "configure"
14945 #include "confdefs.h"
14946 #include <$ac_hdr>
14947 EOF
14948 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14949 { (eval echo configure:14950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14950 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14951 if test -z "$ac_err"; then
14952   rm -rf conftest*
14953   eval "ac_cv_header_$ac_safe=yes"
14954 else
14955   echo "$ac_err" >&5
14956   echo "configure: failed program was:" >&5
14957   cat conftest.$ac_ext >&5
14958   rm -rf conftest*
14959   eval "ac_cv_header_$ac_safe=no"
14960 fi
14961 rm -f conftest*
14962 fi
14963 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14964   echo "$ac_t""yes" 1>&6
14965     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14966   cat >> confdefs.h <<EOF
14967 #define $ac_tr_hdr 1
14968 EOF
14969  
14970 else
14971   echo "$ac_t""no" 1>&6
14972 fi
14973 done
14974
14975
14976         if test $ac_cv_header_readline_readline_h = yes ; then
14977                 save_LIBS="$LIBS"
14978                 LIBS="$TERMCAP_LIBS $LIBS"
14979                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14980 echo "configure:14981: checking for readline in -lreadline" >&5
14981 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14982 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14983   echo $ac_n "(cached) $ac_c" 1>&6
14984 else
14985   ac_save_LIBS="$LIBS"
14986 LIBS="-lreadline  $LIBS"
14987 cat > conftest.$ac_ext <<EOF
14988 #line 14989 "configure"
14989 #include "confdefs.h"
14990 /* Override any gcc2 internal prototype to avoid an error.  */
14991 /* We use char because int might match the return type of a gcc2
14992     builtin and then its argument prototype would still apply.  */
14993 char readline();
14994
14995 int main() {
14996 readline()
14997 ; return 0; }
14998 EOF
14999 if { (eval echo configure:15000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15000   rm -rf conftest*
15001   eval "ac_cv_lib_$ac_lib_var=yes"
15002 else
15003   echo "configure: failed program was:" >&5
15004   cat conftest.$ac_ext >&5
15005   rm -rf conftest*
15006   eval "ac_cv_lib_$ac_lib_var=no"
15007 fi
15008 rm -f conftest*
15009 LIBS="$ac_save_LIBS"
15010
15011 fi
15012 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15013   echo "$ac_t""yes" 1>&6
15014   have_readline=yes
15015 else
15016   echo "$ac_t""no" 1>&6
15017 have_readline=no
15018 fi
15019
15020                 LIBS="$save_LIBS"
15021                         
15022                 if test $have_readline = yes ; then
15023                         ol_with_readline=found
15024                         ol_link_readline=yes
15025
15026                         READLINE_LIBS="-lreadline"
15027                 fi
15028         fi
15029 fi
15030
15031 if test $ol_link_readline = yes ; then
15032         cat >> confdefs.h <<\EOF
15033 #define HAVE_READLINE 1
15034 EOF
15035
15036 fi
15037
15038
15039 if test $ol_enable_crypt != no ; then
15040         echo $ac_n "checking for crypt""... $ac_c" 1>&6
15041 echo "configure:15042: checking for crypt" >&5
15042 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
15043   echo $ac_n "(cached) $ac_c" 1>&6
15044 else
15045   cat > conftest.$ac_ext <<EOF
15046 #line 15047 "configure"
15047 #include "confdefs.h"
15048 /* System header to define __stub macros and hopefully few prototypes,
15049     which can conflict with char crypt(); below.  */
15050 #include <assert.h>
15051 /* Override any gcc2 internal prototype to avoid an error.  */
15052 /* We use char because int might match the return type of a gcc2
15053     builtin and then its argument prototype would still apply.  */
15054 char crypt();
15055 char (*f)();
15056
15057 int main() {
15058
15059 /* The GNU C library defines this for functions which it implements
15060     to always fail with ENOSYS.  Some functions are actually named
15061     something starting with __ and the normal name is an alias.  */
15062 #if defined (__stub_crypt) || defined (__stub___crypt)
15063 choke me
15064 #else
15065 f = crypt;
15066 #endif
15067
15068 ; return 0; }
15069 EOF
15070 if { (eval echo configure:15071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15071   rm -rf conftest*
15072   eval "ac_cv_func_crypt=yes"
15073 else
15074   echo "configure: failed program was:" >&5
15075   cat conftest.$ac_ext >&5
15076   rm -rf conftest*
15077   eval "ac_cv_func_crypt=no"
15078 fi
15079 rm -f conftest*
15080 fi
15081
15082 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
15083   echo "$ac_t""yes" 1>&6
15084   have_crypt=yes
15085 else
15086   echo "$ac_t""no" 1>&6
15087
15088                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
15089 echo "configure:15090: checking for crypt in -lcrypt" >&5
15090 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
15091 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15092   echo $ac_n "(cached) $ac_c" 1>&6
15093 else
15094   ac_save_LIBS="$LIBS"
15095 LIBS="-lcrypt  $LIBS"
15096 cat > conftest.$ac_ext <<EOF
15097 #line 15098 "configure"
15098 #include "confdefs.h"
15099 /* Override any gcc2 internal prototype to avoid an error.  */
15100 /* We use char because int might match the return type of a gcc2
15101     builtin and then its argument prototype would still apply.  */
15102 char crypt();
15103
15104 int main() {
15105 crypt()
15106 ; return 0; }
15107 EOF
15108 if { (eval echo configure:15109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15109   rm -rf conftest*
15110   eval "ac_cv_lib_$ac_lib_var=yes"
15111 else
15112   echo "configure: failed program was:" >&5
15113   cat conftest.$ac_ext >&5
15114   rm -rf conftest*
15115   eval "ac_cv_lib_$ac_lib_var=no"
15116 fi
15117 rm -f conftest*
15118 LIBS="$ac_save_LIBS"
15119
15120 fi
15121 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15122   echo "$ac_t""yes" 1>&6
15123   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
15124                         have_crypt=yes
15125 else
15126   echo "$ac_t""no" 1>&6
15127 have_crypt=no
15128 fi
15129
15130 fi
15131
15132
15133         if test $have_crypt = yes ; then
15134                 cat >> confdefs.h <<\EOF
15135 #define HAVE_CRYPT 1
15136 EOF
15137
15138         else
15139                 echo "configure: warning: could not find crypt" 1>&2
15140                 if test $ol_enable_crypt = yes ; then
15141                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
15142                 fi
15143
15144                 echo "configure: warning: disabling crypt support" 1>&2
15145                 ol_enable_crypt=no
15146         fi
15147 fi
15148
15149 if test $ol_enable_proctitle != no ; then
15150         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
15151 echo "configure:15152: checking for setproctitle" >&5
15152 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
15153   echo $ac_n "(cached) $ac_c" 1>&6
15154 else
15155   cat > conftest.$ac_ext <<EOF
15156 #line 15157 "configure"
15157 #include "confdefs.h"
15158 /* System header to define __stub macros and hopefully few prototypes,
15159     which can conflict with char setproctitle(); below.  */
15160 #include <assert.h>
15161 /* Override any gcc2 internal prototype to avoid an error.  */
15162 /* We use char because int might match the return type of a gcc2
15163     builtin and then its argument prototype would still apply.  */
15164 char setproctitle();
15165 char (*f)();
15166
15167 int main() {
15168
15169 /* The GNU C library defines this for functions which it implements
15170     to always fail with ENOSYS.  Some functions are actually named
15171     something starting with __ and the normal name is an alias.  */
15172 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
15173 choke me
15174 #else
15175 f = setproctitle;
15176 #endif
15177
15178 ; return 0; }
15179 EOF
15180 if { (eval echo configure:15181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15181   rm -rf conftest*
15182   eval "ac_cv_func_setproctitle=yes"
15183 else
15184   echo "configure: failed program was:" >&5
15185   cat conftest.$ac_ext >&5
15186   rm -rf conftest*
15187   eval "ac_cv_func_setproctitle=no"
15188 fi
15189 rm -f conftest*
15190 fi
15191
15192 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
15193   echo "$ac_t""yes" 1>&6
15194   have_setproctitle=yes
15195 else
15196   echo "$ac_t""no" 1>&6
15197
15198                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
15199 echo "configure:15200: checking for setproctitle in -lutil" >&5
15200 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
15201 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15202   echo $ac_n "(cached) $ac_c" 1>&6
15203 else
15204   ac_save_LIBS="$LIBS"
15205 LIBS="-lutil  $LIBS"
15206 cat > conftest.$ac_ext <<EOF
15207 #line 15208 "configure"
15208 #include "confdefs.h"
15209 /* Override any gcc2 internal prototype to avoid an error.  */
15210 /* We use char because int might match the return type of a gcc2
15211     builtin and then its argument prototype would still apply.  */
15212 char setproctitle();
15213
15214 int main() {
15215 setproctitle()
15216 ; return 0; }
15217 EOF
15218 if { (eval echo configure:15219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15219   rm -rf conftest*
15220   eval "ac_cv_lib_$ac_lib_var=yes"
15221 else
15222   echo "configure: failed program was:" >&5
15223   cat conftest.$ac_ext >&5
15224   rm -rf conftest*
15225   eval "ac_cv_lib_$ac_lib_var=no"
15226 fi
15227 rm -f conftest*
15228 LIBS="$ac_save_LIBS"
15229
15230 fi
15231 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15232   echo "$ac_t""yes" 1>&6
15233   have_setproctitle=yes
15234                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
15235 else
15236   echo "$ac_t""no" 1>&6
15237 have_setproctitle=no
15238                         LIBOBJS="$LIBOBJS setproctitle.o"
15239                         LIBSRCS="$LIBSRCS setproctitle.c"
15240 fi
15241
15242 fi
15243
15244
15245         if test $have_setproctitle = yes ; then
15246                 cat >> confdefs.h <<\EOF
15247 #define HAVE_SETPROCTITLE 1
15248 EOF
15249
15250         fi
15251 fi
15252
15253 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15254 echo "configure:15255: checking for ANSI C header files" >&5
15255 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15256   echo $ac_n "(cached) $ac_c" 1>&6
15257 else
15258   cat > conftest.$ac_ext <<EOF
15259 #line 15260 "configure"
15260 #include "confdefs.h"
15261 #include <stdlib.h>
15262 #include <stdarg.h>
15263 #include <string.h>
15264 #include <float.h>
15265 EOF
15266 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15267 { (eval echo configure:15268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15268 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15269 if test -z "$ac_err"; then
15270   rm -rf conftest*
15271   ac_cv_header_stdc=yes
15272 else
15273   echo "$ac_err" >&5
15274   echo "configure: failed program was:" >&5
15275   cat conftest.$ac_ext >&5
15276   rm -rf conftest*
15277   ac_cv_header_stdc=no
15278 fi
15279 rm -f conftest*
15280
15281 if test $ac_cv_header_stdc = yes; then
15282   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15283 cat > conftest.$ac_ext <<EOF
15284 #line 15285 "configure"
15285 #include "confdefs.h"
15286 #include <string.h>
15287 EOF
15288 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15289   egrep "memchr" >/dev/null 2>&1; then
15290   :
15291 else
15292   rm -rf conftest*
15293   ac_cv_header_stdc=no
15294 fi
15295 rm -f conftest*
15296
15297 fi
15298
15299 if test $ac_cv_header_stdc = yes; then
15300   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15301 cat > conftest.$ac_ext <<EOF
15302 #line 15303 "configure"
15303 #include "confdefs.h"
15304 #include <stdlib.h>
15305 EOF
15306 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15307   egrep "free" >/dev/null 2>&1; then
15308   :
15309 else
15310   rm -rf conftest*
15311   ac_cv_header_stdc=no
15312 fi
15313 rm -f conftest*
15314
15315 fi
15316
15317 if test $ac_cv_header_stdc = yes; then
15318   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15319 if test "$cross_compiling" = yes; then
15320   :
15321 else
15322   cat > conftest.$ac_ext <<EOF
15323 #line 15324 "configure"
15324 #include "confdefs.h"
15325 #include <ctype.h>
15326 #if ((' ' & 0x0FF) == 0x020)
15327 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15328 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15329 #else
15330 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15331  || ('j' <= (c) && (c) <= 'r') \
15332  || ('s' <= (c) && (c) <= 'z'))
15333 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15334 #endif
15335 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15336 int main () { int i; for (i = 0; i < 256; i++)
15337 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15338 exit (0); }
15339
15340 EOF
15341 if { (eval echo configure:15342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15342 then
15343   :
15344 else
15345   echo "configure: failed program was:" >&5
15346   cat conftest.$ac_ext >&5
15347   rm -fr conftest*
15348   ac_cv_header_stdc=no
15349 fi
15350 rm -fr conftest*
15351 fi
15352
15353 fi
15354 fi
15355
15356 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15357 if test $ac_cv_header_stdc = yes; then
15358   cat >> confdefs.h <<\EOF
15359 #define STDC_HEADERS 1
15360 EOF
15361
15362 fi
15363
15364 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15365 echo "configure:15366: checking for mode_t" >&5
15366 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15367   echo $ac_n "(cached) $ac_c" 1>&6
15368 else
15369   cat > conftest.$ac_ext <<EOF
15370 #line 15371 "configure"
15371 #include "confdefs.h"
15372 #include <sys/types.h>
15373 #if STDC_HEADERS
15374 #include <stdlib.h>
15375 #include <stddef.h>
15376 #endif
15377
15378 EOF
15379 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15380   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15381   rm -rf conftest*
15382   eval "ac_cv_type_mode_t=yes"
15383 else
15384   rm -rf conftest*
15385   eval "ac_cv_type_mode_t=no"
15386 fi
15387 rm -f conftest*
15388
15389 fi
15390 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15391   echo "$ac_t""yes" 1>&6
15392 else
15393   echo "$ac_t""no" 1>&6
15394   cat >> confdefs.h <<EOF
15395 #define mode_t int
15396 EOF
15397
15398 fi
15399
15400 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15401 echo "configure:15402: checking for off_t" >&5
15402 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15403   echo $ac_n "(cached) $ac_c" 1>&6
15404 else
15405   cat > conftest.$ac_ext <<EOF
15406 #line 15407 "configure"
15407 #include "confdefs.h"
15408 #include <sys/types.h>
15409 #if STDC_HEADERS
15410 #include <stdlib.h>
15411 #include <stddef.h>
15412 #endif
15413
15414 EOF
15415 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15416   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15417   rm -rf conftest*
15418   eval "ac_cv_type_off_t=yes"
15419 else
15420   rm -rf conftest*
15421   eval "ac_cv_type_off_t=no"
15422 fi
15423 rm -f conftest*
15424
15425 fi
15426 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15427   echo "$ac_t""yes" 1>&6
15428 else
15429   echo "$ac_t""no" 1>&6
15430   cat >> confdefs.h <<EOF
15431 #define off_t long
15432 EOF
15433
15434 fi
15435
15436 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15437 echo "configure:15438: checking for pid_t" >&5
15438 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15439   echo $ac_n "(cached) $ac_c" 1>&6
15440 else
15441   cat > conftest.$ac_ext <<EOF
15442 #line 15443 "configure"
15443 #include "confdefs.h"
15444 #include <sys/types.h>
15445 #if STDC_HEADERS
15446 #include <stdlib.h>
15447 #include <stddef.h>
15448 #endif
15449
15450 EOF
15451 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15452   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15453   rm -rf conftest*
15454   eval "ac_cv_type_pid_t=yes"
15455 else
15456   rm -rf conftest*
15457   eval "ac_cv_type_pid_t=no"
15458 fi
15459 rm -f conftest*
15460
15461 fi
15462 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15463   echo "$ac_t""yes" 1>&6
15464 else
15465   echo "$ac_t""no" 1>&6
15466   cat >> confdefs.h <<EOF
15467 #define pid_t int
15468 EOF
15469
15470 fi
15471
15472 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15473 echo "configure:15474: checking for ptrdiff_t" >&5
15474 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15475   echo $ac_n "(cached) $ac_c" 1>&6
15476 else
15477   cat > conftest.$ac_ext <<EOF
15478 #line 15479 "configure"
15479 #include "confdefs.h"
15480 #include <stddef.h>
15481 int main() {
15482 ptrdiff_t p
15483 ; return 0; }
15484 EOF
15485 if { (eval echo configure:15486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15486   rm -rf conftest*
15487   am_cv_type_ptrdiff_t=yes
15488 else
15489   echo "configure: failed program was:" >&5
15490   cat conftest.$ac_ext >&5
15491   rm -rf conftest*
15492   am_cv_type_ptrdiff_t=no
15493 fi
15494 rm -f conftest*
15495 fi
15496
15497 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15498    if test $am_cv_type_ptrdiff_t = yes; then
15499      cat >> confdefs.h <<\EOF
15500 #define HAVE_PTRDIFF_T 1
15501 EOF
15502
15503    fi
15504
15505 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15506 echo "configure:15507: checking return type of signal handlers" >&5
15507 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15508   echo $ac_n "(cached) $ac_c" 1>&6
15509 else
15510   cat > conftest.$ac_ext <<EOF
15511 #line 15512 "configure"
15512 #include "confdefs.h"
15513 #include <sys/types.h>
15514 #include <signal.h>
15515 #ifdef signal
15516 #undef signal
15517 #endif
15518 #ifdef __cplusplus
15519 extern "C" void (*signal (int, void (*)(int)))(int);
15520 #else
15521 void (*signal ()) ();
15522 #endif
15523
15524 int main() {
15525 int i;
15526 ; return 0; }
15527 EOF
15528 if { (eval echo configure:15529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15529   rm -rf conftest*
15530   ac_cv_type_signal=void
15531 else
15532   echo "configure: failed program was:" >&5
15533   cat conftest.$ac_ext >&5
15534   rm -rf conftest*
15535   ac_cv_type_signal=int
15536 fi
15537 rm -f conftest*
15538 fi
15539
15540 echo "$ac_t""$ac_cv_type_signal" 1>&6
15541 cat >> confdefs.h <<EOF
15542 #define RETSIGTYPE $ac_cv_type_signal
15543 EOF
15544
15545
15546 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15547 echo "configure:15548: checking for size_t" >&5
15548 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15549   echo $ac_n "(cached) $ac_c" 1>&6
15550 else
15551   cat > conftest.$ac_ext <<EOF
15552 #line 15553 "configure"
15553 #include "confdefs.h"
15554 #include <sys/types.h>
15555 #if STDC_HEADERS
15556 #include <stdlib.h>
15557 #include <stddef.h>
15558 #endif
15559
15560 EOF
15561 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15562   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15563   rm -rf conftest*
15564   eval "ac_cv_type_size_t=yes"
15565 else
15566   rm -rf conftest*
15567   eval "ac_cv_type_size_t=no"
15568 fi
15569 rm -f conftest*
15570
15571 fi
15572 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15573   echo "$ac_t""yes" 1>&6
15574 else
15575   echo "$ac_t""no" 1>&6
15576   cat >> confdefs.h <<EOF
15577 #define size_t unsigned
15578 EOF
15579
15580 fi
15581
15582
15583 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15584 echo "configure:15585: checking for ssize_t" >&5
15585 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15586   echo $ac_n "(cached) $ac_c" 1>&6
15587 else
15588   cat > conftest.$ac_ext <<EOF
15589 #line 15590 "configure"
15590 #include "confdefs.h"
15591 #include <sys/types.h>
15592 #if STDC_HEADERS
15593 #include <stdlib.h>
15594 #include <stddef.h>
15595 #endif
15596
15597 EOF
15598 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15599   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15600   rm -rf conftest*
15601   eval "ac_cv_type_ssize_t=yes"
15602 else
15603   rm -rf conftest*
15604   eval "ac_cv_type_ssize_t=no"
15605 fi
15606 rm -f conftest*
15607
15608 fi
15609 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15610   echo "$ac_t""yes" 1>&6
15611 else
15612   echo "$ac_t""no" 1>&6
15613   cat >> confdefs.h <<EOF
15614 #define ssize_t signed int
15615 EOF
15616
15617 fi
15618
15619 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15620 echo "configure:15621: checking for caddr_t" >&5
15621 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15622   echo $ac_n "(cached) $ac_c" 1>&6
15623 else
15624   cat > conftest.$ac_ext <<EOF
15625 #line 15626 "configure"
15626 #include "confdefs.h"
15627 #include <sys/types.h>
15628 #if STDC_HEADERS
15629 #include <stdlib.h>
15630 #include <stddef.h>
15631 #endif
15632
15633 EOF
15634 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15635   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15636   rm -rf conftest*
15637   eval "ac_cv_type_caddr_t=yes"
15638 else
15639   rm -rf conftest*
15640   eval "ac_cv_type_caddr_t=no"
15641 fi
15642 rm -f conftest*
15643
15644 fi
15645 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15646   echo "$ac_t""yes" 1>&6
15647 else
15648   echo "$ac_t""no" 1>&6
15649   cat >> confdefs.h <<EOF
15650 #define caddr_t char *
15651 EOF
15652
15653 fi
15654
15655
15656 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15657 echo "configure:15658: checking for socklen_t" >&5
15658 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15659   echo $ac_n "(cached) $ac_c" 1>&6
15660 else
15661   cat > conftest.$ac_ext <<EOF
15662 #line 15663 "configure"
15663 #include "confdefs.h"
15664
15665 #ifdef HAVE_SYS_TYPES_H
15666 #include <sys/types.h>
15667 #endif
15668 #ifdef HAVE_SYS_SOCKET_H
15669 #include <sys/socket.h>
15670 #endif
15671
15672 int main() {
15673 socklen_t len;
15674 ; return 0; }
15675 EOF
15676 if { (eval echo configure:15677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15677   rm -rf conftest*
15678   ol_cv_type_socklen_t=yes
15679 else
15680   echo "configure: failed program was:" >&5
15681   cat conftest.$ac_ext >&5
15682   rm -rf conftest*
15683   ol_cv_type_socklen_t=no
15684 fi
15685 rm -f conftest*
15686 fi
15687
15688 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15689   if test $ol_cv_type_socklen_t = no; then
15690     cat >> confdefs.h <<\EOF
15691 #define socklen_t int
15692 EOF
15693
15694   fi
15695  
15696 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15697 echo "configure:15698: checking for member st_blksize in aggregate type struct stat" >&5
15698 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15699   echo $ac_n "(cached) $ac_c" 1>&6
15700 else
15701   cat > conftest.$ac_ext <<EOF
15702 #line 15703 "configure"
15703 #include "confdefs.h"
15704 #include <sys/types.h>
15705 #include <sys/stat.h>
15706 int main() {
15707 struct stat foo; foo.st_blksize;
15708 ; return 0; }
15709 EOF
15710 if { (eval echo configure:15711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15711   rm -rf conftest*
15712   ac_cv_c_struct_member_st_blksize=yes
15713 else
15714   echo "configure: failed program was:" >&5
15715   cat conftest.$ac_ext >&5
15716   rm -rf conftest*
15717   ac_cv_c_struct_member_st_blksize=no
15718 fi
15719 rm -f conftest*
15720 fi
15721
15722 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15723 st_blksize="$ac_cv_c_struct_member_st_blksize"
15724 if test $ac_cv_c_struct_member_st_blksize = yes; then
15725   cat >> confdefs.h <<\EOF
15726 #define HAVE_ST_BLKSIZE 1
15727 EOF
15728
15729 fi
15730
15731 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15732 echo "configure:15733: checking whether time.h and sys/time.h may both be included" >&5
15733 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15734   echo $ac_n "(cached) $ac_c" 1>&6
15735 else
15736   cat > conftest.$ac_ext <<EOF
15737 #line 15738 "configure"
15738 #include "confdefs.h"
15739 #include <sys/types.h>
15740 #include <sys/time.h>
15741 #include <time.h>
15742 int main() {
15743 struct tm *tp;
15744 ; return 0; }
15745 EOF
15746 if { (eval echo configure:15747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15747   rm -rf conftest*
15748   ac_cv_header_time=yes
15749 else
15750   echo "configure: failed program was:" >&5
15751   cat conftest.$ac_ext >&5
15752   rm -rf conftest*
15753   ac_cv_header_time=no
15754 fi
15755 rm -f conftest*
15756 fi
15757
15758 echo "$ac_t""$ac_cv_header_time" 1>&6
15759 if test $ac_cv_header_time = yes; then
15760   cat >> confdefs.h <<\EOF
15761 #define TIME_WITH_SYS_TIME 1
15762 EOF
15763
15764 fi
15765
15766 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15767 echo "configure:15768: checking whether struct tm is in sys/time.h or time.h" >&5
15768 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15769   echo $ac_n "(cached) $ac_c" 1>&6
15770 else
15771   cat > conftest.$ac_ext <<EOF
15772 #line 15773 "configure"
15773 #include "confdefs.h"
15774 #include <sys/types.h>
15775 #include <time.h>
15776 int main() {
15777 struct tm *tp; tp->tm_sec;
15778 ; return 0; }
15779 EOF
15780 if { (eval echo configure:15781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15781   rm -rf conftest*
15782   ac_cv_struct_tm=time.h
15783 else
15784   echo "configure: failed program was:" >&5
15785   cat conftest.$ac_ext >&5
15786   rm -rf conftest*
15787   ac_cv_struct_tm=sys/time.h
15788 fi
15789 rm -f conftest*
15790 fi
15791
15792 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15793 if test $ac_cv_struct_tm = sys/time.h; then
15794   cat >> confdefs.h <<\EOF
15795 #define TM_IN_SYS_TIME 1
15796 EOF
15797
15798 fi
15799
15800 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15801 echo "configure:15802: checking for uid_t in sys/types.h" >&5
15802 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15803   echo $ac_n "(cached) $ac_c" 1>&6
15804 else
15805   cat > conftest.$ac_ext <<EOF
15806 #line 15807 "configure"
15807 #include "confdefs.h"
15808 #include <sys/types.h>
15809 EOF
15810 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15811   egrep "uid_t" >/dev/null 2>&1; then
15812   rm -rf conftest*
15813   ac_cv_type_uid_t=yes
15814 else
15815   rm -rf conftest*
15816   ac_cv_type_uid_t=no
15817 fi
15818 rm -f conftest*
15819
15820 fi
15821
15822 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15823 if test $ac_cv_type_uid_t = no; then
15824   cat >> confdefs.h <<\EOF
15825 #define uid_t int
15826 EOF
15827
15828   cat >> confdefs.h <<\EOF
15829 #define gid_t int
15830 EOF
15831
15832 fi
15833
15834 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15835 echo "configure:15836: checking for sig_atomic_t" >&5
15836 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15837   echo $ac_n "(cached) $ac_c" 1>&6
15838 else
15839   cat > conftest.$ac_ext <<EOF
15840 #line 15841 "configure"
15841 #include "confdefs.h"
15842 #include <signal.h>
15843 int main() {
15844 sig_atomic_t atomic;
15845 ; return 0; }
15846 EOF
15847 if { (eval echo configure:15848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15848   rm -rf conftest*
15849   ol_cv_type_sig_atomic_t=yes
15850 else
15851   echo "configure: failed program was:" >&5
15852   cat conftest.$ac_ext >&5
15853   rm -rf conftest*
15854   ol_cv_type_sig_atomic_t=no
15855 fi
15856 rm -f conftest*
15857 fi
15858
15859 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15860   if test $ol_cv_type_sig_atomic_t = no; then
15861     cat >> confdefs.h <<\EOF
15862 #define sig_atomic_t int
15863 EOF
15864
15865   fi
15866  
15867
15868
15869 # test for pw_gecos in struct passwd
15870 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15871 echo "configure:15872: checking struct passwd for pw_gecos" >&5
15872 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15873   echo $ac_n "(cached) $ac_c" 1>&6
15874 else
15875   
15876         cat > conftest.$ac_ext <<EOF
15877 #line 15878 "configure"
15878 #include "confdefs.h"
15879 #include <pwd.h>
15880 int main() {
15881
15882         struct passwd pwd;
15883         pwd.pw_gecos = pwd.pw_name;
15884
15885 ; return 0; }
15886 EOF
15887 if { (eval echo configure:15888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15888   rm -rf conftest*
15889   ol_cv_struct_passwd_pw_gecos=yes
15890 else
15891   echo "configure: failed program was:" >&5
15892   cat conftest.$ac_ext >&5
15893   rm -rf conftest*
15894   ol_cv_struct_passwd_pw_gecos=no
15895 fi
15896 rm -f conftest*
15897 fi
15898
15899 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15900 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15901         cat >> confdefs.h <<\EOF
15902 #define HAVE_PW_GECOS 1
15903 EOF
15904
15905 fi
15906
15907 # test for pw_passwd in struct passwd
15908 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15909 echo "configure:15910: checking struct passwd for pw_passwd" >&5
15910 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15911   echo $ac_n "(cached) $ac_c" 1>&6
15912 else
15913   
15914         cat > conftest.$ac_ext <<EOF
15915 #line 15916 "configure"
15916 #include "confdefs.h"
15917 #include <pwd.h>
15918 int main() {
15919
15920         struct passwd pwd;
15921         pwd.pw_passwd = pwd.pw_name;
15922
15923 ; return 0; }
15924 EOF
15925 if { (eval echo configure:15926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15926   rm -rf conftest*
15927   ol_cv_struct_passwd_pw_passwd=yes
15928 else
15929   echo "configure: failed program was:" >&5
15930   cat conftest.$ac_ext >&5
15931   rm -rf conftest*
15932   ol_cv_struct_passwd_pw_passwd=no
15933 fi
15934 rm -f conftest*
15935 fi
15936
15937 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15938 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15939         cat >> confdefs.h <<\EOF
15940 #define HAVE_PW_PASSWD 1
15941 EOF
15942
15943 fi
15944
15945
15946 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15947 echo "configure:15948: checking if toupper() requires islower()" >&5
15948 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15949   echo $ac_n "(cached) $ac_c" 1>&6
15950 else
15951   
15952         if test "$cross_compiling" = yes; then
15953   ol_cv_c_upper_lower=safe
15954 else
15955   cat > conftest.$ac_ext <<EOF
15956 #line 15957 "configure"
15957 #include "confdefs.h"
15958
15959 #include <ctype.h>
15960 main()
15961 {
15962         if ('C' == toupper('C'))
15963                 exit(0);
15964         else
15965                 exit(1);
15966 }
15967 EOF
15968 if { (eval echo configure:15969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15969 then
15970   ol_cv_c_upper_lower=no
15971 else
15972   echo "configure: failed program was:" >&5
15973   cat conftest.$ac_ext >&5
15974   rm -fr conftest*
15975   ol_cv_c_upper_lower=yes
15976 fi
15977 rm -fr conftest*
15978 fi
15979
15980 fi
15981
15982 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15983 if test $ol_cv_c_upper_lower != no ; then
15984         cat >> confdefs.h <<\EOF
15985 #define C_UPPER_LOWER 1
15986 EOF
15987
15988 fi
15989
15990 echo $ac_n "checking for working const""... $ac_c" 1>&6
15991 echo "configure:15992: checking for working const" >&5
15992 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15993   echo $ac_n "(cached) $ac_c" 1>&6
15994 else
15995   cat > conftest.$ac_ext <<EOF
15996 #line 15997 "configure"
15997 #include "confdefs.h"
15998
15999 int main() {
16000
16001 /* Ultrix mips cc rejects this.  */
16002 typedef int charset[2]; const charset x;
16003 /* SunOS 4.1.1 cc rejects this.  */
16004 char const *const *ccp;
16005 char **p;
16006 /* NEC SVR4.0.2 mips cc rejects this.  */
16007 struct point {int x, y;};
16008 static struct point const zero = {0,0};
16009 /* AIX XL C 1.02.0.0 rejects this.
16010    It does not let you subtract one const X* pointer from another in an arm
16011    of an if-expression whose if-part is not a constant expression */
16012 const char *g = "string";
16013 ccp = &g + (g ? g-g : 0);
16014 /* HPUX 7.0 cc rejects these. */
16015 ++ccp;
16016 p = (char**) ccp;
16017 ccp = (char const *const *) p;
16018 { /* SCO 3.2v4 cc rejects this.  */
16019   char *t;
16020   char const *s = 0 ? (char *) 0 : (char const *) 0;
16021
16022   *t++ = 0;
16023 }
16024 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
16025   int x[] = {25, 17};
16026   const int *foo = &x[0];
16027   ++foo;
16028 }
16029 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
16030   typedef const int *iptr;
16031   iptr p = 0;
16032   ++p;
16033 }
16034 { /* AIX XL C 1.02.0.0 rejects this saying
16035      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
16036   struct s { int j; const int *ap[3]; };
16037   struct s *b; b->j = 5;
16038 }
16039 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
16040   const int foo = 10;
16041 }
16042
16043 ; return 0; }
16044 EOF
16045 if { (eval echo configure:16046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16046   rm -rf conftest*
16047   ac_cv_c_const=yes
16048 else
16049   echo "configure: failed program was:" >&5
16050   cat conftest.$ac_ext >&5
16051   rm -rf conftest*
16052   ac_cv_c_const=no
16053 fi
16054 rm -f conftest*
16055 fi
16056
16057 echo "$ac_t""$ac_cv_c_const" 1>&6
16058 if test $ac_cv_c_const = no; then
16059   cat >> confdefs.h <<\EOF
16060 #define const 
16061 EOF
16062
16063 fi
16064
16065 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
16066 echo "configure:16067: checking if compiler understands volatile" >&5
16067 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
16068   echo $ac_n "(cached) $ac_c" 1>&6
16069 else
16070   cat > conftest.$ac_ext <<EOF
16071 #line 16072 "configure"
16072 #include "confdefs.h"
16073 int x, y, z;
16074 int main() {
16075 volatile int a; int * volatile b = x ? &y : &z;
16076       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
16077       *b = 0;
16078 ; return 0; }
16079 EOF
16080 if { (eval echo configure:16081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16081   rm -rf conftest*
16082   ol_cv_c_volatile=yes
16083 else
16084   echo "configure: failed program was:" >&5
16085   cat conftest.$ac_ext >&5
16086   rm -rf conftest*
16087   ol_cv_c_volatile=no
16088 fi
16089 rm -f conftest*
16090 fi
16091
16092 echo "$ac_t""$ol_cv_c_volatile" 1>&6
16093   if test $ol_cv_c_volatile = yes; then
16094     : 
16095   else
16096     cat >> confdefs.h <<\EOF
16097 #define volatile 
16098 EOF
16099
16100   fi
16101  
16102
16103 if test $cross_compiling = yes ; then
16104         cat >> confdefs.h <<\EOF
16105 #define CROSS_COMPILING 1
16106 EOF
16107
16108 else
16109         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
16110 echo "configure:16111: checking whether byte ordering is bigendian" >&5
16111 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
16112   echo $ac_n "(cached) $ac_c" 1>&6
16113 else
16114   ac_cv_c_bigendian=unknown
16115 # See if sys/param.h defines the BYTE_ORDER macro.
16116 cat > conftest.$ac_ext <<EOF
16117 #line 16118 "configure"
16118 #include "confdefs.h"
16119 #include <sys/types.h>
16120 #include <sys/param.h>
16121 int main() {
16122
16123 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
16124  bogus endian macros
16125 #endif
16126 ; return 0; }
16127 EOF
16128 if { (eval echo configure:16129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16129   rm -rf conftest*
16130   # It does; now see whether it defined to BIG_ENDIAN or not.
16131 cat > conftest.$ac_ext <<EOF
16132 #line 16133 "configure"
16133 #include "confdefs.h"
16134 #include <sys/types.h>
16135 #include <sys/param.h>
16136 int main() {
16137
16138 #if BYTE_ORDER != BIG_ENDIAN
16139  not big endian
16140 #endif
16141 ; return 0; }
16142 EOF
16143 if { (eval echo configure:16144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16144   rm -rf conftest*
16145   ac_cv_c_bigendian=yes
16146 else
16147   echo "configure: failed program was:" >&5
16148   cat conftest.$ac_ext >&5
16149   rm -rf conftest*
16150   ac_cv_c_bigendian=no
16151 fi
16152 rm -f conftest*
16153 else
16154   echo "configure: failed program was:" >&5
16155   cat conftest.$ac_ext >&5
16156 fi
16157 rm -f conftest*
16158 if test $ac_cv_c_bigendian = unknown; then
16159 if test "$cross_compiling" = yes; then
16160     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
16161 else
16162   cat > conftest.$ac_ext <<EOF
16163 #line 16164 "configure"
16164 #include "confdefs.h"
16165 main () {
16166   /* Are we little or big endian?  From Harbison&Steele.  */
16167   union
16168   {
16169     long l;
16170     char c[sizeof (long)];
16171   } u;
16172   u.l = 1;
16173   exit (u.c[sizeof (long) - 1] == 1);
16174 }
16175 EOF
16176 if { (eval echo configure:16177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16177 then
16178   ac_cv_c_bigendian=no
16179 else
16180   echo "configure: failed program was:" >&5
16181   cat conftest.$ac_ext >&5
16182   rm -fr conftest*
16183   ac_cv_c_bigendian=yes
16184 fi
16185 rm -fr conftest*
16186 fi
16187
16188 fi
16189 fi
16190
16191 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
16192 if test $ac_cv_c_bigendian = yes; then
16193   cat >> confdefs.h <<\EOF
16194 #define WORDS_BIGENDIAN 1
16195 EOF
16196
16197 fi
16198
16199 fi
16200
16201 echo $ac_n "checking size of short""... $ac_c" 1>&6
16202 echo "configure:16203: checking size of short" >&5 
16203 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
16204   echo $ac_n "(cached) $ac_c" 1>&6
16205 else
16206   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16207   cat > conftest.$ac_ext <<EOF
16208 #line 16209 "configure"
16209 #include "confdefs.h"
16210 #include "confdefs.h" 
16211 #include <sys/types.h> 
16212  
16213
16214 int main() {
16215 switch (0) case 0: case (sizeof (short) == $ac_size):;
16216 ; return 0; }
16217 EOF
16218 if { (eval echo configure:16219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16219   rm -rf conftest*
16220   ac_cv_sizeof_short=$ac_size
16221 else
16222   echo "configure: failed program was:" >&5
16223   cat conftest.$ac_ext >&5
16224 fi
16225 rm -f conftest* 
16226   if test x$ac_cv_sizeof_short != x ; then break; fi 
16227 done 
16228
16229 fi
16230  
16231 if test x$ac_cv_sizeof_short = x ; then 
16232   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
16233 fi 
16234 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
16235 cat >> confdefs.h <<EOF
16236 #define SIZEOF_SHORT $ac_cv_sizeof_short
16237 EOF
16238  
16239  
16240 echo $ac_n "checking size of int""... $ac_c" 1>&6
16241 echo "configure:16242: checking size of int" >&5 
16242 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
16243   echo $ac_n "(cached) $ac_c" 1>&6
16244 else
16245   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16246   cat > conftest.$ac_ext <<EOF
16247 #line 16248 "configure"
16248 #include "confdefs.h"
16249 #include "confdefs.h" 
16250 #include <sys/types.h> 
16251  
16252
16253 int main() {
16254 switch (0) case 0: case (sizeof (int) == $ac_size):;
16255 ; return 0; }
16256 EOF
16257 if { (eval echo configure:16258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16258   rm -rf conftest*
16259   ac_cv_sizeof_int=$ac_size
16260 else
16261   echo "configure: failed program was:" >&5
16262   cat conftest.$ac_ext >&5
16263 fi
16264 rm -f conftest* 
16265   if test x$ac_cv_sizeof_int != x ; then break; fi 
16266 done 
16267
16268 fi
16269  
16270 if test x$ac_cv_sizeof_int = x ; then 
16271   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16272 fi 
16273 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16274 cat >> confdefs.h <<EOF
16275 #define SIZEOF_INT $ac_cv_sizeof_int
16276 EOF
16277  
16278  
16279 echo $ac_n "checking size of long""... $ac_c" 1>&6
16280 echo "configure:16281: checking size of long" >&5 
16281 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16282   echo $ac_n "(cached) $ac_c" 1>&6
16283 else
16284   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16285   cat > conftest.$ac_ext <<EOF
16286 #line 16287 "configure"
16287 #include "confdefs.h"
16288 #include "confdefs.h" 
16289 #include <sys/types.h> 
16290  
16291
16292 int main() {
16293 switch (0) case 0: case (sizeof (long) == $ac_size):;
16294 ; return 0; }
16295 EOF
16296 if { (eval echo configure:16297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16297   rm -rf conftest*
16298   ac_cv_sizeof_long=$ac_size
16299 else
16300   echo "configure: failed program was:" >&5
16301   cat conftest.$ac_ext >&5
16302 fi
16303 rm -f conftest* 
16304   if test x$ac_cv_sizeof_long != x ; then break; fi 
16305 done 
16306
16307 fi
16308  
16309 if test x$ac_cv_sizeof_long = x ; then 
16310   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16311 fi 
16312 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16313 cat >> confdefs.h <<EOF
16314 #define SIZEOF_LONG $ac_cv_sizeof_long
16315 EOF
16316  
16317
16318
16319 if test "$ac_cv_sizeof_int" -lt 4 ; then
16320         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16321
16322         cat >> confdefs.h <<\EOF
16323 #define LBER_INT_T long
16324 EOF
16325
16326 else
16327         cat >> confdefs.h <<\EOF
16328 #define LBER_INT_T int
16329 EOF
16330
16331 fi
16332
16333 cat >> confdefs.h <<\EOF
16334 #define LBER_LEN_T long
16335 EOF
16336
16337 cat >> confdefs.h <<\EOF
16338 #define LBER_SOCKET_T int
16339 EOF
16340
16341 cat >> confdefs.h <<\EOF
16342 #define LBER_TAG_T long
16343 EOF
16344
16345
16346 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16347 echo "configure:16348: checking for 8-bit clean memcmp" >&5
16348 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16349   echo $ac_n "(cached) $ac_c" 1>&6
16350 else
16351   if test "$cross_compiling" = yes; then
16352   ac_cv_func_memcmp_clean=no
16353 else
16354   cat > conftest.$ac_ext <<EOF
16355 #line 16356 "configure"
16356 #include "confdefs.h"
16357
16358 main()
16359 {
16360   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16361   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16362 }
16363
16364 EOF
16365 if { (eval echo configure:16366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16366 then
16367   ac_cv_func_memcmp_clean=yes
16368 else
16369   echo "configure: failed program was:" >&5
16370   cat conftest.$ac_ext >&5
16371   rm -fr conftest*
16372   ac_cv_func_memcmp_clean=no
16373 fi
16374 rm -fr conftest*
16375 fi
16376
16377 fi
16378
16379 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16380 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16381
16382 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16383 echo "configure:16384: checking for strftime" >&5
16384 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16385   echo $ac_n "(cached) $ac_c" 1>&6
16386 else
16387   cat > conftest.$ac_ext <<EOF
16388 #line 16389 "configure"
16389 #include "confdefs.h"
16390 /* System header to define __stub macros and hopefully few prototypes,
16391     which can conflict with char strftime(); below.  */
16392 #include <assert.h>
16393 /* Override any gcc2 internal prototype to avoid an error.  */
16394 /* We use char because int might match the return type of a gcc2
16395     builtin and then its argument prototype would still apply.  */
16396 char strftime();
16397 char (*f)();
16398
16399 int main() {
16400
16401 /* The GNU C library defines this for functions which it implements
16402     to always fail with ENOSYS.  Some functions are actually named
16403     something starting with __ and the normal name is an alias.  */
16404 #if defined (__stub_strftime) || defined (__stub___strftime)
16405 choke me
16406 #else
16407 f = strftime;
16408 #endif
16409
16410 ; return 0; }
16411 EOF
16412 if { (eval echo configure:16413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16413   rm -rf conftest*
16414   eval "ac_cv_func_strftime=yes"
16415 else
16416   echo "configure: failed program was:" >&5
16417   cat conftest.$ac_ext >&5
16418   rm -rf conftest*
16419   eval "ac_cv_func_strftime=no"
16420 fi
16421 rm -f conftest*
16422 fi
16423
16424 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16425   echo "$ac_t""yes" 1>&6
16426   cat >> confdefs.h <<\EOF
16427 #define HAVE_STRFTIME 1
16428 EOF
16429
16430 else
16431   echo "$ac_t""no" 1>&6
16432 # strftime is in -lintl on SCO UNIX.
16433 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16434 echo "configure:16435: checking for strftime in -lintl" >&5
16435 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16436 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16437   echo $ac_n "(cached) $ac_c" 1>&6
16438 else
16439   ac_save_LIBS="$LIBS"
16440 LIBS="-lintl  $LIBS"
16441 cat > conftest.$ac_ext <<EOF
16442 #line 16443 "configure"
16443 #include "confdefs.h"
16444 /* Override any gcc2 internal prototype to avoid an error.  */
16445 /* We use char because int might match the return type of a gcc2
16446     builtin and then its argument prototype would still apply.  */
16447 char strftime();
16448
16449 int main() {
16450 strftime()
16451 ; return 0; }
16452 EOF
16453 if { (eval echo configure:16454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16454   rm -rf conftest*
16455   eval "ac_cv_lib_$ac_lib_var=yes"
16456 else
16457   echo "configure: failed program was:" >&5
16458   cat conftest.$ac_ext >&5
16459   rm -rf conftest*
16460   eval "ac_cv_lib_$ac_lib_var=no"
16461 fi
16462 rm -f conftest*
16463 LIBS="$ac_save_LIBS"
16464
16465 fi
16466 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16467   echo "$ac_t""yes" 1>&6
16468   cat >> confdefs.h <<\EOF
16469 #define HAVE_STRFTIME 1
16470 EOF
16471
16472 LIBS="-lintl $LIBS"
16473 else
16474   echo "$ac_t""no" 1>&6
16475 fi
16476
16477 fi
16478
16479
16480 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16481 echo "configure:16482: checking for inet_aton()" >&5
16482 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16483   echo $ac_n "(cached) $ac_c" 1>&6
16484 else
16485   cat > conftest.$ac_ext <<EOF
16486 #line 16487 "configure"
16487 #include "confdefs.h"
16488
16489 #ifdef HAVE_SYS_TYPES_H
16490 #       include <sys/types.h>
16491 #endif
16492 #ifdef HAVE_SYS_SOCKET_H
16493 #       include <sys/socket.h>
16494 #       ifdef HAVE_SYS_SELECT_H
16495 #               include <sys/select.h>
16496 #       endif
16497 #       include <netinet/in.h>
16498 #       ifdef HAVE_ARPA_INET_H
16499 #               include <arpa/inet.h>
16500 #       endif
16501 #endif
16502
16503 int main() {
16504 struct in_addr in;
16505 int rc = inet_aton( "255.255.255.255", &in );
16506 ; return 0; }
16507 EOF
16508 if { (eval echo configure:16509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16509   rm -rf conftest*
16510   ol_cv_func_inet_aton=yes
16511 else
16512   echo "configure: failed program was:" >&5
16513   cat conftest.$ac_ext >&5
16514   rm -rf conftest*
16515   ol_cv_func_inet_aton=no
16516 fi
16517 rm -f conftest*
16518 fi
16519
16520 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16521   if test $ol_cv_func_inet_aton != no; then
16522     cat >> confdefs.h <<\EOF
16523 #define HAVE_INET_ATON 1
16524 EOF
16525
16526   fi
16527  
16528
16529 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16530 echo "configure:16531: checking for _spawnlp" >&5
16531 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16532   echo $ac_n "(cached) $ac_c" 1>&6
16533 else
16534   cat > conftest.$ac_ext <<EOF
16535 #line 16536 "configure"
16536 #include "confdefs.h"
16537 /* System header to define __stub macros and hopefully few prototypes,
16538     which can conflict with char _spawnlp(); below.  */
16539 #include <assert.h>
16540 /* Override any gcc2 internal prototype to avoid an error.  */
16541 /* We use char because int might match the return type of a gcc2
16542     builtin and then its argument prototype would still apply.  */
16543 char _spawnlp();
16544 char (*f)();
16545
16546 int main() {
16547
16548 /* The GNU C library defines this for functions which it implements
16549     to always fail with ENOSYS.  Some functions are actually named
16550     something starting with __ and the normal name is an alias.  */
16551 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16552 choke me
16553 #else
16554 f = _spawnlp;
16555 #endif
16556
16557 ; return 0; }
16558 EOF
16559 if { (eval echo configure:16560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16560   rm -rf conftest*
16561   eval "ac_cv_func__spawnlp=yes"
16562 else
16563   echo "configure: failed program was:" >&5
16564   cat conftest.$ac_ext >&5
16565   rm -rf conftest*
16566   eval "ac_cv_func__spawnlp=no"
16567 fi
16568 rm -f conftest*
16569 fi
16570
16571 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16572   echo "$ac_t""yes" 1>&6
16573   cat >> confdefs.h <<\EOF
16574 #define HAVE_SPAWNLP 1
16575 EOF
16576
16577 else
16578   echo "$ac_t""no" 1>&6
16579 fi
16580
16581
16582 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16583 echo "configure:16584: checking for _snprintf" >&5
16584 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16585   echo $ac_n "(cached) $ac_c" 1>&6
16586 else
16587   cat > conftest.$ac_ext <<EOF
16588 #line 16589 "configure"
16589 #include "confdefs.h"
16590 /* System header to define __stub macros and hopefully few prototypes,
16591     which can conflict with char _snprintf(); below.  */
16592 #include <assert.h>
16593 /* Override any gcc2 internal prototype to avoid an error.  */
16594 /* We use char because int might match the return type of a gcc2
16595     builtin and then its argument prototype would still apply.  */
16596 char _snprintf();
16597 char (*f)();
16598
16599 int main() {
16600
16601 /* The GNU C library defines this for functions which it implements
16602     to always fail with ENOSYS.  Some functions are actually named
16603     something starting with __ and the normal name is an alias.  */
16604 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16605 choke me
16606 #else
16607 f = _snprintf;
16608 #endif
16609
16610 ; return 0; }
16611 EOF
16612 if { (eval echo configure:16613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16613   rm -rf conftest*
16614   eval "ac_cv_func__snprintf=yes"
16615 else
16616   echo "configure: failed program was:" >&5
16617   cat conftest.$ac_ext >&5
16618   rm -rf conftest*
16619   eval "ac_cv_func__snprintf=no"
16620 fi
16621 rm -f conftest*
16622 fi
16623
16624 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16625   echo "$ac_t""yes" 1>&6
16626   ac_cv_func_snprintf=yes
16627         cat >> confdefs.h <<\EOF
16628 #define snprintf _snprintf
16629 EOF
16630
16631
16632 else
16633   echo "$ac_t""no" 1>&6
16634 fi
16635
16636
16637 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16638 echo "configure:16639: checking for _vsnprintf" >&5
16639 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16640   echo $ac_n "(cached) $ac_c" 1>&6
16641 else
16642   cat > conftest.$ac_ext <<EOF
16643 #line 16644 "configure"
16644 #include "confdefs.h"
16645 /* System header to define __stub macros and hopefully few prototypes,
16646     which can conflict with char _vsnprintf(); below.  */
16647 #include <assert.h>
16648 /* Override any gcc2 internal prototype to avoid an error.  */
16649 /* We use char because int might match the return type of a gcc2
16650     builtin and then its argument prototype would still apply.  */
16651 char _vsnprintf();
16652 char (*f)();
16653
16654 int main() {
16655
16656 /* The GNU C library defines this for functions which it implements
16657     to always fail with ENOSYS.  Some functions are actually named
16658     something starting with __ and the normal name is an alias.  */
16659 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16660 choke me
16661 #else
16662 f = _vsnprintf;
16663 #endif
16664
16665 ; return 0; }
16666 EOF
16667 if { (eval echo configure:16668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16668   rm -rf conftest*
16669   eval "ac_cv_func__vsnprintf=yes"
16670 else
16671   echo "configure: failed program was:" >&5
16672   cat conftest.$ac_ext >&5
16673   rm -rf conftest*
16674   eval "ac_cv_func__vsnprintf=no"
16675 fi
16676 rm -f conftest*
16677 fi
16678
16679 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16680   echo "$ac_t""yes" 1>&6
16681   ac_cv_func_vsnprintf=yes
16682         cat >> confdefs.h <<\EOF
16683 #define vsnprintf _vsnprintf
16684 EOF
16685
16686
16687 else
16688   echo "$ac_t""no" 1>&6
16689 fi
16690
16691
16692 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16693 echo "configure:16694: checking for vprintf" >&5
16694 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16695   echo $ac_n "(cached) $ac_c" 1>&6
16696 else
16697   cat > conftest.$ac_ext <<EOF
16698 #line 16699 "configure"
16699 #include "confdefs.h"
16700 /* System header to define __stub macros and hopefully few prototypes,
16701     which can conflict with char vprintf(); below.  */
16702 #include <assert.h>
16703 /* Override any gcc2 internal prototype to avoid an error.  */
16704 /* We use char because int might match the return type of a gcc2
16705     builtin and then its argument prototype would still apply.  */
16706 char vprintf();
16707 char (*f)();
16708
16709 int main() {
16710
16711 /* The GNU C library defines this for functions which it implements
16712     to always fail with ENOSYS.  Some functions are actually named
16713     something starting with __ and the normal name is an alias.  */
16714 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16715 choke me
16716 #else
16717 f = vprintf;
16718 #endif
16719
16720 ; return 0; }
16721 EOF
16722 if { (eval echo configure:16723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16723   rm -rf conftest*
16724   eval "ac_cv_func_vprintf=yes"
16725 else
16726   echo "configure: failed program was:" >&5
16727   cat conftest.$ac_ext >&5
16728   rm -rf conftest*
16729   eval "ac_cv_func_vprintf=no"
16730 fi
16731 rm -f conftest*
16732 fi
16733
16734 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16735   echo "$ac_t""yes" 1>&6
16736   cat >> confdefs.h <<\EOF
16737 #define HAVE_VPRINTF 1
16738 EOF
16739
16740 else
16741   echo "$ac_t""no" 1>&6
16742 fi
16743
16744 if test "$ac_cv_func_vprintf" != yes; then
16745 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16746 echo "configure:16747: checking for _doprnt" >&5
16747 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16748   echo $ac_n "(cached) $ac_c" 1>&6
16749 else
16750   cat > conftest.$ac_ext <<EOF
16751 #line 16752 "configure"
16752 #include "confdefs.h"
16753 /* System header to define __stub macros and hopefully few prototypes,
16754     which can conflict with char _doprnt(); below.  */
16755 #include <assert.h>
16756 /* Override any gcc2 internal prototype to avoid an error.  */
16757 /* We use char because int might match the return type of a gcc2
16758     builtin and then its argument prototype would still apply.  */
16759 char _doprnt();
16760 char (*f)();
16761
16762 int main() {
16763
16764 /* The GNU C library defines this for functions which it implements
16765     to always fail with ENOSYS.  Some functions are actually named
16766     something starting with __ and the normal name is an alias.  */
16767 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16768 choke me
16769 #else
16770 f = _doprnt;
16771 #endif
16772
16773 ; return 0; }
16774 EOF
16775 if { (eval echo configure:16776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16776   rm -rf conftest*
16777   eval "ac_cv_func__doprnt=yes"
16778 else
16779   echo "configure: failed program was:" >&5
16780   cat conftest.$ac_ext >&5
16781   rm -rf conftest*
16782   eval "ac_cv_func__doprnt=no"
16783 fi
16784 rm -f conftest*
16785 fi
16786
16787 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16788   echo "$ac_t""yes" 1>&6
16789   cat >> confdefs.h <<\EOF
16790 #define HAVE_DOPRNT 1
16791 EOF
16792
16793 else
16794   echo "$ac_t""no" 1>&6
16795 fi
16796
16797 fi
16798
16799
16800 if test $ac_cv_func_vprintf = yes ; then
16801                 for ac_func in vsnprintf vsprintf
16802 do
16803 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16804 echo "configure:16805: checking for $ac_func" >&5
16805 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16806   echo $ac_n "(cached) $ac_c" 1>&6
16807 else
16808   cat > conftest.$ac_ext <<EOF
16809 #line 16810 "configure"
16810 #include "confdefs.h"
16811 /* System header to define __stub macros and hopefully few prototypes,
16812     which can conflict with char $ac_func(); below.  */
16813 #include <assert.h>
16814 /* Override any gcc2 internal prototype to avoid an error.  */
16815 /* We use char because int might match the return type of a gcc2
16816     builtin and then its argument prototype would still apply.  */
16817 char $ac_func();
16818 char (*f)();
16819
16820 int main() {
16821
16822 /* The GNU C library defines this for functions which it implements
16823     to always fail with ENOSYS.  Some functions are actually named
16824     something starting with __ and the normal name is an alias.  */
16825 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16826 choke me
16827 #else
16828 f = $ac_func;
16829 #endif
16830
16831 ; return 0; }
16832 EOF
16833 if { (eval echo configure:16834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16834   rm -rf conftest*
16835   eval "ac_cv_func_$ac_func=yes"
16836 else
16837   echo "configure: failed program was:" >&5
16838   cat conftest.$ac_ext >&5
16839   rm -rf conftest*
16840   eval "ac_cv_func_$ac_func=no"
16841 fi
16842 rm -f conftest*
16843 fi
16844
16845 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16846   echo "$ac_t""yes" 1>&6
16847     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16848   cat >> confdefs.h <<EOF
16849 #define $ac_tr_func 1
16850 EOF
16851  
16852 else
16853   echo "$ac_t""no" 1>&6
16854 fi
16855 done
16856
16857 fi
16858
16859 for ac_func in \
16860         bcopy                   \
16861         closesocket             \
16862         chroot                  \
16863         endgrent                \
16864         endpwent                \
16865         fcntl                   \
16866         flock                   \
16867         getdtablesize   \
16868         getgrgid                \
16869         gethostname             \
16870         getpass                 \
16871         getpassphrase   \
16872         getpwuid                \
16873         getpwnam                \
16874         getspnam                \
16875         gettimeofday    \
16876         initgroups              \
16877         lockf                   \
16878         memcpy                  \
16879         memmove                 \
16880         mkstemp                 \
16881         pipe                    \
16882         read                    \
16883         recv                    \
16884         recvfrom                \
16885         setpwfile               \
16886         setgid                  \
16887         setegid                 \
16888         setsid                  \
16889         setuid                  \
16890         seteuid                 \
16891         sigaction               \
16892         signal                  \
16893         sigset                  \
16894         strdup                  \
16895         strerror                \
16896         strpbrk                 \
16897         strrchr                 \
16898         strsep                  \
16899         strstr                  \
16900         strtol                  \
16901         strtoul                 \
16902         strspn                  \
16903         sysconf                 \
16904         usleep                  \
16905         waitpid                 \
16906         wait4                   \
16907         write                   \
16908         send                    \
16909         sendto                  \
16910
16911 do
16912 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16913 echo "configure:16914: checking for $ac_func" >&5
16914 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16915   echo $ac_n "(cached) $ac_c" 1>&6
16916 else
16917   cat > conftest.$ac_ext <<EOF
16918 #line 16919 "configure"
16919 #include "confdefs.h"
16920 /* System header to define __stub macros and hopefully few prototypes,
16921     which can conflict with char $ac_func(); below.  */
16922 #include <assert.h>
16923 /* Override any gcc2 internal prototype to avoid an error.  */
16924 /* We use char because int might match the return type of a gcc2
16925     builtin and then its argument prototype would still apply.  */
16926 char $ac_func();
16927 char (*f)();
16928
16929 int main() {
16930
16931 /* The GNU C library defines this for functions which it implements
16932     to always fail with ENOSYS.  Some functions are actually named
16933     something starting with __ and the normal name is an alias.  */
16934 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16935 choke me
16936 #else
16937 f = $ac_func;
16938 #endif
16939
16940 ; return 0; }
16941 EOF
16942 if { (eval echo configure:16943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16943   rm -rf conftest*
16944   eval "ac_cv_func_$ac_func=yes"
16945 else
16946   echo "configure: failed program was:" >&5
16947   cat conftest.$ac_ext >&5
16948   rm -rf conftest*
16949   eval "ac_cv_func_$ac_func=no"
16950 fi
16951 rm -f conftest*
16952 fi
16953
16954 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16955   echo "$ac_t""yes" 1>&6
16956     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16957   cat >> confdefs.h <<EOF
16958 #define $ac_tr_func 1
16959 EOF
16960  
16961 else
16962   echo "$ac_t""no" 1>&6
16963 fi
16964 done
16965
16966
16967 for ac_func in getopt
16968 do
16969 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16970 echo "configure:16971: checking for $ac_func" >&5
16971 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16972   echo $ac_n "(cached) $ac_c" 1>&6
16973 else
16974   cat > conftest.$ac_ext <<EOF
16975 #line 16976 "configure"
16976 #include "confdefs.h"
16977 /* System header to define __stub macros and hopefully few prototypes,
16978     which can conflict with char $ac_func(); below.  */
16979 #include <assert.h>
16980 /* Override any gcc2 internal prototype to avoid an error.  */
16981 /* We use char because int might match the return type of a gcc2
16982     builtin and then its argument prototype would still apply.  */
16983 char $ac_func();
16984 char (*f)();
16985
16986 int main() {
16987
16988 /* The GNU C library defines this for functions which it implements
16989     to always fail with ENOSYS.  Some functions are actually named
16990     something starting with __ and the normal name is an alias.  */
16991 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16992 choke me
16993 #else
16994 f = $ac_func;
16995 #endif
16996
16997 ; return 0; }
16998 EOF
16999 if { (eval echo configure:17000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17000   rm -rf conftest*
17001   eval "ac_cv_func_$ac_func=yes"
17002 else
17003   echo "configure: failed program was:" >&5
17004   cat conftest.$ac_ext >&5
17005   rm -rf conftest*
17006   eval "ac_cv_func_$ac_func=no"
17007 fi
17008 rm -f conftest*
17009 fi
17010
17011 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
17012   echo "$ac_t""yes" 1>&6
17013     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
17014   cat >> confdefs.h <<EOF
17015 #define $ac_tr_func 1
17016 EOF
17017  
17018 else
17019   echo "$ac_t""no" 1>&6
17020 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
17021 fi
17022 done
17023
17024
17025
17026 if test "$ac_cv_func_getopt" != yes; then
17027     LIBSRCS="$LIBSRCS getopt.c"
17028 fi
17029
17030 # Check Configuration
17031 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
17032 echo "configure:17033: checking declaration of sys_errlist" >&5
17033 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
17034   echo $ac_n "(cached) $ac_c" 1>&6
17035 else
17036   
17037         cat > conftest.$ac_ext <<EOF
17038 #line 17039 "configure"
17039 #include "confdefs.h"
17040
17041 #include <stdio.h>
17042 #include <sys/types.h>
17043 #include <errno.h>
17044 #ifdef WINNT
17045 #include <stdlib.h>
17046 #endif 
17047 int main() {
17048 char *c = (char *) *sys_errlist
17049 ; return 0; }
17050 EOF
17051 if { (eval echo configure:17052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
17052   rm -rf conftest*
17053   ol_cv_dcl_sys_errlist=yes
17054         ol_cv_have_sys_errlist=yes
17055 else
17056   echo "configure: failed program was:" >&5
17057   cat conftest.$ac_ext >&5
17058   rm -rf conftest*
17059   ol_cv_dcl_sys_errlist=no
17060 fi
17061 rm -f conftest*
17062 fi
17063
17064 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
17065 #
17066 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
17067 if test $ol_cv_dcl_sys_errlist = no ; then
17068         cat >> confdefs.h <<\EOF
17069 #define DECL_SYS_ERRLIST 1
17070 EOF
17071
17072
17073         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
17074 echo "configure:17075: checking existence of sys_errlist" >&5
17075 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
17076   echo $ac_n "(cached) $ac_c" 1>&6
17077 else
17078   
17079                 cat > conftest.$ac_ext <<EOF
17080 #line 17081 "configure"
17081 #include "confdefs.h"
17082 #include <errno.h>
17083 int main() {
17084 char *c = (char *) *sys_errlist
17085 ; return 0; }
17086 EOF
17087 if { (eval echo configure:17088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
17088   rm -rf conftest*
17089   ol_cv_have_sys_errlist=yes
17090 else
17091   echo "configure: failed program was:" >&5
17092   cat conftest.$ac_ext >&5
17093   rm -rf conftest*
17094   ol_cv_have_sys_errlist=no
17095 fi
17096 rm -f conftest*
17097 fi
17098
17099 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
17100 fi
17101 if test $ol_cv_have_sys_errlist = yes ; then
17102         cat >> confdefs.h <<\EOF
17103 #define HAVE_SYS_ERRLIST 1
17104 EOF
17105
17106 fi
17107
17108
17109
17110 if test "$ol_enable_debug" != no ; then
17111         cat >> confdefs.h <<\EOF
17112 #define LDAP_DEBUG 1
17113 EOF
17114
17115 fi
17116 if test "$ol_enable_syslog" = yes ; then
17117         cat >> confdefs.h <<\EOF
17118 #define LDAP_SYSLOG 1
17119 EOF
17120
17121 fi
17122 if test "$ol_enable_cache" = no ; then
17123         cat >> confdefs.h <<\EOF
17124 #define LDAP_NOCACHE 1
17125 EOF
17126
17127 fi
17128 if test "$ol_link_kbind" != no ; then
17129         cat >> confdefs.h <<\EOF
17130 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
17131 EOF
17132
17133 fi
17134 if test "$ol_enable_proctitle" != no ; then
17135         cat >> confdefs.h <<\EOF
17136 #define LDAP_PROCTITLE 1
17137 EOF
17138
17139 fi
17140 if test "$ol_enable_referrals" != no ; then
17141         cat >> confdefs.h <<\EOF
17142 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
17143 EOF
17144
17145 fi
17146 if test "$ol_enable_local" != no; then
17147         cat >> confdefs.h <<\EOF
17148 #define LDAP_PF_LOCAL 1
17149 EOF
17150
17151 fi
17152 if test "$ol_link_ipv6" != no; then
17153         cat >> confdefs.h <<\EOF
17154 #define LDAP_PF_INET6 1
17155 EOF
17156
17157 fi
17158 if test "$ol_enable_cleartext" != no ; then
17159         cat >> confdefs.h <<\EOF
17160 #define SLAPD_CLEARTEXT 1
17161 EOF
17162
17163 fi
17164 if test "$ol_enable_crypt" != no ; then
17165         cat >> confdefs.h <<\EOF
17166 #define SLAPD_CRYPT 1
17167 EOF
17168
17169 fi
17170 if test "$ol_link_kpasswd" != no ; then
17171         cat >> confdefs.h <<\EOF
17172 #define SLAPD_KPASSWD 1
17173 EOF
17174
17175 fi
17176 if test "$ol_link_spasswd" != no ; then
17177         cat >> confdefs.h <<\EOF
17178 #define SLAPD_SPASSWD 1
17179 EOF
17180
17181 fi
17182 if test "$ol_enable_phonetic" != no ; then
17183         cat >> confdefs.h <<\EOF
17184 #define SLAPD_PHONETIC 1
17185 EOF
17186
17187 fi
17188 if test "$ol_enable_rlookups" != no ; then
17189         cat >> confdefs.h <<\EOF
17190 #define SLAPD_RLOOKUPS 1
17191 EOF
17192
17193 fi
17194 if test "$ol_enable_aci" != no ; then
17195         cat >> confdefs.h <<\EOF
17196 #define SLAPD_ACI_ENABLED 1
17197 EOF
17198
17199 fi
17200
17201 if test "$ol_link_modules" != no ; then
17202         cat >> confdefs.h <<\EOF
17203 #define SLAPD_MODULES 1
17204 EOF
17205
17206         BUILD_SLAPD=yes
17207         SLAPD_MODULES_LDFLAGS="-dlopen self"
17208 fi
17209
17210 if test "$ol_link_dnssrv" != no ; then
17211         cat >> confdefs.h <<\EOF
17212 #define SLAPD_DNSSRV 1
17213 EOF
17214
17215         BUILD_SLAPD=yes
17216         BUILD_DNSSRV=yes
17217         if test "$ol_with_dnssrv_module" != static ; then
17218                 cat >> confdefs.h <<\EOF
17219 #define SLAPD_DNSSRV_DYNAMIC 1
17220 EOF
17221
17222                 BUILD_DNSSRV=mod
17223                 BUILD_DNSSRV_DYNAMIC=shared
17224                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
17225         fi
17226 fi
17227
17228 if test "$ol_enable_ldap" != no ; then
17229         cat >> confdefs.h <<\EOF
17230 #define SLAPD_LDAP 1
17231 EOF
17232
17233         BUILD_SLAPD=yes
17234         BUILD_LDAP=yes
17235         if test "$ol_with_ldap_module" != static ; then
17236                 cat >> confdefs.h <<\EOF
17237 #define SLAPD_LDAP_DYNAMIC 1
17238 EOF
17239
17240                 BUILD_LDAP=mod
17241                 BUILD_LDAP_DYNAMIC=shared
17242                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17243         fi
17244 fi
17245
17246 if test "$ol_link_ldbm" != no ; then
17247         cat >> confdefs.h <<\EOF
17248 #define SLAPD_LDBM 1
17249 EOF
17250
17251         BUILD_SLAPD=yes
17252         BUILD_LDBM=yes
17253         if test "$ol_with_ldbm_module" != static ; then
17254                 cat >> confdefs.h <<\EOF
17255 #define SLAPD_LDBM_DYNAMIC 1
17256 EOF
17257
17258                 BUILD_LDBM=mod
17259                 BUILD_LDBM_DYNAMIC=shared
17260                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17261         fi
17262 fi
17263
17264 if test "$ol_enable_passwd" != no ; then
17265         cat >> confdefs.h <<\EOF
17266 #define SLAPD_PASSWD 1
17267 EOF
17268
17269         BUILD_SLAPD=yes
17270         BUILD_PASSWD=yes
17271         if test "$ol_with_passwd_module" != static ; then
17272                 cat >> confdefs.h <<\EOF
17273 #define SLAPD_PASSWD_DYNAMIC 1
17274 EOF
17275
17276                 BUILD_PASSWD=mod
17277                 BUILD_PASSWD_DYNAMIC=shared
17278                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17279         fi
17280 fi
17281
17282 if test "$ol_enable_shell" != no ; then
17283         cat >> confdefs.h <<\EOF
17284 #define SLAPD_SHELL 1
17285 EOF
17286
17287         BUILD_SLAPD=yes
17288         BUILD_SHELL=yes
17289         if test "$ol_with_shell_module" != static ; then
17290                 cat >> confdefs.h <<\EOF
17291 #define SLAPD_SHELL_DYNAMIC 1
17292 EOF
17293
17294                 BUILD_SHELL=mod
17295                 BUILD_SHELL_DYNAMIC=shared
17296                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17297         fi
17298 fi
17299
17300 if test "$ol_enable_sql" != no ; then
17301         cat >> confdefs.h <<\EOF
17302 #define SLAPD_SQL 1
17303 EOF
17304
17305         BUILD_SLAPD=yes
17306         BUILD_SQL=yes
17307         if test "$ol_with_sql_module" != static; then
17308                 cat >> confdefs.h <<\EOF
17309 #define SLAPD_SQL_DYNAMIC 1
17310 EOF
17311
17312                 BUILD_SQL=mod
17313                 BUILD_SQL_DYNAMIC=shared
17314                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17315         fi
17316 fi
17317
17318 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17319         $BUILD_SLAPD = yes ; then
17320         BUILD_SLURPD=yes
17321 fi
17322
17323
17324 if test "$LINK_BINS_DYNAMIC" = yes; then
17325     LIB_LINKAGE=DYN
17326     LT_LIB_LINKAGE=shared
17327 else
17328     LIB_LINKAGE=STAT
17329     LT_LIB_LINKAGE=static
17330 fi
17331
17332 if test "$ac_cv_mingw32" = yes ; then
17333     PLAT=NT
17334     DYN_EXT=dll
17335 else
17336     PLAT=UNIX
17337     DYN_EXT=so
17338 fi
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348   
17349   
17350   
17351   
17352   
17353   
17354   
17355   
17356   
17357   
17358   
17359   
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390 trap '' 1 2 15
17391
17392 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17393
17394 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17395 # Let make expand exec_prefix.
17396 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17397
17398 # Any assignment to VPATH causes Sun make to only execute
17399 # the first set of double-colon rules, so remove it if not needed.
17400 # If there is a colon in the path, we need to keep it.
17401 if test "x$srcdir" = x.; then
17402   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17403 fi
17404
17405 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17406
17407 DEFS=-DHAVE_CONFIG_H
17408
17409 # Without the "./", some shells look in PATH for config.status.
17410 : ${CONFIG_STATUS=./config.status}
17411
17412 echo creating $CONFIG_STATUS
17413 rm -f $CONFIG_STATUS
17414 cat > $CONFIG_STATUS <<EOF
17415 #! /bin/sh
17416 # Generated automatically by configure.
17417 # Run this file to recreate the current configuration.
17418 # This directory was configured as follows,
17419 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17420 #
17421 # $0 $ac_configure_args
17422 #
17423 # Compiler output produced by configure, useful for debugging
17424 # configure, is in ./config.log if it exists.
17425
17426 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17427 for ac_option
17428 do
17429   case "\$ac_option" in
17430   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17431     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17432     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17433   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17434     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17435     exit 0 ;;
17436   -help | --help | --hel | --he | --h)
17437     echo "\$ac_cs_usage"; exit 0 ;;
17438   *) echo "\$ac_cs_usage"; exit 1 ;;
17439   esac
17440 done
17441
17442 ac_given_srcdir=$srcdir
17443 ac_given_INSTALL="$INSTALL"
17444
17445 trap 'rm -fr `echo "\
17446 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17447 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17448 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17449 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17450 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17451 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17452 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17453 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17454 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17455 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17456 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17457 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17458 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17459 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17460 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17461 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17462 include/Makefile:build/top.mk:include/Makefile.in \
17463 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17464 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17465 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17466 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17467 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17468 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17469 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17470 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17471 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17472 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17473 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17474 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17475 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17476 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17477 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17478 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17479 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17480 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17481 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17482 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17483 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17484 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17485 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17486  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17487 EOF
17488 cat >> $CONFIG_STATUS <<EOF
17489
17490 # Protect against being on the right side of a sed subst in config.status.
17491 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17492  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17493 $ac_vpsub
17494 $extrasub
17495 s%@SHELL@%$SHELL%g
17496 s%@CFLAGS@%$CFLAGS%g
17497 s%@CPPFLAGS@%$CPPFLAGS%g
17498 s%@CXXFLAGS@%$CXXFLAGS%g
17499 s%@FFLAGS@%$FFLAGS%g
17500 s%@DEFS@%$DEFS%g
17501 s%@LDFLAGS@%$LDFLAGS%g
17502 s%@LIBS@%$LIBS%g
17503 s%@exec_prefix@%$exec_prefix%g
17504 s%@prefix@%$prefix%g
17505 s%@program_transform_name@%$program_transform_name%g
17506 s%@bindir@%$bindir%g
17507 s%@sbindir@%$sbindir%g
17508 s%@libexecdir@%$libexecdir%g
17509 s%@datadir@%$datadir%g
17510 s%@sysconfdir@%$sysconfdir%g
17511 s%@sharedstatedir@%$sharedstatedir%g
17512 s%@localstatedir@%$localstatedir%g
17513 s%@libdir@%$libdir%g
17514 s%@includedir@%$includedir%g
17515 s%@oldincludedir@%$oldincludedir%g
17516 s%@infodir@%$infodir%g
17517 s%@mandir@%$mandir%g
17518 s%@host@%$host%g
17519 s%@host_alias@%$host_alias%g
17520 s%@host_cpu@%$host_cpu%g
17521 s%@host_vendor@%$host_vendor%g
17522 s%@host_os@%$host_os%g
17523 s%@target@%$target%g
17524 s%@target_alias@%$target_alias%g
17525 s%@target_cpu@%$target_cpu%g
17526 s%@target_vendor@%$target_vendor%g
17527 s%@target_os@%$target_os%g
17528 s%@build@%$build%g
17529 s%@build_alias@%$build_alias%g
17530 s%@build_cpu@%$build_cpu%g
17531 s%@build_vendor@%$build_vendor%g
17532 s%@build_os@%$build_os%g
17533 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17534 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17535 s%@INSTALL_DATA@%$INSTALL_DATA%g
17536 s%@PACKAGE@%$PACKAGE%g
17537 s%@VERSION@%$VERSION%g
17538 s%@ACLOCAL@%$ACLOCAL%g
17539 s%@AUTOCONF@%$AUTOCONF%g
17540 s%@AUTOMAKE@%$AUTOMAKE%g
17541 s%@AUTOHEADER@%$AUTOHEADER%g
17542 s%@MAKEINFO@%$MAKEINFO%g
17543 s%@install_sh@%$install_sh%g
17544 s%@AMTAR@%$AMTAR%g
17545 s%@AWK@%$AWK%g
17546 s%@AMTARFLAGS@%$AMTARFLAGS%g
17547 s%@SET_MAKE@%$SET_MAKE%g
17548 s%@top_builddir@%$top_builddir%g
17549 s%@ldap_subdir@%$ldap_subdir%g
17550 s%@CC@%$CC%g
17551 s%@AR@%$AR%g
17552 s%@RANLIB@%$RANLIB%g
17553 s%@LN_S@%$LN_S%g
17554 s%@DLLTOOL@%$DLLTOOL%g
17555 s%@AS@%$AS%g
17556 s%@OBJDUMP@%$OBJDUMP%g
17557 s%@LIBTOOL@%$LIBTOOL%g
17558 s%@LN_H@%$LN_H%g
17559 s%@SENDMAIL@%$SENDMAIL%g
17560 s%@EDITOR@%$EDITOR%g
17561 s%@FINGER@%$FINGER%g
17562 s%@CPP@%$CPP%g
17563 s%@EXEEXT@%$EXEEXT%g
17564 s%@OBJEXT@%$OBJEXT%g
17565 s%@OL_MKDEP@%$OL_MKDEP%g
17566 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17567 s%@LIBOBJS@%$LIBOBJS%g
17568 s%@LIBSRCS@%$LIBSRCS%g
17569 s%@PLAT@%$PLAT%g
17570 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17571 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17572 s%@DYN_EXT@%$DYN_EXT%g
17573 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17574 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17575 s%@BUILD_LDAP@%$BUILD_LDAP%g
17576 s%@BUILD_LDBM@%$BUILD_LDBM%g
17577 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17578 s%@BUILD_SHELL@%$BUILD_SHELL%g
17579 s%@BUILD_SQL@%$BUILD_SQL%g
17580 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17581 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17582 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17583 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17584 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17585 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17586 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17587 s%@LDAP_LIBS@%$LDAP_LIBS%g
17588 s%@LDIF_LIBS@%$LDIF_LIBS%g
17589 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17590 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17591 s%@LDBM_LIBS@%$LDBM_LIBS%g
17592 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17593 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17594 s%@WRAP_LIBS@%$WRAP_LIBS%g
17595 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17596 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17597 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17598 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17599 s%@KRB4_LIBS@%$KRB4_LIBS%g
17600 s%@KRB5_LIBS@%$KRB5_LIBS%g
17601 s%@READLINE_LIBS@%$READLINE_LIBS%g
17602 s%@SASL_LIBS@%$SASL_LIBS%g
17603 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17604 s%@TLS_LIBS@%$TLS_LIBS%g
17605 s%@MODULES_LIBS@%$MODULES_LIBS%g
17606 s%@AUTH_LIBS@%$AUTH_LIBS%g
17607 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17608 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17609 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17610
17611 CEOF
17612 EOF
17613
17614 cat >> $CONFIG_STATUS <<\EOF
17615
17616 # Split the substitutions into bite-sized pieces for seds with
17617 # small command number limits, like on Digital OSF/1 and HP-UX.
17618 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17619 ac_file=1 # Number of current file.
17620 ac_beg=1 # First line for current file.
17621 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17622 ac_more_lines=:
17623 ac_sed_cmds=""
17624 while $ac_more_lines; do
17625   if test $ac_beg -gt 1; then
17626     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17627   else
17628     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17629   fi
17630   if test ! -s conftest.s$ac_file; then
17631     ac_more_lines=false
17632     rm -f conftest.s$ac_file
17633   else
17634     if test -z "$ac_sed_cmds"; then
17635       ac_sed_cmds="sed -f conftest.s$ac_file"
17636     else
17637       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17638     fi
17639     ac_file=`expr $ac_file + 1`
17640     ac_beg=$ac_end
17641     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17642   fi
17643 done
17644 if test -z "$ac_sed_cmds"; then
17645   ac_sed_cmds=cat
17646 fi
17647 EOF
17648
17649 cat >> $CONFIG_STATUS <<EOF
17650
17651 CONFIG_FILES=\${CONFIG_FILES-"\
17652 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17653 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17654 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17655 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17656 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17657 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17658 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17659 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17660 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17661 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17662 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17663 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17664 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17665 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17666 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17667 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17668 include/Makefile:build/top.mk:include/Makefile.in \
17669 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17670 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17671 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17672 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17673 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17674 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17675 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17676 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17677 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17678 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17679 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17680 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17681 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17682 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17683 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17684 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17685 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17686 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17687 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17688 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17689 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17690 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17691 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17692 "}
17693 EOF
17694 cat >> $CONFIG_STATUS <<\EOF
17695 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17696   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17697   case "$ac_file" in
17698   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17699        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17700   *) ac_file_in="${ac_file}.in" ;;
17701   esac
17702
17703   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17704
17705   # Remove last slash and all that follows it.  Not all systems have dirname.
17706   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17707   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17708     # The file is in a subdirectory.
17709     test ! -d "$ac_dir" && mkdir "$ac_dir"
17710     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17711     # A "../" for each directory in $ac_dir_suffix.
17712     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17713   else
17714     ac_dir_suffix= ac_dots=
17715   fi
17716
17717   case "$ac_given_srcdir" in
17718   .)  srcdir=.
17719       if test -z "$ac_dots"; then top_srcdir=.
17720       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17721   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17722   *) # Relative path.
17723     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17724     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17725   esac
17726
17727   case "$ac_given_INSTALL" in
17728   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17729   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17730   esac
17731
17732   echo creating "$ac_file"
17733   rm -f "$ac_file"
17734   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17735   case "$ac_file" in
17736   *[Mm]akefile*) ac_comsub="1i\\
17737 # $configure_input" ;;
17738   *) ac_comsub= ;;
17739   esac
17740
17741   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17742   sed -e "$ac_comsub
17743 s%@configure_input@%$configure_input%g
17744 s%@srcdir@%$srcdir%g
17745 s%@top_srcdir@%$top_srcdir%g
17746 s%@INSTALL@%$INSTALL%g
17747 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17748 fi; done
17749 rm -f conftest.s*
17750
17751 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17752 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17753 #
17754 # ac_d sets the value in "#define NAME VALUE" lines.
17755 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17756 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17757 ac_dC='\3'
17758 ac_dD='%g'
17759 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17760 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17761 ac_uB='\([      ]\)%\1#\2define\3'
17762 ac_uC=' '
17763 ac_uD='\4%g'
17764 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17765 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17766 ac_eB='$%\1#\2define\3'
17767 ac_eC=' '
17768 ac_eD='%g'
17769
17770 if test "${CONFIG_HEADERS+set}" != set; then
17771 EOF
17772 cat >> $CONFIG_STATUS <<EOF
17773   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17774 EOF
17775 cat >> $CONFIG_STATUS <<\EOF
17776 fi
17777 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17778   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17779   case "$ac_file" in
17780   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17781        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17782   *) ac_file_in="${ac_file}.in" ;;
17783   esac
17784
17785   echo creating $ac_file
17786
17787   rm -f conftest.frag conftest.in conftest.out
17788   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17789   cat $ac_file_inputs > conftest.in
17790
17791 EOF
17792
17793 # Transform confdefs.h into a sed script conftest.vals that substitutes
17794 # the proper values into config.h.in to produce config.h.  And first:
17795 # Protect against being on the right side of a sed subst in config.status.
17796 # Protect against being in an unquoted here document in config.status.
17797 rm -f conftest.vals
17798 cat > conftest.hdr <<\EOF
17799 s/[\\&%]/\\&/g
17800 s%[\\$`]%\\&%g
17801 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17802 s%ac_d%ac_u%gp
17803 s%ac_u%ac_e%gp
17804 EOF
17805 sed -n -f conftest.hdr confdefs.h > conftest.vals
17806 rm -f conftest.hdr
17807
17808 # This sed command replaces #undef with comments.  This is necessary, for
17809 # example, in the case of _POSIX_SOURCE, which is predefined and required
17810 # on some systems where configure will not decide to define it.
17811 cat >> conftest.vals <<\EOF
17812 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17813 EOF
17814
17815 # Break up conftest.vals because some shells have a limit on
17816 # the size of here documents, and old seds have small limits too.
17817
17818 rm -f conftest.tail
17819 while :
17820 do
17821   ac_lines=`grep -c . conftest.vals`
17822   # grep -c gives empty output for an empty file on some AIX systems.
17823   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17824   # Write a limited-size here document to conftest.frag.
17825   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17826   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17827   echo 'CEOF
17828   sed -f conftest.frag conftest.in > conftest.out
17829   rm -f conftest.in
17830   mv conftest.out conftest.in
17831 ' >> $CONFIG_STATUS
17832   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17833   rm -f conftest.vals
17834   mv conftest.tail conftest.vals
17835 done
17836 rm -f conftest.vals
17837
17838 cat >> $CONFIG_STATUS <<\EOF
17839   rm -f conftest.frag conftest.h
17840   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17841   cat conftest.in >> conftest.h
17842   rm -f conftest.in
17843   if cmp -s $ac_file conftest.h 2>/dev/null; then
17844     echo "$ac_file is unchanged"
17845     rm -f conftest.h
17846   else
17847     # Remove last slash and all that follows it.  Not all systems have dirname.
17848       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17849       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17850       # The file is in a subdirectory.
17851       test ! -d "$ac_dir" && mkdir "$ac_dir"
17852     fi
17853     rm -f $ac_file
17854     mv conftest.h $ac_file
17855   fi
17856 fi; done
17857
17858 EOF
17859 cat >> $CONFIG_STATUS <<EOF
17860
17861 EOF
17862 cat >> $CONFIG_STATUS <<\EOF
17863
17864 date > stamp-h
17865 echo Please \"make depend\" to build dependencies
17866
17867 exit 0
17868 EOF
17869 chmod +x $CONFIG_STATUS
17870 rm -fr confdefs* $ac_clean_files
17871 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17872