]> git.sur5r.net Git - openldap/blob - configure
Suck in emfile/enfile changes for HEAD
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.34 2001/10/09 23:18:54 kurt Exp  
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted only as authorized by the OpenLDAP
9 # Public License.  A copy of this license is available at
10 # http://www.OpenLDAP.org/license.html or in file LICENSE in the
11 # top-level directory of the distribution.
12
13 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
14 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
15
16 # Guess values for system-dependent variables and create Makefiles.
17 # Generated automatically using autoconf version 2.13.1 
18 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
19 #
20 # This configure script is free software; the Free Software Foundation
21 # gives unlimited permission to copy, distribute and modify it.
22
23 # Defaults:
24 ac_help=
25 ac_default_prefix=/usr/local
26 # Any additions from configure.in:
27 ac_default_prefix=/usr/local
28 ac_help="$ac_help
29   --with-subdir=DIR       change default subdirectory used for installs"
30 ac_help="$ac_help
31   --enable-debug          enable debugging [yes]"
32 ac_help="$ac_help
33   --enable-syslog         enable syslog support [auto]"
34 ac_help="$ac_help
35   --enable-proctitle      enable proctitle support [yes]"
36 ac_help="$ac_help
37   --enable-cache          enable caching (experimental) [no]"
38 ac_help="$ac_help
39   --enable-referrals      enable LDAPv2+ Referrals (experimental) [no]"
40 ac_help="$ac_help
41   --enable-kbind          enable LDAPv2+ Kerberos IV bind (deprecated) [no]"
42 ac_help="$ac_help
43   --enable-ipv6           enable IPv6 support [auto]"
44 ac_help="$ac_help
45   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
46 ac_help="$ac_help
47   --enable-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 $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
2414
2415 # Check whether --enable-fast-install or --disable-fast-install was given.
2416 if test "${enable_fast_install+set}" = set; then
2417   enableval="$enable_fast_install"
2418   p=${PACKAGE-default}
2419 case "$enableval" in
2420 yes) enable_fast_install=yes ;;
2421 no) enable_fast_install=no ;;
2422 *)
2423   enable_fast_install=no
2424   # Look at the argument we got.  We use all the common list separators.
2425   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2426   for pkg in $enableval; do
2427     if test "X$pkg" = "X$p"; then
2428       enable_fast_install=yes
2429     fi
2430   done
2431   IFS="$ac_save_ifs"
2432   ;;
2433 esac
2434 else
2435   enable_fast_install=yes
2436 fi
2437
2438 # Extract the first word of "ranlib", so it can be a program name with args.
2439 set dummy ranlib; ac_word=$2
2440 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2441 echo "configure:2442: checking for $ac_word" >&5
2442 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2443   echo $ac_n "(cached) $ac_c" 1>&6
2444 else
2445   if test -n "$RANLIB"; then
2446   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2447 else
2448   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2449   ac_dummy="$PATH"
2450   for ac_dir in $ac_dummy; do
2451     test -z "$ac_dir" && ac_dir=.
2452     if test -f $ac_dir/$ac_word; then
2453       ac_cv_prog_RANLIB="ranlib"
2454       break
2455     fi
2456   done
2457   IFS="$ac_save_ifs"
2458   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2459 fi
2460 fi
2461 RANLIB="$ac_cv_prog_RANLIB"
2462 if test -n "$RANLIB"; then
2463   echo "$ac_t""$RANLIB" 1>&6
2464 else
2465   echo "$ac_t""no" 1>&6
2466 fi
2467
2468 # Extract the first word of "gcc", so it can be a program name with args.
2469 set dummy gcc; ac_word=$2
2470 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2471 echo "configure:2472: checking for $ac_word" >&5
2472 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2473   echo $ac_n "(cached) $ac_c" 1>&6
2474 else
2475   if test -n "$CC"; then
2476   ac_cv_prog_CC="$CC" # Let the user override the test.
2477 else
2478   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2479   ac_dummy="$PATH"
2480   for ac_dir in $ac_dummy; do
2481     test -z "$ac_dir" && ac_dir=.
2482     if test -f $ac_dir/$ac_word; then
2483       ac_cv_prog_CC="gcc"
2484       break
2485     fi
2486   done
2487   IFS="$ac_save_ifs"
2488 fi
2489 fi
2490 CC="$ac_cv_prog_CC"
2491 if test -n "$CC"; then
2492   echo "$ac_t""$CC" 1>&6
2493 else
2494   echo "$ac_t""no" 1>&6
2495 fi
2496
2497 if test -z "$CC"; then
2498   # Extract the first word of "cc", so it can be a program name with args.
2499 set dummy cc; ac_word=$2
2500 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2501 echo "configure:2502: checking for $ac_word" >&5
2502 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2503   echo $ac_n "(cached) $ac_c" 1>&6
2504 else
2505   if test -n "$CC"; then
2506   ac_cv_prog_CC="$CC" # Let the user override the test.
2507 else
2508   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2509   ac_prog_rejected=no
2510   ac_dummy="$PATH"
2511   for ac_dir in $ac_dummy; do
2512     test -z "$ac_dir" && ac_dir=.
2513     if test -f $ac_dir/$ac_word; then
2514       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2515         ac_prog_rejected=yes
2516         continue
2517       fi
2518       ac_cv_prog_CC="cc"
2519       break
2520     fi
2521   done
2522   IFS="$ac_save_ifs"
2523 if test $ac_prog_rejected = yes; then
2524   # We found a bogon in the path, so make sure we never use it.
2525   set dummy $ac_cv_prog_CC
2526   shift
2527   if test $# -gt 0; then
2528     # We chose a different compiler from the bogus one.
2529     # However, it has the same basename, so the bogon will be chosen
2530     # first if we set CC to just the basename; use the full file name.
2531     shift
2532     set dummy "$ac_dir/$ac_word" "$@"
2533     shift
2534     ac_cv_prog_CC="$@"
2535   fi
2536 fi
2537 fi
2538 fi
2539 CC="$ac_cv_prog_CC"
2540 if test -n "$CC"; then
2541   echo "$ac_t""$CC" 1>&6
2542 else
2543   echo "$ac_t""no" 1>&6
2544 fi
2545
2546   if test -z "$CC"; then
2547     case "`uname -s`" in
2548     *win32* | *WIN32* | *CYGWIN*)
2549       # Extract the first word of "cl", so it can be a program name with args.
2550 set dummy cl; ac_word=$2
2551 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2552 echo "configure:2553: checking for $ac_word" >&5
2553 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2554   echo $ac_n "(cached) $ac_c" 1>&6
2555 else
2556   if test -n "$CC"; then
2557   ac_cv_prog_CC="$CC" # Let the user override the test.
2558 else
2559   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2560   ac_dummy="$PATH"
2561   for ac_dir in $ac_dummy; do
2562     test -z "$ac_dir" && ac_dir=.
2563     if test -f $ac_dir/$ac_word; then
2564       ac_cv_prog_CC="cl"
2565       break
2566     fi
2567   done
2568   IFS="$ac_save_ifs"
2569 fi
2570 fi
2571 CC="$ac_cv_prog_CC"
2572 if test -n "$CC"; then
2573   echo "$ac_t""$CC" 1>&6
2574 else
2575   echo "$ac_t""no" 1>&6
2576 fi
2577  ;;
2578     esac
2579   fi
2580   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2581 fi
2582
2583 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2584 echo "configure:2585: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2585
2586 ac_ext=c
2587 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2588 ac_cpp='$CPP $CPPFLAGS'
2589 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2590 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2591 cross_compiling=$ac_cv_prog_cc_cross
2592
2593 cat > conftest.$ac_ext << EOF
2594
2595 #line 2596 "configure"
2596 #include "confdefs.h"
2597
2598 main(){return(0);}
2599 EOF
2600 if { (eval echo configure:2601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2601   ac_cv_prog_cc_works=yes
2602   # If we can't run a trivial program, we are probably using a cross compiler.
2603   if (./conftest; exit) 2>/dev/null; then
2604     ac_cv_prog_cc_cross=no
2605   else
2606     ac_cv_prog_cc_cross=yes
2607   fi
2608 else
2609   echo "configure: failed program was:" >&5
2610   cat conftest.$ac_ext >&5
2611   ac_cv_prog_cc_works=no
2612 fi
2613 rm -fr conftest*
2614 ac_ext=c
2615 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2616 ac_cpp='$CPP $CPPFLAGS'
2617 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2618 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2619 cross_compiling=$ac_cv_prog_cc_cross
2620
2621 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2622 if test $ac_cv_prog_cc_works = no; then
2623   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2624 fi
2625 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2626 echo "configure:2627: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2627 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2628 cross_compiling=$ac_cv_prog_cc_cross
2629
2630 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2631 echo "configure:2632: checking whether we are using GNU C" >&5
2632 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2633   echo $ac_n "(cached) $ac_c" 1>&6
2634 else
2635   cat > conftest.c <<EOF
2636 #ifdef __GNUC__
2637   yes;
2638 #endif
2639 EOF
2640 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2641   ac_cv_prog_gcc=yes
2642 else
2643   ac_cv_prog_gcc=no
2644 fi
2645 fi
2646
2647 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2648
2649 if test $ac_cv_prog_gcc = yes; then
2650   GCC=yes
2651 else
2652   GCC=
2653 fi
2654
2655 ac_test_CFLAGS="${CFLAGS+set}"
2656 ac_save_CFLAGS="$CFLAGS"
2657 CFLAGS=
2658 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2659 echo "configure:2660: checking whether ${CC-cc} accepts -g" >&5
2660 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2661   echo $ac_n "(cached) $ac_c" 1>&6
2662 else
2663   echo 'void f(){}' > conftest.c
2664 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2665   ac_cv_prog_cc_g=yes
2666 else
2667   ac_cv_prog_cc_g=no
2668 fi
2669 rm -f conftest*
2670
2671 fi
2672
2673 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2674 if test "$ac_test_CFLAGS" = set; then
2675   CFLAGS="$ac_save_CFLAGS"
2676 elif test $ac_cv_prog_cc_g = yes; then
2677   if test "$GCC" = yes; then
2678     CFLAGS="-g -O2"
2679   else
2680     CFLAGS="-g"
2681   fi
2682 else
2683   if test "$GCC" = yes; then
2684     CFLAGS="-O2"
2685   else
2686     CFLAGS=
2687   fi
2688 fi
2689
2690 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2691 if test "${with_gnu_ld+set}" = set; then
2692   withval="$with_gnu_ld"
2693   test "$withval" = no || with_gnu_ld=yes
2694 else
2695   with_gnu_ld=no
2696 fi
2697
2698 ac_prog=ld
2699 if test "$ac_cv_prog_gcc" = yes; then
2700   # Check if gcc -print-prog-name=ld gives a path.
2701   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2702 echo "configure:2703: checking for ld used by GCC" >&5
2703   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2704   case "$ac_prog" in
2705     # Accept absolute paths.
2706     [\\/]* | [A-Za-z]:[\\/]*)
2707       re_direlt='/[^/][^/]*/\.\./'
2708       # Canonicalize the path of ld
2709       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2710       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2711         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2712       done
2713       test -z "$LD" && LD="$ac_prog"
2714       ;;
2715   "")
2716     # If it fails, then pretend we aren't using GCC.
2717     ac_prog=ld
2718     ;;
2719   *)
2720     # If it is relative, then search for the first ld in PATH.
2721     with_gnu_ld=unknown
2722     ;;
2723   esac
2724 elif test "$with_gnu_ld" = yes; then
2725   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2726 echo "configure:2727: checking for GNU ld" >&5
2727 else
2728   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2729 echo "configure:2730: checking for non-GNU ld" >&5
2730 fi
2731 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2732   echo $ac_n "(cached) $ac_c" 1>&6
2733 else
2734   if test -z "$LD"; then
2735   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2736   for ac_dir in $PATH; do
2737     test -z "$ac_dir" && ac_dir=.
2738     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2739       ac_cv_path_LD="$ac_dir/$ac_prog"
2740       # Check to see if the program is GNU ld.  I'd rather use --version,
2741       # but apparently some GNU ld's only accept -v.
2742       # Break only if it was the GNU/non-GNU ld that we prefer.
2743       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2744         test "$with_gnu_ld" != no && break
2745       else
2746         test "$with_gnu_ld" != yes && break
2747       fi
2748     fi
2749   done
2750   IFS="$ac_save_ifs"
2751 else
2752   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2753 fi
2754 fi
2755
2756 LD="$ac_cv_path_LD"
2757 if test -n "$LD"; then
2758   echo "$ac_t""$LD" 1>&6
2759 else
2760   echo "$ac_t""no" 1>&6
2761 fi
2762 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2763 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2764 echo "configure:2765: checking if the linker ($LD) is GNU ld" >&5
2765 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2766   echo $ac_n "(cached) $ac_c" 1>&6
2767 else
2768   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2769 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2770   ac_cv_prog_gnu_ld=yes
2771 else
2772   ac_cv_prog_gnu_ld=no
2773 fi
2774 fi
2775
2776 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2777
2778
2779 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2780 echo "configure:2781: checking for BSD-compatible nm" >&5
2781 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2782   echo $ac_n "(cached) $ac_c" 1>&6
2783 else
2784   if test -n "$NM"; then
2785   # Let the user override the test.
2786   ac_cv_path_NM="$NM"
2787 else
2788   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2789   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2790     test -z "$ac_dir" && ac_dir=.
2791     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2792       # Check to see if the nm accepts a BSD-compat flag.
2793       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2794       #   nm: unknown option "B" ignored
2795       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2796         ac_cv_path_NM="$ac_dir/nm -B"
2797         break
2798       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2799         ac_cv_path_NM="$ac_dir/nm -p"
2800         break
2801       else
2802         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2803         continue # so that we can try to find one that supports BSD flags
2804       fi
2805     fi
2806   done
2807   IFS="$ac_save_ifs"
2808   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2809 fi
2810 fi
2811
2812 NM="$ac_cv_path_NM"
2813 echo "$ac_t""$NM" 1>&6
2814
2815 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2816 echo "configure:2817: checking whether ln -s works" >&5
2817 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2818   echo $ac_n "(cached) $ac_c" 1>&6
2819 else
2820   rm -f conftestdata
2821 if ln -s X conftestdata 2>/dev/null
2822 then
2823   rm -f conftestdata
2824   ac_cv_prog_LN_S="ln -s"
2825 else
2826   ac_cv_prog_LN_S=ln
2827 fi
2828 fi
2829 LN_S="$ac_cv_prog_LN_S"
2830 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2831   echo "$ac_t""yes" 1>&6
2832 else
2833   echo "$ac_t""no" 1>&6
2834 fi
2835
2836 if test $host != $build; then
2837   ac_tool_prefix=${host_alias}-
2838 else
2839   ac_tool_prefix=
2840 fi
2841
2842
2843 case "$target" in
2844 NONE) lt_target="$host" ;;
2845 *) lt_target="$target" ;;
2846 esac
2847
2848 # Check for any special flags to pass to ltconfig.
2849 libtool_flags="--cache-file=$cache_file"
2850 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2851 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2852 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2853 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2854 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2855 libtool_flags="$libtool_flags --enable-dlopen"
2856 libtool_flags="$libtool_flags --enable-win32-dll"
2857 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2858 if test "${enable_libtool_lock+set}" = set; then
2859   enableval="$enable_libtool_lock"
2860   :
2861 fi
2862
2863 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2864 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2865
2866 # Some flags need to be propagated to the compiler or linker for good
2867 # libtool support.
2868 case "$lt_target" in
2869 *-*-irix6*)
2870   # Find out which ABI we are using.
2871   echo '#line 2872 "configure"' > conftest.$ac_ext
2872   if { (eval echo configure:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2873     case "`/usr/bin/file conftest.o`" in
2874     *32-bit*)
2875       LD="${LD-ld} -32"
2876       ;;
2877     *N32*)
2878       LD="${LD-ld} -n32"
2879       ;;
2880     *64-bit*)
2881       LD="${LD-ld} -64"
2882       ;;
2883     esac
2884   fi
2885   rm -rf conftest*
2886   ;;
2887
2888 *-*-sco3.2v5*)
2889   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2890   SAVE_CFLAGS="$CFLAGS"
2891   CFLAGS="$CFLAGS -belf"
2892   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2893 echo "configure:2894: checking whether the C compiler needs -belf" >&5
2894 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2895   echo $ac_n "(cached) $ac_c" 1>&6
2896 else
2897   cat > conftest.$ac_ext <<EOF
2898 #line 2899 "configure"
2899 #include "confdefs.h"
2900
2901 int main() {
2902
2903 ; return 0; }
2904 EOF
2905 if { (eval echo configure:2906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2906   rm -rf conftest*
2907   lt_cv_cc_needs_belf=yes
2908 else
2909   echo "configure: failed program was:" >&5
2910   cat conftest.$ac_ext >&5
2911   rm -rf conftest*
2912   lt_cv_cc_needs_belf=no
2913 fi
2914 rm -f conftest*
2915 fi
2916
2917 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2918   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2919     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2920     CFLAGS="$SAVE_CFLAGS"
2921   fi
2922   ;;
2923
2924 *-*-cygwin* | *-*-mingw*)
2925   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2926 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2927 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2928 echo "configure:2929: checking for $ac_word" >&5
2929 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2930   echo $ac_n "(cached) $ac_c" 1>&6
2931 else
2932   if test -n "$DLLTOOL"; then
2933   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2934 else
2935   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2936   ac_dummy="$PATH"
2937   for ac_dir in $ac_dummy; do
2938     test -z "$ac_dir" && ac_dir=.
2939     if test -f $ac_dir/$ac_word; then
2940       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2941       break
2942     fi
2943   done
2944   IFS="$ac_save_ifs"
2945 fi
2946 fi
2947 DLLTOOL="$ac_cv_prog_DLLTOOL"
2948 if test -n "$DLLTOOL"; then
2949   echo "$ac_t""$DLLTOOL" 1>&6
2950 else
2951   echo "$ac_t""no" 1>&6
2952 fi
2953
2954
2955 if test -z "$ac_cv_prog_DLLTOOL"; then
2956 if test -n "$ac_tool_prefix"; then
2957   # Extract the first word of "dlltool", so it can be a program name with args.
2958 set dummy dlltool; ac_word=$2
2959 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2960 echo "configure:2961: checking for $ac_word" >&5
2961 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2962   echo $ac_n "(cached) $ac_c" 1>&6
2963 else
2964   if test -n "$DLLTOOL"; then
2965   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2966 else
2967   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2968   ac_dummy="$PATH"
2969   for ac_dir in $ac_dummy; do
2970     test -z "$ac_dir" && ac_dir=.
2971     if test -f $ac_dir/$ac_word; then
2972       ac_cv_prog_DLLTOOL="dlltool"
2973       break
2974     fi
2975   done
2976   IFS="$ac_save_ifs"
2977   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
2978 fi
2979 fi
2980 DLLTOOL="$ac_cv_prog_DLLTOOL"
2981 if test -n "$DLLTOOL"; then
2982   echo "$ac_t""$DLLTOOL" 1>&6
2983 else
2984   echo "$ac_t""no" 1>&6
2985 fi
2986
2987 else
2988   DLLTOOL="false"
2989 fi
2990 fi
2991
2992   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
2993 set dummy ${ac_tool_prefix}as; 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_AS+set}\" = set"; then
2997   echo $ac_n "(cached) $ac_c" 1>&6
2998 else
2999   if test -n "$AS"; then
3000   ac_cv_prog_AS="$AS" # 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_AS="${ac_tool_prefix}as"
3008       break
3009     fi
3010   done
3011   IFS="$ac_save_ifs"
3012 fi
3013 fi
3014 AS="$ac_cv_prog_AS"
3015 if test -n "$AS"; then
3016   echo "$ac_t""$AS" 1>&6
3017 else
3018   echo "$ac_t""no" 1>&6
3019 fi
3020
3021
3022 if test -z "$ac_cv_prog_AS"; then
3023 if test -n "$ac_tool_prefix"; then
3024   # Extract the first word of "as", so it can be a program name with args.
3025 set dummy as; ac_word=$2
3026 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3027 echo "configure:3028: checking for $ac_word" >&5
3028 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3029   echo $ac_n "(cached) $ac_c" 1>&6
3030 else
3031   if test -n "$AS"; then
3032   ac_cv_prog_AS="$AS" # Let the user override the test.
3033 else
3034   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3035   ac_dummy="$PATH"
3036   for ac_dir in $ac_dummy; do
3037     test -z "$ac_dir" && ac_dir=.
3038     if test -f $ac_dir/$ac_word; then
3039       ac_cv_prog_AS="as"
3040       break
3041     fi
3042   done
3043   IFS="$ac_save_ifs"
3044   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3045 fi
3046 fi
3047 AS="$ac_cv_prog_AS"
3048 if test -n "$AS"; then
3049   echo "$ac_t""$AS" 1>&6
3050 else
3051   echo "$ac_t""no" 1>&6
3052 fi
3053
3054 else
3055   AS="false"
3056 fi
3057 fi
3058
3059   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3060 set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+set}\" = set"; then
3064   echo $ac_n "(cached) $ac_c" 1>&6
3065 else
3066   if test -n "$OBJDUMP"; then
3067   ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump"
3075       break
3076     fi
3077   done
3078   IFS="$ac_save_ifs"
3079 fi
3080 fi
3081 OBJDUMP="$ac_cv_prog_OBJDUMP"
3082 if test -n "$OBJDUMP"; then
3083   echo "$ac_t""$OBJDUMP" 1>&6
3084 else
3085   echo "$ac_t""no" 1>&6
3086 fi
3087
3088
3089 if test -z "$ac_cv_prog_OBJDUMP"; then
3090 if test -n "$ac_tool_prefix"; then
3091   # Extract the first word of "objdump", so it can be a program name with args.
3092 set dummy objdump; ac_word=$2
3093 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3094 echo "configure:3095: checking for $ac_word" >&5
3095 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3096   echo $ac_n "(cached) $ac_c" 1>&6
3097 else
3098   if test -n "$OBJDUMP"; then
3099   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3100 else
3101   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3102   ac_dummy="$PATH"
3103   for ac_dir in $ac_dummy; do
3104     test -z "$ac_dir" && ac_dir=.
3105     if test -f $ac_dir/$ac_word; then
3106       ac_cv_prog_OBJDUMP="objdump"
3107       break
3108     fi
3109   done
3110   IFS="$ac_save_ifs"
3111   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3112 fi
3113 fi
3114 OBJDUMP="$ac_cv_prog_OBJDUMP"
3115 if test -n "$OBJDUMP"; then
3116   echo "$ac_t""$OBJDUMP" 1>&6
3117 else
3118   echo "$ac_t""no" 1>&6
3119 fi
3120
3121 else
3122   OBJDUMP="false"
3123 fi
3124 fi
3125
3126   ;;
3127
3128 esac
3129
3130
3131 # Save cache, so that ltconfig can load it
3132
3133
3134 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3135 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3136 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3137 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3138 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3139 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3140 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3141 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3142
3143 # Reload cache, that may have been modified by ltconfig
3144
3145
3146 # This can be used to rebuild libtool when needed
3147 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3148
3149 # Always use our own libtool.
3150 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3151
3152 # Redirect the config.log output again, so that the ltconfig log is not
3153 # clobbered by the next message.
3154 exec 5>>./config.log
3155
3156
3157 for ac_prog in mawk gawk nawk awk
3158 do
3159 # Extract the first word of "$ac_prog", so it can be a program name with args.
3160 set dummy $ac_prog; ac_word=$2
3161 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3162 echo "configure:3163: checking for $ac_word" >&5
3163 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3164   echo $ac_n "(cached) $ac_c" 1>&6
3165 else
3166   if test -n "$AWK"; then
3167   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3168 else
3169   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3170   ac_dummy="$PATH"
3171   for ac_dir in $ac_dummy; do
3172     test -z "$ac_dir" && ac_dir=.
3173     if test -f $ac_dir/$ac_word; then
3174       ac_cv_prog_AWK="$ac_prog"
3175       break
3176     fi
3177   done
3178   IFS="$ac_save_ifs"
3179 fi
3180 fi
3181 AWK="$ac_cv_prog_AWK"
3182 if test -n "$AWK"; then
3183   echo "$ac_t""$AWK" 1>&6
3184 else
3185   echo "$ac_t""no" 1>&6
3186 fi
3187
3188 test -n "$AWK" && break
3189 done
3190
3191 # test for ln hardlink support
3192 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3193 echo "configure:3194: checking whether ln works" >&5
3194 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3195   echo $ac_n "(cached) $ac_c" 1>&6
3196 else
3197   rm -f conftest.src conftest.dst
3198 echo "conftest" > conftest.src
3199 if ln conftest.src conftest.dst 2>/dev/null
3200 then
3201   ol_cv_prog_LN_H="ln"
3202 else
3203   ol_cv_prog_LN_H="cp"
3204 fi
3205 rm -f conftest.src conftest.dst
3206
3207 fi
3208 LN_H="$ol_cv_prog_LN_H"
3209 if test "$ol_cv_prog_LN_H" = "ln"; then
3210         echo "$ac_t""yes" 1>&6
3211 else
3212         echo "$ac_t""no" 1>&6
3213 fi
3214
3215 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3216 echo "configure:3217: checking whether ln -s works" >&5
3217 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3218   echo $ac_n "(cached) $ac_c" 1>&6
3219 else
3220   rm -f conftestdata
3221 if ln -s X conftestdata 2>/dev/null
3222 then
3223   rm -f conftestdata
3224   ac_cv_prog_LN_S="ln -s"
3225 else
3226   ac_cv_prog_LN_S=ln
3227 fi
3228 fi
3229 LN_S="$ac_cv_prog_LN_S"
3230 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3231   echo "$ac_t""yes" 1>&6
3232 else
3233   echo "$ac_t""no" 1>&6
3234 fi
3235
3236
3237 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3238         LN_S="$LN_H"
3239 fi
3240
3241 # Extract the first word of "sendmail", so it can be a program name with args.
3242 set dummy sendmail; ac_word=$2
3243 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3244 echo "configure:3245: checking for $ac_word" >&5
3245 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3246   echo $ac_n "(cached) $ac_c" 1>&6
3247 else
3248   case "$SENDMAIL" in
3249   /*)
3250   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3251   ;;
3252   ?:/*)
3253   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3254   ;;
3255   *)
3256   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3257   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3258   for ac_dir in $ac_dummy; do 
3259     test -z "$ac_dir" && ac_dir=.
3260     if test -f $ac_dir/$ac_word; then
3261       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3262       break
3263     fi
3264   done
3265   IFS="$ac_save_ifs"
3266   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3267   ;;
3268 esac
3269 fi
3270 SENDMAIL="$ac_cv_path_SENDMAIL"
3271 if test -n "$SENDMAIL"; then
3272   echo "$ac_t""$SENDMAIL" 1>&6
3273 else
3274   echo "$ac_t""no" 1>&6
3275 fi
3276
3277 # Extract the first word of "vi", so it can be a program name with args.
3278 set dummy vi; ac_word=$2
3279 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3280 echo "configure:3281: checking for $ac_word" >&5
3281 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3282   echo $ac_n "(cached) $ac_c" 1>&6
3283 else
3284   case "$EDITOR" in
3285   /*)
3286   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3287   ;;
3288   ?:/*)
3289   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3290   ;;
3291   *)
3292   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3293   ac_dummy="$PATH:/usr/ucb"
3294   for ac_dir in $ac_dummy; do 
3295     test -z "$ac_dir" && ac_dir=.
3296     if test -f $ac_dir/$ac_word; then
3297       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3298       break
3299     fi
3300   done
3301   IFS="$ac_save_ifs"
3302   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3303   ;;
3304 esac
3305 fi
3306 EDITOR="$ac_cv_path_EDITOR"
3307 if test -n "$EDITOR"; then
3308   echo "$ac_t""$EDITOR" 1>&6
3309 else
3310   echo "$ac_t""no" 1>&6
3311 fi
3312
3313 # Extract the first word of "finger", so it can be a program name with args.
3314 set dummy finger; ac_word=$2
3315 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3316 echo "configure:3317: checking for $ac_word" >&5
3317 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3318   echo $ac_n "(cached) $ac_c" 1>&6
3319 else
3320   case "$FINGER" in
3321   /*)
3322   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3323   ;;
3324   ?:/*)
3325   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3326   ;;
3327   *)
3328   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3329   ac_dummy="$PATH:/usr/ucb"
3330   for ac_dir in $ac_dummy; do 
3331     test -z "$ac_dir" && ac_dir=.
3332     if test -f $ac_dir/$ac_word; then
3333       ac_cv_path_FINGER="$ac_dir/$ac_word"
3334       break
3335     fi
3336   done
3337   IFS="$ac_save_ifs"
3338   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3339   ;;
3340 esac
3341 fi
3342 FINGER="$ac_cv_path_FINGER"
3343 if test -n "$FINGER"; then
3344   echo "$ac_t""$FINGER" 1>&6
3345 else
3346   echo "$ac_t""no" 1>&6
3347 fi
3348
3349
3350 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3351 echo "configure:3352: checking how to run the C preprocessor" >&5
3352 # On Suns, sometimes $CPP names a directory.
3353 if test -n "$CPP" && test -d "$CPP"; then
3354   CPP=
3355 fi
3356 if test -z "$CPP"; then
3357 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3358   echo $ac_n "(cached) $ac_c" 1>&6
3359 else
3360     # This must be in double quotes, not single quotes, because CPP may get
3361   # substituted into the Makefile and "${CC-cc}" will confuse make.
3362   CPP="${CC-cc} -E"
3363   # On the NeXT, cc -E runs the code through the compiler's parser,
3364   # not just through cpp.
3365   cat > conftest.$ac_ext <<EOF
3366 #line 3367 "configure"
3367 #include "confdefs.h"
3368 #include <assert.h>
3369 Syntax Error
3370 EOF
3371 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3372 { (eval echo configure:3373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3373 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3374 if test -z "$ac_err"; then
3375   :
3376 else
3377   echo "$ac_err" >&5
3378   echo "configure: failed program was:" >&5
3379   cat conftest.$ac_ext >&5
3380   rm -rf conftest*
3381   CPP="${CC-cc} -E -traditional-cpp"
3382   cat > conftest.$ac_ext <<EOF
3383 #line 3384 "configure"
3384 #include "confdefs.h"
3385 #include <assert.h>
3386 Syntax Error
3387 EOF
3388 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3389 { (eval echo configure:3390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3390 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3391 if test -z "$ac_err"; then
3392   :
3393 else
3394   echo "$ac_err" >&5
3395   echo "configure: failed program was:" >&5
3396   cat conftest.$ac_ext >&5
3397   rm -rf conftest*
3398   CPP="${CC-cc} -nologo -E"
3399   cat > conftest.$ac_ext <<EOF
3400 #line 3401 "configure"
3401 #include "confdefs.h"
3402 #include <assert.h>
3403 Syntax Error
3404 EOF
3405 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3406 { (eval echo configure:3407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3407 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3408 if test -z "$ac_err"; then
3409   :
3410 else
3411   echo "$ac_err" >&5
3412   echo "configure: failed program was:" >&5
3413   cat conftest.$ac_ext >&5
3414   rm -rf conftest*
3415   CPP=/lib/cpp
3416 fi
3417 rm -f conftest*
3418 fi
3419 rm -f conftest*
3420 fi
3421 rm -f conftest*
3422   ac_cv_prog_CPP="$CPP"
3423 fi
3424   CPP="$ac_cv_prog_CPP"
3425 else
3426   ac_cv_prog_CPP="$CPP"
3427 fi
3428 echo "$ac_t""$CPP" 1>&6
3429
3430
3431 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3432         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3433
3434 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3435         echo "configure: warning: programs compiled here do run here..." 1>&2
3436         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3437
3438 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3439         echo "configure: warning: programs compiled here do not run here..." 1>&2
3440         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3441 fi
3442
3443 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3444 echo "configure:3445: checking for AIX" >&5
3445 cat > conftest.$ac_ext <<EOF
3446 #line 3447 "configure"
3447 #include "confdefs.h"
3448 #ifdef _AIX
3449   yes
3450 #endif
3451
3452 EOF
3453 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3454   egrep "yes" >/dev/null 2>&1; then
3455   rm -rf conftest*
3456   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3457 #define _ALL_SOURCE 1
3458 EOF
3459
3460 else
3461   rm -rf conftest*
3462   echo "$ac_t""no" 1>&6
3463 fi
3464 rm -f conftest*
3465
3466
3467 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3468 echo "configure:3469: checking for POSIXized ISC" >&5
3469 if test -d /etc/conf/kconfig.d &&
3470   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3471 then
3472   echo "$ac_t""yes" 1>&6
3473   ISC=yes # If later tests want to check for ISC.
3474   cat >> confdefs.h <<\EOF
3475 #define _POSIX_SOURCE 1
3476 EOF
3477
3478   if test "$GCC" = yes; then
3479     CC="$CC -posix"
3480   else
3481     CC="$CC -Xp"
3482   fi
3483 else
3484   echo "$ac_t""no" 1>&6
3485   ISC=
3486 fi
3487
3488 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3489 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3490 echo "configure:3491: checking for minix/config.h" >&5
3491 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3492   echo $ac_n "(cached) $ac_c" 1>&6
3493 else
3494   cat > conftest.$ac_ext <<EOF
3495 #line 3496 "configure"
3496 #include "confdefs.h"
3497 #include <minix/config.h>
3498 EOF
3499 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3500 { (eval echo configure:3501: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3501 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3502 if test -z "$ac_err"; then
3503   rm -rf conftest*
3504   eval "ac_cv_header_$ac_safe=yes"
3505 else
3506   echo "$ac_err" >&5
3507   echo "configure: failed program was:" >&5
3508   cat conftest.$ac_ext >&5
3509   rm -rf conftest*
3510   eval "ac_cv_header_$ac_safe=no"
3511 fi
3512 rm -f conftest*
3513 fi
3514 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3515   echo "$ac_t""yes" 1>&6
3516   MINIX=yes
3517 else
3518   echo "$ac_t""no" 1>&6
3519 MINIX=
3520 fi
3521
3522 if test "$MINIX" = yes; then
3523   cat >> confdefs.h <<\EOF
3524 #define _POSIX_SOURCE 1
3525 EOF
3526
3527   cat >> confdefs.h <<\EOF
3528 #define _POSIX_1_SOURCE 2
3529 EOF
3530
3531   cat >> confdefs.h <<\EOF
3532 #define _MINIX 1
3533 EOF
3534
3535 fi
3536
3537
3538 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3539 echo "configure:3540: checking for Cygwin environment" >&5
3540 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3541   echo $ac_n "(cached) $ac_c" 1>&6
3542 else
3543   cat > conftest.$ac_ext <<EOF
3544 #line 3545 "configure"
3545 #include "confdefs.h"
3546
3547 int main() {
3548
3549 #ifndef __CYGWIN__
3550 #define __CYGWIN__ __CYGWIN32__
3551 #endif
3552 return __CYGWIN__;
3553 ; return 0; }
3554 EOF
3555 if { (eval echo configure:3556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3556   rm -rf conftest*
3557   ac_cv_cygwin=yes
3558 else
3559   echo "configure: failed program was:" >&5
3560   cat conftest.$ac_ext >&5
3561   rm -rf conftest*
3562   ac_cv_cygwin=no
3563 fi
3564 rm -f conftest*
3565 fi
3566
3567 echo "$ac_t""$ac_cv_cygwin" 1>&6
3568 CYGWIN=
3569 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3570 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3571 echo "configure:3572: checking for mingw32 environment" >&5
3572 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3573   echo $ac_n "(cached) $ac_c" 1>&6
3574 else
3575   cat > conftest.$ac_ext <<EOF
3576 #line 3577 "configure"
3577 #include "confdefs.h"
3578
3579 int main() {
3580 return __MINGW32__;
3581 ; return 0; }
3582 EOF
3583 if { (eval echo configure:3584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3584   rm -rf conftest*
3585   ac_cv_mingw32=yes
3586 else
3587   echo "configure: failed program was:" >&5
3588   cat conftest.$ac_ext >&5
3589   rm -rf conftest*
3590   ac_cv_mingw32=no
3591 fi
3592 rm -f conftest*
3593 fi
3594
3595 echo "$ac_t""$ac_cv_mingw32" 1>&6
3596 MINGW32=
3597 test "$ac_cv_mingw32" = yes && MINGW32=yes
3598 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3599 echo "configure:3600: checking for EMX OS/2 environment" >&5
3600 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3601   echo $ac_n "(cached) $ac_c" 1>&6
3602 else
3603   cat > conftest.$ac_ext <<EOF
3604 #line 3605 "configure"
3605 #include "confdefs.h"
3606
3607 int main() {
3608 return __EMX__;
3609 ; return 0; }
3610 EOF
3611 if { (eval echo configure:3612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3612   rm -rf conftest*
3613   ac_cv_emxos2=yes
3614 else
3615   echo "configure: failed program was:" >&5
3616   cat conftest.$ac_ext >&5
3617   rm -rf conftest*
3618   ac_cv_emxos2=no
3619 fi
3620 rm -f conftest*
3621 fi
3622
3623 echo "$ac_t""$ac_cv_emxos2" 1>&6
3624 EMXOS2=
3625 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3626
3627
3628
3629 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3630 echo "configure:3631: checking for executable suffix" >&5
3631 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3632   echo $ac_n "(cached) $ac_c" 1>&6
3633 else
3634   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3635   ac_cv_exeext=.exe
3636 else
3637   rm -f conftest*
3638   echo 'int main () { return 0; }' > conftest.$ac_ext
3639   ac_cv_exeext=
3640   if { (eval echo configure:3641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3641     for file in conftest.*; do
3642       case $file in
3643       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3644       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3645       esac
3646     done
3647   else
3648     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3649   fi
3650   rm -f conftest*
3651   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3652 fi
3653 fi
3654
3655 EXEEXT=""
3656 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3657 echo "$ac_t""${ac_cv_exeext}" 1>&6
3658 ac_exeext=$EXEEXT
3659
3660 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3661 echo "configure:3662: checking for object suffix" >&5
3662 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3663   echo $ac_n "(cached) $ac_c" 1>&6
3664 else
3665   rm -f conftest*
3666 echo 'int i = 1;' > conftest.$ac_ext
3667 if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3668   for ac_file in conftest.*; do
3669     case $ac_file in
3670     *.c) ;;
3671     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3672     esac
3673   done
3674 else
3675   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3676 fi
3677 rm -f conftest*
3678 fi
3679
3680 echo "$ac_t""$ac_cv_objext" 1>&6
3681 OBJEXT=$ac_cv_objext
3682 ac_objext=$ac_cv_objext
3683
3684
3685 cat >> confdefs.h <<EOF
3686 #define EXEEXT "${EXEEXT}"
3687 EOF
3688
3689
3690 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3691 echo "configure:3692: checking for be_app in -lbe" >&5
3692 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3693 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3694   echo $ac_n "(cached) $ac_c" 1>&6
3695 else
3696   ac_save_LIBS="$LIBS"
3697 LIBS="-lbe -lroot -lnet $LIBS"
3698 cat > conftest.$ac_ext <<EOF
3699 #line 3700 "configure"
3700 #include "confdefs.h"
3701 /* Override any gcc2 internal prototype to avoid an error.  */
3702 /* We use char because int might match the return type of a gcc2
3703     builtin and then its argument prototype would still apply.  */
3704 char be_app();
3705
3706 int main() {
3707 be_app()
3708 ; return 0; }
3709 EOF
3710 if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3711   rm -rf conftest*
3712   eval "ac_cv_lib_$ac_lib_var=yes"
3713 else
3714   echo "configure: failed program was:" >&5
3715   cat conftest.$ac_ext >&5
3716   rm -rf conftest*
3717   eval "ac_cv_lib_$ac_lib_var=no"
3718 fi
3719 rm -f conftest*
3720 LIBS="$ac_save_LIBS"
3721
3722 fi
3723 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3724   echo "$ac_t""yes" 1>&6
3725   LIBS="$LIBS -lbe -lroot -lnet"
3726 else
3727   echo "$ac_t""no" 1>&6
3728 :
3729 fi
3730
3731
3732
3733
3734
3735 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3736 echo "configure:3737: checking for ${CC-cc} option to accept ANSI C" >&5
3737 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3738   echo $ac_n "(cached) $ac_c" 1>&6
3739 else
3740   am_cv_prog_cc_stdc=no
3741 ac_save_CC="$CC"
3742 # Don't try gcc -ansi; that turns off useful extensions and
3743 # breaks some systems' header files.
3744 # AIX                   -qlanglvl=ansi
3745 # Ultrix and OSF/1      -std1
3746 # HP-UX 10.20 and later -Ae
3747 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3748 # SVR4                  -Xc -D__EXTENSIONS__
3749 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3750 do
3751   CC="$ac_save_CC $ac_arg"
3752   cat > conftest.$ac_ext <<EOF
3753 #line 3754 "configure"
3754 #include "confdefs.h"
3755 #include <stdarg.h>
3756 #include <stdio.h>
3757 #include <sys/types.h>
3758 #include <sys/stat.h>
3759 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3760 struct buf { int x; };
3761 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3762 static char *e (p, i)
3763      char **p;
3764      int i;
3765 {
3766   return p[i];
3767 }
3768 static char *f (char * (*g) (char **, int), char **p, ...)
3769 {
3770   char *s;
3771   va_list v;
3772   va_start (v,p);
3773   s = g (p, va_arg (v,int));
3774   va_end (v);
3775   return s;
3776 }
3777 int test (int i, double x);
3778 struct s1 {int (*f) (int a);};
3779 struct s2 {int (*f) (double a);};
3780 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3781 int argc;
3782 char **argv;
3783
3784 int main() {
3785
3786 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3787
3788 ; return 0; }
3789 EOF
3790 if { (eval echo configure:3791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3791   rm -rf conftest*
3792   am_cv_prog_cc_stdc="$ac_arg"; break
3793 else
3794   echo "configure: failed program was:" >&5
3795   cat conftest.$ac_ext >&5
3796 fi
3797 rm -f conftest*
3798 done
3799 CC="$ac_save_CC"
3800
3801 fi
3802
3803 if test -z "$am_cv_prog_cc_stdc"; then
3804   echo "$ac_t""none needed" 1>&6
3805 else
3806   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3807 fi
3808 case "x$am_cv_prog_cc_stdc" in
3809   x|xno) ;;
3810   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3811 esac
3812
3813 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3814         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3815 fi
3816
3817 # test for make depend flag
3818 OL_MKDEP=
3819 OL_MKDEP_FLAGS=
3820 if test -z "${MKDEP}"; then
3821         OL_MKDEP="${CC-cc}"
3822         if test -z "${MKDEP_FLAGS}"; then
3823                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3824 echo "configure:3825: checking for ${OL_MKDEP} depend flag" >&5
3825 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3826   echo $ac_n "(cached) $ac_c" 1>&6
3827 else
3828   
3829                         ol_cv_mkdep=no
3830                         for flag in "-M" "-xM"; do
3831                                 cat > conftest.c <<EOF
3832  noCode;
3833 EOF
3834                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3835                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3836                                 then
3837                                         if test ! -f conftest."${ac_object}" ; then
3838                                                 ol_cv_mkdep=$flag
3839                                                 OL_MKDEP_FLAGS="$flag"
3840                                                 break
3841                                         fi
3842                                 fi
3843                         done
3844                         rm -f conftest*
3845                 
3846 fi
3847
3848 echo "$ac_t""$ol_cv_mkdep" 1>&6
3849         else
3850                 cc_cv_mkdep=yes
3851                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3852         fi
3853 else
3854         cc_cv_mkdep=yes
3855         OL_MKDEP="${MKDEP}"
3856         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3857 fi
3858
3859
3860
3861 if test "${ol_cv_mkdep}" = no ; then
3862         # this will soon become an error
3863         echo "configure: warning: do not know how to generate dependencies" 1>&2
3864 fi
3865
3866 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3867 echo "configure:3868: checking for afopen in -ls" >&5
3868 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3869 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3870   echo $ac_n "(cached) $ac_c" 1>&6
3871 else
3872   ac_save_LIBS="$LIBS"
3873 LIBS="-ls  $LIBS"
3874 cat > conftest.$ac_ext <<EOF
3875 #line 3876 "configure"
3876 #include "confdefs.h"
3877 /* Override any gcc2 internal prototype to avoid an error.  */
3878 /* We use char because int might match the return type of a gcc2
3879     builtin and then its argument prototype would still apply.  */
3880 char afopen();
3881
3882 int main() {
3883 afopen()
3884 ; return 0; }
3885 EOF
3886 if { (eval echo configure:3887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3887   rm -rf conftest*
3888   eval "ac_cv_lib_$ac_lib_var=yes"
3889 else
3890   echo "configure: failed program was:" >&5
3891   cat conftest.$ac_ext >&5
3892   rm -rf conftest*
3893   eval "ac_cv_lib_$ac_lib_var=no"
3894 fi
3895 rm -f conftest*
3896 LIBS="$ac_save_LIBS"
3897
3898 fi
3899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3900   echo "$ac_t""yes" 1>&6
3901   
3902         AUTH_LIBS=-ls
3903         cat >> confdefs.h <<\EOF
3904 #define HAVE_AIX_SECURITY 1
3905 EOF
3906
3907
3908 else
3909   echo "$ac_t""no" 1>&6
3910 fi
3911
3912
3913
3914 ol_link_modules=no
3915 if test $ol_enable_modules != no ; then
3916         for ac_hdr in ltdl.h
3917 do
3918 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3919 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3920 echo "configure:3921: checking for $ac_hdr" >&5
3921 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3922   echo $ac_n "(cached) $ac_c" 1>&6
3923 else
3924   cat > conftest.$ac_ext <<EOF
3925 #line 3926 "configure"
3926 #include "confdefs.h"
3927 #include <$ac_hdr>
3928 EOF
3929 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3930 { (eval echo configure:3931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3931 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3932 if test -z "$ac_err"; then
3933   rm -rf conftest*
3934   eval "ac_cv_header_$ac_safe=yes"
3935 else
3936   echo "$ac_err" >&5
3937   echo "configure: failed program was:" >&5
3938   cat conftest.$ac_ext >&5
3939   rm -rf conftest*
3940   eval "ac_cv_header_$ac_safe=no"
3941 fi
3942 rm -f conftest*
3943 fi
3944 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3945   echo "$ac_t""yes" 1>&6
3946     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3947   cat >> confdefs.h <<EOF
3948 #define $ac_tr_hdr 1
3949 EOF
3950  
3951 else
3952   echo "$ac_t""no" 1>&6
3953 fi
3954 done
3955
3956
3957         if test $ac_cv_header_ltdl_h = no ; then
3958                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3959         fi
3960
3961         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3962 echo "configure:3963: checking for lt_dlinit in -lltdl" >&5
3963 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3964 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3965   echo $ac_n "(cached) $ac_c" 1>&6
3966 else
3967   ac_save_LIBS="$LIBS"
3968 LIBS="-lltdl  $LIBS"
3969 cat > conftest.$ac_ext <<EOF
3970 #line 3971 "configure"
3971 #include "confdefs.h"
3972 /* Override any gcc2 internal prototype to avoid an error.  */
3973 /* We use char because int might match the return type of a gcc2
3974     builtin and then its argument prototype would still apply.  */
3975 char lt_dlinit();
3976
3977 int main() {
3978 lt_dlinit()
3979 ; return 0; }
3980 EOF
3981 if { (eval echo configure:3982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3982   rm -rf conftest*
3983   eval "ac_cv_lib_$ac_lib_var=yes"
3984 else
3985   echo "configure: failed program was:" >&5
3986   cat conftest.$ac_ext >&5
3987   rm -rf conftest*
3988   eval "ac_cv_lib_$ac_lib_var=no"
3989 fi
3990 rm -f conftest*
3991 LIBS="$ac_save_LIBS"
3992
3993 fi
3994 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3995   echo "$ac_t""yes" 1>&6
3996   
3997             MODULES_LIBS=-lltdl
3998             cat >> confdefs.h <<\EOF
3999 #define HAVE_LIBLTDL 1
4000 EOF
4001
4002         
4003 else
4004   echo "$ac_t""no" 1>&6
4005 fi
4006
4007
4008         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4009                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4010         fi
4011         ol_link_modules=yes
4012 else
4013         ol_with_dnssrv_module=static
4014         ol_with_ldap_module=static
4015         ol_with_ldbm_module=static
4016         ol_with_passwd_module=static
4017         ol_with_shell_module=static
4018         ol_with_sql_module=static
4019 fi
4020
4021 # test for EBCDIC
4022 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4023 echo "configure:4024: checking for EBCDIC" >&5
4024 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4025   echo $ac_n "(cached) $ac_c" 1>&6
4026 else
4027   
4028         cat > conftest.$ac_ext <<EOF
4029 #line 4030 "configure"
4030 #include "confdefs.h"
4031
4032 #if !('M' == 0xd4)
4033 #include <__ASCII__/generate_error.h>
4034 #endif
4035
4036 EOF
4037 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4038 { (eval echo configure:4039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4039 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4040 if test -z "$ac_err"; then
4041   rm -rf conftest*
4042   ol_cv_cpp_ebcdic=yes
4043 else
4044   echo "$ac_err" >&5
4045   echo "configure: failed program was:" >&5
4046   cat conftest.$ac_ext >&5
4047   rm -rf conftest*
4048   ol_cv_cpp_ebcdic=no
4049 fi
4050 rm -f conftest*
4051 fi
4052
4053 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4054 if test $ol_cv_cpp_ebcdic = yes ; then
4055         cat >> confdefs.h <<\EOF
4056 #define HAVE_EBCDIC 1
4057 EOF
4058
4059 fi
4060
4061 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4062 echo "configure:4063: checking for ANSI C header files" >&5
4063 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4064   echo $ac_n "(cached) $ac_c" 1>&6
4065 else
4066   cat > conftest.$ac_ext <<EOF
4067 #line 4068 "configure"
4068 #include "confdefs.h"
4069 #include <stdlib.h>
4070 #include <stdarg.h>
4071 #include <string.h>
4072 #include <float.h>
4073 EOF
4074 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4075 { (eval echo configure:4076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4076 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4077 if test -z "$ac_err"; then
4078   rm -rf conftest*
4079   ol_cv_header_stdc=yes
4080 else
4081   echo "$ac_err" >&5
4082   echo "configure: failed program was:" >&5
4083   cat conftest.$ac_ext >&5
4084   rm -rf conftest*
4085   ol_cv_header_stdc=no
4086 fi
4087 rm -f conftest*
4088
4089 if test $ol_cv_header_stdc = yes; then
4090   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4091 cat > conftest.$ac_ext <<EOF
4092 #line 4093 "configure"
4093 #include "confdefs.h"
4094 #include <string.h>
4095 EOF
4096 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4097   egrep "memchr" >/dev/null 2>&1; then
4098   :
4099 else
4100   rm -rf conftest*
4101   ol_cv_header_stdc=no
4102 fi
4103 rm -f conftest*
4104
4105 fi
4106
4107 if test $ol_cv_header_stdc = yes; then
4108   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4109 cat > conftest.$ac_ext <<EOF
4110 #line 4111 "configure"
4111 #include "confdefs.h"
4112 #include <stdlib.h>
4113 EOF
4114 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4115   egrep "free" >/dev/null 2>&1; then
4116   :
4117 else
4118   rm -rf conftest*
4119   ol_cv_header_stdc=no
4120 fi
4121 rm -f conftest*
4122
4123 fi
4124
4125 if test $ol_cv_header_stdc = yes; then
4126   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4127 if test "$cross_compiling" = yes; then
4128   :
4129 else
4130   cat > conftest.$ac_ext <<EOF
4131 #line 4132 "configure"
4132 #include "confdefs.h"
4133 #include <ctype.h>
4134 #ifndef HAVE_EBCDIC
4135 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4136 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4137 #else
4138 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4139                 || ('j' <= (c) && (c) <= 'r') \
4140                 || ('s' <= (c) && (c) <= 'z'))
4141 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4142 #endif
4143 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4144 int main () { int i; for (i = 0; i < 256; i++)
4145 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4146 exit (0); }
4147
4148 EOF
4149 if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4150 then
4151   :
4152 else
4153   echo "configure: failed program was:" >&5
4154   cat conftest.$ac_ext >&5
4155   rm -fr conftest*
4156   ol_cv_header_stdc=no
4157 fi
4158 rm -fr conftest*
4159 fi
4160
4161 fi
4162 fi
4163
4164 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4165 if test $ol_cv_header_stdc = yes; then
4166   cat >> confdefs.h <<\EOF
4167 #define STDC_HEADERS 1
4168 EOF
4169
4170 fi
4171 ac_cv_header_stdc=disable
4172
4173
4174 if test $ol_cv_header_stdc != yes; then
4175         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4176 fi
4177
4178 ac_header_dirent=no
4179 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4180 do
4181 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4182 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4183 echo "configure:4184: checking for $ac_hdr that defines DIR" >&5
4184 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4185   echo $ac_n "(cached) $ac_c" 1>&6
4186 else
4187   cat > conftest.$ac_ext <<EOF
4188 #line 4189 "configure"
4189 #include "confdefs.h"
4190 #include <sys/types.h>
4191 #include <$ac_hdr>
4192 int main() {
4193 DIR *dirp = 0;
4194 ; return 0; }
4195 EOF
4196 if { (eval echo configure:4197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4197   rm -rf conftest*
4198   eval "ac_cv_header_dirent_$ac_safe=yes"
4199 else
4200   echo "configure: failed program was:" >&5
4201   cat conftest.$ac_ext >&5
4202   rm -rf conftest*
4203   eval "ac_cv_header_dirent_$ac_safe=no"
4204 fi
4205 rm -f conftest*
4206 fi
4207 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4208   echo "$ac_t""yes" 1>&6
4209     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4210   cat >> confdefs.h <<EOF
4211 #define $ac_tr_hdr 1
4212 EOF
4213  ac_header_dirent=$ac_hdr; break
4214 else
4215   echo "$ac_t""no" 1>&6
4216 fi
4217 done
4218 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4219 if test $ac_header_dirent = dirent.h; then
4220 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4221 echo "configure:4222: checking for opendir in -ldir" >&5
4222 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4223 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4224   echo $ac_n "(cached) $ac_c" 1>&6
4225 else
4226   ac_save_LIBS="$LIBS"
4227 LIBS="-ldir  $LIBS"
4228 cat > conftest.$ac_ext <<EOF
4229 #line 4230 "configure"
4230 #include "confdefs.h"
4231 /* Override any gcc2 internal prototype to avoid an error.  */
4232 /* We use char because int might match the return type of a gcc2
4233     builtin and then its argument prototype would still apply.  */
4234 char opendir();
4235
4236 int main() {
4237 opendir()
4238 ; return 0; }
4239 EOF
4240 if { (eval echo configure:4241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4241   rm -rf conftest*
4242   eval "ac_cv_lib_$ac_lib_var=yes"
4243 else
4244   echo "configure: failed program was:" >&5
4245   cat conftest.$ac_ext >&5
4246   rm -rf conftest*
4247   eval "ac_cv_lib_$ac_lib_var=no"
4248 fi
4249 rm -f conftest*
4250 LIBS="$ac_save_LIBS"
4251
4252 fi
4253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4254   echo "$ac_t""yes" 1>&6
4255   LIBS="$LIBS -ldir"
4256 else
4257   echo "$ac_t""no" 1>&6
4258 fi
4259
4260 else
4261 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4262 echo "configure:4263: checking for opendir in -lx" >&5
4263 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4264 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4265   echo $ac_n "(cached) $ac_c" 1>&6
4266 else
4267   ac_save_LIBS="$LIBS"
4268 LIBS="-lx  $LIBS"
4269 cat > conftest.$ac_ext <<EOF
4270 #line 4271 "configure"
4271 #include "confdefs.h"
4272 /* Override any gcc2 internal prototype to avoid an error.  */
4273 /* We use char because int might match the return type of a gcc2
4274     builtin and then its argument prototype would still apply.  */
4275 char opendir();
4276
4277 int main() {
4278 opendir()
4279 ; return 0; }
4280 EOF
4281 if { (eval echo configure:4282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4282   rm -rf conftest*
4283   eval "ac_cv_lib_$ac_lib_var=yes"
4284 else
4285   echo "configure: failed program was:" >&5
4286   cat conftest.$ac_ext >&5
4287   rm -rf conftest*
4288   eval "ac_cv_lib_$ac_lib_var=no"
4289 fi
4290 rm -f conftest*
4291 LIBS="$ac_save_LIBS"
4292
4293 fi
4294 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4295   echo "$ac_t""yes" 1>&6
4296   LIBS="$LIBS -lx"
4297 else
4298   echo "$ac_t""no" 1>&6
4299 fi
4300
4301 fi
4302
4303 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4304 echo "configure:4305: checking for sys/wait.h that is POSIX.1 compatible" >&5
4305 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4306   echo $ac_n "(cached) $ac_c" 1>&6
4307 else
4308   cat > conftest.$ac_ext <<EOF
4309 #line 4310 "configure"
4310 #include "confdefs.h"
4311 #include <sys/types.h>
4312 #include <sys/wait.h>
4313 #ifndef WEXITSTATUS
4314 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4315 #endif
4316 #ifndef WIFEXITED
4317 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4318 #endif
4319 int main() {
4320 int s;
4321 wait (&s);
4322 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4323 ; return 0; }
4324 EOF
4325 if { (eval echo configure:4326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4326   rm -rf conftest*
4327   ac_cv_header_sys_wait_h=yes
4328 else
4329   echo "configure: failed program was:" >&5
4330   cat conftest.$ac_ext >&5
4331   rm -rf conftest*
4332   ac_cv_header_sys_wait_h=no
4333 fi
4334 rm -f conftest*
4335 fi
4336
4337 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4338 if test $ac_cv_header_sys_wait_h = yes; then
4339   cat >> confdefs.h <<\EOF
4340 #define HAVE_SYS_WAIT_H 1
4341 EOF
4342
4343 fi
4344
4345 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4346 echo "configure:4347: checking POSIX termios" >&5
4347 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4348   echo $ac_n "(cached) $ac_c" 1>&6
4349 else
4350   cat > conftest.$ac_ext <<EOF
4351 #line 4352 "configure"
4352 #include "confdefs.h"
4353 #include <sys/types.h>
4354 #include <unistd.h>
4355 #include <termios.h>
4356 int main() {
4357 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4358    tcgetattr(0, 0);
4359 ; return 0; }
4360 EOF
4361 if { (eval echo configure:4362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4362   rm -rf conftest*
4363   am_cv_sys_posix_termios=yes
4364 else
4365   echo "configure: failed program was:" >&5
4366   cat conftest.$ac_ext >&5
4367   rm -rf conftest*
4368   am_cv_sys_posix_termios=no
4369 fi
4370 rm -f conftest*
4371 fi
4372
4373 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4374
4375
4376  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4377 echo "configure:4378: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4378 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4379   echo $ac_n "(cached) $ac_c" 1>&6
4380 else
4381   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4382
4383   gwinsz_in_termios_h=no
4384   if test $am_cv_sys_posix_termios = yes; then
4385     cat > conftest.$ac_ext <<EOF
4386 #line 4387 "configure"
4387 #include "confdefs.h"
4388 #include <sys/types.h>
4389 #     include <termios.h>
4390 #     ifdef TIOCGWINSZ
4391         yes
4392 #     endif
4393     
4394 EOF
4395 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4396   egrep "yes" >/dev/null 2>&1; then
4397   rm -rf conftest*
4398   gwinsz_in_termios_h=yes
4399 fi
4400 rm -f conftest*
4401
4402   fi
4403
4404   if test $gwinsz_in_termios_h = no; then
4405     cat > conftest.$ac_ext <<EOF
4406 #line 4407 "configure"
4407 #include "confdefs.h"
4408 #include <sys/types.h>
4409 #     include <sys/ioctl.h>
4410 #     ifdef TIOCGWINSZ
4411         yes
4412 #     endif
4413     
4414 EOF
4415 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4416   egrep "yes" >/dev/null 2>&1; then
4417   rm -rf conftest*
4418   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4419 fi
4420 rm -f conftest*
4421
4422   fi
4423   
4424 fi
4425
4426 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4427   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4428     cat >> confdefs.h <<\EOF
4429 #define GWINSZ_IN_SYS_IOCTL 1
4430 EOF
4431
4432   fi
4433
4434 if test $am_cv_sys_posix_termios = yes ; then
4435         cat >> confdefs.h <<\EOF
4436 #define HAVE_POSIX_TERMIOS 1
4437 EOF
4438
4439 fi
4440
4441 for ac_hdr in \
4442         arpa/inet.h             \
4443         arpa/nameser.h  \
4444         assert.h                \
4445         conio.h                 \
4446         crypt.h                 \
4447         direct.h                \
4448         errno.h                 \
4449         fcntl.h                 \
4450         filio.h                 \
4451         getopt.h                \
4452         grp.h                   \
4453         io.h                    \
4454         libutil.h               \
4455         limits.h                \
4456         locale.h                \
4457         netinet/tcp.h   \
4458         malloc.h                \
4459         memory.h                \
4460         psap.h                  \
4461         pwd.h                   \
4462         process.h               \
4463         resolv.h                \
4464         sgtty.h                 \
4465         shadow.h                \
4466         stddef.h                \
4467         string.h                \
4468         strings.h               \
4469         sysexits.h              \
4470         sys/file.h              \
4471         sys/filio.h             \
4472         sys/errno.h             \
4473         sys/ioctl.h             \
4474         sys/param.h             \
4475         sys/resource.h  \
4476         sys/select.h    \
4477         sys/socket.h    \
4478         sys/syslog.h    \
4479         sys/time.h              \
4480         sys/types.h             \
4481         syslog.h                \
4482         termios.h               \
4483         unistd.h                \
4484         winsock.h               \
4485
4486 do
4487 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4488 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4489 echo "configure:4490: checking for $ac_hdr" >&5
4490 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4491   echo $ac_n "(cached) $ac_c" 1>&6
4492 else
4493   cat > conftest.$ac_ext <<EOF
4494 #line 4495 "configure"
4495 #include "confdefs.h"
4496 #include <$ac_hdr>
4497 EOF
4498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4499 { (eval echo configure:4500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4501 if test -z "$ac_err"; then
4502   rm -rf conftest*
4503   eval "ac_cv_header_$ac_safe=yes"
4504 else
4505   echo "$ac_err" >&5
4506   echo "configure: failed program was:" >&5
4507   cat conftest.$ac_ext >&5
4508   rm -rf conftest*
4509   eval "ac_cv_header_$ac_safe=no"
4510 fi
4511 rm -f conftest*
4512 fi
4513 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4514   echo "$ac_t""yes" 1>&6
4515     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4516   cat >> confdefs.h <<EOF
4517 #define $ac_tr_hdr 1
4518 EOF
4519  
4520 else
4521   echo "$ac_t""no" 1>&6
4522 fi
4523 done
4524
4525
4526
4527
4528 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4529 echo "configure:4530: checking for dlopen" >&5
4530 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4531   echo $ac_n "(cached) $ac_c" 1>&6
4532 else
4533   cat > conftest.$ac_ext <<EOF
4534 #line 4535 "configure"
4535 #include "confdefs.h"
4536 /* System header to define __stub macros and hopefully few prototypes,
4537     which can conflict with char dlopen(); below.  */
4538 #include <assert.h>
4539 /* Override any gcc2 internal prototype to avoid an error.  */
4540 /* We use char because int might match the return type of a gcc2
4541     builtin and then its argument prototype would still apply.  */
4542 char dlopen();
4543 char (*f)();
4544
4545 int main() {
4546
4547 /* The GNU C library defines this for functions which it implements
4548     to always fail with ENOSYS.  Some functions are actually named
4549     something starting with __ and the normal name is an alias.  */
4550 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4551 choke me
4552 #else
4553 f = dlopen;
4554 #endif
4555
4556 ; return 0; }
4557 EOF
4558 if { (eval echo configure:4559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4559   rm -rf conftest*
4560   eval "ac_cv_func_dlopen=yes"
4561 else
4562   echo "configure: failed program was:" >&5
4563   cat conftest.$ac_ext >&5
4564   rm -rf conftest*
4565   eval "ac_cv_func_dlopen=no"
4566 fi
4567 rm -f conftest*
4568 fi
4569
4570 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4571   echo "$ac_t""yes" 1>&6
4572   :
4573 else
4574   echo "$ac_t""no" 1>&6
4575 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4576 echo "configure:4577: checking for dlopen in -ldl" >&5
4577 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4578 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4579   echo $ac_n "(cached) $ac_c" 1>&6
4580 else
4581   ac_save_LIBS="$LIBS"
4582 LIBS="-ldl  $LIBS"
4583 cat > conftest.$ac_ext <<EOF
4584 #line 4585 "configure"
4585 #include "confdefs.h"
4586 /* Override any gcc2 internal prototype to avoid an error.  */
4587 /* We use char because int might match the return type of a gcc2
4588     builtin and then its argument prototype would still apply.  */
4589 char dlopen();
4590
4591 int main() {
4592 dlopen()
4593 ; return 0; }
4594 EOF
4595 if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4596   rm -rf conftest*
4597   eval "ac_cv_lib_$ac_lib_var=yes"
4598 else
4599   echo "configure: failed program was:" >&5
4600   cat conftest.$ac_ext >&5
4601   rm -rf conftest*
4602   eval "ac_cv_lib_$ac_lib_var=no"
4603 fi
4604 rm -f conftest*
4605 LIBS="$ac_save_LIBS"
4606
4607 fi
4608 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4609   echo "$ac_t""yes" 1>&6
4610     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4611     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4612   cat >> confdefs.h <<EOF
4613 #define $ac_tr_lib 1
4614 EOF
4615
4616   LIBS="-ldl $LIBS"
4617
4618 else
4619   echo "$ac_t""no" 1>&6
4620 fi
4621
4622 fi
4623
4624
4625 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4626 echo "configure:4627: checking for sigset in -lV3" >&5
4627 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4628 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4629   echo $ac_n "(cached) $ac_c" 1>&6
4630 else
4631   ac_save_LIBS="$LIBS"
4632 LIBS="-lV3  $LIBS"
4633 cat > conftest.$ac_ext <<EOF
4634 #line 4635 "configure"
4635 #include "confdefs.h"
4636 /* Override any gcc2 internal prototype to avoid an error.  */
4637 /* We use char because int might match the return type of a gcc2
4638     builtin and then its argument prototype would still apply.  */
4639 char sigset();
4640
4641 int main() {
4642 sigset()
4643 ; return 0; }
4644 EOF
4645 if { (eval echo configure:4646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4646   rm -rf conftest*
4647   eval "ac_cv_lib_$ac_lib_var=yes"
4648 else
4649   echo "configure: failed program was:" >&5
4650   cat conftest.$ac_ext >&5
4651   rm -rf conftest*
4652   eval "ac_cv_lib_$ac_lib_var=no"
4653 fi
4654 rm -f conftest*
4655 LIBS="$ac_save_LIBS"
4656
4657 fi
4658 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4659   echo "$ac_t""yes" 1>&6
4660     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4661     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4662   cat >> confdefs.h <<EOF
4663 #define $ac_tr_lib 1
4664 EOF
4665
4666   LIBS="-lV3 $LIBS"
4667
4668 else
4669   echo "$ac_t""no" 1>&6
4670 fi
4671
4672
4673 if test $ac_cv_header_winsock_h = yes; then
4674         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4675 echo "configure:4676: checking for winsock" >&5
4676 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4677   echo $ac_n "(cached) $ac_c" 1>&6
4678 else
4679   cat > conftest.$ac_ext <<EOF
4680 #line 4681 "configure"
4681 #include "confdefs.h"
4682 #include <winsock.h>
4683 int main() {
4684
4685                         socket(0,0,0);
4686                         select(0,NULL,NULL,NULL,NULL);
4687                         closesocket(0);
4688                         gethostname(NULL,0);
4689         
4690 ; return 0; }
4691 EOF
4692 if { (eval echo configure:4693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4693   rm -rf conftest*
4694   ol_cv_winsock=yes
4695 else
4696   echo "configure: failed program was:" >&5
4697   cat conftest.$ac_ext >&5
4698   rm -rf conftest*
4699   ol_cv_winsock=no
4700 fi
4701 rm -f conftest*
4702 fi
4703
4704 echo "$ac_t""$ol_cv_winsock" 1>&6
4705
4706         if test $ol_cv_winsock = yes ; then
4707                 cat >> confdefs.h <<\EOF
4708 #define HAVE_WINSOCK 1
4709 EOF
4710
4711                 ac_cv_func_socket=yes
4712                 ac_cv_func_select=yes
4713                 ac_cv_func_closesocket=yes
4714                 ac_cv_func_gethostname=yes
4715         fi
4716 fi
4717
4718
4719 echo $ac_n "checking for socket""... $ac_c" 1>&6
4720 echo "configure:4721: checking for socket" >&5
4721 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4722   echo $ac_n "(cached) $ac_c" 1>&6
4723 else
4724   cat > conftest.$ac_ext <<EOF
4725 #line 4726 "configure"
4726 #include "confdefs.h"
4727 /* System header to define __stub macros and hopefully few prototypes,
4728     which can conflict with char socket(); below.  */
4729 #include <assert.h>
4730 /* Override any gcc2 internal prototype to avoid an error.  */
4731 /* We use char because int might match the return type of a gcc2
4732     builtin and then its argument prototype would still apply.  */
4733 char socket();
4734 char (*f)();
4735
4736 int main() {
4737
4738 /* The GNU C library defines this for functions which it implements
4739     to always fail with ENOSYS.  Some functions are actually named
4740     something starting with __ and the normal name is an alias.  */
4741 #if defined (__stub_socket) || defined (__stub___socket)
4742 choke me
4743 #else
4744 f = socket;
4745 #endif
4746
4747 ; return 0; }
4748 EOF
4749 if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4750   rm -rf conftest*
4751   eval "ac_cv_func_socket=yes"
4752 else
4753   echo "configure: failed program was:" >&5
4754   cat conftest.$ac_ext >&5
4755   rm -rf conftest*
4756   eval "ac_cv_func_socket=no"
4757 fi
4758 rm -f conftest*
4759 fi
4760
4761 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4762   echo "$ac_t""yes" 1>&6
4763   :
4764 else
4765   echo "$ac_t""no" 1>&6
4766         
4767         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4768 echo "configure:4769: checking for main in -lsocket" >&5
4769 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4770 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4771   echo $ac_n "(cached) $ac_c" 1>&6
4772 else
4773   ac_save_LIBS="$LIBS"
4774 LIBS="-lsocket  $LIBS"
4775 cat > conftest.$ac_ext <<EOF
4776 #line 4777 "configure"
4777 #include "confdefs.h"
4778
4779 int main() {
4780 main()
4781 ; return 0; }
4782 EOF
4783 if { (eval echo configure:4784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4784   rm -rf conftest*
4785   eval "ac_cv_lib_$ac_lib_var=yes"
4786 else
4787   echo "configure: failed program was:" >&5
4788   cat conftest.$ac_ext >&5
4789   rm -rf conftest*
4790   eval "ac_cv_lib_$ac_lib_var=no"
4791 fi
4792 rm -f conftest*
4793 LIBS="$ac_save_LIBS"
4794
4795 fi
4796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4797   echo "$ac_t""yes" 1>&6
4798     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4799     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4800   cat >> confdefs.h <<EOF
4801 #define $ac_tr_lib 1
4802 EOF
4803
4804   LIBS="-lsocket $LIBS"
4805
4806 else
4807   echo "$ac_t""no" 1>&6
4808 fi
4809
4810         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4811 echo "configure:4812: checking for main in -lnet" >&5
4812 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4813 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4814   echo $ac_n "(cached) $ac_c" 1>&6
4815 else
4816   ac_save_LIBS="$LIBS"
4817 LIBS="-lnet  $LIBS"
4818 cat > conftest.$ac_ext <<EOF
4819 #line 4820 "configure"
4820 #include "confdefs.h"
4821
4822 int main() {
4823 main()
4824 ; return 0; }
4825 EOF
4826 if { (eval echo configure:4827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4827   rm -rf conftest*
4828   eval "ac_cv_lib_$ac_lib_var=yes"
4829 else
4830   echo "configure: failed program was:" >&5
4831   cat conftest.$ac_ext >&5
4832   rm -rf conftest*
4833   eval "ac_cv_lib_$ac_lib_var=no"
4834 fi
4835 rm -f conftest*
4836 LIBS="$ac_save_LIBS"
4837
4838 fi
4839 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4840   echo "$ac_t""yes" 1>&6
4841     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4842     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4843   cat >> confdefs.h <<EOF
4844 #define $ac_tr_lib 1
4845 EOF
4846
4847   LIBS="-lnet $LIBS"
4848
4849 else
4850   echo "$ac_t""no" 1>&6
4851 fi
4852
4853         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4854 echo "configure:4855: checking for main in -lnsl_s" >&5
4855 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4856 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4857   echo $ac_n "(cached) $ac_c" 1>&6
4858 else
4859   ac_save_LIBS="$LIBS"
4860 LIBS="-lnsl_s  $LIBS"
4861 cat > conftest.$ac_ext <<EOF
4862 #line 4863 "configure"
4863 #include "confdefs.h"
4864
4865 int main() {
4866 main()
4867 ; return 0; }
4868 EOF
4869 if { (eval echo configure:4870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4870   rm -rf conftest*
4871   eval "ac_cv_lib_$ac_lib_var=yes"
4872 else
4873   echo "configure: failed program was:" >&5
4874   cat conftest.$ac_ext >&5
4875   rm -rf conftest*
4876   eval "ac_cv_lib_$ac_lib_var=no"
4877 fi
4878 rm -f conftest*
4879 LIBS="$ac_save_LIBS"
4880
4881 fi
4882 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4883   echo "$ac_t""yes" 1>&6
4884     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4885     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4886   cat >> confdefs.h <<EOF
4887 #define $ac_tr_lib 1
4888 EOF
4889
4890   LIBS="-lnsl_s $LIBS"
4891
4892 else
4893   echo "$ac_t""no" 1>&6
4894 fi
4895
4896         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4897 echo "configure:4898: checking for main in -lnsl" >&5
4898 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4899 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4900   echo $ac_n "(cached) $ac_c" 1>&6
4901 else
4902   ac_save_LIBS="$LIBS"
4903 LIBS="-lnsl  $LIBS"
4904 cat > conftest.$ac_ext <<EOF
4905 #line 4906 "configure"
4906 #include "confdefs.h"
4907
4908 int main() {
4909 main()
4910 ; return 0; }
4911 EOF
4912 if { (eval echo configure:4913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4913   rm -rf conftest*
4914   eval "ac_cv_lib_$ac_lib_var=yes"
4915 else
4916   echo "configure: failed program was:" >&5
4917   cat conftest.$ac_ext >&5
4918   rm -rf conftest*
4919   eval "ac_cv_lib_$ac_lib_var=no"
4920 fi
4921 rm -f conftest*
4922 LIBS="$ac_save_LIBS"
4923
4924 fi
4925 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4926   echo "$ac_t""yes" 1>&6
4927     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4928     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4929   cat >> confdefs.h <<EOF
4930 #define $ac_tr_lib 1
4931 EOF
4932
4933   LIBS="-lnsl $LIBS"
4934
4935 else
4936   echo "$ac_t""no" 1>&6
4937 fi
4938
4939         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4940 echo "configure:4941: checking for socket in -linet" >&5
4941 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4942 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4943   echo $ac_n "(cached) $ac_c" 1>&6
4944 else
4945   ac_save_LIBS="$LIBS"
4946 LIBS="-linet  $LIBS"
4947 cat > conftest.$ac_ext <<EOF
4948 #line 4949 "configure"
4949 #include "confdefs.h"
4950 /* Override any gcc2 internal prototype to avoid an error.  */
4951 /* We use char because int might match the return type of a gcc2
4952     builtin and then its argument prototype would still apply.  */
4953 char socket();
4954
4955 int main() {
4956 socket()
4957 ; return 0; }
4958 EOF
4959 if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4960   rm -rf conftest*
4961   eval "ac_cv_lib_$ac_lib_var=yes"
4962 else
4963   echo "configure: failed program was:" >&5
4964   cat conftest.$ac_ext >&5
4965   rm -rf conftest*
4966   eval "ac_cv_lib_$ac_lib_var=no"
4967 fi
4968 rm -f conftest*
4969 LIBS="$ac_save_LIBS"
4970
4971 fi
4972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4973   echo "$ac_t""yes" 1>&6
4974     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4975     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4976   cat >> confdefs.h <<EOF
4977 #define $ac_tr_lib 1
4978 EOF
4979
4980   LIBS="-linet $LIBS"
4981
4982 else
4983   echo "$ac_t""no" 1>&6
4984 fi
4985
4986         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4987 echo "configure:4988: checking for main in -lgen" >&5
4988 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4989 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4990   echo $ac_n "(cached) $ac_c" 1>&6
4991 else
4992   ac_save_LIBS="$LIBS"
4993 LIBS="-lgen  $LIBS"
4994 cat > conftest.$ac_ext <<EOF
4995 #line 4996 "configure"
4996 #include "confdefs.h"
4997
4998 int main() {
4999 main()
5000 ; return 0; }
5001 EOF
5002 if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5003   rm -rf conftest*
5004   eval "ac_cv_lib_$ac_lib_var=yes"
5005 else
5006   echo "configure: failed program was:" >&5
5007   cat conftest.$ac_ext >&5
5008   rm -rf conftest*
5009   eval "ac_cv_lib_$ac_lib_var=no"
5010 fi
5011 rm -f conftest*
5012 LIBS="$ac_save_LIBS"
5013
5014 fi
5015 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5016   echo "$ac_t""yes" 1>&6
5017     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5018     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5019   cat >> confdefs.h <<EOF
5020 #define $ac_tr_lib 1
5021 EOF
5022
5023   LIBS="-lgen $LIBS"
5024
5025 else
5026   echo "$ac_t""no" 1>&6
5027 fi
5028
5029
5030 fi
5031
5032
5033 echo $ac_n "checking for select""... $ac_c" 1>&6
5034 echo "configure:5035: checking for select" >&5
5035 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5036   echo $ac_n "(cached) $ac_c" 1>&6
5037 else
5038   cat > conftest.$ac_ext <<EOF
5039 #line 5040 "configure"
5040 #include "confdefs.h"
5041 /* System header to define __stub macros and hopefully few prototypes,
5042     which can conflict with char select(); below.  */
5043 #include <assert.h>
5044 /* Override any gcc2 internal prototype to avoid an error.  */
5045 /* We use char because int might match the return type of a gcc2
5046     builtin and then its argument prototype would still apply.  */
5047 char select();
5048 char (*f)();
5049
5050 int main() {
5051
5052 /* The GNU C library defines this for functions which it implements
5053     to always fail with ENOSYS.  Some functions are actually named
5054     something starting with __ and the normal name is an alias.  */
5055 #if defined (__stub_select) || defined (__stub___select)
5056 choke me
5057 #else
5058 f = select;
5059 #endif
5060
5061 ; return 0; }
5062 EOF
5063 if { (eval echo configure:5064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5064   rm -rf conftest*
5065   eval "ac_cv_func_select=yes"
5066 else
5067   echo "configure: failed program was:" >&5
5068   cat conftest.$ac_ext >&5
5069   rm -rf conftest*
5070   eval "ac_cv_func_select=no"
5071 fi
5072 rm -f conftest*
5073 fi
5074
5075 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5076   echo "$ac_t""yes" 1>&6
5077   :
5078 else
5079   echo "$ac_t""no" 1>&6
5080 { echo "configure: error: select() required." 1>&2; exit 1; }
5081 fi
5082
5083
5084 if test "${ac_cv_header_winsock_h}" != yes; then
5085                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5086 echo "configure:5087: checking types of arguments for select()" >&5
5087  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5088   echo $ac_n "(cached) $ac_c" 1>&6
5089 else
5090    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5091   echo $ac_n "(cached) $ac_c" 1>&6
5092 else
5093     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5094   echo $ac_n "(cached) $ac_c" 1>&6
5095 else
5096      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5097      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5098       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5099        cat > conftest.$ac_ext <<EOF
5100 #line 5101 "configure"
5101 #include "confdefs.h"
5102 #ifdef HAVE_SYS_TYPES_H
5103 #include <sys/types.h>
5104 #endif
5105 #ifdef HAVE_SYS_TIME_H
5106 #include <sys/time.h>
5107 #endif
5108 #ifdef HAVE_SYS_SELECT_H
5109 #include <sys/select.h>
5110 #endif
5111 #ifdef HAVE_SYS_SOCKET_H
5112 #include <sys/socket.h>
5113 #endif
5114 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);
5115 int main() {
5116
5117 ; return 0; }
5118 EOF
5119 if { (eval echo configure:5120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5120   rm -rf conftest*
5121           ac_not_found=no ; break 3
5122 else
5123   echo "configure: failed program was:" >&5
5124   cat conftest.$ac_ext >&5
5125   rm -rf conftest*
5126   ac_not_found=yes
5127 fi
5128 rm -f conftest*
5129       done
5130      done
5131     done
5132    
5133 fi
5134   
5135 fi
5136  
5137 fi
5138  if test "$ac_not_found" = yes; then
5139   ac_cv_func_select_arg1=int 
5140   ac_cv_func_select_arg234='int *' 
5141   ac_cv_func_select_arg5='struct timeval *'
5142  fi
5143  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5144  cat >> confdefs.h <<EOF
5145 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5146 EOF
5147
5148  cat >> confdefs.h <<EOF
5149 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5150 EOF
5151
5152  cat >> confdefs.h <<EOF
5153 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5154 EOF
5155
5156
5157 fi
5158
5159
5160 for ac_hdr in regex.h 
5161 do
5162 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5163 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5164 echo "configure:5165: checking for $ac_hdr" >&5
5165 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5166   echo $ac_n "(cached) $ac_c" 1>&6
5167 else
5168   cat > conftest.$ac_ext <<EOF
5169 #line 5170 "configure"
5170 #include "confdefs.h"
5171 #include <$ac_hdr>
5172 EOF
5173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5174 { (eval echo configure:5175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5176 if test -z "$ac_err"; then
5177   rm -rf conftest*
5178   eval "ac_cv_header_$ac_safe=yes"
5179 else
5180   echo "$ac_err" >&5
5181   echo "configure: failed program was:" >&5
5182   cat conftest.$ac_ext >&5
5183   rm -rf conftest*
5184   eval "ac_cv_header_$ac_safe=no"
5185 fi
5186 rm -f conftest*
5187 fi
5188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5189   echo "$ac_t""yes" 1>&6
5190     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5191   cat >> confdefs.h <<EOF
5192 #define $ac_tr_hdr 1
5193 EOF
5194  
5195 else
5196   echo "$ac_t""no" 1>&6
5197 fi
5198 done
5199
5200 if test "$ac_cv_header_regex_h" != yes ; then
5201         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5202 fi
5203 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5204 echo "configure:5205: checking for regfree" >&5
5205 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5206   echo $ac_n "(cached) $ac_c" 1>&6
5207 else
5208   cat > conftest.$ac_ext <<EOF
5209 #line 5210 "configure"
5210 #include "confdefs.h"
5211 /* System header to define __stub macros and hopefully few prototypes,
5212     which can conflict with char regfree(); below.  */
5213 #include <assert.h>
5214 /* Override any gcc2 internal prototype to avoid an error.  */
5215 /* We use char because int might match the return type of a gcc2
5216     builtin and then its argument prototype would still apply.  */
5217 char regfree();
5218 char (*f)();
5219
5220 int main() {
5221
5222 /* The GNU C library defines this for functions which it implements
5223     to always fail with ENOSYS.  Some functions are actually named
5224     something starting with __ and the normal name is an alias.  */
5225 #if defined (__stub_regfree) || defined (__stub___regfree)
5226 choke me
5227 #else
5228 f = regfree;
5229 #endif
5230
5231 ; return 0; }
5232 EOF
5233 if { (eval echo configure:5234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5234   rm -rf conftest*
5235   eval "ac_cv_func_regfree=yes"
5236 else
5237   echo "configure: failed program was:" >&5
5238   cat conftest.$ac_ext >&5
5239   rm -rf conftest*
5240   eval "ac_cv_func_regfree=no"
5241 fi
5242 rm -f conftest*
5243 fi
5244
5245 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5246   echo "$ac_t""yes" 1>&6
5247   :
5248 else
5249   echo "$ac_t""no" 1>&6
5250 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5251 fi
5252
5253
5254
5255 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5256 echo "configure:5257: checking for compatible POSIX regex" >&5
5257 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5258   echo $ac_n "(cached) $ac_c" 1>&6
5259 else
5260   
5261         if test "$cross_compiling" = yes; then
5262   ol_cv_c_posix_regex=cross
5263 else
5264   cat > conftest.$ac_ext <<EOF
5265 #line 5266 "configure"
5266 #include "confdefs.h"
5267
5268 #include <sys/types.h>
5269 #include <regex.h>
5270 static char *pattern, *string;
5271 main()
5272 {
5273         int rc;
5274         regex_t re;
5275
5276         pattern = "^A";
5277
5278         if(regcomp(&re, pattern, 0)) {
5279                 return -1;
5280         }
5281         
5282         string = "ALL MATCH";
5283         
5284         rc = regexec(&re, string, 0, (void*)0, 0);
5285
5286         regfree(&re);
5287
5288         return rc;
5289 }
5290 EOF
5291 if { (eval echo configure:5292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5292 then
5293   ol_cv_c_posix_regex=yes
5294 else
5295   echo "configure: failed program was:" >&5
5296   cat conftest.$ac_ext >&5
5297   rm -fr conftest*
5298   ol_cv_c_posix_regex=no
5299 fi
5300 rm -fr conftest*
5301 fi
5302
5303 fi
5304
5305 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5306
5307 if test "$ol_cv_c_posix_regex" = no ; then
5308         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5309 fi
5310
5311 ol_link_dnssrv=no
5312 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5313 echo "configure:5314: checking for res_query" >&5
5314 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5315   echo $ac_n "(cached) $ac_c" 1>&6
5316 else
5317   cat > conftest.$ac_ext <<EOF
5318 #line 5319 "configure"
5319 #include "confdefs.h"
5320 /* System header to define __stub macros and hopefully few prototypes,
5321     which can conflict with char res_query(); below.  */
5322 #include <assert.h>
5323 /* Override any gcc2 internal prototype to avoid an error.  */
5324 /* We use char because int might match the return type of a gcc2
5325     builtin and then its argument prototype would still apply.  */
5326 char res_query();
5327 char (*f)();
5328
5329 int main() {
5330
5331 /* The GNU C library defines this for functions which it implements
5332     to always fail with ENOSYS.  Some functions are actually named
5333     something starting with __ and the normal name is an alias.  */
5334 #if defined (__stub_res_query) || defined (__stub___res_query)
5335 choke me
5336 #else
5337 f = res_query;
5338 #endif
5339
5340 ; return 0; }
5341 EOF
5342 if { (eval echo configure:5343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5343   rm -rf conftest*
5344   eval "ac_cv_func_res_query=yes"
5345 else
5346   echo "configure: failed program was:" >&5
5347   cat conftest.$ac_ext >&5
5348   rm -rf conftest*
5349   eval "ac_cv_func_res_query=no"
5350 fi
5351 rm -f conftest*
5352 fi
5353
5354 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5355   echo "$ac_t""yes" 1>&6
5356   :
5357 else
5358   echo "$ac_t""no" 1>&6
5359 fi
5360
5361 if test $ac_cv_func_res_query = no ; then 
5362         echo $ac_n "checking for __res_query""... $ac_c" 1>&6
5363 echo "configure:5364: checking for __res_query" >&5
5364 if eval "test \"\${ac_cv_func___res_query+set}\" = set"; then
5365   echo $ac_n "(cached) $ac_c" 1>&6
5366 else
5367   cat > conftest.$ac_ext <<EOF
5368 #line 5369 "configure"
5369 #include "confdefs.h"
5370 /* System header to define __stub macros and hopefully few prototypes,
5371     which can conflict with char __res_query(); below.  */
5372 #include <assert.h>
5373 /* Override any gcc2 internal prototype to avoid an error.  */
5374 /* We use char because int might match the return type of a gcc2
5375     builtin and then its argument prototype would still apply.  */
5376 char __res_query();
5377 char (*f)();
5378
5379 int main() {
5380
5381 /* The GNU C library defines this for functions which it implements
5382     to always fail with ENOSYS.  Some functions are actually named
5383     something starting with __ and the normal name is an alias.  */
5384 #if defined (__stub___res_query) || defined (__stub_____res_query)
5385 choke me
5386 #else
5387 f = __res_query;
5388 #endif
5389
5390 ; return 0; }
5391 EOF
5392 if { (eval echo configure:5393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5393   rm -rf conftest*
5394   eval "ac_cv_func___res_query=yes"
5395 else
5396   echo "configure: failed program was:" >&5
5397   cat conftest.$ac_ext >&5
5398   rm -rf conftest*
5399   eval "ac_cv_func___res_query=no"
5400 fi
5401 rm -f conftest*
5402 fi
5403
5404 if eval "test \"`echo '$ac_cv_func_'__res_query`\" = yes"; then
5405   echo "$ac_t""yes" 1>&6
5406   :
5407 else
5408   echo "$ac_t""no" 1>&6
5409 fi
5410
5411         ac_cv_func_res_query=$ac_cv_func___res_query
5412 fi
5413
5414 if test $ac_cv_func_res_query = no ; then 
5415         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5416 echo "configure:5417: checking for res_query in -lbind" >&5
5417 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5418 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5419   echo $ac_n "(cached) $ac_c" 1>&6
5420 else
5421   ac_save_LIBS="$LIBS"
5422 LIBS="-lbind  $LIBS"
5423 cat > conftest.$ac_ext <<EOF
5424 #line 5425 "configure"
5425 #include "confdefs.h"
5426 /* Override any gcc2 internal prototype to avoid an error.  */
5427 /* We use char because int might match the return type of a gcc2
5428     builtin and then its argument prototype would still apply.  */
5429 char res_query();
5430
5431 int main() {
5432 res_query()
5433 ; return 0; }
5434 EOF
5435 if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5436   rm -rf conftest*
5437   eval "ac_cv_lib_$ac_lib_var=yes"
5438 else
5439   echo "configure: failed program was:" >&5
5440   cat conftest.$ac_ext >&5
5441   rm -rf conftest*
5442   eval "ac_cv_lib_$ac_lib_var=no"
5443 fi
5444 rm -f conftest*
5445 LIBS="$ac_save_LIBS"
5446
5447 fi
5448 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5449   echo "$ac_t""yes" 1>&6
5450     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5451     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5452   cat >> confdefs.h <<EOF
5453 #define $ac_tr_lib 1
5454 EOF
5455
5456   LIBS="-lbind $LIBS"
5457
5458 else
5459   echo "$ac_t""no" 1>&6
5460 fi
5461
5462         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5463 fi
5464
5465 if test $ac_cv_func_res_query = no ; then 
5466         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5467 echo "configure:5468: checking for __res_query in -lbind" >&5
5468 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5469 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5470   echo $ac_n "(cached) $ac_c" 1>&6
5471 else
5472   ac_save_LIBS="$LIBS"
5473 LIBS="-lbind  $LIBS"
5474 cat > conftest.$ac_ext <<EOF
5475 #line 5476 "configure"
5476 #include "confdefs.h"
5477 /* Override any gcc2 internal prototype to avoid an error.  */
5478 /* We use char because int might match the return type of a gcc2
5479     builtin and then its argument prototype would still apply.  */
5480 char __res_query();
5481
5482 int main() {
5483 __res_query()
5484 ; return 0; }
5485 EOF
5486 if { (eval echo configure:5487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5487   rm -rf conftest*
5488   eval "ac_cv_lib_$ac_lib_var=yes"
5489 else
5490   echo "configure: failed program was:" >&5
5491   cat conftest.$ac_ext >&5
5492   rm -rf conftest*
5493   eval "ac_cv_lib_$ac_lib_var=no"
5494 fi
5495 rm -f conftest*
5496 LIBS="$ac_save_LIBS"
5497
5498 fi
5499 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5500   echo "$ac_t""yes" 1>&6
5501     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5502     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5503   cat >> confdefs.h <<EOF
5504 #define $ac_tr_lib 1
5505 EOF
5506
5507   LIBS="-lbind $LIBS"
5508
5509 else
5510   echo "$ac_t""no" 1>&6
5511 fi
5512
5513         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5514 fi
5515
5516 if test $ac_cv_func_res_query = no ; then 
5517         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5518 echo "configure:5519: checking for res_query in -lresolv" >&5
5519 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5520 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5521   echo $ac_n "(cached) $ac_c" 1>&6
5522 else
5523   ac_save_LIBS="$LIBS"
5524 LIBS="-lresolv  $LIBS"
5525 cat > conftest.$ac_ext <<EOF
5526 #line 5527 "configure"
5527 #include "confdefs.h"
5528 /* Override any gcc2 internal prototype to avoid an error.  */
5529 /* We use char because int might match the return type of a gcc2
5530     builtin and then its argument prototype would still apply.  */
5531 char res_query();
5532
5533 int main() {
5534 res_query()
5535 ; return 0; }
5536 EOF
5537 if { (eval echo configure:5538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5538   rm -rf conftest*
5539   eval "ac_cv_lib_$ac_lib_var=yes"
5540 else
5541   echo "configure: failed program was:" >&5
5542   cat conftest.$ac_ext >&5
5543   rm -rf conftest*
5544   eval "ac_cv_lib_$ac_lib_var=no"
5545 fi
5546 rm -f conftest*
5547 LIBS="$ac_save_LIBS"
5548
5549 fi
5550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5551   echo "$ac_t""yes" 1>&6
5552     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5553     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5554   cat >> confdefs.h <<EOF
5555 #define $ac_tr_lib 1
5556 EOF
5557
5558   LIBS="-lresolv $LIBS"
5559
5560 else
5561   echo "$ac_t""no" 1>&6
5562 fi
5563
5564         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5565 fi
5566
5567 if test $ac_cv_func_res_query = no ; then 
5568         echo $ac_n "checking for __res_query in -lresolv""... $ac_c" 1>&6
5569 echo "configure:5570: checking for __res_query in -lresolv" >&5
5570 ac_lib_var=`echo resolv'_'__res_query | sed 'y%./+-:%__p__%'`
5571 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5572   echo $ac_n "(cached) $ac_c" 1>&6
5573 else
5574   ac_save_LIBS="$LIBS"
5575 LIBS="-lresolv  $LIBS"
5576 cat > conftest.$ac_ext <<EOF
5577 #line 5578 "configure"
5578 #include "confdefs.h"
5579 /* Override any gcc2 internal prototype to avoid an error.  */
5580 /* We use char because int might match the return type of a gcc2
5581     builtin and then its argument prototype would still apply.  */
5582 char __res_query();
5583
5584 int main() {
5585 __res_query()
5586 ; return 0; }
5587 EOF
5588 if { (eval echo configure:5589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5589   rm -rf conftest*
5590   eval "ac_cv_lib_$ac_lib_var=yes"
5591 else
5592   echo "configure: failed program was:" >&5
5593   cat conftest.$ac_ext >&5
5594   rm -rf conftest*
5595   eval "ac_cv_lib_$ac_lib_var=no"
5596 fi
5597 rm -f conftest*
5598 LIBS="$ac_save_LIBS"
5599
5600 fi
5601 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5602   echo "$ac_t""yes" 1>&6
5603     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5604     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5605   cat >> confdefs.h <<EOF
5606 #define $ac_tr_lib 1
5607 EOF
5608
5609   LIBS="-lresolv $LIBS"
5610
5611 else
5612   echo "$ac_t""no" 1>&6
5613 fi
5614
5615         ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
5616 fi
5617
5618 if test "$ac_cv_func_res_query" = yes ; then
5619         cat >> confdefs.h <<\EOF
5620 #define HAVE_RES_QUERY 1
5621 EOF
5622
5623
5624         if test $ol_enable_dnssrv != no ; then
5625                 ol_link_dnssrv=yes
5626         fi
5627 fi
5628
5629 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5630         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5631 fi
5632
5633 for ac_func in getaddrinfo inet_ntop 
5634 do
5635 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5636 echo "configure:5637: checking for $ac_func" >&5
5637 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5638   echo $ac_n "(cached) $ac_c" 1>&6
5639 else
5640   cat > conftest.$ac_ext <<EOF
5641 #line 5642 "configure"
5642 #include "confdefs.h"
5643 /* System header to define __stub macros and hopefully few prototypes,
5644     which can conflict with char $ac_func(); below.  */
5645 #include <assert.h>
5646 /* Override any gcc2 internal prototype to avoid an error.  */
5647 /* We use char because int might match the return type of a gcc2
5648     builtin and then its argument prototype would still apply.  */
5649 char $ac_func();
5650 char (*f)();
5651
5652 int main() {
5653
5654 /* The GNU C library defines this for functions which it implements
5655     to always fail with ENOSYS.  Some functions are actually named
5656     something starting with __ and the normal name is an alias.  */
5657 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5658 choke me
5659 #else
5660 f = $ac_func;
5661 #endif
5662
5663 ; return 0; }
5664 EOF
5665 if { (eval echo configure:5666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5666   rm -rf conftest*
5667   eval "ac_cv_func_$ac_func=yes"
5668 else
5669   echo "configure: failed program was:" >&5
5670   cat conftest.$ac_ext >&5
5671   rm -rf conftest*
5672   eval "ac_cv_func_$ac_func=no"
5673 fi
5674 rm -f conftest*
5675 fi
5676
5677 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5678   echo "$ac_t""yes" 1>&6
5679     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5680   cat >> confdefs.h <<EOF
5681 #define $ac_tr_func 1
5682 EOF
5683  
5684 else
5685   echo "$ac_t""no" 1>&6
5686 fi
5687 done
5688
5689
5690 ol_link_ipv6=no
5691 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5692         if test $ol_enable_ipv6 = yes ; then
5693                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5694         fi
5695 else
5696         for ac_func in gai_strerror 
5697 do
5698 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5699 echo "configure:5700: checking for $ac_func" >&5
5700 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5701   echo $ac_n "(cached) $ac_c" 1>&6
5702 else
5703   cat > conftest.$ac_ext <<EOF
5704 #line 5705 "configure"
5705 #include "confdefs.h"
5706 /* System header to define __stub macros and hopefully few prototypes,
5707     which can conflict with char $ac_func(); below.  */
5708 #include <assert.h>
5709 /* Override any gcc2 internal prototype to avoid an error.  */
5710 /* We use char because int might match the return type of a gcc2
5711     builtin and then its argument prototype would still apply.  */
5712 char $ac_func();
5713 char (*f)();
5714
5715 int main() {
5716
5717 /* The GNU C library defines this for functions which it implements
5718     to always fail with ENOSYS.  Some functions are actually named
5719     something starting with __ and the normal name is an alias.  */
5720 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5721 choke me
5722 #else
5723 f = $ac_func;
5724 #endif
5725
5726 ; return 0; }
5727 EOF
5728 if { (eval echo configure:5729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5729   rm -rf conftest*
5730   eval "ac_cv_func_$ac_func=yes"
5731 else
5732   echo "configure: failed program was:" >&5
5733   cat conftest.$ac_ext >&5
5734   rm -rf conftest*
5735   eval "ac_cv_func_$ac_func=no"
5736 fi
5737 rm -f conftest*
5738 fi
5739
5740 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5741   echo "$ac_t""yes" 1>&6
5742     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5743   cat >> confdefs.h <<EOF
5744 #define $ac_tr_func 1
5745 EOF
5746  
5747 else
5748   echo "$ac_t""no" 1>&6
5749 fi
5750 done
5751
5752
5753         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5754 echo "configure:5755: checking INET6_ADDRSTRLEN" >&5
5755 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5756   echo $ac_n "(cached) $ac_c" 1>&6
5757 else
5758   
5759                 cat > conftest.$ac_ext <<EOF
5760 #line 5761 "configure"
5761 #include "confdefs.h"
5762
5763 #                       include <netinet/in.h>
5764 #                       ifdef INET6_ADDRSTRLEN
5765                                 __has_inet6_addrstrlen__;
5766 #                       endif
5767                 
5768 EOF
5769 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5770   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5771   rm -rf conftest*
5772   ol_cv_inet6_addrstrlen=yes
5773 else
5774   rm -rf conftest*
5775   ol_cv_inet6_addrstrlen=no
5776 fi
5777 rm -f conftest*
5778
5779 fi
5780
5781 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5782
5783         if test $ol_cv_inet6_addrstrlen = yes ; then
5784                 ol_link_ipv6=yes
5785         elif test $ol_enable_ipv6 = yes ; then
5786                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5787         fi
5788 fi
5789
5790 if test $ol_enable_local != no ; then
5791         for ac_hdr in sys/un.h 
5792 do
5793 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5794 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5795 echo "configure:5796: checking for $ac_hdr" >&5
5796 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5797   echo $ac_n "(cached) $ac_c" 1>&6
5798 else
5799   cat > conftest.$ac_ext <<EOF
5800 #line 5801 "configure"
5801 #include "confdefs.h"
5802 #include <$ac_hdr>
5803 EOF
5804 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5805 { (eval echo configure:5806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5806 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5807 if test -z "$ac_err"; then
5808   rm -rf conftest*
5809   eval "ac_cv_header_$ac_safe=yes"
5810 else
5811   echo "$ac_err" >&5
5812   echo "configure: failed program was:" >&5
5813   cat conftest.$ac_ext >&5
5814   rm -rf conftest*
5815   eval "ac_cv_header_$ac_safe=no"
5816 fi
5817 rm -f conftest*
5818 fi
5819 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5820   echo "$ac_t""yes" 1>&6
5821     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5822   cat >> confdefs.h <<EOF
5823 #define $ac_tr_hdr 1
5824 EOF
5825  
5826 else
5827   echo "$ac_t""no" 1>&6
5828 fi
5829 done
5830
5831
5832         if test $ol_enable_local = auto ; then
5833                 ol_enable_local=$ac_cv_header_sys_un_h
5834         elif test $ac_cv_header_sys_un_h = no ; then
5835                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5836         fi
5837 fi
5838
5839 ol_link_kbind=no
5840 ol_link_kpasswd=no
5841 ol_link_krb5=no
5842 ol_link_krb4=no
5843
5844 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5845         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5846         -o $ol_with_kerberos = k425 ; then
5847
5848         for ac_hdr in krb5.h
5849 do
5850 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5851 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5852 echo "configure:5853: checking for $ac_hdr" >&5
5853 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5854   echo $ac_n "(cached) $ac_c" 1>&6
5855 else
5856   cat > conftest.$ac_ext <<EOF
5857 #line 5858 "configure"
5858 #include "confdefs.h"
5859 #include <$ac_hdr>
5860 EOF
5861 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5862 { (eval echo configure:5863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5863 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5864 if test -z "$ac_err"; then
5865   rm -rf conftest*
5866   eval "ac_cv_header_$ac_safe=yes"
5867 else
5868   echo "$ac_err" >&5
5869   echo "configure: failed program was:" >&5
5870   cat conftest.$ac_ext >&5
5871   rm -rf conftest*
5872   eval "ac_cv_header_$ac_safe=no"
5873 fi
5874 rm -f conftest*
5875 fi
5876 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5877   echo "$ac_t""yes" 1>&6
5878     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5879   cat >> confdefs.h <<EOF
5880 #define $ac_tr_hdr 1
5881 EOF
5882  
5883 else
5884   echo "$ac_t""no" 1>&6
5885 fi
5886 done
5887
5888
5889         if test $ac_cv_header_krb5_h = yes ; then
5890                                 for ac_hdr in heim_err.h
5891 do
5892 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5893 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5894 echo "configure:5895: checking for $ac_hdr" >&5
5895 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5896   echo $ac_n "(cached) $ac_c" 1>&6
5897 else
5898   cat > conftest.$ac_ext <<EOF
5899 #line 5900 "configure"
5900 #include "confdefs.h"
5901 #include <$ac_hdr>
5902 EOF
5903 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5904 { (eval echo configure:5905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5905 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5906 if test -z "$ac_err"; then
5907   rm -rf conftest*
5908   eval "ac_cv_header_$ac_safe=yes"
5909 else
5910   echo "$ac_err" >&5
5911   echo "configure: failed program was:" >&5
5912   cat conftest.$ac_ext >&5
5913   rm -rf conftest*
5914   eval "ac_cv_header_$ac_safe=no"
5915 fi
5916 rm -f conftest*
5917 fi
5918 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5919   echo "$ac_t""yes" 1>&6
5920     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5921   cat >> confdefs.h <<EOF
5922 #define $ac_tr_hdr 1
5923 EOF
5924  
5925 else
5926   echo "$ac_t""no" 1>&6
5927 fi
5928 done
5929
5930                 if test $ac_cv_header_heim_err_h = yes ; then
5931                         krb5_impl=heimdal
5932                 else
5933                         krb5_impl=mit
5934                 fi
5935
5936                 if test $krb5_impl = mit; then
5937                         echo $ac_n "checking for main in -lk5crypto""... $ac_c" 1>&6
5938 echo "configure:5939: checking for main in -lk5crypto" >&5
5939 ac_lib_var=`echo k5crypto'_'main | sed 'y%./+-:%__p__%'`
5940 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5941   echo $ac_n "(cached) $ac_c" 1>&6
5942 else
5943   ac_save_LIBS="$LIBS"
5944 LIBS="-lk5crypto  $LIBS"
5945 cat > conftest.$ac_ext <<EOF
5946 #line 5947 "configure"
5947 #include "confdefs.h"
5948
5949 int main() {
5950 main()
5951 ; return 0; }
5952 EOF
5953 if { (eval echo configure:5954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5954   rm -rf conftest*
5955   eval "ac_cv_lib_$ac_lib_var=yes"
5956 else
5957   echo "configure: failed program was:" >&5
5958   cat conftest.$ac_ext >&5
5959   rm -rf conftest*
5960   eval "ac_cv_lib_$ac_lib_var=no"
5961 fi
5962 rm -f conftest*
5963 LIBS="$ac_save_LIBS"
5964
5965 fi
5966 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5967   echo "$ac_t""yes" 1>&6
5968   krb5crypto=k5crypto
5969 else
5970   echo "$ac_t""no" 1>&6
5971 krb5crypto=crypto
5972 fi
5973
5974
5975                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5976 echo "configure:5977: checking for main in -lkrb5" >&5
5977 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5978 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5979   echo $ac_n "(cached) $ac_c" 1>&6
5980 else
5981   ac_save_LIBS="$LIBS"
5982 LIBS="-lkrb5 -l$krb5crypto -lcom_err $LIBS"
5983 cat > conftest.$ac_ext <<EOF
5984 #line 5985 "configure"
5985 #include "confdefs.h"
5986
5987 int main() {
5988 main()
5989 ; return 0; }
5990 EOF
5991 if { (eval echo configure:5992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5992   rm -rf conftest*
5993   eval "ac_cv_lib_$ac_lib_var=yes"
5994 else
5995   echo "configure: failed program was:" >&5
5996   cat conftest.$ac_ext >&5
5997   rm -rf conftest*
5998   eval "ac_cv_lib_$ac_lib_var=no"
5999 fi
6000 rm -f conftest*
6001 LIBS="$ac_save_LIBS"
6002
6003 fi
6004 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6005   echo "$ac_t""yes" 1>&6
6006   have_krb5=yes
6007                                 KRB5_LIBS="-lkrb5 -l$krb5crypto -lcom_err"
6008 else
6009   echo "$ac_t""no" 1>&6
6010 have_krb5=no
6011 fi
6012
6013
6014                 elif test $krb5_impl = heimdal; then
6015                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
6016 echo "configure:6017: checking for main in -lkrb5" >&5
6017 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
6018 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6019   echo $ac_n "(cached) $ac_c" 1>&6
6020 else
6021   ac_save_LIBS="$LIBS"
6022 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6023 cat > conftest.$ac_ext <<EOF
6024 #line 6025 "configure"
6025 #include "confdefs.h"
6026
6027 int main() {
6028 main()
6029 ; return 0; }
6030 EOF
6031 if { (eval echo configure:6032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6032   rm -rf conftest*
6033   eval "ac_cv_lib_$ac_lib_var=yes"
6034 else
6035   echo "configure: failed program was:" >&5
6036   cat conftest.$ac_ext >&5
6037   rm -rf conftest*
6038   eval "ac_cv_lib_$ac_lib_var=no"
6039 fi
6040 rm -f conftest*
6041 LIBS="$ac_save_LIBS"
6042
6043 fi
6044 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6045   echo "$ac_t""yes" 1>&6
6046   have_krb5=yes
6047                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
6048 else
6049   echo "$ac_t""no" 1>&6
6050 have_krb5=no
6051 fi
6052
6053
6054                         cat >> confdefs.h <<\EOF
6055 #define HAVE_HEIMDAL_KERBEROS 1
6056 EOF
6057
6058
6059                 else
6060                         have_krb5=no
6061                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
6062                 fi
6063
6064                 if test $have_krb5 = yes ; then
6065                         ol_link_krb5=yes
6066
6067                         cat >> confdefs.h <<\EOF
6068 #define HAVE_KRB5 1
6069 EOF
6070
6071
6072                         if test $ol_enable_kpasswd != no ; then
6073                                 ol_link_kpasswd=yes;
6074                         fi
6075
6076                         if test $ol_with_kerberos = k5only ; then
6077                                 ol_with_kerberos=found
6078                         fi
6079
6080                 elif test $ol_with_kerberos != auto ; then
6081                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
6082                 fi
6083
6084         fi
6085 fi
6086
6087 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
6088         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
6089
6090         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
6091 do
6092 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6093 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6094 echo "configure:6095: checking for $ac_hdr" >&5
6095 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6096   echo $ac_n "(cached) $ac_c" 1>&6
6097 else
6098   cat > conftest.$ac_ext <<EOF
6099 #line 6100 "configure"
6100 #include "confdefs.h"
6101 #include <$ac_hdr>
6102 EOF
6103 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6104 { (eval echo configure:6105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6105 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6106 if test -z "$ac_err"; then
6107   rm -rf conftest*
6108   eval "ac_cv_header_$ac_safe=yes"
6109 else
6110   echo "$ac_err" >&5
6111   echo "configure: failed program was:" >&5
6112   cat conftest.$ac_ext >&5
6113   rm -rf conftest*
6114   eval "ac_cv_header_$ac_safe=no"
6115 fi
6116 rm -f conftest*
6117 fi
6118 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6119   echo "$ac_t""yes" 1>&6
6120     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6121   cat >> confdefs.h <<EOF
6122 #define $ac_tr_hdr 1
6123 EOF
6124  
6125 else
6126   echo "$ac_t""no" 1>&6
6127 fi
6128 done
6129
6130
6131         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
6132                 if test $krb5_impl = mit; then
6133                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6134 echo "configure:6135: checking for main in -lkrb4" >&5
6135 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6136 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6137   echo $ac_n "(cached) $ac_c" 1>&6
6138 else
6139   ac_save_LIBS="$LIBS"
6140 LIBS="-lkrb4 -ldes425 -lkrb5 -l$krb5crypto -lcom_err $LIBS"
6141 cat > conftest.$ac_ext <<EOF
6142 #line 6143 "configure"
6143 #include "confdefs.h"
6144
6145 int main() {
6146 main()
6147 ; return 0; }
6148 EOF
6149 if { (eval echo configure:6150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6150   rm -rf conftest*
6151   eval "ac_cv_lib_$ac_lib_var=yes"
6152 else
6153   echo "configure: failed program was:" >&5
6154   cat conftest.$ac_ext >&5
6155   rm -rf conftest*
6156   eval "ac_cv_lib_$ac_lib_var=no"
6157 fi
6158 rm -f conftest*
6159 LIBS="$ac_save_LIBS"
6160
6161 fi
6162 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6163   echo "$ac_t""yes" 1>&6
6164   have_k425=yes
6165                                 KRB4_LIBS="-lkrb4 -ldes425"
6166 else
6167   echo "$ac_t""no" 1>&6
6168 have_k425=no
6169 fi
6170
6171
6172                 elif test $krb5_impl = heimdal; then
6173                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6174 echo "configure:6175: checking for main in -lkrb4" >&5
6175 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6176 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6177   echo $ac_n "(cached) $ac_c" 1>&6
6178 else
6179   ac_save_LIBS="$LIBS"
6180 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6181 cat > conftest.$ac_ext <<EOF
6182 #line 6183 "configure"
6183 #include "confdefs.h"
6184
6185 int main() {
6186 main()
6187 ; return 0; }
6188 EOF
6189 if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6190   rm -rf conftest*
6191   eval "ac_cv_lib_$ac_lib_var=yes"
6192 else
6193   echo "configure: failed program was:" >&5
6194   cat conftest.$ac_ext >&5
6195   rm -rf conftest*
6196   eval "ac_cv_lib_$ac_lib_var=no"
6197 fi
6198 rm -f conftest*
6199 LIBS="$ac_save_LIBS"
6200
6201 fi
6202 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6203   echo "$ac_t""yes" 1>&6
6204   have_k425=yes
6205                                 KRB4_LIBS="-lkrb4"
6206 else
6207   echo "$ac_t""no" 1>&6
6208 have_k425=no
6209 fi
6210
6211
6212                 else
6213                         have_425=no
6214                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6215                 fi
6216
6217                 if test $have_k425 = yes ; then
6218                         ol_with_kerberos=found
6219                         ol_link_krb4=yes
6220
6221                         cat >> confdefs.h <<\EOF
6222 #define HAVE_KRB425 1
6223 EOF
6224
6225                         cat >> confdefs.h <<\EOF
6226 #define HAVE_KRB4 1
6227 EOF
6228
6229
6230                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6231 echo "configure:6232: checking for des_debug in Kerberos libraries" >&5
6232 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6233   echo $ac_n "(cached) $ac_c" 1>&6
6234 else
6235   
6236                                                                 save_LIBS="$LIBS"
6237                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6238                                 cat > conftest.$ac_ext <<EOF
6239 #line 6240 "configure"
6240 #include "confdefs.h"
6241
6242 #include <kerberosIV/krb.h>
6243 #include <kerberosIV/des.h>
6244 extern int des_debug;
6245
6246 int main() {
6247
6248 des_debug = 1;
6249
6250 ; return 0; }
6251 EOF
6252 if { (eval echo configure:6253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6253   rm -rf conftest*
6254   ol_cv_var_des_debug=yes
6255 else
6256   echo "configure: failed program was:" >&5
6257   cat conftest.$ac_ext >&5
6258   rm -rf conftest*
6259   ol_cv_var_des_debug=no
6260 fi
6261 rm -f conftest*
6262                                                                 LIBS="$save_LIBS"
6263                         
6264 fi
6265
6266 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6267
6268                         if test $ol_cv_var_des_debug = yes ; then
6269                                 cat >> confdefs.h <<\EOF
6270 #define HAVE_DES_DEBUG 1
6271 EOF
6272
6273                         fi
6274
6275                         LIBS="$save_LIBS"
6276                 fi
6277         fi
6278 fi
6279
6280 if test $ol_link_krb5 = yes ; then
6281         ol_with_kerberos=found
6282 fi
6283
6284 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6285         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6286
6287         for ac_hdr in krb.h des.h krb-archaeology.h 
6288 do
6289 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6290 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6291 echo "configure:6292: checking for $ac_hdr" >&5
6292 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6293   echo $ac_n "(cached) $ac_c" 1>&6
6294 else
6295   cat > conftest.$ac_ext <<EOF
6296 #line 6297 "configure"
6297 #include "confdefs.h"
6298 #include <$ac_hdr>
6299 EOF
6300 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6301 { (eval echo configure:6302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6302 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6303 if test -z "$ac_err"; then
6304   rm -rf conftest*
6305   eval "ac_cv_header_$ac_safe=yes"
6306 else
6307   echo "$ac_err" >&5
6308   echo "configure: failed program was:" >&5
6309   cat conftest.$ac_ext >&5
6310   rm -rf conftest*
6311   eval "ac_cv_header_$ac_safe=no"
6312 fi
6313 rm -f conftest*
6314 fi
6315 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6316   echo "$ac_t""yes" 1>&6
6317     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6318   cat >> confdefs.h <<EOF
6319 #define $ac_tr_hdr 1
6320 EOF
6321  
6322 else
6323   echo "$ac_t""no" 1>&6
6324 fi
6325 done
6326
6327
6328         if test $ac_cv_header_krb_h = yes ; then
6329                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6330 echo "configure:6331: checking for main in -lkrb" >&5
6331 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6332 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6333   echo $ac_n "(cached) $ac_c" 1>&6
6334 else
6335   ac_save_LIBS="$LIBS"
6336 LIBS="-lkrb -ldes $LIBS"
6337 cat > conftest.$ac_ext <<EOF
6338 #line 6339 "configure"
6339 #include "confdefs.h"
6340
6341 int main() {
6342 main()
6343 ; return 0; }
6344 EOF
6345 if { (eval echo configure:6346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6346   rm -rf conftest*
6347   eval "ac_cv_lib_$ac_lib_var=yes"
6348 else
6349   echo "configure: failed program was:" >&5
6350   cat conftest.$ac_ext >&5
6351   rm -rf conftest*
6352   eval "ac_cv_lib_$ac_lib_var=no"
6353 fi
6354 rm -f conftest*
6355 LIBS="$ac_save_LIBS"
6356
6357 fi
6358 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6359   echo "$ac_t""yes" 1>&6
6360   have_k4=yes
6361 else
6362   echo "$ac_t""no" 1>&6
6363 have_k4=no
6364 fi
6365
6366
6367                 if test $have_k4 = yes ; then
6368                         ol_with_kerberos=found
6369                         ol_link_krb4=yes
6370
6371                         cat >> confdefs.h <<\EOF
6372 #define HAVE_KRB4 1
6373 EOF
6374
6375
6376                         KRB4_LIBS="-lkrb -ldes"
6377
6378                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6379                                 cat >> confdefs.h <<\EOF
6380 #define HAVE_KTH_KERBEROS 1
6381 EOF
6382
6383                         fi
6384                 fi
6385         fi
6386 fi
6387
6388 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6389         ol_link_kpasswd=yes
6390 fi
6391
6392 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6393         ol_link_kbind=yes
6394
6395 elif test $ol_enable_kbind = yes ; then
6396         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6397 fi
6398
6399 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6400         cat >> confdefs.h <<\EOF
6401 #define HAVE_KERBEROS 1
6402 EOF
6403
6404
6405 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6406         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6407 fi
6408
6409 ol_link_tls=no
6410 if test $ol_with_tls != no ; then
6411         for ac_hdr in openssl/ssl.h ssl.h
6412 do
6413 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6414 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6415 echo "configure:6416: checking for $ac_hdr" >&5
6416 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6417   echo $ac_n "(cached) $ac_c" 1>&6
6418 else
6419   cat > conftest.$ac_ext <<EOF
6420 #line 6421 "configure"
6421 #include "confdefs.h"
6422 #include <$ac_hdr>
6423 EOF
6424 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6425 { (eval echo configure:6426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6426 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6427 if test -z "$ac_err"; then
6428   rm -rf conftest*
6429   eval "ac_cv_header_$ac_safe=yes"
6430 else
6431   echo "$ac_err" >&5
6432   echo "configure: failed program was:" >&5
6433   cat conftest.$ac_ext >&5
6434   rm -rf conftest*
6435   eval "ac_cv_header_$ac_safe=no"
6436 fi
6437 rm -f conftest*
6438 fi
6439 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6440   echo "$ac_t""yes" 1>&6
6441     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6442   cat >> confdefs.h <<EOF
6443 #define $ac_tr_hdr 1
6444 EOF
6445  
6446 else
6447   echo "$ac_t""no" 1>&6
6448 fi
6449 done
6450
6451         
6452         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6453                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6454 echo "configure:6455: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6455 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6456 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6457   echo $ac_n "(cached) $ac_c" 1>&6
6458 else
6459   ac_save_LIBS="$LIBS"
6460 LIBS="-lssl -lcrypto $LIBS"
6461 cat > conftest.$ac_ext <<EOF
6462 #line 6463 "configure"
6463 #include "confdefs.h"
6464 /* Override any gcc2 internal prototype to avoid an error.  */
6465 /* We use char because int might match the return type of a gcc2
6466     builtin and then its argument prototype would still apply.  */
6467 char SSLeay_add_ssl_algorithms();
6468
6469 int main() {
6470 SSLeay_add_ssl_algorithms()
6471 ; return 0; }
6472 EOF
6473 if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6474   rm -rf conftest*
6475   eval "ac_cv_lib_$ac_lib_var=yes"
6476 else
6477   echo "configure: failed program was:" >&5
6478   cat conftest.$ac_ext >&5
6479   rm -rf conftest*
6480   eval "ac_cv_lib_$ac_lib_var=no"
6481 fi
6482 rm -f conftest*
6483 LIBS="$ac_save_LIBS"
6484
6485 fi
6486 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6487   echo "$ac_t""yes" 1>&6
6488   have_ssleay=yes
6489                         need_rsaref=no
6490 else
6491   echo "$ac_t""no" 1>&6
6492 have_ssleay=no
6493 fi
6494
6495                         
6496                 if test $have_ssleay = no ; then
6497                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6498 echo "configure:6499: checking for SSL_library_init in -lssl" >&5
6499 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6500 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6501   echo $ac_n "(cached) $ac_c" 1>&6
6502 else
6503   ac_save_LIBS="$LIBS"
6504 LIBS="-lssl -lcrypto $LIBS"
6505 cat > conftest.$ac_ext <<EOF
6506 #line 6507 "configure"
6507 #include "confdefs.h"
6508 /* Override any gcc2 internal prototype to avoid an error.  */
6509 /* We use char because int might match the return type of a gcc2
6510     builtin and then its argument prototype would still apply.  */
6511 char SSL_library_init();
6512
6513 int main() {
6514 SSL_library_init()
6515 ; return 0; }
6516 EOF
6517 if { (eval echo configure:6518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6518   rm -rf conftest*
6519   eval "ac_cv_lib_$ac_lib_var=yes"
6520 else
6521   echo "configure: failed program was:" >&5
6522   cat conftest.$ac_ext >&5
6523   rm -rf conftest*
6524   eval "ac_cv_lib_$ac_lib_var=no"
6525 fi
6526 rm -f conftest*
6527 LIBS="$ac_save_LIBS"
6528
6529 fi
6530 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6531   echo "$ac_t""yes" 1>&6
6532   have_ssleay=yes
6533                                 need_rsaref=no
6534 else
6535   echo "$ac_t""no" 1>&6
6536 have_ssleay=no
6537 fi
6538
6539                 fi
6540
6541                 if test $have_ssleay = no ; then
6542                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6543 echo "configure:6544: checking for ssl3_accept in -lssl" >&5
6544 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6545 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6546   echo $ac_n "(cached) $ac_c" 1>&6
6547 else
6548   ac_save_LIBS="$LIBS"
6549 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6550 cat > conftest.$ac_ext <<EOF
6551 #line 6552 "configure"
6552 #include "confdefs.h"
6553 /* Override any gcc2 internal prototype to avoid an error.  */
6554 /* We use char because int might match the return type of a gcc2
6555     builtin and then its argument prototype would still apply.  */
6556 char ssl3_accept();
6557
6558 int main() {
6559 ssl3_accept()
6560 ; return 0; }
6561 EOF
6562 if { (eval echo configure:6563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6563   rm -rf conftest*
6564   eval "ac_cv_lib_$ac_lib_var=yes"
6565 else
6566   echo "configure: failed program was:" >&5
6567   cat conftest.$ac_ext >&5
6568   rm -rf conftest*
6569   eval "ac_cv_lib_$ac_lib_var=no"
6570 fi
6571 rm -f conftest*
6572 LIBS="$ac_save_LIBS"
6573
6574 fi
6575 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6576   echo "$ac_t""yes" 1>&6
6577   have_ssleay=yes
6578                                 need_rsaref=yes
6579 else
6580   echo "$ac_t""no" 1>&6
6581 have_ssleay=no
6582 fi
6583
6584                 fi
6585
6586                 if test $have_ssleay = yes ; then
6587                         ol_with_tls=found
6588                         ol_link_tls=yes
6589
6590                         cat >> confdefs.h <<\EOF
6591 #define HAVE_SSLEAY 1
6592 EOF
6593
6594
6595                         if test $need_rsaref = yes; then
6596                                 cat >> confdefs.h <<\EOF
6597 #define HAVE_RSAREF 1
6598 EOF
6599
6600
6601                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6602                         else
6603                                 TLS_LIBS="-lssl -lcrypto"
6604                         fi
6605                 fi
6606         fi
6607
6608 else
6609         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6610 fi
6611
6612 if test $ol_link_tls = yes ; then
6613         cat >> confdefs.h <<\EOF
6614 #define HAVE_TLS 1
6615 EOF
6616
6617
6618 elif test $ol_with_tls = auto ; then
6619         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6620         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6621
6622 elif test $ol_with_tls != no ; then
6623         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6624 fi
6625
6626 for ac_func in \
6627         ctime_r                 \
6628         gethostbyname_r gethostbyaddr_r \
6629
6630 do
6631 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6632 echo "configure:6633: checking for $ac_func" >&5
6633 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6634   echo $ac_n "(cached) $ac_c" 1>&6
6635 else
6636   cat > conftest.$ac_ext <<EOF
6637 #line 6638 "configure"
6638 #include "confdefs.h"
6639 /* System header to define __stub macros and hopefully few prototypes,
6640     which can conflict with char $ac_func(); below.  */
6641 #include <assert.h>
6642 /* Override any gcc2 internal prototype to avoid an error.  */
6643 /* We use char because int might match the return type of a gcc2
6644     builtin and then its argument prototype would still apply.  */
6645 char $ac_func();
6646 char (*f)();
6647
6648 int main() {
6649
6650 /* The GNU C library defines this for functions which it implements
6651     to always fail with ENOSYS.  Some functions are actually named
6652     something starting with __ and the normal name is an alias.  */
6653 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6654 choke me
6655 #else
6656 f = $ac_func;
6657 #endif
6658
6659 ; return 0; }
6660 EOF
6661 if { (eval echo configure:6662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6662   rm -rf conftest*
6663   eval "ac_cv_func_$ac_func=yes"
6664 else
6665   echo "configure: failed program was:" >&5
6666   cat conftest.$ac_ext >&5
6667   rm -rf conftest*
6668   eval "ac_cv_func_$ac_func=no"
6669 fi
6670 rm -f conftest*
6671 fi
6672
6673 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6674   echo "$ac_t""yes" 1>&6
6675     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6676   cat >> confdefs.h <<EOF
6677 #define $ac_tr_func 1
6678 EOF
6679  
6680 else
6681   echo "$ac_t""no" 1>&6
6682 fi
6683 done
6684
6685
6686 if test "$ac_cv_func_ctime_r" = no ; then
6687         ol_cv_func_ctime_r_nargs=0
6688 else
6689         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6690 echo "configure:6691: checking number of arguments of ctime_r" >&5
6691 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6692   echo $ac_n "(cached) $ac_c" 1>&6
6693 else
6694   cat > conftest.$ac_ext <<EOF
6695 #line 6696 "configure"
6696 #include "confdefs.h"
6697 #include <time.h>
6698 int main() {
6699 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6700 ; return 0; }
6701 EOF
6702 if { (eval echo configure:6703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6703   rm -rf conftest*
6704   ol_cv_func_ctime_r_nargs3=yes
6705 else
6706   echo "configure: failed program was:" >&5
6707   cat conftest.$ac_ext >&5
6708   rm -rf conftest*
6709   ol_cv_func_ctime_r_nargs3=no
6710 fi
6711 rm -f conftest*
6712
6713         cat > conftest.$ac_ext <<EOF
6714 #line 6715 "configure"
6715 #include "confdefs.h"
6716 #include <time.h>
6717 int main() {
6718 time_t ti; char *buffer; ctime_r(&ti,buffer);
6719 ; return 0; }
6720 EOF
6721 if { (eval echo configure:6722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6722   rm -rf conftest*
6723   ol_cv_func_ctime_r_nargs2=yes
6724 else
6725   echo "configure: failed program was:" >&5
6726   cat conftest.$ac_ext >&5
6727   rm -rf conftest*
6728   ol_cv_func_ctime_r_nargs2=no
6729 fi
6730 rm -f conftest*
6731
6732         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6733                 $ol_cv_func_ctime_r_nargs2 = no ; then
6734
6735                 ol_cv_func_ctime_r_nargs=3
6736
6737         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6738                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6739
6740                 ol_cv_func_ctime_r_nargs=2
6741
6742         else
6743                 ol_cv_func_ctime_r_nargs=0
6744         fi
6745   
6746 fi
6747
6748 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6749
6750   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6751         cat >> confdefs.h <<EOF
6752 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6753 EOF
6754
6755   fi
6756
6757 fi
6758
6759 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6760         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6761 echo "configure:6762: checking number of arguments of gethostbyname_r" >&5
6762 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6763   echo $ac_n "(cached) $ac_c" 1>&6
6764 else
6765   cat > conftest.$ac_ext <<EOF
6766 #line 6767 "configure"
6767 #include "confdefs.h"
6768 #include <sys/types.h>
6769 #include <sys/socket.h>
6770 #include <netinet/in.h>
6771 #include <netdb.h>
6772 #define BUFSIZE (sizeof(struct hostent)+10)
6773 int main() {
6774 struct hostent hent; char buffer[BUFSIZE];
6775                 int bufsize=BUFSIZE;int h_errno;
6776                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6777                         buffer, bufsize, &h_errno);
6778 ; return 0; }
6779 EOF
6780 if { (eval echo configure:6781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6781   rm -rf conftest*
6782   ol_cv_func_gethostbyname_r_nargs5=yes
6783 else
6784   echo "configure: failed program was:" >&5
6785   cat conftest.$ac_ext >&5
6786   rm -rf conftest*
6787   ol_cv_func_gethostbyname_r_nargs5=no
6788 fi
6789 rm -f conftest*
6790
6791         cat > conftest.$ac_ext <<EOF
6792 #line 6793 "configure"
6793 #include "confdefs.h"
6794 #include <sys/types.h>
6795 #include <sys/socket.h>
6796 #include <netinet/in.h>
6797 #include <netdb.h>
6798 #define BUFSIZE (sizeof(struct hostent)+10)
6799 int main() {
6800 struct hostent hent;struct hostent *rhent;
6801                 char buffer[BUFSIZE];
6802                 int bufsize=BUFSIZE;int h_errno;
6803                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6804                         &rhent, &h_errno);
6805 ; return 0; }
6806 EOF
6807 if { (eval echo configure:6808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6808   rm -rf conftest*
6809   ol_cv_func_gethostbyname_r_nargs6=yes
6810 else
6811   echo "configure: failed program was:" >&5
6812   cat conftest.$ac_ext >&5
6813   rm -rf conftest*
6814   ol_cv_func_gethostbyname_r_nargs6=no
6815 fi
6816 rm -f conftest*
6817
6818         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6819                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6820
6821                 ol_cv_func_gethostbyname_r_nargs=5
6822
6823         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6824                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6825
6826                 ol_cv_func_gethostbyname_r_nargs=6
6827
6828         else
6829                 ol_cv_func_gethostbyname_r_nargs=0
6830         fi
6831   
6832 fi
6833
6834 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6835   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6836         cat >> confdefs.h <<EOF
6837 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6838 EOF
6839
6840   fi
6841
6842 else
6843         ol_cv_func_gethostbyname_r_nargs=0
6844 fi
6845  
6846 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6847         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6848 echo "configure:6849: checking number of arguments of gethostbyaddr_r" >&5
6849 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6850   echo $ac_n "(cached) $ac_c" 1>&6
6851 else
6852   cat > conftest.$ac_ext <<EOF
6853 #line 6854 "configure"
6854 #include "confdefs.h"
6855 #include <sys/types.h>
6856 #include <sys/socket.h>
6857 #include <netinet/in.h>
6858 #include <netdb.h>
6859 #define BUFSIZE (sizeof(struct hostent)+10)
6860 int main() {
6861 struct hostent hent; char buffer[BUFSIZE]; 
6862             struct in_addr add;
6863             size_t alen=sizeof(struct in_addr);
6864             int bufsize=BUFSIZE;int h_errno;
6865                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6866                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6867 ; return 0; }
6868 EOF
6869 if { (eval echo configure:6870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6870   rm -rf conftest*
6871   ol_cv_func_gethostbyaddr_r_nargs7=yes
6872 else
6873   echo "configure: failed program was:" >&5
6874   cat conftest.$ac_ext >&5
6875   rm -rf conftest*
6876   ol_cv_func_gethostbyaddr_r_nargs7=no
6877 fi
6878 rm -f conftest*
6879
6880         cat > conftest.$ac_ext <<EOF
6881 #line 6882 "configure"
6882 #include "confdefs.h"
6883 #include <sys/types.h>
6884 #include <sys/socket.h>
6885 #include <netinet/in.h>
6886 #include <netdb.h>
6887 #define BUFSIZE (sizeof(struct hostent)+10)
6888 int main() {
6889 struct hostent hent;
6890                 struct hostent *rhent; char buffer[BUFSIZE]; 
6891                 struct in_addr add;
6892                 size_t alen=sizeof(struct in_addr);
6893                 int bufsize=BUFSIZE;int h_errno;
6894                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6895                         alen, AF_INET, &hent, buffer, bufsize, 
6896                         &rhent, &h_errno);
6897 ; return 0; }
6898 EOF
6899 if { (eval echo configure:6900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6900   rm -rf conftest*
6901   ol_cv_func_gethostbyaddr_r_nargs8=yes
6902 else
6903   echo "configure: failed program was:" >&5
6904   cat conftest.$ac_ext >&5
6905   rm -rf conftest*
6906   ol_cv_func_gethostbyaddr_r_nargs8=no
6907 fi
6908 rm -f conftest*
6909
6910         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6911                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6912
6913                 ol_cv_func_gethostbyaddr_r_nargs=7
6914
6915         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6916                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6917
6918                 ol_cv_func_gethostbyaddr_r_nargs=8
6919
6920         else
6921                 ol_cv_func_gethostbyaddr_r_nargs=0
6922         fi
6923   
6924 fi
6925
6926 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6927   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6928     cat >> confdefs.h <<EOF
6929 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6930 EOF
6931
6932   fi
6933
6934 else
6935         ol_cv_func_gethostbyaddr_r_nargs=0
6936 fi
6937
6938 if test "$ac_cv_func_ctime_r" = yes \
6939         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6940         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6941         -a "$ac_cv_func_gethostbyname_r" = yes \
6942         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6943         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6944         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6945         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6946         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6947         ; then
6948  
6949         cat >> confdefs.h <<\EOF
6950 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6951 EOF
6952
6953 fi
6954
6955 ol_link_threads=no
6956
6957 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6958         -o $ol_with_threads = nt ; then
6959
6960         
6961         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6962 echo "configure:6963: checking for _beginthread" >&5
6963 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6964   echo $ac_n "(cached) $ac_c" 1>&6
6965 else
6966   cat > conftest.$ac_ext <<EOF
6967 #line 6968 "configure"
6968 #include "confdefs.h"
6969 /* System header to define __stub macros and hopefully few prototypes,
6970     which can conflict with char _beginthread(); below.  */
6971 #include <assert.h>
6972 /* Override any gcc2 internal prototype to avoid an error.  */
6973 /* We use char because int might match the return type of a gcc2
6974     builtin and then its argument prototype would still apply.  */
6975 char _beginthread();
6976 char (*f)();
6977
6978 int main() {
6979
6980 /* The GNU C library defines this for functions which it implements
6981     to always fail with ENOSYS.  Some functions are actually named
6982     something starting with __ and the normal name is an alias.  */
6983 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6984 choke me
6985 #else
6986 f = _beginthread;
6987 #endif
6988
6989 ; return 0; }
6990 EOF
6991 if { (eval echo configure:6992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6992   rm -rf conftest*
6993   eval "ac_cv_func__beginthread=yes"
6994 else
6995   echo "configure: failed program was:" >&5
6996   cat conftest.$ac_ext >&5
6997   rm -rf conftest*
6998   eval "ac_cv_func__beginthread=no"
6999 fi
7000 rm -f conftest*
7001 fi
7002
7003 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
7004   echo "$ac_t""yes" 1>&6
7005   :
7006 else
7007   echo "$ac_t""no" 1>&6
7008 fi
7009
7010
7011         if test $ac_cv_func__beginthread = yes ; then
7012                 cat >> confdefs.h <<\EOF
7013 #define HAVE_NT_THREADS 1
7014 EOF
7015
7016         fi
7017
7018
7019         if test "$ol_cv_nt_threads" = yes ; then
7020         ol_link_threads=nt
7021         ol_with_threads=found
7022         ol_with_yielding_select=yes
7023
7024                 cat >> confdefs.h <<\EOF
7025 #define HAVE_NT_SERVICE_MANAGER 1
7026 EOF
7027
7028                 cat >> confdefs.h <<\EOF
7029 #define HAVE_NT_EVENT_LOG 1
7030 EOF
7031
7032         fi
7033
7034         if test $ol_with_threads = nt ; then
7035                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
7036         fi
7037 fi
7038
7039 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7040         -o $ol_with_threads = posix ; then
7041
7042         for ac_hdr in pthread.h
7043 do
7044 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7045 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7046 echo "configure:7047: checking for $ac_hdr" >&5
7047 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7048   echo $ac_n "(cached) $ac_c" 1>&6
7049 else
7050   cat > conftest.$ac_ext <<EOF
7051 #line 7052 "configure"
7052 #include "confdefs.h"
7053 #include <$ac_hdr>
7054 EOF
7055 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7056 { (eval echo configure:7057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7057 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7058 if test -z "$ac_err"; then
7059   rm -rf conftest*
7060   eval "ac_cv_header_$ac_safe=yes"
7061 else
7062   echo "$ac_err" >&5
7063   echo "configure: failed program was:" >&5
7064   cat conftest.$ac_ext >&5
7065   rm -rf conftest*
7066   eval "ac_cv_header_$ac_safe=no"
7067 fi
7068 rm -f conftest*
7069 fi
7070 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7071   echo "$ac_t""yes" 1>&6
7072     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7073   cat >> confdefs.h <<EOF
7074 #define $ac_tr_hdr 1
7075 EOF
7076  
7077 else
7078   echo "$ac_t""no" 1>&6
7079 fi
7080 done
7081
7082
7083         if test $ac_cv_header_pthread_h = yes ; then
7084                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
7085 echo "configure:7086: checking POSIX thread version" >&5
7086 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
7087   echo $ac_n "(cached) $ac_c" 1>&6
7088 else
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_final;
7098 #               endif
7099         
7100 EOF
7101 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7102   egrep "pthread_version_final" >/dev/null 2>&1; then
7103   rm -rf conftest*
7104   ol_pthread_final=yes
7105 else
7106   rm -rf conftest*
7107   ol_pthread_final=no
7108 fi
7109 rm -f conftest*
7110
7111
7112         cat > conftest.$ac_ext <<EOF
7113 #line 7114 "configure"
7114 #include "confdefs.h"
7115
7116 #               include <pthread.h>
7117                 /* this check could be improved */
7118 #               ifdef pthread_once_init
7119                         pthread_version_draft4;
7120 #               endif
7121         
7122 EOF
7123 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7124   egrep "pthread_version_draft4" >/dev/null 2>&1; then
7125   rm -rf conftest*
7126   ol_pthread_draft4=yes
7127 else
7128   rm -rf conftest*
7129   ol_pthread_draft4=no
7130 fi
7131 rm -f conftest*
7132
7133
7134         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
7135                 ol_cv_pthread_version=final
7136         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
7137                 ol_cv_pthread_version=draft4
7138         else
7139                 ol_cv_pthread_version=unknown
7140         fi
7141
7142 fi
7143
7144 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7145
7146
7147                 if test $ol_cv_pthread_version = final ; then
7148                         cat >> confdefs.h <<\EOF
7149 #define HAVE_PTHREADS_FINAL 1
7150 EOF
7151
7152                 elif test $ol_cv_pthread_version = draft4 ; then
7153                         cat >> confdefs.h <<\EOF
7154 #define HAVE_PTHREADS_D4 1
7155 EOF
7156
7157                 else
7158                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7159                 fi
7160
7161                 # consider threads found
7162                 ol_with_threads=found
7163
7164                 
7165         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7166 echo "configure:7167: checking for LinuxThreads pthread.h" >&5
7167 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7168   echo $ac_n "(cached) $ac_c" 1>&6
7169 else
7170   cat > conftest.$ac_ext <<EOF
7171 #line 7172 "configure"
7172 #include "confdefs.h"
7173 #include <pthread.h>
7174 EOF
7175 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7176   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7177   rm -rf conftest*
7178   ol_cv_header_linux_threads=yes
7179 else
7180   rm -rf conftest*
7181   ol_cv_header_linux_threads=no
7182 fi
7183 rm -f conftest*
7184
7185                 
7186 fi
7187
7188 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7189         if test $ol_cv_header_linux_threads = yes; then
7190                 cat >> confdefs.h <<\EOF
7191 #define HAVE_LINUX_THREADS 1
7192 EOF
7193
7194         fi
7195
7196                 
7197         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7198 echo "configure:7199: checking for GNU Pth pthread.h" >&5
7199 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7200   echo $ac_n "(cached) $ac_c" 1>&6
7201 else
7202   cat > conftest.$ac_ext <<EOF
7203 #line 7204 "configure"
7204 #include "confdefs.h"
7205 #include <pthread.h>
7206 #ifdef _POSIX_THREAD_IS_GNU_PTH
7207         __gnu_pth__;
7208 #endif
7209
7210 EOF
7211 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7212   egrep "__gnu_pth__" >/dev/null 2>&1; then
7213   rm -rf conftest*
7214   ol_cv_header_gnu_pth_pthread_h=yes
7215 else
7216   rm -rf conftest*
7217   ol_cv_header_gnu_pth_pthread_h=no
7218 fi
7219 rm -f conftest*
7220
7221                 
7222 fi
7223
7224 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7225
7226
7227                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7228                         for ac_hdr in sched.h
7229 do
7230 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7231 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7232 echo "configure:7233: checking for $ac_hdr" >&5
7233 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7234   echo $ac_n "(cached) $ac_c" 1>&6
7235 else
7236   cat > conftest.$ac_ext <<EOF
7237 #line 7238 "configure"
7238 #include "confdefs.h"
7239 #include <$ac_hdr>
7240 EOF
7241 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7242 { (eval echo configure:7243: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7243 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7244 if test -z "$ac_err"; then
7245   rm -rf conftest*
7246   eval "ac_cv_header_$ac_safe=yes"
7247 else
7248   echo "$ac_err" >&5
7249   echo "configure: failed program was:" >&5
7250   cat conftest.$ac_ext >&5
7251   rm -rf conftest*
7252   eval "ac_cv_header_$ac_safe=no"
7253 fi
7254 rm -f conftest*
7255 fi
7256 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7257   echo "$ac_t""yes" 1>&6
7258     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7259   cat >> confdefs.h <<EOF
7260 #define $ac_tr_hdr 1
7261 EOF
7262  
7263 else
7264   echo "$ac_t""no" 1>&6
7265 fi
7266 done
7267
7268                 fi
7269
7270                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7271                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7272 echo "configure:7273: checking for pthread_create in default libraries" >&5
7273 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7274   echo $ac_n "(cached) $ac_c" 1>&6
7275 else
7276   
7277                 if test "$cross_compiling" = yes; then
7278   cat > conftest.$ac_ext <<EOF
7279 #line 7280 "configure"
7280 #include "confdefs.h"
7281 /* pthread test headers */
7282 #include <pthread.h>
7283 #ifndef NULL
7284 #define NULL (void*)0
7285 #endif
7286
7287 static void *task(p)
7288         void *p;
7289 {
7290         return (void *) (p == NULL);
7291 }
7292
7293 int main() {
7294
7295         /* pthread test function */
7296         pthread_t t;
7297         int status;
7298         int detach = 1;
7299
7300 #ifdef HAVE_PTHREADS_FINAL
7301         /* Final pthreads */
7302         pthread_attr_t attr;
7303
7304         status = pthread_attr_init(&attr);
7305         if( status ) return status;
7306
7307 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7308         if( !detach ) {
7309 #if defined( PTHREAD_CREATE_JOINABLE )
7310                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7311 #else
7312                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7313 #endif
7314
7315 #ifdef PTHREAD_CREATE_DETACHED
7316         } else {
7317                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7318 #endif
7319         }
7320         if( status ) return status;
7321 #endif
7322
7323         status = pthread_create( &t, &attr, task, NULL );
7324         if( status ) return status;
7325
7326 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7327         if( detach ) {
7328                 /* give thread a chance to complete */
7329                 /* it should remain joinable and hence detachable */
7330                 sleep( 1 );
7331
7332                 status = pthread_detach( t );
7333                 if( status ) return status;
7334         }
7335 #endif
7336
7337 #else
7338         /* Draft 4 pthreads */
7339         status = pthread_create( &t, pthread_attr_default, task, NULL );
7340         if( status ) return status;
7341
7342         if( detach ) {
7343                 /* give thread a chance to complete */
7344                 /* it should remain joinable and hence detachable */
7345                 sleep( 1 );
7346
7347                 status = pthread_detach( &t );
7348                 if( status ) return status;
7349         }
7350 #endif
7351
7352 #ifdef HAVE_LINUX_THREADS
7353         pthread_kill_other_threads_np();
7354 #endif
7355
7356         return 0;
7357
7358 ; return 0; }
7359 EOF
7360 if { (eval echo configure:7361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7361   rm -rf conftest*
7362   ol_cv_pthread_create=yes
7363 else
7364   echo "configure: failed program was:" >&5
7365   cat conftest.$ac_ext >&5
7366   rm -rf conftest*
7367   ol_cv_pthread_create=no
7368 fi
7369 rm -f conftest*
7370 else
7371   cat > conftest.$ac_ext <<EOF
7372 #line 7373 "configure"
7373 #include "confdefs.h"
7374 /* pthread test headers */
7375 #include <pthread.h>
7376 #ifndef NULL
7377 #define NULL (void*)0
7378 #endif
7379
7380 static void *task(p)
7381         void *p;
7382 {
7383         return (void *) (p == NULL);
7384 }
7385
7386
7387 int main(argc, argv)
7388         int argc;
7389         char **argv;
7390 {
7391
7392         /* pthread test function */
7393         pthread_t t;
7394         int status;
7395         int detach = 1;
7396
7397 #ifdef HAVE_PTHREADS_FINAL
7398         /* Final pthreads */
7399         pthread_attr_t attr;
7400
7401         status = pthread_attr_init(&attr);
7402         if( status ) return status;
7403
7404 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7405         if( !detach ) {
7406 #if defined( PTHREAD_CREATE_JOINABLE )
7407                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7408 #else
7409                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7410 #endif
7411
7412 #ifdef PTHREAD_CREATE_DETACHED
7413         } else {
7414                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7415 #endif
7416         }
7417         if( status ) return status;
7418 #endif
7419
7420         status = pthread_create( &t, &attr, task, NULL );
7421         if( status ) return status;
7422
7423 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7424         if( detach ) {
7425                 /* give thread a chance to complete */
7426                 /* it should remain joinable and hence detachable */
7427                 sleep( 1 );
7428
7429                 status = pthread_detach( t );
7430                 if( status ) return status;
7431         }
7432 #endif
7433
7434 #else
7435         /* Draft 4 pthreads */
7436         status = pthread_create( &t, pthread_attr_default, task, NULL );
7437         if( status ) return status;
7438
7439         if( detach ) {
7440                 /* give thread a chance to complete */
7441                 /* it should remain joinable and hence detachable */
7442                 sleep( 1 );
7443
7444                 status = pthread_detach( &t );
7445                 if( status ) return status;
7446         }
7447 #endif
7448
7449 #ifdef HAVE_LINUX_THREADS
7450         pthread_kill_other_threads_np();
7451 #endif
7452
7453         return 0;
7454
7455 }
7456
7457 EOF
7458 if { (eval echo configure:7459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7459 then
7460   ol_cv_pthread_create=yes
7461 else
7462   echo "configure: failed program was:" >&5
7463   cat conftest.$ac_ext >&5
7464   rm -fr conftest*
7465   ol_cv_pthread_create=no
7466 fi
7467 rm -fr conftest*
7468 fi
7469
7470 fi
7471
7472 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7473
7474                 if test $ol_cv_pthread_create != no ; then
7475                         ol_link_threads=posix
7476                         ol_link_pthreads=""
7477                 fi
7478                 
7479                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7480 if test "$ol_link_threads" = no ; then
7481         # try -kthread
7482         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7483 echo "configure:7484: checking for pthread link with -kthread" >&5
7484 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7485   echo $ac_n "(cached) $ac_c" 1>&6
7486 else
7487   
7488                 # save the flags
7489                 ol_LIBS="$LIBS"
7490                 LIBS="-kthread $LIBS"
7491
7492                 if test "$cross_compiling" = yes; then
7493   cat > conftest.$ac_ext <<EOF
7494 #line 7495 "configure"
7495 #include "confdefs.h"
7496 /* pthread test headers */
7497 #include <pthread.h>
7498 #ifndef NULL
7499 #define NULL (void*)0
7500 #endif
7501
7502 static void *task(p)
7503         void *p;
7504 {
7505         return (void *) (p == NULL);
7506 }
7507
7508 int main() {
7509
7510         /* pthread test function */
7511         pthread_t t;
7512         int status;
7513         int detach = 1;
7514
7515 #ifdef HAVE_PTHREADS_FINAL
7516         /* Final pthreads */
7517         pthread_attr_t attr;
7518
7519         status = pthread_attr_init(&attr);
7520         if( status ) return status;
7521
7522 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7523         if( !detach ) {
7524 #if defined( PTHREAD_CREATE_JOINABLE )
7525                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7526 #else
7527                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7528 #endif
7529
7530 #ifdef PTHREAD_CREATE_DETACHED
7531         } else {
7532                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7533 #endif
7534         }
7535         if( status ) return status;
7536 #endif
7537
7538         status = pthread_create( &t, &attr, task, NULL );
7539         if( status ) return status;
7540
7541 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7542         if( detach ) {
7543                 /* give thread a chance to complete */
7544                 /* it should remain joinable and hence detachable */
7545                 sleep( 1 );
7546
7547                 status = pthread_detach( t );
7548                 if( status ) return status;
7549         }
7550 #endif
7551
7552 #else
7553         /* Draft 4 pthreads */
7554         status = pthread_create( &t, pthread_attr_default, task, NULL );
7555         if( status ) return status;
7556
7557         if( detach ) {
7558                 /* give thread a chance to complete */
7559                 /* it should remain joinable and hence detachable */
7560                 sleep( 1 );
7561
7562                 status = pthread_detach( &t );
7563                 if( status ) return status;
7564         }
7565 #endif
7566
7567 #ifdef HAVE_LINUX_THREADS
7568         pthread_kill_other_threads_np();
7569 #endif
7570
7571         return 0;
7572
7573 ; return 0; }
7574 EOF
7575 if { (eval echo configure:7576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7576   rm -rf conftest*
7577   ol_cv_pthread_kthread=yes
7578 else
7579   echo "configure: failed program was:" >&5
7580   cat conftest.$ac_ext >&5
7581   rm -rf conftest*
7582   ol_cv_pthread_kthread=no
7583 fi
7584 rm -f conftest*
7585 else
7586   cat > conftest.$ac_ext <<EOF
7587 #line 7588 "configure"
7588 #include "confdefs.h"
7589 /* pthread test headers */
7590 #include <pthread.h>
7591 #ifndef NULL
7592 #define NULL (void*)0
7593 #endif
7594
7595 static void *task(p)
7596         void *p;
7597 {
7598         return (void *) (p == NULL);
7599 }
7600
7601
7602 int main(argc, argv)
7603         int argc;
7604         char **argv;
7605 {
7606
7607         /* pthread test function */
7608         pthread_t t;
7609         int status;
7610         int detach = 1;
7611
7612 #ifdef HAVE_PTHREADS_FINAL
7613         /* Final pthreads */
7614         pthread_attr_t attr;
7615
7616         status = pthread_attr_init(&attr);
7617         if( status ) return status;
7618
7619 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7620         if( !detach ) {
7621 #if defined( PTHREAD_CREATE_JOINABLE )
7622                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7623 #else
7624                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7625 #endif
7626
7627 #ifdef PTHREAD_CREATE_DETACHED
7628         } else {
7629                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7630 #endif
7631         }
7632         if( status ) return status;
7633 #endif
7634
7635         status = pthread_create( &t, &attr, task, NULL );
7636         if( status ) return status;
7637
7638 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7639         if( detach ) {
7640                 /* give thread a chance to complete */
7641                 /* it should remain joinable and hence detachable */
7642                 sleep( 1 );
7643
7644                 status = pthread_detach( t );
7645                 if( status ) return status;
7646         }
7647 #endif
7648
7649 #else
7650         /* Draft 4 pthreads */
7651         status = pthread_create( &t, pthread_attr_default, task, NULL );
7652         if( status ) return status;
7653
7654         if( detach ) {
7655                 /* give thread a chance to complete */
7656                 /* it should remain joinable and hence detachable */
7657                 sleep( 1 );
7658
7659                 status = pthread_detach( &t );
7660                 if( status ) return status;
7661         }
7662 #endif
7663
7664 #ifdef HAVE_LINUX_THREADS
7665         pthread_kill_other_threads_np();
7666 #endif
7667
7668         return 0;
7669
7670 }
7671
7672 EOF
7673 if { (eval echo configure:7674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7674 then
7675   ol_cv_pthread_kthread=yes
7676 else
7677   echo "configure: failed program was:" >&5
7678   cat conftest.$ac_ext >&5
7679   rm -fr conftest*
7680   ol_cv_pthread_kthread=no
7681 fi
7682 rm -fr conftest*
7683 fi
7684
7685
7686                 # restore the LIBS
7687                 LIBS="$ol_LIBS"
7688         
7689 fi
7690
7691 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7692
7693         if test $ol_cv_pthread_kthread = yes ; then
7694                 ol_link_pthreads="-kthread"
7695                 ol_link_threads=posix
7696         fi
7697 fi
7698
7699                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7700 if test "$ol_link_threads" = no ; then
7701         # try -pthread
7702         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7703 echo "configure:7704: checking for pthread link with -pthread" >&5
7704 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7705   echo $ac_n "(cached) $ac_c" 1>&6
7706 else
7707   
7708                 # save the flags
7709                 ol_LIBS="$LIBS"
7710                 LIBS="-pthread $LIBS"
7711
7712                 if test "$cross_compiling" = yes; then
7713   cat > conftest.$ac_ext <<EOF
7714 #line 7715 "configure"
7715 #include "confdefs.h"
7716 /* pthread test headers */
7717 #include <pthread.h>
7718 #ifndef NULL
7719 #define NULL (void*)0
7720 #endif
7721
7722 static void *task(p)
7723         void *p;
7724 {
7725         return (void *) (p == NULL);
7726 }
7727
7728 int main() {
7729
7730         /* pthread test function */
7731         pthread_t t;
7732         int status;
7733         int detach = 1;
7734
7735 #ifdef HAVE_PTHREADS_FINAL
7736         /* Final pthreads */
7737         pthread_attr_t attr;
7738
7739         status = pthread_attr_init(&attr);
7740         if( status ) return status;
7741
7742 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7743         if( !detach ) {
7744 #if defined( PTHREAD_CREATE_JOINABLE )
7745                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7746 #else
7747                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7748 #endif
7749
7750 #ifdef PTHREAD_CREATE_DETACHED
7751         } else {
7752                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7753 #endif
7754         }
7755         if( status ) return status;
7756 #endif
7757
7758         status = pthread_create( &t, &attr, task, NULL );
7759         if( status ) return status;
7760
7761 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7762         if( detach ) {
7763                 /* give thread a chance to complete */
7764                 /* it should remain joinable and hence detachable */
7765                 sleep( 1 );
7766
7767                 status = pthread_detach( t );
7768                 if( status ) return status;
7769         }
7770 #endif
7771
7772 #else
7773         /* Draft 4 pthreads */
7774         status = pthread_create( &t, pthread_attr_default, task, NULL );
7775         if( status ) return status;
7776
7777         if( detach ) {
7778                 /* give thread a chance to complete */
7779                 /* it should remain joinable and hence detachable */
7780                 sleep( 1 );
7781
7782                 status = pthread_detach( &t );
7783                 if( status ) return status;
7784         }
7785 #endif
7786
7787 #ifdef HAVE_LINUX_THREADS
7788         pthread_kill_other_threads_np();
7789 #endif
7790
7791         return 0;
7792
7793 ; return 0; }
7794 EOF
7795 if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7796   rm -rf conftest*
7797   ol_cv_pthread_pthread=yes
7798 else
7799   echo "configure: failed program was:" >&5
7800   cat conftest.$ac_ext >&5
7801   rm -rf conftest*
7802   ol_cv_pthread_pthread=no
7803 fi
7804 rm -f conftest*
7805 else
7806   cat > conftest.$ac_ext <<EOF
7807 #line 7808 "configure"
7808 #include "confdefs.h"
7809 /* pthread test headers */
7810 #include <pthread.h>
7811 #ifndef NULL
7812 #define NULL (void*)0
7813 #endif
7814
7815 static void *task(p)
7816         void *p;
7817 {
7818         return (void *) (p == NULL);
7819 }
7820
7821
7822 int main(argc, argv)
7823         int argc;
7824         char **argv;
7825 {
7826
7827         /* pthread test function */
7828         pthread_t t;
7829         int status;
7830         int detach = 1;
7831
7832 #ifdef HAVE_PTHREADS_FINAL
7833         /* Final pthreads */
7834         pthread_attr_t attr;
7835
7836         status = pthread_attr_init(&attr);
7837         if( status ) return status;
7838
7839 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7840         if( !detach ) {
7841 #if defined( PTHREAD_CREATE_JOINABLE )
7842                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7843 #else
7844                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7845 #endif
7846
7847 #ifdef PTHREAD_CREATE_DETACHED
7848         } else {
7849                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7850 #endif
7851         }
7852         if( status ) return status;
7853 #endif
7854
7855         status = pthread_create( &t, &attr, task, NULL );
7856         if( status ) return status;
7857
7858 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7859         if( detach ) {
7860                 /* give thread a chance to complete */
7861                 /* it should remain joinable and hence detachable */
7862                 sleep( 1 );
7863
7864                 status = pthread_detach( t );
7865                 if( status ) return status;
7866         }
7867 #endif
7868
7869 #else
7870         /* Draft 4 pthreads */
7871         status = pthread_create( &t, pthread_attr_default, task, NULL );
7872         if( status ) return status;
7873
7874         if( detach ) {
7875                 /* give thread a chance to complete */
7876                 /* it should remain joinable and hence detachable */
7877                 sleep( 1 );
7878
7879                 status = pthread_detach( &t );
7880                 if( status ) return status;
7881         }
7882 #endif
7883
7884 #ifdef HAVE_LINUX_THREADS
7885         pthread_kill_other_threads_np();
7886 #endif
7887
7888         return 0;
7889
7890 }
7891
7892 EOF
7893 if { (eval echo configure:7894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7894 then
7895   ol_cv_pthread_pthread=yes
7896 else
7897   echo "configure: failed program was:" >&5
7898   cat conftest.$ac_ext >&5
7899   rm -fr conftest*
7900   ol_cv_pthread_pthread=no
7901 fi
7902 rm -fr conftest*
7903 fi
7904
7905
7906                 # restore the LIBS
7907                 LIBS="$ol_LIBS"
7908         
7909 fi
7910
7911 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7912
7913         if test $ol_cv_pthread_pthread = yes ; then
7914                 ol_link_pthreads="-pthread"
7915                 ol_link_threads=posix
7916         fi
7917 fi
7918
7919                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7920 if test "$ol_link_threads" = no ; then
7921         # try -pthreads
7922         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7923 echo "configure:7924: checking for pthread link with -pthreads" >&5
7924 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7925   echo $ac_n "(cached) $ac_c" 1>&6
7926 else
7927   
7928                 # save the flags
7929                 ol_LIBS="$LIBS"
7930                 LIBS="-pthreads $LIBS"
7931
7932                 if test "$cross_compiling" = yes; then
7933   cat > conftest.$ac_ext <<EOF
7934 #line 7935 "configure"
7935 #include "confdefs.h"
7936 /* pthread test headers */
7937 #include <pthread.h>
7938 #ifndef NULL
7939 #define NULL (void*)0
7940 #endif
7941
7942 static void *task(p)
7943         void *p;
7944 {
7945         return (void *) (p == NULL);
7946 }
7947
7948 int main() {
7949
7950         /* pthread test function */
7951         pthread_t t;
7952         int status;
7953         int detach = 1;
7954
7955 #ifdef HAVE_PTHREADS_FINAL
7956         /* Final pthreads */
7957         pthread_attr_t attr;
7958
7959         status = pthread_attr_init(&attr);
7960         if( status ) return status;
7961
7962 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7963         if( !detach ) {
7964 #if defined( PTHREAD_CREATE_JOINABLE )
7965                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7966 #else
7967                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7968 #endif
7969
7970 #ifdef PTHREAD_CREATE_DETACHED
7971         } else {
7972                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7973 #endif
7974         }
7975         if( status ) return status;
7976 #endif
7977
7978         status = pthread_create( &t, &attr, task, NULL );
7979         if( status ) return status;
7980
7981 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7982         if( detach ) {
7983                 /* give thread a chance to complete */
7984                 /* it should remain joinable and hence detachable */
7985                 sleep( 1 );
7986
7987                 status = pthread_detach( t );
7988                 if( status ) return status;
7989         }
7990 #endif
7991
7992 #else
7993         /* Draft 4 pthreads */
7994         status = pthread_create( &t, pthread_attr_default, task, NULL );
7995         if( status ) return status;
7996
7997         if( detach ) {
7998                 /* give thread a chance to complete */
7999                 /* it should remain joinable and hence detachable */
8000                 sleep( 1 );
8001
8002                 status = pthread_detach( &t );
8003                 if( status ) return status;
8004         }
8005 #endif
8006
8007 #ifdef HAVE_LINUX_THREADS
8008         pthread_kill_other_threads_np();
8009 #endif
8010
8011         return 0;
8012
8013 ; return 0; }
8014 EOF
8015 if { (eval echo configure:8016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8016   rm -rf conftest*
8017   ol_cv_pthread_pthreads=yes
8018 else
8019   echo "configure: failed program was:" >&5
8020   cat conftest.$ac_ext >&5
8021   rm -rf conftest*
8022   ol_cv_pthread_pthreads=no
8023 fi
8024 rm -f conftest*
8025 else
8026   cat > conftest.$ac_ext <<EOF
8027 #line 8028 "configure"
8028 #include "confdefs.h"
8029 /* pthread test headers */
8030 #include <pthread.h>
8031 #ifndef NULL
8032 #define NULL (void*)0
8033 #endif
8034
8035 static void *task(p)
8036         void *p;
8037 {
8038         return (void *) (p == NULL);
8039 }
8040
8041
8042 int main(argc, argv)
8043         int argc;
8044         char **argv;
8045 {
8046
8047         /* pthread test function */
8048         pthread_t t;
8049         int status;
8050         int detach = 1;
8051
8052 #ifdef HAVE_PTHREADS_FINAL
8053         /* Final pthreads */
8054         pthread_attr_t attr;
8055
8056         status = pthread_attr_init(&attr);
8057         if( status ) return status;
8058
8059 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8060         if( !detach ) {
8061 #if defined( PTHREAD_CREATE_JOINABLE )
8062                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8063 #else
8064                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8065 #endif
8066
8067 #ifdef PTHREAD_CREATE_DETACHED
8068         } else {
8069                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8070 #endif
8071         }
8072         if( status ) return status;
8073 #endif
8074
8075         status = pthread_create( &t, &attr, task, NULL );
8076         if( status ) return status;
8077
8078 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8079         if( detach ) {
8080                 /* give thread a chance to complete */
8081                 /* it should remain joinable and hence detachable */
8082                 sleep( 1 );
8083
8084                 status = pthread_detach( t );
8085                 if( status ) return status;
8086         }
8087 #endif
8088
8089 #else
8090         /* Draft 4 pthreads */
8091         status = pthread_create( &t, pthread_attr_default, task, NULL );
8092         if( status ) return status;
8093
8094         if( detach ) {
8095                 /* give thread a chance to complete */
8096                 /* it should remain joinable and hence detachable */
8097                 sleep( 1 );
8098
8099                 status = pthread_detach( &t );
8100                 if( status ) return status;
8101         }
8102 #endif
8103
8104 #ifdef HAVE_LINUX_THREADS
8105         pthread_kill_other_threads_np();
8106 #endif
8107
8108         return 0;
8109
8110 }
8111
8112 EOF
8113 if { (eval echo configure:8114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8114 then
8115   ol_cv_pthread_pthreads=yes
8116 else
8117   echo "configure: failed program was:" >&5
8118   cat conftest.$ac_ext >&5
8119   rm -fr conftest*
8120   ol_cv_pthread_pthreads=no
8121 fi
8122 rm -fr conftest*
8123 fi
8124
8125
8126                 # restore the LIBS
8127                 LIBS="$ol_LIBS"
8128         
8129 fi
8130
8131 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
8132
8133         if test $ol_cv_pthread_pthreads = yes ; then
8134                 ol_link_pthreads="-pthreads"
8135                 ol_link_threads=posix
8136         fi
8137 fi
8138
8139                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
8140 if test "$ol_link_threads" = no ; then
8141         # try -mthreads
8142         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
8143 echo "configure:8144: checking for pthread link with -mthreads" >&5
8144 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
8145   echo $ac_n "(cached) $ac_c" 1>&6
8146 else
8147   
8148                 # save the flags
8149                 ol_LIBS="$LIBS"
8150                 LIBS="-mthreads $LIBS"
8151
8152                 if test "$cross_compiling" = yes; then
8153   cat > conftest.$ac_ext <<EOF
8154 #line 8155 "configure"
8155 #include "confdefs.h"
8156 /* pthread test headers */
8157 #include <pthread.h>
8158 #ifndef NULL
8159 #define NULL (void*)0
8160 #endif
8161
8162 static void *task(p)
8163         void *p;
8164 {
8165         return (void *) (p == NULL);
8166 }
8167
8168 int main() {
8169
8170         /* pthread test function */
8171         pthread_t t;
8172         int status;
8173         int detach = 1;
8174
8175 #ifdef HAVE_PTHREADS_FINAL
8176         /* Final pthreads */
8177         pthread_attr_t attr;
8178
8179         status = pthread_attr_init(&attr);
8180         if( status ) return status;
8181
8182 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8183         if( !detach ) {
8184 #if defined( PTHREAD_CREATE_JOINABLE )
8185                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8186 #else
8187                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8188 #endif
8189
8190 #ifdef PTHREAD_CREATE_DETACHED
8191         } else {
8192                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8193 #endif
8194         }
8195         if( status ) return status;
8196 #endif
8197
8198         status = pthread_create( &t, &attr, task, NULL );
8199         if( status ) return status;
8200
8201 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8202         if( detach ) {
8203                 /* give thread a chance to complete */
8204                 /* it should remain joinable and hence detachable */
8205                 sleep( 1 );
8206
8207                 status = pthread_detach( t );
8208                 if( status ) return status;
8209         }
8210 #endif
8211
8212 #else
8213         /* Draft 4 pthreads */
8214         status = pthread_create( &t, pthread_attr_default, task, NULL );
8215         if( status ) return status;
8216
8217         if( detach ) {
8218                 /* give thread a chance to complete */
8219                 /* it should remain joinable and hence detachable */
8220                 sleep( 1 );
8221
8222                 status = pthread_detach( &t );
8223                 if( status ) return status;
8224         }
8225 #endif
8226
8227 #ifdef HAVE_LINUX_THREADS
8228         pthread_kill_other_threads_np();
8229 #endif
8230
8231         return 0;
8232
8233 ; return 0; }
8234 EOF
8235 if { (eval echo configure:8236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8236   rm -rf conftest*
8237   ol_cv_pthread_mthreads=yes
8238 else
8239   echo "configure: failed program was:" >&5
8240   cat conftest.$ac_ext >&5
8241   rm -rf conftest*
8242   ol_cv_pthread_mthreads=no
8243 fi
8244 rm -f conftest*
8245 else
8246   cat > conftest.$ac_ext <<EOF
8247 #line 8248 "configure"
8248 #include "confdefs.h"
8249 /* pthread test headers */
8250 #include <pthread.h>
8251 #ifndef NULL
8252 #define NULL (void*)0
8253 #endif
8254
8255 static void *task(p)
8256         void *p;
8257 {
8258         return (void *) (p == NULL);
8259 }
8260
8261
8262 int main(argc, argv)
8263         int argc;
8264         char **argv;
8265 {
8266
8267         /* pthread test function */
8268         pthread_t t;
8269         int status;
8270         int detach = 1;
8271
8272 #ifdef HAVE_PTHREADS_FINAL
8273         /* Final pthreads */
8274         pthread_attr_t attr;
8275
8276         status = pthread_attr_init(&attr);
8277         if( status ) return status;
8278
8279 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8280         if( !detach ) {
8281 #if defined( PTHREAD_CREATE_JOINABLE )
8282                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8283 #else
8284                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8285 #endif
8286
8287 #ifdef PTHREAD_CREATE_DETACHED
8288         } else {
8289                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8290 #endif
8291         }
8292         if( status ) return status;
8293 #endif
8294
8295         status = pthread_create( &t, &attr, task, NULL );
8296         if( status ) return status;
8297
8298 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8299         if( detach ) {
8300                 /* give thread a chance to complete */
8301                 /* it should remain joinable and hence detachable */
8302                 sleep( 1 );
8303
8304                 status = pthread_detach( t );
8305                 if( status ) return status;
8306         }
8307 #endif
8308
8309 #else
8310         /* Draft 4 pthreads */
8311         status = pthread_create( &t, pthread_attr_default, task, NULL );
8312         if( status ) return status;
8313
8314         if( detach ) {
8315                 /* give thread a chance to complete */
8316                 /* it should remain joinable and hence detachable */
8317                 sleep( 1 );
8318
8319                 status = pthread_detach( &t );
8320                 if( status ) return status;
8321         }
8322 #endif
8323
8324 #ifdef HAVE_LINUX_THREADS
8325         pthread_kill_other_threads_np();
8326 #endif
8327
8328         return 0;
8329
8330 }
8331
8332 EOF
8333 if { (eval echo configure:8334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8334 then
8335   ol_cv_pthread_mthreads=yes
8336 else
8337   echo "configure: failed program was:" >&5
8338   cat conftest.$ac_ext >&5
8339   rm -fr conftest*
8340   ol_cv_pthread_mthreads=no
8341 fi
8342 rm -fr conftest*
8343 fi
8344
8345
8346                 # restore the LIBS
8347                 LIBS="$ol_LIBS"
8348         
8349 fi
8350
8351 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8352
8353         if test $ol_cv_pthread_mthreads = yes ; then
8354                 ol_link_pthreads="-mthreads"
8355                 ol_link_threads=posix
8356         fi
8357 fi
8358
8359                 # Pthread try link: -thread (ol_cv_pthread_thread)
8360 if test "$ol_link_threads" = no ; then
8361         # try -thread
8362         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8363 echo "configure:8364: checking for pthread link with -thread" >&5
8364 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8365   echo $ac_n "(cached) $ac_c" 1>&6
8366 else
8367   
8368                 # save the flags
8369                 ol_LIBS="$LIBS"
8370                 LIBS="-thread $LIBS"
8371
8372                 if test "$cross_compiling" = yes; then
8373   cat > conftest.$ac_ext <<EOF
8374 #line 8375 "configure"
8375 #include "confdefs.h"
8376 /* pthread test headers */
8377 #include <pthread.h>
8378 #ifndef NULL
8379 #define NULL (void*)0
8380 #endif
8381
8382 static void *task(p)
8383         void *p;
8384 {
8385         return (void *) (p == NULL);
8386 }
8387
8388 int main() {
8389
8390         /* pthread test function */
8391         pthread_t t;
8392         int status;
8393         int detach = 1;
8394
8395 #ifdef HAVE_PTHREADS_FINAL
8396         /* Final pthreads */
8397         pthread_attr_t attr;
8398
8399         status = pthread_attr_init(&attr);
8400         if( status ) return status;
8401
8402 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8403         if( !detach ) {
8404 #if defined( PTHREAD_CREATE_JOINABLE )
8405                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8406 #else
8407                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8408 #endif
8409
8410 #ifdef PTHREAD_CREATE_DETACHED
8411         } else {
8412                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8413 #endif
8414         }
8415         if( status ) return status;
8416 #endif
8417
8418         status = pthread_create( &t, &attr, task, NULL );
8419         if( status ) return status;
8420
8421 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8422         if( detach ) {
8423                 /* give thread a chance to complete */
8424                 /* it should remain joinable and hence detachable */
8425                 sleep( 1 );
8426
8427                 status = pthread_detach( t );
8428                 if( status ) return status;
8429         }
8430 #endif
8431
8432 #else
8433         /* Draft 4 pthreads */
8434         status = pthread_create( &t, pthread_attr_default, task, NULL );
8435         if( status ) return status;
8436
8437         if( detach ) {
8438                 /* give thread a chance to complete */
8439                 /* it should remain joinable and hence detachable */
8440                 sleep( 1 );
8441
8442                 status = pthread_detach( &t );
8443                 if( status ) return status;
8444         }
8445 #endif
8446
8447 #ifdef HAVE_LINUX_THREADS
8448         pthread_kill_other_threads_np();
8449 #endif
8450
8451         return 0;
8452
8453 ; return 0; }
8454 EOF
8455 if { (eval echo configure:8456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8456   rm -rf conftest*
8457   ol_cv_pthread_thread=yes
8458 else
8459   echo "configure: failed program was:" >&5
8460   cat conftest.$ac_ext >&5
8461   rm -rf conftest*
8462   ol_cv_pthread_thread=no
8463 fi
8464 rm -f conftest*
8465 else
8466   cat > conftest.$ac_ext <<EOF
8467 #line 8468 "configure"
8468 #include "confdefs.h"
8469 /* pthread test headers */
8470 #include <pthread.h>
8471 #ifndef NULL
8472 #define NULL (void*)0
8473 #endif
8474
8475 static void *task(p)
8476         void *p;
8477 {
8478         return (void *) (p == NULL);
8479 }
8480
8481
8482 int main(argc, argv)
8483         int argc;
8484         char **argv;
8485 {
8486
8487         /* pthread test function */
8488         pthread_t t;
8489         int status;
8490         int detach = 1;
8491
8492 #ifdef HAVE_PTHREADS_FINAL
8493         /* Final pthreads */
8494         pthread_attr_t attr;
8495
8496         status = pthread_attr_init(&attr);
8497         if( status ) return status;
8498
8499 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8500         if( !detach ) {
8501 #if defined( PTHREAD_CREATE_JOINABLE )
8502                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8503 #else
8504                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8505 #endif
8506
8507 #ifdef PTHREAD_CREATE_DETACHED
8508         } else {
8509                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8510 #endif
8511         }
8512         if( status ) return status;
8513 #endif
8514
8515         status = pthread_create( &t, &attr, task, NULL );
8516         if( status ) return status;
8517
8518 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8519         if( detach ) {
8520                 /* give thread a chance to complete */
8521                 /* it should remain joinable and hence detachable */
8522                 sleep( 1 );
8523
8524                 status = pthread_detach( t );
8525                 if( status ) return status;
8526         }
8527 #endif
8528
8529 #else
8530         /* Draft 4 pthreads */
8531         status = pthread_create( &t, pthread_attr_default, task, NULL );
8532         if( status ) return status;
8533
8534         if( detach ) {
8535                 /* give thread a chance to complete */
8536                 /* it should remain joinable and hence detachable */
8537                 sleep( 1 );
8538
8539                 status = pthread_detach( &t );
8540                 if( status ) return status;
8541         }
8542 #endif
8543
8544 #ifdef HAVE_LINUX_THREADS
8545         pthread_kill_other_threads_np();
8546 #endif
8547
8548         return 0;
8549
8550 }
8551
8552 EOF
8553 if { (eval echo configure:8554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8554 then
8555   ol_cv_pthread_thread=yes
8556 else
8557   echo "configure: failed program was:" >&5
8558   cat conftest.$ac_ext >&5
8559   rm -fr conftest*
8560   ol_cv_pthread_thread=no
8561 fi
8562 rm -fr conftest*
8563 fi
8564
8565
8566                 # restore the LIBS
8567                 LIBS="$ol_LIBS"
8568         
8569 fi
8570
8571 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8572
8573         if test $ol_cv_pthread_thread = yes ; then
8574                 ol_link_pthreads="-thread"
8575                 ol_link_threads=posix
8576         fi
8577 fi
8578
8579
8580                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8581 if test "$ol_link_threads" = no ; then
8582         # try -lpthread -lmach -lexc -lc_r
8583         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8584 echo "configure:8585: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8585 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8586   echo $ac_n "(cached) $ac_c" 1>&6
8587 else
8588   
8589                 # save the flags
8590                 ol_LIBS="$LIBS"
8591                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8592
8593                 if test "$cross_compiling" = yes; then
8594   cat > conftest.$ac_ext <<EOF
8595 #line 8596 "configure"
8596 #include "confdefs.h"
8597 /* pthread test headers */
8598 #include <pthread.h>
8599 #ifndef NULL
8600 #define NULL (void*)0
8601 #endif
8602
8603 static void *task(p)
8604         void *p;
8605 {
8606         return (void *) (p == NULL);
8607 }
8608
8609 int main() {
8610
8611         /* pthread test function */
8612         pthread_t t;
8613         int status;
8614         int detach = 1;
8615
8616 #ifdef HAVE_PTHREADS_FINAL
8617         /* Final pthreads */
8618         pthread_attr_t attr;
8619
8620         status = pthread_attr_init(&attr);
8621         if( status ) return status;
8622
8623 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8624         if( !detach ) {
8625 #if defined( PTHREAD_CREATE_JOINABLE )
8626                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8627 #else
8628                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8629 #endif
8630
8631 #ifdef PTHREAD_CREATE_DETACHED
8632         } else {
8633                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8634 #endif
8635         }
8636         if( status ) return status;
8637 #endif
8638
8639         status = pthread_create( &t, &attr, task, NULL );
8640         if( status ) return status;
8641
8642 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8643         if( detach ) {
8644                 /* give thread a chance to complete */
8645                 /* it should remain joinable and hence detachable */
8646                 sleep( 1 );
8647
8648                 status = pthread_detach( t );
8649                 if( status ) return status;
8650         }
8651 #endif
8652
8653 #else
8654         /* Draft 4 pthreads */
8655         status = pthread_create( &t, pthread_attr_default, task, NULL );
8656         if( status ) return status;
8657
8658         if( detach ) {
8659                 /* give thread a chance to complete */
8660                 /* it should remain joinable and hence detachable */
8661                 sleep( 1 );
8662
8663                 status = pthread_detach( &t );
8664                 if( status ) return status;
8665         }
8666 #endif
8667
8668 #ifdef HAVE_LINUX_THREADS
8669         pthread_kill_other_threads_np();
8670 #endif
8671
8672         return 0;
8673
8674 ; return 0; }
8675 EOF
8676 if { (eval echo configure:8677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8677   rm -rf conftest*
8678   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8679 else
8680   echo "configure: failed program was:" >&5
8681   cat conftest.$ac_ext >&5
8682   rm -rf conftest*
8683   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8684 fi
8685 rm -f conftest*
8686 else
8687   cat > conftest.$ac_ext <<EOF
8688 #line 8689 "configure"
8689 #include "confdefs.h"
8690 /* pthread test headers */
8691 #include <pthread.h>
8692 #ifndef NULL
8693 #define NULL (void*)0
8694 #endif
8695
8696 static void *task(p)
8697         void *p;
8698 {
8699         return (void *) (p == NULL);
8700 }
8701
8702
8703 int main(argc, argv)
8704         int argc;
8705         char **argv;
8706 {
8707
8708         /* pthread test function */
8709         pthread_t t;
8710         int status;
8711         int detach = 1;
8712
8713 #ifdef HAVE_PTHREADS_FINAL
8714         /* Final pthreads */
8715         pthread_attr_t attr;
8716
8717         status = pthread_attr_init(&attr);
8718         if( status ) return status;
8719
8720 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8721         if( !detach ) {
8722 #if defined( PTHREAD_CREATE_JOINABLE )
8723                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8724 #else
8725                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8726 #endif
8727
8728 #ifdef PTHREAD_CREATE_DETACHED
8729         } else {
8730                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8731 #endif
8732         }
8733         if( status ) return status;
8734 #endif
8735
8736         status = pthread_create( &t, &attr, task, NULL );
8737         if( status ) return status;
8738
8739 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8740         if( detach ) {
8741                 /* give thread a chance to complete */
8742                 /* it should remain joinable and hence detachable */
8743                 sleep( 1 );
8744
8745                 status = pthread_detach( t );
8746                 if( status ) return status;
8747         }
8748 #endif
8749
8750 #else
8751         /* Draft 4 pthreads */
8752         status = pthread_create( &t, pthread_attr_default, task, NULL );
8753         if( status ) return status;
8754
8755         if( detach ) {
8756                 /* give thread a chance to complete */
8757                 /* it should remain joinable and hence detachable */
8758                 sleep( 1 );
8759
8760                 status = pthread_detach( &t );
8761                 if( status ) return status;
8762         }
8763 #endif
8764
8765 #ifdef HAVE_LINUX_THREADS
8766         pthread_kill_other_threads_np();
8767 #endif
8768
8769         return 0;
8770
8771 }
8772
8773 EOF
8774 if { (eval echo configure:8775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8775 then
8776   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8777 else
8778   echo "configure: failed program was:" >&5
8779   cat conftest.$ac_ext >&5
8780   rm -fr conftest*
8781   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8782 fi
8783 rm -fr conftest*
8784 fi
8785
8786
8787                 # restore the LIBS
8788                 LIBS="$ol_LIBS"
8789         
8790 fi
8791
8792 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8793
8794         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8795                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8796                 ol_link_threads=posix
8797         fi
8798 fi
8799
8800                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8801 if test "$ol_link_threads" = no ; then
8802         # try -lpthread -lmach -lexc
8803         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8804 echo "configure:8805: checking for pthread link with -lpthread -lmach -lexc" >&5
8805 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8806   echo $ac_n "(cached) $ac_c" 1>&6
8807 else
8808   
8809                 # save the flags
8810                 ol_LIBS="$LIBS"
8811                 LIBS="-lpthread -lmach -lexc $LIBS"
8812
8813                 if test "$cross_compiling" = yes; then
8814   cat > conftest.$ac_ext <<EOF
8815 #line 8816 "configure"
8816 #include "confdefs.h"
8817 /* pthread test headers */
8818 #include <pthread.h>
8819 #ifndef NULL
8820 #define NULL (void*)0
8821 #endif
8822
8823 static void *task(p)
8824         void *p;
8825 {
8826         return (void *) (p == NULL);
8827 }
8828
8829 int main() {
8830
8831         /* pthread test function */
8832         pthread_t t;
8833         int status;
8834         int detach = 1;
8835
8836 #ifdef HAVE_PTHREADS_FINAL
8837         /* Final pthreads */
8838         pthread_attr_t attr;
8839
8840         status = pthread_attr_init(&attr);
8841         if( status ) return status;
8842
8843 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8844         if( !detach ) {
8845 #if defined( PTHREAD_CREATE_JOINABLE )
8846                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8847 #else
8848                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8849 #endif
8850
8851 #ifdef PTHREAD_CREATE_DETACHED
8852         } else {
8853                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8854 #endif
8855         }
8856         if( status ) return status;
8857 #endif
8858
8859         status = pthread_create( &t, &attr, task, NULL );
8860         if( status ) return status;
8861
8862 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8863         if( detach ) {
8864                 /* give thread a chance to complete */
8865                 /* it should remain joinable and hence detachable */
8866                 sleep( 1 );
8867
8868                 status = pthread_detach( t );
8869                 if( status ) return status;
8870         }
8871 #endif
8872
8873 #else
8874         /* Draft 4 pthreads */
8875         status = pthread_create( &t, pthread_attr_default, task, NULL );
8876         if( status ) return status;
8877
8878         if( detach ) {
8879                 /* give thread a chance to complete */
8880                 /* it should remain joinable and hence detachable */
8881                 sleep( 1 );
8882
8883                 status = pthread_detach( &t );
8884                 if( status ) return status;
8885         }
8886 #endif
8887
8888 #ifdef HAVE_LINUX_THREADS
8889         pthread_kill_other_threads_np();
8890 #endif
8891
8892         return 0;
8893
8894 ; return 0; }
8895 EOF
8896 if { (eval echo configure:8897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8897   rm -rf conftest*
8898   ol_cv_pthread_lpthread_lmach_lexc=yes
8899 else
8900   echo "configure: failed program was:" >&5
8901   cat conftest.$ac_ext >&5
8902   rm -rf conftest*
8903   ol_cv_pthread_lpthread_lmach_lexc=no
8904 fi
8905 rm -f conftest*
8906 else
8907   cat > conftest.$ac_ext <<EOF
8908 #line 8909 "configure"
8909 #include "confdefs.h"
8910 /* pthread test headers */
8911 #include <pthread.h>
8912 #ifndef NULL
8913 #define NULL (void*)0
8914 #endif
8915
8916 static void *task(p)
8917         void *p;
8918 {
8919         return (void *) (p == NULL);
8920 }
8921
8922
8923 int main(argc, argv)
8924         int argc;
8925         char **argv;
8926 {
8927
8928         /* pthread test function */
8929         pthread_t t;
8930         int status;
8931         int detach = 1;
8932
8933 #ifdef HAVE_PTHREADS_FINAL
8934         /* Final pthreads */
8935         pthread_attr_t attr;
8936
8937         status = pthread_attr_init(&attr);
8938         if( status ) return status;
8939
8940 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8941         if( !detach ) {
8942 #if defined( PTHREAD_CREATE_JOINABLE )
8943                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8944 #else
8945                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8946 #endif
8947
8948 #ifdef PTHREAD_CREATE_DETACHED
8949         } else {
8950                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8951 #endif
8952         }
8953         if( status ) return status;
8954 #endif
8955
8956         status = pthread_create( &t, &attr, task, NULL );
8957         if( status ) return status;
8958
8959 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8960         if( detach ) {
8961                 /* give thread a chance to complete */
8962                 /* it should remain joinable and hence detachable */
8963                 sleep( 1 );
8964
8965                 status = pthread_detach( t );
8966                 if( status ) return status;
8967         }
8968 #endif
8969
8970 #else
8971         /* Draft 4 pthreads */
8972         status = pthread_create( &t, pthread_attr_default, task, NULL );
8973         if( status ) return status;
8974
8975         if( detach ) {
8976                 /* give thread a chance to complete */
8977                 /* it should remain joinable and hence detachable */
8978                 sleep( 1 );
8979
8980                 status = pthread_detach( &t );
8981                 if( status ) return status;
8982         }
8983 #endif
8984
8985 #ifdef HAVE_LINUX_THREADS
8986         pthread_kill_other_threads_np();
8987 #endif
8988
8989         return 0;
8990
8991 }
8992
8993 EOF
8994 if { (eval echo configure:8995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8995 then
8996   ol_cv_pthread_lpthread_lmach_lexc=yes
8997 else
8998   echo "configure: failed program was:" >&5
8999   cat conftest.$ac_ext >&5
9000   rm -fr conftest*
9001   ol_cv_pthread_lpthread_lmach_lexc=no
9002 fi
9003 rm -fr conftest*
9004 fi
9005
9006
9007                 # restore the LIBS
9008                 LIBS="$ol_LIBS"
9009         
9010 fi
9011
9012 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
9013
9014         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
9015                 ol_link_pthreads="-lpthread -lmach -lexc"
9016                 ol_link_threads=posix
9017         fi
9018 fi
9019
9020
9021                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
9022 if test "$ol_link_threads" = no ; then
9023         # try -lpthread -Wl,-woff,85
9024         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
9025 echo "configure:9026: checking for pthread link with -lpthread -Wl,-woff,85" >&5
9026 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
9027   echo $ac_n "(cached) $ac_c" 1>&6
9028 else
9029   
9030                 # save the flags
9031                 ol_LIBS="$LIBS"
9032                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
9033
9034                 if test "$cross_compiling" = yes; then
9035   cat > conftest.$ac_ext <<EOF
9036 #line 9037 "configure"
9037 #include "confdefs.h"
9038 /* pthread test headers */
9039 #include <pthread.h>
9040 #ifndef NULL
9041 #define NULL (void*)0
9042 #endif
9043
9044 static void *task(p)
9045         void *p;
9046 {
9047         return (void *) (p == NULL);
9048 }
9049
9050 int main() {
9051
9052         /* pthread test function */
9053         pthread_t t;
9054         int status;
9055         int detach = 1;
9056
9057 #ifdef HAVE_PTHREADS_FINAL
9058         /* Final pthreads */
9059         pthread_attr_t attr;
9060
9061         status = pthread_attr_init(&attr);
9062         if( status ) return status;
9063
9064 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9065         if( !detach ) {
9066 #if defined( PTHREAD_CREATE_JOINABLE )
9067                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9068 #else
9069                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9070 #endif
9071
9072 #ifdef PTHREAD_CREATE_DETACHED
9073         } else {
9074                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9075 #endif
9076         }
9077         if( status ) return status;
9078 #endif
9079
9080         status = pthread_create( &t, &attr, task, NULL );
9081         if( status ) return status;
9082
9083 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9084         if( detach ) {
9085                 /* give thread a chance to complete */
9086                 /* it should remain joinable and hence detachable */
9087                 sleep( 1 );
9088
9089                 status = pthread_detach( t );
9090                 if( status ) return status;
9091         }
9092 #endif
9093
9094 #else
9095         /* Draft 4 pthreads */
9096         status = pthread_create( &t, pthread_attr_default, task, NULL );
9097         if( status ) return status;
9098
9099         if( detach ) {
9100                 /* give thread a chance to complete */
9101                 /* it should remain joinable and hence detachable */
9102                 sleep( 1 );
9103
9104                 status = pthread_detach( &t );
9105                 if( status ) return status;
9106         }
9107 #endif
9108
9109 #ifdef HAVE_LINUX_THREADS
9110         pthread_kill_other_threads_np();
9111 #endif
9112
9113         return 0;
9114
9115 ; return 0; }
9116 EOF
9117 if { (eval echo configure:9118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9118   rm -rf conftest*
9119   ol_cv_pthread_lib_lpthread_woff=yes
9120 else
9121   echo "configure: failed program was:" >&5
9122   cat conftest.$ac_ext >&5
9123   rm -rf conftest*
9124   ol_cv_pthread_lib_lpthread_woff=no
9125 fi
9126 rm -f conftest*
9127 else
9128   cat > conftest.$ac_ext <<EOF
9129 #line 9130 "configure"
9130 #include "confdefs.h"
9131 /* pthread test headers */
9132 #include <pthread.h>
9133 #ifndef NULL
9134 #define NULL (void*)0
9135 #endif
9136
9137 static void *task(p)
9138         void *p;
9139 {
9140         return (void *) (p == NULL);
9141 }
9142
9143
9144 int main(argc, argv)
9145         int argc;
9146         char **argv;
9147 {
9148
9149         /* pthread test function */
9150         pthread_t t;
9151         int status;
9152         int detach = 1;
9153
9154 #ifdef HAVE_PTHREADS_FINAL
9155         /* Final pthreads */
9156         pthread_attr_t attr;
9157
9158         status = pthread_attr_init(&attr);
9159         if( status ) return status;
9160
9161 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9162         if( !detach ) {
9163 #if defined( PTHREAD_CREATE_JOINABLE )
9164                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9165 #else
9166                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9167 #endif
9168
9169 #ifdef PTHREAD_CREATE_DETACHED
9170         } else {
9171                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9172 #endif
9173         }
9174         if( status ) return status;
9175 #endif
9176
9177         status = pthread_create( &t, &attr, task, NULL );
9178         if( status ) return status;
9179
9180 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9181         if( detach ) {
9182                 /* give thread a chance to complete */
9183                 /* it should remain joinable and hence detachable */
9184                 sleep( 1 );
9185
9186                 status = pthread_detach( t );
9187                 if( status ) return status;
9188         }
9189 #endif
9190
9191 #else
9192         /* Draft 4 pthreads */
9193         status = pthread_create( &t, pthread_attr_default, task, NULL );
9194         if( status ) return status;
9195
9196         if( detach ) {
9197                 /* give thread a chance to complete */
9198                 /* it should remain joinable and hence detachable */
9199                 sleep( 1 );
9200
9201                 status = pthread_detach( &t );
9202                 if( status ) return status;
9203         }
9204 #endif
9205
9206 #ifdef HAVE_LINUX_THREADS
9207         pthread_kill_other_threads_np();
9208 #endif
9209
9210         return 0;
9211
9212 }
9213
9214 EOF
9215 if { (eval echo configure:9216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9216 then
9217   ol_cv_pthread_lib_lpthread_woff=yes
9218 else
9219   echo "configure: failed program was:" >&5
9220   cat conftest.$ac_ext >&5
9221   rm -fr conftest*
9222   ol_cv_pthread_lib_lpthread_woff=no
9223 fi
9224 rm -fr conftest*
9225 fi
9226
9227
9228                 # restore the LIBS
9229                 LIBS="$ol_LIBS"
9230         
9231 fi
9232
9233 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9234
9235         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9236                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9237                 ol_link_threads=posix
9238         fi
9239 fi
9240
9241
9242                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9243 if test "$ol_link_threads" = no ; then
9244         # try -lpthread
9245         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9246 echo "configure:9247: checking for pthread link with -lpthread" >&5
9247 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9248   echo $ac_n "(cached) $ac_c" 1>&6
9249 else
9250   
9251                 # save the flags
9252                 ol_LIBS="$LIBS"
9253                 LIBS="-lpthread $LIBS"
9254
9255                 if test "$cross_compiling" = yes; then
9256   cat > conftest.$ac_ext <<EOF
9257 #line 9258 "configure"
9258 #include "confdefs.h"
9259 /* pthread test headers */
9260 #include <pthread.h>
9261 #ifndef NULL
9262 #define NULL (void*)0
9263 #endif
9264
9265 static void *task(p)
9266         void *p;
9267 {
9268         return (void *) (p == NULL);
9269 }
9270
9271 int main() {
9272
9273         /* pthread test function */
9274         pthread_t t;
9275         int status;
9276         int detach = 1;
9277
9278 #ifdef HAVE_PTHREADS_FINAL
9279         /* Final pthreads */
9280         pthread_attr_t attr;
9281
9282         status = pthread_attr_init(&attr);
9283         if( status ) return status;
9284
9285 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9286         if( !detach ) {
9287 #if defined( PTHREAD_CREATE_JOINABLE )
9288                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9289 #else
9290                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9291 #endif
9292
9293 #ifdef PTHREAD_CREATE_DETACHED
9294         } else {
9295                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9296 #endif
9297         }
9298         if( status ) return status;
9299 #endif
9300
9301         status = pthread_create( &t, &attr, task, NULL );
9302         if( status ) return status;
9303
9304 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9305         if( detach ) {
9306                 /* give thread a chance to complete */
9307                 /* it should remain joinable and hence detachable */
9308                 sleep( 1 );
9309
9310                 status = pthread_detach( t );
9311                 if( status ) return status;
9312         }
9313 #endif
9314
9315 #else
9316         /* Draft 4 pthreads */
9317         status = pthread_create( &t, pthread_attr_default, task, NULL );
9318         if( status ) return status;
9319
9320         if( detach ) {
9321                 /* give thread a chance to complete */
9322                 /* it should remain joinable and hence detachable */
9323                 sleep( 1 );
9324
9325                 status = pthread_detach( &t );
9326                 if( status ) return status;
9327         }
9328 #endif
9329
9330 #ifdef HAVE_LINUX_THREADS
9331         pthread_kill_other_threads_np();
9332 #endif
9333
9334         return 0;
9335
9336 ; return 0; }
9337 EOF
9338 if { (eval echo configure:9339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9339   rm -rf conftest*
9340   ol_cv_pthread_lpthread=yes
9341 else
9342   echo "configure: failed program was:" >&5
9343   cat conftest.$ac_ext >&5
9344   rm -rf conftest*
9345   ol_cv_pthread_lpthread=no
9346 fi
9347 rm -f conftest*
9348 else
9349   cat > conftest.$ac_ext <<EOF
9350 #line 9351 "configure"
9351 #include "confdefs.h"
9352 /* pthread test headers */
9353 #include <pthread.h>
9354 #ifndef NULL
9355 #define NULL (void*)0
9356 #endif
9357
9358 static void *task(p)
9359         void *p;
9360 {
9361         return (void *) (p == NULL);
9362 }
9363
9364
9365 int main(argc, argv)
9366         int argc;
9367         char **argv;
9368 {
9369
9370         /* pthread test function */
9371         pthread_t t;
9372         int status;
9373         int detach = 1;
9374
9375 #ifdef HAVE_PTHREADS_FINAL
9376         /* Final pthreads */
9377         pthread_attr_t attr;
9378
9379         status = pthread_attr_init(&attr);
9380         if( status ) return status;
9381
9382 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9383         if( !detach ) {
9384 #if defined( PTHREAD_CREATE_JOINABLE )
9385                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9386 #else
9387                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9388 #endif
9389
9390 #ifdef PTHREAD_CREATE_DETACHED
9391         } else {
9392                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9393 #endif
9394         }
9395         if( status ) return status;
9396 #endif
9397
9398         status = pthread_create( &t, &attr, task, NULL );
9399         if( status ) return status;
9400
9401 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9402         if( detach ) {
9403                 /* give thread a chance to complete */
9404                 /* it should remain joinable and hence detachable */
9405                 sleep( 1 );
9406
9407                 status = pthread_detach( t );
9408                 if( status ) return status;
9409         }
9410 #endif
9411
9412 #else
9413         /* Draft 4 pthreads */
9414         status = pthread_create( &t, pthread_attr_default, task, NULL );
9415         if( status ) return status;
9416
9417         if( detach ) {
9418                 /* give thread a chance to complete */
9419                 /* it should remain joinable and hence detachable */
9420                 sleep( 1 );
9421
9422                 status = pthread_detach( &t );
9423                 if( status ) return status;
9424         }
9425 #endif
9426
9427 #ifdef HAVE_LINUX_THREADS
9428         pthread_kill_other_threads_np();
9429 #endif
9430
9431         return 0;
9432
9433 }
9434
9435 EOF
9436 if { (eval echo configure:9437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9437 then
9438   ol_cv_pthread_lpthread=yes
9439 else
9440   echo "configure: failed program was:" >&5
9441   cat conftest.$ac_ext >&5
9442   rm -fr conftest*
9443   ol_cv_pthread_lpthread=no
9444 fi
9445 rm -fr conftest*
9446 fi
9447
9448
9449                 # restore the LIBS
9450                 LIBS="$ol_LIBS"
9451         
9452 fi
9453
9454 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9455
9456         if test $ol_cv_pthread_lpthread = yes ; then
9457                 ol_link_pthreads="-lpthread"
9458                 ol_link_threads=posix
9459         fi
9460 fi
9461
9462                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9463 if test "$ol_link_threads" = no ; then
9464         # try -lc_r
9465         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9466 echo "configure:9467: checking for pthread link with -lc_r" >&5
9467 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9468   echo $ac_n "(cached) $ac_c" 1>&6
9469 else
9470   
9471                 # save the flags
9472                 ol_LIBS="$LIBS"
9473                 LIBS="-lc_r $LIBS"
9474
9475                 if test "$cross_compiling" = yes; then
9476   cat > conftest.$ac_ext <<EOF
9477 #line 9478 "configure"
9478 #include "confdefs.h"
9479 /* pthread test headers */
9480 #include <pthread.h>
9481 #ifndef NULL
9482 #define NULL (void*)0
9483 #endif
9484
9485 static void *task(p)
9486         void *p;
9487 {
9488         return (void *) (p == NULL);
9489 }
9490
9491 int main() {
9492
9493         /* pthread test function */
9494         pthread_t t;
9495         int status;
9496         int detach = 1;
9497
9498 #ifdef HAVE_PTHREADS_FINAL
9499         /* Final pthreads */
9500         pthread_attr_t attr;
9501
9502         status = pthread_attr_init(&attr);
9503         if( status ) return status;
9504
9505 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9506         if( !detach ) {
9507 #if defined( PTHREAD_CREATE_JOINABLE )
9508                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9509 #else
9510                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9511 #endif
9512
9513 #ifdef PTHREAD_CREATE_DETACHED
9514         } else {
9515                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9516 #endif
9517         }
9518         if( status ) return status;
9519 #endif
9520
9521         status = pthread_create( &t, &attr, task, NULL );
9522         if( status ) return status;
9523
9524 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9525         if( detach ) {
9526                 /* give thread a chance to complete */
9527                 /* it should remain joinable and hence detachable */
9528                 sleep( 1 );
9529
9530                 status = pthread_detach( t );
9531                 if( status ) return status;
9532         }
9533 #endif
9534
9535 #else
9536         /* Draft 4 pthreads */
9537         status = pthread_create( &t, pthread_attr_default, task, NULL );
9538         if( status ) return status;
9539
9540         if( detach ) {
9541                 /* give thread a chance to complete */
9542                 /* it should remain joinable and hence detachable */
9543                 sleep( 1 );
9544
9545                 status = pthread_detach( &t );
9546                 if( status ) return status;
9547         }
9548 #endif
9549
9550 #ifdef HAVE_LINUX_THREADS
9551         pthread_kill_other_threads_np();
9552 #endif
9553
9554         return 0;
9555
9556 ; return 0; }
9557 EOF
9558 if { (eval echo configure:9559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9559   rm -rf conftest*
9560   ol_cv_pthread_lc_r=yes
9561 else
9562   echo "configure: failed program was:" >&5
9563   cat conftest.$ac_ext >&5
9564   rm -rf conftest*
9565   ol_cv_pthread_lc_r=no
9566 fi
9567 rm -f conftest*
9568 else
9569   cat > conftest.$ac_ext <<EOF
9570 #line 9571 "configure"
9571 #include "confdefs.h"
9572 /* pthread test headers */
9573 #include <pthread.h>
9574 #ifndef NULL
9575 #define NULL (void*)0
9576 #endif
9577
9578 static void *task(p)
9579         void *p;
9580 {
9581         return (void *) (p == NULL);
9582 }
9583
9584
9585 int main(argc, argv)
9586         int argc;
9587         char **argv;
9588 {
9589
9590         /* pthread test function */
9591         pthread_t t;
9592         int status;
9593         int detach = 1;
9594
9595 #ifdef HAVE_PTHREADS_FINAL
9596         /* Final pthreads */
9597         pthread_attr_t attr;
9598
9599         status = pthread_attr_init(&attr);
9600         if( status ) return status;
9601
9602 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9603         if( !detach ) {
9604 #if defined( PTHREAD_CREATE_JOINABLE )
9605                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9606 #else
9607                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9608 #endif
9609
9610 #ifdef PTHREAD_CREATE_DETACHED
9611         } else {
9612                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9613 #endif
9614         }
9615         if( status ) return status;
9616 #endif
9617
9618         status = pthread_create( &t, &attr, task, NULL );
9619         if( status ) return status;
9620
9621 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9622         if( detach ) {
9623                 /* give thread a chance to complete */
9624                 /* it should remain joinable and hence detachable */
9625                 sleep( 1 );
9626
9627                 status = pthread_detach( t );
9628                 if( status ) return status;
9629         }
9630 #endif
9631
9632 #else
9633         /* Draft 4 pthreads */
9634         status = pthread_create( &t, pthread_attr_default, task, NULL );
9635         if( status ) return status;
9636
9637         if( detach ) {
9638                 /* give thread a chance to complete */
9639                 /* it should remain joinable and hence detachable */
9640                 sleep( 1 );
9641
9642                 status = pthread_detach( &t );
9643                 if( status ) return status;
9644         }
9645 #endif
9646
9647 #ifdef HAVE_LINUX_THREADS
9648         pthread_kill_other_threads_np();
9649 #endif
9650
9651         return 0;
9652
9653 }
9654
9655 EOF
9656 if { (eval echo configure:9657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9657 then
9658   ol_cv_pthread_lc_r=yes
9659 else
9660   echo "configure: failed program was:" >&5
9661   cat conftest.$ac_ext >&5
9662   rm -fr conftest*
9663   ol_cv_pthread_lc_r=no
9664 fi
9665 rm -fr conftest*
9666 fi
9667
9668
9669                 # restore the LIBS
9670                 LIBS="$ol_LIBS"
9671         
9672 fi
9673
9674 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9675
9676         if test $ol_cv_pthread_lc_r = yes ; then
9677                 ol_link_pthreads="-lc_r"
9678                 ol_link_threads=posix
9679         fi
9680 fi
9681
9682
9683                 # Pthread try link: -threads (ol_cv_pthread_threads)
9684 if test "$ol_link_threads" = no ; then
9685         # try -threads
9686         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9687 echo "configure:9688: checking for pthread link with -threads" >&5
9688 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9689   echo $ac_n "(cached) $ac_c" 1>&6
9690 else
9691   
9692                 # save the flags
9693                 ol_LIBS="$LIBS"
9694                 LIBS="-threads $LIBS"
9695
9696                 if test "$cross_compiling" = yes; then
9697   cat > conftest.$ac_ext <<EOF
9698 #line 9699 "configure"
9699 #include "confdefs.h"
9700 /* pthread test headers */
9701 #include <pthread.h>
9702 #ifndef NULL
9703 #define NULL (void*)0
9704 #endif
9705
9706 static void *task(p)
9707         void *p;
9708 {
9709         return (void *) (p == NULL);
9710 }
9711
9712 int main() {
9713
9714         /* pthread test function */
9715         pthread_t t;
9716         int status;
9717         int detach = 1;
9718
9719 #ifdef HAVE_PTHREADS_FINAL
9720         /* Final pthreads */
9721         pthread_attr_t attr;
9722
9723         status = pthread_attr_init(&attr);
9724         if( status ) return status;
9725
9726 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9727         if( !detach ) {
9728 #if defined( PTHREAD_CREATE_JOINABLE )
9729                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9730 #else
9731                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9732 #endif
9733
9734 #ifdef PTHREAD_CREATE_DETACHED
9735         } else {
9736                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9737 #endif
9738         }
9739         if( status ) return status;
9740 #endif
9741
9742         status = pthread_create( &t, &attr, task, NULL );
9743         if( status ) return status;
9744
9745 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9746         if( detach ) {
9747                 /* give thread a chance to complete */
9748                 /* it should remain joinable and hence detachable */
9749                 sleep( 1 );
9750
9751                 status = pthread_detach( t );
9752                 if( status ) return status;
9753         }
9754 #endif
9755
9756 #else
9757         /* Draft 4 pthreads */
9758         status = pthread_create( &t, pthread_attr_default, task, NULL );
9759         if( status ) return status;
9760
9761         if( detach ) {
9762                 /* give thread a chance to complete */
9763                 /* it should remain joinable and hence detachable */
9764                 sleep( 1 );
9765
9766                 status = pthread_detach( &t );
9767                 if( status ) return status;
9768         }
9769 #endif
9770
9771 #ifdef HAVE_LINUX_THREADS
9772         pthread_kill_other_threads_np();
9773 #endif
9774
9775         return 0;
9776
9777 ; return 0; }
9778 EOF
9779 if { (eval echo configure:9780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9780   rm -rf conftest*
9781   ol_cv_pthread_threads=yes
9782 else
9783   echo "configure: failed program was:" >&5
9784   cat conftest.$ac_ext >&5
9785   rm -rf conftest*
9786   ol_cv_pthread_threads=no
9787 fi
9788 rm -f conftest*
9789 else
9790   cat > conftest.$ac_ext <<EOF
9791 #line 9792 "configure"
9792 #include "confdefs.h"
9793 /* pthread test headers */
9794 #include <pthread.h>
9795 #ifndef NULL
9796 #define NULL (void*)0
9797 #endif
9798
9799 static void *task(p)
9800         void *p;
9801 {
9802         return (void *) (p == NULL);
9803 }
9804
9805
9806 int main(argc, argv)
9807         int argc;
9808         char **argv;
9809 {
9810
9811         /* pthread test function */
9812         pthread_t t;
9813         int status;
9814         int detach = 1;
9815
9816 #ifdef HAVE_PTHREADS_FINAL
9817         /* Final pthreads */
9818         pthread_attr_t attr;
9819
9820         status = pthread_attr_init(&attr);
9821         if( status ) return status;
9822
9823 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9824         if( !detach ) {
9825 #if defined( PTHREAD_CREATE_JOINABLE )
9826                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9827 #else
9828                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9829 #endif
9830
9831 #ifdef PTHREAD_CREATE_DETACHED
9832         } else {
9833                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9834 #endif
9835         }
9836         if( status ) return status;
9837 #endif
9838
9839         status = pthread_create( &t, &attr, task, NULL );
9840         if( status ) return status;
9841
9842 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9843         if( detach ) {
9844                 /* give thread a chance to complete */
9845                 /* it should remain joinable and hence detachable */
9846                 sleep( 1 );
9847
9848                 status = pthread_detach( t );
9849                 if( status ) return status;
9850         }
9851 #endif
9852
9853 #else
9854         /* Draft 4 pthreads */
9855         status = pthread_create( &t, pthread_attr_default, task, NULL );
9856         if( status ) return status;
9857
9858         if( detach ) {
9859                 /* give thread a chance to complete */
9860                 /* it should remain joinable and hence detachable */
9861                 sleep( 1 );
9862
9863                 status = pthread_detach( &t );
9864                 if( status ) return status;
9865         }
9866 #endif
9867
9868 #ifdef HAVE_LINUX_THREADS
9869         pthread_kill_other_threads_np();
9870 #endif
9871
9872         return 0;
9873
9874 }
9875
9876 EOF
9877 if { (eval echo configure:9878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9878 then
9879   ol_cv_pthread_threads=yes
9880 else
9881   echo "configure: failed program was:" >&5
9882   cat conftest.$ac_ext >&5
9883   rm -fr conftest*
9884   ol_cv_pthread_threads=no
9885 fi
9886 rm -fr conftest*
9887 fi
9888
9889
9890                 # restore the LIBS
9891                 LIBS="$ol_LIBS"
9892         
9893 fi
9894
9895 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9896
9897         if test $ol_cv_pthread_threads = yes ; then
9898                 ol_link_pthreads="-threads"
9899                 ol_link_threads=posix
9900         fi
9901 fi
9902
9903
9904                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9905 if test "$ol_link_threads" = no ; then
9906         # try -lpthreads -lmach -lexc -lc_r
9907         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9908 echo "configure:9909: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9909 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9910   echo $ac_n "(cached) $ac_c" 1>&6
9911 else
9912   
9913                 # save the flags
9914                 ol_LIBS="$LIBS"
9915                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9916
9917                 if test "$cross_compiling" = yes; then
9918   cat > conftest.$ac_ext <<EOF
9919 #line 9920 "configure"
9920 #include "confdefs.h"
9921 /* pthread test headers */
9922 #include <pthread.h>
9923 #ifndef NULL
9924 #define NULL (void*)0
9925 #endif
9926
9927 static void *task(p)
9928         void *p;
9929 {
9930         return (void *) (p == NULL);
9931 }
9932
9933 int main() {
9934
9935         /* pthread test function */
9936         pthread_t t;
9937         int status;
9938         int detach = 1;
9939
9940 #ifdef HAVE_PTHREADS_FINAL
9941         /* Final pthreads */
9942         pthread_attr_t attr;
9943
9944         status = pthread_attr_init(&attr);
9945         if( status ) return status;
9946
9947 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9948         if( !detach ) {
9949 #if defined( PTHREAD_CREATE_JOINABLE )
9950                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9951 #else
9952                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9953 #endif
9954
9955 #ifdef PTHREAD_CREATE_DETACHED
9956         } else {
9957                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9958 #endif
9959         }
9960         if( status ) return status;
9961 #endif
9962
9963         status = pthread_create( &t, &attr, task, NULL );
9964         if( status ) return status;
9965
9966 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9967         if( detach ) {
9968                 /* give thread a chance to complete */
9969                 /* it should remain joinable and hence detachable */
9970                 sleep( 1 );
9971
9972                 status = pthread_detach( t );
9973                 if( status ) return status;
9974         }
9975 #endif
9976
9977 #else
9978         /* Draft 4 pthreads */
9979         status = pthread_create( &t, pthread_attr_default, task, NULL );
9980         if( status ) return status;
9981
9982         if( detach ) {
9983                 /* give thread a chance to complete */
9984                 /* it should remain joinable and hence detachable */
9985                 sleep( 1 );
9986
9987                 status = pthread_detach( &t );
9988                 if( status ) return status;
9989         }
9990 #endif
9991
9992 #ifdef HAVE_LINUX_THREADS
9993         pthread_kill_other_threads_np();
9994 #endif
9995
9996         return 0;
9997
9998 ; return 0; }
9999 EOF
10000 if { (eval echo configure:10001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10001   rm -rf conftest*
10002   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10003 else
10004   echo "configure: failed program was:" >&5
10005   cat conftest.$ac_ext >&5
10006   rm -rf conftest*
10007   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10008 fi
10009 rm -f conftest*
10010 else
10011   cat > conftest.$ac_ext <<EOF
10012 #line 10013 "configure"
10013 #include "confdefs.h"
10014 /* pthread test headers */
10015 #include <pthread.h>
10016 #ifndef NULL
10017 #define NULL (void*)0
10018 #endif
10019
10020 static void *task(p)
10021         void *p;
10022 {
10023         return (void *) (p == NULL);
10024 }
10025
10026
10027 int main(argc, argv)
10028         int argc;
10029         char **argv;
10030 {
10031
10032         /* pthread test function */
10033         pthread_t t;
10034         int status;
10035         int detach = 1;
10036
10037 #ifdef HAVE_PTHREADS_FINAL
10038         /* Final pthreads */
10039         pthread_attr_t attr;
10040
10041         status = pthread_attr_init(&attr);
10042         if( status ) return status;
10043
10044 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10045         if( !detach ) {
10046 #if defined( PTHREAD_CREATE_JOINABLE )
10047                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10048 #else
10049                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10050 #endif
10051
10052 #ifdef PTHREAD_CREATE_DETACHED
10053         } else {
10054                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10055 #endif
10056         }
10057         if( status ) return status;
10058 #endif
10059
10060         status = pthread_create( &t, &attr, task, NULL );
10061         if( status ) return status;
10062
10063 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10064         if( detach ) {
10065                 /* give thread a chance to complete */
10066                 /* it should remain joinable and hence detachable */
10067                 sleep( 1 );
10068
10069                 status = pthread_detach( t );
10070                 if( status ) return status;
10071         }
10072 #endif
10073
10074 #else
10075         /* Draft 4 pthreads */
10076         status = pthread_create( &t, pthread_attr_default, task, NULL );
10077         if( status ) return status;
10078
10079         if( detach ) {
10080                 /* give thread a chance to complete */
10081                 /* it should remain joinable and hence detachable */
10082                 sleep( 1 );
10083
10084                 status = pthread_detach( &t );
10085                 if( status ) return status;
10086         }
10087 #endif
10088
10089 #ifdef HAVE_LINUX_THREADS
10090         pthread_kill_other_threads_np();
10091 #endif
10092
10093         return 0;
10094
10095 }
10096
10097 EOF
10098 if { (eval echo configure:10099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10099 then
10100   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
10101 else
10102   echo "configure: failed program was:" >&5
10103   cat conftest.$ac_ext >&5
10104   rm -fr conftest*
10105   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
10106 fi
10107 rm -fr conftest*
10108 fi
10109
10110
10111                 # restore the LIBS
10112                 LIBS="$ol_LIBS"
10113         
10114 fi
10115
10116 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
10117
10118         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
10119                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
10120                 ol_link_threads=posix
10121         fi
10122 fi
10123
10124                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
10125 if test "$ol_link_threads" = no ; then
10126         # try -lpthreads -lmach -lexc
10127         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
10128 echo "configure:10129: checking for pthread link with -lpthreads -lmach -lexc" >&5
10129 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
10130   echo $ac_n "(cached) $ac_c" 1>&6
10131 else
10132   
10133                 # save the flags
10134                 ol_LIBS="$LIBS"
10135                 LIBS="-lpthreads -lmach -lexc $LIBS"
10136
10137                 if test "$cross_compiling" = yes; then
10138   cat > conftest.$ac_ext <<EOF
10139 #line 10140 "configure"
10140 #include "confdefs.h"
10141 /* pthread test headers */
10142 #include <pthread.h>
10143 #ifndef NULL
10144 #define NULL (void*)0
10145 #endif
10146
10147 static void *task(p)
10148         void *p;
10149 {
10150         return (void *) (p == NULL);
10151 }
10152
10153 int main() {
10154
10155         /* pthread test function */
10156         pthread_t t;
10157         int status;
10158         int detach = 1;
10159
10160 #ifdef HAVE_PTHREADS_FINAL
10161         /* Final pthreads */
10162         pthread_attr_t attr;
10163
10164         status = pthread_attr_init(&attr);
10165         if( status ) return status;
10166
10167 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10168         if( !detach ) {
10169 #if defined( PTHREAD_CREATE_JOINABLE )
10170                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10171 #else
10172                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10173 #endif
10174
10175 #ifdef PTHREAD_CREATE_DETACHED
10176         } else {
10177                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10178 #endif
10179         }
10180         if( status ) return status;
10181 #endif
10182
10183         status = pthread_create( &t, &attr, task, NULL );
10184         if( status ) return status;
10185
10186 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10187         if( detach ) {
10188                 /* give thread a chance to complete */
10189                 /* it should remain joinable and hence detachable */
10190                 sleep( 1 );
10191
10192                 status = pthread_detach( t );
10193                 if( status ) return status;
10194         }
10195 #endif
10196
10197 #else
10198         /* Draft 4 pthreads */
10199         status = pthread_create( &t, pthread_attr_default, task, NULL );
10200         if( status ) return status;
10201
10202         if( detach ) {
10203                 /* give thread a chance to complete */
10204                 /* it should remain joinable and hence detachable */
10205                 sleep( 1 );
10206
10207                 status = pthread_detach( &t );
10208                 if( status ) return status;
10209         }
10210 #endif
10211
10212 #ifdef HAVE_LINUX_THREADS
10213         pthread_kill_other_threads_np();
10214 #endif
10215
10216         return 0;
10217
10218 ; return 0; }
10219 EOF
10220 if { (eval echo configure:10221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10221   rm -rf conftest*
10222   ol_cv_pthread_lpthreads_lmach_lexc=yes
10223 else
10224   echo "configure: failed program was:" >&5
10225   cat conftest.$ac_ext >&5
10226   rm -rf conftest*
10227   ol_cv_pthread_lpthreads_lmach_lexc=no
10228 fi
10229 rm -f conftest*
10230 else
10231   cat > conftest.$ac_ext <<EOF
10232 #line 10233 "configure"
10233 #include "confdefs.h"
10234 /* pthread test headers */
10235 #include <pthread.h>
10236 #ifndef NULL
10237 #define NULL (void*)0
10238 #endif
10239
10240 static void *task(p)
10241         void *p;
10242 {
10243         return (void *) (p == NULL);
10244 }
10245
10246
10247 int main(argc, argv)
10248         int argc;
10249         char **argv;
10250 {
10251
10252         /* pthread test function */
10253         pthread_t t;
10254         int status;
10255         int detach = 1;
10256
10257 #ifdef HAVE_PTHREADS_FINAL
10258         /* Final pthreads */
10259         pthread_attr_t attr;
10260
10261         status = pthread_attr_init(&attr);
10262         if( status ) return status;
10263
10264 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10265         if( !detach ) {
10266 #if defined( PTHREAD_CREATE_JOINABLE )
10267                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10268 #else
10269                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10270 #endif
10271
10272 #ifdef PTHREAD_CREATE_DETACHED
10273         } else {
10274                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10275 #endif
10276         }
10277         if( status ) return status;
10278 #endif
10279
10280         status = pthread_create( &t, &attr, task, NULL );
10281         if( status ) return status;
10282
10283 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10284         if( detach ) {
10285                 /* give thread a chance to complete */
10286                 /* it should remain joinable and hence detachable */
10287                 sleep( 1 );
10288
10289                 status = pthread_detach( t );
10290                 if( status ) return status;
10291         }
10292 #endif
10293
10294 #else
10295         /* Draft 4 pthreads */
10296         status = pthread_create( &t, pthread_attr_default, task, NULL );
10297         if( status ) return status;
10298
10299         if( detach ) {
10300                 /* give thread a chance to complete */
10301                 /* it should remain joinable and hence detachable */
10302                 sleep( 1 );
10303
10304                 status = pthread_detach( &t );
10305                 if( status ) return status;
10306         }
10307 #endif
10308
10309 #ifdef HAVE_LINUX_THREADS
10310         pthread_kill_other_threads_np();
10311 #endif
10312
10313         return 0;
10314
10315 }
10316
10317 EOF
10318 if { (eval echo configure:10319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10319 then
10320   ol_cv_pthread_lpthreads_lmach_lexc=yes
10321 else
10322   echo "configure: failed program was:" >&5
10323   cat conftest.$ac_ext >&5
10324   rm -fr conftest*
10325   ol_cv_pthread_lpthreads_lmach_lexc=no
10326 fi
10327 rm -fr conftest*
10328 fi
10329
10330
10331                 # restore the LIBS
10332                 LIBS="$ol_LIBS"
10333         
10334 fi
10335
10336 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10337
10338         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10339                 ol_link_pthreads="-lpthreads -lmach -lexc"
10340                 ol_link_threads=posix
10341         fi
10342 fi
10343
10344                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10345 if test "$ol_link_threads" = no ; then
10346         # try -lpthreads -lexc
10347         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10348 echo "configure:10349: checking for pthread link with -lpthreads -lexc" >&5
10349 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10350   echo $ac_n "(cached) $ac_c" 1>&6
10351 else
10352   
10353                 # save the flags
10354                 ol_LIBS="$LIBS"
10355                 LIBS="-lpthreads -lexc $LIBS"
10356
10357                 if test "$cross_compiling" = yes; then
10358   cat > conftest.$ac_ext <<EOF
10359 #line 10360 "configure"
10360 #include "confdefs.h"
10361 /* pthread test headers */
10362 #include <pthread.h>
10363 #ifndef NULL
10364 #define NULL (void*)0
10365 #endif
10366
10367 static void *task(p)
10368         void *p;
10369 {
10370         return (void *) (p == NULL);
10371 }
10372
10373 int main() {
10374
10375         /* pthread test function */
10376         pthread_t t;
10377         int status;
10378         int detach = 1;
10379
10380 #ifdef HAVE_PTHREADS_FINAL
10381         /* Final pthreads */
10382         pthread_attr_t attr;
10383
10384         status = pthread_attr_init(&attr);
10385         if( status ) return status;
10386
10387 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10388         if( !detach ) {
10389 #if defined( PTHREAD_CREATE_JOINABLE )
10390                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10391 #else
10392                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10393 #endif
10394
10395 #ifdef PTHREAD_CREATE_DETACHED
10396         } else {
10397                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10398 #endif
10399         }
10400         if( status ) return status;
10401 #endif
10402
10403         status = pthread_create( &t, &attr, task, NULL );
10404         if( status ) return status;
10405
10406 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10407         if( detach ) {
10408                 /* give thread a chance to complete */
10409                 /* it should remain joinable and hence detachable */
10410                 sleep( 1 );
10411
10412                 status = pthread_detach( t );
10413                 if( status ) return status;
10414         }
10415 #endif
10416
10417 #else
10418         /* Draft 4 pthreads */
10419         status = pthread_create( &t, pthread_attr_default, task, NULL );
10420         if( status ) return status;
10421
10422         if( detach ) {
10423                 /* give thread a chance to complete */
10424                 /* it should remain joinable and hence detachable */
10425                 sleep( 1 );
10426
10427                 status = pthread_detach( &t );
10428                 if( status ) return status;
10429         }
10430 #endif
10431
10432 #ifdef HAVE_LINUX_THREADS
10433         pthread_kill_other_threads_np();
10434 #endif
10435
10436         return 0;
10437
10438 ; return 0; }
10439 EOF
10440 if { (eval echo configure:10441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10441   rm -rf conftest*
10442   ol_cv_pthread_lpthreads_lexc=yes
10443 else
10444   echo "configure: failed program was:" >&5
10445   cat conftest.$ac_ext >&5
10446   rm -rf conftest*
10447   ol_cv_pthread_lpthreads_lexc=no
10448 fi
10449 rm -f conftest*
10450 else
10451   cat > conftest.$ac_ext <<EOF
10452 #line 10453 "configure"
10453 #include "confdefs.h"
10454 /* pthread test headers */
10455 #include <pthread.h>
10456 #ifndef NULL
10457 #define NULL (void*)0
10458 #endif
10459
10460 static void *task(p)
10461         void *p;
10462 {
10463         return (void *) (p == NULL);
10464 }
10465
10466
10467 int main(argc, argv)
10468         int argc;
10469         char **argv;
10470 {
10471
10472         /* pthread test function */
10473         pthread_t t;
10474         int status;
10475         int detach = 1;
10476
10477 #ifdef HAVE_PTHREADS_FINAL
10478         /* Final pthreads */
10479         pthread_attr_t attr;
10480
10481         status = pthread_attr_init(&attr);
10482         if( status ) return status;
10483
10484 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10485         if( !detach ) {
10486 #if defined( PTHREAD_CREATE_JOINABLE )
10487                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10488 #else
10489                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10490 #endif
10491
10492 #ifdef PTHREAD_CREATE_DETACHED
10493         } else {
10494                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10495 #endif
10496         }
10497         if( status ) return status;
10498 #endif
10499
10500         status = pthread_create( &t, &attr, task, NULL );
10501         if( status ) return status;
10502
10503 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10504         if( detach ) {
10505                 /* give thread a chance to complete */
10506                 /* it should remain joinable and hence detachable */
10507                 sleep( 1 );
10508
10509                 status = pthread_detach( t );
10510                 if( status ) return status;
10511         }
10512 #endif
10513
10514 #else
10515         /* Draft 4 pthreads */
10516         status = pthread_create( &t, pthread_attr_default, task, NULL );
10517         if( status ) return status;
10518
10519         if( detach ) {
10520                 /* give thread a chance to complete */
10521                 /* it should remain joinable and hence detachable */
10522                 sleep( 1 );
10523
10524                 status = pthread_detach( &t );
10525                 if( status ) return status;
10526         }
10527 #endif
10528
10529 #ifdef HAVE_LINUX_THREADS
10530         pthread_kill_other_threads_np();
10531 #endif
10532
10533         return 0;
10534
10535 }
10536
10537 EOF
10538 if { (eval echo configure:10539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10539 then
10540   ol_cv_pthread_lpthreads_lexc=yes
10541 else
10542   echo "configure: failed program was:" >&5
10543   cat conftest.$ac_ext >&5
10544   rm -fr conftest*
10545   ol_cv_pthread_lpthreads_lexc=no
10546 fi
10547 rm -fr conftest*
10548 fi
10549
10550
10551                 # restore the LIBS
10552                 LIBS="$ol_LIBS"
10553         
10554 fi
10555
10556 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10557
10558         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10559                 ol_link_pthreads="-lpthreads -lexc"
10560                 ol_link_threads=posix
10561         fi
10562 fi
10563
10564
10565                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10566 if test "$ol_link_threads" = no ; then
10567         # try -lpthreads
10568         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10569 echo "configure:10570: checking for pthread link with -lpthreads" >&5
10570 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10571   echo $ac_n "(cached) $ac_c" 1>&6
10572 else
10573   
10574                 # save the flags
10575                 ol_LIBS="$LIBS"
10576                 LIBS="-lpthreads $LIBS"
10577
10578                 if test "$cross_compiling" = yes; then
10579   cat > conftest.$ac_ext <<EOF
10580 #line 10581 "configure"
10581 #include "confdefs.h"
10582 /* pthread test headers */
10583 #include <pthread.h>
10584 #ifndef NULL
10585 #define NULL (void*)0
10586 #endif
10587
10588 static void *task(p)
10589         void *p;
10590 {
10591         return (void *) (p == NULL);
10592 }
10593
10594 int main() {
10595
10596         /* pthread test function */
10597         pthread_t t;
10598         int status;
10599         int detach = 1;
10600
10601 #ifdef HAVE_PTHREADS_FINAL
10602         /* Final pthreads */
10603         pthread_attr_t attr;
10604
10605         status = pthread_attr_init(&attr);
10606         if( status ) return status;
10607
10608 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10609         if( !detach ) {
10610 #if defined( PTHREAD_CREATE_JOINABLE )
10611                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10612 #else
10613                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10614 #endif
10615
10616 #ifdef PTHREAD_CREATE_DETACHED
10617         } else {
10618                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10619 #endif
10620         }
10621         if( status ) return status;
10622 #endif
10623
10624         status = pthread_create( &t, &attr, task, NULL );
10625         if( status ) return status;
10626
10627 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10628         if( detach ) {
10629                 /* give thread a chance to complete */
10630                 /* it should remain joinable and hence detachable */
10631                 sleep( 1 );
10632
10633                 status = pthread_detach( t );
10634                 if( status ) return status;
10635         }
10636 #endif
10637
10638 #else
10639         /* Draft 4 pthreads */
10640         status = pthread_create( &t, pthread_attr_default, task, NULL );
10641         if( status ) return status;
10642
10643         if( detach ) {
10644                 /* give thread a chance to complete */
10645                 /* it should remain joinable and hence detachable */
10646                 sleep( 1 );
10647
10648                 status = pthread_detach( &t );
10649                 if( status ) return status;
10650         }
10651 #endif
10652
10653 #ifdef HAVE_LINUX_THREADS
10654         pthread_kill_other_threads_np();
10655 #endif
10656
10657         return 0;
10658
10659 ; return 0; }
10660 EOF
10661 if { (eval echo configure:10662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10662   rm -rf conftest*
10663   ol_cv_pthread_lib_lpthreads=yes
10664 else
10665   echo "configure: failed program was:" >&5
10666   cat conftest.$ac_ext >&5
10667   rm -rf conftest*
10668   ol_cv_pthread_lib_lpthreads=no
10669 fi
10670 rm -f conftest*
10671 else
10672   cat > conftest.$ac_ext <<EOF
10673 #line 10674 "configure"
10674 #include "confdefs.h"
10675 /* pthread test headers */
10676 #include <pthread.h>
10677 #ifndef NULL
10678 #define NULL (void*)0
10679 #endif
10680
10681 static void *task(p)
10682         void *p;
10683 {
10684         return (void *) (p == NULL);
10685 }
10686
10687
10688 int main(argc, argv)
10689         int argc;
10690         char **argv;
10691 {
10692
10693         /* pthread test function */
10694         pthread_t t;
10695         int status;
10696         int detach = 1;
10697
10698 #ifdef HAVE_PTHREADS_FINAL
10699         /* Final pthreads */
10700         pthread_attr_t attr;
10701
10702         status = pthread_attr_init(&attr);
10703         if( status ) return status;
10704
10705 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10706         if( !detach ) {
10707 #if defined( PTHREAD_CREATE_JOINABLE )
10708                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10709 #else
10710                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10711 #endif
10712
10713 #ifdef PTHREAD_CREATE_DETACHED
10714         } else {
10715                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10716 #endif
10717         }
10718         if( status ) return status;
10719 #endif
10720
10721         status = pthread_create( &t, &attr, task, NULL );
10722         if( status ) return status;
10723
10724 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10725         if( detach ) {
10726                 /* give thread a chance to complete */
10727                 /* it should remain joinable and hence detachable */
10728                 sleep( 1 );
10729
10730                 status = pthread_detach( t );
10731                 if( status ) return status;
10732         }
10733 #endif
10734
10735 #else
10736         /* Draft 4 pthreads */
10737         status = pthread_create( &t, pthread_attr_default, task, NULL );
10738         if( status ) return status;
10739
10740         if( detach ) {
10741                 /* give thread a chance to complete */
10742                 /* it should remain joinable and hence detachable */
10743                 sleep( 1 );
10744
10745                 status = pthread_detach( &t );
10746                 if( status ) return status;
10747         }
10748 #endif
10749
10750 #ifdef HAVE_LINUX_THREADS
10751         pthread_kill_other_threads_np();
10752 #endif
10753
10754         return 0;
10755
10756 }
10757
10758 EOF
10759 if { (eval echo configure:10760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10760 then
10761   ol_cv_pthread_lib_lpthreads=yes
10762 else
10763   echo "configure: failed program was:" >&5
10764   cat conftest.$ac_ext >&5
10765   rm -fr conftest*
10766   ol_cv_pthread_lib_lpthreads=no
10767 fi
10768 rm -fr conftest*
10769 fi
10770
10771
10772                 # restore the LIBS
10773                 LIBS="$ol_LIBS"
10774         
10775 fi
10776
10777 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10778
10779         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10780                 ol_link_pthreads="-lpthreads"
10781                 ol_link_threads=posix
10782         fi
10783 fi
10784
10785
10786                 if test $ol_link_threads != no ; then
10787                         cat >> confdefs.h <<\EOF
10788 #define HAVE_PTHREADS 1
10789 EOF
10790
10791
10792                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10793
10794                                                 save_CPPFLAGS="$CPPFLAGS"
10795                         save_LIBS="$LIBS"
10796                         LIBS="$LTHREAD_LIBS $LIBS"
10797
10798                                                                                                 for ac_func in sched_yield pthread_yield
10799 do
10800 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10801 echo "configure:10802: checking for $ac_func" >&5
10802 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10803   echo $ac_n "(cached) $ac_c" 1>&6
10804 else
10805   cat > conftest.$ac_ext <<EOF
10806 #line 10807 "configure"
10807 #include "confdefs.h"
10808 /* System header to define __stub macros and hopefully few prototypes,
10809     which can conflict with char $ac_func(); below.  */
10810 #include <assert.h>
10811 /* Override any gcc2 internal prototype to avoid an error.  */
10812 /* We use char because int might match the return type of a gcc2
10813     builtin and then its argument prototype would still apply.  */
10814 char $ac_func();
10815 char (*f)();
10816
10817 int main() {
10818
10819 /* The GNU C library defines this for functions which it implements
10820     to always fail with ENOSYS.  Some functions are actually named
10821     something starting with __ and the normal name is an alias.  */
10822 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10823 choke me
10824 #else
10825 f = $ac_func;
10826 #endif
10827
10828 ; return 0; }
10829 EOF
10830 if { (eval echo configure:10831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10831   rm -rf conftest*
10832   eval "ac_cv_func_$ac_func=yes"
10833 else
10834   echo "configure: failed program was:" >&5
10835   cat conftest.$ac_ext >&5
10836   rm -rf conftest*
10837   eval "ac_cv_func_$ac_func=no"
10838 fi
10839 rm -f conftest*
10840 fi
10841
10842 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10843   echo "$ac_t""yes" 1>&6
10844     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10845   cat >> confdefs.h <<EOF
10846 #define $ac_tr_func 1
10847 EOF
10848  
10849 else
10850   echo "$ac_t""no" 1>&6
10851 fi
10852 done
10853
10854
10855                         if test $ac_cv_func_sched_yield = no -a \
10856                                 $ac_cv_func_pthread_yield = no ; then
10857                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10858 echo "configure:10859: checking for sched_yield in -lrt" >&5
10859 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10860 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10861   echo $ac_n "(cached) $ac_c" 1>&6
10862 else
10863   ac_save_LIBS="$LIBS"
10864 LIBS="-lrt  $LIBS"
10865 cat > conftest.$ac_ext <<EOF
10866 #line 10867 "configure"
10867 #include "confdefs.h"
10868 /* Override any gcc2 internal prototype to avoid an error.  */
10869 /* We use char because int might match the return type of a gcc2
10870     builtin and then its argument prototype would still apply.  */
10871 char sched_yield();
10872
10873 int main() {
10874 sched_yield()
10875 ; return 0; }
10876 EOF
10877 if { (eval echo configure:10878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10878   rm -rf conftest*
10879   eval "ac_cv_lib_$ac_lib_var=yes"
10880 else
10881   echo "configure: failed program was:" >&5
10882   cat conftest.$ac_ext >&5
10883   rm -rf conftest*
10884   eval "ac_cv_lib_$ac_lib_var=no"
10885 fi
10886 rm -f conftest*
10887 LIBS="$ac_save_LIBS"
10888
10889 fi
10890 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10891   echo "$ac_t""yes" 1>&6
10892   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10893                                         cat >> confdefs.h <<\EOF
10894 #define HAVE_SCHED_YIELD 1
10895 EOF
10896
10897                                         ac_cv_func_sched_yield=yes
10898 else
10899   echo "$ac_t""no" 1>&6
10900 ac_cv_func_sched_yield=no
10901 fi
10902
10903                         fi
10904                         if test $ac_cv_func_sched_yield = no -a \
10905                                 $ac_cv_func_pthread_yield = no ; then
10906                                                                                                 for ac_func in thr_yield
10907 do
10908 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10909 echo "configure:10910: checking for $ac_func" >&5
10910 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10911   echo $ac_n "(cached) $ac_c" 1>&6
10912 else
10913   cat > conftest.$ac_ext <<EOF
10914 #line 10915 "configure"
10915 #include "confdefs.h"
10916 /* System header to define __stub macros and hopefully few prototypes,
10917     which can conflict with char $ac_func(); below.  */
10918 #include <assert.h>
10919 /* Override any gcc2 internal prototype to avoid an error.  */
10920 /* We use char because int might match the return type of a gcc2
10921     builtin and then its argument prototype would still apply.  */
10922 char $ac_func();
10923 char (*f)();
10924
10925 int main() {
10926
10927 /* The GNU C library defines this for functions which it implements
10928     to always fail with ENOSYS.  Some functions are actually named
10929     something starting with __ and the normal name is an alias.  */
10930 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10931 choke me
10932 #else
10933 f = $ac_func;
10934 #endif
10935
10936 ; return 0; }
10937 EOF
10938 if { (eval echo configure:10939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10939   rm -rf conftest*
10940   eval "ac_cv_func_$ac_func=yes"
10941 else
10942   echo "configure: failed program was:" >&5
10943   cat conftest.$ac_ext >&5
10944   rm -rf conftest*
10945   eval "ac_cv_func_$ac_func=no"
10946 fi
10947 rm -f conftest*
10948 fi
10949
10950 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10951   echo "$ac_t""yes" 1>&6
10952     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10953   cat >> confdefs.h <<EOF
10954 #define $ac_tr_func 1
10955 EOF
10956  
10957 else
10958   echo "$ac_t""no" 1>&6
10959 fi
10960 done
10961
10962                         fi
10963                         if test $ac_cv_func_sched_yield = no -a \
10964                                 $ac_cv_func_pthread_yield = no -a \
10965                                 "$ac_cv_func_thr_yield" = no ; then
10966                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10967                         fi
10968
10969                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10970 do
10971 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10972 echo "configure:10973: checking for $ac_func" >&5
10973 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10974   echo $ac_n "(cached) $ac_c" 1>&6
10975 else
10976   cat > conftest.$ac_ext <<EOF
10977 #line 10978 "configure"
10978 #include "confdefs.h"
10979 /* System header to define __stub macros and hopefully few prototypes,
10980     which can conflict with char $ac_func(); below.  */
10981 #include <assert.h>
10982 /* Override any gcc2 internal prototype to avoid an error.  */
10983 /* We use char because int might match the return type of a gcc2
10984     builtin and then its argument prototype would still apply.  */
10985 char $ac_func();
10986 char (*f)();
10987
10988 int main() {
10989
10990 /* The GNU C library defines this for functions which it implements
10991     to always fail with ENOSYS.  Some functions are actually named
10992     something starting with __ and the normal name is an alias.  */
10993 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10994 choke me
10995 #else
10996 f = $ac_func;
10997 #endif
10998
10999 ; return 0; }
11000 EOF
11001 if { (eval echo configure:11002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11002   rm -rf conftest*
11003   eval "ac_cv_func_$ac_func=yes"
11004 else
11005   echo "configure: failed program was:" >&5
11006   cat conftest.$ac_ext >&5
11007   rm -rf conftest*
11008   eval "ac_cv_func_$ac_func=no"
11009 fi
11010 rm -f conftest*
11011 fi
11012
11013 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11014   echo "$ac_t""yes" 1>&6
11015     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11016   cat >> confdefs.h <<EOF
11017 #define $ac_tr_func 1
11018 EOF
11019  
11020 else
11021   echo "$ac_t""no" 1>&6
11022 fi
11023 done
11024
11025
11026                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
11027 echo "configure:11028: checking for pthread_detach with <pthread.h>" >&5
11028 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
11029   echo $ac_n "(cached) $ac_c" 1>&6
11030 else
11031   
11032                                                                 cat > conftest.$ac_ext <<EOF
11033 #line 11034 "configure"
11034 #include "confdefs.h"
11035
11036 #include <pthread.h>
11037 #ifndef NULL
11038 #define NULL (void*)0
11039 #endif
11040
11041 int main() {
11042 pthread_detach(NULL);
11043 ; return 0; }
11044 EOF
11045 if { (eval echo configure:11046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11046   rm -rf conftest*
11047   ol_cv_func_pthread_detach=yes
11048 else
11049   echo "configure: failed program was:" >&5
11050   cat conftest.$ac_ext >&5
11051   rm -rf conftest*
11052   ol_cv_func_pthread_detach=no
11053 fi
11054 rm -f conftest*
11055                         
11056 fi
11057
11058 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
11059
11060                         if test $ol_cv_func_pthread_detach = no ; then
11061                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
11062                         fi
11063
11064                         cat >> confdefs.h <<\EOF
11065 #define HAVE_PTHREAD_DETACH 1
11066 EOF
11067
11068
11069                                                 for ac_func in \
11070                                 pthread_setconcurrency \
11071                                 pthread_getconcurrency \
11072                                 thr_setconcurrency \
11073                                 thr_getconcurrency \
11074                         
11075 do
11076 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11077 echo "configure:11078: checking for $ac_func" >&5
11078 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11079   echo $ac_n "(cached) $ac_c" 1>&6
11080 else
11081   cat > conftest.$ac_ext <<EOF
11082 #line 11083 "configure"
11083 #include "confdefs.h"
11084 /* System header to define __stub macros and hopefully few prototypes,
11085     which can conflict with char $ac_func(); below.  */
11086 #include <assert.h>
11087 /* Override any gcc2 internal prototype to avoid an error.  */
11088 /* We use char because int might match the return type of a gcc2
11089     builtin and then its argument prototype would still apply.  */
11090 char $ac_func();
11091 char (*f)();
11092
11093 int main() {
11094
11095 /* The GNU C library defines this for functions which it implements
11096     to always fail with ENOSYS.  Some functions are actually named
11097     something starting with __ and the normal name is an alias.  */
11098 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11099 choke me
11100 #else
11101 f = $ac_func;
11102 #endif
11103
11104 ; return 0; }
11105 EOF
11106 if { (eval echo configure:11107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11107   rm -rf conftest*
11108   eval "ac_cv_func_$ac_func=yes"
11109 else
11110   echo "configure: failed program was:" >&5
11111   cat conftest.$ac_ext >&5
11112   rm -rf conftest*
11113   eval "ac_cv_func_$ac_func=no"
11114 fi
11115 rm -f conftest*
11116 fi
11117
11118 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11119   echo "$ac_t""yes" 1>&6
11120     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11121   cat >> confdefs.h <<EOF
11122 #define $ac_tr_func 1
11123 EOF
11124  
11125 else
11126   echo "$ac_t""no" 1>&6
11127 fi
11128 done
11129
11130
11131                         
11132         for ac_func in pthread_kill_other_threads_np
11133 do
11134 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11135 echo "configure:11136: checking for $ac_func" >&5
11136 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11137   echo $ac_n "(cached) $ac_c" 1>&6
11138 else
11139   cat > conftest.$ac_ext <<EOF
11140 #line 11141 "configure"
11141 #include "confdefs.h"
11142 /* System header to define __stub macros and hopefully few prototypes,
11143     which can conflict with char $ac_func(); below.  */
11144 #include <assert.h>
11145 /* Override any gcc2 internal prototype to avoid an error.  */
11146 /* We use char because int might match the return type of a gcc2
11147     builtin and then its argument prototype would still apply.  */
11148 char $ac_func();
11149 char (*f)();
11150
11151 int main() {
11152
11153 /* The GNU C library defines this for functions which it implements
11154     to always fail with ENOSYS.  Some functions are actually named
11155     something starting with __ and the normal name is an alias.  */
11156 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11157 choke me
11158 #else
11159 f = $ac_func;
11160 #endif
11161
11162 ; return 0; }
11163 EOF
11164 if { (eval echo configure:11165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11165   rm -rf conftest*
11166   eval "ac_cv_func_$ac_func=yes"
11167 else
11168   echo "configure: failed program was:" >&5
11169   cat conftest.$ac_ext >&5
11170   rm -rf conftest*
11171   eval "ac_cv_func_$ac_func=no"
11172 fi
11173 rm -f conftest*
11174 fi
11175
11176 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11177   echo "$ac_t""yes" 1>&6
11178     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11179   cat >> confdefs.h <<EOF
11180 #define $ac_tr_func 1
11181 EOF
11182  
11183 else
11184   echo "$ac_t""no" 1>&6
11185 fi
11186 done
11187
11188         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11189 echo "configure:11190: checking for LinuxThreads implementation" >&5
11190 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11191   echo $ac_n "(cached) $ac_c" 1>&6
11192 else
11193   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11194 fi
11195
11196 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11197
11198                         
11199         
11200         
11201         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11202 echo "configure:11203: checking for LinuxThreads consistency" >&5
11203 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11204   echo $ac_n "(cached) $ac_c" 1>&6
11205 else
11206   
11207                 if test $ol_cv_header_linux_threads = yes -a \
11208                         $ol_cv_sys_linux_threads = yes; then
11209                         ol_cv_linux_threads=yes
11210                 elif test $ol_cv_header_linux_threads = no -a \
11211                         $ol_cv_sys_linux_threads = no; then
11212                         ol_cv_linux_threads=no
11213                 else
11214                         ol_cv_linux_threads=error
11215                 fi
11216         
11217 fi
11218
11219 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11220
11221
11222                         if test $ol_cv_linux_threads = error; then
11223                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11224                         fi
11225
11226                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11227 echo "configure:11228: checking if pthread_create() works" >&5
11228 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11229   echo $ac_n "(cached) $ac_c" 1>&6
11230 else
11231   
11232                         if test "$cross_compiling" = yes; then
11233                                 ol_cv_pthread_create_works=yes
11234 else
11235   cat > conftest.$ac_ext <<EOF
11236 #line 11237 "configure"
11237 #include "confdefs.h"
11238 /* pthread test headers */
11239 #include <pthread.h>
11240 #ifndef NULL
11241 #define NULL (void*)0
11242 #endif
11243
11244 static void *task(p)
11245         void *p;
11246 {
11247         return (void *) (p == NULL);
11248 }
11249
11250
11251 int main(argc, argv)
11252         int argc;
11253         char **argv;
11254 {
11255
11256         /* pthread test function */
11257         pthread_t t;
11258         int status;
11259         int detach = 1;
11260
11261 #ifdef HAVE_PTHREADS_FINAL
11262         /* Final pthreads */
11263         pthread_attr_t attr;
11264
11265         status = pthread_attr_init(&attr);
11266         if( status ) return status;
11267
11268 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11269         if( !detach ) {
11270 #if defined( PTHREAD_CREATE_JOINABLE )
11271                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11272 #else
11273                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11274 #endif
11275
11276 #ifdef PTHREAD_CREATE_DETACHED
11277         } else {
11278                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11279 #endif
11280         }
11281         if( status ) return status;
11282 #endif
11283
11284         status = pthread_create( &t, &attr, task, NULL );
11285         if( status ) return status;
11286
11287 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11288         if( detach ) {
11289                 /* give thread a chance to complete */
11290                 /* it should remain joinable and hence detachable */
11291                 sleep( 1 );
11292
11293                 status = pthread_detach( t );
11294                 if( status ) return status;
11295         }
11296 #endif
11297
11298 #else
11299         /* Draft 4 pthreads */
11300         status = pthread_create( &t, pthread_attr_default, task, NULL );
11301         if( status ) return status;
11302
11303         if( detach ) {
11304                 /* give thread a chance to complete */
11305                 /* it should remain joinable and hence detachable */
11306                 sleep( 1 );
11307
11308                 status = pthread_detach( &t );
11309                 if( status ) return status;
11310         }
11311 #endif
11312
11313 #ifdef HAVE_LINUX_THREADS
11314         pthread_kill_other_threads_np();
11315 #endif
11316
11317         return 0;
11318
11319 }
11320
11321 EOF
11322 if { (eval echo configure:11323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11323 then
11324   ol_cv_pthread_create_works=yes
11325 else
11326   echo "configure: failed program was:" >&5
11327   cat conftest.$ac_ext >&5
11328   rm -fr conftest*
11329   ol_cv_pthread_create_works=no
11330 fi
11331 rm -fr conftest*
11332 fi
11333
11334 fi
11335
11336 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11337
11338                         if test $ol_cv_pthread_create_works = no ; then
11339                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11340                         fi
11341
11342                                                 if test $ol_with_yielding_select = auto ; then
11343                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11344 echo "configure:11345: checking if select yields when using pthreads" >&5
11345 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11346   echo $ac_n "(cached) $ac_c" 1>&6
11347 else
11348   
11349                                 if test "$cross_compiling" = yes; then
11350   ol_cv_pthread_select_yields=cross
11351 else
11352   cat > conftest.$ac_ext <<EOF
11353 #line 11354 "configure"
11354 #include "confdefs.h"
11355
11356 #include <sys/types.h>
11357 #include <sys/time.h>
11358 #include <unistd.h>
11359 #include <pthread.h>
11360 #ifndef NULL
11361 #define NULL (void*) 0
11362 #endif
11363
11364 static int fildes[2];
11365
11366 static void *task(p)
11367         void *p;
11368 {
11369         int i;
11370         struct timeval tv;
11371
11372         fd_set rfds;
11373
11374         tv.tv_sec=10;
11375         tv.tv_usec=0;
11376
11377         FD_ZERO(&rfds);
11378         FD_SET(fildes[0], &rfds);
11379
11380         /* we're not interested in any fds */
11381         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11382
11383         if(i < 0) {
11384                 perror("select");
11385                 exit(10);
11386         }
11387
11388         exit(0); /* if we exit here, the select blocked the whole process */
11389 }
11390
11391 int main(argc, argv)
11392         int argc;
11393         char **argv;
11394 {
11395         pthread_t t;
11396
11397         /* create a pipe to select */
11398         if(pipe(&fildes[0])) {
11399                 perror("select");
11400                 exit(1);
11401         }
11402
11403 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11404         (void) pthread_setconcurrency(2);
11405 #else
11406 #ifdef HAVE_THR_SETCONCURRENCY
11407         /* Set Solaris LWP concurrency to 2 */
11408         thr_setconcurrency(2);
11409 #endif
11410 #endif
11411
11412 #if HAVE_PTHREADS_D4
11413         pthread_create(&t, pthread_attr_default, task, NULL);
11414 #else
11415         pthread_create(&t, NULL, task, NULL);
11416 #endif
11417
11418 #if HAVE_SCHED_YIELD
11419         sched_yield();  /* make sure task runs first */
11420 #else
11421 #ifdef HAVE_PTHREAD_YIELD
11422         pthread_yield();        /* make sure task runs first */
11423 #endif
11424 #endif
11425
11426         exit(2);
11427 }
11428 EOF
11429 if { (eval echo configure:11430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11430 then
11431   ol_cv_pthread_select_yields=no
11432 else
11433   echo "configure: failed program was:" >&5
11434   cat conftest.$ac_ext >&5
11435   rm -fr conftest*
11436   ol_cv_pthread_select_yields=yes
11437 fi
11438 rm -fr conftest*
11439 fi
11440
11441 fi
11442
11443 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11444
11445                                 if test $ol_cv_pthread_select_yields = cross ; then
11446                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11447                                 fi
11448
11449                                 if test $ol_cv_pthread_select_yields = yes ; then
11450                                         ol_with_yielding_select=yes
11451                                 fi
11452                         fi
11453
11454                                                 CPPFLAGS="$save_CPPFLAGS"
11455                         LIBS="$save_LIBS"
11456                 else
11457                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11458                 fi
11459         fi
11460
11461         if test $ol_with_threads = posix ; then
11462                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11463         fi
11464 fi
11465
11466 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11467         -o $ol_with_threads = mach ; then
11468
11469                 for ac_hdr in mach/cthreads.h
11470 do
11471 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11472 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11473 echo "configure:11474: checking for $ac_hdr" >&5
11474 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11475   echo $ac_n "(cached) $ac_c" 1>&6
11476 else
11477   cat > conftest.$ac_ext <<EOF
11478 #line 11479 "configure"
11479 #include "confdefs.h"
11480 #include <$ac_hdr>
11481 EOF
11482 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11483 { (eval echo configure:11484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11484 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11485 if test -z "$ac_err"; then
11486   rm -rf conftest*
11487   eval "ac_cv_header_$ac_safe=yes"
11488 else
11489   echo "$ac_err" >&5
11490   echo "configure: failed program was:" >&5
11491   cat conftest.$ac_ext >&5
11492   rm -rf conftest*
11493   eval "ac_cv_header_$ac_safe=no"
11494 fi
11495 rm -f conftest*
11496 fi
11497 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11498   echo "$ac_t""yes" 1>&6
11499     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11500   cat >> confdefs.h <<EOF
11501 #define $ac_tr_hdr 1
11502 EOF
11503  
11504 else
11505   echo "$ac_t""no" 1>&6
11506 fi
11507 done
11508
11509         if test $ac_cv_header_mach_cthreads_h = yes ; then
11510                 ol_with_threads=found
11511
11512                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11513 echo "configure:11514: checking for cthread_fork" >&5
11514 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11515   echo $ac_n "(cached) $ac_c" 1>&6
11516 else
11517   cat > conftest.$ac_ext <<EOF
11518 #line 11519 "configure"
11519 #include "confdefs.h"
11520 /* System header to define __stub macros and hopefully few prototypes,
11521     which can conflict with char cthread_fork(); below.  */
11522 #include <assert.h>
11523 /* Override any gcc2 internal prototype to avoid an error.  */
11524 /* We use char because int might match the return type of a gcc2
11525     builtin and then its argument prototype would still apply.  */
11526 char cthread_fork();
11527 char (*f)();
11528
11529 int main() {
11530
11531 /* The GNU C library defines this for functions which it implements
11532     to always fail with ENOSYS.  Some functions are actually named
11533     something starting with __ and the normal name is an alias.  */
11534 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11535 choke me
11536 #else
11537 f = cthread_fork;
11538 #endif
11539
11540 ; return 0; }
11541 EOF
11542 if { (eval echo configure:11543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11543   rm -rf conftest*
11544   eval "ac_cv_func_cthread_fork=yes"
11545 else
11546   echo "configure: failed program was:" >&5
11547   cat conftest.$ac_ext >&5
11548   rm -rf conftest*
11549   eval "ac_cv_func_cthread_fork=no"
11550 fi
11551 rm -f conftest*
11552 fi
11553
11554 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11555   echo "$ac_t""yes" 1>&6
11556   ol_link_threads=yes
11557 else
11558   echo "$ac_t""no" 1>&6
11559 fi
11560
11561
11562                 if test $ol_link_threads = no ; then
11563                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11564 echo "configure:11565: checking for cthread_fork with -all_load" >&5
11565 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11566   echo $ac_n "(cached) $ac_c" 1>&6
11567 else
11568   
11569                                                                 save_LIBS="$LIBS"
11570                                 LIBS="-all_load $LIBS"
11571                                 cat > conftest.$ac_ext <<EOF
11572 #line 11573 "configure"
11573 #include "confdefs.h"
11574 #include <mach/cthreads.h>
11575 int main() {
11576
11577                                         cthread_fork((void *)0, (void *)0);
11578                                         
11579 ; return 0; }
11580 EOF
11581 if { (eval echo configure:11582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11582   rm -rf conftest*
11583   ol_cv_cthread_all_load=yes
11584 else
11585   echo "configure: failed program was:" >&5
11586   cat conftest.$ac_ext >&5
11587   rm -rf conftest*
11588   ol_cv_cthread_all_load=no
11589 fi
11590 rm -f conftest*
11591                                                                 LIBS="$save_LIBS"
11592                         
11593 fi
11594
11595 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11596
11597                         if test $ol_cv_cthread_all_load = yes ; then
11598                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11599                                 ol_link_threads=mach
11600                         fi
11601                 fi
11602
11603                 if test $ol_link_threads != no ; then
11604                         : check for cthread specific functionality here
11605                         cat >> confdefs.h <<\EOF
11606 #define HAVE_MACH_CTHREADS 1
11607 EOF
11608
11609                 else
11610                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11611                 fi
11612         fi
11613
11614         if test $ol_with_threads = mach ; then
11615                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11616         fi
11617 fi
11618
11619 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11620         -o $ol_with_threads = pth ; then
11621
11622         for ac_hdr in pth.h
11623 do
11624 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11625 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11626 echo "configure:11627: checking for $ac_hdr" >&5
11627 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11628   echo $ac_n "(cached) $ac_c" 1>&6
11629 else
11630   cat > conftest.$ac_ext <<EOF
11631 #line 11632 "configure"
11632 #include "confdefs.h"
11633 #include <$ac_hdr>
11634 EOF
11635 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11636 { (eval echo configure:11637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11637 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11638 if test -z "$ac_err"; then
11639   rm -rf conftest*
11640   eval "ac_cv_header_$ac_safe=yes"
11641 else
11642   echo "$ac_err" >&5
11643   echo "configure: failed program was:" >&5
11644   cat conftest.$ac_ext >&5
11645   rm -rf conftest*
11646   eval "ac_cv_header_$ac_safe=no"
11647 fi
11648 rm -f conftest*
11649 fi
11650 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11651   echo "$ac_t""yes" 1>&6
11652     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11653   cat >> confdefs.h <<EOF
11654 #define $ac_tr_hdr 1
11655 EOF
11656  
11657 else
11658   echo "$ac_t""no" 1>&6
11659 fi
11660 done
11661
11662
11663         if test $ac_cv_header_pth_h = yes ; then
11664                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11665 echo "configure:11666: checking for pth_version in -lpth" >&5
11666 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11667 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11668   echo $ac_n "(cached) $ac_c" 1>&6
11669 else
11670   ac_save_LIBS="$LIBS"
11671 LIBS="-lpth  $LIBS"
11672 cat > conftest.$ac_ext <<EOF
11673 #line 11674 "configure"
11674 #include "confdefs.h"
11675 /* Override any gcc2 internal prototype to avoid an error.  */
11676 /* We use char because int might match the return type of a gcc2
11677     builtin and then its argument prototype would still apply.  */
11678 char pth_version();
11679
11680 int main() {
11681 pth_version()
11682 ; return 0; }
11683 EOF
11684 if { (eval echo configure:11685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11685   rm -rf conftest*
11686   eval "ac_cv_lib_$ac_lib_var=yes"
11687 else
11688   echo "configure: failed program was:" >&5
11689   cat conftest.$ac_ext >&5
11690   rm -rf conftest*
11691   eval "ac_cv_lib_$ac_lib_var=no"
11692 fi
11693 rm -f conftest*
11694 LIBS="$ac_save_LIBS"
11695
11696 fi
11697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11698   echo "$ac_t""yes" 1>&6
11699   have_pth=yes
11700 else
11701   echo "$ac_t""no" 1>&6
11702 have_pth=no
11703 fi
11704
11705
11706                 if test $have_pth = yes ; then
11707                         cat >> confdefs.h <<\EOF
11708 #define HAVE_GNU_PTH 1
11709 EOF
11710
11711                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11712                         ol_link_threads=pth
11713
11714                         if test $ol_with_yielding_select = auto ; then
11715                                 ol_with_yielding_select=yes
11716                         fi
11717                 fi
11718         fi
11719 fi
11720
11721 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11722         -o $ol_with_threads = lwp ; then
11723
11724                 for ac_hdr in thread.h synch.h
11725 do
11726 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11727 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11728 echo "configure:11729: checking for $ac_hdr" >&5
11729 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11730   echo $ac_n "(cached) $ac_c" 1>&6
11731 else
11732   cat > conftest.$ac_ext <<EOF
11733 #line 11734 "configure"
11734 #include "confdefs.h"
11735 #include <$ac_hdr>
11736 EOF
11737 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11738 { (eval echo configure:11739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11739 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11740 if test -z "$ac_err"; then
11741   rm -rf conftest*
11742   eval "ac_cv_header_$ac_safe=yes"
11743 else
11744   echo "$ac_err" >&5
11745   echo "configure: failed program was:" >&5
11746   cat conftest.$ac_ext >&5
11747   rm -rf conftest*
11748   eval "ac_cv_header_$ac_safe=no"
11749 fi
11750 rm -f conftest*
11751 fi
11752 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11753   echo "$ac_t""yes" 1>&6
11754     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11755   cat >> confdefs.h <<EOF
11756 #define $ac_tr_hdr 1
11757 EOF
11758  
11759 else
11760   echo "$ac_t""no" 1>&6
11761 fi
11762 done
11763
11764         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11765                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11766 echo "configure:11767: checking for thr_create in -lthread" >&5
11767 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11768 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11769   echo $ac_n "(cached) $ac_c" 1>&6
11770 else
11771   ac_save_LIBS="$LIBS"
11772 LIBS="-lthread  $LIBS"
11773 cat > conftest.$ac_ext <<EOF
11774 #line 11775 "configure"
11775 #include "confdefs.h"
11776 /* Override any gcc2 internal prototype to avoid an error.  */
11777 /* We use char because int might match the return type of a gcc2
11778     builtin and then its argument prototype would still apply.  */
11779 char thr_create();
11780
11781 int main() {
11782 thr_create()
11783 ; return 0; }
11784 EOF
11785 if { (eval echo configure:11786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11786   rm -rf conftest*
11787   eval "ac_cv_lib_$ac_lib_var=yes"
11788 else
11789   echo "configure: failed program was:" >&5
11790   cat conftest.$ac_ext >&5
11791   rm -rf conftest*
11792   eval "ac_cv_lib_$ac_lib_var=no"
11793 fi
11794 rm -f conftest*
11795 LIBS="$ac_save_LIBS"
11796
11797 fi
11798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11799   echo "$ac_t""yes" 1>&6
11800   have_thr=yes
11801 else
11802   echo "$ac_t""no" 1>&6
11803 have_thr=no
11804 fi
11805
11806
11807                 if test $have_thr = yes ; then
11808                         cat >> confdefs.h <<\EOF
11809 #define HAVE_THR 1
11810 EOF
11811
11812                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11813                         ol_link_threads=thr
11814
11815                         if test $ol_with_yielding_select = auto ; then
11816                                 ol_with_yielding_select=yes
11817                         fi
11818
11819                                                 for ac_func in \
11820                                 thr_setconcurrency \
11821                                 thr_getconcurrency \
11822                         
11823 do
11824 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11825 echo "configure:11826: checking for $ac_func" >&5
11826 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11827   echo $ac_n "(cached) $ac_c" 1>&6
11828 else
11829   cat > conftest.$ac_ext <<EOF
11830 #line 11831 "configure"
11831 #include "confdefs.h"
11832 /* System header to define __stub macros and hopefully few prototypes,
11833     which can conflict with char $ac_func(); below.  */
11834 #include <assert.h>
11835 /* Override any gcc2 internal prototype to avoid an error.  */
11836 /* We use char because int might match the return type of a gcc2
11837     builtin and then its argument prototype would still apply.  */
11838 char $ac_func();
11839 char (*f)();
11840
11841 int main() {
11842
11843 /* The GNU C library defines this for functions which it implements
11844     to always fail with ENOSYS.  Some functions are actually named
11845     something starting with __ and the normal name is an alias.  */
11846 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11847 choke me
11848 #else
11849 f = $ac_func;
11850 #endif
11851
11852 ; return 0; }
11853 EOF
11854 if { (eval echo configure:11855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11855   rm -rf conftest*
11856   eval "ac_cv_func_$ac_func=yes"
11857 else
11858   echo "configure: failed program was:" >&5
11859   cat conftest.$ac_ext >&5
11860   rm -rf conftest*
11861   eval "ac_cv_func_$ac_func=no"
11862 fi
11863 rm -f conftest*
11864 fi
11865
11866 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11867   echo "$ac_t""yes" 1>&6
11868     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11869   cat >> confdefs.h <<EOF
11870 #define $ac_tr_func 1
11871 EOF
11872  
11873 else
11874   echo "$ac_t""no" 1>&6
11875 fi
11876 done
11877
11878                 fi
11879         fi
11880
11881                 for ac_hdr in lwp/lwp.h
11882 do
11883 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11884 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11885 echo "configure:11886: checking for $ac_hdr" >&5
11886 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11887   echo $ac_n "(cached) $ac_c" 1>&6
11888 else
11889   cat > conftest.$ac_ext <<EOF
11890 #line 11891 "configure"
11891 #include "confdefs.h"
11892 #include <$ac_hdr>
11893 EOF
11894 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11895 { (eval echo configure:11896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11896 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11897 if test -z "$ac_err"; then
11898   rm -rf conftest*
11899   eval "ac_cv_header_$ac_safe=yes"
11900 else
11901   echo "$ac_err" >&5
11902   echo "configure: failed program was:" >&5
11903   cat conftest.$ac_ext >&5
11904   rm -rf conftest*
11905   eval "ac_cv_header_$ac_safe=no"
11906 fi
11907 rm -f conftest*
11908 fi
11909 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11910   echo "$ac_t""yes" 1>&6
11911     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11912   cat >> confdefs.h <<EOF
11913 #define $ac_tr_hdr 1
11914 EOF
11915  
11916 else
11917   echo "$ac_t""no" 1>&6
11918 fi
11919 done
11920
11921         if test $ac_cv_header_lwp_lwp_h = yes ; then
11922                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11923 echo "configure:11924: checking for lwp_create in -llwp" >&5
11924 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11925 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11926   echo $ac_n "(cached) $ac_c" 1>&6
11927 else
11928   ac_save_LIBS="$LIBS"
11929 LIBS="-llwp  $LIBS"
11930 cat > conftest.$ac_ext <<EOF
11931 #line 11932 "configure"
11932 #include "confdefs.h"
11933 /* Override any gcc2 internal prototype to avoid an error.  */
11934 /* We use char because int might match the return type of a gcc2
11935     builtin and then its argument prototype would still apply.  */
11936 char lwp_create();
11937
11938 int main() {
11939 lwp_create()
11940 ; return 0; }
11941 EOF
11942 if { (eval echo configure:11943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11943   rm -rf conftest*
11944   eval "ac_cv_lib_$ac_lib_var=yes"
11945 else
11946   echo "configure: failed program was:" >&5
11947   cat conftest.$ac_ext >&5
11948   rm -rf conftest*
11949   eval "ac_cv_lib_$ac_lib_var=no"
11950 fi
11951 rm -f conftest*
11952 LIBS="$ac_save_LIBS"
11953
11954 fi
11955 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11956   echo "$ac_t""yes" 1>&6
11957   have_lwp=yes
11958 else
11959   echo "$ac_t""no" 1>&6
11960 have_lwp=no
11961 fi
11962
11963
11964                 if test $have_lwp = yes ; then
11965                         cat >> confdefs.h <<\EOF
11966 #define HAVE_LWP 1
11967 EOF
11968
11969                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11970                         ol_link_threads=lwp
11971
11972                         if test $ol_with_yielding_select = auto ; then
11973                                 ol_with_yielding_select=no
11974                         fi
11975                 fi
11976         fi
11977 fi
11978
11979 if test $ol_with_yielding_select = yes ; then
11980         cat >> confdefs.h <<\EOF
11981 #define HAVE_YIELDING_SELECT 1
11982 EOF
11983
11984 fi
11985
11986 if test $ol_with_threads = manual ; then
11987                 ol_link_threads=yes
11988
11989         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11990
11991         for ac_hdr in pthread.h sched.h
11992 do
11993 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11994 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11995 echo "configure:11996: checking for $ac_hdr" >&5
11996 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11997   echo $ac_n "(cached) $ac_c" 1>&6
11998 else
11999   cat > conftest.$ac_ext <<EOF
12000 #line 12001 "configure"
12001 #include "confdefs.h"
12002 #include <$ac_hdr>
12003 EOF
12004 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12005 { (eval echo configure:12006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12006 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12007 if test -z "$ac_err"; then
12008   rm -rf conftest*
12009   eval "ac_cv_header_$ac_safe=yes"
12010 else
12011   echo "$ac_err" >&5
12012   echo "configure: failed program was:" >&5
12013   cat conftest.$ac_ext >&5
12014   rm -rf conftest*
12015   eval "ac_cv_header_$ac_safe=no"
12016 fi
12017 rm -f conftest*
12018 fi
12019 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12020   echo "$ac_t""yes" 1>&6
12021     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12022   cat >> confdefs.h <<EOF
12023 #define $ac_tr_hdr 1
12024 EOF
12025  
12026 else
12027   echo "$ac_t""no" 1>&6
12028 fi
12029 done
12030
12031         for ac_func in sched_yield pthread_yield
12032 do
12033 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
12034 echo "configure:12035: checking for $ac_func" >&5
12035 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
12036   echo $ac_n "(cached) $ac_c" 1>&6
12037 else
12038   cat > conftest.$ac_ext <<EOF
12039 #line 12040 "configure"
12040 #include "confdefs.h"
12041 /* System header to define __stub macros and hopefully few prototypes,
12042     which can conflict with char $ac_func(); below.  */
12043 #include <assert.h>
12044 /* Override any gcc2 internal prototype to avoid an error.  */
12045 /* We use char because int might match the return type of a gcc2
12046     builtin and then its argument prototype would still apply.  */
12047 char $ac_func();
12048 char (*f)();
12049
12050 int main() {
12051
12052 /* The GNU C library defines this for functions which it implements
12053     to always fail with ENOSYS.  Some functions are actually named
12054     something starting with __ and the normal name is an alias.  */
12055 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
12056 choke me
12057 #else
12058 f = $ac_func;
12059 #endif
12060
12061 ; return 0; }
12062 EOF
12063 if { (eval echo configure:12064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12064   rm -rf conftest*
12065   eval "ac_cv_func_$ac_func=yes"
12066 else
12067   echo "configure: failed program was:" >&5
12068   cat conftest.$ac_ext >&5
12069   rm -rf conftest*
12070   eval "ac_cv_func_$ac_func=no"
12071 fi
12072 rm -f conftest*
12073 fi
12074
12075 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
12076   echo "$ac_t""yes" 1>&6
12077     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
12078   cat >> confdefs.h <<EOF
12079 #define $ac_tr_func 1
12080 EOF
12081  
12082 else
12083   echo "$ac_t""no" 1>&6
12084 fi
12085 done
12086
12087         
12088         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
12089 echo "configure:12090: checking for LinuxThreads pthread.h" >&5
12090 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
12091   echo $ac_n "(cached) $ac_c" 1>&6
12092 else
12093   cat > conftest.$ac_ext <<EOF
12094 #line 12095 "configure"
12095 #include "confdefs.h"
12096 #include <pthread.h>
12097 EOF
12098 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12099   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
12100   rm -rf conftest*
12101   ol_cv_header_linux_threads=yes
12102 else
12103   rm -rf conftest*
12104   ol_cv_header_linux_threads=no
12105 fi
12106 rm -f conftest*
12107
12108                 
12109 fi
12110
12111 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
12112         if test $ol_cv_header_linux_threads = yes; then
12113                 cat >> confdefs.h <<\EOF
12114 #define HAVE_LINUX_THREADS 1
12115 EOF
12116
12117         fi
12118
12119
12120         for ac_hdr in mach/cthreads.h
12121 do
12122 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12123 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12124 echo "configure:12125: checking for $ac_hdr" >&5
12125 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12126   echo $ac_n "(cached) $ac_c" 1>&6
12127 else
12128   cat > conftest.$ac_ext <<EOF
12129 #line 12130 "configure"
12130 #include "confdefs.h"
12131 #include <$ac_hdr>
12132 EOF
12133 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12134 { (eval echo configure:12135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12135 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12136 if test -z "$ac_err"; then
12137   rm -rf conftest*
12138   eval "ac_cv_header_$ac_safe=yes"
12139 else
12140   echo "$ac_err" >&5
12141   echo "configure: failed program was:" >&5
12142   cat conftest.$ac_ext >&5
12143   rm -rf conftest*
12144   eval "ac_cv_header_$ac_safe=no"
12145 fi
12146 rm -f conftest*
12147 fi
12148 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12149   echo "$ac_t""yes" 1>&6
12150     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12151   cat >> confdefs.h <<EOF
12152 #define $ac_tr_hdr 1
12153 EOF
12154  
12155 else
12156   echo "$ac_t""no" 1>&6
12157 fi
12158 done
12159
12160         for ac_hdr in lwp/lwp.h
12161 do
12162 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12163 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12164 echo "configure:12165: checking for $ac_hdr" >&5
12165 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12166   echo $ac_n "(cached) $ac_c" 1>&6
12167 else
12168   cat > conftest.$ac_ext <<EOF
12169 #line 12170 "configure"
12170 #include "confdefs.h"
12171 #include <$ac_hdr>
12172 EOF
12173 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12174 { (eval echo configure:12175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12175 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12176 if test -z "$ac_err"; then
12177   rm -rf conftest*
12178   eval "ac_cv_header_$ac_safe=yes"
12179 else
12180   echo "$ac_err" >&5
12181   echo "configure: failed program was:" >&5
12182   cat conftest.$ac_ext >&5
12183   rm -rf conftest*
12184   eval "ac_cv_header_$ac_safe=no"
12185 fi
12186 rm -f conftest*
12187 fi
12188 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12189   echo "$ac_t""yes" 1>&6
12190     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12191   cat >> confdefs.h <<EOF
12192 #define $ac_tr_hdr 1
12193 EOF
12194  
12195 else
12196   echo "$ac_t""no" 1>&6
12197 fi
12198 done
12199
12200         for ac_hdr in thread.h synch.h
12201 do
12202 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12203 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12204 echo "configure:12205: checking for $ac_hdr" >&5
12205 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12206   echo $ac_n "(cached) $ac_c" 1>&6
12207 else
12208   cat > conftest.$ac_ext <<EOF
12209 #line 12210 "configure"
12210 #include "confdefs.h"
12211 #include <$ac_hdr>
12212 EOF
12213 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12214 { (eval echo configure:12215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12215 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12216 if test -z "$ac_err"; then
12217   rm -rf conftest*
12218   eval "ac_cv_header_$ac_safe=yes"
12219 else
12220   echo "$ac_err" >&5
12221   echo "configure: failed program was:" >&5
12222   cat conftest.$ac_ext >&5
12223   rm -rf conftest*
12224   eval "ac_cv_header_$ac_safe=no"
12225 fi
12226 rm -f conftest*
12227 fi
12228 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12229   echo "$ac_t""yes" 1>&6
12230     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12231   cat >> confdefs.h <<EOF
12232 #define $ac_tr_hdr 1
12233 EOF
12234  
12235 else
12236   echo "$ac_t""no" 1>&6
12237 fi
12238 done
12239
12240 fi
12241
12242 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12243                         cat >> confdefs.h <<\EOF
12244 #define REENTRANT 1
12245 EOF
12246
12247         cat >> confdefs.h <<\EOF
12248 #define _REENTRANT 1
12249 EOF
12250
12251         cat >> confdefs.h <<\EOF
12252 #define THREAD_SAFE 1
12253 EOF
12254
12255         cat >> confdefs.h <<\EOF
12256 #define _THREAD_SAFE 1
12257 EOF
12258
12259         cat >> confdefs.h <<\EOF
12260 #define THREADSAFE 1
12261 EOF
12262
12263         cat >> confdefs.h <<\EOF
12264 #define _THREADSAFE 1
12265 EOF
12266
12267         cat >> confdefs.h <<\EOF
12268 #define _SGI_MP_SOURCE 1
12269 EOF
12270
12271
12272                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12273 echo "configure:12274: checking for thread specific errno" >&5
12274 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12275   echo $ac_n "(cached) $ac_c" 1>&6
12276 else
12277   
12278                 cat > conftest.$ac_ext <<EOF
12279 #line 12280 "configure"
12280 #include "confdefs.h"
12281 #include <errno.h>
12282 int main() {
12283 errno = 0;
12284 ; return 0; }
12285 EOF
12286 if { (eval echo configure:12287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12287   rm -rf conftest*
12288   ol_cv_errno_thread_specific=yes
12289 else
12290   echo "configure: failed program was:" >&5
12291   cat conftest.$ac_ext >&5
12292   rm -rf conftest*
12293   ol_cv_errno_thread_specific=no
12294 fi
12295 rm -f conftest*
12296         
12297 fi
12298
12299 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12300
12301                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12302 echo "configure:12303: checking for thread specific h_errno" >&5
12303 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12304   echo $ac_n "(cached) $ac_c" 1>&6
12305 else
12306   
12307                 cat > conftest.$ac_ext <<EOF
12308 #line 12309 "configure"
12309 #include "confdefs.h"
12310 #include <netdb.h>
12311 int main() {
12312 h_errno = 0;
12313 ; return 0; }
12314 EOF
12315 if { (eval echo configure:12316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12316   rm -rf conftest*
12317   ol_cv_h_errno_thread_specific=yes
12318 else
12319   echo "configure: failed program was:" >&5
12320   cat conftest.$ac_ext >&5
12321   rm -rf conftest*
12322   ol_cv_h_errno_thread_specific=no
12323 fi
12324 rm -f conftest*
12325         
12326 fi
12327
12328 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12329
12330         if test $ol_cv_errno_thread_specific != yes \
12331                 -o $ol_cv_h_errno_thread_specific != yes ; then
12332                 LIBS="$LTHREAD_LIBS $LIBS"
12333                 LTHREAD_LIBS=""
12334         fi
12335
12336 fi  
12337
12338 if test $ol_link_threads = no ; then
12339         if test $ol_with_threads = yes ; then
12340                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12341         fi
12342
12343         if test $ol_with_threads = auto ; then
12344                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12345                 ol_with_threads=no
12346         fi
12347
12348         cat >> confdefs.h <<\EOF
12349 #define NO_THREADS 1
12350 EOF
12351
12352         LTHREAD_LIBS=""
12353 fi
12354
12355 if test $ol_link_threads != no ; then
12356         cat >> confdefs.h <<\EOF
12357 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12358 EOF
12359
12360 fi
12361
12362 ol_link_ldbm=no 
12363
12364 if test $ol_with_ldbm_api = auto \
12365         -o $ol_with_ldbm_api = berkeley \
12366         -o $ol_with_ldbm_api = bcompat ; then
12367
12368         if test $ol_with_ldbm_api = bcompat; then \
12369                 ol_cv_berkeley_db=no
12370 for ac_hdr in db_185.h db.h
12371 do
12372 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12373 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12374 echo "configure:12375: checking for $ac_hdr" >&5
12375 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12376   echo $ac_n "(cached) $ac_c" 1>&6
12377 else
12378   cat > conftest.$ac_ext <<EOF
12379 #line 12380 "configure"
12380 #include "confdefs.h"
12381 #include <$ac_hdr>
12382 EOF
12383 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12384 { (eval echo configure:12385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12385 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12386 if test -z "$ac_err"; then
12387   rm -rf conftest*
12388   eval "ac_cv_header_$ac_safe=yes"
12389 else
12390   echo "$ac_err" >&5
12391   echo "configure: failed program was:" >&5
12392   cat conftest.$ac_ext >&5
12393   rm -rf conftest*
12394   eval "ac_cv_header_$ac_safe=no"
12395 fi
12396 rm -f conftest*
12397 fi
12398 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12399   echo "$ac_t""yes" 1>&6
12400     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12401   cat >> confdefs.h <<EOF
12402 #define $ac_tr_hdr 1
12403 EOF
12404  
12405 else
12406   echo "$ac_t""no" 1>&6
12407 fi
12408 done
12409
12410 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12411         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12412 echo "configure:12413: checking if Berkeley DB header compatibility" >&5
12413 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12414   echo $ac_n "(cached) $ac_c" 1>&6
12415 else
12416   
12417                 cat > conftest.$ac_ext <<EOF
12418 #line 12419 "configure"
12419 #include "confdefs.h"
12420
12421 #if HAVE_DB_185_H
12422 #       include <db_185.h>
12423 #else
12424 #       include <db.h>
12425 #endif
12426
12427  /* this check could be improved */
12428 #ifndef DB_VERSION_MAJOR
12429 #       define DB_VERSION_MAJOR 1
12430 #endif
12431
12432 #if DB_VERSION_MAJOR == 1 
12433         __db_version_1
12434 #endif
12435
12436 EOF
12437 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12438   egrep "__db_version_1" >/dev/null 2>&1; then
12439   rm -rf conftest*
12440   ol_cv_header_db1=yes
12441 else
12442   rm -rf conftest*
12443   ol_cv_header_db1=no
12444 fi
12445 rm -f conftest*
12446
12447 fi
12448
12449 echo "$ac_t""$ol_cv_header_db1" 1>&6
12450
12451         if test $ol_cv_header_db1 = yes ; then
12452                 ol_cv_lib_db=no
12453 if test $ol_cv_lib_db = no ; then
12454         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12455 echo "configure:12456: checking for Berkeley DB link (default)" >&5
12456 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12457   echo $ac_n "(cached) $ac_c" 1>&6
12458 else
12459   
12460         ol_DB_LIB=
12461         ol_LIBS=$LIBS
12462         LIBS="$ol_DB_LIB $LIBS"
12463
12464         cat > conftest.$ac_ext <<EOF
12465 #line 12466 "configure"
12466 #include "confdefs.h"
12467
12468 #ifdef HAVE_DB_185_H
12469 # include <db_185.h>
12470 #else
12471 # include <db.h>
12472 #endif
12473
12474 #ifndef DB_VERSION_MAJOR
12475 # define DB_VERSION_MAJOR 1
12476 #endif
12477
12478 #ifndef NULL
12479 #define NULL ((void*)0)
12480 #endif
12481
12482 int main() {
12483
12484 #if DB_VERSION_MAJOR > 1
12485         {
12486                 char *version;
12487                 int major, minor, patch;
12488
12489                 version = db_version( &major, &minor, &patch );
12490
12491                 if( major != DB_VERSION_MAJOR ||
12492                         minor < DB_VERSION_MINOR )
12493                 {
12494                         printf("Berkeley DB version mismatch\n"
12495                                 "\texpected: %s\n\tgot: %s\n",
12496                                 DB_VERSION_STRING, version);
12497                         return 1;
12498                 }
12499         }
12500 #endif
12501
12502 #if DB_VERSION_MAJOR > 2
12503         db_env_create( NULL, 0 );
12504 #elif DB_VERSION_MAJOR > 1
12505         db_appexit( NULL );
12506 #else
12507         (void) dbopen( NULL, 0, 0, 0, NULL);
12508 #endif
12509
12510 ; return 0; }
12511 EOF
12512 if { (eval echo configure:12513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12513   rm -rf conftest*
12514   ol_cv_db_none=yes
12515 else
12516   echo "configure: failed program was:" >&5
12517   cat conftest.$ac_ext >&5
12518   rm -rf conftest*
12519   ol_cv_db_none=no
12520 fi
12521 rm -f conftest*
12522
12523         LIBS="$ol_LIBS"
12524
12525 fi
12526
12527 echo "$ac_t""$ol_cv_db_none" 1>&6
12528
12529         if test $ol_cv_db_none = yes ; then
12530                 ol_cv_lib_db=yes
12531         fi
12532 fi
12533
12534 if test $ol_cv_lib_db = no ; then
12535         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12536 echo "configure:12537: checking for Berkeley DB link (-ldb)" >&5
12537 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12538   echo $ac_n "(cached) $ac_c" 1>&6
12539 else
12540   
12541         ol_DB_LIB=-ldb
12542         ol_LIBS=$LIBS
12543         LIBS="$ol_DB_LIB $LIBS"
12544
12545         cat > conftest.$ac_ext <<EOF
12546 #line 12547 "configure"
12547 #include "confdefs.h"
12548
12549 #ifdef HAVE_DB_185_H
12550 # include <db_185.h>
12551 #else
12552 # include <db.h>
12553 #endif
12554
12555 #ifndef DB_VERSION_MAJOR
12556 # define DB_VERSION_MAJOR 1
12557 #endif
12558
12559 #ifndef NULL
12560 #define NULL ((void*)0)
12561 #endif
12562
12563 int main() {
12564
12565 #if DB_VERSION_MAJOR > 1
12566         {
12567                 char *version;
12568                 int major, minor, patch;
12569
12570                 version = db_version( &major, &minor, &patch );
12571
12572                 if( major != DB_VERSION_MAJOR ||
12573                         minor < DB_VERSION_MINOR )
12574                 {
12575                         printf("Berkeley DB version mismatch\n"
12576                                 "\texpected: %s\n\tgot: %s\n",
12577                                 DB_VERSION_STRING, version);
12578                         return 1;
12579                 }
12580         }
12581 #endif
12582
12583 #if DB_VERSION_MAJOR > 2
12584         db_env_create( NULL, 0 );
12585 #elif DB_VERSION_MAJOR > 1
12586         db_appexit( NULL );
12587 #else
12588         (void) dbopen( NULL, 0, 0, 0, NULL);
12589 #endif
12590
12591 ; return 0; }
12592 EOF
12593 if { (eval echo configure:12594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12594   rm -rf conftest*
12595   ol_cv_db_db=yes
12596 else
12597   echo "configure: failed program was:" >&5
12598   cat conftest.$ac_ext >&5
12599   rm -rf conftest*
12600   ol_cv_db_db=no
12601 fi
12602 rm -f conftest*
12603
12604         LIBS="$ol_LIBS"
12605
12606 fi
12607
12608 echo "$ac_t""$ol_cv_db_db" 1>&6
12609
12610         if test $ol_cv_db_db = yes ; then
12611                 ol_cv_lib_db=-ldb
12612         fi
12613 fi
12614
12615 if test $ol_cv_lib_db = no ; then
12616         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12617 echo "configure:12618: checking for Berkeley DB link (-ldb3)" >&5
12618 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12619   echo $ac_n "(cached) $ac_c" 1>&6
12620 else
12621   
12622         ol_DB_LIB=-ldb3
12623         ol_LIBS=$LIBS
12624         LIBS="$ol_DB_LIB $LIBS"
12625
12626         cat > conftest.$ac_ext <<EOF
12627 #line 12628 "configure"
12628 #include "confdefs.h"
12629
12630 #ifdef HAVE_DB_185_H
12631 # include <db_185.h>
12632 #else
12633 # include <db.h>
12634 #endif
12635
12636 #ifndef DB_VERSION_MAJOR
12637 # define DB_VERSION_MAJOR 1
12638 #endif
12639
12640 #ifndef NULL
12641 #define NULL ((void*)0)
12642 #endif
12643
12644 int main() {
12645
12646 #if DB_VERSION_MAJOR > 1
12647         {
12648                 char *version;
12649                 int major, minor, patch;
12650
12651                 version = db_version( &major, &minor, &patch );
12652
12653                 if( major != DB_VERSION_MAJOR ||
12654                         minor < DB_VERSION_MINOR )
12655                 {
12656                         printf("Berkeley DB version mismatch\n"
12657                                 "\texpected: %s\n\tgot: %s\n",
12658                                 DB_VERSION_STRING, version);
12659                         return 1;
12660                 }
12661         }
12662 #endif
12663
12664 #if DB_VERSION_MAJOR > 2
12665         db_env_create( NULL, 0 );
12666 #elif DB_VERSION_MAJOR > 1
12667         db_appexit( NULL );
12668 #else
12669         (void) dbopen( NULL, 0, 0, 0, NULL);
12670 #endif
12671
12672 ; return 0; }
12673 EOF
12674 if { (eval echo configure:12675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12675   rm -rf conftest*
12676   ol_cv_db_db3=yes
12677 else
12678   echo "configure: failed program was:" >&5
12679   cat conftest.$ac_ext >&5
12680   rm -rf conftest*
12681   ol_cv_db_db3=no
12682 fi
12683 rm -f conftest*
12684
12685         LIBS="$ol_LIBS"
12686
12687 fi
12688
12689 echo "$ac_t""$ol_cv_db_db3" 1>&6
12690
12691         if test $ol_cv_db_db3 = yes ; then
12692                 ol_cv_lib_db=-ldb3
12693         fi
12694 fi
12695
12696 if test $ol_cv_lib_db = no ; then
12697         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12698 echo "configure:12699: checking for Berkeley DB link (-ldb2)" >&5
12699 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12700   echo $ac_n "(cached) $ac_c" 1>&6
12701 else
12702   
12703         ol_DB_LIB=-ldb2
12704         ol_LIBS=$LIBS
12705         LIBS="$ol_DB_LIB $LIBS"
12706
12707         cat > conftest.$ac_ext <<EOF
12708 #line 12709 "configure"
12709 #include "confdefs.h"
12710
12711 #ifdef HAVE_DB_185_H
12712 # include <db_185.h>
12713 #else
12714 # include <db.h>
12715 #endif
12716
12717 #ifndef DB_VERSION_MAJOR
12718 # define DB_VERSION_MAJOR 1
12719 #endif
12720
12721 #ifndef NULL
12722 #define NULL ((void*)0)
12723 #endif
12724
12725 int main() {
12726
12727 #if DB_VERSION_MAJOR > 1
12728         {
12729                 char *version;
12730                 int major, minor, patch;
12731
12732                 version = db_version( &major, &minor, &patch );
12733
12734                 if( major != DB_VERSION_MAJOR ||
12735                         minor < DB_VERSION_MINOR )
12736                 {
12737                         printf("Berkeley DB version mismatch\n"
12738                                 "\texpected: %s\n\tgot: %s\n",
12739                                 DB_VERSION_STRING, version);
12740                         return 1;
12741                 }
12742         }
12743 #endif
12744
12745 #if DB_VERSION_MAJOR > 2
12746         db_env_create( NULL, 0 );
12747 #elif DB_VERSION_MAJOR > 1
12748         db_appexit( NULL );
12749 #else
12750         (void) dbopen( NULL, 0, 0, 0, NULL);
12751 #endif
12752
12753 ; return 0; }
12754 EOF
12755 if { (eval echo configure:12756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12756   rm -rf conftest*
12757   ol_cv_db_db2=yes
12758 else
12759   echo "configure: failed program was:" >&5
12760   cat conftest.$ac_ext >&5
12761   rm -rf conftest*
12762   ol_cv_db_db2=no
12763 fi
12764 rm -f conftest*
12765
12766         LIBS="$ol_LIBS"
12767
12768 fi
12769
12770 echo "$ac_t""$ol_cv_db_db2" 1>&6
12771
12772         if test $ol_cv_db_db2 = yes ; then
12773                 ol_cv_lib_db=-ldb2
12774         fi
12775 fi
12776
12777 if test $ol_cv_lib_db = no ; then
12778         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12779 echo "configure:12780: checking for Berkeley DB link (-ldb1)" >&5
12780 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12781   echo $ac_n "(cached) $ac_c" 1>&6
12782 else
12783   
12784         ol_DB_LIB=-ldb1
12785         ol_LIBS=$LIBS
12786         LIBS="$ol_DB_LIB $LIBS"
12787
12788         cat > conftest.$ac_ext <<EOF
12789 #line 12790 "configure"
12790 #include "confdefs.h"
12791
12792 #ifdef HAVE_DB_185_H
12793 # include <db_185.h>
12794 #else
12795 # include <db.h>
12796 #endif
12797
12798 #ifndef DB_VERSION_MAJOR
12799 # define DB_VERSION_MAJOR 1
12800 #endif
12801
12802 #ifndef NULL
12803 #define NULL ((void*)0)
12804 #endif
12805
12806 int main() {
12807
12808 #if DB_VERSION_MAJOR > 1
12809         {
12810                 char *version;
12811                 int major, minor, patch;
12812
12813                 version = db_version( &major, &minor, &patch );
12814
12815                 if( major != DB_VERSION_MAJOR ||
12816                         minor < DB_VERSION_MINOR )
12817                 {
12818                         printf("Berkeley DB version mismatch\n"
12819                                 "\texpected: %s\n\tgot: %s\n",
12820                                 DB_VERSION_STRING, version);
12821                         return 1;
12822                 }
12823         }
12824 #endif
12825
12826 #if DB_VERSION_MAJOR > 2
12827         db_env_create( NULL, 0 );
12828 #elif DB_VERSION_MAJOR > 1
12829         db_appexit( NULL );
12830 #else
12831         (void) dbopen( NULL, 0, 0, 0, NULL);
12832 #endif
12833
12834 ; return 0; }
12835 EOF
12836 if { (eval echo configure:12837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12837   rm -rf conftest*
12838   ol_cv_db_db1=yes
12839 else
12840   echo "configure: failed program was:" >&5
12841   cat conftest.$ac_ext >&5
12842   rm -rf conftest*
12843   ol_cv_db_db1=no
12844 fi
12845 rm -f conftest*
12846
12847         LIBS="$ol_LIBS"
12848
12849 fi
12850
12851 echo "$ac_t""$ol_cv_db_db1" 1>&6
12852
12853         if test $ol_cv_db_db1 = yes ; then
12854                 ol_cv_lib_db=-ldb1
12855         fi
12856 fi
12857
12858
12859                 if test "$ol_cv_lib_db" != no ; then
12860                         ol_cv_berkeley_db=yes
12861                 fi
12862         fi
12863 fi
12864
12865         else
12866                 ol_cv_berkeley_db=no
12867 for ac_hdr in db.h
12868 do
12869 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12870 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12871 echo "configure:12872: checking for $ac_hdr" >&5
12872 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12873   echo $ac_n "(cached) $ac_c" 1>&6
12874 else
12875   cat > conftest.$ac_ext <<EOF
12876 #line 12877 "configure"
12877 #include "confdefs.h"
12878 #include <$ac_hdr>
12879 EOF
12880 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12881 { (eval echo configure:12882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12882 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12883 if test -z "$ac_err"; then
12884   rm -rf conftest*
12885   eval "ac_cv_header_$ac_safe=yes"
12886 else
12887   echo "$ac_err" >&5
12888   echo "configure: failed program was:" >&5
12889   cat conftest.$ac_ext >&5
12890   rm -rf conftest*
12891   eval "ac_cv_header_$ac_safe=no"
12892 fi
12893 rm -f conftest*
12894 fi
12895 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12896   echo "$ac_t""yes" 1>&6
12897     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12898   cat >> confdefs.h <<EOF
12899 #define $ac_tr_hdr 1
12900 EOF
12901  
12902 else
12903   echo "$ac_t""no" 1>&6
12904 fi
12905 done
12906
12907 if test $ac_cv_header_db_h = yes; then
12908         ol_cv_lib_db=no
12909 if test $ol_cv_lib_db = no ; then
12910         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12911 echo "configure:12912: checking for Berkeley DB link (default)" >&5
12912 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12913   echo $ac_n "(cached) $ac_c" 1>&6
12914 else
12915   
12916         ol_DB_LIB=
12917         ol_LIBS=$LIBS
12918         LIBS="$ol_DB_LIB $LIBS"
12919
12920         cat > conftest.$ac_ext <<EOF
12921 #line 12922 "configure"
12922 #include "confdefs.h"
12923
12924 #ifdef HAVE_DB_185_H
12925 # include <db_185.h>
12926 #else
12927 # include <db.h>
12928 #endif
12929
12930 #ifndef DB_VERSION_MAJOR
12931 # define DB_VERSION_MAJOR 1
12932 #endif
12933
12934 #ifndef NULL
12935 #define NULL ((void*)0)
12936 #endif
12937
12938 int main() {
12939
12940 #if DB_VERSION_MAJOR > 1
12941         {
12942                 char *version;
12943                 int major, minor, patch;
12944
12945                 version = db_version( &major, &minor, &patch );
12946
12947                 if( major != DB_VERSION_MAJOR ||
12948                         minor < DB_VERSION_MINOR )
12949                 {
12950                         printf("Berkeley DB version mismatch\n"
12951                                 "\texpected: %s\n\tgot: %s\n",
12952                                 DB_VERSION_STRING, version);
12953                         return 1;
12954                 }
12955         }
12956 #endif
12957
12958 #if DB_VERSION_MAJOR > 2
12959         db_env_create( NULL, 0 );
12960 #elif DB_VERSION_MAJOR > 1
12961         db_appexit( NULL );
12962 #else
12963         (void) dbopen( NULL, 0, 0, 0, NULL);
12964 #endif
12965
12966 ; return 0; }
12967 EOF
12968 if { (eval echo configure:12969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12969   rm -rf conftest*
12970   ol_cv_db_none=yes
12971 else
12972   echo "configure: failed program was:" >&5
12973   cat conftest.$ac_ext >&5
12974   rm -rf conftest*
12975   ol_cv_db_none=no
12976 fi
12977 rm -f conftest*
12978
12979         LIBS="$ol_LIBS"
12980
12981 fi
12982
12983 echo "$ac_t""$ol_cv_db_none" 1>&6
12984
12985         if test $ol_cv_db_none = yes ; then
12986                 ol_cv_lib_db=yes
12987         fi
12988 fi
12989
12990 if test $ol_cv_lib_db = no ; then
12991         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12992 echo "configure:12993: checking for Berkeley DB link (-ldb)" >&5
12993 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12994   echo $ac_n "(cached) $ac_c" 1>&6
12995 else
12996   
12997         ol_DB_LIB=-ldb
12998         ol_LIBS=$LIBS
12999         LIBS="$ol_DB_LIB $LIBS"
13000
13001         cat > conftest.$ac_ext <<EOF
13002 #line 13003 "configure"
13003 #include "confdefs.h"
13004
13005 #ifdef HAVE_DB_185_H
13006 # include <db_185.h>
13007 #else
13008 # include <db.h>
13009 #endif
13010
13011 #ifndef DB_VERSION_MAJOR
13012 # define DB_VERSION_MAJOR 1
13013 #endif
13014
13015 #ifndef NULL
13016 #define NULL ((void*)0)
13017 #endif
13018
13019 int main() {
13020
13021 #if DB_VERSION_MAJOR > 1
13022         {
13023                 char *version;
13024                 int major, minor, patch;
13025
13026                 version = db_version( &major, &minor, &patch );
13027
13028                 if( major != DB_VERSION_MAJOR ||
13029                         minor < DB_VERSION_MINOR )
13030                 {
13031                         printf("Berkeley DB version mismatch\n"
13032                                 "\texpected: %s\n\tgot: %s\n",
13033                                 DB_VERSION_STRING, version);
13034                         return 1;
13035                 }
13036         }
13037 #endif
13038
13039 #if DB_VERSION_MAJOR > 2
13040         db_env_create( NULL, 0 );
13041 #elif DB_VERSION_MAJOR > 1
13042         db_appexit( NULL );
13043 #else
13044         (void) dbopen( NULL, 0, 0, 0, NULL);
13045 #endif
13046
13047 ; return 0; }
13048 EOF
13049 if { (eval echo configure:13050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13050   rm -rf conftest*
13051   ol_cv_db_db=yes
13052 else
13053   echo "configure: failed program was:" >&5
13054   cat conftest.$ac_ext >&5
13055   rm -rf conftest*
13056   ol_cv_db_db=no
13057 fi
13058 rm -f conftest*
13059
13060         LIBS="$ol_LIBS"
13061
13062 fi
13063
13064 echo "$ac_t""$ol_cv_db_db" 1>&6
13065
13066         if test $ol_cv_db_db = yes ; then
13067                 ol_cv_lib_db=-ldb
13068         fi
13069 fi
13070
13071 if test $ol_cv_lib_db = no ; then
13072         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
13073 echo "configure:13074: checking for Berkeley DB link (-ldb3)" >&5
13074 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
13075   echo $ac_n "(cached) $ac_c" 1>&6
13076 else
13077   
13078         ol_DB_LIB=-ldb3
13079         ol_LIBS=$LIBS
13080         LIBS="$ol_DB_LIB $LIBS"
13081
13082         cat > conftest.$ac_ext <<EOF
13083 #line 13084 "configure"
13084 #include "confdefs.h"
13085
13086 #ifdef HAVE_DB_185_H
13087 # include <db_185.h>
13088 #else
13089 # include <db.h>
13090 #endif
13091
13092 #ifndef DB_VERSION_MAJOR
13093 # define DB_VERSION_MAJOR 1
13094 #endif
13095
13096 #ifndef NULL
13097 #define NULL ((void*)0)
13098 #endif
13099
13100 int main() {
13101
13102 #if DB_VERSION_MAJOR > 1
13103         {
13104                 char *version;
13105                 int major, minor, patch;
13106
13107                 version = db_version( &major, &minor, &patch );
13108
13109                 if( major != DB_VERSION_MAJOR ||
13110                         minor < DB_VERSION_MINOR )
13111                 {
13112                         printf("Berkeley DB version mismatch\n"
13113                                 "\texpected: %s\n\tgot: %s\n",
13114                                 DB_VERSION_STRING, version);
13115                         return 1;
13116                 }
13117         }
13118 #endif
13119
13120 #if DB_VERSION_MAJOR > 2
13121         db_env_create( NULL, 0 );
13122 #elif DB_VERSION_MAJOR > 1
13123         db_appexit( NULL );
13124 #else
13125         (void) dbopen( NULL, 0, 0, 0, NULL);
13126 #endif
13127
13128 ; return 0; }
13129 EOF
13130 if { (eval echo configure:13131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13131   rm -rf conftest*
13132   ol_cv_db_db3=yes
13133 else
13134   echo "configure: failed program was:" >&5
13135   cat conftest.$ac_ext >&5
13136   rm -rf conftest*
13137   ol_cv_db_db3=no
13138 fi
13139 rm -f conftest*
13140
13141         LIBS="$ol_LIBS"
13142
13143 fi
13144
13145 echo "$ac_t""$ol_cv_db_db3" 1>&6
13146
13147         if test $ol_cv_db_db3 = yes ; then
13148                 ol_cv_lib_db=-ldb3
13149         fi
13150 fi
13151
13152 if test $ol_cv_lib_db = no ; then
13153         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13154 echo "configure:13155: checking for Berkeley DB link (-ldb2)" >&5
13155 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13156   echo $ac_n "(cached) $ac_c" 1>&6
13157 else
13158   
13159         ol_DB_LIB=-ldb2
13160         ol_LIBS=$LIBS
13161         LIBS="$ol_DB_LIB $LIBS"
13162
13163         cat > conftest.$ac_ext <<EOF
13164 #line 13165 "configure"
13165 #include "confdefs.h"
13166
13167 #ifdef HAVE_DB_185_H
13168 # include <db_185.h>
13169 #else
13170 # include <db.h>
13171 #endif
13172
13173 #ifndef DB_VERSION_MAJOR
13174 # define DB_VERSION_MAJOR 1
13175 #endif
13176
13177 #ifndef NULL
13178 #define NULL ((void*)0)
13179 #endif
13180
13181 int main() {
13182
13183 #if DB_VERSION_MAJOR > 1
13184         {
13185                 char *version;
13186                 int major, minor, patch;
13187
13188                 version = db_version( &major, &minor, &patch );
13189
13190                 if( major != DB_VERSION_MAJOR ||
13191                         minor < DB_VERSION_MINOR )
13192                 {
13193                         printf("Berkeley DB version mismatch\n"
13194                                 "\texpected: %s\n\tgot: %s\n",
13195                                 DB_VERSION_STRING, version);
13196                         return 1;
13197                 }
13198         }
13199 #endif
13200
13201 #if DB_VERSION_MAJOR > 2
13202         db_env_create( NULL, 0 );
13203 #elif DB_VERSION_MAJOR > 1
13204         db_appexit( NULL );
13205 #else
13206         (void) dbopen( NULL, 0, 0, 0, NULL);
13207 #endif
13208
13209 ; return 0; }
13210 EOF
13211 if { (eval echo configure:13212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13212   rm -rf conftest*
13213   ol_cv_db_db2=yes
13214 else
13215   echo "configure: failed program was:" >&5
13216   cat conftest.$ac_ext >&5
13217   rm -rf conftest*
13218   ol_cv_db_db2=no
13219 fi
13220 rm -f conftest*
13221
13222         LIBS="$ol_LIBS"
13223
13224 fi
13225
13226 echo "$ac_t""$ol_cv_db_db2" 1>&6
13227
13228         if test $ol_cv_db_db2 = yes ; then
13229                 ol_cv_lib_db=-ldb2
13230         fi
13231 fi
13232
13233 if test $ol_cv_lib_db = no ; then
13234         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13235 echo "configure:13236: checking for Berkeley DB link (-ldb1)" >&5
13236 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13237   echo $ac_n "(cached) $ac_c" 1>&6
13238 else
13239   
13240         ol_DB_LIB=-ldb1
13241         ol_LIBS=$LIBS
13242         LIBS="$ol_DB_LIB $LIBS"
13243
13244         cat > conftest.$ac_ext <<EOF
13245 #line 13246 "configure"
13246 #include "confdefs.h"
13247
13248 #ifdef HAVE_DB_185_H
13249 # include <db_185.h>
13250 #else
13251 # include <db.h>
13252 #endif
13253
13254 #ifndef DB_VERSION_MAJOR
13255 # define DB_VERSION_MAJOR 1
13256 #endif
13257
13258 #ifndef NULL
13259 #define NULL ((void*)0)
13260 #endif
13261
13262 int main() {
13263
13264 #if DB_VERSION_MAJOR > 1
13265         {
13266                 char *version;
13267                 int major, minor, patch;
13268
13269                 version = db_version( &major, &minor, &patch );
13270
13271                 if( major != DB_VERSION_MAJOR ||
13272                         minor < DB_VERSION_MINOR )
13273                 {
13274                         printf("Berkeley DB version mismatch\n"
13275                                 "\texpected: %s\n\tgot: %s\n",
13276                                 DB_VERSION_STRING, version);
13277                         return 1;
13278                 }
13279         }
13280 #endif
13281
13282 #if DB_VERSION_MAJOR > 2
13283         db_env_create( NULL, 0 );
13284 #elif DB_VERSION_MAJOR > 1
13285         db_appexit( NULL );
13286 #else
13287         (void) dbopen( NULL, 0, 0, 0, NULL);
13288 #endif
13289
13290 ; return 0; }
13291 EOF
13292 if { (eval echo configure:13293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13293   rm -rf conftest*
13294   ol_cv_db_db1=yes
13295 else
13296   echo "configure: failed program was:" >&5
13297   cat conftest.$ac_ext >&5
13298   rm -rf conftest*
13299   ol_cv_db_db1=no
13300 fi
13301 rm -f conftest*
13302
13303         LIBS="$ol_LIBS"
13304
13305 fi
13306
13307 echo "$ac_t""$ol_cv_db_db1" 1>&6
13308
13309         if test $ol_cv_db_db1 = yes ; then
13310                 ol_cv_lib_db=-ldb1
13311         fi
13312 fi
13313
13314
13315         if test "$ol_cv_lib_db" != no ; then
13316                 ol_cv_berkeley_db=yes
13317                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13318 echo "configure:13319: checking for Berkeley DB thread support" >&5
13319 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13320   echo $ac_n "(cached) $ac_c" 1>&6
13321 else
13322   
13323         ol_LIBS="$LIBS"
13324         if test $ol_cv_lib_db != yes ; then
13325                 LIBS="$ol_cv_lib_db"
13326         fi
13327
13328         if test "$cross_compiling" = yes; then
13329   ol_cv_berkeley_db_thread=cross
13330 else
13331   cat > conftest.$ac_ext <<EOF
13332 #line 13333 "configure"
13333 #include "confdefs.h"
13334
13335 #ifdef HAVE_DB_185_H
13336         choke me;
13337 #else
13338 #include <db.h>
13339 #endif
13340 #ifndef NULL
13341 #define NULL ((void *)0)
13342 #endif
13343 main()
13344 {
13345         int rc;
13346         u_int32_t flags = DB_CREATE |
13347 #ifdef DB_PRIVATE
13348                 DB_PRIVATE |
13349 #endif
13350                 DB_THREAD;
13351
13352 #if DB_VERSION_MAJOR > 2
13353         DB_ENV *env = NULL;
13354
13355         rc = db_env_create( &env, 0 );
13356
13357         flags |= DB_INIT_MPOOL;
13358 #ifdef DB_MPOOL_PRIVATE
13359         flags |= DB_MPOOL_PRIVATE;
13360 #endif
13361
13362         if( rc ) {
13363                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13364                 return rc;
13365         }
13366
13367 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13368         rc = env->open( env, NULL, flags, 0 );
13369 #else
13370         rc = env->open( env, NULL, NULL, flags, 0 );
13371 #endif
13372
13373         if ( rc == 0 ) {
13374                 rc = env->close( env, 0 );
13375         }
13376
13377         if( rc ) {
13378                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13379                 return rc;
13380         }
13381
13382 #else
13383         DB_ENV env;
13384         memset( &env, '\0', sizeof(env) );
13385
13386         rc = db_appinit( NULL, NULL, &env, flags );
13387
13388         if( rc == 0 ) {
13389                 db_appexit( &env );
13390         }
13391
13392         unlink("__db_mpool.share");
13393         unlink("__db_lock.share");
13394 #endif
13395
13396         return rc;
13397 }
13398 EOF
13399 if { (eval echo configure:13400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13400 then
13401   ol_cv_berkeley_db_thread=yes
13402 else
13403   echo "configure: failed program was:" >&5
13404   cat conftest.$ac_ext >&5
13405   rm -fr conftest*
13406   ol_cv_berkeley_db_thread=no
13407 fi
13408 rm -fr conftest*
13409 fi
13410
13411
13412         LIBS="$ol_LIBS"
13413
13414         if test $ol_cv_berkeley_db_thread != no ; then
13415                 cat >> confdefs.h <<\EOF
13416 #define HAVE_BERKELEY_DB_THREAD 1
13417 EOF
13418
13419         fi
13420
13421 fi
13422
13423 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13424         fi
13425 fi
13426
13427         fi
13428
13429         if test $ol_cv_berkeley_db != no ; then
13430                 cat >> confdefs.h <<\EOF
13431 #define HAVE_BERKELEY_DB 1
13432 EOF
13433
13434
13435                 ol_link_ldbm=berkeley
13436                 ol_with_ldbm_api=db
13437
13438                 if test $ol_with_ldbm_type = hash ; then
13439                         cat >> confdefs.h <<\EOF
13440 #define LDBM_USE_DBHASH 1
13441 EOF
13442
13443                 else
13444                         cat >> confdefs.h <<\EOF
13445 #define LDBM_USE_DBBTREE 1
13446 EOF
13447
13448                 fi
13449
13450                                                 if test $ol_cv_lib_db != yes ; then
13451                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13452                 fi
13453         fi
13454 fi
13455
13456 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13457         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13458         ol_with_ldbm_api=none
13459 fi
13460
13461 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13462         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13463 echo "configure:13464: checking for MDBM library" >&5
13464 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13465   echo $ac_n "(cached) $ac_c" 1>&6
13466 else
13467         ol_LIBS="$LIBS"
13468         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13469 echo "configure:13470: checking for mdbm_set_chain" >&5
13470 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13471   echo $ac_n "(cached) $ac_c" 1>&6
13472 else
13473   cat > conftest.$ac_ext <<EOF
13474 #line 13475 "configure"
13475 #include "confdefs.h"
13476 /* System header to define __stub macros and hopefully few prototypes,
13477     which can conflict with char mdbm_set_chain(); below.  */
13478 #include <assert.h>
13479 /* Override any gcc2 internal prototype to avoid an error.  */
13480 /* We use char because int might match the return type of a gcc2
13481     builtin and then its argument prototype would still apply.  */
13482 char mdbm_set_chain();
13483 char (*f)();
13484
13485 int main() {
13486
13487 /* The GNU C library defines this for functions which it implements
13488     to always fail with ENOSYS.  Some functions are actually named
13489     something starting with __ and the normal name is an alias.  */
13490 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13491 choke me
13492 #else
13493 f = mdbm_set_chain;
13494 #endif
13495
13496 ; return 0; }
13497 EOF
13498 if { (eval echo configure:13499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13499   rm -rf conftest*
13500   eval "ac_cv_func_mdbm_set_chain=yes"
13501 else
13502   echo "configure: failed program was:" >&5
13503   cat conftest.$ac_ext >&5
13504   rm -rf conftest*
13505   eval "ac_cv_func_mdbm_set_chain=no"
13506 fi
13507 rm -f conftest*
13508 fi
13509
13510 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13511   echo "$ac_t""yes" 1>&6
13512   ol_cv_lib_mdbm=yes
13513 else
13514   echo "$ac_t""no" 1>&6
13515
13516                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13517 echo "configure:13518: checking for mdbm_set_chain in -lmdbm" >&5
13518 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13519 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13520   echo $ac_n "(cached) $ac_c" 1>&6
13521 else
13522   ac_save_LIBS="$LIBS"
13523 LIBS="-lmdbm  $LIBS"
13524 cat > conftest.$ac_ext <<EOF
13525 #line 13526 "configure"
13526 #include "confdefs.h"
13527 /* Override any gcc2 internal prototype to avoid an error.  */
13528 /* We use char because int might match the return type of a gcc2
13529     builtin and then its argument prototype would still apply.  */
13530 char mdbm_set_chain();
13531
13532 int main() {
13533 mdbm_set_chain()
13534 ; return 0; }
13535 EOF
13536 if { (eval echo configure:13537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13537   rm -rf conftest*
13538   eval "ac_cv_lib_$ac_lib_var=yes"
13539 else
13540   echo "configure: failed program was:" >&5
13541   cat conftest.$ac_ext >&5
13542   rm -rf conftest*
13543   eval "ac_cv_lib_$ac_lib_var=no"
13544 fi
13545 rm -f conftest*
13546 LIBS="$ac_save_LIBS"
13547
13548 fi
13549 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13550   echo "$ac_t""yes" 1>&6
13551   ol_cv_lib_mdbm=-lmdbm
13552 else
13553   echo "$ac_t""no" 1>&6
13554 ol_cv_lib_mdbm=no
13555 fi
13556
13557         
13558 fi
13559
13560         LIBS="$ol_LIBS"
13561
13562 fi
13563
13564 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13565
13566
13567  for ac_hdr in mdbm.h
13568 do
13569 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13570 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13571 echo "configure:13572: checking for $ac_hdr" >&5
13572 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13573   echo $ac_n "(cached) $ac_c" 1>&6
13574 else
13575   cat > conftest.$ac_ext <<EOF
13576 #line 13577 "configure"
13577 #include "confdefs.h"
13578 #include <$ac_hdr>
13579 EOF
13580 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13581 { (eval echo configure:13582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13582 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13583 if test -z "$ac_err"; then
13584   rm -rf conftest*
13585   eval "ac_cv_header_$ac_safe=yes"
13586 else
13587   echo "$ac_err" >&5
13588   echo "configure: failed program was:" >&5
13589   cat conftest.$ac_ext >&5
13590   rm -rf conftest*
13591   eval "ac_cv_header_$ac_safe=no"
13592 fi
13593 rm -f conftest*
13594 fi
13595 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13596   echo "$ac_t""yes" 1>&6
13597     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13598   cat >> confdefs.h <<EOF
13599 #define $ac_tr_hdr 1
13600 EOF
13601  
13602 else
13603   echo "$ac_t""no" 1>&6
13604 fi
13605 done
13606
13607  echo $ac_n "checking for db""... $ac_c" 1>&6
13608 echo "configure:13609: checking for db" >&5
13609 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13610   echo $ac_n "(cached) $ac_c" 1>&6
13611 else
13612   
13613         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13614                 ol_cv_mdbm=no
13615         else
13616                 ol_cv_mdbm=yes
13617         fi
13618
13619 fi
13620
13621 echo "$ac_t""$ol_cv_mdbm" 1>&6
13622  if test $ol_cv_mdbm = yes ; then
13623         cat >> confdefs.h <<\EOF
13624 #define HAVE_MDBM 1
13625 EOF
13626
13627  fi
13628
13629
13630         if test $ol_cv_mdbm = yes ; then
13631                 ol_link_ldbm=mdbm
13632                 ol_with_ldbm_api=mdbm
13633                 if test $ol_cv_lib_mdbm != yes ; then
13634                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13635                 fi
13636         fi
13637 fi
13638
13639 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13640         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13641 echo "configure:13642: checking for GDBM library" >&5
13642 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13643   echo $ac_n "(cached) $ac_c" 1>&6
13644 else
13645         ol_LIBS="$LIBS"
13646         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13647 echo "configure:13648: checking for gdbm_open" >&5
13648 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13649   echo $ac_n "(cached) $ac_c" 1>&6
13650 else
13651   cat > conftest.$ac_ext <<EOF
13652 #line 13653 "configure"
13653 #include "confdefs.h"
13654 /* System header to define __stub macros and hopefully few prototypes,
13655     which can conflict with char gdbm_open(); below.  */
13656 #include <assert.h>
13657 /* Override any gcc2 internal prototype to avoid an error.  */
13658 /* We use char because int might match the return type of a gcc2
13659     builtin and then its argument prototype would still apply.  */
13660 char gdbm_open();
13661 char (*f)();
13662
13663 int main() {
13664
13665 /* The GNU C library defines this for functions which it implements
13666     to always fail with ENOSYS.  Some functions are actually named
13667     something starting with __ and the normal name is an alias.  */
13668 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13669 choke me
13670 #else
13671 f = gdbm_open;
13672 #endif
13673
13674 ; return 0; }
13675 EOF
13676 if { (eval echo configure:13677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13677   rm -rf conftest*
13678   eval "ac_cv_func_gdbm_open=yes"
13679 else
13680   echo "configure: failed program was:" >&5
13681   cat conftest.$ac_ext >&5
13682   rm -rf conftest*
13683   eval "ac_cv_func_gdbm_open=no"
13684 fi
13685 rm -f conftest*
13686 fi
13687
13688 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13689   echo "$ac_t""yes" 1>&6
13690   ol_cv_lib_gdbm=yes
13691 else
13692   echo "$ac_t""no" 1>&6
13693
13694                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13695 echo "configure:13696: checking for gdbm_open in -lgdbm" >&5
13696 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13697 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13698   echo $ac_n "(cached) $ac_c" 1>&6
13699 else
13700   ac_save_LIBS="$LIBS"
13701 LIBS="-lgdbm  $LIBS"
13702 cat > conftest.$ac_ext <<EOF
13703 #line 13704 "configure"
13704 #include "confdefs.h"
13705 /* Override any gcc2 internal prototype to avoid an error.  */
13706 /* We use char because int might match the return type of a gcc2
13707     builtin and then its argument prototype would still apply.  */
13708 char gdbm_open();
13709
13710 int main() {
13711 gdbm_open()
13712 ; return 0; }
13713 EOF
13714 if { (eval echo configure:13715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13715   rm -rf conftest*
13716   eval "ac_cv_lib_$ac_lib_var=yes"
13717 else
13718   echo "configure: failed program was:" >&5
13719   cat conftest.$ac_ext >&5
13720   rm -rf conftest*
13721   eval "ac_cv_lib_$ac_lib_var=no"
13722 fi
13723 rm -f conftest*
13724 LIBS="$ac_save_LIBS"
13725
13726 fi
13727 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13728   echo "$ac_t""yes" 1>&6
13729   ol_cv_lib_gdbm=-lgdbm
13730 else
13731   echo "$ac_t""no" 1>&6
13732 ol_cv_lib_gdbm=no
13733 fi
13734
13735         
13736 fi
13737
13738         LIBS="$ol_LIBS"
13739
13740 fi
13741
13742 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13743
13744
13745  for ac_hdr in gdbm.h
13746 do
13747 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13748 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13749 echo "configure:13750: checking for $ac_hdr" >&5
13750 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13751   echo $ac_n "(cached) $ac_c" 1>&6
13752 else
13753   cat > conftest.$ac_ext <<EOF
13754 #line 13755 "configure"
13755 #include "confdefs.h"
13756 #include <$ac_hdr>
13757 EOF
13758 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13759 { (eval echo configure:13760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13760 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13761 if test -z "$ac_err"; then
13762   rm -rf conftest*
13763   eval "ac_cv_header_$ac_safe=yes"
13764 else
13765   echo "$ac_err" >&5
13766   echo "configure: failed program was:" >&5
13767   cat conftest.$ac_ext >&5
13768   rm -rf conftest*
13769   eval "ac_cv_header_$ac_safe=no"
13770 fi
13771 rm -f conftest*
13772 fi
13773 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13774   echo "$ac_t""yes" 1>&6
13775     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13776   cat >> confdefs.h <<EOF
13777 #define $ac_tr_hdr 1
13778 EOF
13779  
13780 else
13781   echo "$ac_t""no" 1>&6
13782 fi
13783 done
13784
13785  echo $ac_n "checking for db""... $ac_c" 1>&6
13786 echo "configure:13787: checking for db" >&5
13787 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13788   echo $ac_n "(cached) $ac_c" 1>&6
13789 else
13790   
13791         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13792                 ol_cv_gdbm=no
13793         else
13794                 ol_cv_gdbm=yes
13795         fi
13796
13797 fi
13798
13799 echo "$ac_t""$ol_cv_gdbm" 1>&6
13800  if test $ol_cv_gdbm = yes ; then
13801         cat >> confdefs.h <<\EOF
13802 #define HAVE_GDBM 1
13803 EOF
13804
13805  fi
13806
13807
13808         if test $ol_cv_gdbm = yes ; then
13809                 ol_link_ldbm=gdbm
13810                 ol_with_ldbm_api=gdbm
13811
13812                 if test $ol_cv_lib_gdbm != yes ; then
13813                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
13814                 fi
13815         fi
13816 fi
13817
13818 if test $ol_with_ldbm_api = ndbm ; then
13819         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
13820 echo "configure:13821: checking for NDBM library" >&5
13821 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
13822   echo $ac_n "(cached) $ac_c" 1>&6
13823 else
13824         ol_LIBS="$LIBS"
13825         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13826 echo "configure:13827: checking for dbm_open" >&5
13827 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
13828   echo $ac_n "(cached) $ac_c" 1>&6
13829 else
13830   cat > conftest.$ac_ext <<EOF
13831 #line 13832 "configure"
13832 #include "confdefs.h"
13833 /* System header to define __stub macros and hopefully few prototypes,
13834     which can conflict with char dbm_open(); below.  */
13835 #include <assert.h>
13836 /* Override any gcc2 internal prototype to avoid an error.  */
13837 /* We use char because int might match the return type of a gcc2
13838     builtin and then its argument prototype would still apply.  */
13839 char dbm_open();
13840 char (*f)();
13841
13842 int main() {
13843
13844 /* The GNU C library defines this for functions which it implements
13845     to always fail with ENOSYS.  Some functions are actually named
13846     something starting with __ and the normal name is an alias.  */
13847 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13848 choke me
13849 #else
13850 f = dbm_open;
13851 #endif
13852
13853 ; return 0; }
13854 EOF
13855 if { (eval echo configure:13856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13856   rm -rf conftest*
13857   eval "ac_cv_func_dbm_open=yes"
13858 else
13859   echo "configure: failed program was:" >&5
13860   cat conftest.$ac_ext >&5
13861   rm -rf conftest*
13862   eval "ac_cv_func_dbm_open=no"
13863 fi
13864 rm -f conftest*
13865 fi
13866
13867 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13868   echo "$ac_t""yes" 1>&6
13869   ol_cv_lib_ndbm=yes
13870 else
13871   echo "$ac_t""no" 1>&6
13872
13873                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
13874 echo "configure:13875: checking for dbm_open in -lndbm" >&5
13875 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13876 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13877   echo $ac_n "(cached) $ac_c" 1>&6
13878 else
13879   ac_save_LIBS="$LIBS"
13880 LIBS="-lndbm  $LIBS"
13881 cat > conftest.$ac_ext <<EOF
13882 #line 13883 "configure"
13883 #include "confdefs.h"
13884 /* Override any gcc2 internal prototype to avoid an error.  */
13885 /* We use char because int might match the return type of a gcc2
13886     builtin and then its argument prototype would still apply.  */
13887 char dbm_open();
13888
13889 int main() {
13890 dbm_open()
13891 ; return 0; }
13892 EOF
13893 if { (eval echo configure:13894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13894   rm -rf conftest*
13895   eval "ac_cv_lib_$ac_lib_var=yes"
13896 else
13897   echo "configure: failed program was:" >&5
13898   cat conftest.$ac_ext >&5
13899   rm -rf conftest*
13900   eval "ac_cv_lib_$ac_lib_var=no"
13901 fi
13902 rm -f conftest*
13903 LIBS="$ac_save_LIBS"
13904
13905 fi
13906 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13907   echo "$ac_t""yes" 1>&6
13908   ol_cv_lib_ndbm=-lndbm
13909 else
13910   echo "$ac_t""no" 1>&6
13911
13912                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13913 echo "configure:13914: checking for dbm_open in -ldbm" >&5
13914 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13915 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13916   echo $ac_n "(cached) $ac_c" 1>&6
13917 else
13918   ac_save_LIBS="$LIBS"
13919 LIBS="-ldbm  $LIBS"
13920 cat > conftest.$ac_ext <<EOF
13921 #line 13922 "configure"
13922 #include "confdefs.h"
13923 /* Override any gcc2 internal prototype to avoid an error.  */
13924 /* We use char because int might match the return type of a gcc2
13925     builtin and then its argument prototype would still apply.  */
13926 char dbm_open();
13927
13928 int main() {
13929 dbm_open()
13930 ; return 0; }
13931 EOF
13932 if { (eval echo configure:13933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13933   rm -rf conftest*
13934   eval "ac_cv_lib_$ac_lib_var=yes"
13935 else
13936   echo "configure: failed program was:" >&5
13937   cat conftest.$ac_ext >&5
13938   rm -rf conftest*
13939   eval "ac_cv_lib_$ac_lib_var=no"
13940 fi
13941 rm -f conftest*
13942 LIBS="$ac_save_LIBS"
13943
13944 fi
13945 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13946   echo "$ac_t""yes" 1>&6
13947   ol_cv_lib_ndbm=-ldbm
13948 else
13949   echo "$ac_t""no" 1>&6
13950 ol_cv_lib_ndbm=no
13951 fi
13952                 
13953 fi
13954
13955         
13956 fi
13957
13958         LIBS="$ol_LIBS"
13959
13960 fi
13961
13962 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
13963
13964
13965  for ac_hdr in ndbm.h
13966 do
13967 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13968 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13969 echo "configure:13970: checking for $ac_hdr" >&5
13970 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13971   echo $ac_n "(cached) $ac_c" 1>&6
13972 else
13973   cat > conftest.$ac_ext <<EOF
13974 #line 13975 "configure"
13975 #include "confdefs.h"
13976 #include <$ac_hdr>
13977 EOF
13978 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13979 { (eval echo configure:13980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13980 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13981 if test -z "$ac_err"; then
13982   rm -rf conftest*
13983   eval "ac_cv_header_$ac_safe=yes"
13984 else
13985   echo "$ac_err" >&5
13986   echo "configure: failed program was:" >&5
13987   cat conftest.$ac_ext >&5
13988   rm -rf conftest*
13989   eval "ac_cv_header_$ac_safe=no"
13990 fi
13991 rm -f conftest*
13992 fi
13993 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13994   echo "$ac_t""yes" 1>&6
13995     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13996   cat >> confdefs.h <<EOF
13997 #define $ac_tr_hdr 1
13998 EOF
13999  
14000 else
14001   echo "$ac_t""no" 1>&6
14002 fi
14003 done
14004
14005  echo $ac_n "checking for db""... $ac_c" 1>&6
14006 echo "configure:14007: checking for db" >&5
14007 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
14008   echo $ac_n "(cached) $ac_c" 1>&6
14009 else
14010   
14011         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
14012                 ol_cv_ndbm=no
14013         else
14014                 ol_cv_ndbm=yes
14015         fi
14016
14017 fi
14018
14019 echo "$ac_t""$ol_cv_ndbm" 1>&6
14020  if test $ol_cv_ndbm = yes ; then
14021         cat >> confdefs.h <<\EOF
14022 #define HAVE_NDBM 1
14023 EOF
14024
14025  fi
14026
14027
14028         if test $ol_cv_ndbm = yes ; then
14029                 ol_link_ldbm=ndbm
14030                 ol_with_ldbm_api=ndbm
14031
14032                 if test $ol_cv_lib_ndbm != yes ; then
14033                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
14034                 fi
14035         fi
14036 fi
14037
14038 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
14039         echo "configure: warning: could not find suitable LDBM backend" 1>&2
14040         if test $ol_enable_ldbm = yes ; then
14041                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
14042         fi
14043
14044         echo "configure: warning: disabling LDBM" 1>&2
14045         ol_enable_ldbm=no
14046 fi
14047
14048 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
14049         LINK_BINS_DYNAMIC="yes"
14050 else
14051         LINK_BINS_DYNAMIC="no"
14052 fi
14053
14054 if test $ol_enable_wrappers != no ; then
14055         for ac_hdr in tcpd.h
14056 do
14057 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14058 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14059 echo "configure:14060: checking for $ac_hdr" >&5
14060 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14061   echo $ac_n "(cached) $ac_c" 1>&6
14062 else
14063   cat > conftest.$ac_ext <<EOF
14064 #line 14065 "configure"
14065 #include "confdefs.h"
14066 #include <$ac_hdr>
14067 EOF
14068 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14069 { (eval echo configure:14070: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14070 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14071 if test -z "$ac_err"; then
14072   rm -rf conftest*
14073   eval "ac_cv_header_$ac_safe=yes"
14074 else
14075   echo "$ac_err" >&5
14076   echo "configure: failed program was:" >&5
14077   cat conftest.$ac_ext >&5
14078   rm -rf conftest*
14079   eval "ac_cv_header_$ac_safe=no"
14080 fi
14081 rm -f conftest*
14082 fi
14083 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14084   echo "$ac_t""yes" 1>&6
14085     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14086   cat >> confdefs.h <<EOF
14087 #define $ac_tr_hdr 1
14088 EOF
14089  
14090 else
14091   echo "$ac_t""no" 1>&6
14092 fi
14093 done
14094
14095
14096         if test $ac_cv_header_tcpd_h != yes ; then
14097                 have_wrappers=no
14098         else
14099                 cat > conftest.$ac_ext <<EOF
14100 #line 14101 "configure"
14101 #include "confdefs.h"
14102
14103 int allow_severity = 0;
14104 int deny_severity  = 0;
14105                 
14106 int main() {
14107 hosts_access()
14108 ; return 0; }
14109 EOF
14110 if { (eval echo configure:14111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14111   rm -rf conftest*
14112   have_wrappers=yes
14113 else
14114   echo "configure: failed program was:" >&5
14115   cat conftest.$ac_ext >&5
14116   rm -rf conftest*
14117   have_wrappers=no
14118 fi
14119 rm -f conftest*
14120         fi
14121
14122         if test $have_wrappers = yes ; then
14123                 cat >> confdefs.h <<\EOF
14124 #define HAVE_TCPD 1
14125 EOF
14126
14127                 WRAP_LIBS="-lwrap"
14128
14129                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
14130 echo "configure:14131: checking for main in -lnsl" >&5
14131 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
14132 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14133   echo $ac_n "(cached) $ac_c" 1>&6
14134 else
14135   ac_save_LIBS="$LIBS"
14136 LIBS="-lnsl  $LIBS"
14137 cat > conftest.$ac_ext <<EOF
14138 #line 14139 "configure"
14139 #include "confdefs.h"
14140
14141 int main() {
14142 main()
14143 ; return 0; }
14144 EOF
14145 if { (eval echo configure:14146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14146   rm -rf conftest*
14147   eval "ac_cv_lib_$ac_lib_var=yes"
14148 else
14149   echo "configure: failed program was:" >&5
14150   cat conftest.$ac_ext >&5
14151   rm -rf conftest*
14152   eval "ac_cv_lib_$ac_lib_var=no"
14153 fi
14154 rm -f conftest*
14155 LIBS="$ac_save_LIBS"
14156
14157 fi
14158 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14159   echo "$ac_t""yes" 1>&6
14160     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14161     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14162   cat >> confdefs.h <<EOF
14163 #define $ac_tr_lib 1
14164 EOF
14165
14166   LIBS="-lnsl $LIBS"
14167
14168 else
14169   echo "$ac_t""no" 1>&6
14170 fi
14171
14172         else
14173                 echo "configure: warning: could not find -lwrap" 1>&2
14174                 if test $ol_enable_wrappers = yes ; then
14175                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14176                 fi
14177
14178                 echo "configure: warning: disabling wrappers support" 1>&2
14179                 ol_enable_wrappers=no
14180                 WRAP_LIBS=""
14181         fi
14182 fi
14183
14184 if test $ol_enable_syslog != no ; then
14185         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14186 echo "configure:14187: checking for openlog" >&5
14187 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14188   echo $ac_n "(cached) $ac_c" 1>&6
14189 else
14190   cat > conftest.$ac_ext <<EOF
14191 #line 14192 "configure"
14192 #include "confdefs.h"
14193 /* System header to define __stub macros and hopefully few prototypes,
14194     which can conflict with char openlog(); below.  */
14195 #include <assert.h>
14196 /* Override any gcc2 internal prototype to avoid an error.  */
14197 /* We use char because int might match the return type of a gcc2
14198     builtin and then its argument prototype would still apply.  */
14199 char openlog();
14200 char (*f)();
14201
14202 int main() {
14203
14204 /* The GNU C library defines this for functions which it implements
14205     to always fail with ENOSYS.  Some functions are actually named
14206     something starting with __ and the normal name is an alias.  */
14207 #if defined (__stub_openlog) || defined (__stub___openlog)
14208 choke me
14209 #else
14210 f = openlog;
14211 #endif
14212
14213 ; return 0; }
14214 EOF
14215 if { (eval echo configure:14216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14216   rm -rf conftest*
14217   eval "ac_cv_func_openlog=yes"
14218 else
14219   echo "configure: failed program was:" >&5
14220   cat conftest.$ac_ext >&5
14221   rm -rf conftest*
14222   eval "ac_cv_func_openlog=no"
14223 fi
14224 rm -f conftest*
14225 fi
14226
14227 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14228   echo "$ac_t""yes" 1>&6
14229   :
14230 else
14231   echo "$ac_t""no" 1>&6
14232 fi
14233
14234         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14235                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14236         fi
14237         ol_enable_syslog=$ac_cv_func_openlog
14238 fi
14239
14240 ol_link_sql=no
14241 if test $ol_enable_sql != no ; then
14242         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14243 echo "configure:14244: checking for SQLDriverConnect in -liodbc" >&5
14244 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14245 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14246   echo $ac_n "(cached) $ac_c" 1>&6
14247 else
14248   ac_save_LIBS="$LIBS"
14249 LIBS="-liodbc  $LIBS"
14250 cat > conftest.$ac_ext <<EOF
14251 #line 14252 "configure"
14252 #include "confdefs.h"
14253 /* Override any gcc2 internal prototype to avoid an error.  */
14254 /* We use char because int might match the return type of a gcc2
14255     builtin and then its argument prototype would still apply.  */
14256 char SQLDriverConnect();
14257
14258 int main() {
14259 SQLDriverConnect()
14260 ; return 0; }
14261 EOF
14262 if { (eval echo configure:14263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14263   rm -rf conftest*
14264   eval "ac_cv_lib_$ac_lib_var=yes"
14265 else
14266   echo "configure: failed program was:" >&5
14267   cat conftest.$ac_ext >&5
14268   rm -rf conftest*
14269   eval "ac_cv_lib_$ac_lib_var=no"
14270 fi
14271 rm -f conftest*
14272 LIBS="$ac_save_LIBS"
14273
14274 fi
14275 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14276   echo "$ac_t""yes" 1>&6
14277   have_iodbc=yes
14278 else
14279   echo "$ac_t""no" 1>&6
14280 have_iodbc=no
14281 fi
14282
14283         if test $have_iodbc = yes ; then
14284                 ol_link_sql="-liodbc"
14285         else
14286                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14287 echo "configure:14288: checking for SQLDriverConnect in -lodbc" >&5
14288 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14289 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14290   echo $ac_n "(cached) $ac_c" 1>&6
14291 else
14292   ac_save_LIBS="$LIBS"
14293 LIBS="-lodbc  $LIBS"
14294 cat > conftest.$ac_ext <<EOF
14295 #line 14296 "configure"
14296 #include "confdefs.h"
14297 /* Override any gcc2 internal prototype to avoid an error.  */
14298 /* We use char because int might match the return type of a gcc2
14299     builtin and then its argument prototype would still apply.  */
14300 char SQLDriverConnect();
14301
14302 int main() {
14303 SQLDriverConnect()
14304 ; return 0; }
14305 EOF
14306 if { (eval echo configure:14307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14307   rm -rf conftest*
14308   eval "ac_cv_lib_$ac_lib_var=yes"
14309 else
14310   echo "configure: failed program was:" >&5
14311   cat conftest.$ac_ext >&5
14312   rm -rf conftest*
14313   eval "ac_cv_lib_$ac_lib_var=no"
14314 fi
14315 rm -f conftest*
14316 LIBS="$ac_save_LIBS"
14317
14318 fi
14319 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14320   echo "$ac_t""yes" 1>&6
14321   have_odbc=yes
14322 else
14323   echo "$ac_t""no" 1>&6
14324 have_odbc=no
14325 fi
14326
14327                 if test $have_odbc = yes ; then
14328                         ol_link_sql="-lodbc"
14329                 fi
14330         fi
14331
14332         if test $ol_link_sql != no ; then
14333                 SLAPD_SQL_LIBS="$ol_link_sql"
14334
14335         elif test $ol_enable_sql != auto ; then
14336                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14337         fi
14338 fi
14339
14340 ol_link_termcap=no
14341 for ac_hdr in termcap.h ncurses.h
14342 do
14343 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14344 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14345 echo "configure:14346: checking for $ac_hdr" >&5
14346 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14347   echo $ac_n "(cached) $ac_c" 1>&6
14348 else
14349   cat > conftest.$ac_ext <<EOF
14350 #line 14351 "configure"
14351 #include "confdefs.h"
14352 #include <$ac_hdr>
14353 EOF
14354 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14355 { (eval echo configure:14356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14356 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14357 if test -z "$ac_err"; then
14358   rm -rf conftest*
14359   eval "ac_cv_header_$ac_safe=yes"
14360 else
14361   echo "$ac_err" >&5
14362   echo "configure: failed program was:" >&5
14363   cat conftest.$ac_ext >&5
14364   rm -rf conftest*
14365   eval "ac_cv_header_$ac_safe=no"
14366 fi
14367 rm -f conftest*
14368 fi
14369 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14370   echo "$ac_t""yes" 1>&6
14371     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14372   cat >> confdefs.h <<EOF
14373 #define $ac_tr_hdr 1
14374 EOF
14375  
14376 else
14377   echo "$ac_t""no" 1>&6
14378 fi
14379 done
14380
14381
14382 if test $ol_link_termcap = no ; then
14383         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14384 echo "configure:14385: checking for tputs in -ltermcap" >&5
14385 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14386 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14387   echo $ac_n "(cached) $ac_c" 1>&6
14388 else
14389   ac_save_LIBS="$LIBS"
14390 LIBS="-ltermcap  $LIBS"
14391 cat > conftest.$ac_ext <<EOF
14392 #line 14393 "configure"
14393 #include "confdefs.h"
14394 /* Override any gcc2 internal prototype to avoid an error.  */
14395 /* We use char because int might match the return type of a gcc2
14396     builtin and then its argument prototype would still apply.  */
14397 char tputs();
14398
14399 int main() {
14400 tputs()
14401 ; return 0; }
14402 EOF
14403 if { (eval echo configure:14404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14404   rm -rf conftest*
14405   eval "ac_cv_lib_$ac_lib_var=yes"
14406 else
14407   echo "configure: failed program was:" >&5
14408   cat conftest.$ac_ext >&5
14409   rm -rf conftest*
14410   eval "ac_cv_lib_$ac_lib_var=no"
14411 fi
14412 rm -f conftest*
14413 LIBS="$ac_save_LIBS"
14414
14415 fi
14416 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14417   echo "$ac_t""yes" 1>&6
14418   have_termcap=yes
14419 else
14420   echo "$ac_t""no" 1>&6
14421 have_termcap=no
14422 fi
14423
14424         if test $have_termcap = yes ; then
14425                 cat >> confdefs.h <<\EOF
14426 #define HAVE_TERMCAP 1
14427 EOF
14428
14429                 ol_link_termcap=yes
14430                 TERMCAP_LIBS=-ltermcap
14431         fi
14432 fi
14433
14434 if test $ol_link_termcap = no ; then
14435         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14436 echo "configure:14437: checking for initscr in -lncurses" >&5
14437 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14438 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14439   echo $ac_n "(cached) $ac_c" 1>&6
14440 else
14441   ac_save_LIBS="$LIBS"
14442 LIBS="-lncurses  $LIBS"
14443 cat > conftest.$ac_ext <<EOF
14444 #line 14445 "configure"
14445 #include "confdefs.h"
14446 /* Override any gcc2 internal prototype to avoid an error.  */
14447 /* We use char because int might match the return type of a gcc2
14448     builtin and then its argument prototype would still apply.  */
14449 char initscr();
14450
14451 int main() {
14452 initscr()
14453 ; return 0; }
14454 EOF
14455 if { (eval echo configure:14456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14456   rm -rf conftest*
14457   eval "ac_cv_lib_$ac_lib_var=yes"
14458 else
14459   echo "configure: failed program was:" >&5
14460   cat conftest.$ac_ext >&5
14461   rm -rf conftest*
14462   eval "ac_cv_lib_$ac_lib_var=no"
14463 fi
14464 rm -f conftest*
14465 LIBS="$ac_save_LIBS"
14466
14467 fi
14468 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14469   echo "$ac_t""yes" 1>&6
14470   have_ncurses=yes
14471 else
14472   echo "$ac_t""no" 1>&6
14473 have_ncurses=no
14474 fi
14475
14476         if test $have_ncurses = yes ; then
14477                 cat >> confdefs.h <<\EOF
14478 #define HAVE_NCURSES 1
14479 EOF
14480
14481                 ol_link_termcap=yes
14482                 TERMCAP_LIBS=-lncurses
14483         fi
14484 fi
14485
14486 if test $ol_link_termcap = no ; then
14487         cat >> confdefs.h <<\EOF
14488 #define NO_TERMCAP 1
14489 EOF
14490
14491         TERMCAP_LIBS=
14492 fi
14493
14494 ol_link_sasl=no
14495 ol_link_spasswd=no
14496 if test $ol_with_cyrus_sasl != no ; then
14497         for ac_hdr in sasl.h
14498 do
14499 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14500 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14501 echo "configure:14502: checking for $ac_hdr" >&5
14502 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14503   echo $ac_n "(cached) $ac_c" 1>&6
14504 else
14505   cat > conftest.$ac_ext <<EOF
14506 #line 14507 "configure"
14507 #include "confdefs.h"
14508 #include <$ac_hdr>
14509 EOF
14510 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14511 { (eval echo configure:14512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14512 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14513 if test -z "$ac_err"; then
14514   rm -rf conftest*
14515   eval "ac_cv_header_$ac_safe=yes"
14516 else
14517   echo "$ac_err" >&5
14518   echo "configure: failed program was:" >&5
14519   cat conftest.$ac_ext >&5
14520   rm -rf conftest*
14521   eval "ac_cv_header_$ac_safe=no"
14522 fi
14523 rm -f conftest*
14524 fi
14525 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14526   echo "$ac_t""yes" 1>&6
14527     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14528   cat >> confdefs.h <<EOF
14529 #define $ac_tr_hdr 1
14530 EOF
14531  
14532 else
14533   echo "$ac_t""no" 1>&6
14534 fi
14535 done
14536
14537
14538         if test $ac_cv_header_sasl_h = yes ; then
14539                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14540 echo "configure:14541: checking for sasl_client_init in -lsasl" >&5
14541 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14542 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14543   echo $ac_n "(cached) $ac_c" 1>&6
14544 else
14545   ac_save_LIBS="$LIBS"
14546 LIBS="-lsasl  $LIBS"
14547 cat > conftest.$ac_ext <<EOF
14548 #line 14549 "configure"
14549 #include "confdefs.h"
14550 /* Override any gcc2 internal prototype to avoid an error.  */
14551 /* We use char because int might match the return type of a gcc2
14552     builtin and then its argument prototype would still apply.  */
14553 char sasl_client_init();
14554
14555 int main() {
14556 sasl_client_init()
14557 ; return 0; }
14558 EOF
14559 if { (eval echo configure:14560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14560   rm -rf conftest*
14561   eval "ac_cv_lib_$ac_lib_var=yes"
14562 else
14563   echo "configure: failed program was:" >&5
14564   cat conftest.$ac_ext >&5
14565   rm -rf conftest*
14566   eval "ac_cv_lib_$ac_lib_var=no"
14567 fi
14568 rm -f conftest*
14569 LIBS="$ac_save_LIBS"
14570
14571 fi
14572 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14573   echo "$ac_t""yes" 1>&6
14574   have_cyrus_sasl=yes
14575 else
14576   echo "$ac_t""no" 1>&6
14577 have_cyrus_sasl=no
14578 fi
14579
14580
14581                 if test $have_cyrus_sasl != no ; then
14582                         SASL_LIBS="-lsasl"
14583                         cat >> confdefs.h <<\EOF
14584 #define HAVE_CYRUS_SASL 1
14585 EOF
14586
14587                         ol_link_sasl=yes
14588                 fi
14589         fi
14590
14591         if test $ol_link_sasl = no ; then
14592                 if test $ol_with_cyrus_sasl != auto ; then
14593                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14594                 else
14595                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14596                         echo "configure: warning: SASL authentication not supported!" 1>&2
14597                         if test $ol_link_tls = no ; then
14598                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14599                         fi
14600                 fi
14601
14602         elif test $ol_enable_spasswd != no ; then
14603                 ol_link_spasswd=yes
14604         fi
14605
14606 else
14607         echo "configure: warning: SASL authentication not supported!" 1>&2
14608         if test $ol_link_tls = no ; then
14609                 echo "configure: warning: Strong authentication not supported!" 1>&2
14610         fi
14611 fi
14612
14613 if test $cross_compiling != yes ; then
14614         dev=no
14615         if test -r /dev/urandom ; then
14616                 dev="/dev/urandom";
14617         elif test -r /idev/urandom ; then
14618                 dev="/idev/urandom";
14619         elif test -r /dev/srandom ; then
14620                 dev="/dev/srandom";
14621         elif test -r /dev/random ; then
14622                 dev="/dev/random";
14623         elif test -r /idev/random ; then
14624                 dev="/idev/random";
14625         fi
14626
14627         if test $dev != no ; then
14628                 cat >> confdefs.h <<EOF
14629 #define URANDOM_DEVICE "$dev"
14630 EOF
14631
14632         fi
14633 fi
14634
14635 ol_link_fetch=no
14636 if test $ol_with_fetch != no ; then
14637         ol_LIBS=$LIBS
14638 LIBS="-lfetch -lcom_err $LIBS"
14639 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14640 echo "configure:14641: checking fetch(3) library" >&5
14641 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14642   echo $ac_n "(cached) $ac_c" 1>&6
14643 else
14644   
14645         cat > conftest.$ac_ext <<EOF
14646 #line 14647 "configure"
14647 #include "confdefs.h"
14648
14649 #include <sys/param.h>
14650 #include <stdio.h>
14651 #include <fetch.h>
14652 int main() {
14653 struct url *u = fetchParseURL("file:///"); 
14654 ; return 0; }
14655 EOF
14656 if { (eval echo configure:14657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14657   rm -rf conftest*
14658   ol_cv_lib_fetch=yes
14659 else
14660   echo "configure: failed program was:" >&5
14661   cat conftest.$ac_ext >&5
14662   rm -rf conftest*
14663   ol_cv_lib_fetch=no
14664 fi
14665 rm -f conftest*
14666 fi
14667
14668 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14669 LIBS=$ol_LIBS
14670 if test $ol_cv_lib_fetch != no ; then
14671         ol_link_fetch="-lfetch -lcom_err"
14672         cat >> confdefs.h <<\EOF
14673 #define HAVE_FETCH 1
14674 EOF
14675
14676 fi
14677
14678
14679         if test $ol_cv_lib_fetch != no ; then
14680                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14681                 ol_link_fetch=freebsd
14682
14683         elif test $ol_with_fetch != auto ; then
14684                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14685         fi 
14686 fi
14687
14688 ol_link_readline=no
14689 if test $ol_with_readline != no ; then
14690         for ac_hdr in readline/readline.h readline/history.h
14691 do
14692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14693 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14694 echo "configure:14695: checking for $ac_hdr" >&5
14695 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14696   echo $ac_n "(cached) $ac_c" 1>&6
14697 else
14698   cat > conftest.$ac_ext <<EOF
14699 #line 14700 "configure"
14700 #include "confdefs.h"
14701 #include <$ac_hdr>
14702 EOF
14703 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14704 { (eval echo configure:14705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14705 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14706 if test -z "$ac_err"; then
14707   rm -rf conftest*
14708   eval "ac_cv_header_$ac_safe=yes"
14709 else
14710   echo "$ac_err" >&5
14711   echo "configure: failed program was:" >&5
14712   cat conftest.$ac_ext >&5
14713   rm -rf conftest*
14714   eval "ac_cv_header_$ac_safe=no"
14715 fi
14716 rm -f conftest*
14717 fi
14718 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14719   echo "$ac_t""yes" 1>&6
14720     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14721   cat >> confdefs.h <<EOF
14722 #define $ac_tr_hdr 1
14723 EOF
14724  
14725 else
14726   echo "$ac_t""no" 1>&6
14727 fi
14728 done
14729
14730
14731         if test $ac_cv_header_readline_readline_h = yes ; then
14732                 save_LIBS="$LIBS"
14733                 LIBS="$TERMCAP_LIBS $LIBS"
14734                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14735 echo "configure:14736: checking for readline in -lreadline" >&5
14736 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14737 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14738   echo $ac_n "(cached) $ac_c" 1>&6
14739 else
14740   ac_save_LIBS="$LIBS"
14741 LIBS="-lreadline  $LIBS"
14742 cat > conftest.$ac_ext <<EOF
14743 #line 14744 "configure"
14744 #include "confdefs.h"
14745 /* Override any gcc2 internal prototype to avoid an error.  */
14746 /* We use char because int might match the return type of a gcc2
14747     builtin and then its argument prototype would still apply.  */
14748 char readline();
14749
14750 int main() {
14751 readline()
14752 ; return 0; }
14753 EOF
14754 if { (eval echo configure:14755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14755   rm -rf conftest*
14756   eval "ac_cv_lib_$ac_lib_var=yes"
14757 else
14758   echo "configure: failed program was:" >&5
14759   cat conftest.$ac_ext >&5
14760   rm -rf conftest*
14761   eval "ac_cv_lib_$ac_lib_var=no"
14762 fi
14763 rm -f conftest*
14764 LIBS="$ac_save_LIBS"
14765
14766 fi
14767 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14768   echo "$ac_t""yes" 1>&6
14769   have_readline=yes
14770 else
14771   echo "$ac_t""no" 1>&6
14772 have_readline=no
14773 fi
14774
14775                 LIBS="$save_LIBS"
14776                         
14777                 if test $have_readline = yes ; then
14778                         ol_with_readline=found
14779                         ol_link_readline=yes
14780
14781                         READLINE_LIBS="-lreadline"
14782                 fi
14783         fi
14784 fi
14785
14786 if test $ol_link_readline = yes ; then
14787         cat >> confdefs.h <<\EOF
14788 #define HAVE_READLINE 1
14789 EOF
14790
14791 fi
14792
14793
14794 if test $ol_enable_crypt != no ; then
14795         echo $ac_n "checking for crypt""... $ac_c" 1>&6
14796 echo "configure:14797: checking for crypt" >&5
14797 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
14798   echo $ac_n "(cached) $ac_c" 1>&6
14799 else
14800   cat > conftest.$ac_ext <<EOF
14801 #line 14802 "configure"
14802 #include "confdefs.h"
14803 /* System header to define __stub macros and hopefully few prototypes,
14804     which can conflict with char crypt(); below.  */
14805 #include <assert.h>
14806 /* Override any gcc2 internal prototype to avoid an error.  */
14807 /* We use char because int might match the return type of a gcc2
14808     builtin and then its argument prototype would still apply.  */
14809 char crypt();
14810 char (*f)();
14811
14812 int main() {
14813
14814 /* The GNU C library defines this for functions which it implements
14815     to always fail with ENOSYS.  Some functions are actually named
14816     something starting with __ and the normal name is an alias.  */
14817 #if defined (__stub_crypt) || defined (__stub___crypt)
14818 choke me
14819 #else
14820 f = crypt;
14821 #endif
14822
14823 ; return 0; }
14824 EOF
14825 if { (eval echo configure:14826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14826   rm -rf conftest*
14827   eval "ac_cv_func_crypt=yes"
14828 else
14829   echo "configure: failed program was:" >&5
14830   cat conftest.$ac_ext >&5
14831   rm -rf conftest*
14832   eval "ac_cv_func_crypt=no"
14833 fi
14834 rm -f conftest*
14835 fi
14836
14837 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14838   echo "$ac_t""yes" 1>&6
14839   have_crypt=yes
14840 else
14841   echo "$ac_t""no" 1>&6
14842
14843                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14844 echo "configure:14845: checking for crypt in -lcrypt" >&5
14845 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14846 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14847   echo $ac_n "(cached) $ac_c" 1>&6
14848 else
14849   ac_save_LIBS="$LIBS"
14850 LIBS="-lcrypt  $LIBS"
14851 cat > conftest.$ac_ext <<EOF
14852 #line 14853 "configure"
14853 #include "confdefs.h"
14854 /* Override any gcc2 internal prototype to avoid an error.  */
14855 /* We use char because int might match the return type of a gcc2
14856     builtin and then its argument prototype would still apply.  */
14857 char crypt();
14858
14859 int main() {
14860 crypt()
14861 ; return 0; }
14862 EOF
14863 if { (eval echo configure:14864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14864   rm -rf conftest*
14865   eval "ac_cv_lib_$ac_lib_var=yes"
14866 else
14867   echo "configure: failed program was:" >&5
14868   cat conftest.$ac_ext >&5
14869   rm -rf conftest*
14870   eval "ac_cv_lib_$ac_lib_var=no"
14871 fi
14872 rm -f conftest*
14873 LIBS="$ac_save_LIBS"
14874
14875 fi
14876 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14877   echo "$ac_t""yes" 1>&6
14878   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14879                         have_crypt=yes
14880 else
14881   echo "$ac_t""no" 1>&6
14882 have_crypt=no
14883 fi
14884
14885 fi
14886
14887
14888         if test $have_crypt = yes ; then
14889                 cat >> confdefs.h <<\EOF
14890 #define HAVE_CRYPT 1
14891 EOF
14892
14893         else
14894                 echo "configure: warning: could not find crypt" 1>&2
14895                 if test $ol_enable_crypt = yes ; then
14896                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14897                 fi
14898
14899                 echo "configure: warning: disabling crypt support" 1>&2
14900                 ol_enable_crypt=no
14901         fi
14902 fi
14903
14904 if test $ol_enable_proctitle != no ; then
14905         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
14906 echo "configure:14907: checking for setproctitle" >&5
14907 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
14908   echo $ac_n "(cached) $ac_c" 1>&6
14909 else
14910   cat > conftest.$ac_ext <<EOF
14911 #line 14912 "configure"
14912 #include "confdefs.h"
14913 /* System header to define __stub macros and hopefully few prototypes,
14914     which can conflict with char setproctitle(); below.  */
14915 #include <assert.h>
14916 /* Override any gcc2 internal prototype to avoid an error.  */
14917 /* We use char because int might match the return type of a gcc2
14918     builtin and then its argument prototype would still apply.  */
14919 char setproctitle();
14920 char (*f)();
14921
14922 int main() {
14923
14924 /* The GNU C library defines this for functions which it implements
14925     to always fail with ENOSYS.  Some functions are actually named
14926     something starting with __ and the normal name is an alias.  */
14927 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
14928 choke me
14929 #else
14930 f = setproctitle;
14931 #endif
14932
14933 ; return 0; }
14934 EOF
14935 if { (eval echo configure:14936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14936   rm -rf conftest*
14937   eval "ac_cv_func_setproctitle=yes"
14938 else
14939   echo "configure: failed program was:" >&5
14940   cat conftest.$ac_ext >&5
14941   rm -rf conftest*
14942   eval "ac_cv_func_setproctitle=no"
14943 fi
14944 rm -f conftest*
14945 fi
14946
14947 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
14948   echo "$ac_t""yes" 1>&6
14949   have_setproctitle=yes
14950 else
14951   echo "$ac_t""no" 1>&6
14952
14953                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
14954 echo "configure:14955: checking for setproctitle in -lutil" >&5
14955 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
14956 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14957   echo $ac_n "(cached) $ac_c" 1>&6
14958 else
14959   ac_save_LIBS="$LIBS"
14960 LIBS="-lutil  $LIBS"
14961 cat > conftest.$ac_ext <<EOF
14962 #line 14963 "configure"
14963 #include "confdefs.h"
14964 /* Override any gcc2 internal prototype to avoid an error.  */
14965 /* We use char because int might match the return type of a gcc2
14966     builtin and then its argument prototype would still apply.  */
14967 char setproctitle();
14968
14969 int main() {
14970 setproctitle()
14971 ; return 0; }
14972 EOF
14973 if { (eval echo configure:14974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14974   rm -rf conftest*
14975   eval "ac_cv_lib_$ac_lib_var=yes"
14976 else
14977   echo "configure: failed program was:" >&5
14978   cat conftest.$ac_ext >&5
14979   rm -rf conftest*
14980   eval "ac_cv_lib_$ac_lib_var=no"
14981 fi
14982 rm -f conftest*
14983 LIBS="$ac_save_LIBS"
14984
14985 fi
14986 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14987   echo "$ac_t""yes" 1>&6
14988   have_setproctitle=yes
14989                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
14990 else
14991   echo "$ac_t""no" 1>&6
14992 have_setproctitle=no
14993                         LIBOBJS="$LIBOBJS setproctitle.o"
14994                         LIBSRCS="$LIBSRCS setproctitle.c"
14995 fi
14996
14997 fi
14998
14999
15000         if test $have_setproctitle = yes ; then
15001                 cat >> confdefs.h <<\EOF
15002 #define HAVE_SETPROCTITLE 1
15003 EOF
15004
15005         fi
15006 fi
15007
15008 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
15009 echo "configure:15010: checking for ANSI C header files" >&5
15010 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
15011   echo $ac_n "(cached) $ac_c" 1>&6
15012 else
15013   cat > conftest.$ac_ext <<EOF
15014 #line 15015 "configure"
15015 #include "confdefs.h"
15016 #include <stdlib.h>
15017 #include <stdarg.h>
15018 #include <string.h>
15019 #include <float.h>
15020 EOF
15021 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
15022 { (eval echo configure:15023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
15023 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
15024 if test -z "$ac_err"; then
15025   rm -rf conftest*
15026   ac_cv_header_stdc=yes
15027 else
15028   echo "$ac_err" >&5
15029   echo "configure: failed program was:" >&5
15030   cat conftest.$ac_ext >&5
15031   rm -rf conftest*
15032   ac_cv_header_stdc=no
15033 fi
15034 rm -f conftest*
15035
15036 if test $ac_cv_header_stdc = yes; then
15037   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15038 cat > conftest.$ac_ext <<EOF
15039 #line 15040 "configure"
15040 #include "confdefs.h"
15041 #include <string.h>
15042 EOF
15043 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15044   egrep "memchr" >/dev/null 2>&1; then
15045   :
15046 else
15047   rm -rf conftest*
15048   ac_cv_header_stdc=no
15049 fi
15050 rm -f conftest*
15051
15052 fi
15053
15054 if test $ac_cv_header_stdc = yes; then
15055   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15056 cat > conftest.$ac_ext <<EOF
15057 #line 15058 "configure"
15058 #include "confdefs.h"
15059 #include <stdlib.h>
15060 EOF
15061 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15062   egrep "free" >/dev/null 2>&1; then
15063   :
15064 else
15065   rm -rf conftest*
15066   ac_cv_header_stdc=no
15067 fi
15068 rm -f conftest*
15069
15070 fi
15071
15072 if test $ac_cv_header_stdc = yes; then
15073   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15074 if test "$cross_compiling" = yes; then
15075   :
15076 else
15077   cat > conftest.$ac_ext <<EOF
15078 #line 15079 "configure"
15079 #include "confdefs.h"
15080 #include <ctype.h>
15081 #if ((' ' & 0x0FF) == 0x020)
15082 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15083 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15084 #else
15085 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15086  || ('j' <= (c) && (c) <= 'r') \
15087  || ('s' <= (c) && (c) <= 'z'))
15088 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15089 #endif
15090 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15091 int main () { int i; for (i = 0; i < 256; i++)
15092 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
15093 exit (0); }
15094
15095 EOF
15096 if { (eval echo configure:15097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15097 then
15098   :
15099 else
15100   echo "configure: failed program was:" >&5
15101   cat conftest.$ac_ext >&5
15102   rm -fr conftest*
15103   ac_cv_header_stdc=no
15104 fi
15105 rm -fr conftest*
15106 fi
15107
15108 fi
15109 fi
15110
15111 echo "$ac_t""$ac_cv_header_stdc" 1>&6
15112 if test $ac_cv_header_stdc = yes; then
15113   cat >> confdefs.h <<\EOF
15114 #define STDC_HEADERS 1
15115 EOF
15116
15117 fi
15118
15119 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
15120 echo "configure:15121: checking for mode_t" >&5
15121 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
15122   echo $ac_n "(cached) $ac_c" 1>&6
15123 else
15124   cat > conftest.$ac_ext <<EOF
15125 #line 15126 "configure"
15126 #include "confdefs.h"
15127 #include <sys/types.h>
15128 #if STDC_HEADERS
15129 #include <stdlib.h>
15130 #include <stddef.h>
15131 #endif
15132
15133 EOF
15134 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15135   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15136   rm -rf conftest*
15137   eval "ac_cv_type_mode_t=yes"
15138 else
15139   rm -rf conftest*
15140   eval "ac_cv_type_mode_t=no"
15141 fi
15142 rm -f conftest*
15143
15144 fi
15145 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
15146   echo "$ac_t""yes" 1>&6
15147 else
15148   echo "$ac_t""no" 1>&6
15149   cat >> confdefs.h <<EOF
15150 #define mode_t int
15151 EOF
15152
15153 fi
15154
15155 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15156 echo "configure:15157: checking for off_t" >&5
15157 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
15158   echo $ac_n "(cached) $ac_c" 1>&6
15159 else
15160   cat > conftest.$ac_ext <<EOF
15161 #line 15162 "configure"
15162 #include "confdefs.h"
15163 #include <sys/types.h>
15164 #if STDC_HEADERS
15165 #include <stdlib.h>
15166 #include <stddef.h>
15167 #endif
15168
15169 EOF
15170 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15171   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15172   rm -rf conftest*
15173   eval "ac_cv_type_off_t=yes"
15174 else
15175   rm -rf conftest*
15176   eval "ac_cv_type_off_t=no"
15177 fi
15178 rm -f conftest*
15179
15180 fi
15181 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15182   echo "$ac_t""yes" 1>&6
15183 else
15184   echo "$ac_t""no" 1>&6
15185   cat >> confdefs.h <<EOF
15186 #define off_t long
15187 EOF
15188
15189 fi
15190
15191 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15192 echo "configure:15193: checking for pid_t" >&5
15193 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15194   echo $ac_n "(cached) $ac_c" 1>&6
15195 else
15196   cat > conftest.$ac_ext <<EOF
15197 #line 15198 "configure"
15198 #include "confdefs.h"
15199 #include <sys/types.h>
15200 #if STDC_HEADERS
15201 #include <stdlib.h>
15202 #include <stddef.h>
15203 #endif
15204
15205 EOF
15206 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15207   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15208   rm -rf conftest*
15209   eval "ac_cv_type_pid_t=yes"
15210 else
15211   rm -rf conftest*
15212   eval "ac_cv_type_pid_t=no"
15213 fi
15214 rm -f conftest*
15215
15216 fi
15217 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15218   echo "$ac_t""yes" 1>&6
15219 else
15220   echo "$ac_t""no" 1>&6
15221   cat >> confdefs.h <<EOF
15222 #define pid_t int
15223 EOF
15224
15225 fi
15226
15227 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15228 echo "configure:15229: checking for ptrdiff_t" >&5
15229 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15230   echo $ac_n "(cached) $ac_c" 1>&6
15231 else
15232   cat > conftest.$ac_ext <<EOF
15233 #line 15234 "configure"
15234 #include "confdefs.h"
15235 #include <stddef.h>
15236 int main() {
15237 ptrdiff_t p
15238 ; return 0; }
15239 EOF
15240 if { (eval echo configure:15241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15241   rm -rf conftest*
15242   am_cv_type_ptrdiff_t=yes
15243 else
15244   echo "configure: failed program was:" >&5
15245   cat conftest.$ac_ext >&5
15246   rm -rf conftest*
15247   am_cv_type_ptrdiff_t=no
15248 fi
15249 rm -f conftest*
15250 fi
15251
15252 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15253    if test $am_cv_type_ptrdiff_t = yes; then
15254      cat >> confdefs.h <<\EOF
15255 #define HAVE_PTRDIFF_T 1
15256 EOF
15257
15258    fi
15259
15260 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15261 echo "configure:15262: checking return type of signal handlers" >&5
15262 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15263   echo $ac_n "(cached) $ac_c" 1>&6
15264 else
15265   cat > conftest.$ac_ext <<EOF
15266 #line 15267 "configure"
15267 #include "confdefs.h"
15268 #include <sys/types.h>
15269 #include <signal.h>
15270 #ifdef signal
15271 #undef signal
15272 #endif
15273 #ifdef __cplusplus
15274 extern "C" void (*signal (int, void (*)(int)))(int);
15275 #else
15276 void (*signal ()) ();
15277 #endif
15278
15279 int main() {
15280 int i;
15281 ; return 0; }
15282 EOF
15283 if { (eval echo configure:15284: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15284   rm -rf conftest*
15285   ac_cv_type_signal=void
15286 else
15287   echo "configure: failed program was:" >&5
15288   cat conftest.$ac_ext >&5
15289   rm -rf conftest*
15290   ac_cv_type_signal=int
15291 fi
15292 rm -f conftest*
15293 fi
15294
15295 echo "$ac_t""$ac_cv_type_signal" 1>&6
15296 cat >> confdefs.h <<EOF
15297 #define RETSIGTYPE $ac_cv_type_signal
15298 EOF
15299
15300
15301 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15302 echo "configure:15303: checking for size_t" >&5
15303 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15304   echo $ac_n "(cached) $ac_c" 1>&6
15305 else
15306   cat > conftest.$ac_ext <<EOF
15307 #line 15308 "configure"
15308 #include "confdefs.h"
15309 #include <sys/types.h>
15310 #if STDC_HEADERS
15311 #include <stdlib.h>
15312 #include <stddef.h>
15313 #endif
15314
15315 EOF
15316 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15317   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15318   rm -rf conftest*
15319   eval "ac_cv_type_size_t=yes"
15320 else
15321   rm -rf conftest*
15322   eval "ac_cv_type_size_t=no"
15323 fi
15324 rm -f conftest*
15325
15326 fi
15327 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15328   echo "$ac_t""yes" 1>&6
15329 else
15330   echo "$ac_t""no" 1>&6
15331   cat >> confdefs.h <<EOF
15332 #define size_t unsigned
15333 EOF
15334
15335 fi
15336
15337
15338 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15339 echo "configure:15340: checking for ssize_t" >&5
15340 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
15341   echo $ac_n "(cached) $ac_c" 1>&6
15342 else
15343   cat > conftest.$ac_ext <<EOF
15344 #line 15345 "configure"
15345 #include "confdefs.h"
15346 #include <sys/types.h>
15347 #if STDC_HEADERS
15348 #include <stdlib.h>
15349 #include <stddef.h>
15350 #endif
15351
15352 EOF
15353 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15354   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15355   rm -rf conftest*
15356   eval "ac_cv_type_ssize_t=yes"
15357 else
15358   rm -rf conftest*
15359   eval "ac_cv_type_ssize_t=no"
15360 fi
15361 rm -f conftest*
15362
15363 fi
15364 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
15365   echo "$ac_t""yes" 1>&6
15366 else
15367   echo "$ac_t""no" 1>&6
15368   cat >> confdefs.h <<EOF
15369 #define ssize_t signed int
15370 EOF
15371
15372 fi
15373
15374 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15375 echo "configure:15376: checking for caddr_t" >&5
15376 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
15377   echo $ac_n "(cached) $ac_c" 1>&6
15378 else
15379   cat > conftest.$ac_ext <<EOF
15380 #line 15381 "configure"
15381 #include "confdefs.h"
15382 #include <sys/types.h>
15383 #if STDC_HEADERS
15384 #include <stdlib.h>
15385 #include <stddef.h>
15386 #endif
15387
15388 EOF
15389 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15390   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15391   rm -rf conftest*
15392   eval "ac_cv_type_caddr_t=yes"
15393 else
15394   rm -rf conftest*
15395   eval "ac_cv_type_caddr_t=no"
15396 fi
15397 rm -f conftest*
15398
15399 fi
15400 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15401   echo "$ac_t""yes" 1>&6
15402 else
15403   echo "$ac_t""no" 1>&6
15404   cat >> confdefs.h <<EOF
15405 #define caddr_t char *
15406 EOF
15407
15408 fi
15409
15410
15411 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15412 echo "configure:15413: checking for socklen_t" >&5
15413 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15414   echo $ac_n "(cached) $ac_c" 1>&6
15415 else
15416   cat > conftest.$ac_ext <<EOF
15417 #line 15418 "configure"
15418 #include "confdefs.h"
15419
15420 #ifdef HAVE_SYS_TYPES_H
15421 #include <sys/types.h>
15422 #endif
15423 #ifdef HAVE_SYS_SOCKET_H
15424 #include <sys/socket.h>
15425 #endif
15426
15427 int main() {
15428 socklen_t len;
15429 ; return 0; }
15430 EOF
15431 if { (eval echo configure:15432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15432   rm -rf conftest*
15433   ol_cv_type_socklen_t=yes
15434 else
15435   echo "configure: failed program was:" >&5
15436   cat conftest.$ac_ext >&5
15437   rm -rf conftest*
15438   ol_cv_type_socklen_t=no
15439 fi
15440 rm -f conftest*
15441 fi
15442
15443 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15444   if test $ol_cv_type_socklen_t = no; then
15445     cat >> confdefs.h <<\EOF
15446 #define socklen_t int
15447 EOF
15448
15449   fi
15450  
15451 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15452 echo "configure:15453: checking for member st_blksize in aggregate type struct stat" >&5
15453 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15454   echo $ac_n "(cached) $ac_c" 1>&6
15455 else
15456   cat > conftest.$ac_ext <<EOF
15457 #line 15458 "configure"
15458 #include "confdefs.h"
15459 #include <sys/types.h>
15460 #include <sys/stat.h>
15461 int main() {
15462 struct stat foo; foo.st_blksize;
15463 ; return 0; }
15464 EOF
15465 if { (eval echo configure:15466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15466   rm -rf conftest*
15467   ac_cv_c_struct_member_st_blksize=yes
15468 else
15469   echo "configure: failed program was:" >&5
15470   cat conftest.$ac_ext >&5
15471   rm -rf conftest*
15472   ac_cv_c_struct_member_st_blksize=no
15473 fi
15474 rm -f conftest*
15475 fi
15476
15477 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15478 st_blksize="$ac_cv_c_struct_member_st_blksize"
15479 if test $ac_cv_c_struct_member_st_blksize = yes; then
15480   cat >> confdefs.h <<\EOF
15481 #define HAVE_ST_BLKSIZE 1
15482 EOF
15483
15484 fi
15485
15486 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15487 echo "configure:15488: checking whether time.h and sys/time.h may both be included" >&5
15488 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15489   echo $ac_n "(cached) $ac_c" 1>&6
15490 else
15491   cat > conftest.$ac_ext <<EOF
15492 #line 15493 "configure"
15493 #include "confdefs.h"
15494 #include <sys/types.h>
15495 #include <sys/time.h>
15496 #include <time.h>
15497 int main() {
15498 struct tm *tp;
15499 ; return 0; }
15500 EOF
15501 if { (eval echo configure:15502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15502   rm -rf conftest*
15503   ac_cv_header_time=yes
15504 else
15505   echo "configure: failed program was:" >&5
15506   cat conftest.$ac_ext >&5
15507   rm -rf conftest*
15508   ac_cv_header_time=no
15509 fi
15510 rm -f conftest*
15511 fi
15512
15513 echo "$ac_t""$ac_cv_header_time" 1>&6
15514 if test $ac_cv_header_time = yes; then
15515   cat >> confdefs.h <<\EOF
15516 #define TIME_WITH_SYS_TIME 1
15517 EOF
15518
15519 fi
15520
15521 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15522 echo "configure:15523: checking whether struct tm is in sys/time.h or time.h" >&5
15523 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
15524   echo $ac_n "(cached) $ac_c" 1>&6
15525 else
15526   cat > conftest.$ac_ext <<EOF
15527 #line 15528 "configure"
15528 #include "confdefs.h"
15529 #include <sys/types.h>
15530 #include <time.h>
15531 int main() {
15532 struct tm *tp; tp->tm_sec;
15533 ; return 0; }
15534 EOF
15535 if { (eval echo configure:15536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15536   rm -rf conftest*
15537   ac_cv_struct_tm=time.h
15538 else
15539   echo "configure: failed program was:" >&5
15540   cat conftest.$ac_ext >&5
15541   rm -rf conftest*
15542   ac_cv_struct_tm=sys/time.h
15543 fi
15544 rm -f conftest*
15545 fi
15546
15547 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15548 if test $ac_cv_struct_tm = sys/time.h; then
15549   cat >> confdefs.h <<\EOF
15550 #define TM_IN_SYS_TIME 1
15551 EOF
15552
15553 fi
15554
15555 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15556 echo "configure:15557: checking for uid_t in sys/types.h" >&5
15557 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15558   echo $ac_n "(cached) $ac_c" 1>&6
15559 else
15560   cat > conftest.$ac_ext <<EOF
15561 #line 15562 "configure"
15562 #include "confdefs.h"
15563 #include <sys/types.h>
15564 EOF
15565 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15566   egrep "uid_t" >/dev/null 2>&1; then
15567   rm -rf conftest*
15568   ac_cv_type_uid_t=yes
15569 else
15570   rm -rf conftest*
15571   ac_cv_type_uid_t=no
15572 fi
15573 rm -f conftest*
15574
15575 fi
15576
15577 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15578 if test $ac_cv_type_uid_t = no; then
15579   cat >> confdefs.h <<\EOF
15580 #define uid_t int
15581 EOF
15582
15583   cat >> confdefs.h <<\EOF
15584 #define gid_t int
15585 EOF
15586
15587 fi
15588
15589 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15590 echo "configure:15591: checking for sig_atomic_t" >&5
15591 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15592   echo $ac_n "(cached) $ac_c" 1>&6
15593 else
15594   cat > conftest.$ac_ext <<EOF
15595 #line 15596 "configure"
15596 #include "confdefs.h"
15597 #include <signal.h>
15598 int main() {
15599 sig_atomic_t atomic;
15600 ; return 0; }
15601 EOF
15602 if { (eval echo configure:15603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15603   rm -rf conftest*
15604   ol_cv_type_sig_atomic_t=yes
15605 else
15606   echo "configure: failed program was:" >&5
15607   cat conftest.$ac_ext >&5
15608   rm -rf conftest*
15609   ol_cv_type_sig_atomic_t=no
15610 fi
15611 rm -f conftest*
15612 fi
15613
15614 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15615   if test $ol_cv_type_sig_atomic_t = no; then
15616     cat >> confdefs.h <<\EOF
15617 #define sig_atomic_t int
15618 EOF
15619
15620   fi
15621  
15622
15623
15624 # test for pw_gecos in struct passwd
15625 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15626 echo "configure:15627: checking struct passwd for pw_gecos" >&5
15627 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15628   echo $ac_n "(cached) $ac_c" 1>&6
15629 else
15630   
15631         cat > conftest.$ac_ext <<EOF
15632 #line 15633 "configure"
15633 #include "confdefs.h"
15634 #include <pwd.h>
15635 int main() {
15636
15637         struct passwd pwd;
15638         pwd.pw_gecos = pwd.pw_name;
15639
15640 ; return 0; }
15641 EOF
15642 if { (eval echo configure:15643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15643   rm -rf conftest*
15644   ol_cv_struct_passwd_pw_gecos=yes
15645 else
15646   echo "configure: failed program was:" >&5
15647   cat conftest.$ac_ext >&5
15648   rm -rf conftest*
15649   ol_cv_struct_passwd_pw_gecos=no
15650 fi
15651 rm -f conftest*
15652 fi
15653
15654 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15655 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15656         cat >> confdefs.h <<\EOF
15657 #define HAVE_PW_GECOS 1
15658 EOF
15659
15660 fi
15661
15662 # test for pw_passwd in struct passwd
15663 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15664 echo "configure:15665: checking struct passwd for pw_passwd" >&5
15665 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15666   echo $ac_n "(cached) $ac_c" 1>&6
15667 else
15668   
15669         cat > conftest.$ac_ext <<EOF
15670 #line 15671 "configure"
15671 #include "confdefs.h"
15672 #include <pwd.h>
15673 int main() {
15674
15675         struct passwd pwd;
15676         pwd.pw_passwd = pwd.pw_name;
15677
15678 ; return 0; }
15679 EOF
15680 if { (eval echo configure:15681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15681   rm -rf conftest*
15682   ol_cv_struct_passwd_pw_passwd=yes
15683 else
15684   echo "configure: failed program was:" >&5
15685   cat conftest.$ac_ext >&5
15686   rm -rf conftest*
15687   ol_cv_struct_passwd_pw_passwd=no
15688 fi
15689 rm -f conftest*
15690 fi
15691
15692 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15693 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15694         cat >> confdefs.h <<\EOF
15695 #define HAVE_PW_PASSWD 1
15696 EOF
15697
15698 fi
15699
15700
15701 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15702 echo "configure:15703: checking if toupper() requires islower()" >&5
15703 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15704   echo $ac_n "(cached) $ac_c" 1>&6
15705 else
15706   
15707         if test "$cross_compiling" = yes; then
15708   ol_cv_c_upper_lower=safe
15709 else
15710   cat > conftest.$ac_ext <<EOF
15711 #line 15712 "configure"
15712 #include "confdefs.h"
15713
15714 #include <ctype.h>
15715 main()
15716 {
15717         if ('C' == toupper('C'))
15718                 exit(0);
15719         else
15720                 exit(1);
15721 }
15722 EOF
15723 if { (eval echo configure:15724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15724 then
15725   ol_cv_c_upper_lower=no
15726 else
15727   echo "configure: failed program was:" >&5
15728   cat conftest.$ac_ext >&5
15729   rm -fr conftest*
15730   ol_cv_c_upper_lower=yes
15731 fi
15732 rm -fr conftest*
15733 fi
15734
15735 fi
15736
15737 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15738 if test $ol_cv_c_upper_lower != no ; then
15739         cat >> confdefs.h <<\EOF
15740 #define C_UPPER_LOWER 1
15741 EOF
15742
15743 fi
15744
15745 echo $ac_n "checking for working const""... $ac_c" 1>&6
15746 echo "configure:15747: checking for working const" >&5
15747 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15748   echo $ac_n "(cached) $ac_c" 1>&6
15749 else
15750   cat > conftest.$ac_ext <<EOF
15751 #line 15752 "configure"
15752 #include "confdefs.h"
15753
15754 int main() {
15755
15756 /* Ultrix mips cc rejects this.  */
15757 typedef int charset[2]; const charset x;
15758 /* SunOS 4.1.1 cc rejects this.  */
15759 char const *const *ccp;
15760 char **p;
15761 /* NEC SVR4.0.2 mips cc rejects this.  */
15762 struct point {int x, y;};
15763 static struct point const zero = {0,0};
15764 /* AIX XL C 1.02.0.0 rejects this.
15765    It does not let you subtract one const X* pointer from another in an arm
15766    of an if-expression whose if-part is not a constant expression */
15767 const char *g = "string";
15768 ccp = &g + (g ? g-g : 0);
15769 /* HPUX 7.0 cc rejects these. */
15770 ++ccp;
15771 p = (char**) ccp;
15772 ccp = (char const *const *) p;
15773 { /* SCO 3.2v4 cc rejects this.  */
15774   char *t;
15775   char const *s = 0 ? (char *) 0 : (char const *) 0;
15776
15777   *t++ = 0;
15778 }
15779 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15780   int x[] = {25, 17};
15781   const int *foo = &x[0];
15782   ++foo;
15783 }
15784 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15785   typedef const int *iptr;
15786   iptr p = 0;
15787   ++p;
15788 }
15789 { /* AIX XL C 1.02.0.0 rejects this saying
15790      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15791   struct s { int j; const int *ap[3]; };
15792   struct s *b; b->j = 5;
15793 }
15794 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15795   const int foo = 10;
15796 }
15797
15798 ; return 0; }
15799 EOF
15800 if { (eval echo configure:15801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15801   rm -rf conftest*
15802   ac_cv_c_const=yes
15803 else
15804   echo "configure: failed program was:" >&5
15805   cat conftest.$ac_ext >&5
15806   rm -rf conftest*
15807   ac_cv_c_const=no
15808 fi
15809 rm -f conftest*
15810 fi
15811
15812 echo "$ac_t""$ac_cv_c_const" 1>&6
15813 if test $ac_cv_c_const = no; then
15814   cat >> confdefs.h <<\EOF
15815 #define const 
15816 EOF
15817
15818 fi
15819
15820 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15821 echo "configure:15822: checking if compiler understands volatile" >&5
15822 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15823   echo $ac_n "(cached) $ac_c" 1>&6
15824 else
15825   cat > conftest.$ac_ext <<EOF
15826 #line 15827 "configure"
15827 #include "confdefs.h"
15828 int x, y, z;
15829 int main() {
15830 volatile int a; int * volatile b = x ? &y : &z;
15831       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15832       *b = 0;
15833 ; return 0; }
15834 EOF
15835 if { (eval echo configure:15836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15836   rm -rf conftest*
15837   ol_cv_c_volatile=yes
15838 else
15839   echo "configure: failed program was:" >&5
15840   cat conftest.$ac_ext >&5
15841   rm -rf conftest*
15842   ol_cv_c_volatile=no
15843 fi
15844 rm -f conftest*
15845 fi
15846
15847 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15848   if test $ol_cv_c_volatile = yes; then
15849     : 
15850   else
15851     cat >> confdefs.h <<\EOF
15852 #define volatile 
15853 EOF
15854
15855   fi
15856  
15857
15858 if test $cross_compiling = yes ; then
15859         cat >> confdefs.h <<\EOF
15860 #define CROSS_COMPILING 1
15861 EOF
15862
15863 else
15864         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15865 echo "configure:15866: checking whether byte ordering is bigendian" >&5
15866 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15867   echo $ac_n "(cached) $ac_c" 1>&6
15868 else
15869   ac_cv_c_bigendian=unknown
15870 # See if sys/param.h defines the BYTE_ORDER macro.
15871 cat > conftest.$ac_ext <<EOF
15872 #line 15873 "configure"
15873 #include "confdefs.h"
15874 #include <sys/types.h>
15875 #include <sys/param.h>
15876 int main() {
15877
15878 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15879  bogus endian macros
15880 #endif
15881 ; return 0; }
15882 EOF
15883 if { (eval echo configure:15884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15884   rm -rf conftest*
15885   # It does; now see whether it defined to BIG_ENDIAN or not.
15886 cat > conftest.$ac_ext <<EOF
15887 #line 15888 "configure"
15888 #include "confdefs.h"
15889 #include <sys/types.h>
15890 #include <sys/param.h>
15891 int main() {
15892
15893 #if BYTE_ORDER != BIG_ENDIAN
15894  not big endian
15895 #endif
15896 ; return 0; }
15897 EOF
15898 if { (eval echo configure:15899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15899   rm -rf conftest*
15900   ac_cv_c_bigendian=yes
15901 else
15902   echo "configure: failed program was:" >&5
15903   cat conftest.$ac_ext >&5
15904   rm -rf conftest*
15905   ac_cv_c_bigendian=no
15906 fi
15907 rm -f conftest*
15908 else
15909   echo "configure: failed program was:" >&5
15910   cat conftest.$ac_ext >&5
15911 fi
15912 rm -f conftest*
15913 if test $ac_cv_c_bigendian = unknown; then
15914 if test "$cross_compiling" = yes; then
15915     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
15916 else
15917   cat > conftest.$ac_ext <<EOF
15918 #line 15919 "configure"
15919 #include "confdefs.h"
15920 main () {
15921   /* Are we little or big endian?  From Harbison&Steele.  */
15922   union
15923   {
15924     long l;
15925     char c[sizeof (long)];
15926   } u;
15927   u.l = 1;
15928   exit (u.c[sizeof (long) - 1] == 1);
15929 }
15930 EOF
15931 if { (eval echo configure:15932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15932 then
15933   ac_cv_c_bigendian=no
15934 else
15935   echo "configure: failed program was:" >&5
15936   cat conftest.$ac_ext >&5
15937   rm -fr conftest*
15938   ac_cv_c_bigendian=yes
15939 fi
15940 rm -fr conftest*
15941 fi
15942
15943 fi
15944 fi
15945
15946 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
15947 if test $ac_cv_c_bigendian = yes; then
15948   cat >> confdefs.h <<\EOF
15949 #define WORDS_BIGENDIAN 1
15950 EOF
15951
15952 fi
15953
15954 fi
15955
15956 echo $ac_n "checking size of short""... $ac_c" 1>&6
15957 echo "configure:15958: checking size of short" >&5 
15958 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
15959   echo $ac_n "(cached) $ac_c" 1>&6
15960 else
15961   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15962   cat > conftest.$ac_ext <<EOF
15963 #line 15964 "configure"
15964 #include "confdefs.h"
15965 #include "confdefs.h" 
15966 #include <sys/types.h> 
15967  
15968
15969 int main() {
15970 switch (0) case 0: case (sizeof (short) == $ac_size):;
15971 ; return 0; }
15972 EOF
15973 if { (eval echo configure:15974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15974   rm -rf conftest*
15975   ac_cv_sizeof_short=$ac_size
15976 else
15977   echo "configure: failed program was:" >&5
15978   cat conftest.$ac_ext >&5
15979 fi
15980 rm -f conftest* 
15981   if test x$ac_cv_sizeof_short != x ; then break; fi 
15982 done 
15983
15984 fi
15985  
15986 if test x$ac_cv_sizeof_short = x ; then 
15987   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
15988 fi 
15989 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
15990 cat >> confdefs.h <<EOF
15991 #define SIZEOF_SHORT $ac_cv_sizeof_short
15992 EOF
15993  
15994  
15995 echo $ac_n "checking size of int""... $ac_c" 1>&6
15996 echo "configure:15997: checking size of int" >&5 
15997 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
15998   echo $ac_n "(cached) $ac_c" 1>&6
15999 else
16000   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16001   cat > conftest.$ac_ext <<EOF
16002 #line 16003 "configure"
16003 #include "confdefs.h"
16004 #include "confdefs.h" 
16005 #include <sys/types.h> 
16006  
16007
16008 int main() {
16009 switch (0) case 0: case (sizeof (int) == $ac_size):;
16010 ; return 0; }
16011 EOF
16012 if { (eval echo configure:16013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16013   rm -rf conftest*
16014   ac_cv_sizeof_int=$ac_size
16015 else
16016   echo "configure: failed program was:" >&5
16017   cat conftest.$ac_ext >&5
16018 fi
16019 rm -f conftest* 
16020   if test x$ac_cv_sizeof_int != x ; then break; fi 
16021 done 
16022
16023 fi
16024  
16025 if test x$ac_cv_sizeof_int = x ; then 
16026   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
16027 fi 
16028 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
16029 cat >> confdefs.h <<EOF
16030 #define SIZEOF_INT $ac_cv_sizeof_int
16031 EOF
16032  
16033  
16034 echo $ac_n "checking size of long""... $ac_c" 1>&6
16035 echo "configure:16036: checking size of long" >&5 
16036 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
16037   echo $ac_n "(cached) $ac_c" 1>&6
16038 else
16039   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
16040   cat > conftest.$ac_ext <<EOF
16041 #line 16042 "configure"
16042 #include "confdefs.h"
16043 #include "confdefs.h" 
16044 #include <sys/types.h> 
16045  
16046
16047 int main() {
16048 switch (0) case 0: case (sizeof (long) == $ac_size):;
16049 ; return 0; }
16050 EOF
16051 if { (eval echo configure:16052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16052   rm -rf conftest*
16053   ac_cv_sizeof_long=$ac_size
16054 else
16055   echo "configure: failed program was:" >&5
16056   cat conftest.$ac_ext >&5
16057 fi
16058 rm -f conftest* 
16059   if test x$ac_cv_sizeof_long != x ; then break; fi 
16060 done 
16061
16062 fi
16063  
16064 if test x$ac_cv_sizeof_long = x ; then 
16065   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
16066 fi 
16067 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
16068 cat >> confdefs.h <<EOF
16069 #define SIZEOF_LONG $ac_cv_sizeof_long
16070 EOF
16071  
16072
16073
16074 if test "$ac_cv_sizeof_int" -lt 4 ; then
16075         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
16076
16077         cat >> confdefs.h <<\EOF
16078 #define LBER_INT_T long
16079 EOF
16080
16081 else
16082         cat >> confdefs.h <<\EOF
16083 #define LBER_INT_T int
16084 EOF
16085
16086 fi
16087
16088 cat >> confdefs.h <<\EOF
16089 #define LBER_LEN_T long
16090 EOF
16091
16092 cat >> confdefs.h <<\EOF
16093 #define LBER_SOCKET_T int
16094 EOF
16095
16096 cat >> confdefs.h <<\EOF
16097 #define LBER_TAG_T long
16098 EOF
16099
16100
16101 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
16102 echo "configure:16103: checking for 8-bit clean memcmp" >&5
16103 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
16104   echo $ac_n "(cached) $ac_c" 1>&6
16105 else
16106   if test "$cross_compiling" = yes; then
16107   ac_cv_func_memcmp_clean=no
16108 else
16109   cat > conftest.$ac_ext <<EOF
16110 #line 16111 "configure"
16111 #include "confdefs.h"
16112
16113 main()
16114 {
16115   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
16116   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
16117 }
16118
16119 EOF
16120 if { (eval echo configure:16121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
16121 then
16122   ac_cv_func_memcmp_clean=yes
16123 else
16124   echo "configure: failed program was:" >&5
16125   cat conftest.$ac_ext >&5
16126   rm -fr conftest*
16127   ac_cv_func_memcmp_clean=no
16128 fi
16129 rm -fr conftest*
16130 fi
16131
16132 fi
16133
16134 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
16135 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
16136
16137 echo $ac_n "checking for strftime""... $ac_c" 1>&6
16138 echo "configure:16139: checking for strftime" >&5
16139 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
16140   echo $ac_n "(cached) $ac_c" 1>&6
16141 else
16142   cat > conftest.$ac_ext <<EOF
16143 #line 16144 "configure"
16144 #include "confdefs.h"
16145 /* System header to define __stub macros and hopefully few prototypes,
16146     which can conflict with char strftime(); below.  */
16147 #include <assert.h>
16148 /* Override any gcc2 internal prototype to avoid an error.  */
16149 /* We use char because int might match the return type of a gcc2
16150     builtin and then its argument prototype would still apply.  */
16151 char strftime();
16152 char (*f)();
16153
16154 int main() {
16155
16156 /* The GNU C library defines this for functions which it implements
16157     to always fail with ENOSYS.  Some functions are actually named
16158     something starting with __ and the normal name is an alias.  */
16159 #if defined (__stub_strftime) || defined (__stub___strftime)
16160 choke me
16161 #else
16162 f = strftime;
16163 #endif
16164
16165 ; return 0; }
16166 EOF
16167 if { (eval echo configure:16168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16168   rm -rf conftest*
16169   eval "ac_cv_func_strftime=yes"
16170 else
16171   echo "configure: failed program was:" >&5
16172   cat conftest.$ac_ext >&5
16173   rm -rf conftest*
16174   eval "ac_cv_func_strftime=no"
16175 fi
16176 rm -f conftest*
16177 fi
16178
16179 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16180   echo "$ac_t""yes" 1>&6
16181   cat >> confdefs.h <<\EOF
16182 #define HAVE_STRFTIME 1
16183 EOF
16184
16185 else
16186   echo "$ac_t""no" 1>&6
16187 # strftime is in -lintl on SCO UNIX.
16188 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16189 echo "configure:16190: checking for strftime in -lintl" >&5
16190 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16191 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16192   echo $ac_n "(cached) $ac_c" 1>&6
16193 else
16194   ac_save_LIBS="$LIBS"
16195 LIBS="-lintl  $LIBS"
16196 cat > conftest.$ac_ext <<EOF
16197 #line 16198 "configure"
16198 #include "confdefs.h"
16199 /* Override any gcc2 internal prototype to avoid an error.  */
16200 /* We use char because int might match the return type of a gcc2
16201     builtin and then its argument prototype would still apply.  */
16202 char strftime();
16203
16204 int main() {
16205 strftime()
16206 ; return 0; }
16207 EOF
16208 if { (eval echo configure:16209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16209   rm -rf conftest*
16210   eval "ac_cv_lib_$ac_lib_var=yes"
16211 else
16212   echo "configure: failed program was:" >&5
16213   cat conftest.$ac_ext >&5
16214   rm -rf conftest*
16215   eval "ac_cv_lib_$ac_lib_var=no"
16216 fi
16217 rm -f conftest*
16218 LIBS="$ac_save_LIBS"
16219
16220 fi
16221 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16222   echo "$ac_t""yes" 1>&6
16223   cat >> confdefs.h <<\EOF
16224 #define HAVE_STRFTIME 1
16225 EOF
16226
16227 LIBS="-lintl $LIBS"
16228 else
16229   echo "$ac_t""no" 1>&6
16230 fi
16231
16232 fi
16233
16234
16235 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16236 echo "configure:16237: checking for inet_aton()" >&5
16237 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16238   echo $ac_n "(cached) $ac_c" 1>&6
16239 else
16240   cat > conftest.$ac_ext <<EOF
16241 #line 16242 "configure"
16242 #include "confdefs.h"
16243
16244 #ifdef HAVE_SYS_TYPES_H
16245 #       include <sys/types.h>
16246 #endif
16247 #ifdef HAVE_SYS_SOCKET_H
16248 #       include <sys/socket.h>
16249 #       ifdef HAVE_SYS_SELECT_H
16250 #               include <sys/select.h>
16251 #       endif
16252 #       include <netinet/in.h>
16253 #       ifdef HAVE_ARPA_INET_H
16254 #               include <arpa/inet.h>
16255 #       endif
16256 #endif
16257
16258 int main() {
16259 struct in_addr in;
16260 int rc = inet_aton( "255.255.255.255", &in );
16261 ; return 0; }
16262 EOF
16263 if { (eval echo configure:16264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16264   rm -rf conftest*
16265   ol_cv_func_inet_aton=yes
16266 else
16267   echo "configure: failed program was:" >&5
16268   cat conftest.$ac_ext >&5
16269   rm -rf conftest*
16270   ol_cv_func_inet_aton=no
16271 fi
16272 rm -f conftest*
16273 fi
16274
16275 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16276   if test $ol_cv_func_inet_aton != no; then
16277     cat >> confdefs.h <<\EOF
16278 #define HAVE_INET_ATON 1
16279 EOF
16280
16281   fi
16282  
16283
16284 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16285 echo "configure:16286: checking for _spawnlp" >&5
16286 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
16287   echo $ac_n "(cached) $ac_c" 1>&6
16288 else
16289   cat > conftest.$ac_ext <<EOF
16290 #line 16291 "configure"
16291 #include "confdefs.h"
16292 /* System header to define __stub macros and hopefully few prototypes,
16293     which can conflict with char _spawnlp(); below.  */
16294 #include <assert.h>
16295 /* Override any gcc2 internal prototype to avoid an error.  */
16296 /* We use char because int might match the return type of a gcc2
16297     builtin and then its argument prototype would still apply.  */
16298 char _spawnlp();
16299 char (*f)();
16300
16301 int main() {
16302
16303 /* The GNU C library defines this for functions which it implements
16304     to always fail with ENOSYS.  Some functions are actually named
16305     something starting with __ and the normal name is an alias.  */
16306 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
16307 choke me
16308 #else
16309 f = _spawnlp;
16310 #endif
16311
16312 ; return 0; }
16313 EOF
16314 if { (eval echo configure:16315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16315   rm -rf conftest*
16316   eval "ac_cv_func__spawnlp=yes"
16317 else
16318   echo "configure: failed program was:" >&5
16319   cat conftest.$ac_ext >&5
16320   rm -rf conftest*
16321   eval "ac_cv_func__spawnlp=no"
16322 fi
16323 rm -f conftest*
16324 fi
16325
16326 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16327   echo "$ac_t""yes" 1>&6
16328   cat >> confdefs.h <<\EOF
16329 #define HAVE_SPAWNLP 1
16330 EOF
16331
16332 else
16333   echo "$ac_t""no" 1>&6
16334 fi
16335
16336
16337 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16338 echo "configure:16339: checking for _snprintf" >&5
16339 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16340   echo $ac_n "(cached) $ac_c" 1>&6
16341 else
16342   cat > conftest.$ac_ext <<EOF
16343 #line 16344 "configure"
16344 #include "confdefs.h"
16345 /* System header to define __stub macros and hopefully few prototypes,
16346     which can conflict with char _snprintf(); below.  */
16347 #include <assert.h>
16348 /* Override any gcc2 internal prototype to avoid an error.  */
16349 /* We use char because int might match the return type of a gcc2
16350     builtin and then its argument prototype would still apply.  */
16351 char _snprintf();
16352 char (*f)();
16353
16354 int main() {
16355
16356 /* The GNU C library defines this for functions which it implements
16357     to always fail with ENOSYS.  Some functions are actually named
16358     something starting with __ and the normal name is an alias.  */
16359 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16360 choke me
16361 #else
16362 f = _snprintf;
16363 #endif
16364
16365 ; return 0; }
16366 EOF
16367 if { (eval echo configure:16368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16368   rm -rf conftest*
16369   eval "ac_cv_func__snprintf=yes"
16370 else
16371   echo "configure: failed program was:" >&5
16372   cat conftest.$ac_ext >&5
16373   rm -rf conftest*
16374   eval "ac_cv_func__snprintf=no"
16375 fi
16376 rm -f conftest*
16377 fi
16378
16379 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16380   echo "$ac_t""yes" 1>&6
16381   ac_cv_func_snprintf=yes
16382         cat >> confdefs.h <<\EOF
16383 #define snprintf _snprintf
16384 EOF
16385
16386
16387 else
16388   echo "$ac_t""no" 1>&6
16389 fi
16390
16391
16392 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16393 echo "configure:16394: checking for _vsnprintf" >&5
16394 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16395   echo $ac_n "(cached) $ac_c" 1>&6
16396 else
16397   cat > conftest.$ac_ext <<EOF
16398 #line 16399 "configure"
16399 #include "confdefs.h"
16400 /* System header to define __stub macros and hopefully few prototypes,
16401     which can conflict with char _vsnprintf(); below.  */
16402 #include <assert.h>
16403 /* Override any gcc2 internal prototype to avoid an error.  */
16404 /* We use char because int might match the return type of a gcc2
16405     builtin and then its argument prototype would still apply.  */
16406 char _vsnprintf();
16407 char (*f)();
16408
16409 int main() {
16410
16411 /* The GNU C library defines this for functions which it implements
16412     to always fail with ENOSYS.  Some functions are actually named
16413     something starting with __ and the normal name is an alias.  */
16414 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16415 choke me
16416 #else
16417 f = _vsnprintf;
16418 #endif
16419
16420 ; return 0; }
16421 EOF
16422 if { (eval echo configure:16423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16423   rm -rf conftest*
16424   eval "ac_cv_func__vsnprintf=yes"
16425 else
16426   echo "configure: failed program was:" >&5
16427   cat conftest.$ac_ext >&5
16428   rm -rf conftest*
16429   eval "ac_cv_func__vsnprintf=no"
16430 fi
16431 rm -f conftest*
16432 fi
16433
16434 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16435   echo "$ac_t""yes" 1>&6
16436   ac_cv_func_vsnprintf=yes
16437         cat >> confdefs.h <<\EOF
16438 #define vsnprintf _vsnprintf
16439 EOF
16440
16441
16442 else
16443   echo "$ac_t""no" 1>&6
16444 fi
16445
16446
16447 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16448 echo "configure:16449: checking for vprintf" >&5
16449 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16450   echo $ac_n "(cached) $ac_c" 1>&6
16451 else
16452   cat > conftest.$ac_ext <<EOF
16453 #line 16454 "configure"
16454 #include "confdefs.h"
16455 /* System header to define __stub macros and hopefully few prototypes,
16456     which can conflict with char vprintf(); below.  */
16457 #include <assert.h>
16458 /* Override any gcc2 internal prototype to avoid an error.  */
16459 /* We use char because int might match the return type of a gcc2
16460     builtin and then its argument prototype would still apply.  */
16461 char vprintf();
16462 char (*f)();
16463
16464 int main() {
16465
16466 /* The GNU C library defines this for functions which it implements
16467     to always fail with ENOSYS.  Some functions are actually named
16468     something starting with __ and the normal name is an alias.  */
16469 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16470 choke me
16471 #else
16472 f = vprintf;
16473 #endif
16474
16475 ; return 0; }
16476 EOF
16477 if { (eval echo configure:16478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16478   rm -rf conftest*
16479   eval "ac_cv_func_vprintf=yes"
16480 else
16481   echo "configure: failed program was:" >&5
16482   cat conftest.$ac_ext >&5
16483   rm -rf conftest*
16484   eval "ac_cv_func_vprintf=no"
16485 fi
16486 rm -f conftest*
16487 fi
16488
16489 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16490   echo "$ac_t""yes" 1>&6
16491   cat >> confdefs.h <<\EOF
16492 #define HAVE_VPRINTF 1
16493 EOF
16494
16495 else
16496   echo "$ac_t""no" 1>&6
16497 fi
16498
16499 if test "$ac_cv_func_vprintf" != yes; then
16500 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16501 echo "configure:16502: checking for _doprnt" >&5
16502 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16503   echo $ac_n "(cached) $ac_c" 1>&6
16504 else
16505   cat > conftest.$ac_ext <<EOF
16506 #line 16507 "configure"
16507 #include "confdefs.h"
16508 /* System header to define __stub macros and hopefully few prototypes,
16509     which can conflict with char _doprnt(); below.  */
16510 #include <assert.h>
16511 /* Override any gcc2 internal prototype to avoid an error.  */
16512 /* We use char because int might match the return type of a gcc2
16513     builtin and then its argument prototype would still apply.  */
16514 char _doprnt();
16515 char (*f)();
16516
16517 int main() {
16518
16519 /* The GNU C library defines this for functions which it implements
16520     to always fail with ENOSYS.  Some functions are actually named
16521     something starting with __ and the normal name is an alias.  */
16522 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16523 choke me
16524 #else
16525 f = _doprnt;
16526 #endif
16527
16528 ; return 0; }
16529 EOF
16530 if { (eval echo configure:16531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16531   rm -rf conftest*
16532   eval "ac_cv_func__doprnt=yes"
16533 else
16534   echo "configure: failed program was:" >&5
16535   cat conftest.$ac_ext >&5
16536   rm -rf conftest*
16537   eval "ac_cv_func__doprnt=no"
16538 fi
16539 rm -f conftest*
16540 fi
16541
16542 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16543   echo "$ac_t""yes" 1>&6
16544   cat >> confdefs.h <<\EOF
16545 #define HAVE_DOPRNT 1
16546 EOF
16547
16548 else
16549   echo "$ac_t""no" 1>&6
16550 fi
16551
16552 fi
16553
16554
16555 if test $ac_cv_func_vprintf = yes ; then
16556                 for ac_func in vsnprintf vsprintf
16557 do
16558 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16559 echo "configure:16560: checking for $ac_func" >&5
16560 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16561   echo $ac_n "(cached) $ac_c" 1>&6
16562 else
16563   cat > conftest.$ac_ext <<EOF
16564 #line 16565 "configure"
16565 #include "confdefs.h"
16566 /* System header to define __stub macros and hopefully few prototypes,
16567     which can conflict with char $ac_func(); below.  */
16568 #include <assert.h>
16569 /* Override any gcc2 internal prototype to avoid an error.  */
16570 /* We use char because int might match the return type of a gcc2
16571     builtin and then its argument prototype would still apply.  */
16572 char $ac_func();
16573 char (*f)();
16574
16575 int main() {
16576
16577 /* The GNU C library defines this for functions which it implements
16578     to always fail with ENOSYS.  Some functions are actually named
16579     something starting with __ and the normal name is an alias.  */
16580 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16581 choke me
16582 #else
16583 f = $ac_func;
16584 #endif
16585
16586 ; return 0; }
16587 EOF
16588 if { (eval echo configure:16589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16589   rm -rf conftest*
16590   eval "ac_cv_func_$ac_func=yes"
16591 else
16592   echo "configure: failed program was:" >&5
16593   cat conftest.$ac_ext >&5
16594   rm -rf conftest*
16595   eval "ac_cv_func_$ac_func=no"
16596 fi
16597 rm -f conftest*
16598 fi
16599
16600 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16601   echo "$ac_t""yes" 1>&6
16602     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16603   cat >> confdefs.h <<EOF
16604 #define $ac_tr_func 1
16605 EOF
16606  
16607 else
16608   echo "$ac_t""no" 1>&6
16609 fi
16610 done
16611
16612 fi
16613
16614 for ac_func in \
16615         bcopy                   \
16616         closesocket             \
16617         chroot                  \
16618         endgrent                \
16619         endpwent                \
16620         fcntl                   \
16621         flock                   \
16622         getdtablesize   \
16623         getgrgid                \
16624         gethostname             \
16625         getpass                 \
16626         getpassphrase   \
16627         getpwuid                \
16628         getpwnam                \
16629         getspnam                \
16630         gettimeofday    \
16631         initgroups              \
16632         lockf                   \
16633         memcpy                  \
16634         memmove                 \
16635         mkstemp                 \
16636         pipe                    \
16637         read                    \
16638         recv                    \
16639         recvfrom                \
16640         setpwfile               \
16641         setgid                  \
16642         setegid                 \
16643         setsid                  \
16644         setuid                  \
16645         seteuid                 \
16646         sigaction               \
16647         signal                  \
16648         sigset                  \
16649         strdup                  \
16650         strerror                \
16651         strpbrk                 \
16652         strrchr                 \
16653         strsep                  \
16654         strstr                  \
16655         strtol                  \
16656         strtoul                 \
16657         strspn                  \
16658         sysconf                 \
16659         usleep                  \
16660         waitpid                 \
16661         wait4                   \
16662         write                   \
16663         send                    \
16664         sendto                  \
16665
16666 do
16667 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16668 echo "configure:16669: checking for $ac_func" >&5
16669 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16670   echo $ac_n "(cached) $ac_c" 1>&6
16671 else
16672   cat > conftest.$ac_ext <<EOF
16673 #line 16674 "configure"
16674 #include "confdefs.h"
16675 /* System header to define __stub macros and hopefully few prototypes,
16676     which can conflict with char $ac_func(); below.  */
16677 #include <assert.h>
16678 /* Override any gcc2 internal prototype to avoid an error.  */
16679 /* We use char because int might match the return type of a gcc2
16680     builtin and then its argument prototype would still apply.  */
16681 char $ac_func();
16682 char (*f)();
16683
16684 int main() {
16685
16686 /* The GNU C library defines this for functions which it implements
16687     to always fail with ENOSYS.  Some functions are actually named
16688     something starting with __ and the normal name is an alias.  */
16689 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16690 choke me
16691 #else
16692 f = $ac_func;
16693 #endif
16694
16695 ; return 0; }
16696 EOF
16697 if { (eval echo configure:16698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16698   rm -rf conftest*
16699   eval "ac_cv_func_$ac_func=yes"
16700 else
16701   echo "configure: failed program was:" >&5
16702   cat conftest.$ac_ext >&5
16703   rm -rf conftest*
16704   eval "ac_cv_func_$ac_func=no"
16705 fi
16706 rm -f conftest*
16707 fi
16708
16709 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16710   echo "$ac_t""yes" 1>&6
16711     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16712   cat >> confdefs.h <<EOF
16713 #define $ac_tr_func 1
16714 EOF
16715  
16716 else
16717   echo "$ac_t""no" 1>&6
16718 fi
16719 done
16720
16721
16722 for ac_func in getopt tempnam
16723 do
16724 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16725 echo "configure:16726: checking for $ac_func" >&5
16726 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16727   echo $ac_n "(cached) $ac_c" 1>&6
16728 else
16729   cat > conftest.$ac_ext <<EOF
16730 #line 16731 "configure"
16731 #include "confdefs.h"
16732 /* System header to define __stub macros and hopefully few prototypes,
16733     which can conflict with char $ac_func(); below.  */
16734 #include <assert.h>
16735 /* Override any gcc2 internal prototype to avoid an error.  */
16736 /* We use char because int might match the return type of a gcc2
16737     builtin and then its argument prototype would still apply.  */
16738 char $ac_func();
16739 char (*f)();
16740
16741 int main() {
16742
16743 /* The GNU C library defines this for functions which it implements
16744     to always fail with ENOSYS.  Some functions are actually named
16745     something starting with __ and the normal name is an alias.  */
16746 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16747 choke me
16748 #else
16749 f = $ac_func;
16750 #endif
16751
16752 ; return 0; }
16753 EOF
16754 if { (eval echo configure:16755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16755   rm -rf conftest*
16756   eval "ac_cv_func_$ac_func=yes"
16757 else
16758   echo "configure: failed program was:" >&5
16759   cat conftest.$ac_ext >&5
16760   rm -rf conftest*
16761   eval "ac_cv_func_$ac_func=no"
16762 fi
16763 rm -f conftest*
16764 fi
16765
16766 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16767   echo "$ac_t""yes" 1>&6
16768     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16769   cat >> confdefs.h <<EOF
16770 #define $ac_tr_func 1
16771 EOF
16772  
16773 else
16774   echo "$ac_t""no" 1>&6
16775 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
16776 fi
16777 done
16778
16779
16780
16781 if test "$ac_cv_func_getopt" != yes; then
16782     LIBSRCS="$LIBSRCS getopt.c"
16783 fi
16784
16785 if test "$ac_cv_func_tempnam" != yes; then
16786     LIBSRCS="$LIBSRCS tempnam.c"
16787 fi
16788
16789 # Check Configuration
16790 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
16791 echo "configure:16792: checking declaration of sys_errlist" >&5
16792 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
16793   echo $ac_n "(cached) $ac_c" 1>&6
16794 else
16795   
16796         cat > conftest.$ac_ext <<EOF
16797 #line 16798 "configure"
16798 #include "confdefs.h"
16799
16800 #include <stdio.h>
16801 #include <sys/types.h>
16802 #include <errno.h>
16803 #ifdef WINNT
16804 #include <stdlib.h>
16805 #endif 
16806 int main() {
16807 char *c = (char *) *sys_errlist
16808 ; return 0; }
16809 EOF
16810 if { (eval echo configure:16811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16811   rm -rf conftest*
16812   ol_cv_dcl_sys_errlist=yes
16813         ol_cv_have_sys_errlist=yes
16814 else
16815   echo "configure: failed program was:" >&5
16816   cat conftest.$ac_ext >&5
16817   rm -rf conftest*
16818   ol_cv_dcl_sys_errlist=no
16819 fi
16820 rm -f conftest*
16821 fi
16822
16823 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16824 #
16825 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16826 if test $ol_cv_dcl_sys_errlist = no ; then
16827         cat >> confdefs.h <<\EOF
16828 #define DECL_SYS_ERRLIST 1
16829 EOF
16830
16831
16832         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16833 echo "configure:16834: checking existence of sys_errlist" >&5
16834 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16835   echo $ac_n "(cached) $ac_c" 1>&6
16836 else
16837   
16838                 cat > conftest.$ac_ext <<EOF
16839 #line 16840 "configure"
16840 #include "confdefs.h"
16841 #include <errno.h>
16842 int main() {
16843 char *c = (char *) *sys_errlist
16844 ; return 0; }
16845 EOF
16846 if { (eval echo configure:16847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16847   rm -rf conftest*
16848   ol_cv_have_sys_errlist=yes
16849 else
16850   echo "configure: failed program was:" >&5
16851   cat conftest.$ac_ext >&5
16852   rm -rf conftest*
16853   ol_cv_have_sys_errlist=no
16854 fi
16855 rm -f conftest*
16856 fi
16857
16858 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16859 fi
16860 if test $ol_cv_have_sys_errlist = yes ; then
16861         cat >> confdefs.h <<\EOF
16862 #define HAVE_SYS_ERRLIST 1
16863 EOF
16864
16865 fi
16866
16867
16868
16869 if test "$ol_enable_debug" != no ; then
16870         cat >> confdefs.h <<\EOF
16871 #define LDAP_DEBUG 1
16872 EOF
16873
16874 fi
16875 if test "$ol_enable_syslog" = yes ; then
16876         cat >> confdefs.h <<\EOF
16877 #define LDAP_SYSLOG 1
16878 EOF
16879
16880 fi
16881 if test "$ol_enable_cache" = no ; then
16882         cat >> confdefs.h <<\EOF
16883 #define LDAP_NOCACHE 1
16884 EOF
16885
16886 fi
16887 if test "$ol_link_kbind" != no ; then
16888         cat >> confdefs.h <<\EOF
16889 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16890 EOF
16891
16892 fi
16893 if test "$ol_enable_proctitle" != no ; then
16894         cat >> confdefs.h <<\EOF
16895 #define LDAP_PROCTITLE 1
16896 EOF
16897
16898 fi
16899 if test "$ol_enable_referrals" != no ; then
16900         cat >> confdefs.h <<\EOF
16901 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16902 EOF
16903
16904 fi
16905 if test "$ol_enable_local" != no; then
16906         cat >> confdefs.h <<\EOF
16907 #define LDAP_PF_LOCAL 1
16908 EOF
16909
16910 fi
16911 if test "$ol_link_ipv6" != no; then
16912         cat >> confdefs.h <<\EOF
16913 #define LDAP_PF_INET6 1
16914 EOF
16915
16916 fi
16917 if test "$ol_enable_cleartext" != no ; then
16918         cat >> confdefs.h <<\EOF
16919 #define SLAPD_CLEARTEXT 1
16920 EOF
16921
16922 fi
16923 if test "$ol_enable_crypt" != no ; then
16924         cat >> confdefs.h <<\EOF
16925 #define SLAPD_CRYPT 1
16926 EOF
16927
16928 fi
16929 if test "$ol_link_kpasswd" != no ; then
16930         cat >> confdefs.h <<\EOF
16931 #define SLAPD_KPASSWD 1
16932 EOF
16933
16934 fi
16935 if test "$ol_link_spasswd" != no ; then
16936         cat >> confdefs.h <<\EOF
16937 #define SLAPD_SPASSWD 1
16938 EOF
16939
16940 fi
16941 if test "$ol_enable_phonetic" != no ; then
16942         cat >> confdefs.h <<\EOF
16943 #define SLAPD_PHONETIC 1
16944 EOF
16945
16946 fi
16947 if test "$ol_enable_rlookups" != no ; then
16948         cat >> confdefs.h <<\EOF
16949 #define SLAPD_RLOOKUPS 1
16950 EOF
16951
16952 fi
16953 if test "$ol_enable_aci" != no ; then
16954         cat >> confdefs.h <<\EOF
16955 #define SLAPD_ACI_ENABLED 1
16956 EOF
16957
16958 fi
16959
16960 if test "$ol_link_modules" != no ; then
16961         cat >> confdefs.h <<\EOF
16962 #define SLAPD_MODULES 1
16963 EOF
16964
16965         BUILD_SLAPD=yes
16966         SLAPD_MODULES_LDFLAGS="-dlopen self"
16967 fi
16968
16969 if test "$ol_link_dnssrv" != no ; then
16970         cat >> confdefs.h <<\EOF
16971 #define SLAPD_DNSSRV 1
16972 EOF
16973
16974         BUILD_SLAPD=yes
16975         BUILD_DNSSRV=yes
16976         if test "$ol_with_dnssrv_module" != static ; then
16977                 cat >> confdefs.h <<\EOF
16978 #define SLAPD_DNSSRV_DYNAMIC 1
16979 EOF
16980
16981                 BUILD_DNSSRV=mod
16982                 BUILD_DNSSRV_DYNAMIC=shared
16983                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
16984         fi
16985 fi
16986
16987 if test "$ol_enable_ldap" != no ; then
16988         cat >> confdefs.h <<\EOF
16989 #define SLAPD_LDAP 1
16990 EOF
16991
16992         BUILD_SLAPD=yes
16993         BUILD_LDAP=yes
16994         if test "$ol_with_ldap_module" != static ; then
16995                 cat >> confdefs.h <<\EOF
16996 #define SLAPD_LDAP_DYNAMIC 1
16997 EOF
16998
16999                 BUILD_LDAP=mod
17000                 BUILD_LDAP_DYNAMIC=shared
17001                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
17002         fi
17003 fi
17004
17005 if test "$ol_link_ldbm" != no ; then
17006         cat >> confdefs.h <<\EOF
17007 #define SLAPD_LDBM 1
17008 EOF
17009
17010         BUILD_SLAPD=yes
17011         BUILD_LDBM=yes
17012         if test "$ol_with_ldbm_module" != static ; then
17013                 cat >> confdefs.h <<\EOF
17014 #define SLAPD_LDBM_DYNAMIC 1
17015 EOF
17016
17017                 BUILD_LDBM=mod
17018                 BUILD_LDBM_DYNAMIC=shared
17019                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
17020         fi
17021 fi
17022
17023 if test "$ol_enable_passwd" != no ; then
17024         cat >> confdefs.h <<\EOF
17025 #define SLAPD_PASSWD 1
17026 EOF
17027
17028         BUILD_SLAPD=yes
17029         BUILD_PASSWD=yes
17030         if test "$ol_with_passwd_module" != static ; then
17031                 cat >> confdefs.h <<\EOF
17032 #define SLAPD_PASSWD_DYNAMIC 1
17033 EOF
17034
17035                 BUILD_PASSWD=mod
17036                 BUILD_PASSWD_DYNAMIC=shared
17037                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
17038         fi
17039 fi
17040
17041 if test "$ol_enable_shell" != no ; then
17042         cat >> confdefs.h <<\EOF
17043 #define SLAPD_SHELL 1
17044 EOF
17045
17046         BUILD_SLAPD=yes
17047         BUILD_SHELL=yes
17048         if test "$ol_with_shell_module" != static ; then
17049                 cat >> confdefs.h <<\EOF
17050 #define SLAPD_SHELL_DYNAMIC 1
17051 EOF
17052
17053                 BUILD_SHELL=mod
17054                 BUILD_SHELL_DYNAMIC=shared
17055                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
17056         fi
17057 fi
17058
17059 if test "$ol_enable_sql" != no ; then
17060         cat >> confdefs.h <<\EOF
17061 #define SLAPD_SQL 1
17062 EOF
17063
17064         BUILD_SLAPD=yes
17065         BUILD_SQL=yes
17066         if test "$ol_with_sql_module" != static; then
17067                 cat >> confdefs.h <<\EOF
17068 #define SLAPD_SQL_DYNAMIC 1
17069 EOF
17070
17071                 BUILD_SQL=mod
17072                 BUILD_SQL_DYNAMIC=shared
17073                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
17074         fi
17075 fi
17076
17077 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
17078         $BUILD_SLAPD = yes ; then
17079         BUILD_SLURPD=yes
17080 fi
17081
17082
17083 if test "$LINK_BINS_DYNAMIC" = yes; then
17084     LIB_LINKAGE=DYN
17085     LT_LIB_LINKAGE=shared
17086 else
17087     LIB_LINKAGE=STAT
17088     LT_LIB_LINKAGE=static
17089 fi
17090
17091 if test "$ac_cv_mingw32" = yes ; then
17092     PLAT=NT
17093     DYN_EXT=dll
17094 else
17095     PLAT=UNIX
17096     DYN_EXT=so
17097 fi
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107   
17108   
17109   
17110   
17111   
17112   
17113   
17114   
17115   
17116   
17117   
17118   
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149 trap '' 1 2 15
17150
17151 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17152
17153 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17154 # Let make expand exec_prefix.
17155 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17156
17157 # Any assignment to VPATH causes Sun make to only execute
17158 # the first set of double-colon rules, so remove it if not needed.
17159 # If there is a colon in the path, we need to keep it.
17160 if test "x$srcdir" = x.; then
17161   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17162 fi
17163
17164 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17165
17166 DEFS=-DHAVE_CONFIG_H
17167
17168 # Without the "./", some shells look in PATH for config.status.
17169 : ${CONFIG_STATUS=./config.status}
17170
17171 echo creating $CONFIG_STATUS
17172 rm -f $CONFIG_STATUS
17173 cat > $CONFIG_STATUS <<EOF
17174 #! /bin/sh
17175 # Generated automatically by configure.
17176 # Run this file to recreate the current configuration.
17177 # This directory was configured as follows,
17178 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17179 #
17180 # $0 $ac_configure_args
17181 #
17182 # Compiler output produced by configure, useful for debugging
17183 # configure, is in ./config.log if it exists.
17184
17185 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17186 for ac_option
17187 do
17188   case "\$ac_option" in
17189   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17190     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17191     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17192   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17193     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17194     exit 0 ;;
17195   -help | --help | --hel | --he | --h)
17196     echo "\$ac_cs_usage"; exit 0 ;;
17197   *) echo "\$ac_cs_usage"; exit 1 ;;
17198   esac
17199 done
17200
17201 ac_given_srcdir=$srcdir
17202 ac_given_INSTALL="$INSTALL"
17203
17204 trap 'rm -fr `echo "\
17205 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17206 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17207 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17208 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17209 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17210 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17211 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17212 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17213 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17214 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17215 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17216 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17217 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17218 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17219 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17220 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17221 include/Makefile:build/top.mk:include/Makefile.in \
17222 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17223 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17224 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17225 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17226 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17227 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17228 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17229 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17230 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17231 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17232 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17233 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17234 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17235 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17236 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17237 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17238 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17239 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17240 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17241 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17242 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17243 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17244 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17245  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17246 EOF
17247 cat >> $CONFIG_STATUS <<EOF
17248
17249 # Protect against being on the right side of a sed subst in config.status.
17250 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17251  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17252 $ac_vpsub
17253 $extrasub
17254 s%@SHELL@%$SHELL%g
17255 s%@CFLAGS@%$CFLAGS%g
17256 s%@CPPFLAGS@%$CPPFLAGS%g
17257 s%@CXXFLAGS@%$CXXFLAGS%g
17258 s%@FFLAGS@%$FFLAGS%g
17259 s%@DEFS@%$DEFS%g
17260 s%@LDFLAGS@%$LDFLAGS%g
17261 s%@LIBS@%$LIBS%g
17262 s%@exec_prefix@%$exec_prefix%g
17263 s%@prefix@%$prefix%g
17264 s%@program_transform_name@%$program_transform_name%g
17265 s%@bindir@%$bindir%g
17266 s%@sbindir@%$sbindir%g
17267 s%@libexecdir@%$libexecdir%g
17268 s%@datadir@%$datadir%g
17269 s%@sysconfdir@%$sysconfdir%g
17270 s%@sharedstatedir@%$sharedstatedir%g
17271 s%@localstatedir@%$localstatedir%g
17272 s%@libdir@%$libdir%g
17273 s%@includedir@%$includedir%g
17274 s%@oldincludedir@%$oldincludedir%g
17275 s%@infodir@%$infodir%g
17276 s%@mandir@%$mandir%g
17277 s%@host@%$host%g
17278 s%@host_alias@%$host_alias%g
17279 s%@host_cpu@%$host_cpu%g
17280 s%@host_vendor@%$host_vendor%g
17281 s%@host_os@%$host_os%g
17282 s%@target@%$target%g
17283 s%@target_alias@%$target_alias%g
17284 s%@target_cpu@%$target_cpu%g
17285 s%@target_vendor@%$target_vendor%g
17286 s%@target_os@%$target_os%g
17287 s%@build@%$build%g
17288 s%@build_alias@%$build_alias%g
17289 s%@build_cpu@%$build_cpu%g
17290 s%@build_vendor@%$build_vendor%g
17291 s%@build_os@%$build_os%g
17292 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17293 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17294 s%@INSTALL_DATA@%$INSTALL_DATA%g
17295 s%@PACKAGE@%$PACKAGE%g
17296 s%@VERSION@%$VERSION%g
17297 s%@ACLOCAL@%$ACLOCAL%g
17298 s%@AUTOCONF@%$AUTOCONF%g
17299 s%@AUTOMAKE@%$AUTOMAKE%g
17300 s%@AUTOHEADER@%$AUTOHEADER%g
17301 s%@MAKEINFO@%$MAKEINFO%g
17302 s%@install_sh@%$install_sh%g
17303 s%@AMTAR@%$AMTAR%g
17304 s%@AWK@%$AWK%g
17305 s%@AMTARFLAGS@%$AMTARFLAGS%g
17306 s%@SET_MAKE@%$SET_MAKE%g
17307 s%@top_builddir@%$top_builddir%g
17308 s%@ldap_subdir@%$ldap_subdir%g
17309 s%@CC@%$CC%g
17310 s%@RANLIB@%$RANLIB%g
17311 s%@LN_S@%$LN_S%g
17312 s%@DLLTOOL@%$DLLTOOL%g
17313 s%@AS@%$AS%g
17314 s%@OBJDUMP@%$OBJDUMP%g
17315 s%@LIBTOOL@%$LIBTOOL%g
17316 s%@LN_H@%$LN_H%g
17317 s%@SENDMAIL@%$SENDMAIL%g
17318 s%@EDITOR@%$EDITOR%g
17319 s%@FINGER@%$FINGER%g
17320 s%@CPP@%$CPP%g
17321 s%@EXEEXT@%$EXEEXT%g
17322 s%@OBJEXT@%$OBJEXT%g
17323 s%@OL_MKDEP@%$OL_MKDEP%g
17324 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17325 s%@LIBOBJS@%$LIBOBJS%g
17326 s%@LIBSRCS@%$LIBSRCS%g
17327 s%@PLAT@%$PLAT%g
17328 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17329 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17330 s%@DYN_EXT@%$DYN_EXT%g
17331 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17332 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17333 s%@BUILD_LDAP@%$BUILD_LDAP%g
17334 s%@BUILD_LDBM@%$BUILD_LDBM%g
17335 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17336 s%@BUILD_SHELL@%$BUILD_SHELL%g
17337 s%@BUILD_SQL@%$BUILD_SQL%g
17338 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17339 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17340 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17341 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17342 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17343 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17344 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17345 s%@LDAP_LIBS@%$LDAP_LIBS%g
17346 s%@LDIF_LIBS@%$LDIF_LIBS%g
17347 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17348 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17349 s%@LDBM_LIBS@%$LDBM_LIBS%g
17350 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17351 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17352 s%@WRAP_LIBS@%$WRAP_LIBS%g
17353 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17354 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17355 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17356 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17357 s%@KRB4_LIBS@%$KRB4_LIBS%g
17358 s%@KRB5_LIBS@%$KRB5_LIBS%g
17359 s%@READLINE_LIBS@%$READLINE_LIBS%g
17360 s%@SASL_LIBS@%$SASL_LIBS%g
17361 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17362 s%@TLS_LIBS@%$TLS_LIBS%g
17363 s%@MODULES_LIBS@%$MODULES_LIBS%g
17364 s%@AUTH_LIBS@%$AUTH_LIBS%g
17365 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17366 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17367 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17368
17369 CEOF
17370 EOF
17371
17372 cat >> $CONFIG_STATUS <<\EOF
17373
17374 # Split the substitutions into bite-sized pieces for seds with
17375 # small command number limits, like on Digital OSF/1 and HP-UX.
17376 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17377 ac_file=1 # Number of current file.
17378 ac_beg=1 # First line for current file.
17379 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17380 ac_more_lines=:
17381 ac_sed_cmds=""
17382 while $ac_more_lines; do
17383   if test $ac_beg -gt 1; then
17384     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17385   else
17386     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17387   fi
17388   if test ! -s conftest.s$ac_file; then
17389     ac_more_lines=false
17390     rm -f conftest.s$ac_file
17391   else
17392     if test -z "$ac_sed_cmds"; then
17393       ac_sed_cmds="sed -f conftest.s$ac_file"
17394     else
17395       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17396     fi
17397     ac_file=`expr $ac_file + 1`
17398     ac_beg=$ac_end
17399     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17400   fi
17401 done
17402 if test -z "$ac_sed_cmds"; then
17403   ac_sed_cmds=cat
17404 fi
17405 EOF
17406
17407 cat >> $CONFIG_STATUS <<EOF
17408
17409 CONFIG_FILES=\${CONFIG_FILES-"\
17410 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17411 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17412 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17413 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17414 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17415 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17416 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17417 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17418 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17419 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17420 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17421 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17422 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17423 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17424 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17425 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17426 include/Makefile:build/top.mk:include/Makefile.in \
17427 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17428 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17429 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17430 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17431 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17432 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17433 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17434 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17435 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17436 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17437 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17438 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17439 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17440 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17441 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17442 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17443 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17444 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17445 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17446 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17447 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17448 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17449 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17450 "}
17451 EOF
17452 cat >> $CONFIG_STATUS <<\EOF
17453 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17454   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17455   case "$ac_file" in
17456   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17457        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17458   *) ac_file_in="${ac_file}.in" ;;
17459   esac
17460
17461   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17462
17463   # Remove last slash and all that follows it.  Not all systems have dirname.
17464   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17465   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17466     # The file is in a subdirectory.
17467     test ! -d "$ac_dir" && mkdir "$ac_dir"
17468     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17469     # A "../" for each directory in $ac_dir_suffix.
17470     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17471   else
17472     ac_dir_suffix= ac_dots=
17473   fi
17474
17475   case "$ac_given_srcdir" in
17476   .)  srcdir=.
17477       if test -z "$ac_dots"; then top_srcdir=.
17478       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17479   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17480   *) # Relative path.
17481     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17482     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17483   esac
17484
17485   case "$ac_given_INSTALL" in
17486   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17487   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17488   esac
17489
17490   echo creating "$ac_file"
17491   rm -f "$ac_file"
17492   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17493   case "$ac_file" in
17494   *[Mm]akefile*) ac_comsub="1i\\
17495 # $configure_input" ;;
17496   *) ac_comsub= ;;
17497   esac
17498
17499   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17500   sed -e "$ac_comsub
17501 s%@configure_input@%$configure_input%g
17502 s%@srcdir@%$srcdir%g
17503 s%@top_srcdir@%$top_srcdir%g
17504 s%@INSTALL@%$INSTALL%g
17505 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17506 fi; done
17507 rm -f conftest.s*
17508
17509 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17510 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17511 #
17512 # ac_d sets the value in "#define NAME VALUE" lines.
17513 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17514 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17515 ac_dC='\3'
17516 ac_dD='%g'
17517 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17518 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17519 ac_uB='\([      ]\)%\1#\2define\3'
17520 ac_uC=' '
17521 ac_uD='\4%g'
17522 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17523 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17524 ac_eB='$%\1#\2define\3'
17525 ac_eC=' '
17526 ac_eD='%g'
17527
17528 if test "${CONFIG_HEADERS+set}" != set; then
17529 EOF
17530 cat >> $CONFIG_STATUS <<EOF
17531   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17532 EOF
17533 cat >> $CONFIG_STATUS <<\EOF
17534 fi
17535 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17536   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17537   case "$ac_file" in
17538   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17539        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17540   *) ac_file_in="${ac_file}.in" ;;
17541   esac
17542
17543   echo creating $ac_file
17544
17545   rm -f conftest.frag conftest.in conftest.out
17546   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17547   cat $ac_file_inputs > conftest.in
17548
17549 EOF
17550
17551 # Transform confdefs.h into a sed script conftest.vals that substitutes
17552 # the proper values into config.h.in to produce config.h.  And first:
17553 # Protect against being on the right side of a sed subst in config.status.
17554 # Protect against being in an unquoted here document in config.status.
17555 rm -f conftest.vals
17556 cat > conftest.hdr <<\EOF
17557 s/[\\&%]/\\&/g
17558 s%[\\$`]%\\&%g
17559 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17560 s%ac_d%ac_u%gp
17561 s%ac_u%ac_e%gp
17562 EOF
17563 sed -n -f conftest.hdr confdefs.h > conftest.vals
17564 rm -f conftest.hdr
17565
17566 # This sed command replaces #undef with comments.  This is necessary, for
17567 # example, in the case of _POSIX_SOURCE, which is predefined and required
17568 # on some systems where configure will not decide to define it.
17569 cat >> conftest.vals <<\EOF
17570 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17571 EOF
17572
17573 # Break up conftest.vals because some shells have a limit on
17574 # the size of here documents, and old seds have small limits too.
17575
17576 rm -f conftest.tail
17577 while :
17578 do
17579   ac_lines=`grep -c . conftest.vals`
17580   # grep -c gives empty output for an empty file on some AIX systems.
17581   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17582   # Write a limited-size here document to conftest.frag.
17583   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17584   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17585   echo 'CEOF
17586   sed -f conftest.frag conftest.in > conftest.out
17587   rm -f conftest.in
17588   mv conftest.out conftest.in
17589 ' >> $CONFIG_STATUS
17590   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17591   rm -f conftest.vals
17592   mv conftest.tail conftest.vals
17593 done
17594 rm -f conftest.vals
17595
17596 cat >> $CONFIG_STATUS <<\EOF
17597   rm -f conftest.frag conftest.h
17598   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17599   cat conftest.in >> conftest.h
17600   rm -f conftest.in
17601   if cmp -s $ac_file conftest.h 2>/dev/null; then
17602     echo "$ac_file is unchanged"
17603     rm -f conftest.h
17604   else
17605     # Remove last slash and all that follows it.  Not all systems have dirname.
17606       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17607       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17608       # The file is in a subdirectory.
17609       test ! -d "$ac_dir" && mkdir "$ac_dir"
17610     fi
17611     rm -f $ac_file
17612     mv conftest.h $ac_file
17613   fi
17614 fi; done
17615
17616 EOF
17617 cat >> $CONFIG_STATUS <<EOF
17618
17619 EOF
17620 cat >> $CONFIG_STATUS <<\EOF
17621
17622 date > stamp-h
17623 echo Please \"make depend\" to build dependencies
17624
17625 exit 0
17626 EOF
17627 chmod +x $CONFIG_STATUS
17628 rm -fr confdefs* $ac_clean_files
17629 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17630