]> git.sur5r.net Git - openldap/blob - configure
Add better root dse error reporting
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.33 2001/09/26 19:20:24 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         fi
2237         ol_with_kerberos=yes
2238 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2239         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2240                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2241         fi
2242         ol_with_kerberos=no
2243 fi
2244
2245 if test $ol_enable_spasswd = yes ; then
2246         if test $ol_with_cyrus_sasl = no ; then
2247                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2248         fi
2249         ol_with_cyrus_sasl=yes
2250 fi
2251
2252 echo "$ac_t""done" 1>&6
2253
2254 LDAP_LIBS=
2255 LDIF_LIBS=
2256 LDBM_LIBS=
2257 LTHREAD_LIBS=
2258 LUTIL_LIBS=
2259
2260 SLAPD_LIBS=
2261 SLURPD_LIBS=
2262
2263 BUILD_SLAPD=no
2264 BUILD_SLURPD=no
2265
2266 BUILD_THREAD=no
2267
2268 BUILD_DNSSRV=no
2269 BUILD_LDAP=no
2270 BUILD_LDBM=no
2271 BUILD_PASSWD=no
2272 BUILD_SHELL=no
2273 BUILD_SQL=no
2274
2275 BUILD_DNSSRV_DYNAMIC=static
2276 BUILD_LDAP_DYNAMIC=static
2277 BUILD_LDBM_DYNAMIC=static
2278 BUILD_PASSWD_DYNAMIC=static
2279 BUILD_SHELL_DYNAMIC=static
2280 BUILD_SQL_DYNAMIC=static
2281
2282 SLAPD_MODULES_LDFLAGS=
2283 SLAPD_MODULES_CPPFLAGS=
2284 SLAPD_MODULES_LIST=
2285
2286 SLAPD_SQL_LDFLAGS=
2287 SLAPD_SQL_LIBS=
2288 SLAPD_SQL_INCLUDES=
2289
2290 KRB4_LIBS=
2291 KRB5_LIBS=
2292 READLINE_LIBS=
2293 SASL_LIBS=
2294 TERMCAP_LIBS=
2295 TLS_LIBS=
2296 MODULES_LIBS=
2297 AUTH_LIBS=
2298
2299
2300
2301 cat >> confdefs.h <<\EOF
2302 #define HAVE_MKVERSION 1
2303 EOF
2304
2305
2306
2307
2308 ol_aix_threads=no
2309 case "$target" in
2310 *-*-aix*)       if test -z "$CC" ; then
2311                 case "$ol_with_threads" in
2312                 auto | yes |  posix) ol_aix_threads=yes ;;
2313                 esac
2314         fi
2315 ;;
2316 esac
2317
2318 if test $ol_aix_threads = yes ; then
2319         if test -z "${CC}" ; then
2320                 for ac_prog in cc_r xlc_r cc
2321 do
2322 # Extract the first word of "$ac_prog", so it can be a program name with args.
2323 set dummy $ac_prog; ac_word=$2
2324 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2325 echo "configure:2326: checking for $ac_word" >&5
2326 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2327   echo $ac_n "(cached) $ac_c" 1>&6
2328 else
2329   if test -n "$CC"; then
2330   ac_cv_prog_CC="$CC" # Let the user override the test.
2331 else
2332   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2333   ac_dummy="$PATH"
2334   for ac_dir in $ac_dummy; do
2335     test -z "$ac_dir" && ac_dir=.
2336     if test -f $ac_dir/$ac_word; then
2337       ac_cv_prog_CC="$ac_prog"
2338       break
2339     fi
2340   done
2341   IFS="$ac_save_ifs"
2342 fi
2343 fi
2344 CC="$ac_cv_prog_CC"
2345 if test -n "$CC"; then
2346   echo "$ac_t""$CC" 1>&6
2347 else
2348   echo "$ac_t""no" 1>&6
2349 fi
2350
2351 test -n "$CC" && break
2352 done
2353
2354
2355                 if test "$CC" = cc ; then
2356                                                 if test $ol_with_threads != auto ; then
2357                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2358                         else
2359                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2360                         fi
2361                         ol_with_threads=no
2362                 fi
2363         fi
2364
2365         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2366                 ol_with_threads=posix
2367                 ol_cv_pthread_create=yes
2368         fi
2369 fi
2370
2371 if test -z "${CC}"; then
2372         for ac_prog in cc
2373 do
2374 # Extract the first word of "$ac_prog", so it can be a program name with args.
2375 set dummy $ac_prog; ac_word=$2
2376 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2377 echo "configure:2378: checking for $ac_word" >&5
2378 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2379   echo $ac_n "(cached) $ac_c" 1>&6
2380 else
2381   if test -n "$CC"; then
2382   ac_cv_prog_CC="$CC" # Let the user override the test.
2383 else
2384   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2385   ac_dummy="$PATH"
2386   for ac_dir in $ac_dummy; do
2387     test -z "$ac_dir" && ac_dir=.
2388     if test -f $ac_dir/$ac_word; then
2389       ac_cv_prog_CC="$ac_prog"
2390       break
2391     fi
2392   done
2393   IFS="$ac_save_ifs"
2394 fi
2395 fi
2396 CC="$ac_cv_prog_CC"
2397 if test -n "$CC"; then
2398   echo "$ac_t""$CC" 1>&6
2399 else
2400   echo "$ac_t""no" 1>&6
2401 fi
2402
2403 test -n "$CC" && break
2404 done
2405
2406 fi
2407
2408
2409
2410
2411 # Check whether --enable-fast-install or --disable-fast-install was given.
2412 if test "${enable_fast_install+set}" = set; then
2413   enableval="$enable_fast_install"
2414   p=${PACKAGE-default}
2415 case "$enableval" in
2416 yes) enable_fast_install=yes ;;
2417 no) enable_fast_install=no ;;
2418 *)
2419   enable_fast_install=no
2420   # Look at the argument we got.  We use all the common list separators.
2421   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2422   for pkg in $enableval; do
2423     if test "X$pkg" = "X$p"; then
2424       enable_fast_install=yes
2425     fi
2426   done
2427   IFS="$ac_save_ifs"
2428   ;;
2429 esac
2430 else
2431   enable_fast_install=yes
2432 fi
2433
2434 # Extract the first word of "ranlib", so it can be a program name with args.
2435 set dummy ranlib; ac_word=$2
2436 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2437 echo "configure:2438: checking for $ac_word" >&5
2438 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2439   echo $ac_n "(cached) $ac_c" 1>&6
2440 else
2441   if test -n "$RANLIB"; then
2442   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2443 else
2444   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2445   ac_dummy="$PATH"
2446   for ac_dir in $ac_dummy; do
2447     test -z "$ac_dir" && ac_dir=.
2448     if test -f $ac_dir/$ac_word; then
2449       ac_cv_prog_RANLIB="ranlib"
2450       break
2451     fi
2452   done
2453   IFS="$ac_save_ifs"
2454   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2455 fi
2456 fi
2457 RANLIB="$ac_cv_prog_RANLIB"
2458 if test -n "$RANLIB"; then
2459   echo "$ac_t""$RANLIB" 1>&6
2460 else
2461   echo "$ac_t""no" 1>&6
2462 fi
2463
2464 # Extract the first word of "gcc", so it can be a program name with args.
2465 set dummy gcc; ac_word=$2
2466 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2467 echo "configure:2468: checking for $ac_word" >&5
2468 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2469   echo $ac_n "(cached) $ac_c" 1>&6
2470 else
2471   if test -n "$CC"; then
2472   ac_cv_prog_CC="$CC" # Let the user override the test.
2473 else
2474   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2475   ac_dummy="$PATH"
2476   for ac_dir in $ac_dummy; do
2477     test -z "$ac_dir" && ac_dir=.
2478     if test -f $ac_dir/$ac_word; then
2479       ac_cv_prog_CC="gcc"
2480       break
2481     fi
2482   done
2483   IFS="$ac_save_ifs"
2484 fi
2485 fi
2486 CC="$ac_cv_prog_CC"
2487 if test -n "$CC"; then
2488   echo "$ac_t""$CC" 1>&6
2489 else
2490   echo "$ac_t""no" 1>&6
2491 fi
2492
2493 if test -z "$CC"; then
2494   # Extract the first word of "cc", so it can be a program name with args.
2495 set dummy cc; ac_word=$2
2496 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2497 echo "configure:2498: checking for $ac_word" >&5
2498 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2499   echo $ac_n "(cached) $ac_c" 1>&6
2500 else
2501   if test -n "$CC"; then
2502   ac_cv_prog_CC="$CC" # Let the user override the test.
2503 else
2504   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2505   ac_prog_rejected=no
2506   ac_dummy="$PATH"
2507   for ac_dir in $ac_dummy; do
2508     test -z "$ac_dir" && ac_dir=.
2509     if test -f $ac_dir/$ac_word; then
2510       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2511         ac_prog_rejected=yes
2512         continue
2513       fi
2514       ac_cv_prog_CC="cc"
2515       break
2516     fi
2517   done
2518   IFS="$ac_save_ifs"
2519 if test $ac_prog_rejected = yes; then
2520   # We found a bogon in the path, so make sure we never use it.
2521   set dummy $ac_cv_prog_CC
2522   shift
2523   if test $# -gt 0; then
2524     # We chose a different compiler from the bogus one.
2525     # However, it has the same basename, so the bogon will be chosen
2526     # first if we set CC to just the basename; use the full file name.
2527     shift
2528     set dummy "$ac_dir/$ac_word" "$@"
2529     shift
2530     ac_cv_prog_CC="$@"
2531   fi
2532 fi
2533 fi
2534 fi
2535 CC="$ac_cv_prog_CC"
2536 if test -n "$CC"; then
2537   echo "$ac_t""$CC" 1>&6
2538 else
2539   echo "$ac_t""no" 1>&6
2540 fi
2541
2542   if test -z "$CC"; then
2543     case "`uname -s`" in
2544     *win32* | *WIN32* | *CYGWIN*)
2545       # Extract the first word of "cl", so it can be a program name with args.
2546 set dummy cl; ac_word=$2
2547 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2548 echo "configure:2549: checking for $ac_word" >&5
2549 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2550   echo $ac_n "(cached) $ac_c" 1>&6
2551 else
2552   if test -n "$CC"; then
2553   ac_cv_prog_CC="$CC" # Let the user override the test.
2554 else
2555   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2556   ac_dummy="$PATH"
2557   for ac_dir in $ac_dummy; do
2558     test -z "$ac_dir" && ac_dir=.
2559     if test -f $ac_dir/$ac_word; then
2560       ac_cv_prog_CC="cl"
2561       break
2562     fi
2563   done
2564   IFS="$ac_save_ifs"
2565 fi
2566 fi
2567 CC="$ac_cv_prog_CC"
2568 if test -n "$CC"; then
2569   echo "$ac_t""$CC" 1>&6
2570 else
2571   echo "$ac_t""no" 1>&6
2572 fi
2573  ;;
2574     esac
2575   fi
2576   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2577 fi
2578
2579 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2580 echo "configure:2581: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2581
2582 ac_ext=c
2583 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2584 ac_cpp='$CPP $CPPFLAGS'
2585 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2586 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2587 cross_compiling=$ac_cv_prog_cc_cross
2588
2589 cat > conftest.$ac_ext << EOF
2590
2591 #line 2592 "configure"
2592 #include "confdefs.h"
2593
2594 main(){return(0);}
2595 EOF
2596 if { (eval echo configure:2597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2597   ac_cv_prog_cc_works=yes
2598   # If we can't run a trivial program, we are probably using a cross compiler.
2599   if (./conftest; exit) 2>/dev/null; then
2600     ac_cv_prog_cc_cross=no
2601   else
2602     ac_cv_prog_cc_cross=yes
2603   fi
2604 else
2605   echo "configure: failed program was:" >&5
2606   cat conftest.$ac_ext >&5
2607   ac_cv_prog_cc_works=no
2608 fi
2609 rm -fr conftest*
2610 ac_ext=c
2611 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2612 ac_cpp='$CPP $CPPFLAGS'
2613 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2614 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2615 cross_compiling=$ac_cv_prog_cc_cross
2616
2617 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2618 if test $ac_cv_prog_cc_works = no; then
2619   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2620 fi
2621 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2622 echo "configure:2623: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2623 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2624 cross_compiling=$ac_cv_prog_cc_cross
2625
2626 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2627 echo "configure:2628: checking whether we are using GNU C" >&5
2628 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2629   echo $ac_n "(cached) $ac_c" 1>&6
2630 else
2631   cat > conftest.c <<EOF
2632 #ifdef __GNUC__
2633   yes;
2634 #endif
2635 EOF
2636 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2637   ac_cv_prog_gcc=yes
2638 else
2639   ac_cv_prog_gcc=no
2640 fi
2641 fi
2642
2643 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2644
2645 if test $ac_cv_prog_gcc = yes; then
2646   GCC=yes
2647 else
2648   GCC=
2649 fi
2650
2651 ac_test_CFLAGS="${CFLAGS+set}"
2652 ac_save_CFLAGS="$CFLAGS"
2653 CFLAGS=
2654 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2655 echo "configure:2656: checking whether ${CC-cc} accepts -g" >&5
2656 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2657   echo $ac_n "(cached) $ac_c" 1>&6
2658 else
2659   echo 'void f(){}' > conftest.c
2660 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2661   ac_cv_prog_cc_g=yes
2662 else
2663   ac_cv_prog_cc_g=no
2664 fi
2665 rm -f conftest*
2666
2667 fi
2668
2669 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2670 if test "$ac_test_CFLAGS" = set; then
2671   CFLAGS="$ac_save_CFLAGS"
2672 elif test $ac_cv_prog_cc_g = yes; then
2673   if test "$GCC" = yes; then
2674     CFLAGS="-g -O2"
2675   else
2676     CFLAGS="-g"
2677   fi
2678 else
2679   if test "$GCC" = yes; then
2680     CFLAGS="-O2"
2681   else
2682     CFLAGS=
2683   fi
2684 fi
2685
2686 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2687 if test "${with_gnu_ld+set}" = set; then
2688   withval="$with_gnu_ld"
2689   test "$withval" = no || with_gnu_ld=yes
2690 else
2691   with_gnu_ld=no
2692 fi
2693
2694 ac_prog=ld
2695 if test "$ac_cv_prog_gcc" = yes; then
2696   # Check if gcc -print-prog-name=ld gives a path.
2697   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2698 echo "configure:2699: checking for ld used by GCC" >&5
2699   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2700   case "$ac_prog" in
2701     # Accept absolute paths.
2702     [\\/]* | [A-Za-z]:[\\/]*)
2703       re_direlt='/[^/][^/]*/\.\./'
2704       # Canonicalize the path of ld
2705       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2706       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2707         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2708       done
2709       test -z "$LD" && LD="$ac_prog"
2710       ;;
2711   "")
2712     # If it fails, then pretend we aren't using GCC.
2713     ac_prog=ld
2714     ;;
2715   *)
2716     # If it is relative, then search for the first ld in PATH.
2717     with_gnu_ld=unknown
2718     ;;
2719   esac
2720 elif test "$with_gnu_ld" = yes; then
2721   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2722 echo "configure:2723: checking for GNU ld" >&5
2723 else
2724   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2725 echo "configure:2726: checking for non-GNU ld" >&5
2726 fi
2727 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2728   echo $ac_n "(cached) $ac_c" 1>&6
2729 else
2730   if test -z "$LD"; then
2731   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2732   for ac_dir in $PATH; do
2733     test -z "$ac_dir" && ac_dir=.
2734     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2735       ac_cv_path_LD="$ac_dir/$ac_prog"
2736       # Check to see if the program is GNU ld.  I'd rather use --version,
2737       # but apparently some GNU ld's only accept -v.
2738       # Break only if it was the GNU/non-GNU ld that we prefer.
2739       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2740         test "$with_gnu_ld" != no && break
2741       else
2742         test "$with_gnu_ld" != yes && break
2743       fi
2744     fi
2745   done
2746   IFS="$ac_save_ifs"
2747 else
2748   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2749 fi
2750 fi
2751
2752 LD="$ac_cv_path_LD"
2753 if test -n "$LD"; then
2754   echo "$ac_t""$LD" 1>&6
2755 else
2756   echo "$ac_t""no" 1>&6
2757 fi
2758 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2759 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2760 echo "configure:2761: checking if the linker ($LD) is GNU ld" >&5
2761 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2762   echo $ac_n "(cached) $ac_c" 1>&6
2763 else
2764   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2765 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2766   ac_cv_prog_gnu_ld=yes
2767 else
2768   ac_cv_prog_gnu_ld=no
2769 fi
2770 fi
2771
2772 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2773
2774
2775 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2776 echo "configure:2777: checking for BSD-compatible nm" >&5
2777 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2778   echo $ac_n "(cached) $ac_c" 1>&6
2779 else
2780   if test -n "$NM"; then
2781   # Let the user override the test.
2782   ac_cv_path_NM="$NM"
2783 else
2784   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2785   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2786     test -z "$ac_dir" && ac_dir=.
2787     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2788       # Check to see if the nm accepts a BSD-compat flag.
2789       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2790       #   nm: unknown option "B" ignored
2791       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2792         ac_cv_path_NM="$ac_dir/nm -B"
2793         break
2794       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2795         ac_cv_path_NM="$ac_dir/nm -p"
2796         break
2797       else
2798         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2799         continue # so that we can try to find one that supports BSD flags
2800       fi
2801     fi
2802   done
2803   IFS="$ac_save_ifs"
2804   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2805 fi
2806 fi
2807
2808 NM="$ac_cv_path_NM"
2809 echo "$ac_t""$NM" 1>&6
2810
2811 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2812 echo "configure:2813: checking whether ln -s works" >&5
2813 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2814   echo $ac_n "(cached) $ac_c" 1>&6
2815 else
2816   rm -f conftestdata
2817 if ln -s X conftestdata 2>/dev/null
2818 then
2819   rm -f conftestdata
2820   ac_cv_prog_LN_S="ln -s"
2821 else
2822   ac_cv_prog_LN_S=ln
2823 fi
2824 fi
2825 LN_S="$ac_cv_prog_LN_S"
2826 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2827   echo "$ac_t""yes" 1>&6
2828 else
2829   echo "$ac_t""no" 1>&6
2830 fi
2831
2832 if test $host != $build; then
2833   ac_tool_prefix=${host_alias}-
2834 else
2835   ac_tool_prefix=
2836 fi
2837
2838
2839 case "$target" in
2840 NONE) lt_target="$host" ;;
2841 *) lt_target="$target" ;;
2842 esac
2843
2844 # Check for any special flags to pass to ltconfig.
2845 libtool_flags="--cache-file=$cache_file"
2846 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2847 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2848 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2849 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2850 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2851 libtool_flags="$libtool_flags --enable-dlopen"
2852 libtool_flags="$libtool_flags --enable-win32-dll"
2853 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2854 if test "${enable_libtool_lock+set}" = set; then
2855   enableval="$enable_libtool_lock"
2856   :
2857 fi
2858
2859 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2860 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2861
2862 # Some flags need to be propagated to the compiler or linker for good
2863 # libtool support.
2864 case "$lt_target" in
2865 *-*-irix6*)
2866   # Find out which ABI we are using.
2867   echo '#line 2868 "configure"' > conftest.$ac_ext
2868   if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2869     case "`/usr/bin/file conftest.o`" in
2870     *32-bit*)
2871       LD="${LD-ld} -32"
2872       ;;
2873     *N32*)
2874       LD="${LD-ld} -n32"
2875       ;;
2876     *64-bit*)
2877       LD="${LD-ld} -64"
2878       ;;
2879     esac
2880   fi
2881   rm -rf conftest*
2882   ;;
2883
2884 *-*-sco3.2v5*)
2885   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2886   SAVE_CFLAGS="$CFLAGS"
2887   CFLAGS="$CFLAGS -belf"
2888   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2889 echo "configure:2890: checking whether the C compiler needs -belf" >&5
2890 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2891   echo $ac_n "(cached) $ac_c" 1>&6
2892 else
2893   cat > conftest.$ac_ext <<EOF
2894 #line 2895 "configure"
2895 #include "confdefs.h"
2896
2897 int main() {
2898
2899 ; return 0; }
2900 EOF
2901 if { (eval echo configure:2902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2902   rm -rf conftest*
2903   lt_cv_cc_needs_belf=yes
2904 else
2905   echo "configure: failed program was:" >&5
2906   cat conftest.$ac_ext >&5
2907   rm -rf conftest*
2908   lt_cv_cc_needs_belf=no
2909 fi
2910 rm -f conftest*
2911 fi
2912
2913 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2914   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2915     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2916     CFLAGS="$SAVE_CFLAGS"
2917   fi
2918   ;;
2919
2920 *-*-cygwin* | *-*-mingw*)
2921   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2922 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2923 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2924 echo "configure:2925: checking for $ac_word" >&5
2925 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2926   echo $ac_n "(cached) $ac_c" 1>&6
2927 else
2928   if test -n "$DLLTOOL"; then
2929   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2930 else
2931   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2932   ac_dummy="$PATH"
2933   for ac_dir in $ac_dummy; do
2934     test -z "$ac_dir" && ac_dir=.
2935     if test -f $ac_dir/$ac_word; then
2936       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2937       break
2938     fi
2939   done
2940   IFS="$ac_save_ifs"
2941 fi
2942 fi
2943 DLLTOOL="$ac_cv_prog_DLLTOOL"
2944 if test -n "$DLLTOOL"; then
2945   echo "$ac_t""$DLLTOOL" 1>&6
2946 else
2947   echo "$ac_t""no" 1>&6
2948 fi
2949
2950
2951 if test -z "$ac_cv_prog_DLLTOOL"; then
2952 if test -n "$ac_tool_prefix"; then
2953   # Extract the first word of "dlltool", so it can be a program name with args.
2954 set dummy dlltool; ac_word=$2
2955 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2956 echo "configure:2957: checking for $ac_word" >&5
2957 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2958   echo $ac_n "(cached) $ac_c" 1>&6
2959 else
2960   if test -n "$DLLTOOL"; then
2961   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2962 else
2963   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2964   ac_dummy="$PATH"
2965   for ac_dir in $ac_dummy; do
2966     test -z "$ac_dir" && ac_dir=.
2967     if test -f $ac_dir/$ac_word; then
2968       ac_cv_prog_DLLTOOL="dlltool"
2969       break
2970     fi
2971   done
2972   IFS="$ac_save_ifs"
2973   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
2974 fi
2975 fi
2976 DLLTOOL="$ac_cv_prog_DLLTOOL"
2977 if test -n "$DLLTOOL"; then
2978   echo "$ac_t""$DLLTOOL" 1>&6
2979 else
2980   echo "$ac_t""no" 1>&6
2981 fi
2982
2983 else
2984   DLLTOOL="false"
2985 fi
2986 fi
2987
2988   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
2989 set dummy ${ac_tool_prefix}as; ac_word=$2
2990 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2991 echo "configure:2992: checking for $ac_word" >&5
2992 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
2993   echo $ac_n "(cached) $ac_c" 1>&6
2994 else
2995   if test -n "$AS"; then
2996   ac_cv_prog_AS="$AS" # Let the user override the test.
2997 else
2998   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2999   ac_dummy="$PATH"
3000   for ac_dir in $ac_dummy; do
3001     test -z "$ac_dir" && ac_dir=.
3002     if test -f $ac_dir/$ac_word; then
3003       ac_cv_prog_AS="${ac_tool_prefix}as"
3004       break
3005     fi
3006   done
3007   IFS="$ac_save_ifs"
3008 fi
3009 fi
3010 AS="$ac_cv_prog_AS"
3011 if test -n "$AS"; then
3012   echo "$ac_t""$AS" 1>&6
3013 else
3014   echo "$ac_t""no" 1>&6
3015 fi
3016
3017
3018 if test -z "$ac_cv_prog_AS"; then
3019 if test -n "$ac_tool_prefix"; then
3020   # Extract the first word of "as", so it can be a program name with args.
3021 set dummy as; ac_word=$2
3022 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3023 echo "configure:3024: checking for $ac_word" >&5
3024 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3025   echo $ac_n "(cached) $ac_c" 1>&6
3026 else
3027   if test -n "$AS"; then
3028   ac_cv_prog_AS="$AS" # Let the user override the test.
3029 else
3030   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3031   ac_dummy="$PATH"
3032   for ac_dir in $ac_dummy; do
3033     test -z "$ac_dir" && ac_dir=.
3034     if test -f $ac_dir/$ac_word; then
3035       ac_cv_prog_AS="as"
3036       break
3037     fi
3038   done
3039   IFS="$ac_save_ifs"
3040   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3041 fi
3042 fi
3043 AS="$ac_cv_prog_AS"
3044 if test -n "$AS"; then
3045   echo "$ac_t""$AS" 1>&6
3046 else
3047   echo "$ac_t""no" 1>&6
3048 fi
3049
3050 else
3051   AS="false"
3052 fi
3053 fi
3054
3055   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3056 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3057 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3058 echo "configure:3059: checking for $ac_word" >&5
3059 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3060   echo $ac_n "(cached) $ac_c" 1>&6
3061 else
3062   if test -n "$OBJDUMP"; then
3063   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3064 else
3065   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3066   ac_dummy="$PATH"
3067   for ac_dir in $ac_dummy; do
3068     test -z "$ac_dir" && ac_dir=.
3069     if test -f $ac_dir/$ac_word; then
3070       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3071       break
3072     fi
3073   done
3074   IFS="$ac_save_ifs"
3075 fi
3076 fi
3077 OBJDUMP="$ac_cv_prog_OBJDUMP"
3078 if test -n "$OBJDUMP"; then
3079   echo "$ac_t""$OBJDUMP" 1>&6
3080 else
3081   echo "$ac_t""no" 1>&6
3082 fi
3083
3084
3085 if test -z "$ac_cv_prog_OBJDUMP"; then
3086 if test -n "$ac_tool_prefix"; then
3087   # Extract the first word of "objdump", so it can be a program name with args.
3088 set dummy objdump; ac_word=$2
3089 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3090 echo "configure:3091: checking for $ac_word" >&5
3091 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3092   echo $ac_n "(cached) $ac_c" 1>&6
3093 else
3094   if test -n "$OBJDUMP"; then
3095   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3096 else
3097   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3098   ac_dummy="$PATH"
3099   for ac_dir in $ac_dummy; do
3100     test -z "$ac_dir" && ac_dir=.
3101     if test -f $ac_dir/$ac_word; then
3102       ac_cv_prog_OBJDUMP="objdump"
3103       break
3104     fi
3105   done
3106   IFS="$ac_save_ifs"
3107   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3108 fi
3109 fi
3110 OBJDUMP="$ac_cv_prog_OBJDUMP"
3111 if test -n "$OBJDUMP"; then
3112   echo "$ac_t""$OBJDUMP" 1>&6
3113 else
3114   echo "$ac_t""no" 1>&6
3115 fi
3116
3117 else
3118   OBJDUMP="false"
3119 fi
3120 fi
3121
3122   ;;
3123
3124 esac
3125
3126
3127 # Save cache, so that ltconfig can load it
3128
3129
3130 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3131 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3132 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3133 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3134 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3135 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3136 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3137 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3138
3139 # Reload cache, that may have been modified by ltconfig
3140
3141
3142 # This can be used to rebuild libtool when needed
3143 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3144
3145 # Always use our own libtool.
3146 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3147
3148 # Redirect the config.log output again, so that the ltconfig log is not
3149 # clobbered by the next message.
3150 exec 5>>./config.log
3151
3152
3153 for ac_prog in mawk gawk nawk awk
3154 do
3155 # Extract the first word of "$ac_prog", so it can be a program name with args.
3156 set dummy $ac_prog; ac_word=$2
3157 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3158 echo "configure:3159: checking for $ac_word" >&5
3159 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3160   echo $ac_n "(cached) $ac_c" 1>&6
3161 else
3162   if test -n "$AWK"; then
3163   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3164 else
3165   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3166   ac_dummy="$PATH"
3167   for ac_dir in $ac_dummy; do
3168     test -z "$ac_dir" && ac_dir=.
3169     if test -f $ac_dir/$ac_word; then
3170       ac_cv_prog_AWK="$ac_prog"
3171       break
3172     fi
3173   done
3174   IFS="$ac_save_ifs"
3175 fi
3176 fi
3177 AWK="$ac_cv_prog_AWK"
3178 if test -n "$AWK"; then
3179   echo "$ac_t""$AWK" 1>&6
3180 else
3181   echo "$ac_t""no" 1>&6
3182 fi
3183
3184 test -n "$AWK" && break
3185 done
3186
3187 # test for ln hardlink support
3188 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3189 echo "configure:3190: checking whether ln works" >&5
3190 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3191   echo $ac_n "(cached) $ac_c" 1>&6
3192 else
3193   rm -f conftest.src conftest.dst
3194 echo "conftest" > conftest.src
3195 if ln conftest.src conftest.dst 2>/dev/null
3196 then
3197   ol_cv_prog_LN_H="ln"
3198 else
3199   ol_cv_prog_LN_H="cp"
3200 fi
3201 rm -f conftest.src conftest.dst
3202
3203 fi
3204 LN_H="$ol_cv_prog_LN_H"
3205 if test "$ol_cv_prog_LN_H" = "ln"; then
3206         echo "$ac_t""yes" 1>&6
3207 else
3208         echo "$ac_t""no" 1>&6
3209 fi
3210
3211 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3212 echo "configure:3213: checking whether ln -s works" >&5
3213 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3214   echo $ac_n "(cached) $ac_c" 1>&6
3215 else
3216   rm -f conftestdata
3217 if ln -s X conftestdata 2>/dev/null
3218 then
3219   rm -f conftestdata
3220   ac_cv_prog_LN_S="ln -s"
3221 else
3222   ac_cv_prog_LN_S=ln
3223 fi
3224 fi
3225 LN_S="$ac_cv_prog_LN_S"
3226 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3227   echo "$ac_t""yes" 1>&6
3228 else
3229   echo "$ac_t""no" 1>&6
3230 fi
3231
3232
3233 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3234         LN_S="$LN_H"
3235 fi
3236
3237 # Extract the first word of "sendmail", so it can be a program name with args.
3238 set dummy sendmail; ac_word=$2
3239 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3240 echo "configure:3241: checking for $ac_word" >&5
3241 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3242   echo $ac_n "(cached) $ac_c" 1>&6
3243 else
3244   case "$SENDMAIL" in
3245   /*)
3246   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3247   ;;
3248   ?:/*)
3249   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3250   ;;
3251   *)
3252   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3253   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3254   for ac_dir in $ac_dummy; do 
3255     test -z "$ac_dir" && ac_dir=.
3256     if test -f $ac_dir/$ac_word; then
3257       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3258       break
3259     fi
3260   done
3261   IFS="$ac_save_ifs"
3262   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3263   ;;
3264 esac
3265 fi
3266 SENDMAIL="$ac_cv_path_SENDMAIL"
3267 if test -n "$SENDMAIL"; then
3268   echo "$ac_t""$SENDMAIL" 1>&6
3269 else
3270   echo "$ac_t""no" 1>&6
3271 fi
3272
3273 # Extract the first word of "vi", so it can be a program name with args.
3274 set dummy vi; ac_word=$2
3275 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3276 echo "configure:3277: checking for $ac_word" >&5
3277 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3278   echo $ac_n "(cached) $ac_c" 1>&6
3279 else
3280   case "$EDITOR" in
3281   /*)
3282   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3283   ;;
3284   ?:/*)
3285   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3286   ;;
3287   *)
3288   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3289   ac_dummy="$PATH:/usr/ucb"
3290   for ac_dir in $ac_dummy; do 
3291     test -z "$ac_dir" && ac_dir=.
3292     if test -f $ac_dir/$ac_word; then
3293       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3294       break
3295     fi
3296   done
3297   IFS="$ac_save_ifs"
3298   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3299   ;;
3300 esac
3301 fi
3302 EDITOR="$ac_cv_path_EDITOR"
3303 if test -n "$EDITOR"; then
3304   echo "$ac_t""$EDITOR" 1>&6
3305 else
3306   echo "$ac_t""no" 1>&6
3307 fi
3308
3309 # Extract the first word of "finger", so it can be a program name with args.
3310 set dummy finger; ac_word=$2
3311 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3312 echo "configure:3313: checking for $ac_word" >&5
3313 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3314   echo $ac_n "(cached) $ac_c" 1>&6
3315 else
3316   case "$FINGER" in
3317   /*)
3318   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3319   ;;
3320   ?:/*)
3321   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3322   ;;
3323   *)
3324   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3325   ac_dummy="$PATH:/usr/ucb"
3326   for ac_dir in $ac_dummy; do 
3327     test -z "$ac_dir" && ac_dir=.
3328     if test -f $ac_dir/$ac_word; then
3329       ac_cv_path_FINGER="$ac_dir/$ac_word"
3330       break
3331     fi
3332   done
3333   IFS="$ac_save_ifs"
3334   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3335   ;;
3336 esac
3337 fi
3338 FINGER="$ac_cv_path_FINGER"
3339 if test -n "$FINGER"; then
3340   echo "$ac_t""$FINGER" 1>&6
3341 else
3342   echo "$ac_t""no" 1>&6
3343 fi
3344
3345
3346 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3347 echo "configure:3348: checking how to run the C preprocessor" >&5
3348 # On Suns, sometimes $CPP names a directory.
3349 if test -n "$CPP" && test -d "$CPP"; then
3350   CPP=
3351 fi
3352 if test -z "$CPP"; then
3353 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3354   echo $ac_n "(cached) $ac_c" 1>&6
3355 else
3356     # This must be in double quotes, not single quotes, because CPP may get
3357   # substituted into the Makefile and "${CC-cc}" will confuse make.
3358   CPP="${CC-cc} -E"
3359   # On the NeXT, cc -E runs the code through the compiler's parser,
3360   # not just through cpp.
3361   cat > conftest.$ac_ext <<EOF
3362 #line 3363 "configure"
3363 #include "confdefs.h"
3364 #include <assert.h>
3365 Syntax Error
3366 EOF
3367 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3368 { (eval echo configure:3369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3369 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3370 if test -z "$ac_err"; then
3371   :
3372 else
3373   echo "$ac_err" >&5
3374   echo "configure: failed program was:" >&5
3375   cat conftest.$ac_ext >&5
3376   rm -rf conftest*
3377   CPP="${CC-cc} -E -traditional-cpp"
3378   cat > conftest.$ac_ext <<EOF
3379 #line 3380 "configure"
3380 #include "confdefs.h"
3381 #include <assert.h>
3382 Syntax Error
3383 EOF
3384 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3385 { (eval echo configure:3386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3386 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3387 if test -z "$ac_err"; then
3388   :
3389 else
3390   echo "$ac_err" >&5
3391   echo "configure: failed program was:" >&5
3392   cat conftest.$ac_ext >&5
3393   rm -rf conftest*
3394   CPP="${CC-cc} -nologo -E"
3395   cat > conftest.$ac_ext <<EOF
3396 #line 3397 "configure"
3397 #include "confdefs.h"
3398 #include <assert.h>
3399 Syntax Error
3400 EOF
3401 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3402 { (eval echo configure:3403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3403 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3404 if test -z "$ac_err"; then
3405   :
3406 else
3407   echo "$ac_err" >&5
3408   echo "configure: failed program was:" >&5
3409   cat conftest.$ac_ext >&5
3410   rm -rf conftest*
3411   CPP=/lib/cpp
3412 fi
3413 rm -f conftest*
3414 fi
3415 rm -f conftest*
3416 fi
3417 rm -f conftest*
3418   ac_cv_prog_CPP="$CPP"
3419 fi
3420   CPP="$ac_cv_prog_CPP"
3421 else
3422   ac_cv_prog_CPP="$CPP"
3423 fi
3424 echo "$ac_t""$CPP" 1>&6
3425
3426
3427 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3428         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3429
3430 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3431         echo "configure: warning: programs compiled here do run here..." 1>&2
3432         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3433
3434 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3435         echo "configure: warning: programs compiled here do not run here..." 1>&2
3436         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3437 fi
3438
3439 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3440 echo "configure:3441: checking for AIX" >&5
3441 cat > conftest.$ac_ext <<EOF
3442 #line 3443 "configure"
3443 #include "confdefs.h"
3444 #ifdef _AIX
3445   yes
3446 #endif
3447
3448 EOF
3449 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3450   egrep "yes" >/dev/null 2>&1; then
3451   rm -rf conftest*
3452   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3453 #define _ALL_SOURCE 1
3454 EOF
3455
3456 else
3457   rm -rf conftest*
3458   echo "$ac_t""no" 1>&6
3459 fi
3460 rm -f conftest*
3461
3462
3463 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3464 echo "configure:3465: checking for POSIXized ISC" >&5
3465 if test -d /etc/conf/kconfig.d &&
3466   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3467 then
3468   echo "$ac_t""yes" 1>&6
3469   ISC=yes # If later tests want to check for ISC.
3470   cat >> confdefs.h <<\EOF
3471 #define _POSIX_SOURCE 1
3472 EOF
3473
3474   if test "$GCC" = yes; then
3475     CC="$CC -posix"
3476   else
3477     CC="$CC -Xp"
3478   fi
3479 else
3480   echo "$ac_t""no" 1>&6
3481   ISC=
3482 fi
3483
3484 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3485 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3486 echo "configure:3487: checking for minix/config.h" >&5
3487 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3488   echo $ac_n "(cached) $ac_c" 1>&6
3489 else
3490   cat > conftest.$ac_ext <<EOF
3491 #line 3492 "configure"
3492 #include "confdefs.h"
3493 #include <minix/config.h>
3494 EOF
3495 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3496 { (eval echo configure:3497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3497 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3498 if test -z "$ac_err"; then
3499   rm -rf conftest*
3500   eval "ac_cv_header_$ac_safe=yes"
3501 else
3502   echo "$ac_err" >&5
3503   echo "configure: failed program was:" >&5
3504   cat conftest.$ac_ext >&5
3505   rm -rf conftest*
3506   eval "ac_cv_header_$ac_safe=no"
3507 fi
3508 rm -f conftest*
3509 fi
3510 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3511   echo "$ac_t""yes" 1>&6
3512   MINIX=yes
3513 else
3514   echo "$ac_t""no" 1>&6
3515 MINIX=
3516 fi
3517
3518 if test "$MINIX" = yes; then
3519   cat >> confdefs.h <<\EOF
3520 #define _POSIX_SOURCE 1
3521 EOF
3522
3523   cat >> confdefs.h <<\EOF
3524 #define _POSIX_1_SOURCE 2
3525 EOF
3526
3527   cat >> confdefs.h <<\EOF
3528 #define _MINIX 1
3529 EOF
3530
3531 fi
3532
3533
3534 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3535 echo "configure:3536: checking for Cygwin environment" >&5
3536 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3537   echo $ac_n "(cached) $ac_c" 1>&6
3538 else
3539   cat > conftest.$ac_ext <<EOF
3540 #line 3541 "configure"
3541 #include "confdefs.h"
3542
3543 int main() {
3544
3545 #ifndef __CYGWIN__
3546 #define __CYGWIN__ __CYGWIN32__
3547 #endif
3548 return __CYGWIN__;
3549 ; return 0; }
3550 EOF
3551 if { (eval echo configure:3552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3552   rm -rf conftest*
3553   ac_cv_cygwin=yes
3554 else
3555   echo "configure: failed program was:" >&5
3556   cat conftest.$ac_ext >&5
3557   rm -rf conftest*
3558   ac_cv_cygwin=no
3559 fi
3560 rm -f conftest*
3561 fi
3562
3563 echo "$ac_t""$ac_cv_cygwin" 1>&6
3564 CYGWIN=
3565 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3566 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3567 echo "configure:3568: checking for mingw32 environment" >&5
3568 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3569   echo $ac_n "(cached) $ac_c" 1>&6
3570 else
3571   cat > conftest.$ac_ext <<EOF
3572 #line 3573 "configure"
3573 #include "confdefs.h"
3574
3575 int main() {
3576 return __MINGW32__;
3577 ; return 0; }
3578 EOF
3579 if { (eval echo configure:3580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3580   rm -rf conftest*
3581   ac_cv_mingw32=yes
3582 else
3583   echo "configure: failed program was:" >&5
3584   cat conftest.$ac_ext >&5
3585   rm -rf conftest*
3586   ac_cv_mingw32=no
3587 fi
3588 rm -f conftest*
3589 fi
3590
3591 echo "$ac_t""$ac_cv_mingw32" 1>&6
3592 MINGW32=
3593 test "$ac_cv_mingw32" = yes && MINGW32=yes
3594 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3595 echo "configure:3596: checking for EMX OS/2 environment" >&5
3596 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3597   echo $ac_n "(cached) $ac_c" 1>&6
3598 else
3599   cat > conftest.$ac_ext <<EOF
3600 #line 3601 "configure"
3601 #include "confdefs.h"
3602
3603 int main() {
3604 return __EMX__;
3605 ; return 0; }
3606 EOF
3607 if { (eval echo configure:3608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3608   rm -rf conftest*
3609   ac_cv_emxos2=yes
3610 else
3611   echo "configure: failed program was:" >&5
3612   cat conftest.$ac_ext >&5
3613   rm -rf conftest*
3614   ac_cv_emxos2=no
3615 fi
3616 rm -f conftest*
3617 fi
3618
3619 echo "$ac_t""$ac_cv_emxos2" 1>&6
3620 EMXOS2=
3621 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3622
3623
3624
3625 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3626 echo "configure:3627: checking for executable suffix" >&5
3627 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3628   echo $ac_n "(cached) $ac_c" 1>&6
3629 else
3630   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3631   ac_cv_exeext=.exe
3632 else
3633   rm -f conftest*
3634   echo 'int main () { return 0; }' > conftest.$ac_ext
3635   ac_cv_exeext=
3636   if { (eval echo configure:3637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3637     for file in conftest.*; do
3638       case $file in
3639       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3640       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3641       esac
3642     done
3643   else
3644     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3645   fi
3646   rm -f conftest*
3647   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3648 fi
3649 fi
3650
3651 EXEEXT=""
3652 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3653 echo "$ac_t""${ac_cv_exeext}" 1>&6
3654 ac_exeext=$EXEEXT
3655
3656 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3657 echo "configure:3658: checking for object suffix" >&5
3658 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3659   echo $ac_n "(cached) $ac_c" 1>&6
3660 else
3661   rm -f conftest*
3662 echo 'int i = 1;' > conftest.$ac_ext
3663 if { (eval echo configure:3664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3664   for ac_file in conftest.*; do
3665     case $ac_file in
3666     *.c) ;;
3667     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3668     esac
3669   done
3670 else
3671   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3672 fi
3673 rm -f conftest*
3674 fi
3675
3676 echo "$ac_t""$ac_cv_objext" 1>&6
3677 OBJEXT=$ac_cv_objext
3678 ac_objext=$ac_cv_objext
3679
3680
3681 cat >> confdefs.h <<EOF
3682 #define EXEEXT "${EXEEXT}"
3683 EOF
3684
3685
3686 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3687 echo "configure:3688: checking for be_app in -lbe" >&5
3688 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3689 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3690   echo $ac_n "(cached) $ac_c" 1>&6
3691 else
3692   ac_save_LIBS="$LIBS"
3693 LIBS="-lbe -lroot -lnet $LIBS"
3694 cat > conftest.$ac_ext <<EOF
3695 #line 3696 "configure"
3696 #include "confdefs.h"
3697 /* Override any gcc2 internal prototype to avoid an error.  */
3698 /* We use char because int might match the return type of a gcc2
3699     builtin and then its argument prototype would still apply.  */
3700 char be_app();
3701
3702 int main() {
3703 be_app()
3704 ; return 0; }
3705 EOF
3706 if { (eval echo configure:3707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3707   rm -rf conftest*
3708   eval "ac_cv_lib_$ac_lib_var=yes"
3709 else
3710   echo "configure: failed program was:" >&5
3711   cat conftest.$ac_ext >&5
3712   rm -rf conftest*
3713   eval "ac_cv_lib_$ac_lib_var=no"
3714 fi
3715 rm -f conftest*
3716 LIBS="$ac_save_LIBS"
3717
3718 fi
3719 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3720   echo "$ac_t""yes" 1>&6
3721   LIBS="$LIBS -lbe -lroot -lnet"
3722 else
3723   echo "$ac_t""no" 1>&6
3724 :
3725 fi
3726
3727
3728
3729
3730
3731 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3732 echo "configure:3733: checking for ${CC-cc} option to accept ANSI C" >&5
3733 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3734   echo $ac_n "(cached) $ac_c" 1>&6
3735 else
3736   am_cv_prog_cc_stdc=no
3737 ac_save_CC="$CC"
3738 # Don't try gcc -ansi; that turns off useful extensions and
3739 # breaks some systems' header files.
3740 # AIX                   -qlanglvl=ansi
3741 # Ultrix and OSF/1      -std1
3742 # HP-UX 10.20 and later -Ae
3743 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3744 # SVR4                  -Xc -D__EXTENSIONS__
3745 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3746 do
3747   CC="$ac_save_CC $ac_arg"
3748   cat > conftest.$ac_ext <<EOF
3749 #line 3750 "configure"
3750 #include "confdefs.h"
3751 #include <stdarg.h>
3752 #include <stdio.h>
3753 #include <sys/types.h>
3754 #include <sys/stat.h>
3755 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3756 struct buf { int x; };
3757 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3758 static char *e (p, i)
3759      char **p;
3760      int i;
3761 {
3762   return p[i];
3763 }
3764 static char *f (char * (*g) (char **, int), char **p, ...)
3765 {
3766   char *s;
3767   va_list v;
3768   va_start (v,p);
3769   s = g (p, va_arg (v,int));
3770   va_end (v);
3771   return s;
3772 }
3773 int test (int i, double x);
3774 struct s1 {int (*f) (int a);};
3775 struct s2 {int (*f) (double a);};
3776 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3777 int argc;
3778 char **argv;
3779
3780 int main() {
3781
3782 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3783
3784 ; return 0; }
3785 EOF
3786 if { (eval echo configure:3787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3787   rm -rf conftest*
3788   am_cv_prog_cc_stdc="$ac_arg"; break
3789 else
3790   echo "configure: failed program was:" >&5
3791   cat conftest.$ac_ext >&5
3792 fi
3793 rm -f conftest*
3794 done
3795 CC="$ac_save_CC"
3796
3797 fi
3798
3799 if test -z "$am_cv_prog_cc_stdc"; then
3800   echo "$ac_t""none needed" 1>&6
3801 else
3802   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3803 fi
3804 case "x$am_cv_prog_cc_stdc" in
3805   x|xno) ;;
3806   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3807 esac
3808
3809 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3810         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3811 fi
3812
3813 # test for make depend flag
3814 OL_MKDEP=
3815 OL_MKDEP_FLAGS=
3816 if test -z "${MKDEP}"; then
3817         OL_MKDEP="${CC-cc}"
3818         if test -z "${MKDEP_FLAGS}"; then
3819                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3820 echo "configure:3821: checking for ${OL_MKDEP} depend flag" >&5
3821 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3822   echo $ac_n "(cached) $ac_c" 1>&6
3823 else
3824   
3825                         ol_cv_mkdep=no
3826                         for flag in "-M" "-xM"; do
3827                                 cat > conftest.c <<EOF
3828  noCode;
3829 EOF
3830                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3831                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3832                                 then
3833                                         if test ! -f conftest."${ac_object}" ; then
3834                                                 ol_cv_mkdep=$flag
3835                                                 OL_MKDEP_FLAGS="$flag"
3836                                                 break
3837                                         fi
3838                                 fi
3839                         done
3840                         rm -f conftest*
3841                 
3842 fi
3843
3844 echo "$ac_t""$ol_cv_mkdep" 1>&6
3845         else
3846                 cc_cv_mkdep=yes
3847                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3848         fi
3849 else
3850         cc_cv_mkdep=yes
3851         OL_MKDEP="${MKDEP}"
3852         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3853 fi
3854
3855
3856
3857 if test "${ol_cv_mkdep}" = no ; then
3858         # this will soon become an error
3859         echo "configure: warning: do not know how to generate dependencies" 1>&2
3860 fi
3861
3862 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3863 echo "configure:3864: checking for afopen in -ls" >&5
3864 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3866   echo $ac_n "(cached) $ac_c" 1>&6
3867 else
3868   ac_save_LIBS="$LIBS"
3869 LIBS="-ls  $LIBS"
3870 cat > conftest.$ac_ext <<EOF
3871 #line 3872 "configure"
3872 #include "confdefs.h"
3873 /* Override any gcc2 internal prototype to avoid an error.  */
3874 /* We use char because int might match the return type of a gcc2
3875     builtin and then its argument prototype would still apply.  */
3876 char afopen();
3877
3878 int main() {
3879 afopen()
3880 ; return 0; }
3881 EOF
3882 if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3883   rm -rf conftest*
3884   eval "ac_cv_lib_$ac_lib_var=yes"
3885 else
3886   echo "configure: failed program was:" >&5
3887   cat conftest.$ac_ext >&5
3888   rm -rf conftest*
3889   eval "ac_cv_lib_$ac_lib_var=no"
3890 fi
3891 rm -f conftest*
3892 LIBS="$ac_save_LIBS"
3893
3894 fi
3895 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3896   echo "$ac_t""yes" 1>&6
3897   
3898         AUTH_LIBS=-ls
3899         cat >> confdefs.h <<\EOF
3900 #define HAVE_AIX_SECURITY 1
3901 EOF
3902
3903
3904 else
3905   echo "$ac_t""no" 1>&6
3906 fi
3907
3908
3909
3910 ol_link_modules=no
3911 if test $ol_enable_modules != no ; then
3912         for ac_hdr in ltdl.h
3913 do
3914 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3915 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3916 echo "configure:3917: checking for $ac_hdr" >&5
3917 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3918   echo $ac_n "(cached) $ac_c" 1>&6
3919 else
3920   cat > conftest.$ac_ext <<EOF
3921 #line 3922 "configure"
3922 #include "confdefs.h"
3923 #include <$ac_hdr>
3924 EOF
3925 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3926 { (eval echo configure:3927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3927 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3928 if test -z "$ac_err"; then
3929   rm -rf conftest*
3930   eval "ac_cv_header_$ac_safe=yes"
3931 else
3932   echo "$ac_err" >&5
3933   echo "configure: failed program was:" >&5
3934   cat conftest.$ac_ext >&5
3935   rm -rf conftest*
3936   eval "ac_cv_header_$ac_safe=no"
3937 fi
3938 rm -f conftest*
3939 fi
3940 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3941   echo "$ac_t""yes" 1>&6
3942     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3943   cat >> confdefs.h <<EOF
3944 #define $ac_tr_hdr 1
3945 EOF
3946  
3947 else
3948   echo "$ac_t""no" 1>&6
3949 fi
3950 done
3951
3952
3953         if test $ac_cv_header_ltdl_h = no ; then
3954                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3955         fi
3956
3957         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3958 echo "configure:3959: checking for lt_dlinit in -lltdl" >&5
3959 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3960 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3961   echo $ac_n "(cached) $ac_c" 1>&6
3962 else
3963   ac_save_LIBS="$LIBS"
3964 LIBS="-lltdl  $LIBS"
3965 cat > conftest.$ac_ext <<EOF
3966 #line 3967 "configure"
3967 #include "confdefs.h"
3968 /* Override any gcc2 internal prototype to avoid an error.  */
3969 /* We use char because int might match the return type of a gcc2
3970     builtin and then its argument prototype would still apply.  */
3971 char lt_dlinit();
3972
3973 int main() {
3974 lt_dlinit()
3975 ; return 0; }
3976 EOF
3977 if { (eval echo configure:3978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3978   rm -rf conftest*
3979   eval "ac_cv_lib_$ac_lib_var=yes"
3980 else
3981   echo "configure: failed program was:" >&5
3982   cat conftest.$ac_ext >&5
3983   rm -rf conftest*
3984   eval "ac_cv_lib_$ac_lib_var=no"
3985 fi
3986 rm -f conftest*
3987 LIBS="$ac_save_LIBS"
3988
3989 fi
3990 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3991   echo "$ac_t""yes" 1>&6
3992   
3993             MODULES_LIBS=-lltdl
3994             cat >> confdefs.h <<\EOF
3995 #define HAVE_LIBLTDL 1
3996 EOF
3997
3998         
3999 else
4000   echo "$ac_t""no" 1>&6
4001 fi
4002
4003
4004         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4005                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4006         fi
4007         ol_link_modules=yes
4008 else
4009         ol_with_dnssrv_module=static
4010         ol_with_ldap_module=static
4011         ol_with_ldbm_module=static
4012         ol_with_passwd_module=static
4013         ol_with_shell_module=static
4014         ol_with_sql_module=static
4015 fi
4016
4017 # test for EBCDIC
4018 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4019 echo "configure:4020: checking for EBCDIC" >&5
4020 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4021   echo $ac_n "(cached) $ac_c" 1>&6
4022 else
4023   
4024         cat > conftest.$ac_ext <<EOF
4025 #line 4026 "configure"
4026 #include "confdefs.h"
4027
4028 #if !('M' == 0xd4)
4029 #include <__ASCII__/generate_error.h>
4030 #endif
4031
4032 EOF
4033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4034 { (eval echo configure:4035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4036 if test -z "$ac_err"; then
4037   rm -rf conftest*
4038   ol_cv_cpp_ebcdic=yes
4039 else
4040   echo "$ac_err" >&5
4041   echo "configure: failed program was:" >&5
4042   cat conftest.$ac_ext >&5
4043   rm -rf conftest*
4044   ol_cv_cpp_ebcdic=no
4045 fi
4046 rm -f conftest*
4047 fi
4048
4049 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4050 if test $ol_cv_cpp_ebcdic = yes ; then
4051         cat >> confdefs.h <<\EOF
4052 #define HAVE_EBCDIC 1
4053 EOF
4054
4055 fi
4056
4057 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4058 echo "configure:4059: checking for ANSI C header files" >&5
4059 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4060   echo $ac_n "(cached) $ac_c" 1>&6
4061 else
4062   cat > conftest.$ac_ext <<EOF
4063 #line 4064 "configure"
4064 #include "confdefs.h"
4065 #include <stdlib.h>
4066 #include <stdarg.h>
4067 #include <string.h>
4068 #include <float.h>
4069 EOF
4070 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4071 { (eval echo configure:4072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4072 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4073 if test -z "$ac_err"; then
4074   rm -rf conftest*
4075   ol_cv_header_stdc=yes
4076 else
4077   echo "$ac_err" >&5
4078   echo "configure: failed program was:" >&5
4079   cat conftest.$ac_ext >&5
4080   rm -rf conftest*
4081   ol_cv_header_stdc=no
4082 fi
4083 rm -f conftest*
4084
4085 if test $ol_cv_header_stdc = yes; then
4086   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4087 cat > conftest.$ac_ext <<EOF
4088 #line 4089 "configure"
4089 #include "confdefs.h"
4090 #include <string.h>
4091 EOF
4092 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4093   egrep "memchr" >/dev/null 2>&1; then
4094   :
4095 else
4096   rm -rf conftest*
4097   ol_cv_header_stdc=no
4098 fi
4099 rm -f conftest*
4100
4101 fi
4102
4103 if test $ol_cv_header_stdc = yes; then
4104   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4105 cat > conftest.$ac_ext <<EOF
4106 #line 4107 "configure"
4107 #include "confdefs.h"
4108 #include <stdlib.h>
4109 EOF
4110 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4111   egrep "free" >/dev/null 2>&1; then
4112   :
4113 else
4114   rm -rf conftest*
4115   ol_cv_header_stdc=no
4116 fi
4117 rm -f conftest*
4118
4119 fi
4120
4121 if test $ol_cv_header_stdc = yes; then
4122   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4123 if test "$cross_compiling" = yes; then
4124   :
4125 else
4126   cat > conftest.$ac_ext <<EOF
4127 #line 4128 "configure"
4128 #include "confdefs.h"
4129 #include <ctype.h>
4130 #ifndef HAVE_EBCDIC
4131 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4132 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4133 #else
4134 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4135                 || ('j' <= (c) && (c) <= 'r') \
4136                 || ('s' <= (c) && (c) <= 'z'))
4137 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4138 #endif
4139 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4140 int main () { int i; for (i = 0; i < 256; i++)
4141 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4142 exit (0); }
4143
4144 EOF
4145 if { (eval echo configure:4146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4146 then
4147   :
4148 else
4149   echo "configure: failed program was:" >&5
4150   cat conftest.$ac_ext >&5
4151   rm -fr conftest*
4152   ol_cv_header_stdc=no
4153 fi
4154 rm -fr conftest*
4155 fi
4156
4157 fi
4158 fi
4159
4160 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4161 if test $ol_cv_header_stdc = yes; then
4162   cat >> confdefs.h <<\EOF
4163 #define STDC_HEADERS 1
4164 EOF
4165
4166 fi
4167 ac_cv_header_stdc=disable
4168
4169
4170 if test $ol_cv_header_stdc != yes; then
4171         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4172 fi
4173
4174 ac_header_dirent=no
4175 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4176 do
4177 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4178 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4179 echo "configure:4180: checking for $ac_hdr that defines DIR" >&5
4180 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4181   echo $ac_n "(cached) $ac_c" 1>&6
4182 else
4183   cat > conftest.$ac_ext <<EOF
4184 #line 4185 "configure"
4185 #include "confdefs.h"
4186 #include <sys/types.h>
4187 #include <$ac_hdr>
4188 int main() {
4189 DIR *dirp = 0;
4190 ; return 0; }
4191 EOF
4192 if { (eval echo configure:4193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4193   rm -rf conftest*
4194   eval "ac_cv_header_dirent_$ac_safe=yes"
4195 else
4196   echo "configure: failed program was:" >&5
4197   cat conftest.$ac_ext >&5
4198   rm -rf conftest*
4199   eval "ac_cv_header_dirent_$ac_safe=no"
4200 fi
4201 rm -f conftest*
4202 fi
4203 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4204   echo "$ac_t""yes" 1>&6
4205     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4206   cat >> confdefs.h <<EOF
4207 #define $ac_tr_hdr 1
4208 EOF
4209  ac_header_dirent=$ac_hdr; break
4210 else
4211   echo "$ac_t""no" 1>&6
4212 fi
4213 done
4214 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4215 if test $ac_header_dirent = dirent.h; then
4216 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4217 echo "configure:4218: checking for opendir in -ldir" >&5
4218 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4219 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4220   echo $ac_n "(cached) $ac_c" 1>&6
4221 else
4222   ac_save_LIBS="$LIBS"
4223 LIBS="-ldir  $LIBS"
4224 cat > conftest.$ac_ext <<EOF
4225 #line 4226 "configure"
4226 #include "confdefs.h"
4227 /* Override any gcc2 internal prototype to avoid an error.  */
4228 /* We use char because int might match the return type of a gcc2
4229     builtin and then its argument prototype would still apply.  */
4230 char opendir();
4231
4232 int main() {
4233 opendir()
4234 ; return 0; }
4235 EOF
4236 if { (eval echo configure:4237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4237   rm -rf conftest*
4238   eval "ac_cv_lib_$ac_lib_var=yes"
4239 else
4240   echo "configure: failed program was:" >&5
4241   cat conftest.$ac_ext >&5
4242   rm -rf conftest*
4243   eval "ac_cv_lib_$ac_lib_var=no"
4244 fi
4245 rm -f conftest*
4246 LIBS="$ac_save_LIBS"
4247
4248 fi
4249 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4250   echo "$ac_t""yes" 1>&6
4251   LIBS="$LIBS -ldir"
4252 else
4253   echo "$ac_t""no" 1>&6
4254 fi
4255
4256 else
4257 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4258 echo "configure:4259: checking for opendir in -lx" >&5
4259 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4260 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4261   echo $ac_n "(cached) $ac_c" 1>&6
4262 else
4263   ac_save_LIBS="$LIBS"
4264 LIBS="-lx  $LIBS"
4265 cat > conftest.$ac_ext <<EOF
4266 #line 4267 "configure"
4267 #include "confdefs.h"
4268 /* Override any gcc2 internal prototype to avoid an error.  */
4269 /* We use char because int might match the return type of a gcc2
4270     builtin and then its argument prototype would still apply.  */
4271 char opendir();
4272
4273 int main() {
4274 opendir()
4275 ; return 0; }
4276 EOF
4277 if { (eval echo configure:4278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4278   rm -rf conftest*
4279   eval "ac_cv_lib_$ac_lib_var=yes"
4280 else
4281   echo "configure: failed program was:" >&5
4282   cat conftest.$ac_ext >&5
4283   rm -rf conftest*
4284   eval "ac_cv_lib_$ac_lib_var=no"
4285 fi
4286 rm -f conftest*
4287 LIBS="$ac_save_LIBS"
4288
4289 fi
4290 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4291   echo "$ac_t""yes" 1>&6
4292   LIBS="$LIBS -lx"
4293 else
4294   echo "$ac_t""no" 1>&6
4295 fi
4296
4297 fi
4298
4299 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4300 echo "configure:4301: checking for sys/wait.h that is POSIX.1 compatible" >&5
4301 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4302   echo $ac_n "(cached) $ac_c" 1>&6
4303 else
4304   cat > conftest.$ac_ext <<EOF
4305 #line 4306 "configure"
4306 #include "confdefs.h"
4307 #include <sys/types.h>
4308 #include <sys/wait.h>
4309 #ifndef WEXITSTATUS
4310 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4311 #endif
4312 #ifndef WIFEXITED
4313 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4314 #endif
4315 int main() {
4316 int s;
4317 wait (&s);
4318 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4319 ; return 0; }
4320 EOF
4321 if { (eval echo configure:4322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4322   rm -rf conftest*
4323   ac_cv_header_sys_wait_h=yes
4324 else
4325   echo "configure: failed program was:" >&5
4326   cat conftest.$ac_ext >&5
4327   rm -rf conftest*
4328   ac_cv_header_sys_wait_h=no
4329 fi
4330 rm -f conftest*
4331 fi
4332
4333 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4334 if test $ac_cv_header_sys_wait_h = yes; then
4335   cat >> confdefs.h <<\EOF
4336 #define HAVE_SYS_WAIT_H 1
4337 EOF
4338
4339 fi
4340
4341 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4342 echo "configure:4343: checking POSIX termios" >&5
4343 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4344   echo $ac_n "(cached) $ac_c" 1>&6
4345 else
4346   cat > conftest.$ac_ext <<EOF
4347 #line 4348 "configure"
4348 #include "confdefs.h"
4349 #include <sys/types.h>
4350 #include <unistd.h>
4351 #include <termios.h>
4352 int main() {
4353 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4354    tcgetattr(0, 0);
4355 ; return 0; }
4356 EOF
4357 if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4358   rm -rf conftest*
4359   am_cv_sys_posix_termios=yes
4360 else
4361   echo "configure: failed program was:" >&5
4362   cat conftest.$ac_ext >&5
4363   rm -rf conftest*
4364   am_cv_sys_posix_termios=no
4365 fi
4366 rm -f conftest*
4367 fi
4368
4369 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4370
4371
4372  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4373 echo "configure:4374: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4374 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4375   echo $ac_n "(cached) $ac_c" 1>&6
4376 else
4377   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4378
4379   gwinsz_in_termios_h=no
4380   if test $am_cv_sys_posix_termios = yes; then
4381     cat > conftest.$ac_ext <<EOF
4382 #line 4383 "configure"
4383 #include "confdefs.h"
4384 #include <sys/types.h>
4385 #     include <termios.h>
4386 #     ifdef TIOCGWINSZ
4387         yes
4388 #     endif
4389     
4390 EOF
4391 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4392   egrep "yes" >/dev/null 2>&1; then
4393   rm -rf conftest*
4394   gwinsz_in_termios_h=yes
4395 fi
4396 rm -f conftest*
4397
4398   fi
4399
4400   if test $gwinsz_in_termios_h = no; then
4401     cat > conftest.$ac_ext <<EOF
4402 #line 4403 "configure"
4403 #include "confdefs.h"
4404 #include <sys/types.h>
4405 #     include <sys/ioctl.h>
4406 #     ifdef TIOCGWINSZ
4407         yes
4408 #     endif
4409     
4410 EOF
4411 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4412   egrep "yes" >/dev/null 2>&1; then
4413   rm -rf conftest*
4414   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4415 fi
4416 rm -f conftest*
4417
4418   fi
4419   
4420 fi
4421
4422 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4423   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4424     cat >> confdefs.h <<\EOF
4425 #define GWINSZ_IN_SYS_IOCTL 1
4426 EOF
4427
4428   fi
4429
4430 if test $am_cv_sys_posix_termios = yes ; then
4431         cat >> confdefs.h <<\EOF
4432 #define HAVE_POSIX_TERMIOS 1
4433 EOF
4434
4435 fi
4436
4437 for ac_hdr in \
4438         arpa/inet.h             \
4439         arpa/nameser.h  \
4440         assert.h                \
4441         conio.h                 \
4442         crypt.h                 \
4443         direct.h                \
4444         errno.h                 \
4445         fcntl.h                 \
4446         filio.h                 \
4447         getopt.h                \
4448         grp.h                   \
4449         io.h                    \
4450         libutil.h               \
4451         limits.h                \
4452         locale.h                \
4453         netinet/tcp.h   \
4454         malloc.h                \
4455         memory.h                \
4456         psap.h                  \
4457         pwd.h                   \
4458         process.h               \
4459         resolv.h                \
4460         sgtty.h                 \
4461         shadow.h                \
4462         stddef.h                \
4463         string.h                \
4464         strings.h               \
4465         sysexits.h              \
4466         sys/file.h              \
4467         sys/filio.h             \
4468         sys/errno.h             \
4469         sys/ioctl.h             \
4470         sys/param.h             \
4471         sys/resource.h  \
4472         sys/select.h    \
4473         sys/socket.h    \
4474         sys/syslog.h    \
4475         sys/time.h              \
4476         sys/types.h             \
4477         syslog.h                \
4478         termios.h               \
4479         unistd.h                \
4480         winsock.h               \
4481
4482 do
4483 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4484 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4485 echo "configure:4486: checking for $ac_hdr" >&5
4486 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4487   echo $ac_n "(cached) $ac_c" 1>&6
4488 else
4489   cat > conftest.$ac_ext <<EOF
4490 #line 4491 "configure"
4491 #include "confdefs.h"
4492 #include <$ac_hdr>
4493 EOF
4494 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4495 { (eval echo configure:4496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4496 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4497 if test -z "$ac_err"; then
4498   rm -rf conftest*
4499   eval "ac_cv_header_$ac_safe=yes"
4500 else
4501   echo "$ac_err" >&5
4502   echo "configure: failed program was:" >&5
4503   cat conftest.$ac_ext >&5
4504   rm -rf conftest*
4505   eval "ac_cv_header_$ac_safe=no"
4506 fi
4507 rm -f conftest*
4508 fi
4509 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4510   echo "$ac_t""yes" 1>&6
4511     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4512   cat >> confdefs.h <<EOF
4513 #define $ac_tr_hdr 1
4514 EOF
4515  
4516 else
4517   echo "$ac_t""no" 1>&6
4518 fi
4519 done
4520
4521
4522
4523
4524 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4525 echo "configure:4526: checking for dlopen" >&5
4526 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4527   echo $ac_n "(cached) $ac_c" 1>&6
4528 else
4529   cat > conftest.$ac_ext <<EOF
4530 #line 4531 "configure"
4531 #include "confdefs.h"
4532 /* System header to define __stub macros and hopefully few prototypes,
4533     which can conflict with char dlopen(); below.  */
4534 #include <assert.h>
4535 /* Override any gcc2 internal prototype to avoid an error.  */
4536 /* We use char because int might match the return type of a gcc2
4537     builtin and then its argument prototype would still apply.  */
4538 char dlopen();
4539 char (*f)();
4540
4541 int main() {
4542
4543 /* The GNU C library defines this for functions which it implements
4544     to always fail with ENOSYS.  Some functions are actually named
4545     something starting with __ and the normal name is an alias.  */
4546 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4547 choke me
4548 #else
4549 f = dlopen;
4550 #endif
4551
4552 ; return 0; }
4553 EOF
4554 if { (eval echo configure:4555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4555   rm -rf conftest*
4556   eval "ac_cv_func_dlopen=yes"
4557 else
4558   echo "configure: failed program was:" >&5
4559   cat conftest.$ac_ext >&5
4560   rm -rf conftest*
4561   eval "ac_cv_func_dlopen=no"
4562 fi
4563 rm -f conftest*
4564 fi
4565
4566 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4567   echo "$ac_t""yes" 1>&6
4568   :
4569 else
4570   echo "$ac_t""no" 1>&6
4571 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4572 echo "configure:4573: checking for dlopen in -ldl" >&5
4573 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4574 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4575   echo $ac_n "(cached) $ac_c" 1>&6
4576 else
4577   ac_save_LIBS="$LIBS"
4578 LIBS="-ldl  $LIBS"
4579 cat > conftest.$ac_ext <<EOF
4580 #line 4581 "configure"
4581 #include "confdefs.h"
4582 /* Override any gcc2 internal prototype to avoid an error.  */
4583 /* We use char because int might match the return type of a gcc2
4584     builtin and then its argument prototype would still apply.  */
4585 char dlopen();
4586
4587 int main() {
4588 dlopen()
4589 ; return 0; }
4590 EOF
4591 if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4592   rm -rf conftest*
4593   eval "ac_cv_lib_$ac_lib_var=yes"
4594 else
4595   echo "configure: failed program was:" >&5
4596   cat conftest.$ac_ext >&5
4597   rm -rf conftest*
4598   eval "ac_cv_lib_$ac_lib_var=no"
4599 fi
4600 rm -f conftest*
4601 LIBS="$ac_save_LIBS"
4602
4603 fi
4604 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4605   echo "$ac_t""yes" 1>&6
4606     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4607     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4608   cat >> confdefs.h <<EOF
4609 #define $ac_tr_lib 1
4610 EOF
4611
4612   LIBS="-ldl $LIBS"
4613
4614 else
4615   echo "$ac_t""no" 1>&6
4616 fi
4617
4618 fi
4619
4620
4621 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4622 echo "configure:4623: checking for sigset in -lV3" >&5
4623 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4624 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4625   echo $ac_n "(cached) $ac_c" 1>&6
4626 else
4627   ac_save_LIBS="$LIBS"
4628 LIBS="-lV3  $LIBS"
4629 cat > conftest.$ac_ext <<EOF
4630 #line 4631 "configure"
4631 #include "confdefs.h"
4632 /* Override any gcc2 internal prototype to avoid an error.  */
4633 /* We use char because int might match the return type of a gcc2
4634     builtin and then its argument prototype would still apply.  */
4635 char sigset();
4636
4637 int main() {
4638 sigset()
4639 ; return 0; }
4640 EOF
4641 if { (eval echo configure:4642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4642   rm -rf conftest*
4643   eval "ac_cv_lib_$ac_lib_var=yes"
4644 else
4645   echo "configure: failed program was:" >&5
4646   cat conftest.$ac_ext >&5
4647   rm -rf conftest*
4648   eval "ac_cv_lib_$ac_lib_var=no"
4649 fi
4650 rm -f conftest*
4651 LIBS="$ac_save_LIBS"
4652
4653 fi
4654 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4655   echo "$ac_t""yes" 1>&6
4656     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4657     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4658   cat >> confdefs.h <<EOF
4659 #define $ac_tr_lib 1
4660 EOF
4661
4662   LIBS="-lV3 $LIBS"
4663
4664 else
4665   echo "$ac_t""no" 1>&6
4666 fi
4667
4668
4669 if test $ac_cv_header_winsock_h = yes; then
4670         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4671 echo "configure:4672: checking for winsock" >&5
4672 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4673   echo $ac_n "(cached) $ac_c" 1>&6
4674 else
4675   cat > conftest.$ac_ext <<EOF
4676 #line 4677 "configure"
4677 #include "confdefs.h"
4678 #include <winsock.h>
4679 int main() {
4680
4681                         socket(0,0,0);
4682                         select(0,NULL,NULL,NULL,NULL);
4683                         closesocket(0);
4684                         gethostname(NULL,0);
4685         
4686 ; return 0; }
4687 EOF
4688 if { (eval echo configure:4689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4689   rm -rf conftest*
4690   ol_cv_winsock=yes
4691 else
4692   echo "configure: failed program was:" >&5
4693   cat conftest.$ac_ext >&5
4694   rm -rf conftest*
4695   ol_cv_winsock=no
4696 fi
4697 rm -f conftest*
4698 fi
4699
4700 echo "$ac_t""$ol_cv_winsock" 1>&6
4701
4702         if test $ol_cv_winsock = yes ; then
4703                 cat >> confdefs.h <<\EOF
4704 #define HAVE_WINSOCK 1
4705 EOF
4706
4707                 ac_cv_func_socket=yes
4708                 ac_cv_func_select=yes
4709                 ac_cv_func_closesocket=yes
4710                 ac_cv_func_gethostname=yes
4711         fi
4712 fi
4713
4714
4715 echo $ac_n "checking for socket""... $ac_c" 1>&6
4716 echo "configure:4717: checking for socket" >&5
4717 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4718   echo $ac_n "(cached) $ac_c" 1>&6
4719 else
4720   cat > conftest.$ac_ext <<EOF
4721 #line 4722 "configure"
4722 #include "confdefs.h"
4723 /* System header to define __stub macros and hopefully few prototypes,
4724     which can conflict with char socket(); below.  */
4725 #include <assert.h>
4726 /* Override any gcc2 internal prototype to avoid an error.  */
4727 /* We use char because int might match the return type of a gcc2
4728     builtin and then its argument prototype would still apply.  */
4729 char socket();
4730 char (*f)();
4731
4732 int main() {
4733
4734 /* The GNU C library defines this for functions which it implements
4735     to always fail with ENOSYS.  Some functions are actually named
4736     something starting with __ and the normal name is an alias.  */
4737 #if defined (__stub_socket) || defined (__stub___socket)
4738 choke me
4739 #else
4740 f = socket;
4741 #endif
4742
4743 ; return 0; }
4744 EOF
4745 if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4746   rm -rf conftest*
4747   eval "ac_cv_func_socket=yes"
4748 else
4749   echo "configure: failed program was:" >&5
4750   cat conftest.$ac_ext >&5
4751   rm -rf conftest*
4752   eval "ac_cv_func_socket=no"
4753 fi
4754 rm -f conftest*
4755 fi
4756
4757 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4758   echo "$ac_t""yes" 1>&6
4759   :
4760 else
4761   echo "$ac_t""no" 1>&6
4762         
4763         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4764 echo "configure:4765: checking for main in -lsocket" >&5
4765 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4766 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4767   echo $ac_n "(cached) $ac_c" 1>&6
4768 else
4769   ac_save_LIBS="$LIBS"
4770 LIBS="-lsocket  $LIBS"
4771 cat > conftest.$ac_ext <<EOF
4772 #line 4773 "configure"
4773 #include "confdefs.h"
4774
4775 int main() {
4776 main()
4777 ; return 0; }
4778 EOF
4779 if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4780   rm -rf conftest*
4781   eval "ac_cv_lib_$ac_lib_var=yes"
4782 else
4783   echo "configure: failed program was:" >&5
4784   cat conftest.$ac_ext >&5
4785   rm -rf conftest*
4786   eval "ac_cv_lib_$ac_lib_var=no"
4787 fi
4788 rm -f conftest*
4789 LIBS="$ac_save_LIBS"
4790
4791 fi
4792 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4793   echo "$ac_t""yes" 1>&6
4794     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4795     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4796   cat >> confdefs.h <<EOF
4797 #define $ac_tr_lib 1
4798 EOF
4799
4800   LIBS="-lsocket $LIBS"
4801
4802 else
4803   echo "$ac_t""no" 1>&6
4804 fi
4805
4806         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4807 echo "configure:4808: checking for main in -lnet" >&5
4808 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4809 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4810   echo $ac_n "(cached) $ac_c" 1>&6
4811 else
4812   ac_save_LIBS="$LIBS"
4813 LIBS="-lnet  $LIBS"
4814 cat > conftest.$ac_ext <<EOF
4815 #line 4816 "configure"
4816 #include "confdefs.h"
4817
4818 int main() {
4819 main()
4820 ; return 0; }
4821 EOF
4822 if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4823   rm -rf conftest*
4824   eval "ac_cv_lib_$ac_lib_var=yes"
4825 else
4826   echo "configure: failed program was:" >&5
4827   cat conftest.$ac_ext >&5
4828   rm -rf conftest*
4829   eval "ac_cv_lib_$ac_lib_var=no"
4830 fi
4831 rm -f conftest*
4832 LIBS="$ac_save_LIBS"
4833
4834 fi
4835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4836   echo "$ac_t""yes" 1>&6
4837     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4838     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4839   cat >> confdefs.h <<EOF
4840 #define $ac_tr_lib 1
4841 EOF
4842
4843   LIBS="-lnet $LIBS"
4844
4845 else
4846   echo "$ac_t""no" 1>&6
4847 fi
4848
4849         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4850 echo "configure:4851: checking for main in -lnsl_s" >&5
4851 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4852 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4853   echo $ac_n "(cached) $ac_c" 1>&6
4854 else
4855   ac_save_LIBS="$LIBS"
4856 LIBS="-lnsl_s  $LIBS"
4857 cat > conftest.$ac_ext <<EOF
4858 #line 4859 "configure"
4859 #include "confdefs.h"
4860
4861 int main() {
4862 main()
4863 ; return 0; }
4864 EOF
4865 if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4866   rm -rf conftest*
4867   eval "ac_cv_lib_$ac_lib_var=yes"
4868 else
4869   echo "configure: failed program was:" >&5
4870   cat conftest.$ac_ext >&5
4871   rm -rf conftest*
4872   eval "ac_cv_lib_$ac_lib_var=no"
4873 fi
4874 rm -f conftest*
4875 LIBS="$ac_save_LIBS"
4876
4877 fi
4878 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4879   echo "$ac_t""yes" 1>&6
4880     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4881     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4882   cat >> confdefs.h <<EOF
4883 #define $ac_tr_lib 1
4884 EOF
4885
4886   LIBS="-lnsl_s $LIBS"
4887
4888 else
4889   echo "$ac_t""no" 1>&6
4890 fi
4891
4892         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4893 echo "configure:4894: checking for main in -lnsl" >&5
4894 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4895 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4896   echo $ac_n "(cached) $ac_c" 1>&6
4897 else
4898   ac_save_LIBS="$LIBS"
4899 LIBS="-lnsl  $LIBS"
4900 cat > conftest.$ac_ext <<EOF
4901 #line 4902 "configure"
4902 #include "confdefs.h"
4903
4904 int main() {
4905 main()
4906 ; return 0; }
4907 EOF
4908 if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4909   rm -rf conftest*
4910   eval "ac_cv_lib_$ac_lib_var=yes"
4911 else
4912   echo "configure: failed program was:" >&5
4913   cat conftest.$ac_ext >&5
4914   rm -rf conftest*
4915   eval "ac_cv_lib_$ac_lib_var=no"
4916 fi
4917 rm -f conftest*
4918 LIBS="$ac_save_LIBS"
4919
4920 fi
4921 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4922   echo "$ac_t""yes" 1>&6
4923     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4924     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4925   cat >> confdefs.h <<EOF
4926 #define $ac_tr_lib 1
4927 EOF
4928
4929   LIBS="-lnsl $LIBS"
4930
4931 else
4932   echo "$ac_t""no" 1>&6
4933 fi
4934
4935         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4936 echo "configure:4937: checking for socket in -linet" >&5
4937 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4938 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4939   echo $ac_n "(cached) $ac_c" 1>&6
4940 else
4941   ac_save_LIBS="$LIBS"
4942 LIBS="-linet  $LIBS"
4943 cat > conftest.$ac_ext <<EOF
4944 #line 4945 "configure"
4945 #include "confdefs.h"
4946 /* Override any gcc2 internal prototype to avoid an error.  */
4947 /* We use char because int might match the return type of a gcc2
4948     builtin and then its argument prototype would still apply.  */
4949 char socket();
4950
4951 int main() {
4952 socket()
4953 ; return 0; }
4954 EOF
4955 if { (eval echo configure:4956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4956   rm -rf conftest*
4957   eval "ac_cv_lib_$ac_lib_var=yes"
4958 else
4959   echo "configure: failed program was:" >&5
4960   cat conftest.$ac_ext >&5
4961   rm -rf conftest*
4962   eval "ac_cv_lib_$ac_lib_var=no"
4963 fi
4964 rm -f conftest*
4965 LIBS="$ac_save_LIBS"
4966
4967 fi
4968 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4969   echo "$ac_t""yes" 1>&6
4970     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4971     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4972   cat >> confdefs.h <<EOF
4973 #define $ac_tr_lib 1
4974 EOF
4975
4976   LIBS="-linet $LIBS"
4977
4978 else
4979   echo "$ac_t""no" 1>&6
4980 fi
4981
4982         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4983 echo "configure:4984: checking for main in -lgen" >&5
4984 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4985 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4986   echo $ac_n "(cached) $ac_c" 1>&6
4987 else
4988   ac_save_LIBS="$LIBS"
4989 LIBS="-lgen  $LIBS"
4990 cat > conftest.$ac_ext <<EOF
4991 #line 4992 "configure"
4992 #include "confdefs.h"
4993
4994 int main() {
4995 main()
4996 ; return 0; }
4997 EOF
4998 if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4999   rm -rf conftest*
5000   eval "ac_cv_lib_$ac_lib_var=yes"
5001 else
5002   echo "configure: failed program was:" >&5
5003   cat conftest.$ac_ext >&5
5004   rm -rf conftest*
5005   eval "ac_cv_lib_$ac_lib_var=no"
5006 fi
5007 rm -f conftest*
5008 LIBS="$ac_save_LIBS"
5009
5010 fi
5011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5012   echo "$ac_t""yes" 1>&6
5013     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5014     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5015   cat >> confdefs.h <<EOF
5016 #define $ac_tr_lib 1
5017 EOF
5018
5019   LIBS="-lgen $LIBS"
5020
5021 else
5022   echo "$ac_t""no" 1>&6
5023 fi
5024
5025
5026 fi
5027
5028
5029 echo $ac_n "checking for select""... $ac_c" 1>&6
5030 echo "configure:5031: checking for select" >&5
5031 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5032   echo $ac_n "(cached) $ac_c" 1>&6
5033 else
5034   cat > conftest.$ac_ext <<EOF
5035 #line 5036 "configure"
5036 #include "confdefs.h"
5037 /* System header to define __stub macros and hopefully few prototypes,
5038     which can conflict with char select(); below.  */
5039 #include <assert.h>
5040 /* Override any gcc2 internal prototype to avoid an error.  */
5041 /* We use char because int might match the return type of a gcc2
5042     builtin and then its argument prototype would still apply.  */
5043 char select();
5044 char (*f)();
5045
5046 int main() {
5047
5048 /* The GNU C library defines this for functions which it implements
5049     to always fail with ENOSYS.  Some functions are actually named
5050     something starting with __ and the normal name is an alias.  */
5051 #if defined (__stub_select) || defined (__stub___select)
5052 choke me
5053 #else
5054 f = select;
5055 #endif
5056
5057 ; return 0; }
5058 EOF
5059 if { (eval echo configure:5060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5060   rm -rf conftest*
5061   eval "ac_cv_func_select=yes"
5062 else
5063   echo "configure: failed program was:" >&5
5064   cat conftest.$ac_ext >&5
5065   rm -rf conftest*
5066   eval "ac_cv_func_select=no"
5067 fi
5068 rm -f conftest*
5069 fi
5070
5071 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5072   echo "$ac_t""yes" 1>&6
5073   :
5074 else
5075   echo "$ac_t""no" 1>&6
5076 { echo "configure: error: select() required." 1>&2; exit 1; }
5077 fi
5078
5079
5080 if test "${ac_cv_header_winsock_h}" != yes; then
5081                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5082 echo "configure:5083: checking types of arguments for select()" >&5
5083  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5084   echo $ac_n "(cached) $ac_c" 1>&6
5085 else
5086    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5087   echo $ac_n "(cached) $ac_c" 1>&6
5088 else
5089     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5090   echo $ac_n "(cached) $ac_c" 1>&6
5091 else
5092      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5093      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5094       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5095        cat > conftest.$ac_ext <<EOF
5096 #line 5097 "configure"
5097 #include "confdefs.h"
5098 #ifdef HAVE_SYS_TYPES_H
5099 #include <sys/types.h>
5100 #endif
5101 #ifdef HAVE_SYS_TIME_H
5102 #include <sys/time.h>
5103 #endif
5104 #ifdef HAVE_SYS_SELECT_H
5105 #include <sys/select.h>
5106 #endif
5107 #ifdef HAVE_SYS_SOCKET_H
5108 #include <sys/socket.h>
5109 #endif
5110 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);
5111 int main() {
5112
5113 ; return 0; }
5114 EOF
5115 if { (eval echo configure:5116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5116   rm -rf conftest*
5117           ac_not_found=no ; break 3
5118 else
5119   echo "configure: failed program was:" >&5
5120   cat conftest.$ac_ext >&5
5121   rm -rf conftest*
5122   ac_not_found=yes
5123 fi
5124 rm -f conftest*
5125       done
5126      done
5127     done
5128    
5129 fi
5130   
5131 fi
5132  
5133 fi
5134  if test "$ac_not_found" = yes; then
5135   ac_cv_func_select_arg1=int 
5136   ac_cv_func_select_arg234='int *' 
5137   ac_cv_func_select_arg5='struct timeval *'
5138  fi
5139  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5140  cat >> confdefs.h <<EOF
5141 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5142 EOF
5143
5144  cat >> confdefs.h <<EOF
5145 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5146 EOF
5147
5148  cat >> confdefs.h <<EOF
5149 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5150 EOF
5151
5152
5153 fi
5154
5155
5156 for ac_hdr in regex.h 
5157 do
5158 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5159 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5160 echo "configure:5161: checking for $ac_hdr" >&5
5161 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5162   echo $ac_n "(cached) $ac_c" 1>&6
5163 else
5164   cat > conftest.$ac_ext <<EOF
5165 #line 5166 "configure"
5166 #include "confdefs.h"
5167 #include <$ac_hdr>
5168 EOF
5169 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5170 { (eval echo configure:5171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5171 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5172 if test -z "$ac_err"; then
5173   rm -rf conftest*
5174   eval "ac_cv_header_$ac_safe=yes"
5175 else
5176   echo "$ac_err" >&5
5177   echo "configure: failed program was:" >&5
5178   cat conftest.$ac_ext >&5
5179   rm -rf conftest*
5180   eval "ac_cv_header_$ac_safe=no"
5181 fi
5182 rm -f conftest*
5183 fi
5184 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5185   echo "$ac_t""yes" 1>&6
5186     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5187   cat >> confdefs.h <<EOF
5188 #define $ac_tr_hdr 1
5189 EOF
5190  
5191 else
5192   echo "$ac_t""no" 1>&6
5193 fi
5194 done
5195
5196 if test "$ac_cv_header_regex_h" != yes ; then
5197         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5198 fi
5199 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5200 echo "configure:5201: checking for regfree" >&5
5201 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5202   echo $ac_n "(cached) $ac_c" 1>&6
5203 else
5204   cat > conftest.$ac_ext <<EOF
5205 #line 5206 "configure"
5206 #include "confdefs.h"
5207 /* System header to define __stub macros and hopefully few prototypes,
5208     which can conflict with char regfree(); below.  */
5209 #include <assert.h>
5210 /* Override any gcc2 internal prototype to avoid an error.  */
5211 /* We use char because int might match the return type of a gcc2
5212     builtin and then its argument prototype would still apply.  */
5213 char regfree();
5214 char (*f)();
5215
5216 int main() {
5217
5218 /* The GNU C library defines this for functions which it implements
5219     to always fail with ENOSYS.  Some functions are actually named
5220     something starting with __ and the normal name is an alias.  */
5221 #if defined (__stub_regfree) || defined (__stub___regfree)
5222 choke me
5223 #else
5224 f = regfree;
5225 #endif
5226
5227 ; return 0; }
5228 EOF
5229 if { (eval echo configure:5230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5230   rm -rf conftest*
5231   eval "ac_cv_func_regfree=yes"
5232 else
5233   echo "configure: failed program was:" >&5
5234   cat conftest.$ac_ext >&5
5235   rm -rf conftest*
5236   eval "ac_cv_func_regfree=no"
5237 fi
5238 rm -f conftest*
5239 fi
5240
5241 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5242   echo "$ac_t""yes" 1>&6
5243   :
5244 else
5245   echo "$ac_t""no" 1>&6
5246 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5247 fi
5248
5249
5250
5251 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5252 echo "configure:5253: checking for compatible POSIX regex" >&5
5253 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5254   echo $ac_n "(cached) $ac_c" 1>&6
5255 else
5256   
5257         if test "$cross_compiling" = yes; then
5258   ol_cv_c_posix_regex=cross
5259 else
5260   cat > conftest.$ac_ext <<EOF
5261 #line 5262 "configure"
5262 #include "confdefs.h"
5263
5264 #include <sys/types.h>
5265 #include <regex.h>
5266 static char *pattern, *string;
5267 main()
5268 {
5269         int rc;
5270         regex_t re;
5271
5272         pattern = "^A";
5273
5274         if(regcomp(&re, pattern, 0)) {
5275                 return -1;
5276         }
5277         
5278         string = "ALL MATCH";
5279         
5280         rc = regexec(&re, string, 0, (void*)0, 0);
5281
5282         regfree(&re);
5283
5284         return rc;
5285 }
5286 EOF
5287 if { (eval echo configure:5288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5288 then
5289   ol_cv_c_posix_regex=yes
5290 else
5291   echo "configure: failed program was:" >&5
5292   cat conftest.$ac_ext >&5
5293   rm -fr conftest*
5294   ol_cv_c_posix_regex=no
5295 fi
5296 rm -fr conftest*
5297 fi
5298
5299 fi
5300
5301 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5302
5303 if test "$ol_cv_c_posix_regex" = no ; then
5304         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5305 fi
5306
5307 ol_link_dnssrv=no
5308 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5309 echo "configure:5310: checking for res_query" >&5
5310 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5311   echo $ac_n "(cached) $ac_c" 1>&6
5312 else
5313   cat > conftest.$ac_ext <<EOF
5314 #line 5315 "configure"
5315 #include "confdefs.h"
5316 /* System header to define __stub macros and hopefully few prototypes,
5317     which can conflict with char res_query(); below.  */
5318 #include <assert.h>
5319 /* Override any gcc2 internal prototype to avoid an error.  */
5320 /* We use char because int might match the return type of a gcc2
5321     builtin and then its argument prototype would still apply.  */
5322 char res_query();
5323 char (*f)();
5324
5325 int main() {
5326
5327 /* The GNU C library defines this for functions which it implements
5328     to always fail with ENOSYS.  Some functions are actually named
5329     something starting with __ and the normal name is an alias.  */
5330 #if defined (__stub_res_query) || defined (__stub___res_query)
5331 choke me
5332 #else
5333 f = res_query;
5334 #endif
5335
5336 ; return 0; }
5337 EOF
5338 if { (eval echo configure:5339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5339   rm -rf conftest*
5340   eval "ac_cv_func_res_query=yes"
5341 else
5342   echo "configure: failed program was:" >&5
5343   cat conftest.$ac_ext >&5
5344   rm -rf conftest*
5345   eval "ac_cv_func_res_query=no"
5346 fi
5347 rm -f conftest*
5348 fi
5349
5350 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5351   echo "$ac_t""yes" 1>&6
5352   :
5353 else
5354   echo "$ac_t""no" 1>&6
5355 fi
5356
5357 if test $ac_cv_func_res_query = no ; then 
5358         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5359 echo "configure:5360: checking for res_query in -lbind" >&5
5360 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5361 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5362   echo $ac_n "(cached) $ac_c" 1>&6
5363 else
5364   ac_save_LIBS="$LIBS"
5365 LIBS="-lbind  $LIBS"
5366 cat > conftest.$ac_ext <<EOF
5367 #line 5368 "configure"
5368 #include "confdefs.h"
5369 /* Override any gcc2 internal prototype to avoid an error.  */
5370 /* We use char because int might match the return type of a gcc2
5371     builtin and then its argument prototype would still apply.  */
5372 char res_query();
5373
5374 int main() {
5375 res_query()
5376 ; return 0; }
5377 EOF
5378 if { (eval echo configure:5379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5379   rm -rf conftest*
5380   eval "ac_cv_lib_$ac_lib_var=yes"
5381 else
5382   echo "configure: failed program was:" >&5
5383   cat conftest.$ac_ext >&5
5384   rm -rf conftest*
5385   eval "ac_cv_lib_$ac_lib_var=no"
5386 fi
5387 rm -f conftest*
5388 LIBS="$ac_save_LIBS"
5389
5390 fi
5391 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5392   echo "$ac_t""yes" 1>&6
5393     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5394     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5395   cat >> confdefs.h <<EOF
5396 #define $ac_tr_lib 1
5397 EOF
5398
5399   LIBS="-lbind $LIBS"
5400
5401 else
5402   echo "$ac_t""no" 1>&6
5403 fi
5404
5405         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5406 fi
5407
5408 if test $ac_cv_func_res_query = no ; then 
5409         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5410 echo "configure:5411: checking for __res_query in -lbind" >&5
5411 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5412 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5413   echo $ac_n "(cached) $ac_c" 1>&6
5414 else
5415   ac_save_LIBS="$LIBS"
5416 LIBS="-lbind  $LIBS"
5417 cat > conftest.$ac_ext <<EOF
5418 #line 5419 "configure"
5419 #include "confdefs.h"
5420 /* Override any gcc2 internal prototype to avoid an error.  */
5421 /* We use char because int might match the return type of a gcc2
5422     builtin and then its argument prototype would still apply.  */
5423 char __res_query();
5424
5425 int main() {
5426 __res_query()
5427 ; return 0; }
5428 EOF
5429 if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5430   rm -rf conftest*
5431   eval "ac_cv_lib_$ac_lib_var=yes"
5432 else
5433   echo "configure: failed program was:" >&5
5434   cat conftest.$ac_ext >&5
5435   rm -rf conftest*
5436   eval "ac_cv_lib_$ac_lib_var=no"
5437 fi
5438 rm -f conftest*
5439 LIBS="$ac_save_LIBS"
5440
5441 fi
5442 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5443   echo "$ac_t""yes" 1>&6
5444     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5445     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5446   cat >> confdefs.h <<EOF
5447 #define $ac_tr_lib 1
5448 EOF
5449
5450   LIBS="-lbind $LIBS"
5451
5452 else
5453   echo "$ac_t""no" 1>&6
5454 fi
5455
5456         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5457 fi
5458
5459 if test $ac_cv_func_res_query = no ; then 
5460         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5461 echo "configure:5462: checking for res_query in -lresolv" >&5
5462 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5463 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5464   echo $ac_n "(cached) $ac_c" 1>&6
5465 else
5466   ac_save_LIBS="$LIBS"
5467 LIBS="-lresolv  $LIBS"
5468 cat > conftest.$ac_ext <<EOF
5469 #line 5470 "configure"
5470 #include "confdefs.h"
5471 /* Override any gcc2 internal prototype to avoid an error.  */
5472 /* We use char because int might match the return type of a gcc2
5473     builtin and then its argument prototype would still apply.  */
5474 char res_query();
5475
5476 int main() {
5477 res_query()
5478 ; return 0; }
5479 EOF
5480 if { (eval echo configure:5481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5481   rm -rf conftest*
5482   eval "ac_cv_lib_$ac_lib_var=yes"
5483 else
5484   echo "configure: failed program was:" >&5
5485   cat conftest.$ac_ext >&5
5486   rm -rf conftest*
5487   eval "ac_cv_lib_$ac_lib_var=no"
5488 fi
5489 rm -f conftest*
5490 LIBS="$ac_save_LIBS"
5491
5492 fi
5493 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5494   echo "$ac_t""yes" 1>&6
5495     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5496     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5497   cat >> confdefs.h <<EOF
5498 #define $ac_tr_lib 1
5499 EOF
5500
5501   LIBS="-lresolv $LIBS"
5502
5503 else
5504   echo "$ac_t""no" 1>&6
5505 fi
5506
5507         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5508 fi
5509
5510 if test "$ac_cv_func_res_query" = yes ; then
5511         cat >> confdefs.h <<\EOF
5512 #define HAVE_RES_QUERY 1
5513 EOF
5514
5515
5516         if test $ol_enable_dnssrv != no ; then
5517                 ol_link_dnssrv=yes
5518         fi
5519 fi
5520
5521 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5522         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5523 fi
5524
5525 for ac_func in getaddrinfo inet_ntop 
5526 do
5527 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5528 echo "configure:5529: checking for $ac_func" >&5
5529 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5530   echo $ac_n "(cached) $ac_c" 1>&6
5531 else
5532   cat > conftest.$ac_ext <<EOF
5533 #line 5534 "configure"
5534 #include "confdefs.h"
5535 /* System header to define __stub macros and hopefully few prototypes,
5536     which can conflict with char $ac_func(); below.  */
5537 #include <assert.h>
5538 /* Override any gcc2 internal prototype to avoid an error.  */
5539 /* We use char because int might match the return type of a gcc2
5540     builtin and then its argument prototype would still apply.  */
5541 char $ac_func();
5542 char (*f)();
5543
5544 int main() {
5545
5546 /* The GNU C library defines this for functions which it implements
5547     to always fail with ENOSYS.  Some functions are actually named
5548     something starting with __ and the normal name is an alias.  */
5549 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5550 choke me
5551 #else
5552 f = $ac_func;
5553 #endif
5554
5555 ; return 0; }
5556 EOF
5557 if { (eval echo configure:5558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5558   rm -rf conftest*
5559   eval "ac_cv_func_$ac_func=yes"
5560 else
5561   echo "configure: failed program was:" >&5
5562   cat conftest.$ac_ext >&5
5563   rm -rf conftest*
5564   eval "ac_cv_func_$ac_func=no"
5565 fi
5566 rm -f conftest*
5567 fi
5568
5569 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5570   echo "$ac_t""yes" 1>&6
5571     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5572   cat >> confdefs.h <<EOF
5573 #define $ac_tr_func 1
5574 EOF
5575  
5576 else
5577   echo "$ac_t""no" 1>&6
5578 fi
5579 done
5580
5581
5582 ol_link_ipv6=no
5583 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop = no ; then
5584         if test $ol_enable_ipv6 = yes ; then
5585                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5586         fi
5587 else
5588         for ac_func in gai_strerror 
5589 do
5590 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5591 echo "configure:5592: checking for $ac_func" >&5
5592 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5593   echo $ac_n "(cached) $ac_c" 1>&6
5594 else
5595   cat > conftest.$ac_ext <<EOF
5596 #line 5597 "configure"
5597 #include "confdefs.h"
5598 /* System header to define __stub macros and hopefully few prototypes,
5599     which can conflict with char $ac_func(); below.  */
5600 #include <assert.h>
5601 /* Override any gcc2 internal prototype to avoid an error.  */
5602 /* We use char because int might match the return type of a gcc2
5603     builtin and then its argument prototype would still apply.  */
5604 char $ac_func();
5605 char (*f)();
5606
5607 int main() {
5608
5609 /* The GNU C library defines this for functions which it implements
5610     to always fail with ENOSYS.  Some functions are actually named
5611     something starting with __ and the normal name is an alias.  */
5612 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5613 choke me
5614 #else
5615 f = $ac_func;
5616 #endif
5617
5618 ; return 0; }
5619 EOF
5620 if { (eval echo configure:5621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5621   rm -rf conftest*
5622   eval "ac_cv_func_$ac_func=yes"
5623 else
5624   echo "configure: failed program was:" >&5
5625   cat conftest.$ac_ext >&5
5626   rm -rf conftest*
5627   eval "ac_cv_func_$ac_func=no"
5628 fi
5629 rm -f conftest*
5630 fi
5631
5632 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5633   echo "$ac_t""yes" 1>&6
5634     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5635   cat >> confdefs.h <<EOF
5636 #define $ac_tr_func 1
5637 EOF
5638  
5639 else
5640   echo "$ac_t""no" 1>&6
5641 fi
5642 done
5643
5644
5645         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5646 echo "configure:5647: checking INET6_ADDRSTRLEN" >&5
5647 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5648   echo $ac_n "(cached) $ac_c" 1>&6
5649 else
5650   
5651                 cat > conftest.$ac_ext <<EOF
5652 #line 5653 "configure"
5653 #include "confdefs.h"
5654
5655 #                       include <netinet/in.h>
5656 #                       ifdef INET6_ADDRSTRLEN
5657                                 __has_inet6_addrstrlen__;
5658 #                       endif
5659                 
5660 EOF
5661 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5662   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5663   rm -rf conftest*
5664   ol_cv_inet6_addrstrlen=yes
5665 else
5666   rm -rf conftest*
5667   ol_cv_inet6_addrstrlen=no
5668 fi
5669 rm -f conftest*
5670
5671 fi
5672
5673 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5674
5675         if test $ol_cv_inet6_addrstrlen = yes ; then
5676                 ol_link_ipv6=yes
5677         elif test $ol_enable_ipv6 = yes ; then
5678                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5679         fi
5680 fi
5681
5682 if test $ol_enable_local != no ; then
5683         for ac_hdr in sys/un.h 
5684 do
5685 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5686 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5687 echo "configure:5688: checking for $ac_hdr" >&5
5688 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5689   echo $ac_n "(cached) $ac_c" 1>&6
5690 else
5691   cat > conftest.$ac_ext <<EOF
5692 #line 5693 "configure"
5693 #include "confdefs.h"
5694 #include <$ac_hdr>
5695 EOF
5696 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5697 { (eval echo configure:5698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5698 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5699 if test -z "$ac_err"; then
5700   rm -rf conftest*
5701   eval "ac_cv_header_$ac_safe=yes"
5702 else
5703   echo "$ac_err" >&5
5704   echo "configure: failed program was:" >&5
5705   cat conftest.$ac_ext >&5
5706   rm -rf conftest*
5707   eval "ac_cv_header_$ac_safe=no"
5708 fi
5709 rm -f conftest*
5710 fi
5711 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5712   echo "$ac_t""yes" 1>&6
5713     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5714   cat >> confdefs.h <<EOF
5715 #define $ac_tr_hdr 1
5716 EOF
5717  
5718 else
5719   echo "$ac_t""no" 1>&6
5720 fi
5721 done
5722
5723
5724         if test $ol_enable_local = auto ; then
5725                 ol_enable_local=$ac_cv_header_sys_un_h
5726         elif test $ac_cv_header_sys_un_h = no ; then
5727                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5728         fi
5729 fi
5730
5731 ol_link_kbind=no
5732 ol_link_kpasswd=no
5733 ol_link_krb5=no
5734 ol_link_krb4=no
5735
5736 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5737         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5738         -o $ol_with_kerberos = k425 ; then
5739
5740         for ac_hdr in krb5.h
5741 do
5742 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5743 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5744 echo "configure:5745: checking for $ac_hdr" >&5
5745 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5746   echo $ac_n "(cached) $ac_c" 1>&6
5747 else
5748   cat > conftest.$ac_ext <<EOF
5749 #line 5750 "configure"
5750 #include "confdefs.h"
5751 #include <$ac_hdr>
5752 EOF
5753 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5754 { (eval echo configure:5755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5755 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5756 if test -z "$ac_err"; then
5757   rm -rf conftest*
5758   eval "ac_cv_header_$ac_safe=yes"
5759 else
5760   echo "$ac_err" >&5
5761   echo "configure: failed program was:" >&5
5762   cat conftest.$ac_ext >&5
5763   rm -rf conftest*
5764   eval "ac_cv_header_$ac_safe=no"
5765 fi
5766 rm -f conftest*
5767 fi
5768 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5769   echo "$ac_t""yes" 1>&6
5770     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5771   cat >> confdefs.h <<EOF
5772 #define $ac_tr_hdr 1
5773 EOF
5774  
5775 else
5776   echo "$ac_t""no" 1>&6
5777 fi
5778 done
5779
5780
5781         if test $ac_cv_header_krb5_h = yes ; then
5782                                 for ac_hdr in heim_err.h
5783 do
5784 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5785 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5786 echo "configure:5787: checking for $ac_hdr" >&5
5787 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5788   echo $ac_n "(cached) $ac_c" 1>&6
5789 else
5790   cat > conftest.$ac_ext <<EOF
5791 #line 5792 "configure"
5792 #include "confdefs.h"
5793 #include <$ac_hdr>
5794 EOF
5795 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5796 { (eval echo configure:5797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5797 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5798 if test -z "$ac_err"; then
5799   rm -rf conftest*
5800   eval "ac_cv_header_$ac_safe=yes"
5801 else
5802   echo "$ac_err" >&5
5803   echo "configure: failed program was:" >&5
5804   cat conftest.$ac_ext >&5
5805   rm -rf conftest*
5806   eval "ac_cv_header_$ac_safe=no"
5807 fi
5808 rm -f conftest*
5809 fi
5810 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5811   echo "$ac_t""yes" 1>&6
5812     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5813   cat >> confdefs.h <<EOF
5814 #define $ac_tr_hdr 1
5815 EOF
5816  
5817 else
5818   echo "$ac_t""no" 1>&6
5819 fi
5820 done
5821
5822                 if test $ac_cv_header_heim_err_h = yes ; then
5823                         krb5_impl=heimdal
5824                 else
5825                         krb5_impl=mit
5826                 fi
5827
5828                 if test $krb5_impl = mit; then
5829                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5830 echo "configure:5831: checking for main in -lkrb5" >&5
5831 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5832 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5833   echo $ac_n "(cached) $ac_c" 1>&6
5834 else
5835   ac_save_LIBS="$LIBS"
5836 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5837 cat > conftest.$ac_ext <<EOF
5838 #line 5839 "configure"
5839 #include "confdefs.h"
5840
5841 int main() {
5842 main()
5843 ; return 0; }
5844 EOF
5845 if { (eval echo configure:5846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5846   rm -rf conftest*
5847   eval "ac_cv_lib_$ac_lib_var=yes"
5848 else
5849   echo "configure: failed program was:" >&5
5850   cat conftest.$ac_ext >&5
5851   rm -rf conftest*
5852   eval "ac_cv_lib_$ac_lib_var=no"
5853 fi
5854 rm -f conftest*
5855 LIBS="$ac_save_LIBS"
5856
5857 fi
5858 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5859   echo "$ac_t""yes" 1>&6
5860   have_krb5=yes
5861                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5862 else
5863   echo "$ac_t""no" 1>&6
5864 have_krb5=no
5865 fi
5866
5867
5868                 elif test $krb5_impl = heimdal; then
5869                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5870 echo "configure:5871: checking for main in -lkrb5" >&5
5871 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5872 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5873   echo $ac_n "(cached) $ac_c" 1>&6
5874 else
5875   ac_save_LIBS="$LIBS"
5876 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5877 cat > conftest.$ac_ext <<EOF
5878 #line 5879 "configure"
5879 #include "confdefs.h"
5880
5881 int main() {
5882 main()
5883 ; return 0; }
5884 EOF
5885 if { (eval echo configure:5886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5886   rm -rf conftest*
5887   eval "ac_cv_lib_$ac_lib_var=yes"
5888 else
5889   echo "configure: failed program was:" >&5
5890   cat conftest.$ac_ext >&5
5891   rm -rf conftest*
5892   eval "ac_cv_lib_$ac_lib_var=no"
5893 fi
5894 rm -f conftest*
5895 LIBS="$ac_save_LIBS"
5896
5897 fi
5898 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5899   echo "$ac_t""yes" 1>&6
5900   have_krb5=yes
5901                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5902 else
5903   echo "$ac_t""no" 1>&6
5904 have_krb5=no
5905 fi
5906
5907
5908                         cat >> confdefs.h <<\EOF
5909 #define HAVE_HEIMDAL_KERBEROS 1
5910 EOF
5911
5912                 else
5913                         have_krb5=no
5914                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
5915                 fi
5916
5917                 if test $have_krb5 = yes ; then
5918                         ol_link_krb5=yes
5919
5920                         cat >> confdefs.h <<\EOF
5921 #define HAVE_KRB5 1
5922 EOF
5923
5924
5925                         if test $ol_enable_kpasswd != no ; then
5926                                 ol_link_kpasswd=yes;
5927                         fi
5928
5929                         if test $ol_with_kerberos = k5only ; then
5930                                 ol_with_kerberos=found
5931                         fi
5932
5933                 elif test $ol_with_kerberos != auto ; then
5934                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5935                 fi
5936
5937         fi
5938 fi
5939
5940 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
5941         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5942
5943         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5944 do
5945 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5946 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5947 echo "configure:5948: checking for $ac_hdr" >&5
5948 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5949   echo $ac_n "(cached) $ac_c" 1>&6
5950 else
5951   cat > conftest.$ac_ext <<EOF
5952 #line 5953 "configure"
5953 #include "confdefs.h"
5954 #include <$ac_hdr>
5955 EOF
5956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5957 { (eval echo configure:5958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5959 if test -z "$ac_err"; then
5960   rm -rf conftest*
5961   eval "ac_cv_header_$ac_safe=yes"
5962 else
5963   echo "$ac_err" >&5
5964   echo "configure: failed program was:" >&5
5965   cat conftest.$ac_ext >&5
5966   rm -rf conftest*
5967   eval "ac_cv_header_$ac_safe=no"
5968 fi
5969 rm -f conftest*
5970 fi
5971 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5972   echo "$ac_t""yes" 1>&6
5973     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5974   cat >> confdefs.h <<EOF
5975 #define $ac_tr_hdr 1
5976 EOF
5977  
5978 else
5979   echo "$ac_t""no" 1>&6
5980 fi
5981 done
5982
5983
5984         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5985                 if test $krb5_impl = mit; then
5986                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5987 echo "configure:5988: checking for main in -lkrb4" >&5
5988 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5989 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5990   echo $ac_n "(cached) $ac_c" 1>&6
5991 else
5992   ac_save_LIBS="$LIBS"
5993 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5994 cat > conftest.$ac_ext <<EOF
5995 #line 5996 "configure"
5996 #include "confdefs.h"
5997
5998 int main() {
5999 main()
6000 ; return 0; }
6001 EOF
6002 if { (eval echo configure:6003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6003   rm -rf conftest*
6004   eval "ac_cv_lib_$ac_lib_var=yes"
6005 else
6006   echo "configure: failed program was:" >&5
6007   cat conftest.$ac_ext >&5
6008   rm -rf conftest*
6009   eval "ac_cv_lib_$ac_lib_var=no"
6010 fi
6011 rm -f conftest*
6012 LIBS="$ac_save_LIBS"
6013
6014 fi
6015 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6016   echo "$ac_t""yes" 1>&6
6017   have_k425=yes
6018                                 KRB4_LIBS="-lkrb4 -ldes425"
6019 else
6020   echo "$ac_t""no" 1>&6
6021 have_k425=no
6022 fi
6023
6024
6025                 elif test $krb5_impl = heimdal; then
6026                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6027 echo "configure:6028: checking for main in -lkrb4" >&5
6028 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6029 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6030   echo $ac_n "(cached) $ac_c" 1>&6
6031 else
6032   ac_save_LIBS="$LIBS"
6033 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6034 cat > conftest.$ac_ext <<EOF
6035 #line 6036 "configure"
6036 #include "confdefs.h"
6037
6038 int main() {
6039 main()
6040 ; return 0; }
6041 EOF
6042 if { (eval echo configure:6043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6043   rm -rf conftest*
6044   eval "ac_cv_lib_$ac_lib_var=yes"
6045 else
6046   echo "configure: failed program was:" >&5
6047   cat conftest.$ac_ext >&5
6048   rm -rf conftest*
6049   eval "ac_cv_lib_$ac_lib_var=no"
6050 fi
6051 rm -f conftest*
6052 LIBS="$ac_save_LIBS"
6053
6054 fi
6055 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6056   echo "$ac_t""yes" 1>&6
6057   have_k425=yes
6058                                 KRB4_LIBS="-lkrb4"
6059 else
6060   echo "$ac_t""no" 1>&6
6061 have_k425=no
6062 fi
6063
6064
6065                 else
6066                         have_425=no
6067                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6068                 fi
6069
6070                 if test $have_k425 = yes ; then
6071                         ol_with_kerberos=found
6072                         ol_link_krb4=yes
6073
6074                         cat >> confdefs.h <<\EOF
6075 #define HAVE_KRB425 1
6076 EOF
6077
6078                         cat >> confdefs.h <<\EOF
6079 #define HAVE_KRB4 1
6080 EOF
6081
6082
6083                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6084 echo "configure:6085: checking for des_debug in Kerberos libraries" >&5
6085 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6086   echo $ac_n "(cached) $ac_c" 1>&6
6087 else
6088   
6089                                                                 save_LIBS="$LIBS"
6090                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6091                                 cat > conftest.$ac_ext <<EOF
6092 #line 6093 "configure"
6093 #include "confdefs.h"
6094
6095 #include <kerberosIV/krb.h>
6096 #include <kerberosIV/des.h>
6097 extern int des_debug;
6098
6099 int main() {
6100
6101 des_debug = 1;
6102
6103 ; return 0; }
6104 EOF
6105 if { (eval echo configure:6106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6106   rm -rf conftest*
6107   ol_cv_var_des_debug=yes
6108 else
6109   echo "configure: failed program was:" >&5
6110   cat conftest.$ac_ext >&5
6111   rm -rf conftest*
6112   ol_cv_var_des_debug=no
6113 fi
6114 rm -f conftest*
6115                                                                 LIBS="$save_LIBS"
6116                         
6117 fi
6118
6119 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6120
6121                         if test $ol_cv_var_des_debug = yes ; then
6122                                 cat >> confdefs.h <<\EOF
6123 #define HAVE_DES_DEBUG 1
6124 EOF
6125
6126                         fi
6127
6128                         LIBS="$save_LIBS"
6129                 fi
6130         fi
6131 fi
6132
6133 if test $ol_link_krb5 = yes ; then
6134         ol_with_kerberos=found
6135 fi
6136
6137 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6138         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6139
6140         for ac_hdr in krb.h des.h krb-archaeology.h 
6141 do
6142 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6143 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6144 echo "configure:6145: checking for $ac_hdr" >&5
6145 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6146   echo $ac_n "(cached) $ac_c" 1>&6
6147 else
6148   cat > conftest.$ac_ext <<EOF
6149 #line 6150 "configure"
6150 #include "confdefs.h"
6151 #include <$ac_hdr>
6152 EOF
6153 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6154 { (eval echo configure:6155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6155 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6156 if test -z "$ac_err"; then
6157   rm -rf conftest*
6158   eval "ac_cv_header_$ac_safe=yes"
6159 else
6160   echo "$ac_err" >&5
6161   echo "configure: failed program was:" >&5
6162   cat conftest.$ac_ext >&5
6163   rm -rf conftest*
6164   eval "ac_cv_header_$ac_safe=no"
6165 fi
6166 rm -f conftest*
6167 fi
6168 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6169   echo "$ac_t""yes" 1>&6
6170     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6171   cat >> confdefs.h <<EOF
6172 #define $ac_tr_hdr 1
6173 EOF
6174  
6175 else
6176   echo "$ac_t""no" 1>&6
6177 fi
6178 done
6179
6180
6181         if test $ac_cv_header_krb_h = yes ; then
6182                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6183 echo "configure:6184: checking for main in -lkrb" >&5
6184 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6185 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6186   echo $ac_n "(cached) $ac_c" 1>&6
6187 else
6188   ac_save_LIBS="$LIBS"
6189 LIBS="-lkrb -ldes $LIBS"
6190 cat > conftest.$ac_ext <<EOF
6191 #line 6192 "configure"
6192 #include "confdefs.h"
6193
6194 int main() {
6195 main()
6196 ; return 0; }
6197 EOF
6198 if { (eval echo configure:6199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6199   rm -rf conftest*
6200   eval "ac_cv_lib_$ac_lib_var=yes"
6201 else
6202   echo "configure: failed program was:" >&5
6203   cat conftest.$ac_ext >&5
6204   rm -rf conftest*
6205   eval "ac_cv_lib_$ac_lib_var=no"
6206 fi
6207 rm -f conftest*
6208 LIBS="$ac_save_LIBS"
6209
6210 fi
6211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6212   echo "$ac_t""yes" 1>&6
6213   have_k4=yes
6214 else
6215   echo "$ac_t""no" 1>&6
6216 have_k4=no
6217 fi
6218
6219
6220                 if test $have_k4 = yes ; then
6221                         ol_with_kerberos=found
6222                         ol_link_krb4=yes
6223
6224                         cat >> confdefs.h <<\EOF
6225 #define HAVE_KRB4 1
6226 EOF
6227
6228
6229                         KRB4_LIBS="-lkrb -ldes"
6230
6231                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6232                                 cat >> confdefs.h <<\EOF
6233 #define HAVE_KTH_KERBEROS 1
6234 EOF
6235
6236                         fi
6237                 fi
6238         fi
6239 fi
6240
6241 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6242         ol_link_kpasswd=yes
6243 fi
6244
6245 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6246         ol_link_kbind=yes
6247
6248 elif test $ol_enable_kbind = yes ; then
6249         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6250 fi
6251
6252 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6253         cat >> confdefs.h <<\EOF
6254 #define HAVE_KERBEROS 1
6255 EOF
6256
6257
6258 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6259         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6260 fi
6261
6262 ol_link_tls=no
6263 if test $ol_with_tls != no ; then
6264         for ac_hdr in openssl/ssl.h ssl.h
6265 do
6266 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6267 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6268 echo "configure:6269: checking for $ac_hdr" >&5
6269 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6270   echo $ac_n "(cached) $ac_c" 1>&6
6271 else
6272   cat > conftest.$ac_ext <<EOF
6273 #line 6274 "configure"
6274 #include "confdefs.h"
6275 #include <$ac_hdr>
6276 EOF
6277 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6278 { (eval echo configure:6279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6279 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6280 if test -z "$ac_err"; then
6281   rm -rf conftest*
6282   eval "ac_cv_header_$ac_safe=yes"
6283 else
6284   echo "$ac_err" >&5
6285   echo "configure: failed program was:" >&5
6286   cat conftest.$ac_ext >&5
6287   rm -rf conftest*
6288   eval "ac_cv_header_$ac_safe=no"
6289 fi
6290 rm -f conftest*
6291 fi
6292 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6293   echo "$ac_t""yes" 1>&6
6294     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6295   cat >> confdefs.h <<EOF
6296 #define $ac_tr_hdr 1
6297 EOF
6298  
6299 else
6300   echo "$ac_t""no" 1>&6
6301 fi
6302 done
6303
6304         
6305         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6306                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6307 echo "configure:6308: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6308 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6309 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6310   echo $ac_n "(cached) $ac_c" 1>&6
6311 else
6312   ac_save_LIBS="$LIBS"
6313 LIBS="-lssl -lcrypto $LIBS"
6314 cat > conftest.$ac_ext <<EOF
6315 #line 6316 "configure"
6316 #include "confdefs.h"
6317 /* Override any gcc2 internal prototype to avoid an error.  */
6318 /* We use char because int might match the return type of a gcc2
6319     builtin and then its argument prototype would still apply.  */
6320 char SSLeay_add_ssl_algorithms();
6321
6322 int main() {
6323 SSLeay_add_ssl_algorithms()
6324 ; return 0; }
6325 EOF
6326 if { (eval echo configure:6327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6327   rm -rf conftest*
6328   eval "ac_cv_lib_$ac_lib_var=yes"
6329 else
6330   echo "configure: failed program was:" >&5
6331   cat conftest.$ac_ext >&5
6332   rm -rf conftest*
6333   eval "ac_cv_lib_$ac_lib_var=no"
6334 fi
6335 rm -f conftest*
6336 LIBS="$ac_save_LIBS"
6337
6338 fi
6339 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6340   echo "$ac_t""yes" 1>&6
6341   have_ssleay=yes
6342                         need_rsaref=no
6343 else
6344   echo "$ac_t""no" 1>&6
6345 have_ssleay=no
6346 fi
6347
6348                         
6349                 if test $have_ssleay = no ; then
6350                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6351 echo "configure:6352: checking for SSL_library_init in -lssl" >&5
6352 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6353 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6354   echo $ac_n "(cached) $ac_c" 1>&6
6355 else
6356   ac_save_LIBS="$LIBS"
6357 LIBS="-lssl -lcrypto $LIBS"
6358 cat > conftest.$ac_ext <<EOF
6359 #line 6360 "configure"
6360 #include "confdefs.h"
6361 /* Override any gcc2 internal prototype to avoid an error.  */
6362 /* We use char because int might match the return type of a gcc2
6363     builtin and then its argument prototype would still apply.  */
6364 char SSL_library_init();
6365
6366 int main() {
6367 SSL_library_init()
6368 ; return 0; }
6369 EOF
6370 if { (eval echo configure:6371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6371   rm -rf conftest*
6372   eval "ac_cv_lib_$ac_lib_var=yes"
6373 else
6374   echo "configure: failed program was:" >&5
6375   cat conftest.$ac_ext >&5
6376   rm -rf conftest*
6377   eval "ac_cv_lib_$ac_lib_var=no"
6378 fi
6379 rm -f conftest*
6380 LIBS="$ac_save_LIBS"
6381
6382 fi
6383 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6384   echo "$ac_t""yes" 1>&6
6385   have_ssleay=yes
6386                                 need_rsaref=no
6387 else
6388   echo "$ac_t""no" 1>&6
6389 have_ssleay=no
6390 fi
6391
6392                 fi
6393
6394                 if test $have_ssleay = no ; then
6395                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6396 echo "configure:6397: checking for ssl3_accept in -lssl" >&5
6397 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6398 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6399   echo $ac_n "(cached) $ac_c" 1>&6
6400 else
6401   ac_save_LIBS="$LIBS"
6402 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6403 cat > conftest.$ac_ext <<EOF
6404 #line 6405 "configure"
6405 #include "confdefs.h"
6406 /* Override any gcc2 internal prototype to avoid an error.  */
6407 /* We use char because int might match the return type of a gcc2
6408     builtin and then its argument prototype would still apply.  */
6409 char ssl3_accept();
6410
6411 int main() {
6412 ssl3_accept()
6413 ; return 0; }
6414 EOF
6415 if { (eval echo configure:6416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6416   rm -rf conftest*
6417   eval "ac_cv_lib_$ac_lib_var=yes"
6418 else
6419   echo "configure: failed program was:" >&5
6420   cat conftest.$ac_ext >&5
6421   rm -rf conftest*
6422   eval "ac_cv_lib_$ac_lib_var=no"
6423 fi
6424 rm -f conftest*
6425 LIBS="$ac_save_LIBS"
6426
6427 fi
6428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6429   echo "$ac_t""yes" 1>&6
6430   have_ssleay=yes
6431                                 need_rsaref=yes
6432 else
6433   echo "$ac_t""no" 1>&6
6434 have_ssleay=no
6435 fi
6436
6437                 fi
6438
6439                 if test $have_ssleay = yes ; then
6440                         ol_with_tls=found
6441                         ol_link_tls=yes
6442
6443                         cat >> confdefs.h <<\EOF
6444 #define HAVE_SSLEAY 1
6445 EOF
6446
6447
6448                         if test $need_rsaref = yes; then
6449                                 cat >> confdefs.h <<\EOF
6450 #define HAVE_RSAREF 1
6451 EOF
6452
6453
6454                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6455                         else
6456                                 TLS_LIBS="-lssl -lcrypto"
6457                         fi
6458                 fi
6459         fi
6460
6461 else
6462         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6463 fi
6464
6465 if test $ol_link_tls = yes ; then
6466         cat >> confdefs.h <<\EOF
6467 #define HAVE_TLS 1
6468 EOF
6469
6470
6471 elif test $ol_with_tls = auto ; then
6472         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6473         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6474
6475 elif test $ol_with_tls != no ; then
6476         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6477 fi
6478
6479 for ac_func in \
6480         ctime_r                 \
6481         gethostbyname_r gethostbyaddr_r \
6482
6483 do
6484 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6485 echo "configure:6486: checking for $ac_func" >&5
6486 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6487   echo $ac_n "(cached) $ac_c" 1>&6
6488 else
6489   cat > conftest.$ac_ext <<EOF
6490 #line 6491 "configure"
6491 #include "confdefs.h"
6492 /* System header to define __stub macros and hopefully few prototypes,
6493     which can conflict with char $ac_func(); below.  */
6494 #include <assert.h>
6495 /* Override any gcc2 internal prototype to avoid an error.  */
6496 /* We use char because int might match the return type of a gcc2
6497     builtin and then its argument prototype would still apply.  */
6498 char $ac_func();
6499 char (*f)();
6500
6501 int main() {
6502
6503 /* The GNU C library defines this for functions which it implements
6504     to always fail with ENOSYS.  Some functions are actually named
6505     something starting with __ and the normal name is an alias.  */
6506 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6507 choke me
6508 #else
6509 f = $ac_func;
6510 #endif
6511
6512 ; return 0; }
6513 EOF
6514 if { (eval echo configure:6515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6515   rm -rf conftest*
6516   eval "ac_cv_func_$ac_func=yes"
6517 else
6518   echo "configure: failed program was:" >&5
6519   cat conftest.$ac_ext >&5
6520   rm -rf conftest*
6521   eval "ac_cv_func_$ac_func=no"
6522 fi
6523 rm -f conftest*
6524 fi
6525
6526 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6527   echo "$ac_t""yes" 1>&6
6528     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6529   cat >> confdefs.h <<EOF
6530 #define $ac_tr_func 1
6531 EOF
6532  
6533 else
6534   echo "$ac_t""no" 1>&6
6535 fi
6536 done
6537
6538
6539 if test "$ac_cv_func_ctime_r" = no ; then
6540         ol_cv_func_ctime_r_nargs=0
6541 else
6542         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6543 echo "configure:6544: checking number of arguments of ctime_r" >&5
6544 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6545   echo $ac_n "(cached) $ac_c" 1>&6
6546 else
6547   cat > conftest.$ac_ext <<EOF
6548 #line 6549 "configure"
6549 #include "confdefs.h"
6550 #include <time.h>
6551 int main() {
6552 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6553 ; return 0; }
6554 EOF
6555 if { (eval echo configure:6556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6556   rm -rf conftest*
6557   ol_cv_func_ctime_r_nargs3=yes
6558 else
6559   echo "configure: failed program was:" >&5
6560   cat conftest.$ac_ext >&5
6561   rm -rf conftest*
6562   ol_cv_func_ctime_r_nargs3=no
6563 fi
6564 rm -f conftest*
6565
6566         cat > conftest.$ac_ext <<EOF
6567 #line 6568 "configure"
6568 #include "confdefs.h"
6569 #include <time.h>
6570 int main() {
6571 time_t ti; char *buffer; ctime_r(&ti,buffer);
6572 ; return 0; }
6573 EOF
6574 if { (eval echo configure:6575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6575   rm -rf conftest*
6576   ol_cv_func_ctime_r_nargs2=yes
6577 else
6578   echo "configure: failed program was:" >&5
6579   cat conftest.$ac_ext >&5
6580   rm -rf conftest*
6581   ol_cv_func_ctime_r_nargs2=no
6582 fi
6583 rm -f conftest*
6584
6585         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6586                 $ol_cv_func_ctime_r_nargs2 = no ; then
6587
6588                 ol_cv_func_ctime_r_nargs=3
6589
6590         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6591                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6592
6593                 ol_cv_func_ctime_r_nargs=2
6594
6595         else
6596                 ol_cv_func_ctime_r_nargs=0
6597         fi
6598   
6599 fi
6600
6601 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6602
6603   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6604         cat >> confdefs.h <<EOF
6605 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6606 EOF
6607
6608   fi
6609
6610 fi
6611
6612 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6613         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6614 echo "configure:6615: checking number of arguments of gethostbyname_r" >&5
6615 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6616   echo $ac_n "(cached) $ac_c" 1>&6
6617 else
6618   cat > conftest.$ac_ext <<EOF
6619 #line 6620 "configure"
6620 #include "confdefs.h"
6621 #include <sys/types.h>
6622 #include <sys/socket.h>
6623 #include <netinet/in.h>
6624 #include <netdb.h>
6625 #define BUFSIZE (sizeof(struct hostent)+10)
6626 int main() {
6627 struct hostent hent; char buffer[BUFSIZE];
6628                 int bufsize=BUFSIZE;int h_errno;
6629                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6630                         buffer, bufsize, &h_errno);
6631 ; return 0; }
6632 EOF
6633 if { (eval echo configure:6634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6634   rm -rf conftest*
6635   ol_cv_func_gethostbyname_r_nargs5=yes
6636 else
6637   echo "configure: failed program was:" >&5
6638   cat conftest.$ac_ext >&5
6639   rm -rf conftest*
6640   ol_cv_func_gethostbyname_r_nargs5=no
6641 fi
6642 rm -f conftest*
6643
6644         cat > conftest.$ac_ext <<EOF
6645 #line 6646 "configure"
6646 #include "confdefs.h"
6647 #include <sys/types.h>
6648 #include <sys/socket.h>
6649 #include <netinet/in.h>
6650 #include <netdb.h>
6651 #define BUFSIZE (sizeof(struct hostent)+10)
6652 int main() {
6653 struct hostent hent;struct hostent *rhent;
6654                 char buffer[BUFSIZE];
6655                 int bufsize=BUFSIZE;int h_errno;
6656                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6657                         &rhent, &h_errno);
6658 ; return 0; }
6659 EOF
6660 if { (eval echo configure:6661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6661   rm -rf conftest*
6662   ol_cv_func_gethostbyname_r_nargs6=yes
6663 else
6664   echo "configure: failed program was:" >&5
6665   cat conftest.$ac_ext >&5
6666   rm -rf conftest*
6667   ol_cv_func_gethostbyname_r_nargs6=no
6668 fi
6669 rm -f conftest*
6670
6671         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6672                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6673
6674                 ol_cv_func_gethostbyname_r_nargs=5
6675
6676         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6677                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6678
6679                 ol_cv_func_gethostbyname_r_nargs=6
6680
6681         else
6682                 ol_cv_func_gethostbyname_r_nargs=0
6683         fi
6684   
6685 fi
6686
6687 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6688   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6689         cat >> confdefs.h <<EOF
6690 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6691 EOF
6692
6693   fi
6694
6695 else
6696         ol_cv_func_gethostbyname_r_nargs=0
6697 fi
6698  
6699 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6700         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6701 echo "configure:6702: checking number of arguments of gethostbyaddr_r" >&5
6702 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6703   echo $ac_n "(cached) $ac_c" 1>&6
6704 else
6705   cat > conftest.$ac_ext <<EOF
6706 #line 6707 "configure"
6707 #include "confdefs.h"
6708 #include <sys/types.h>
6709 #include <sys/socket.h>
6710 #include <netinet/in.h>
6711 #include <netdb.h>
6712 #define BUFSIZE (sizeof(struct hostent)+10)
6713 int main() {
6714 struct hostent hent; char buffer[BUFSIZE]; 
6715             struct in_addr add;
6716             size_t alen=sizeof(struct in_addr);
6717             int bufsize=BUFSIZE;int h_errno;
6718                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6719                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6720 ; return 0; }
6721 EOF
6722 if { (eval echo configure:6723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6723   rm -rf conftest*
6724   ol_cv_func_gethostbyaddr_r_nargs7=yes
6725 else
6726   echo "configure: failed program was:" >&5
6727   cat conftest.$ac_ext >&5
6728   rm -rf conftest*
6729   ol_cv_func_gethostbyaddr_r_nargs7=no
6730 fi
6731 rm -f conftest*
6732
6733         cat > conftest.$ac_ext <<EOF
6734 #line 6735 "configure"
6735 #include "confdefs.h"
6736 #include <sys/types.h>
6737 #include <sys/socket.h>
6738 #include <netinet/in.h>
6739 #include <netdb.h>
6740 #define BUFSIZE (sizeof(struct hostent)+10)
6741 int main() {
6742 struct hostent hent;
6743                 struct hostent *rhent; char buffer[BUFSIZE]; 
6744                 struct in_addr add;
6745                 size_t alen=sizeof(struct in_addr);
6746                 int bufsize=BUFSIZE;int h_errno;
6747                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6748                         alen, AF_INET, &hent, buffer, bufsize, 
6749                         &rhent, &h_errno);
6750 ; return 0; }
6751 EOF
6752 if { (eval echo configure:6753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6753   rm -rf conftest*
6754   ol_cv_func_gethostbyaddr_r_nargs8=yes
6755 else
6756   echo "configure: failed program was:" >&5
6757   cat conftest.$ac_ext >&5
6758   rm -rf conftest*
6759   ol_cv_func_gethostbyaddr_r_nargs8=no
6760 fi
6761 rm -f conftest*
6762
6763         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6764                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6765
6766                 ol_cv_func_gethostbyaddr_r_nargs=7
6767
6768         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6769                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6770
6771                 ol_cv_func_gethostbyaddr_r_nargs=8
6772
6773         else
6774                 ol_cv_func_gethostbyaddr_r_nargs=0
6775         fi
6776   
6777 fi
6778
6779 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6780   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6781     cat >> confdefs.h <<EOF
6782 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6783 EOF
6784
6785   fi
6786
6787 else
6788         ol_cv_func_gethostbyaddr_r_nargs=0
6789 fi
6790
6791 if test "$ac_cv_func_ctime_r" = yes \
6792         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6793         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6794         -a "$ac_cv_func_gethostbyname_r" = yes \
6795         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6796         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6797         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6798         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6799         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6800         ; then
6801  
6802         cat >> confdefs.h <<\EOF
6803 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6804 EOF
6805
6806 fi
6807
6808 ol_link_threads=no
6809
6810 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6811         -o $ol_with_threads = nt ; then
6812
6813         
6814         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6815 echo "configure:6816: checking for _beginthread" >&5
6816 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6817   echo $ac_n "(cached) $ac_c" 1>&6
6818 else
6819   cat > conftest.$ac_ext <<EOF
6820 #line 6821 "configure"
6821 #include "confdefs.h"
6822 /* System header to define __stub macros and hopefully few prototypes,
6823     which can conflict with char _beginthread(); below.  */
6824 #include <assert.h>
6825 /* Override any gcc2 internal prototype to avoid an error.  */
6826 /* We use char because int might match the return type of a gcc2
6827     builtin and then its argument prototype would still apply.  */
6828 char _beginthread();
6829 char (*f)();
6830
6831 int main() {
6832
6833 /* The GNU C library defines this for functions which it implements
6834     to always fail with ENOSYS.  Some functions are actually named
6835     something starting with __ and the normal name is an alias.  */
6836 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6837 choke me
6838 #else
6839 f = _beginthread;
6840 #endif
6841
6842 ; return 0; }
6843 EOF
6844 if { (eval echo configure:6845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6845   rm -rf conftest*
6846   eval "ac_cv_func__beginthread=yes"
6847 else
6848   echo "configure: failed program was:" >&5
6849   cat conftest.$ac_ext >&5
6850   rm -rf conftest*
6851   eval "ac_cv_func__beginthread=no"
6852 fi
6853 rm -f conftest*
6854 fi
6855
6856 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6857   echo "$ac_t""yes" 1>&6
6858   :
6859 else
6860   echo "$ac_t""no" 1>&6
6861 fi
6862
6863
6864         if test $ac_cv_func__beginthread = yes ; then
6865                 cat >> confdefs.h <<\EOF
6866 #define HAVE_NT_THREADS 1
6867 EOF
6868
6869         fi
6870
6871
6872         if test "$ol_cv_nt_threads" = yes ; then
6873         ol_link_threads=nt
6874         ol_with_threads=found
6875         ol_with_yielding_select=yes
6876
6877                 cat >> confdefs.h <<\EOF
6878 #define HAVE_NT_SERVICE_MANAGER 1
6879 EOF
6880
6881                 cat >> confdefs.h <<\EOF
6882 #define HAVE_NT_EVENT_LOG 1
6883 EOF
6884
6885         fi
6886
6887         if test $ol_with_threads = nt ; then
6888                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6889         fi
6890 fi
6891
6892 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6893         -o $ol_with_threads = posix ; then
6894
6895         for ac_hdr in pthread.h
6896 do
6897 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6898 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6899 echo "configure:6900: checking for $ac_hdr" >&5
6900 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6901   echo $ac_n "(cached) $ac_c" 1>&6
6902 else
6903   cat > conftest.$ac_ext <<EOF
6904 #line 6905 "configure"
6905 #include "confdefs.h"
6906 #include <$ac_hdr>
6907 EOF
6908 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6909 { (eval echo configure:6910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6910 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6911 if test -z "$ac_err"; then
6912   rm -rf conftest*
6913   eval "ac_cv_header_$ac_safe=yes"
6914 else
6915   echo "$ac_err" >&5
6916   echo "configure: failed program was:" >&5
6917   cat conftest.$ac_ext >&5
6918   rm -rf conftest*
6919   eval "ac_cv_header_$ac_safe=no"
6920 fi
6921 rm -f conftest*
6922 fi
6923 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6924   echo "$ac_t""yes" 1>&6
6925     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6926   cat >> confdefs.h <<EOF
6927 #define $ac_tr_hdr 1
6928 EOF
6929  
6930 else
6931   echo "$ac_t""no" 1>&6
6932 fi
6933 done
6934
6935
6936         if test $ac_cv_header_pthread_h = yes ; then
6937                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6938 echo "configure:6939: checking POSIX thread version" >&5
6939 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6940   echo $ac_n "(cached) $ac_c" 1>&6
6941 else
6942   
6943         cat > conftest.$ac_ext <<EOF
6944 #line 6945 "configure"
6945 #include "confdefs.h"
6946
6947 #               include <pthread.h>
6948                 /* this check could be improved */
6949 #               ifdef PTHREAD_ONCE_INIT
6950                         pthread_version_final;
6951 #               endif
6952         
6953 EOF
6954 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6955   egrep "pthread_version_final" >/dev/null 2>&1; then
6956   rm -rf conftest*
6957   ol_pthread_final=yes
6958 else
6959   rm -rf conftest*
6960   ol_pthread_final=no
6961 fi
6962 rm -f conftest*
6963
6964
6965         cat > conftest.$ac_ext <<EOF
6966 #line 6967 "configure"
6967 #include "confdefs.h"
6968
6969 #               include <pthread.h>
6970                 /* this check could be improved */
6971 #               ifdef pthread_once_init
6972                         pthread_version_draft4;
6973 #               endif
6974         
6975 EOF
6976 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6977   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6978   rm -rf conftest*
6979   ol_pthread_draft4=yes
6980 else
6981   rm -rf conftest*
6982   ol_pthread_draft4=no
6983 fi
6984 rm -f conftest*
6985
6986
6987         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6988                 ol_cv_pthread_version=final
6989         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6990                 ol_cv_pthread_version=draft4
6991         else
6992                 ol_cv_pthread_version=unknown
6993         fi
6994
6995 fi
6996
6997 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6998
6999
7000                 if test $ol_cv_pthread_version = final ; then
7001                         cat >> confdefs.h <<\EOF
7002 #define HAVE_PTHREADS_FINAL 1
7003 EOF
7004
7005                 elif test $ol_cv_pthread_version = draft4 ; then
7006                         cat >> confdefs.h <<\EOF
7007 #define HAVE_PTHREADS_D4 1
7008 EOF
7009
7010                 else
7011                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7012                 fi
7013
7014                 # consider threads found
7015                 ol_with_threads=found
7016
7017                 
7018         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7019 echo "configure:7020: checking for LinuxThreads pthread.h" >&5
7020 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7021   echo $ac_n "(cached) $ac_c" 1>&6
7022 else
7023   cat > conftest.$ac_ext <<EOF
7024 #line 7025 "configure"
7025 #include "confdefs.h"
7026 #include <pthread.h>
7027 EOF
7028 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7029   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7030   rm -rf conftest*
7031   ol_cv_header_linux_threads=yes
7032 else
7033   rm -rf conftest*
7034   ol_cv_header_linux_threads=no
7035 fi
7036 rm -f conftest*
7037
7038                 
7039 fi
7040
7041 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7042         if test $ol_cv_header_linux_threads = yes; then
7043                 cat >> confdefs.h <<\EOF
7044 #define HAVE_LINUX_THREADS 1
7045 EOF
7046
7047         fi
7048
7049                 
7050         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7051 echo "configure:7052: checking for GNU Pth pthread.h" >&5
7052 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7053   echo $ac_n "(cached) $ac_c" 1>&6
7054 else
7055   cat > conftest.$ac_ext <<EOF
7056 #line 7057 "configure"
7057 #include "confdefs.h"
7058 #include <pthread.h>
7059 #ifdef _POSIX_THREAD_IS_GNU_PTH
7060         __gnu_pth__;
7061 #endif
7062
7063 EOF
7064 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7065   egrep "__gnu_pth__" >/dev/null 2>&1; then
7066   rm -rf conftest*
7067   ol_cv_header_gnu_pth_pthread_h=yes
7068 else
7069   rm -rf conftest*
7070   ol_cv_header_gnu_pth_pthread_h=no
7071 fi
7072 rm -f conftest*
7073
7074                 
7075 fi
7076
7077 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7078
7079
7080                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7081                         for ac_hdr in sched.h
7082 do
7083 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7084 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7085 echo "configure:7086: checking for $ac_hdr" >&5
7086 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7087   echo $ac_n "(cached) $ac_c" 1>&6
7088 else
7089   cat > conftest.$ac_ext <<EOF
7090 #line 7091 "configure"
7091 #include "confdefs.h"
7092 #include <$ac_hdr>
7093 EOF
7094 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7095 { (eval echo configure:7096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7096 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7097 if test -z "$ac_err"; then
7098   rm -rf conftest*
7099   eval "ac_cv_header_$ac_safe=yes"
7100 else
7101   echo "$ac_err" >&5
7102   echo "configure: failed program was:" >&5
7103   cat conftest.$ac_ext >&5
7104   rm -rf conftest*
7105   eval "ac_cv_header_$ac_safe=no"
7106 fi
7107 rm -f conftest*
7108 fi
7109 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7110   echo "$ac_t""yes" 1>&6
7111     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7112   cat >> confdefs.h <<EOF
7113 #define $ac_tr_hdr 1
7114 EOF
7115  
7116 else
7117   echo "$ac_t""no" 1>&6
7118 fi
7119 done
7120
7121                 fi
7122
7123                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7124                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7125 echo "configure:7126: checking for pthread_create in default libraries" >&5
7126 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7127   echo $ac_n "(cached) $ac_c" 1>&6
7128 else
7129   
7130                 if test "$cross_compiling" = yes; then
7131   cat > conftest.$ac_ext <<EOF
7132 #line 7133 "configure"
7133 #include "confdefs.h"
7134 /* pthread test headers */
7135 #include <pthread.h>
7136 #ifndef NULL
7137 #define NULL (void*)0
7138 #endif
7139
7140 static void *task(p)
7141         void *p;
7142 {
7143         return (void *) (p == NULL);
7144 }
7145
7146 int main() {
7147
7148         /* pthread test function */
7149         pthread_t t;
7150         int status;
7151         int detach = 1;
7152
7153 #ifdef HAVE_PTHREADS_FINAL
7154         /* Final pthreads */
7155         pthread_attr_t attr;
7156
7157         status = pthread_attr_init(&attr);
7158         if( status ) return status;
7159
7160 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7161         if( !detach ) {
7162 #if defined( PTHREAD_CREATE_JOINABLE )
7163                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7164 #else
7165                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7166 #endif
7167
7168 #ifdef PTHREAD_CREATE_DETACHED
7169         } else {
7170                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7171 #endif
7172         }
7173         if( status ) return status;
7174 #endif
7175
7176         status = pthread_create( &t, &attr, task, NULL );
7177         if( status ) return status;
7178
7179 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7180         if( detach ) {
7181                 /* give thread a chance to complete */
7182                 /* it should remain joinable and hence detachable */
7183                 sleep( 1 );
7184
7185                 status = pthread_detach( t );
7186                 if( status ) return status;
7187         }
7188 #endif
7189
7190 #else
7191         /* Draft 4 pthreads */
7192         status = pthread_create( &t, pthread_attr_default, task, NULL );
7193         if( status ) return status;
7194
7195         if( detach ) {
7196                 /* give thread a chance to complete */
7197                 /* it should remain joinable and hence detachable */
7198                 sleep( 1 );
7199
7200                 status = pthread_detach( &t );
7201                 if( status ) return status;
7202         }
7203 #endif
7204
7205 #ifdef HAVE_LINUX_THREADS
7206         pthread_kill_other_threads_np();
7207 #endif
7208
7209         return 0;
7210
7211 ; return 0; }
7212 EOF
7213 if { (eval echo configure:7214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7214   rm -rf conftest*
7215   ol_cv_pthread_create=yes
7216 else
7217   echo "configure: failed program was:" >&5
7218   cat conftest.$ac_ext >&5
7219   rm -rf conftest*
7220   ol_cv_pthread_create=no
7221 fi
7222 rm -f conftest*
7223 else
7224   cat > conftest.$ac_ext <<EOF
7225 #line 7226 "configure"
7226 #include "confdefs.h"
7227 /* pthread test headers */
7228 #include <pthread.h>
7229 #ifndef NULL
7230 #define NULL (void*)0
7231 #endif
7232
7233 static void *task(p)
7234         void *p;
7235 {
7236         return (void *) (p == NULL);
7237 }
7238
7239
7240 int main(argc, argv)
7241         int argc;
7242         char **argv;
7243 {
7244
7245         /* pthread test function */
7246         pthread_t t;
7247         int status;
7248         int detach = 1;
7249
7250 #ifdef HAVE_PTHREADS_FINAL
7251         /* Final pthreads */
7252         pthread_attr_t attr;
7253
7254         status = pthread_attr_init(&attr);
7255         if( status ) return status;
7256
7257 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7258         if( !detach ) {
7259 #if defined( PTHREAD_CREATE_JOINABLE )
7260                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7261 #else
7262                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7263 #endif
7264
7265 #ifdef PTHREAD_CREATE_DETACHED
7266         } else {
7267                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7268 #endif
7269         }
7270         if( status ) return status;
7271 #endif
7272
7273         status = pthread_create( &t, &attr, task, NULL );
7274         if( status ) return status;
7275
7276 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7277         if( detach ) {
7278                 /* give thread a chance to complete */
7279                 /* it should remain joinable and hence detachable */
7280                 sleep( 1 );
7281
7282                 status = pthread_detach( t );
7283                 if( status ) return status;
7284         }
7285 #endif
7286
7287 #else
7288         /* Draft 4 pthreads */
7289         status = pthread_create( &t, pthread_attr_default, task, NULL );
7290         if( status ) return status;
7291
7292         if( detach ) {
7293                 /* give thread a chance to complete */
7294                 /* it should remain joinable and hence detachable */
7295                 sleep( 1 );
7296
7297                 status = pthread_detach( &t );
7298                 if( status ) return status;
7299         }
7300 #endif
7301
7302 #ifdef HAVE_LINUX_THREADS
7303         pthread_kill_other_threads_np();
7304 #endif
7305
7306         return 0;
7307
7308 }
7309
7310 EOF
7311 if { (eval echo configure:7312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7312 then
7313   ol_cv_pthread_create=yes
7314 else
7315   echo "configure: failed program was:" >&5
7316   cat conftest.$ac_ext >&5
7317   rm -fr conftest*
7318   ol_cv_pthread_create=no
7319 fi
7320 rm -fr conftest*
7321 fi
7322
7323 fi
7324
7325 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7326
7327                 if test $ol_cv_pthread_create != no ; then
7328                         ol_link_threads=posix
7329                         ol_link_pthreads=""
7330                 fi
7331                 
7332                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7333 if test "$ol_link_threads" = no ; then
7334         # try -kthread
7335         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7336 echo "configure:7337: checking for pthread link with -kthread" >&5
7337 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7338   echo $ac_n "(cached) $ac_c" 1>&6
7339 else
7340   
7341                 # save the flags
7342                 ol_LIBS="$LIBS"
7343                 LIBS="-kthread $LIBS"
7344
7345                 if test "$cross_compiling" = yes; then
7346   cat > conftest.$ac_ext <<EOF
7347 #line 7348 "configure"
7348 #include "confdefs.h"
7349 /* pthread test headers */
7350 #include <pthread.h>
7351 #ifndef NULL
7352 #define NULL (void*)0
7353 #endif
7354
7355 static void *task(p)
7356         void *p;
7357 {
7358         return (void *) (p == NULL);
7359 }
7360
7361 int main() {
7362
7363         /* pthread test function */
7364         pthread_t t;
7365         int status;
7366         int detach = 1;
7367
7368 #ifdef HAVE_PTHREADS_FINAL
7369         /* Final pthreads */
7370         pthread_attr_t attr;
7371
7372         status = pthread_attr_init(&attr);
7373         if( status ) return status;
7374
7375 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7376         if( !detach ) {
7377 #if defined( PTHREAD_CREATE_JOINABLE )
7378                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7379 #else
7380                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7381 #endif
7382
7383 #ifdef PTHREAD_CREATE_DETACHED
7384         } else {
7385                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7386 #endif
7387         }
7388         if( status ) return status;
7389 #endif
7390
7391         status = pthread_create( &t, &attr, task, NULL );
7392         if( status ) return status;
7393
7394 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7395         if( detach ) {
7396                 /* give thread a chance to complete */
7397                 /* it should remain joinable and hence detachable */
7398                 sleep( 1 );
7399
7400                 status = pthread_detach( t );
7401                 if( status ) return status;
7402         }
7403 #endif
7404
7405 #else
7406         /* Draft 4 pthreads */
7407         status = pthread_create( &t, pthread_attr_default, task, NULL );
7408         if( status ) return status;
7409
7410         if( detach ) {
7411                 /* give thread a chance to complete */
7412                 /* it should remain joinable and hence detachable */
7413                 sleep( 1 );
7414
7415                 status = pthread_detach( &t );
7416                 if( status ) return status;
7417         }
7418 #endif
7419
7420 #ifdef HAVE_LINUX_THREADS
7421         pthread_kill_other_threads_np();
7422 #endif
7423
7424         return 0;
7425
7426 ; return 0; }
7427 EOF
7428 if { (eval echo configure:7429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7429   rm -rf conftest*
7430   ol_cv_pthread_kthread=yes
7431 else
7432   echo "configure: failed program was:" >&5
7433   cat conftest.$ac_ext >&5
7434   rm -rf conftest*
7435   ol_cv_pthread_kthread=no
7436 fi
7437 rm -f conftest*
7438 else
7439   cat > conftest.$ac_ext <<EOF
7440 #line 7441 "configure"
7441 #include "confdefs.h"
7442 /* pthread test headers */
7443 #include <pthread.h>
7444 #ifndef NULL
7445 #define NULL (void*)0
7446 #endif
7447
7448 static void *task(p)
7449         void *p;
7450 {
7451         return (void *) (p == NULL);
7452 }
7453
7454
7455 int main(argc, argv)
7456         int argc;
7457         char **argv;
7458 {
7459
7460         /* pthread test function */
7461         pthread_t t;
7462         int status;
7463         int detach = 1;
7464
7465 #ifdef HAVE_PTHREADS_FINAL
7466         /* Final pthreads */
7467         pthread_attr_t attr;
7468
7469         status = pthread_attr_init(&attr);
7470         if( status ) return status;
7471
7472 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7473         if( !detach ) {
7474 #if defined( PTHREAD_CREATE_JOINABLE )
7475                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7476 #else
7477                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7478 #endif
7479
7480 #ifdef PTHREAD_CREATE_DETACHED
7481         } else {
7482                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7483 #endif
7484         }
7485         if( status ) return status;
7486 #endif
7487
7488         status = pthread_create( &t, &attr, task, NULL );
7489         if( status ) return status;
7490
7491 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7492         if( detach ) {
7493                 /* give thread a chance to complete */
7494                 /* it should remain joinable and hence detachable */
7495                 sleep( 1 );
7496
7497                 status = pthread_detach( t );
7498                 if( status ) return status;
7499         }
7500 #endif
7501
7502 #else
7503         /* Draft 4 pthreads */
7504         status = pthread_create( &t, pthread_attr_default, task, NULL );
7505         if( status ) return status;
7506
7507         if( detach ) {
7508                 /* give thread a chance to complete */
7509                 /* it should remain joinable and hence detachable */
7510                 sleep( 1 );
7511
7512                 status = pthread_detach( &t );
7513                 if( status ) return status;
7514         }
7515 #endif
7516
7517 #ifdef HAVE_LINUX_THREADS
7518         pthread_kill_other_threads_np();
7519 #endif
7520
7521         return 0;
7522
7523 }
7524
7525 EOF
7526 if { (eval echo configure:7527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7527 then
7528   ol_cv_pthread_kthread=yes
7529 else
7530   echo "configure: failed program was:" >&5
7531   cat conftest.$ac_ext >&5
7532   rm -fr conftest*
7533   ol_cv_pthread_kthread=no
7534 fi
7535 rm -fr conftest*
7536 fi
7537
7538
7539                 # restore the LIBS
7540                 LIBS="$ol_LIBS"
7541         
7542 fi
7543
7544 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7545
7546         if test $ol_cv_pthread_kthread = yes ; then
7547                 ol_link_pthreads="-kthread"
7548                 ol_link_threads=posix
7549         fi
7550 fi
7551
7552                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7553 if test "$ol_link_threads" = no ; then
7554         # try -pthread
7555         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7556 echo "configure:7557: checking for pthread link with -pthread" >&5
7557 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7558   echo $ac_n "(cached) $ac_c" 1>&6
7559 else
7560   
7561                 # save the flags
7562                 ol_LIBS="$LIBS"
7563                 LIBS="-pthread $LIBS"
7564
7565                 if test "$cross_compiling" = yes; then
7566   cat > conftest.$ac_ext <<EOF
7567 #line 7568 "configure"
7568 #include "confdefs.h"
7569 /* pthread test headers */
7570 #include <pthread.h>
7571 #ifndef NULL
7572 #define NULL (void*)0
7573 #endif
7574
7575 static void *task(p)
7576         void *p;
7577 {
7578         return (void *) (p == NULL);
7579 }
7580
7581 int main() {
7582
7583         /* pthread test function */
7584         pthread_t t;
7585         int status;
7586         int detach = 1;
7587
7588 #ifdef HAVE_PTHREADS_FINAL
7589         /* Final pthreads */
7590         pthread_attr_t attr;
7591
7592         status = pthread_attr_init(&attr);
7593         if( status ) return status;
7594
7595 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7596         if( !detach ) {
7597 #if defined( PTHREAD_CREATE_JOINABLE )
7598                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7599 #else
7600                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7601 #endif
7602
7603 #ifdef PTHREAD_CREATE_DETACHED
7604         } else {
7605                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7606 #endif
7607         }
7608         if( status ) return status;
7609 #endif
7610
7611         status = pthread_create( &t, &attr, task, NULL );
7612         if( status ) return status;
7613
7614 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7615         if( detach ) {
7616                 /* give thread a chance to complete */
7617                 /* it should remain joinable and hence detachable */
7618                 sleep( 1 );
7619
7620                 status = pthread_detach( t );
7621                 if( status ) return status;
7622         }
7623 #endif
7624
7625 #else
7626         /* Draft 4 pthreads */
7627         status = pthread_create( &t, pthread_attr_default, task, NULL );
7628         if( status ) return status;
7629
7630         if( detach ) {
7631                 /* give thread a chance to complete */
7632                 /* it should remain joinable and hence detachable */
7633                 sleep( 1 );
7634
7635                 status = pthread_detach( &t );
7636                 if( status ) return status;
7637         }
7638 #endif
7639
7640 #ifdef HAVE_LINUX_THREADS
7641         pthread_kill_other_threads_np();
7642 #endif
7643
7644         return 0;
7645
7646 ; return 0; }
7647 EOF
7648 if { (eval echo configure:7649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7649   rm -rf conftest*
7650   ol_cv_pthread_pthread=yes
7651 else
7652   echo "configure: failed program was:" >&5
7653   cat conftest.$ac_ext >&5
7654   rm -rf conftest*
7655   ol_cv_pthread_pthread=no
7656 fi
7657 rm -f conftest*
7658 else
7659   cat > conftest.$ac_ext <<EOF
7660 #line 7661 "configure"
7661 #include "confdefs.h"
7662 /* pthread test headers */
7663 #include <pthread.h>
7664 #ifndef NULL
7665 #define NULL (void*)0
7666 #endif
7667
7668 static void *task(p)
7669         void *p;
7670 {
7671         return (void *) (p == NULL);
7672 }
7673
7674
7675 int main(argc, argv)
7676         int argc;
7677         char **argv;
7678 {
7679
7680         /* pthread test function */
7681         pthread_t t;
7682         int status;
7683         int detach = 1;
7684
7685 #ifdef HAVE_PTHREADS_FINAL
7686         /* Final pthreads */
7687         pthread_attr_t attr;
7688
7689         status = pthread_attr_init(&attr);
7690         if( status ) return status;
7691
7692 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7693         if( !detach ) {
7694 #if defined( PTHREAD_CREATE_JOINABLE )
7695                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7696 #else
7697                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7698 #endif
7699
7700 #ifdef PTHREAD_CREATE_DETACHED
7701         } else {
7702                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7703 #endif
7704         }
7705         if( status ) return status;
7706 #endif
7707
7708         status = pthread_create( &t, &attr, task, NULL );
7709         if( status ) return status;
7710
7711 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7712         if( detach ) {
7713                 /* give thread a chance to complete */
7714                 /* it should remain joinable and hence detachable */
7715                 sleep( 1 );
7716
7717                 status = pthread_detach( t );
7718                 if( status ) return status;
7719         }
7720 #endif
7721
7722 #else
7723         /* Draft 4 pthreads */
7724         status = pthread_create( &t, pthread_attr_default, task, NULL );
7725         if( status ) return status;
7726
7727         if( detach ) {
7728                 /* give thread a chance to complete */
7729                 /* it should remain joinable and hence detachable */
7730                 sleep( 1 );
7731
7732                 status = pthread_detach( &t );
7733                 if( status ) return status;
7734         }
7735 #endif
7736
7737 #ifdef HAVE_LINUX_THREADS
7738         pthread_kill_other_threads_np();
7739 #endif
7740
7741         return 0;
7742
7743 }
7744
7745 EOF
7746 if { (eval echo configure:7747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7747 then
7748   ol_cv_pthread_pthread=yes
7749 else
7750   echo "configure: failed program was:" >&5
7751   cat conftest.$ac_ext >&5
7752   rm -fr conftest*
7753   ol_cv_pthread_pthread=no
7754 fi
7755 rm -fr conftest*
7756 fi
7757
7758
7759                 # restore the LIBS
7760                 LIBS="$ol_LIBS"
7761         
7762 fi
7763
7764 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7765
7766         if test $ol_cv_pthread_pthread = yes ; then
7767                 ol_link_pthreads="-pthread"
7768                 ol_link_threads=posix
7769         fi
7770 fi
7771
7772                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7773 if test "$ol_link_threads" = no ; then
7774         # try -pthreads
7775         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7776 echo "configure:7777: checking for pthread link with -pthreads" >&5
7777 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7778   echo $ac_n "(cached) $ac_c" 1>&6
7779 else
7780   
7781                 # save the flags
7782                 ol_LIBS="$LIBS"
7783                 LIBS="-pthreads $LIBS"
7784
7785                 if test "$cross_compiling" = yes; then
7786   cat > conftest.$ac_ext <<EOF
7787 #line 7788 "configure"
7788 #include "confdefs.h"
7789 /* pthread test headers */
7790 #include <pthread.h>
7791 #ifndef NULL
7792 #define NULL (void*)0
7793 #endif
7794
7795 static void *task(p)
7796         void *p;
7797 {
7798         return (void *) (p == NULL);
7799 }
7800
7801 int main() {
7802
7803         /* pthread test function */
7804         pthread_t t;
7805         int status;
7806         int detach = 1;
7807
7808 #ifdef HAVE_PTHREADS_FINAL
7809         /* Final pthreads */
7810         pthread_attr_t attr;
7811
7812         status = pthread_attr_init(&attr);
7813         if( status ) return status;
7814
7815 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7816         if( !detach ) {
7817 #if defined( PTHREAD_CREATE_JOINABLE )
7818                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7819 #else
7820                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7821 #endif
7822
7823 #ifdef PTHREAD_CREATE_DETACHED
7824         } else {
7825                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7826 #endif
7827         }
7828         if( status ) return status;
7829 #endif
7830
7831         status = pthread_create( &t, &attr, task, NULL );
7832         if( status ) return status;
7833
7834 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7835         if( detach ) {
7836                 /* give thread a chance to complete */
7837                 /* it should remain joinable and hence detachable */
7838                 sleep( 1 );
7839
7840                 status = pthread_detach( t );
7841                 if( status ) return status;
7842         }
7843 #endif
7844
7845 #else
7846         /* Draft 4 pthreads */
7847         status = pthread_create( &t, pthread_attr_default, task, NULL );
7848         if( status ) return status;
7849
7850         if( detach ) {
7851                 /* give thread a chance to complete */
7852                 /* it should remain joinable and hence detachable */
7853                 sleep( 1 );
7854
7855                 status = pthread_detach( &t );
7856                 if( status ) return status;
7857         }
7858 #endif
7859
7860 #ifdef HAVE_LINUX_THREADS
7861         pthread_kill_other_threads_np();
7862 #endif
7863
7864         return 0;
7865
7866 ; return 0; }
7867 EOF
7868 if { (eval echo configure:7869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7869   rm -rf conftest*
7870   ol_cv_pthread_pthreads=yes
7871 else
7872   echo "configure: failed program was:" >&5
7873   cat conftest.$ac_ext >&5
7874   rm -rf conftest*
7875   ol_cv_pthread_pthreads=no
7876 fi
7877 rm -f conftest*
7878 else
7879   cat > conftest.$ac_ext <<EOF
7880 #line 7881 "configure"
7881 #include "confdefs.h"
7882 /* pthread test headers */
7883 #include <pthread.h>
7884 #ifndef NULL
7885 #define NULL (void*)0
7886 #endif
7887
7888 static void *task(p)
7889         void *p;
7890 {
7891         return (void *) (p == NULL);
7892 }
7893
7894
7895 int main(argc, argv)
7896         int argc;
7897         char **argv;
7898 {
7899
7900         /* pthread test function */
7901         pthread_t t;
7902         int status;
7903         int detach = 1;
7904
7905 #ifdef HAVE_PTHREADS_FINAL
7906         /* Final pthreads */
7907         pthread_attr_t attr;
7908
7909         status = pthread_attr_init(&attr);
7910         if( status ) return status;
7911
7912 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
7913         if( !detach ) {
7914 #if defined( PTHREAD_CREATE_JOINABLE )
7915                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
7916 #else
7917                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
7918 #endif
7919
7920 #ifdef PTHREAD_CREATE_DETACHED
7921         } else {
7922                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
7923 #endif
7924         }
7925         if( status ) return status;
7926 #endif
7927
7928         status = pthread_create( &t, &attr, task, NULL );
7929         if( status ) return status;
7930
7931 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
7932         if( detach ) {
7933                 /* give thread a chance to complete */
7934                 /* it should remain joinable and hence detachable */
7935                 sleep( 1 );
7936
7937                 status = pthread_detach( t );
7938                 if( status ) return status;
7939         }
7940 #endif
7941
7942 #else
7943         /* Draft 4 pthreads */
7944         status = pthread_create( &t, pthread_attr_default, task, NULL );
7945         if( status ) return status;
7946
7947         if( detach ) {
7948                 /* give thread a chance to complete */
7949                 /* it should remain joinable and hence detachable */
7950                 sleep( 1 );
7951
7952                 status = pthread_detach( &t );
7953                 if( status ) return status;
7954         }
7955 #endif
7956
7957 #ifdef HAVE_LINUX_THREADS
7958         pthread_kill_other_threads_np();
7959 #endif
7960
7961         return 0;
7962
7963 }
7964
7965 EOF
7966 if { (eval echo configure:7967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7967 then
7968   ol_cv_pthread_pthreads=yes
7969 else
7970   echo "configure: failed program was:" >&5
7971   cat conftest.$ac_ext >&5
7972   rm -fr conftest*
7973   ol_cv_pthread_pthreads=no
7974 fi
7975 rm -fr conftest*
7976 fi
7977
7978
7979                 # restore the LIBS
7980                 LIBS="$ol_LIBS"
7981         
7982 fi
7983
7984 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7985
7986         if test $ol_cv_pthread_pthreads = yes ; then
7987                 ol_link_pthreads="-pthreads"
7988                 ol_link_threads=posix
7989         fi
7990 fi
7991
7992                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7993 if test "$ol_link_threads" = no ; then
7994         # try -mthreads
7995         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7996 echo "configure:7997: checking for pthread link with -mthreads" >&5
7997 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7998   echo $ac_n "(cached) $ac_c" 1>&6
7999 else
8000   
8001                 # save the flags
8002                 ol_LIBS="$LIBS"
8003                 LIBS="-mthreads $LIBS"
8004
8005                 if test "$cross_compiling" = yes; then
8006   cat > conftest.$ac_ext <<EOF
8007 #line 8008 "configure"
8008 #include "confdefs.h"
8009 /* pthread test headers */
8010 #include <pthread.h>
8011 #ifndef NULL
8012 #define NULL (void*)0
8013 #endif
8014
8015 static void *task(p)
8016         void *p;
8017 {
8018         return (void *) (p == NULL);
8019 }
8020
8021 int main() {
8022
8023         /* pthread test function */
8024         pthread_t t;
8025         int status;
8026         int detach = 1;
8027
8028 #ifdef HAVE_PTHREADS_FINAL
8029         /* Final pthreads */
8030         pthread_attr_t attr;
8031
8032         status = pthread_attr_init(&attr);
8033         if( status ) return status;
8034
8035 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8036         if( !detach ) {
8037 #if defined( PTHREAD_CREATE_JOINABLE )
8038                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8039 #else
8040                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8041 #endif
8042
8043 #ifdef PTHREAD_CREATE_DETACHED
8044         } else {
8045                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8046 #endif
8047         }
8048         if( status ) return status;
8049 #endif
8050
8051         status = pthread_create( &t, &attr, task, NULL );
8052         if( status ) return status;
8053
8054 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8055         if( detach ) {
8056                 /* give thread a chance to complete */
8057                 /* it should remain joinable and hence detachable */
8058                 sleep( 1 );
8059
8060                 status = pthread_detach( t );
8061                 if( status ) return status;
8062         }
8063 #endif
8064
8065 #else
8066         /* Draft 4 pthreads */
8067         status = pthread_create( &t, pthread_attr_default, task, NULL );
8068         if( status ) return status;
8069
8070         if( detach ) {
8071                 /* give thread a chance to complete */
8072                 /* it should remain joinable and hence detachable */
8073                 sleep( 1 );
8074
8075                 status = pthread_detach( &t );
8076                 if( status ) return status;
8077         }
8078 #endif
8079
8080 #ifdef HAVE_LINUX_THREADS
8081         pthread_kill_other_threads_np();
8082 #endif
8083
8084         return 0;
8085
8086 ; return 0; }
8087 EOF
8088 if { (eval echo configure:8089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8089   rm -rf conftest*
8090   ol_cv_pthread_mthreads=yes
8091 else
8092   echo "configure: failed program was:" >&5
8093   cat conftest.$ac_ext >&5
8094   rm -rf conftest*
8095   ol_cv_pthread_mthreads=no
8096 fi
8097 rm -f conftest*
8098 else
8099   cat > conftest.$ac_ext <<EOF
8100 #line 8101 "configure"
8101 #include "confdefs.h"
8102 /* pthread test headers */
8103 #include <pthread.h>
8104 #ifndef NULL
8105 #define NULL (void*)0
8106 #endif
8107
8108 static void *task(p)
8109         void *p;
8110 {
8111         return (void *) (p == NULL);
8112 }
8113
8114
8115 int main(argc, argv)
8116         int argc;
8117         char **argv;
8118 {
8119
8120         /* pthread test function */
8121         pthread_t t;
8122         int status;
8123         int detach = 1;
8124
8125 #ifdef HAVE_PTHREADS_FINAL
8126         /* Final pthreads */
8127         pthread_attr_t attr;
8128
8129         status = pthread_attr_init(&attr);
8130         if( status ) return status;
8131
8132 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8133         if( !detach ) {
8134 #if defined( PTHREAD_CREATE_JOINABLE )
8135                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8136 #else
8137                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8138 #endif
8139
8140 #ifdef PTHREAD_CREATE_DETACHED
8141         } else {
8142                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8143 #endif
8144         }
8145         if( status ) return status;
8146 #endif
8147
8148         status = pthread_create( &t, &attr, task, NULL );
8149         if( status ) return status;
8150
8151 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8152         if( detach ) {
8153                 /* give thread a chance to complete */
8154                 /* it should remain joinable and hence detachable */
8155                 sleep( 1 );
8156
8157                 status = pthread_detach( t );
8158                 if( status ) return status;
8159         }
8160 #endif
8161
8162 #else
8163         /* Draft 4 pthreads */
8164         status = pthread_create( &t, pthread_attr_default, task, NULL );
8165         if( status ) return status;
8166
8167         if( detach ) {
8168                 /* give thread a chance to complete */
8169                 /* it should remain joinable and hence detachable */
8170                 sleep( 1 );
8171
8172                 status = pthread_detach( &t );
8173                 if( status ) return status;
8174         }
8175 #endif
8176
8177 #ifdef HAVE_LINUX_THREADS
8178         pthread_kill_other_threads_np();
8179 #endif
8180
8181         return 0;
8182
8183 }
8184
8185 EOF
8186 if { (eval echo configure:8187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8187 then
8188   ol_cv_pthread_mthreads=yes
8189 else
8190   echo "configure: failed program was:" >&5
8191   cat conftest.$ac_ext >&5
8192   rm -fr conftest*
8193   ol_cv_pthread_mthreads=no
8194 fi
8195 rm -fr conftest*
8196 fi
8197
8198
8199                 # restore the LIBS
8200                 LIBS="$ol_LIBS"
8201         
8202 fi
8203
8204 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
8205
8206         if test $ol_cv_pthread_mthreads = yes ; then
8207                 ol_link_pthreads="-mthreads"
8208                 ol_link_threads=posix
8209         fi
8210 fi
8211
8212                 # Pthread try link: -thread (ol_cv_pthread_thread)
8213 if test "$ol_link_threads" = no ; then
8214         # try -thread
8215         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8216 echo "configure:8217: checking for pthread link with -thread" >&5
8217 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8218   echo $ac_n "(cached) $ac_c" 1>&6
8219 else
8220   
8221                 # save the flags
8222                 ol_LIBS="$LIBS"
8223                 LIBS="-thread $LIBS"
8224
8225                 if test "$cross_compiling" = yes; then
8226   cat > conftest.$ac_ext <<EOF
8227 #line 8228 "configure"
8228 #include "confdefs.h"
8229 /* pthread test headers */
8230 #include <pthread.h>
8231 #ifndef NULL
8232 #define NULL (void*)0
8233 #endif
8234
8235 static void *task(p)
8236         void *p;
8237 {
8238         return (void *) (p == NULL);
8239 }
8240
8241 int main() {
8242
8243         /* pthread test function */
8244         pthread_t t;
8245         int status;
8246         int detach = 1;
8247
8248 #ifdef HAVE_PTHREADS_FINAL
8249         /* Final pthreads */
8250         pthread_attr_t attr;
8251
8252         status = pthread_attr_init(&attr);
8253         if( status ) return status;
8254
8255 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8256         if( !detach ) {
8257 #if defined( PTHREAD_CREATE_JOINABLE )
8258                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8259 #else
8260                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8261 #endif
8262
8263 #ifdef PTHREAD_CREATE_DETACHED
8264         } else {
8265                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8266 #endif
8267         }
8268         if( status ) return status;
8269 #endif
8270
8271         status = pthread_create( &t, &attr, task, NULL );
8272         if( status ) return status;
8273
8274 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8275         if( detach ) {
8276                 /* give thread a chance to complete */
8277                 /* it should remain joinable and hence detachable */
8278                 sleep( 1 );
8279
8280                 status = pthread_detach( t );
8281                 if( status ) return status;
8282         }
8283 #endif
8284
8285 #else
8286         /* Draft 4 pthreads */
8287         status = pthread_create( &t, pthread_attr_default, task, NULL );
8288         if( status ) return status;
8289
8290         if( detach ) {
8291                 /* give thread a chance to complete */
8292                 /* it should remain joinable and hence detachable */
8293                 sleep( 1 );
8294
8295                 status = pthread_detach( &t );
8296                 if( status ) return status;
8297         }
8298 #endif
8299
8300 #ifdef HAVE_LINUX_THREADS
8301         pthread_kill_other_threads_np();
8302 #endif
8303
8304         return 0;
8305
8306 ; return 0; }
8307 EOF
8308 if { (eval echo configure:8309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8309   rm -rf conftest*
8310   ol_cv_pthread_thread=yes
8311 else
8312   echo "configure: failed program was:" >&5
8313   cat conftest.$ac_ext >&5
8314   rm -rf conftest*
8315   ol_cv_pthread_thread=no
8316 fi
8317 rm -f conftest*
8318 else
8319   cat > conftest.$ac_ext <<EOF
8320 #line 8321 "configure"
8321 #include "confdefs.h"
8322 /* pthread test headers */
8323 #include <pthread.h>
8324 #ifndef NULL
8325 #define NULL (void*)0
8326 #endif
8327
8328 static void *task(p)
8329         void *p;
8330 {
8331         return (void *) (p == NULL);
8332 }
8333
8334
8335 int main(argc, argv)
8336         int argc;
8337         char **argv;
8338 {
8339
8340         /* pthread test function */
8341         pthread_t t;
8342         int status;
8343         int detach = 1;
8344
8345 #ifdef HAVE_PTHREADS_FINAL
8346         /* Final pthreads */
8347         pthread_attr_t attr;
8348
8349         status = pthread_attr_init(&attr);
8350         if( status ) return status;
8351
8352 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8353         if( !detach ) {
8354 #if defined( PTHREAD_CREATE_JOINABLE )
8355                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8356 #else
8357                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8358 #endif
8359
8360 #ifdef PTHREAD_CREATE_DETACHED
8361         } else {
8362                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8363 #endif
8364         }
8365         if( status ) return status;
8366 #endif
8367
8368         status = pthread_create( &t, &attr, task, NULL );
8369         if( status ) return status;
8370
8371 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8372         if( detach ) {
8373                 /* give thread a chance to complete */
8374                 /* it should remain joinable and hence detachable */
8375                 sleep( 1 );
8376
8377                 status = pthread_detach( t );
8378                 if( status ) return status;
8379         }
8380 #endif
8381
8382 #else
8383         /* Draft 4 pthreads */
8384         status = pthread_create( &t, pthread_attr_default, task, NULL );
8385         if( status ) return status;
8386
8387         if( detach ) {
8388                 /* give thread a chance to complete */
8389                 /* it should remain joinable and hence detachable */
8390                 sleep( 1 );
8391
8392                 status = pthread_detach( &t );
8393                 if( status ) return status;
8394         }
8395 #endif
8396
8397 #ifdef HAVE_LINUX_THREADS
8398         pthread_kill_other_threads_np();
8399 #endif
8400
8401         return 0;
8402
8403 }
8404
8405 EOF
8406 if { (eval echo configure:8407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8407 then
8408   ol_cv_pthread_thread=yes
8409 else
8410   echo "configure: failed program was:" >&5
8411   cat conftest.$ac_ext >&5
8412   rm -fr conftest*
8413   ol_cv_pthread_thread=no
8414 fi
8415 rm -fr conftest*
8416 fi
8417
8418
8419                 # restore the LIBS
8420                 LIBS="$ol_LIBS"
8421         
8422 fi
8423
8424 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8425
8426         if test $ol_cv_pthread_thread = yes ; then
8427                 ol_link_pthreads="-thread"
8428                 ol_link_threads=posix
8429         fi
8430 fi
8431
8432
8433                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8434 if test "$ol_link_threads" = no ; then
8435         # try -lpthread -lmach -lexc -lc_r
8436         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8437 echo "configure:8438: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8438 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8439   echo $ac_n "(cached) $ac_c" 1>&6
8440 else
8441   
8442                 # save the flags
8443                 ol_LIBS="$LIBS"
8444                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8445
8446                 if test "$cross_compiling" = yes; then
8447   cat > conftest.$ac_ext <<EOF
8448 #line 8449 "configure"
8449 #include "confdefs.h"
8450 /* pthread test headers */
8451 #include <pthread.h>
8452 #ifndef NULL
8453 #define NULL (void*)0
8454 #endif
8455
8456 static void *task(p)
8457         void *p;
8458 {
8459         return (void *) (p == NULL);
8460 }
8461
8462 int main() {
8463
8464         /* pthread test function */
8465         pthread_t t;
8466         int status;
8467         int detach = 1;
8468
8469 #ifdef HAVE_PTHREADS_FINAL
8470         /* Final pthreads */
8471         pthread_attr_t attr;
8472
8473         status = pthread_attr_init(&attr);
8474         if( status ) return status;
8475
8476 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8477         if( !detach ) {
8478 #if defined( PTHREAD_CREATE_JOINABLE )
8479                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8480 #else
8481                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8482 #endif
8483
8484 #ifdef PTHREAD_CREATE_DETACHED
8485         } else {
8486                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8487 #endif
8488         }
8489         if( status ) return status;
8490 #endif
8491
8492         status = pthread_create( &t, &attr, task, NULL );
8493         if( status ) return status;
8494
8495 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8496         if( detach ) {
8497                 /* give thread a chance to complete */
8498                 /* it should remain joinable and hence detachable */
8499                 sleep( 1 );
8500
8501                 status = pthread_detach( t );
8502                 if( status ) return status;
8503         }
8504 #endif
8505
8506 #else
8507         /* Draft 4 pthreads */
8508         status = pthread_create( &t, pthread_attr_default, task, NULL );
8509         if( status ) return status;
8510
8511         if( detach ) {
8512                 /* give thread a chance to complete */
8513                 /* it should remain joinable and hence detachable */
8514                 sleep( 1 );
8515
8516                 status = pthread_detach( &t );
8517                 if( status ) return status;
8518         }
8519 #endif
8520
8521 #ifdef HAVE_LINUX_THREADS
8522         pthread_kill_other_threads_np();
8523 #endif
8524
8525         return 0;
8526
8527 ; return 0; }
8528 EOF
8529 if { (eval echo configure:8530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8530   rm -rf conftest*
8531   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8532 else
8533   echo "configure: failed program was:" >&5
8534   cat conftest.$ac_ext >&5
8535   rm -rf conftest*
8536   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8537 fi
8538 rm -f conftest*
8539 else
8540   cat > conftest.$ac_ext <<EOF
8541 #line 8542 "configure"
8542 #include "confdefs.h"
8543 /* pthread test headers */
8544 #include <pthread.h>
8545 #ifndef NULL
8546 #define NULL (void*)0
8547 #endif
8548
8549 static void *task(p)
8550         void *p;
8551 {
8552         return (void *) (p == NULL);
8553 }
8554
8555
8556 int main(argc, argv)
8557         int argc;
8558         char **argv;
8559 {
8560
8561         /* pthread test function */
8562         pthread_t t;
8563         int status;
8564         int detach = 1;
8565
8566 #ifdef HAVE_PTHREADS_FINAL
8567         /* Final pthreads */
8568         pthread_attr_t attr;
8569
8570         status = pthread_attr_init(&attr);
8571         if( status ) return status;
8572
8573 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8574         if( !detach ) {
8575 #if defined( PTHREAD_CREATE_JOINABLE )
8576                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8577 #else
8578                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8579 #endif
8580
8581 #ifdef PTHREAD_CREATE_DETACHED
8582         } else {
8583                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8584 #endif
8585         }
8586         if( status ) return status;
8587 #endif
8588
8589         status = pthread_create( &t, &attr, task, NULL );
8590         if( status ) return status;
8591
8592 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8593         if( detach ) {
8594                 /* give thread a chance to complete */
8595                 /* it should remain joinable and hence detachable */
8596                 sleep( 1 );
8597
8598                 status = pthread_detach( t );
8599                 if( status ) return status;
8600         }
8601 #endif
8602
8603 #else
8604         /* Draft 4 pthreads */
8605         status = pthread_create( &t, pthread_attr_default, task, NULL );
8606         if( status ) return status;
8607
8608         if( detach ) {
8609                 /* give thread a chance to complete */
8610                 /* it should remain joinable and hence detachable */
8611                 sleep( 1 );
8612
8613                 status = pthread_detach( &t );
8614                 if( status ) return status;
8615         }
8616 #endif
8617
8618 #ifdef HAVE_LINUX_THREADS
8619         pthread_kill_other_threads_np();
8620 #endif
8621
8622         return 0;
8623
8624 }
8625
8626 EOF
8627 if { (eval echo configure:8628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8628 then
8629   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8630 else
8631   echo "configure: failed program was:" >&5
8632   cat conftest.$ac_ext >&5
8633   rm -fr conftest*
8634   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8635 fi
8636 rm -fr conftest*
8637 fi
8638
8639
8640                 # restore the LIBS
8641                 LIBS="$ol_LIBS"
8642         
8643 fi
8644
8645 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8646
8647         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8648                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8649                 ol_link_threads=posix
8650         fi
8651 fi
8652
8653                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8654 if test "$ol_link_threads" = no ; then
8655         # try -lpthread -lmach -lexc
8656         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8657 echo "configure:8658: checking for pthread link with -lpthread -lmach -lexc" >&5
8658 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8659   echo $ac_n "(cached) $ac_c" 1>&6
8660 else
8661   
8662                 # save the flags
8663                 ol_LIBS="$LIBS"
8664                 LIBS="-lpthread -lmach -lexc $LIBS"
8665
8666                 if test "$cross_compiling" = yes; then
8667   cat > conftest.$ac_ext <<EOF
8668 #line 8669 "configure"
8669 #include "confdefs.h"
8670 /* pthread test headers */
8671 #include <pthread.h>
8672 #ifndef NULL
8673 #define NULL (void*)0
8674 #endif
8675
8676 static void *task(p)
8677         void *p;
8678 {
8679         return (void *) (p == NULL);
8680 }
8681
8682 int main() {
8683
8684         /* pthread test function */
8685         pthread_t t;
8686         int status;
8687         int detach = 1;
8688
8689 #ifdef HAVE_PTHREADS_FINAL
8690         /* Final pthreads */
8691         pthread_attr_t attr;
8692
8693         status = pthread_attr_init(&attr);
8694         if( status ) return status;
8695
8696 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8697         if( !detach ) {
8698 #if defined( PTHREAD_CREATE_JOINABLE )
8699                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8700 #else
8701                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8702 #endif
8703
8704 #ifdef PTHREAD_CREATE_DETACHED
8705         } else {
8706                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8707 #endif
8708         }
8709         if( status ) return status;
8710 #endif
8711
8712         status = pthread_create( &t, &attr, task, NULL );
8713         if( status ) return status;
8714
8715 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8716         if( detach ) {
8717                 /* give thread a chance to complete */
8718                 /* it should remain joinable and hence detachable */
8719                 sleep( 1 );
8720
8721                 status = pthread_detach( t );
8722                 if( status ) return status;
8723         }
8724 #endif
8725
8726 #else
8727         /* Draft 4 pthreads */
8728         status = pthread_create( &t, pthread_attr_default, task, NULL );
8729         if( status ) return status;
8730
8731         if( detach ) {
8732                 /* give thread a chance to complete */
8733                 /* it should remain joinable and hence detachable */
8734                 sleep( 1 );
8735
8736                 status = pthread_detach( &t );
8737                 if( status ) return status;
8738         }
8739 #endif
8740
8741 #ifdef HAVE_LINUX_THREADS
8742         pthread_kill_other_threads_np();
8743 #endif
8744
8745         return 0;
8746
8747 ; return 0; }
8748 EOF
8749 if { (eval echo configure:8750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8750   rm -rf conftest*
8751   ol_cv_pthread_lpthread_lmach_lexc=yes
8752 else
8753   echo "configure: failed program was:" >&5
8754   cat conftest.$ac_ext >&5
8755   rm -rf conftest*
8756   ol_cv_pthread_lpthread_lmach_lexc=no
8757 fi
8758 rm -f conftest*
8759 else
8760   cat > conftest.$ac_ext <<EOF
8761 #line 8762 "configure"
8762 #include "confdefs.h"
8763 /* pthread test headers */
8764 #include <pthread.h>
8765 #ifndef NULL
8766 #define NULL (void*)0
8767 #endif
8768
8769 static void *task(p)
8770         void *p;
8771 {
8772         return (void *) (p == NULL);
8773 }
8774
8775
8776 int main(argc, argv)
8777         int argc;
8778         char **argv;
8779 {
8780
8781         /* pthread test function */
8782         pthread_t t;
8783         int status;
8784         int detach = 1;
8785
8786 #ifdef HAVE_PTHREADS_FINAL
8787         /* Final pthreads */
8788         pthread_attr_t attr;
8789
8790         status = pthread_attr_init(&attr);
8791         if( status ) return status;
8792
8793 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8794         if( !detach ) {
8795 #if defined( PTHREAD_CREATE_JOINABLE )
8796                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8797 #else
8798                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8799 #endif
8800
8801 #ifdef PTHREAD_CREATE_DETACHED
8802         } else {
8803                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8804 #endif
8805         }
8806         if( status ) return status;
8807 #endif
8808
8809         status = pthread_create( &t, &attr, task, NULL );
8810         if( status ) return status;
8811
8812 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8813         if( detach ) {
8814                 /* give thread a chance to complete */
8815                 /* it should remain joinable and hence detachable */
8816                 sleep( 1 );
8817
8818                 status = pthread_detach( t );
8819                 if( status ) return status;
8820         }
8821 #endif
8822
8823 #else
8824         /* Draft 4 pthreads */
8825         status = pthread_create( &t, pthread_attr_default, task, NULL );
8826         if( status ) return status;
8827
8828         if( detach ) {
8829                 /* give thread a chance to complete */
8830                 /* it should remain joinable and hence detachable */
8831                 sleep( 1 );
8832
8833                 status = pthread_detach( &t );
8834                 if( status ) return status;
8835         }
8836 #endif
8837
8838 #ifdef HAVE_LINUX_THREADS
8839         pthread_kill_other_threads_np();
8840 #endif
8841
8842         return 0;
8843
8844 }
8845
8846 EOF
8847 if { (eval echo configure:8848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8848 then
8849   ol_cv_pthread_lpthread_lmach_lexc=yes
8850 else
8851   echo "configure: failed program was:" >&5
8852   cat conftest.$ac_ext >&5
8853   rm -fr conftest*
8854   ol_cv_pthread_lpthread_lmach_lexc=no
8855 fi
8856 rm -fr conftest*
8857 fi
8858
8859
8860                 # restore the LIBS
8861                 LIBS="$ol_LIBS"
8862         
8863 fi
8864
8865 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8866
8867         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8868                 ol_link_pthreads="-lpthread -lmach -lexc"
8869                 ol_link_threads=posix
8870         fi
8871 fi
8872
8873
8874                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8875 if test "$ol_link_threads" = no ; then
8876         # try -lpthread -Wl,-woff,85
8877         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8878 echo "configure:8879: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8879 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8880   echo $ac_n "(cached) $ac_c" 1>&6
8881 else
8882   
8883                 # save the flags
8884                 ol_LIBS="$LIBS"
8885                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8886
8887                 if test "$cross_compiling" = yes; then
8888   cat > conftest.$ac_ext <<EOF
8889 #line 8890 "configure"
8890 #include "confdefs.h"
8891 /* pthread test headers */
8892 #include <pthread.h>
8893 #ifndef NULL
8894 #define NULL (void*)0
8895 #endif
8896
8897 static void *task(p)
8898         void *p;
8899 {
8900         return (void *) (p == NULL);
8901 }
8902
8903 int main() {
8904
8905         /* pthread test function */
8906         pthread_t t;
8907         int status;
8908         int detach = 1;
8909
8910 #ifdef HAVE_PTHREADS_FINAL
8911         /* Final pthreads */
8912         pthread_attr_t attr;
8913
8914         status = pthread_attr_init(&attr);
8915         if( status ) return status;
8916
8917 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
8918         if( !detach ) {
8919 #if defined( PTHREAD_CREATE_JOINABLE )
8920                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
8921 #else
8922                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
8923 #endif
8924
8925 #ifdef PTHREAD_CREATE_DETACHED
8926         } else {
8927                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
8928 #endif
8929         }
8930         if( status ) return status;
8931 #endif
8932
8933         status = pthread_create( &t, &attr, task, NULL );
8934         if( status ) return status;
8935
8936 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
8937         if( detach ) {
8938                 /* give thread a chance to complete */
8939                 /* it should remain joinable and hence detachable */
8940                 sleep( 1 );
8941
8942                 status = pthread_detach( t );
8943                 if( status ) return status;
8944         }
8945 #endif
8946
8947 #else
8948         /* Draft 4 pthreads */
8949         status = pthread_create( &t, pthread_attr_default, task, NULL );
8950         if( status ) return status;
8951
8952         if( detach ) {
8953                 /* give thread a chance to complete */
8954                 /* it should remain joinable and hence detachable */
8955                 sleep( 1 );
8956
8957                 status = pthread_detach( &t );
8958                 if( status ) return status;
8959         }
8960 #endif
8961
8962 #ifdef HAVE_LINUX_THREADS
8963         pthread_kill_other_threads_np();
8964 #endif
8965
8966         return 0;
8967
8968 ; return 0; }
8969 EOF
8970 if { (eval echo configure:8971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8971   rm -rf conftest*
8972   ol_cv_pthread_lib_lpthread_woff=yes
8973 else
8974   echo "configure: failed program was:" >&5
8975   cat conftest.$ac_ext >&5
8976   rm -rf conftest*
8977   ol_cv_pthread_lib_lpthread_woff=no
8978 fi
8979 rm -f conftest*
8980 else
8981   cat > conftest.$ac_ext <<EOF
8982 #line 8983 "configure"
8983 #include "confdefs.h"
8984 /* pthread test headers */
8985 #include <pthread.h>
8986 #ifndef NULL
8987 #define NULL (void*)0
8988 #endif
8989
8990 static void *task(p)
8991         void *p;
8992 {
8993         return (void *) (p == NULL);
8994 }
8995
8996
8997 int main(argc, argv)
8998         int argc;
8999         char **argv;
9000 {
9001
9002         /* pthread test function */
9003         pthread_t t;
9004         int status;
9005         int detach = 1;
9006
9007 #ifdef HAVE_PTHREADS_FINAL
9008         /* Final pthreads */
9009         pthread_attr_t attr;
9010
9011         status = pthread_attr_init(&attr);
9012         if( status ) return status;
9013
9014 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9015         if( !detach ) {
9016 #if defined( PTHREAD_CREATE_JOINABLE )
9017                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9018 #else
9019                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9020 #endif
9021
9022 #ifdef PTHREAD_CREATE_DETACHED
9023         } else {
9024                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9025 #endif
9026         }
9027         if( status ) return status;
9028 #endif
9029
9030         status = pthread_create( &t, &attr, task, NULL );
9031         if( status ) return status;
9032
9033 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9034         if( detach ) {
9035                 /* give thread a chance to complete */
9036                 /* it should remain joinable and hence detachable */
9037                 sleep( 1 );
9038
9039                 status = pthread_detach( t );
9040                 if( status ) return status;
9041         }
9042 #endif
9043
9044 #else
9045         /* Draft 4 pthreads */
9046         status = pthread_create( &t, pthread_attr_default, task, NULL );
9047         if( status ) return status;
9048
9049         if( detach ) {
9050                 /* give thread a chance to complete */
9051                 /* it should remain joinable and hence detachable */
9052                 sleep( 1 );
9053
9054                 status = pthread_detach( &t );
9055                 if( status ) return status;
9056         }
9057 #endif
9058
9059 #ifdef HAVE_LINUX_THREADS
9060         pthread_kill_other_threads_np();
9061 #endif
9062
9063         return 0;
9064
9065 }
9066
9067 EOF
9068 if { (eval echo configure:9069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9069 then
9070   ol_cv_pthread_lib_lpthread_woff=yes
9071 else
9072   echo "configure: failed program was:" >&5
9073   cat conftest.$ac_ext >&5
9074   rm -fr conftest*
9075   ol_cv_pthread_lib_lpthread_woff=no
9076 fi
9077 rm -fr conftest*
9078 fi
9079
9080
9081                 # restore the LIBS
9082                 LIBS="$ol_LIBS"
9083         
9084 fi
9085
9086 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
9087
9088         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
9089                 ol_link_pthreads="-lpthread -Wl,-woff,85"
9090                 ol_link_threads=posix
9091         fi
9092 fi
9093
9094
9095                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
9096 if test "$ol_link_threads" = no ; then
9097         # try -lpthread
9098         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
9099 echo "configure:9100: checking for pthread link with -lpthread" >&5
9100 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
9101   echo $ac_n "(cached) $ac_c" 1>&6
9102 else
9103   
9104                 # save the flags
9105                 ol_LIBS="$LIBS"
9106                 LIBS="-lpthread $LIBS"
9107
9108                 if test "$cross_compiling" = yes; then
9109   cat > conftest.$ac_ext <<EOF
9110 #line 9111 "configure"
9111 #include "confdefs.h"
9112 /* pthread test headers */
9113 #include <pthread.h>
9114 #ifndef NULL
9115 #define NULL (void*)0
9116 #endif
9117
9118 static void *task(p)
9119         void *p;
9120 {
9121         return (void *) (p == NULL);
9122 }
9123
9124 int main() {
9125
9126         /* pthread test function */
9127         pthread_t t;
9128         int status;
9129         int detach = 1;
9130
9131 #ifdef HAVE_PTHREADS_FINAL
9132         /* Final pthreads */
9133         pthread_attr_t attr;
9134
9135         status = pthread_attr_init(&attr);
9136         if( status ) return status;
9137
9138 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9139         if( !detach ) {
9140 #if defined( PTHREAD_CREATE_JOINABLE )
9141                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9142 #else
9143                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9144 #endif
9145
9146 #ifdef PTHREAD_CREATE_DETACHED
9147         } else {
9148                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9149 #endif
9150         }
9151         if( status ) return status;
9152 #endif
9153
9154         status = pthread_create( &t, &attr, task, NULL );
9155         if( status ) return status;
9156
9157 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9158         if( detach ) {
9159                 /* give thread a chance to complete */
9160                 /* it should remain joinable and hence detachable */
9161                 sleep( 1 );
9162
9163                 status = pthread_detach( t );
9164                 if( status ) return status;
9165         }
9166 #endif
9167
9168 #else
9169         /* Draft 4 pthreads */
9170         status = pthread_create( &t, pthread_attr_default, task, NULL );
9171         if( status ) return status;
9172
9173         if( detach ) {
9174                 /* give thread a chance to complete */
9175                 /* it should remain joinable and hence detachable */
9176                 sleep( 1 );
9177
9178                 status = pthread_detach( &t );
9179                 if( status ) return status;
9180         }
9181 #endif
9182
9183 #ifdef HAVE_LINUX_THREADS
9184         pthread_kill_other_threads_np();
9185 #endif
9186
9187         return 0;
9188
9189 ; return 0; }
9190 EOF
9191 if { (eval echo configure:9192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9192   rm -rf conftest*
9193   ol_cv_pthread_lpthread=yes
9194 else
9195   echo "configure: failed program was:" >&5
9196   cat conftest.$ac_ext >&5
9197   rm -rf conftest*
9198   ol_cv_pthread_lpthread=no
9199 fi
9200 rm -f conftest*
9201 else
9202   cat > conftest.$ac_ext <<EOF
9203 #line 9204 "configure"
9204 #include "confdefs.h"
9205 /* pthread test headers */
9206 #include <pthread.h>
9207 #ifndef NULL
9208 #define NULL (void*)0
9209 #endif
9210
9211 static void *task(p)
9212         void *p;
9213 {
9214         return (void *) (p == NULL);
9215 }
9216
9217
9218 int main(argc, argv)
9219         int argc;
9220         char **argv;
9221 {
9222
9223         /* pthread test function */
9224         pthread_t t;
9225         int status;
9226         int detach = 1;
9227
9228 #ifdef HAVE_PTHREADS_FINAL
9229         /* Final pthreads */
9230         pthread_attr_t attr;
9231
9232         status = pthread_attr_init(&attr);
9233         if( status ) return status;
9234
9235 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9236         if( !detach ) {
9237 #if defined( PTHREAD_CREATE_JOINABLE )
9238                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9239 #else
9240                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9241 #endif
9242
9243 #ifdef PTHREAD_CREATE_DETACHED
9244         } else {
9245                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9246 #endif
9247         }
9248         if( status ) return status;
9249 #endif
9250
9251         status = pthread_create( &t, &attr, task, NULL );
9252         if( status ) return status;
9253
9254 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9255         if( detach ) {
9256                 /* give thread a chance to complete */
9257                 /* it should remain joinable and hence detachable */
9258                 sleep( 1 );
9259
9260                 status = pthread_detach( t );
9261                 if( status ) return status;
9262         }
9263 #endif
9264
9265 #else
9266         /* Draft 4 pthreads */
9267         status = pthread_create( &t, pthread_attr_default, task, NULL );
9268         if( status ) return status;
9269
9270         if( detach ) {
9271                 /* give thread a chance to complete */
9272                 /* it should remain joinable and hence detachable */
9273                 sleep( 1 );
9274
9275                 status = pthread_detach( &t );
9276                 if( status ) return status;
9277         }
9278 #endif
9279
9280 #ifdef HAVE_LINUX_THREADS
9281         pthread_kill_other_threads_np();
9282 #endif
9283
9284         return 0;
9285
9286 }
9287
9288 EOF
9289 if { (eval echo configure:9290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9290 then
9291   ol_cv_pthread_lpthread=yes
9292 else
9293   echo "configure: failed program was:" >&5
9294   cat conftest.$ac_ext >&5
9295   rm -fr conftest*
9296   ol_cv_pthread_lpthread=no
9297 fi
9298 rm -fr conftest*
9299 fi
9300
9301
9302                 # restore the LIBS
9303                 LIBS="$ol_LIBS"
9304         
9305 fi
9306
9307 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
9308
9309         if test $ol_cv_pthread_lpthread = yes ; then
9310                 ol_link_pthreads="-lpthread"
9311                 ol_link_threads=posix
9312         fi
9313 fi
9314
9315                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
9316 if test "$ol_link_threads" = no ; then
9317         # try -lc_r
9318         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
9319 echo "configure:9320: checking for pthread link with -lc_r" >&5
9320 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
9321   echo $ac_n "(cached) $ac_c" 1>&6
9322 else
9323   
9324                 # save the flags
9325                 ol_LIBS="$LIBS"
9326                 LIBS="-lc_r $LIBS"
9327
9328                 if test "$cross_compiling" = yes; then
9329   cat > conftest.$ac_ext <<EOF
9330 #line 9331 "configure"
9331 #include "confdefs.h"
9332 /* pthread test headers */
9333 #include <pthread.h>
9334 #ifndef NULL
9335 #define NULL (void*)0
9336 #endif
9337
9338 static void *task(p)
9339         void *p;
9340 {
9341         return (void *) (p == NULL);
9342 }
9343
9344 int main() {
9345
9346         /* pthread test function */
9347         pthread_t t;
9348         int status;
9349         int detach = 1;
9350
9351 #ifdef HAVE_PTHREADS_FINAL
9352         /* Final pthreads */
9353         pthread_attr_t attr;
9354
9355         status = pthread_attr_init(&attr);
9356         if( status ) return status;
9357
9358 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9359         if( !detach ) {
9360 #if defined( PTHREAD_CREATE_JOINABLE )
9361                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9362 #else
9363                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9364 #endif
9365
9366 #ifdef PTHREAD_CREATE_DETACHED
9367         } else {
9368                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9369 #endif
9370         }
9371         if( status ) return status;
9372 #endif
9373
9374         status = pthread_create( &t, &attr, task, NULL );
9375         if( status ) return status;
9376
9377 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9378         if( detach ) {
9379                 /* give thread a chance to complete */
9380                 /* it should remain joinable and hence detachable */
9381                 sleep( 1 );
9382
9383                 status = pthread_detach( t );
9384                 if( status ) return status;
9385         }
9386 #endif
9387
9388 #else
9389         /* Draft 4 pthreads */
9390         status = pthread_create( &t, pthread_attr_default, task, NULL );
9391         if( status ) return status;
9392
9393         if( detach ) {
9394                 /* give thread a chance to complete */
9395                 /* it should remain joinable and hence detachable */
9396                 sleep( 1 );
9397
9398                 status = pthread_detach( &t );
9399                 if( status ) return status;
9400         }
9401 #endif
9402
9403 #ifdef HAVE_LINUX_THREADS
9404         pthread_kill_other_threads_np();
9405 #endif
9406
9407         return 0;
9408
9409 ; return 0; }
9410 EOF
9411 if { (eval echo configure:9412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9412   rm -rf conftest*
9413   ol_cv_pthread_lc_r=yes
9414 else
9415   echo "configure: failed program was:" >&5
9416   cat conftest.$ac_ext >&5
9417   rm -rf conftest*
9418   ol_cv_pthread_lc_r=no
9419 fi
9420 rm -f conftest*
9421 else
9422   cat > conftest.$ac_ext <<EOF
9423 #line 9424 "configure"
9424 #include "confdefs.h"
9425 /* pthread test headers */
9426 #include <pthread.h>
9427 #ifndef NULL
9428 #define NULL (void*)0
9429 #endif
9430
9431 static void *task(p)
9432         void *p;
9433 {
9434         return (void *) (p == NULL);
9435 }
9436
9437
9438 int main(argc, argv)
9439         int argc;
9440         char **argv;
9441 {
9442
9443         /* pthread test function */
9444         pthread_t t;
9445         int status;
9446         int detach = 1;
9447
9448 #ifdef HAVE_PTHREADS_FINAL
9449         /* Final pthreads */
9450         pthread_attr_t attr;
9451
9452         status = pthread_attr_init(&attr);
9453         if( status ) return status;
9454
9455 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9456         if( !detach ) {
9457 #if defined( PTHREAD_CREATE_JOINABLE )
9458                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9459 #else
9460                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9461 #endif
9462
9463 #ifdef PTHREAD_CREATE_DETACHED
9464         } else {
9465                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9466 #endif
9467         }
9468         if( status ) return status;
9469 #endif
9470
9471         status = pthread_create( &t, &attr, task, NULL );
9472         if( status ) return status;
9473
9474 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9475         if( detach ) {
9476                 /* give thread a chance to complete */
9477                 /* it should remain joinable and hence detachable */
9478                 sleep( 1 );
9479
9480                 status = pthread_detach( t );
9481                 if( status ) return status;
9482         }
9483 #endif
9484
9485 #else
9486         /* Draft 4 pthreads */
9487         status = pthread_create( &t, pthread_attr_default, task, NULL );
9488         if( status ) return status;
9489
9490         if( detach ) {
9491                 /* give thread a chance to complete */
9492                 /* it should remain joinable and hence detachable */
9493                 sleep( 1 );
9494
9495                 status = pthread_detach( &t );
9496                 if( status ) return status;
9497         }
9498 #endif
9499
9500 #ifdef HAVE_LINUX_THREADS
9501         pthread_kill_other_threads_np();
9502 #endif
9503
9504         return 0;
9505
9506 }
9507
9508 EOF
9509 if { (eval echo configure:9510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9510 then
9511   ol_cv_pthread_lc_r=yes
9512 else
9513   echo "configure: failed program was:" >&5
9514   cat conftest.$ac_ext >&5
9515   rm -fr conftest*
9516   ol_cv_pthread_lc_r=no
9517 fi
9518 rm -fr conftest*
9519 fi
9520
9521
9522                 # restore the LIBS
9523                 LIBS="$ol_LIBS"
9524         
9525 fi
9526
9527 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9528
9529         if test $ol_cv_pthread_lc_r = yes ; then
9530                 ol_link_pthreads="-lc_r"
9531                 ol_link_threads=posix
9532         fi
9533 fi
9534
9535
9536                 # Pthread try link: -threads (ol_cv_pthread_threads)
9537 if test "$ol_link_threads" = no ; then
9538         # try -threads
9539         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9540 echo "configure:9541: checking for pthread link with -threads" >&5
9541 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9542   echo $ac_n "(cached) $ac_c" 1>&6
9543 else
9544   
9545                 # save the flags
9546                 ol_LIBS="$LIBS"
9547                 LIBS="-threads $LIBS"
9548
9549                 if test "$cross_compiling" = yes; then
9550   cat > conftest.$ac_ext <<EOF
9551 #line 9552 "configure"
9552 #include "confdefs.h"
9553 /* pthread test headers */
9554 #include <pthread.h>
9555 #ifndef NULL
9556 #define NULL (void*)0
9557 #endif
9558
9559 static void *task(p)
9560         void *p;
9561 {
9562         return (void *) (p == NULL);
9563 }
9564
9565 int main() {
9566
9567         /* pthread test function */
9568         pthread_t t;
9569         int status;
9570         int detach = 1;
9571
9572 #ifdef HAVE_PTHREADS_FINAL
9573         /* Final pthreads */
9574         pthread_attr_t attr;
9575
9576         status = pthread_attr_init(&attr);
9577         if( status ) return status;
9578
9579 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9580         if( !detach ) {
9581 #if defined( PTHREAD_CREATE_JOINABLE )
9582                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9583 #else
9584                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9585 #endif
9586
9587 #ifdef PTHREAD_CREATE_DETACHED
9588         } else {
9589                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9590 #endif
9591         }
9592         if( status ) return status;
9593 #endif
9594
9595         status = pthread_create( &t, &attr, task, NULL );
9596         if( status ) return status;
9597
9598 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9599         if( detach ) {
9600                 /* give thread a chance to complete */
9601                 /* it should remain joinable and hence detachable */
9602                 sleep( 1 );
9603
9604                 status = pthread_detach( t );
9605                 if( status ) return status;
9606         }
9607 #endif
9608
9609 #else
9610         /* Draft 4 pthreads */
9611         status = pthread_create( &t, pthread_attr_default, task, NULL );
9612         if( status ) return status;
9613
9614         if( detach ) {
9615                 /* give thread a chance to complete */
9616                 /* it should remain joinable and hence detachable */
9617                 sleep( 1 );
9618
9619                 status = pthread_detach( &t );
9620                 if( status ) return status;
9621         }
9622 #endif
9623
9624 #ifdef HAVE_LINUX_THREADS
9625         pthread_kill_other_threads_np();
9626 #endif
9627
9628         return 0;
9629
9630 ; return 0; }
9631 EOF
9632 if { (eval echo configure:9633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9633   rm -rf conftest*
9634   ol_cv_pthread_threads=yes
9635 else
9636   echo "configure: failed program was:" >&5
9637   cat conftest.$ac_ext >&5
9638   rm -rf conftest*
9639   ol_cv_pthread_threads=no
9640 fi
9641 rm -f conftest*
9642 else
9643   cat > conftest.$ac_ext <<EOF
9644 #line 9645 "configure"
9645 #include "confdefs.h"
9646 /* pthread test headers */
9647 #include <pthread.h>
9648 #ifndef NULL
9649 #define NULL (void*)0
9650 #endif
9651
9652 static void *task(p)
9653         void *p;
9654 {
9655         return (void *) (p == NULL);
9656 }
9657
9658
9659 int main(argc, argv)
9660         int argc;
9661         char **argv;
9662 {
9663
9664         /* pthread test function */
9665         pthread_t t;
9666         int status;
9667         int detach = 1;
9668
9669 #ifdef HAVE_PTHREADS_FINAL
9670         /* Final pthreads */
9671         pthread_attr_t attr;
9672
9673         status = pthread_attr_init(&attr);
9674         if( status ) return status;
9675
9676 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9677         if( !detach ) {
9678 #if defined( PTHREAD_CREATE_JOINABLE )
9679                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9680 #else
9681                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9682 #endif
9683
9684 #ifdef PTHREAD_CREATE_DETACHED
9685         } else {
9686                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9687 #endif
9688         }
9689         if( status ) return status;
9690 #endif
9691
9692         status = pthread_create( &t, &attr, task, NULL );
9693         if( status ) return status;
9694
9695 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9696         if( detach ) {
9697                 /* give thread a chance to complete */
9698                 /* it should remain joinable and hence detachable */
9699                 sleep( 1 );
9700
9701                 status = pthread_detach( t );
9702                 if( status ) return status;
9703         }
9704 #endif
9705
9706 #else
9707         /* Draft 4 pthreads */
9708         status = pthread_create( &t, pthread_attr_default, task, NULL );
9709         if( status ) return status;
9710
9711         if( detach ) {
9712                 /* give thread a chance to complete */
9713                 /* it should remain joinable and hence detachable */
9714                 sleep( 1 );
9715
9716                 status = pthread_detach( &t );
9717                 if( status ) return status;
9718         }
9719 #endif
9720
9721 #ifdef HAVE_LINUX_THREADS
9722         pthread_kill_other_threads_np();
9723 #endif
9724
9725         return 0;
9726
9727 }
9728
9729 EOF
9730 if { (eval echo configure:9731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9731 then
9732   ol_cv_pthread_threads=yes
9733 else
9734   echo "configure: failed program was:" >&5
9735   cat conftest.$ac_ext >&5
9736   rm -fr conftest*
9737   ol_cv_pthread_threads=no
9738 fi
9739 rm -fr conftest*
9740 fi
9741
9742
9743                 # restore the LIBS
9744                 LIBS="$ol_LIBS"
9745         
9746 fi
9747
9748 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9749
9750         if test $ol_cv_pthread_threads = yes ; then
9751                 ol_link_pthreads="-threads"
9752                 ol_link_threads=posix
9753         fi
9754 fi
9755
9756
9757                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9758 if test "$ol_link_threads" = no ; then
9759         # try -lpthreads -lmach -lexc -lc_r
9760         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9761 echo "configure:9762: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9762 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9763   echo $ac_n "(cached) $ac_c" 1>&6
9764 else
9765   
9766                 # save the flags
9767                 ol_LIBS="$LIBS"
9768                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9769
9770                 if test "$cross_compiling" = yes; then
9771   cat > conftest.$ac_ext <<EOF
9772 #line 9773 "configure"
9773 #include "confdefs.h"
9774 /* pthread test headers */
9775 #include <pthread.h>
9776 #ifndef NULL
9777 #define NULL (void*)0
9778 #endif
9779
9780 static void *task(p)
9781         void *p;
9782 {
9783         return (void *) (p == NULL);
9784 }
9785
9786 int main() {
9787
9788         /* pthread test function */
9789         pthread_t t;
9790         int status;
9791         int detach = 1;
9792
9793 #ifdef HAVE_PTHREADS_FINAL
9794         /* Final pthreads */
9795         pthread_attr_t attr;
9796
9797         status = pthread_attr_init(&attr);
9798         if( status ) return status;
9799
9800 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9801         if( !detach ) {
9802 #if defined( PTHREAD_CREATE_JOINABLE )
9803                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9804 #else
9805                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9806 #endif
9807
9808 #ifdef PTHREAD_CREATE_DETACHED
9809         } else {
9810                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9811 #endif
9812         }
9813         if( status ) return status;
9814 #endif
9815
9816         status = pthread_create( &t, &attr, task, NULL );
9817         if( status ) return status;
9818
9819 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9820         if( detach ) {
9821                 /* give thread a chance to complete */
9822                 /* it should remain joinable and hence detachable */
9823                 sleep( 1 );
9824
9825                 status = pthread_detach( t );
9826                 if( status ) return status;
9827         }
9828 #endif
9829
9830 #else
9831         /* Draft 4 pthreads */
9832         status = pthread_create( &t, pthread_attr_default, task, NULL );
9833         if( status ) return status;
9834
9835         if( detach ) {
9836                 /* give thread a chance to complete */
9837                 /* it should remain joinable and hence detachable */
9838                 sleep( 1 );
9839
9840                 status = pthread_detach( &t );
9841                 if( status ) return status;
9842         }
9843 #endif
9844
9845 #ifdef HAVE_LINUX_THREADS
9846         pthread_kill_other_threads_np();
9847 #endif
9848
9849         return 0;
9850
9851 ; return 0; }
9852 EOF
9853 if { (eval echo configure:9854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9854   rm -rf conftest*
9855   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9856 else
9857   echo "configure: failed program was:" >&5
9858   cat conftest.$ac_ext >&5
9859   rm -rf conftest*
9860   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9861 fi
9862 rm -f conftest*
9863 else
9864   cat > conftest.$ac_ext <<EOF
9865 #line 9866 "configure"
9866 #include "confdefs.h"
9867 /* pthread test headers */
9868 #include <pthread.h>
9869 #ifndef NULL
9870 #define NULL (void*)0
9871 #endif
9872
9873 static void *task(p)
9874         void *p;
9875 {
9876         return (void *) (p == NULL);
9877 }
9878
9879
9880 int main(argc, argv)
9881         int argc;
9882         char **argv;
9883 {
9884
9885         /* pthread test function */
9886         pthread_t t;
9887         int status;
9888         int detach = 1;
9889
9890 #ifdef HAVE_PTHREADS_FINAL
9891         /* Final pthreads */
9892         pthread_attr_t attr;
9893
9894         status = pthread_attr_init(&attr);
9895         if( status ) return status;
9896
9897 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
9898         if( !detach ) {
9899 #if defined( PTHREAD_CREATE_JOINABLE )
9900                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
9901 #else
9902                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
9903 #endif
9904
9905 #ifdef PTHREAD_CREATE_DETACHED
9906         } else {
9907                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
9908 #endif
9909         }
9910         if( status ) return status;
9911 #endif
9912
9913         status = pthread_create( &t, &attr, task, NULL );
9914         if( status ) return status;
9915
9916 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
9917         if( detach ) {
9918                 /* give thread a chance to complete */
9919                 /* it should remain joinable and hence detachable */
9920                 sleep( 1 );
9921
9922                 status = pthread_detach( t );
9923                 if( status ) return status;
9924         }
9925 #endif
9926
9927 #else
9928         /* Draft 4 pthreads */
9929         status = pthread_create( &t, pthread_attr_default, task, NULL );
9930         if( status ) return status;
9931
9932         if( detach ) {
9933                 /* give thread a chance to complete */
9934                 /* it should remain joinable and hence detachable */
9935                 sleep( 1 );
9936
9937                 status = pthread_detach( &t );
9938                 if( status ) return status;
9939         }
9940 #endif
9941
9942 #ifdef HAVE_LINUX_THREADS
9943         pthread_kill_other_threads_np();
9944 #endif
9945
9946         return 0;
9947
9948 }
9949
9950 EOF
9951 if { (eval echo configure:9952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9952 then
9953   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9954 else
9955   echo "configure: failed program was:" >&5
9956   cat conftest.$ac_ext >&5
9957   rm -fr conftest*
9958   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9959 fi
9960 rm -fr conftest*
9961 fi
9962
9963
9964                 # restore the LIBS
9965                 LIBS="$ol_LIBS"
9966         
9967 fi
9968
9969 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9970
9971         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9972                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9973                 ol_link_threads=posix
9974         fi
9975 fi
9976
9977                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9978 if test "$ol_link_threads" = no ; then
9979         # try -lpthreads -lmach -lexc
9980         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9981 echo "configure:9982: checking for pthread link with -lpthreads -lmach -lexc" >&5
9982 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9983   echo $ac_n "(cached) $ac_c" 1>&6
9984 else
9985   
9986                 # save the flags
9987                 ol_LIBS="$LIBS"
9988                 LIBS="-lpthreads -lmach -lexc $LIBS"
9989
9990                 if test "$cross_compiling" = yes; then
9991   cat > conftest.$ac_ext <<EOF
9992 #line 9993 "configure"
9993 #include "confdefs.h"
9994 /* pthread test headers */
9995 #include <pthread.h>
9996 #ifndef NULL
9997 #define NULL (void*)0
9998 #endif
9999
10000 static void *task(p)
10001         void *p;
10002 {
10003         return (void *) (p == NULL);
10004 }
10005
10006 int main() {
10007
10008         /* pthread test function */
10009         pthread_t t;
10010         int status;
10011         int detach = 1;
10012
10013 #ifdef HAVE_PTHREADS_FINAL
10014         /* Final pthreads */
10015         pthread_attr_t attr;
10016
10017         status = pthread_attr_init(&attr);
10018         if( status ) return status;
10019
10020 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10021         if( !detach ) {
10022 #if defined( PTHREAD_CREATE_JOINABLE )
10023                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10024 #else
10025                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10026 #endif
10027
10028 #ifdef PTHREAD_CREATE_DETACHED
10029         } else {
10030                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10031 #endif
10032         }
10033         if( status ) return status;
10034 #endif
10035
10036         status = pthread_create( &t, &attr, task, NULL );
10037         if( status ) return status;
10038
10039 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10040         if( detach ) {
10041                 /* give thread a chance to complete */
10042                 /* it should remain joinable and hence detachable */
10043                 sleep( 1 );
10044
10045                 status = pthread_detach( t );
10046                 if( status ) return status;
10047         }
10048 #endif
10049
10050 #else
10051         /* Draft 4 pthreads */
10052         status = pthread_create( &t, pthread_attr_default, task, NULL );
10053         if( status ) return status;
10054
10055         if( detach ) {
10056                 /* give thread a chance to complete */
10057                 /* it should remain joinable and hence detachable */
10058                 sleep( 1 );
10059
10060                 status = pthread_detach( &t );
10061                 if( status ) return status;
10062         }
10063 #endif
10064
10065 #ifdef HAVE_LINUX_THREADS
10066         pthread_kill_other_threads_np();
10067 #endif
10068
10069         return 0;
10070
10071 ; return 0; }
10072 EOF
10073 if { (eval echo configure:10074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10074   rm -rf conftest*
10075   ol_cv_pthread_lpthreads_lmach_lexc=yes
10076 else
10077   echo "configure: failed program was:" >&5
10078   cat conftest.$ac_ext >&5
10079   rm -rf conftest*
10080   ol_cv_pthread_lpthreads_lmach_lexc=no
10081 fi
10082 rm -f conftest*
10083 else
10084   cat > conftest.$ac_ext <<EOF
10085 #line 10086 "configure"
10086 #include "confdefs.h"
10087 /* pthread test headers */
10088 #include <pthread.h>
10089 #ifndef NULL
10090 #define NULL (void*)0
10091 #endif
10092
10093 static void *task(p)
10094         void *p;
10095 {
10096         return (void *) (p == NULL);
10097 }
10098
10099
10100 int main(argc, argv)
10101         int argc;
10102         char **argv;
10103 {
10104
10105         /* pthread test function */
10106         pthread_t t;
10107         int status;
10108         int detach = 1;
10109
10110 #ifdef HAVE_PTHREADS_FINAL
10111         /* Final pthreads */
10112         pthread_attr_t attr;
10113
10114         status = pthread_attr_init(&attr);
10115         if( status ) return status;
10116
10117 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10118         if( !detach ) {
10119 #if defined( PTHREAD_CREATE_JOINABLE )
10120                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10121 #else
10122                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10123 #endif
10124
10125 #ifdef PTHREAD_CREATE_DETACHED
10126         } else {
10127                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10128 #endif
10129         }
10130         if( status ) return status;
10131 #endif
10132
10133         status = pthread_create( &t, &attr, task, NULL );
10134         if( status ) return status;
10135
10136 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10137         if( detach ) {
10138                 /* give thread a chance to complete */
10139                 /* it should remain joinable and hence detachable */
10140                 sleep( 1 );
10141
10142                 status = pthread_detach( t );
10143                 if( status ) return status;
10144         }
10145 #endif
10146
10147 #else
10148         /* Draft 4 pthreads */
10149         status = pthread_create( &t, pthread_attr_default, task, NULL );
10150         if( status ) return status;
10151
10152         if( detach ) {
10153                 /* give thread a chance to complete */
10154                 /* it should remain joinable and hence detachable */
10155                 sleep( 1 );
10156
10157                 status = pthread_detach( &t );
10158                 if( status ) return status;
10159         }
10160 #endif
10161
10162 #ifdef HAVE_LINUX_THREADS
10163         pthread_kill_other_threads_np();
10164 #endif
10165
10166         return 0;
10167
10168 }
10169
10170 EOF
10171 if { (eval echo configure:10172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10172 then
10173   ol_cv_pthread_lpthreads_lmach_lexc=yes
10174 else
10175   echo "configure: failed program was:" >&5
10176   cat conftest.$ac_ext >&5
10177   rm -fr conftest*
10178   ol_cv_pthread_lpthreads_lmach_lexc=no
10179 fi
10180 rm -fr conftest*
10181 fi
10182
10183
10184                 # restore the LIBS
10185                 LIBS="$ol_LIBS"
10186         
10187 fi
10188
10189 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
10190
10191         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
10192                 ol_link_pthreads="-lpthreads -lmach -lexc"
10193                 ol_link_threads=posix
10194         fi
10195 fi
10196
10197                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
10198 if test "$ol_link_threads" = no ; then
10199         # try -lpthreads -lexc
10200         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
10201 echo "configure:10202: checking for pthread link with -lpthreads -lexc" >&5
10202 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
10203   echo $ac_n "(cached) $ac_c" 1>&6
10204 else
10205   
10206                 # save the flags
10207                 ol_LIBS="$LIBS"
10208                 LIBS="-lpthreads -lexc $LIBS"
10209
10210                 if test "$cross_compiling" = yes; then
10211   cat > conftest.$ac_ext <<EOF
10212 #line 10213 "configure"
10213 #include "confdefs.h"
10214 /* pthread test headers */
10215 #include <pthread.h>
10216 #ifndef NULL
10217 #define NULL (void*)0
10218 #endif
10219
10220 static void *task(p)
10221         void *p;
10222 {
10223         return (void *) (p == NULL);
10224 }
10225
10226 int main() {
10227
10228         /* pthread test function */
10229         pthread_t t;
10230         int status;
10231         int detach = 1;
10232
10233 #ifdef HAVE_PTHREADS_FINAL
10234         /* Final pthreads */
10235         pthread_attr_t attr;
10236
10237         status = pthread_attr_init(&attr);
10238         if( status ) return status;
10239
10240 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10241         if( !detach ) {
10242 #if defined( PTHREAD_CREATE_JOINABLE )
10243                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10244 #else
10245                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10246 #endif
10247
10248 #ifdef PTHREAD_CREATE_DETACHED
10249         } else {
10250                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10251 #endif
10252         }
10253         if( status ) return status;
10254 #endif
10255
10256         status = pthread_create( &t, &attr, task, NULL );
10257         if( status ) return status;
10258
10259 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10260         if( detach ) {
10261                 /* give thread a chance to complete */
10262                 /* it should remain joinable and hence detachable */
10263                 sleep( 1 );
10264
10265                 status = pthread_detach( t );
10266                 if( status ) return status;
10267         }
10268 #endif
10269
10270 #else
10271         /* Draft 4 pthreads */
10272         status = pthread_create( &t, pthread_attr_default, task, NULL );
10273         if( status ) return status;
10274
10275         if( detach ) {
10276                 /* give thread a chance to complete */
10277                 /* it should remain joinable and hence detachable */
10278                 sleep( 1 );
10279
10280                 status = pthread_detach( &t );
10281                 if( status ) return status;
10282         }
10283 #endif
10284
10285 #ifdef HAVE_LINUX_THREADS
10286         pthread_kill_other_threads_np();
10287 #endif
10288
10289         return 0;
10290
10291 ; return 0; }
10292 EOF
10293 if { (eval echo configure:10294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10294   rm -rf conftest*
10295   ol_cv_pthread_lpthreads_lexc=yes
10296 else
10297   echo "configure: failed program was:" >&5
10298   cat conftest.$ac_ext >&5
10299   rm -rf conftest*
10300   ol_cv_pthread_lpthreads_lexc=no
10301 fi
10302 rm -f conftest*
10303 else
10304   cat > conftest.$ac_ext <<EOF
10305 #line 10306 "configure"
10306 #include "confdefs.h"
10307 /* pthread test headers */
10308 #include <pthread.h>
10309 #ifndef NULL
10310 #define NULL (void*)0
10311 #endif
10312
10313 static void *task(p)
10314         void *p;
10315 {
10316         return (void *) (p == NULL);
10317 }
10318
10319
10320 int main(argc, argv)
10321         int argc;
10322         char **argv;
10323 {
10324
10325         /* pthread test function */
10326         pthread_t t;
10327         int status;
10328         int detach = 1;
10329
10330 #ifdef HAVE_PTHREADS_FINAL
10331         /* Final pthreads */
10332         pthread_attr_t attr;
10333
10334         status = pthread_attr_init(&attr);
10335         if( status ) return status;
10336
10337 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10338         if( !detach ) {
10339 #if defined( PTHREAD_CREATE_JOINABLE )
10340                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10341 #else
10342                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10343 #endif
10344
10345 #ifdef PTHREAD_CREATE_DETACHED
10346         } else {
10347                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10348 #endif
10349         }
10350         if( status ) return status;
10351 #endif
10352
10353         status = pthread_create( &t, &attr, task, NULL );
10354         if( status ) return status;
10355
10356 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10357         if( detach ) {
10358                 /* give thread a chance to complete */
10359                 /* it should remain joinable and hence detachable */
10360                 sleep( 1 );
10361
10362                 status = pthread_detach( t );
10363                 if( status ) return status;
10364         }
10365 #endif
10366
10367 #else
10368         /* Draft 4 pthreads */
10369         status = pthread_create( &t, pthread_attr_default, task, NULL );
10370         if( status ) return status;
10371
10372         if( detach ) {
10373                 /* give thread a chance to complete */
10374                 /* it should remain joinable and hence detachable */
10375                 sleep( 1 );
10376
10377                 status = pthread_detach( &t );
10378                 if( status ) return status;
10379         }
10380 #endif
10381
10382 #ifdef HAVE_LINUX_THREADS
10383         pthread_kill_other_threads_np();
10384 #endif
10385
10386         return 0;
10387
10388 }
10389
10390 EOF
10391 if { (eval echo configure:10392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10392 then
10393   ol_cv_pthread_lpthreads_lexc=yes
10394 else
10395   echo "configure: failed program was:" >&5
10396   cat conftest.$ac_ext >&5
10397   rm -fr conftest*
10398   ol_cv_pthread_lpthreads_lexc=no
10399 fi
10400 rm -fr conftest*
10401 fi
10402
10403
10404                 # restore the LIBS
10405                 LIBS="$ol_LIBS"
10406         
10407 fi
10408
10409 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
10410
10411         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
10412                 ol_link_pthreads="-lpthreads -lexc"
10413                 ol_link_threads=posix
10414         fi
10415 fi
10416
10417
10418                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
10419 if test "$ol_link_threads" = no ; then
10420         # try -lpthreads
10421         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
10422 echo "configure:10423: checking for pthread link with -lpthreads" >&5
10423 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
10424   echo $ac_n "(cached) $ac_c" 1>&6
10425 else
10426   
10427                 # save the flags
10428                 ol_LIBS="$LIBS"
10429                 LIBS="-lpthreads $LIBS"
10430
10431                 if test "$cross_compiling" = yes; then
10432   cat > conftest.$ac_ext <<EOF
10433 #line 10434 "configure"
10434 #include "confdefs.h"
10435 /* pthread test headers */
10436 #include <pthread.h>
10437 #ifndef NULL
10438 #define NULL (void*)0
10439 #endif
10440
10441 static void *task(p)
10442         void *p;
10443 {
10444         return (void *) (p == NULL);
10445 }
10446
10447 int main() {
10448
10449         /* pthread test function */
10450         pthread_t t;
10451         int status;
10452         int detach = 1;
10453
10454 #ifdef HAVE_PTHREADS_FINAL
10455         /* Final pthreads */
10456         pthread_attr_t attr;
10457
10458         status = pthread_attr_init(&attr);
10459         if( status ) return status;
10460
10461 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10462         if( !detach ) {
10463 #if defined( PTHREAD_CREATE_JOINABLE )
10464                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10465 #else
10466                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10467 #endif
10468
10469 #ifdef PTHREAD_CREATE_DETACHED
10470         } else {
10471                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10472 #endif
10473         }
10474         if( status ) return status;
10475 #endif
10476
10477         status = pthread_create( &t, &attr, task, NULL );
10478         if( status ) return status;
10479
10480 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10481         if( detach ) {
10482                 /* give thread a chance to complete */
10483                 /* it should remain joinable and hence detachable */
10484                 sleep( 1 );
10485
10486                 status = pthread_detach( t );
10487                 if( status ) return status;
10488         }
10489 #endif
10490
10491 #else
10492         /* Draft 4 pthreads */
10493         status = pthread_create( &t, pthread_attr_default, task, NULL );
10494         if( status ) return status;
10495
10496         if( detach ) {
10497                 /* give thread a chance to complete */
10498                 /* it should remain joinable and hence detachable */
10499                 sleep( 1 );
10500
10501                 status = pthread_detach( &t );
10502                 if( status ) return status;
10503         }
10504 #endif
10505
10506 #ifdef HAVE_LINUX_THREADS
10507         pthread_kill_other_threads_np();
10508 #endif
10509
10510         return 0;
10511
10512 ; return 0; }
10513 EOF
10514 if { (eval echo configure:10515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10515   rm -rf conftest*
10516   ol_cv_pthread_lib_lpthreads=yes
10517 else
10518   echo "configure: failed program was:" >&5
10519   cat conftest.$ac_ext >&5
10520   rm -rf conftest*
10521   ol_cv_pthread_lib_lpthreads=no
10522 fi
10523 rm -f conftest*
10524 else
10525   cat > conftest.$ac_ext <<EOF
10526 #line 10527 "configure"
10527 #include "confdefs.h"
10528 /* pthread test headers */
10529 #include <pthread.h>
10530 #ifndef NULL
10531 #define NULL (void*)0
10532 #endif
10533
10534 static void *task(p)
10535         void *p;
10536 {
10537         return (void *) (p == NULL);
10538 }
10539
10540
10541 int main(argc, argv)
10542         int argc;
10543         char **argv;
10544 {
10545
10546         /* pthread test function */
10547         pthread_t t;
10548         int status;
10549         int detach = 1;
10550
10551 #ifdef HAVE_PTHREADS_FINAL
10552         /* Final pthreads */
10553         pthread_attr_t attr;
10554
10555         status = pthread_attr_init(&attr);
10556         if( status ) return status;
10557
10558 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
10559         if( !detach ) {
10560 #if defined( PTHREAD_CREATE_JOINABLE )
10561                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
10562 #else
10563                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
10564 #endif
10565
10566 #ifdef PTHREAD_CREATE_DETACHED
10567         } else {
10568                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
10569 #endif
10570         }
10571         if( status ) return status;
10572 #endif
10573
10574         status = pthread_create( &t, &attr, task, NULL );
10575         if( status ) return status;
10576
10577 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
10578         if( detach ) {
10579                 /* give thread a chance to complete */
10580                 /* it should remain joinable and hence detachable */
10581                 sleep( 1 );
10582
10583                 status = pthread_detach( t );
10584                 if( status ) return status;
10585         }
10586 #endif
10587
10588 #else
10589         /* Draft 4 pthreads */
10590         status = pthread_create( &t, pthread_attr_default, task, NULL );
10591         if( status ) return status;
10592
10593         if( detach ) {
10594                 /* give thread a chance to complete */
10595                 /* it should remain joinable and hence detachable */
10596                 sleep( 1 );
10597
10598                 status = pthread_detach( &t );
10599                 if( status ) return status;
10600         }
10601 #endif
10602
10603 #ifdef HAVE_LINUX_THREADS
10604         pthread_kill_other_threads_np();
10605 #endif
10606
10607         return 0;
10608
10609 }
10610
10611 EOF
10612 if { (eval echo configure:10613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10613 then
10614   ol_cv_pthread_lib_lpthreads=yes
10615 else
10616   echo "configure: failed program was:" >&5
10617   cat conftest.$ac_ext >&5
10618   rm -fr conftest*
10619   ol_cv_pthread_lib_lpthreads=no
10620 fi
10621 rm -fr conftest*
10622 fi
10623
10624
10625                 # restore the LIBS
10626                 LIBS="$ol_LIBS"
10627         
10628 fi
10629
10630 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
10631
10632         if test $ol_cv_pthread_lib_lpthreads = yes ; then
10633                 ol_link_pthreads="-lpthreads"
10634                 ol_link_threads=posix
10635         fi
10636 fi
10637
10638
10639                 if test $ol_link_threads != no ; then
10640                         cat >> confdefs.h <<\EOF
10641 #define HAVE_PTHREADS 1
10642 EOF
10643
10644
10645                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
10646
10647                                                 save_CPPFLAGS="$CPPFLAGS"
10648                         save_LIBS="$LIBS"
10649                         LIBS="$LTHREAD_LIBS $LIBS"
10650
10651                                                                                                 for ac_func in sched_yield pthread_yield
10652 do
10653 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10654 echo "configure:10655: checking for $ac_func" >&5
10655 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10656   echo $ac_n "(cached) $ac_c" 1>&6
10657 else
10658   cat > conftest.$ac_ext <<EOF
10659 #line 10660 "configure"
10660 #include "confdefs.h"
10661 /* System header to define __stub macros and hopefully few prototypes,
10662     which can conflict with char $ac_func(); below.  */
10663 #include <assert.h>
10664 /* Override any gcc2 internal prototype to avoid an error.  */
10665 /* We use char because int might match the return type of a gcc2
10666     builtin and then its argument prototype would still apply.  */
10667 char $ac_func();
10668 char (*f)();
10669
10670 int main() {
10671
10672 /* The GNU C library defines this for functions which it implements
10673     to always fail with ENOSYS.  Some functions are actually named
10674     something starting with __ and the normal name is an alias.  */
10675 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10676 choke me
10677 #else
10678 f = $ac_func;
10679 #endif
10680
10681 ; return 0; }
10682 EOF
10683 if { (eval echo configure:10684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10684   rm -rf conftest*
10685   eval "ac_cv_func_$ac_func=yes"
10686 else
10687   echo "configure: failed program was:" >&5
10688   cat conftest.$ac_ext >&5
10689   rm -rf conftest*
10690   eval "ac_cv_func_$ac_func=no"
10691 fi
10692 rm -f conftest*
10693 fi
10694
10695 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10696   echo "$ac_t""yes" 1>&6
10697     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10698   cat >> confdefs.h <<EOF
10699 #define $ac_tr_func 1
10700 EOF
10701  
10702 else
10703   echo "$ac_t""no" 1>&6
10704 fi
10705 done
10706
10707
10708                         if test $ac_cv_func_sched_yield = no -a \
10709                                 $ac_cv_func_pthread_yield = no ; then
10710                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10711 echo "configure:10712: checking for sched_yield in -lrt" >&5
10712 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10713 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10714   echo $ac_n "(cached) $ac_c" 1>&6
10715 else
10716   ac_save_LIBS="$LIBS"
10717 LIBS="-lrt  $LIBS"
10718 cat > conftest.$ac_ext <<EOF
10719 #line 10720 "configure"
10720 #include "confdefs.h"
10721 /* Override any gcc2 internal prototype to avoid an error.  */
10722 /* We use char because int might match the return type of a gcc2
10723     builtin and then its argument prototype would still apply.  */
10724 char sched_yield();
10725
10726 int main() {
10727 sched_yield()
10728 ; return 0; }
10729 EOF
10730 if { (eval echo configure:10731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10731   rm -rf conftest*
10732   eval "ac_cv_lib_$ac_lib_var=yes"
10733 else
10734   echo "configure: failed program was:" >&5
10735   cat conftest.$ac_ext >&5
10736   rm -rf conftest*
10737   eval "ac_cv_lib_$ac_lib_var=no"
10738 fi
10739 rm -f conftest*
10740 LIBS="$ac_save_LIBS"
10741
10742 fi
10743 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10744   echo "$ac_t""yes" 1>&6
10745   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10746                                         cat >> confdefs.h <<\EOF
10747 #define HAVE_SCHED_YIELD 1
10748 EOF
10749
10750                                         ac_cv_func_sched_yield=yes
10751 else
10752   echo "$ac_t""no" 1>&6
10753 ac_cv_func_sched_yield=no
10754 fi
10755
10756                         fi
10757                         if test $ac_cv_func_sched_yield = no -a \
10758                                 $ac_cv_func_pthread_yield = no ; then
10759                                                                                                 for ac_func in thr_yield
10760 do
10761 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10762 echo "configure:10763: checking for $ac_func" >&5
10763 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10764   echo $ac_n "(cached) $ac_c" 1>&6
10765 else
10766   cat > conftest.$ac_ext <<EOF
10767 #line 10768 "configure"
10768 #include "confdefs.h"
10769 /* System header to define __stub macros and hopefully few prototypes,
10770     which can conflict with char $ac_func(); below.  */
10771 #include <assert.h>
10772 /* Override any gcc2 internal prototype to avoid an error.  */
10773 /* We use char because int might match the return type of a gcc2
10774     builtin and then its argument prototype would still apply.  */
10775 char $ac_func();
10776 char (*f)();
10777
10778 int main() {
10779
10780 /* The GNU C library defines this for functions which it implements
10781     to always fail with ENOSYS.  Some functions are actually named
10782     something starting with __ and the normal name is an alias.  */
10783 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10784 choke me
10785 #else
10786 f = $ac_func;
10787 #endif
10788
10789 ; return 0; }
10790 EOF
10791 if { (eval echo configure:10792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10792   rm -rf conftest*
10793   eval "ac_cv_func_$ac_func=yes"
10794 else
10795   echo "configure: failed program was:" >&5
10796   cat conftest.$ac_ext >&5
10797   rm -rf conftest*
10798   eval "ac_cv_func_$ac_func=no"
10799 fi
10800 rm -f conftest*
10801 fi
10802
10803 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10804   echo "$ac_t""yes" 1>&6
10805     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10806   cat >> confdefs.h <<EOF
10807 #define $ac_tr_func 1
10808 EOF
10809  
10810 else
10811   echo "$ac_t""no" 1>&6
10812 fi
10813 done
10814
10815                         fi
10816                         if test $ac_cv_func_sched_yield = no -a \
10817                                 $ac_cv_func_pthread_yield = no -a \
10818                                 "$ac_cv_func_thr_yield" = no ; then
10819                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10820                         fi
10821
10822                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10823 do
10824 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10825 echo "configure:10826: checking for $ac_func" >&5
10826 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10827   echo $ac_n "(cached) $ac_c" 1>&6
10828 else
10829   cat > conftest.$ac_ext <<EOF
10830 #line 10831 "configure"
10831 #include "confdefs.h"
10832 /* System header to define __stub macros and hopefully few prototypes,
10833     which can conflict with char $ac_func(); below.  */
10834 #include <assert.h>
10835 /* Override any gcc2 internal prototype to avoid an error.  */
10836 /* We use char because int might match the return type of a gcc2
10837     builtin and then its argument prototype would still apply.  */
10838 char $ac_func();
10839 char (*f)();
10840
10841 int main() {
10842
10843 /* The GNU C library defines this for functions which it implements
10844     to always fail with ENOSYS.  Some functions are actually named
10845     something starting with __ and the normal name is an alias.  */
10846 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10847 choke me
10848 #else
10849 f = $ac_func;
10850 #endif
10851
10852 ; return 0; }
10853 EOF
10854 if { (eval echo configure:10855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10855   rm -rf conftest*
10856   eval "ac_cv_func_$ac_func=yes"
10857 else
10858   echo "configure: failed program was:" >&5
10859   cat conftest.$ac_ext >&5
10860   rm -rf conftest*
10861   eval "ac_cv_func_$ac_func=no"
10862 fi
10863 rm -f conftest*
10864 fi
10865
10866 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10867   echo "$ac_t""yes" 1>&6
10868     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10869   cat >> confdefs.h <<EOF
10870 #define $ac_tr_func 1
10871 EOF
10872  
10873 else
10874   echo "$ac_t""no" 1>&6
10875 fi
10876 done
10877
10878
10879                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
10880 echo "configure:10881: checking for pthread_detach with <pthread.h>" >&5
10881 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
10882   echo $ac_n "(cached) $ac_c" 1>&6
10883 else
10884   
10885                                                                 cat > conftest.$ac_ext <<EOF
10886 #line 10887 "configure"
10887 #include "confdefs.h"
10888
10889 #include <pthread.h>
10890 #ifndef NULL
10891 #define NULL (void*)0
10892 #endif
10893
10894 int main() {
10895 pthread_detach(NULL);
10896 ; return 0; }
10897 EOF
10898 if { (eval echo configure:10899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10899   rm -rf conftest*
10900   ol_cv_func_pthread_detach=yes
10901 else
10902   echo "configure: failed program was:" >&5
10903   cat conftest.$ac_ext >&5
10904   rm -rf conftest*
10905   ol_cv_func_pthread_detach=no
10906 fi
10907 rm -f conftest*
10908                         
10909 fi
10910
10911 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
10912
10913                         if test $ol_cv_func_pthread_detach = no ; then
10914                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
10915                         fi
10916
10917                         cat >> confdefs.h <<\EOF
10918 #define HAVE_PTHREAD_DETACH 1
10919 EOF
10920
10921
10922                                                 for ac_func in \
10923                                 pthread_setconcurrency \
10924                                 pthread_getconcurrency \
10925                                 thr_setconcurrency \
10926                                 thr_getconcurrency \
10927                         
10928 do
10929 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10930 echo "configure:10931: checking for $ac_func" >&5
10931 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10932   echo $ac_n "(cached) $ac_c" 1>&6
10933 else
10934   cat > conftest.$ac_ext <<EOF
10935 #line 10936 "configure"
10936 #include "confdefs.h"
10937 /* System header to define __stub macros and hopefully few prototypes,
10938     which can conflict with char $ac_func(); below.  */
10939 #include <assert.h>
10940 /* Override any gcc2 internal prototype to avoid an error.  */
10941 /* We use char because int might match the return type of a gcc2
10942     builtin and then its argument prototype would still apply.  */
10943 char $ac_func();
10944 char (*f)();
10945
10946 int main() {
10947
10948 /* The GNU C library defines this for functions which it implements
10949     to always fail with ENOSYS.  Some functions are actually named
10950     something starting with __ and the normal name is an alias.  */
10951 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10952 choke me
10953 #else
10954 f = $ac_func;
10955 #endif
10956
10957 ; return 0; }
10958 EOF
10959 if { (eval echo configure:10960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10960   rm -rf conftest*
10961   eval "ac_cv_func_$ac_func=yes"
10962 else
10963   echo "configure: failed program was:" >&5
10964   cat conftest.$ac_ext >&5
10965   rm -rf conftest*
10966   eval "ac_cv_func_$ac_func=no"
10967 fi
10968 rm -f conftest*
10969 fi
10970
10971 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10972   echo "$ac_t""yes" 1>&6
10973     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10974   cat >> confdefs.h <<EOF
10975 #define $ac_tr_func 1
10976 EOF
10977  
10978 else
10979   echo "$ac_t""no" 1>&6
10980 fi
10981 done
10982
10983
10984                         
10985         for ac_func in pthread_kill_other_threads_np
10986 do
10987 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10988 echo "configure:10989: checking for $ac_func" >&5
10989 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10990   echo $ac_n "(cached) $ac_c" 1>&6
10991 else
10992   cat > conftest.$ac_ext <<EOF
10993 #line 10994 "configure"
10994 #include "confdefs.h"
10995 /* System header to define __stub macros and hopefully few prototypes,
10996     which can conflict with char $ac_func(); below.  */
10997 #include <assert.h>
10998 /* Override any gcc2 internal prototype to avoid an error.  */
10999 /* We use char because int might match the return type of a gcc2
11000     builtin and then its argument prototype would still apply.  */
11001 char $ac_func();
11002 char (*f)();
11003
11004 int main() {
11005
11006 /* The GNU C library defines this for functions which it implements
11007     to always fail with ENOSYS.  Some functions are actually named
11008     something starting with __ and the normal name is an alias.  */
11009 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11010 choke me
11011 #else
11012 f = $ac_func;
11013 #endif
11014
11015 ; return 0; }
11016 EOF
11017 if { (eval echo configure:11018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11018   rm -rf conftest*
11019   eval "ac_cv_func_$ac_func=yes"
11020 else
11021   echo "configure: failed program was:" >&5
11022   cat conftest.$ac_ext >&5
11023   rm -rf conftest*
11024   eval "ac_cv_func_$ac_func=no"
11025 fi
11026 rm -f conftest*
11027 fi
11028
11029 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11030   echo "$ac_t""yes" 1>&6
11031     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11032   cat >> confdefs.h <<EOF
11033 #define $ac_tr_func 1
11034 EOF
11035  
11036 else
11037   echo "$ac_t""no" 1>&6
11038 fi
11039 done
11040
11041         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
11042 echo "configure:11043: checking for LinuxThreads implementation" >&5
11043 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
11044   echo $ac_n "(cached) $ac_c" 1>&6
11045 else
11046   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
11047 fi
11048
11049 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
11050
11051                         
11052         
11053         
11054         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
11055 echo "configure:11056: checking for LinuxThreads consistency" >&5
11056 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
11057   echo $ac_n "(cached) $ac_c" 1>&6
11058 else
11059   
11060                 if test $ol_cv_header_linux_threads = yes -a \
11061                         $ol_cv_sys_linux_threads = yes; then
11062                         ol_cv_linux_threads=yes
11063                 elif test $ol_cv_header_linux_threads = no -a \
11064                         $ol_cv_sys_linux_threads = no; then
11065                         ol_cv_linux_threads=no
11066                 else
11067                         ol_cv_linux_threads=error
11068                 fi
11069         
11070 fi
11071
11072 echo "$ac_t""$ol_cv_linux_threads" 1>&6
11073
11074
11075                         if test $ol_cv_linux_threads = error; then
11076                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
11077                         fi
11078
11079                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
11080 echo "configure:11081: checking if pthread_create() works" >&5
11081 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
11082   echo $ac_n "(cached) $ac_c" 1>&6
11083 else
11084   
11085                         if test "$cross_compiling" = yes; then
11086                                 ol_cv_pthread_create_works=yes
11087 else
11088   cat > conftest.$ac_ext <<EOF
11089 #line 11090 "configure"
11090 #include "confdefs.h"
11091 /* pthread test headers */
11092 #include <pthread.h>
11093 #ifndef NULL
11094 #define NULL (void*)0
11095 #endif
11096
11097 static void *task(p)
11098         void *p;
11099 {
11100         return (void *) (p == NULL);
11101 }
11102
11103
11104 int main(argc, argv)
11105         int argc;
11106         char **argv;
11107 {
11108
11109         /* pthread test function */
11110         pthread_t t;
11111         int status;
11112         int detach = 1;
11113
11114 #ifdef HAVE_PTHREADS_FINAL
11115         /* Final pthreads */
11116         pthread_attr_t attr;
11117
11118         status = pthread_attr_init(&attr);
11119         if( status ) return status;
11120
11121 #if defined( PTHREAD_CREATE_JOINABLE ) || defined( PTHREAD_UNDETACHED )
11122         if( !detach ) {
11123 #if defined( PTHREAD_CREATE_JOINABLE )
11124                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
11125 #else
11126                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_UNDETACHED);
11127 #endif
11128
11129 #ifdef PTHREAD_CREATE_DETACHED
11130         } else {
11131                 status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
11132 #endif
11133         }
11134         if( status ) return status;
11135 #endif
11136
11137         status = pthread_create( &t, &attr, task, NULL );
11138         if( status ) return status;
11139
11140 #if !defined( PTHREAD_CREATE_JOINABLE ) && !defined( PTHREAD_UNDETACHED )
11141         if( detach ) {
11142                 /* give thread a chance to complete */
11143                 /* it should remain joinable and hence detachable */
11144                 sleep( 1 );
11145
11146                 status = pthread_detach( t );
11147                 if( status ) return status;
11148         }
11149 #endif
11150
11151 #else
11152         /* Draft 4 pthreads */
11153         status = pthread_create( &t, pthread_attr_default, task, NULL );
11154         if( status ) return status;
11155
11156         if( detach ) {
11157                 /* give thread a chance to complete */
11158                 /* it should remain joinable and hence detachable */
11159                 sleep( 1 );
11160
11161                 status = pthread_detach( &t );
11162                 if( status ) return status;
11163         }
11164 #endif
11165
11166 #ifdef HAVE_LINUX_THREADS
11167         pthread_kill_other_threads_np();
11168 #endif
11169
11170         return 0;
11171
11172 }
11173
11174 EOF
11175 if { (eval echo configure:11176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11176 then
11177   ol_cv_pthread_create_works=yes
11178 else
11179   echo "configure: failed program was:" >&5
11180   cat conftest.$ac_ext >&5
11181   rm -fr conftest*
11182   ol_cv_pthread_create_works=no
11183 fi
11184 rm -fr conftest*
11185 fi
11186
11187 fi
11188
11189 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
11190
11191                         if test $ol_cv_pthread_create_works = no ; then
11192                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
11193                         fi
11194
11195                                                 if test $ol_with_yielding_select = auto ; then
11196                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
11197 echo "configure:11198: checking if select yields when using pthreads" >&5
11198 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
11199   echo $ac_n "(cached) $ac_c" 1>&6
11200 else
11201   
11202                                 if test "$cross_compiling" = yes; then
11203   ol_cv_pthread_select_yields=cross
11204 else
11205   cat > conftest.$ac_ext <<EOF
11206 #line 11207 "configure"
11207 #include "confdefs.h"
11208
11209 #include <sys/types.h>
11210 #include <sys/time.h>
11211 #include <unistd.h>
11212 #include <pthread.h>
11213 #ifndef NULL
11214 #define NULL (void*) 0
11215 #endif
11216
11217 static int fildes[2];
11218
11219 static void *task(p)
11220         void *p;
11221 {
11222         int i;
11223         struct timeval tv;
11224
11225         fd_set rfds;
11226
11227         tv.tv_sec=10;
11228         tv.tv_usec=0;
11229
11230         FD_ZERO(&rfds);
11231         FD_SET(fildes[0], &rfds);
11232
11233         /* we're not interested in any fds */
11234         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
11235
11236         if(i < 0) {
11237                 perror("select");
11238                 exit(10);
11239         }
11240
11241         exit(0); /* if we exit here, the select blocked the whole process */
11242 }
11243
11244 int main(argc, argv)
11245         int argc;
11246         char **argv;
11247 {
11248         pthread_t t;
11249
11250         /* create a pipe to select */
11251         if(pipe(&fildes[0])) {
11252                 perror("select");
11253                 exit(1);
11254         }
11255
11256 #ifdef HAVE_PTHREAD_SETCONCURRENCY
11257         (void) pthread_setconcurrency(2);
11258 #else
11259 #ifdef HAVE_THR_SETCONCURRENCY
11260         /* Set Solaris LWP concurrency to 2 */
11261         thr_setconcurrency(2);
11262 #endif
11263 #endif
11264
11265 #if HAVE_PTHREADS_D4
11266         pthread_create(&t, pthread_attr_default, task, NULL);
11267 #else
11268         pthread_create(&t, NULL, task, NULL);
11269 #endif
11270
11271 #if HAVE_SCHED_YIELD
11272         sched_yield();  /* make sure task runs first */
11273 #else
11274 #ifdef HAVE_PTHREAD_YIELD
11275         pthread_yield();        /* make sure task runs first */
11276 #endif
11277 #endif
11278
11279         exit(2);
11280 }
11281 EOF
11282 if { (eval echo configure:11283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11283 then
11284   ol_cv_pthread_select_yields=no
11285 else
11286   echo "configure: failed program was:" >&5
11287   cat conftest.$ac_ext >&5
11288   rm -fr conftest*
11289   ol_cv_pthread_select_yields=yes
11290 fi
11291 rm -fr conftest*
11292 fi
11293
11294 fi
11295
11296 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
11297
11298                                 if test $ol_cv_pthread_select_yields = cross ; then
11299                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
11300                                 fi
11301
11302                                 if test $ol_cv_pthread_select_yields = yes ; then
11303                                         ol_with_yielding_select=yes
11304                                 fi
11305                         fi
11306
11307                                                 CPPFLAGS="$save_CPPFLAGS"
11308                         LIBS="$save_LIBS"
11309                 else
11310                         { echo "configure: error: could not locate usable POSIX Threads" 1>&2; exit 1; }
11311                 fi
11312         fi
11313
11314         if test $ol_with_threads = posix ; then
11315                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
11316         fi
11317 fi
11318
11319 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11320         -o $ol_with_threads = mach ; then
11321
11322                 for ac_hdr in mach/cthreads.h
11323 do
11324 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11325 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11326 echo "configure:11327: checking for $ac_hdr" >&5
11327 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11328   echo $ac_n "(cached) $ac_c" 1>&6
11329 else
11330   cat > conftest.$ac_ext <<EOF
11331 #line 11332 "configure"
11332 #include "confdefs.h"
11333 #include <$ac_hdr>
11334 EOF
11335 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11336 { (eval echo configure:11337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11337 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11338 if test -z "$ac_err"; then
11339   rm -rf conftest*
11340   eval "ac_cv_header_$ac_safe=yes"
11341 else
11342   echo "$ac_err" >&5
11343   echo "configure: failed program was:" >&5
11344   cat conftest.$ac_ext >&5
11345   rm -rf conftest*
11346   eval "ac_cv_header_$ac_safe=no"
11347 fi
11348 rm -f conftest*
11349 fi
11350 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11351   echo "$ac_t""yes" 1>&6
11352     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11353   cat >> confdefs.h <<EOF
11354 #define $ac_tr_hdr 1
11355 EOF
11356  
11357 else
11358   echo "$ac_t""no" 1>&6
11359 fi
11360 done
11361
11362         if test $ac_cv_header_mach_cthreads_h = yes ; then
11363                 ol_with_threads=found
11364
11365                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
11366 echo "configure:11367: checking for cthread_fork" >&5
11367 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
11368   echo $ac_n "(cached) $ac_c" 1>&6
11369 else
11370   cat > conftest.$ac_ext <<EOF
11371 #line 11372 "configure"
11372 #include "confdefs.h"
11373 /* System header to define __stub macros and hopefully few prototypes,
11374     which can conflict with char cthread_fork(); below.  */
11375 #include <assert.h>
11376 /* Override any gcc2 internal prototype to avoid an error.  */
11377 /* We use char because int might match the return type of a gcc2
11378     builtin and then its argument prototype would still apply.  */
11379 char cthread_fork();
11380 char (*f)();
11381
11382 int main() {
11383
11384 /* The GNU C library defines this for functions which it implements
11385     to always fail with ENOSYS.  Some functions are actually named
11386     something starting with __ and the normal name is an alias.  */
11387 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
11388 choke me
11389 #else
11390 f = cthread_fork;
11391 #endif
11392
11393 ; return 0; }
11394 EOF
11395 if { (eval echo configure:11396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11396   rm -rf conftest*
11397   eval "ac_cv_func_cthread_fork=yes"
11398 else
11399   echo "configure: failed program was:" >&5
11400   cat conftest.$ac_ext >&5
11401   rm -rf conftest*
11402   eval "ac_cv_func_cthread_fork=no"
11403 fi
11404 rm -f conftest*
11405 fi
11406
11407 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
11408   echo "$ac_t""yes" 1>&6
11409   ol_link_threads=yes
11410 else
11411   echo "$ac_t""no" 1>&6
11412 fi
11413
11414
11415                 if test $ol_link_threads = no ; then
11416                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
11417 echo "configure:11418: checking for cthread_fork with -all_load" >&5
11418 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
11419   echo $ac_n "(cached) $ac_c" 1>&6
11420 else
11421   
11422                                                                 save_LIBS="$LIBS"
11423                                 LIBS="-all_load $LIBS"
11424                                 cat > conftest.$ac_ext <<EOF
11425 #line 11426 "configure"
11426 #include "confdefs.h"
11427 #include <mach/cthreads.h>
11428 int main() {
11429
11430                                         cthread_fork((void *)0, (void *)0);
11431                                         
11432 ; return 0; }
11433 EOF
11434 if { (eval echo configure:11435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11435   rm -rf conftest*
11436   ol_cv_cthread_all_load=yes
11437 else
11438   echo "configure: failed program was:" >&5
11439   cat conftest.$ac_ext >&5
11440   rm -rf conftest*
11441   ol_cv_cthread_all_load=no
11442 fi
11443 rm -f conftest*
11444                                                                 LIBS="$save_LIBS"
11445                         
11446 fi
11447
11448 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
11449
11450                         if test $ol_cv_cthread_all_load = yes ; then
11451                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
11452                                 ol_link_threads=mach
11453                         fi
11454                 fi
11455
11456                 if test $ol_link_threads != no ; then
11457                         : check for cthread specific functionality here
11458                         cat >> confdefs.h <<\EOF
11459 #define HAVE_MACH_CTHREADS 1
11460 EOF
11461
11462                 else
11463                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
11464                 fi
11465         fi
11466
11467         if test $ol_with_threads = mach ; then
11468                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
11469         fi
11470 fi
11471
11472 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11473         -o $ol_with_threads = pth ; then
11474
11475         for ac_hdr in pth.h
11476 do
11477 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11478 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11479 echo "configure:11480: checking for $ac_hdr" >&5
11480 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11481   echo $ac_n "(cached) $ac_c" 1>&6
11482 else
11483   cat > conftest.$ac_ext <<EOF
11484 #line 11485 "configure"
11485 #include "confdefs.h"
11486 #include <$ac_hdr>
11487 EOF
11488 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11489 { (eval echo configure:11490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11490 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11491 if test -z "$ac_err"; then
11492   rm -rf conftest*
11493   eval "ac_cv_header_$ac_safe=yes"
11494 else
11495   echo "$ac_err" >&5
11496   echo "configure: failed program was:" >&5
11497   cat conftest.$ac_ext >&5
11498   rm -rf conftest*
11499   eval "ac_cv_header_$ac_safe=no"
11500 fi
11501 rm -f conftest*
11502 fi
11503 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11504   echo "$ac_t""yes" 1>&6
11505     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11506   cat >> confdefs.h <<EOF
11507 #define $ac_tr_hdr 1
11508 EOF
11509  
11510 else
11511   echo "$ac_t""no" 1>&6
11512 fi
11513 done
11514
11515
11516         if test $ac_cv_header_pth_h = yes ; then
11517                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
11518 echo "configure:11519: checking for pth_version in -lpth" >&5
11519 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
11520 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11521   echo $ac_n "(cached) $ac_c" 1>&6
11522 else
11523   ac_save_LIBS="$LIBS"
11524 LIBS="-lpth  $LIBS"
11525 cat > conftest.$ac_ext <<EOF
11526 #line 11527 "configure"
11527 #include "confdefs.h"
11528 /* Override any gcc2 internal prototype to avoid an error.  */
11529 /* We use char because int might match the return type of a gcc2
11530     builtin and then its argument prototype would still apply.  */
11531 char pth_version();
11532
11533 int main() {
11534 pth_version()
11535 ; return 0; }
11536 EOF
11537 if { (eval echo configure:11538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11538   rm -rf conftest*
11539   eval "ac_cv_lib_$ac_lib_var=yes"
11540 else
11541   echo "configure: failed program was:" >&5
11542   cat conftest.$ac_ext >&5
11543   rm -rf conftest*
11544   eval "ac_cv_lib_$ac_lib_var=no"
11545 fi
11546 rm -f conftest*
11547 LIBS="$ac_save_LIBS"
11548
11549 fi
11550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11551   echo "$ac_t""yes" 1>&6
11552   have_pth=yes
11553 else
11554   echo "$ac_t""no" 1>&6
11555 have_pth=no
11556 fi
11557
11558
11559                 if test $have_pth = yes ; then
11560                         cat >> confdefs.h <<\EOF
11561 #define HAVE_GNU_PTH 1
11562 EOF
11563
11564                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
11565                         ol_link_threads=pth
11566
11567                         if test $ol_with_yielding_select = auto ; then
11568                                 ol_with_yielding_select=yes
11569                         fi
11570                 fi
11571         fi
11572 fi
11573
11574 if test $ol_with_threads = auto -o $ol_with_threads = yes \
11575         -o $ol_with_threads = lwp ; then
11576
11577                 for ac_hdr in thread.h synch.h
11578 do
11579 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11580 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11581 echo "configure:11582: checking for $ac_hdr" >&5
11582 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11583   echo $ac_n "(cached) $ac_c" 1>&6
11584 else
11585   cat > conftest.$ac_ext <<EOF
11586 #line 11587 "configure"
11587 #include "confdefs.h"
11588 #include <$ac_hdr>
11589 EOF
11590 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11591 { (eval echo configure:11592: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11592 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11593 if test -z "$ac_err"; then
11594   rm -rf conftest*
11595   eval "ac_cv_header_$ac_safe=yes"
11596 else
11597   echo "$ac_err" >&5
11598   echo "configure: failed program was:" >&5
11599   cat conftest.$ac_ext >&5
11600   rm -rf conftest*
11601   eval "ac_cv_header_$ac_safe=no"
11602 fi
11603 rm -f conftest*
11604 fi
11605 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11606   echo "$ac_t""yes" 1>&6
11607     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11608   cat >> confdefs.h <<EOF
11609 #define $ac_tr_hdr 1
11610 EOF
11611  
11612 else
11613   echo "$ac_t""no" 1>&6
11614 fi
11615 done
11616
11617         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
11618                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
11619 echo "configure:11620: checking for thr_create in -lthread" >&5
11620 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
11621 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11622   echo $ac_n "(cached) $ac_c" 1>&6
11623 else
11624   ac_save_LIBS="$LIBS"
11625 LIBS="-lthread  $LIBS"
11626 cat > conftest.$ac_ext <<EOF
11627 #line 11628 "configure"
11628 #include "confdefs.h"
11629 /* Override any gcc2 internal prototype to avoid an error.  */
11630 /* We use char because int might match the return type of a gcc2
11631     builtin and then its argument prototype would still apply.  */
11632 char thr_create();
11633
11634 int main() {
11635 thr_create()
11636 ; return 0; }
11637 EOF
11638 if { (eval echo configure:11639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11639   rm -rf conftest*
11640   eval "ac_cv_lib_$ac_lib_var=yes"
11641 else
11642   echo "configure: failed program was:" >&5
11643   cat conftest.$ac_ext >&5
11644   rm -rf conftest*
11645   eval "ac_cv_lib_$ac_lib_var=no"
11646 fi
11647 rm -f conftest*
11648 LIBS="$ac_save_LIBS"
11649
11650 fi
11651 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11652   echo "$ac_t""yes" 1>&6
11653   have_thr=yes
11654 else
11655   echo "$ac_t""no" 1>&6
11656 have_thr=no
11657 fi
11658
11659
11660                 if test $have_thr = yes ; then
11661                         cat >> confdefs.h <<\EOF
11662 #define HAVE_THR 1
11663 EOF
11664
11665                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
11666                         ol_link_threads=thr
11667
11668                         if test $ol_with_yielding_select = auto ; then
11669                                 ol_with_yielding_select=yes
11670                         fi
11671
11672                                                 for ac_func in \
11673                                 thr_setconcurrency \
11674                                 thr_getconcurrency \
11675                         
11676 do
11677 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11678 echo "configure:11679: checking for $ac_func" >&5
11679 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11680   echo $ac_n "(cached) $ac_c" 1>&6
11681 else
11682   cat > conftest.$ac_ext <<EOF
11683 #line 11684 "configure"
11684 #include "confdefs.h"
11685 /* System header to define __stub macros and hopefully few prototypes,
11686     which can conflict with char $ac_func(); below.  */
11687 #include <assert.h>
11688 /* Override any gcc2 internal prototype to avoid an error.  */
11689 /* We use char because int might match the return type of a gcc2
11690     builtin and then its argument prototype would still apply.  */
11691 char $ac_func();
11692 char (*f)();
11693
11694 int main() {
11695
11696 /* The GNU C library defines this for functions which it implements
11697     to always fail with ENOSYS.  Some functions are actually named
11698     something starting with __ and the normal name is an alias.  */
11699 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11700 choke me
11701 #else
11702 f = $ac_func;
11703 #endif
11704
11705 ; return 0; }
11706 EOF
11707 if { (eval echo configure:11708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11708   rm -rf conftest*
11709   eval "ac_cv_func_$ac_func=yes"
11710 else
11711   echo "configure: failed program was:" >&5
11712   cat conftest.$ac_ext >&5
11713   rm -rf conftest*
11714   eval "ac_cv_func_$ac_func=no"
11715 fi
11716 rm -f conftest*
11717 fi
11718
11719 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11720   echo "$ac_t""yes" 1>&6
11721     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11722   cat >> confdefs.h <<EOF
11723 #define $ac_tr_func 1
11724 EOF
11725  
11726 else
11727   echo "$ac_t""no" 1>&6
11728 fi
11729 done
11730
11731                 fi
11732         fi
11733
11734                 for ac_hdr in lwp/lwp.h
11735 do
11736 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11737 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11738 echo "configure:11739: checking for $ac_hdr" >&5
11739 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11740   echo $ac_n "(cached) $ac_c" 1>&6
11741 else
11742   cat > conftest.$ac_ext <<EOF
11743 #line 11744 "configure"
11744 #include "confdefs.h"
11745 #include <$ac_hdr>
11746 EOF
11747 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11748 { (eval echo configure:11749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11749 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11750 if test -z "$ac_err"; then
11751   rm -rf conftest*
11752   eval "ac_cv_header_$ac_safe=yes"
11753 else
11754   echo "$ac_err" >&5
11755   echo "configure: failed program was:" >&5
11756   cat conftest.$ac_ext >&5
11757   rm -rf conftest*
11758   eval "ac_cv_header_$ac_safe=no"
11759 fi
11760 rm -f conftest*
11761 fi
11762 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11763   echo "$ac_t""yes" 1>&6
11764     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11765   cat >> confdefs.h <<EOF
11766 #define $ac_tr_hdr 1
11767 EOF
11768  
11769 else
11770   echo "$ac_t""no" 1>&6
11771 fi
11772 done
11773
11774         if test $ac_cv_header_lwp_lwp_h = yes ; then
11775                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11776 echo "configure:11777: checking for lwp_create in -llwp" >&5
11777 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11778 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11779   echo $ac_n "(cached) $ac_c" 1>&6
11780 else
11781   ac_save_LIBS="$LIBS"
11782 LIBS="-llwp  $LIBS"
11783 cat > conftest.$ac_ext <<EOF
11784 #line 11785 "configure"
11785 #include "confdefs.h"
11786 /* Override any gcc2 internal prototype to avoid an error.  */
11787 /* We use char because int might match the return type of a gcc2
11788     builtin and then its argument prototype would still apply.  */
11789 char lwp_create();
11790
11791 int main() {
11792 lwp_create()
11793 ; return 0; }
11794 EOF
11795 if { (eval echo configure:11796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11796   rm -rf conftest*
11797   eval "ac_cv_lib_$ac_lib_var=yes"
11798 else
11799   echo "configure: failed program was:" >&5
11800   cat conftest.$ac_ext >&5
11801   rm -rf conftest*
11802   eval "ac_cv_lib_$ac_lib_var=no"
11803 fi
11804 rm -f conftest*
11805 LIBS="$ac_save_LIBS"
11806
11807 fi
11808 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11809   echo "$ac_t""yes" 1>&6
11810   have_lwp=yes
11811 else
11812   echo "$ac_t""no" 1>&6
11813 have_lwp=no
11814 fi
11815
11816
11817                 if test $have_lwp = yes ; then
11818                         cat >> confdefs.h <<\EOF
11819 #define HAVE_LWP 1
11820 EOF
11821
11822                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11823                         ol_link_threads=lwp
11824
11825                         if test $ol_with_yielding_select = auto ; then
11826                                 ol_with_yielding_select=no
11827                         fi
11828                 fi
11829         fi
11830 fi
11831
11832 if test $ol_with_yielding_select = yes ; then
11833         cat >> confdefs.h <<\EOF
11834 #define HAVE_YIELDING_SELECT 1
11835 EOF
11836
11837 fi
11838
11839 if test $ol_with_threads = manual ; then
11840                 ol_link_threads=yes
11841
11842         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11843
11844         for ac_hdr in pthread.h sched.h
11845 do
11846 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11847 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11848 echo "configure:11849: checking for $ac_hdr" >&5
11849 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11850   echo $ac_n "(cached) $ac_c" 1>&6
11851 else
11852   cat > conftest.$ac_ext <<EOF
11853 #line 11854 "configure"
11854 #include "confdefs.h"
11855 #include <$ac_hdr>
11856 EOF
11857 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11858 { (eval echo configure:11859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11859 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11860 if test -z "$ac_err"; then
11861   rm -rf conftest*
11862   eval "ac_cv_header_$ac_safe=yes"
11863 else
11864   echo "$ac_err" >&5
11865   echo "configure: failed program was:" >&5
11866   cat conftest.$ac_ext >&5
11867   rm -rf conftest*
11868   eval "ac_cv_header_$ac_safe=no"
11869 fi
11870 rm -f conftest*
11871 fi
11872 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11873   echo "$ac_t""yes" 1>&6
11874     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11875   cat >> confdefs.h <<EOF
11876 #define $ac_tr_hdr 1
11877 EOF
11878  
11879 else
11880   echo "$ac_t""no" 1>&6
11881 fi
11882 done
11883
11884         for ac_func in sched_yield pthread_yield
11885 do
11886 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11887 echo "configure:11888: checking for $ac_func" >&5
11888 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11889   echo $ac_n "(cached) $ac_c" 1>&6
11890 else
11891   cat > conftest.$ac_ext <<EOF
11892 #line 11893 "configure"
11893 #include "confdefs.h"
11894 /* System header to define __stub macros and hopefully few prototypes,
11895     which can conflict with char $ac_func(); below.  */
11896 #include <assert.h>
11897 /* Override any gcc2 internal prototype to avoid an error.  */
11898 /* We use char because int might match the return type of a gcc2
11899     builtin and then its argument prototype would still apply.  */
11900 char $ac_func();
11901 char (*f)();
11902
11903 int main() {
11904
11905 /* The GNU C library defines this for functions which it implements
11906     to always fail with ENOSYS.  Some functions are actually named
11907     something starting with __ and the normal name is an alias.  */
11908 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11909 choke me
11910 #else
11911 f = $ac_func;
11912 #endif
11913
11914 ; return 0; }
11915 EOF
11916 if { (eval echo configure:11917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11917   rm -rf conftest*
11918   eval "ac_cv_func_$ac_func=yes"
11919 else
11920   echo "configure: failed program was:" >&5
11921   cat conftest.$ac_ext >&5
11922   rm -rf conftest*
11923   eval "ac_cv_func_$ac_func=no"
11924 fi
11925 rm -f conftest*
11926 fi
11927
11928 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11929   echo "$ac_t""yes" 1>&6
11930     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11931   cat >> confdefs.h <<EOF
11932 #define $ac_tr_func 1
11933 EOF
11934  
11935 else
11936   echo "$ac_t""no" 1>&6
11937 fi
11938 done
11939
11940         
11941         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11942 echo "configure:11943: checking for LinuxThreads pthread.h" >&5
11943 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11944   echo $ac_n "(cached) $ac_c" 1>&6
11945 else
11946   cat > conftest.$ac_ext <<EOF
11947 #line 11948 "configure"
11948 #include "confdefs.h"
11949 #include <pthread.h>
11950 EOF
11951 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11952   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11953   rm -rf conftest*
11954   ol_cv_header_linux_threads=yes
11955 else
11956   rm -rf conftest*
11957   ol_cv_header_linux_threads=no
11958 fi
11959 rm -f conftest*
11960
11961                 
11962 fi
11963
11964 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11965         if test $ol_cv_header_linux_threads = yes; then
11966                 cat >> confdefs.h <<\EOF
11967 #define HAVE_LINUX_THREADS 1
11968 EOF
11969
11970         fi
11971
11972
11973         for ac_hdr in mach/cthreads.h
11974 do
11975 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11976 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11977 echo "configure:11978: checking for $ac_hdr" >&5
11978 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11979   echo $ac_n "(cached) $ac_c" 1>&6
11980 else
11981   cat > conftest.$ac_ext <<EOF
11982 #line 11983 "configure"
11983 #include "confdefs.h"
11984 #include <$ac_hdr>
11985 EOF
11986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11987 { (eval echo configure:11988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11989 if test -z "$ac_err"; then
11990   rm -rf conftest*
11991   eval "ac_cv_header_$ac_safe=yes"
11992 else
11993   echo "$ac_err" >&5
11994   echo "configure: failed program was:" >&5
11995   cat conftest.$ac_ext >&5
11996   rm -rf conftest*
11997   eval "ac_cv_header_$ac_safe=no"
11998 fi
11999 rm -f conftest*
12000 fi
12001 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12002   echo "$ac_t""yes" 1>&6
12003     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12004   cat >> confdefs.h <<EOF
12005 #define $ac_tr_hdr 1
12006 EOF
12007  
12008 else
12009   echo "$ac_t""no" 1>&6
12010 fi
12011 done
12012
12013         for ac_hdr in lwp/lwp.h
12014 do
12015 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12016 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12017 echo "configure:12018: checking for $ac_hdr" >&5
12018 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12019   echo $ac_n "(cached) $ac_c" 1>&6
12020 else
12021   cat > conftest.$ac_ext <<EOF
12022 #line 12023 "configure"
12023 #include "confdefs.h"
12024 #include <$ac_hdr>
12025 EOF
12026 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12027 { (eval echo configure:12028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12028 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12029 if test -z "$ac_err"; then
12030   rm -rf conftest*
12031   eval "ac_cv_header_$ac_safe=yes"
12032 else
12033   echo "$ac_err" >&5
12034   echo "configure: failed program was:" >&5
12035   cat conftest.$ac_ext >&5
12036   rm -rf conftest*
12037   eval "ac_cv_header_$ac_safe=no"
12038 fi
12039 rm -f conftest*
12040 fi
12041 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12042   echo "$ac_t""yes" 1>&6
12043     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12044   cat >> confdefs.h <<EOF
12045 #define $ac_tr_hdr 1
12046 EOF
12047  
12048 else
12049   echo "$ac_t""no" 1>&6
12050 fi
12051 done
12052
12053         for ac_hdr in thread.h synch.h
12054 do
12055 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12056 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12057 echo "configure:12058: checking for $ac_hdr" >&5
12058 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12059   echo $ac_n "(cached) $ac_c" 1>&6
12060 else
12061   cat > conftest.$ac_ext <<EOF
12062 #line 12063 "configure"
12063 #include "confdefs.h"
12064 #include <$ac_hdr>
12065 EOF
12066 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12067 { (eval echo configure:12068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12068 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12069 if test -z "$ac_err"; then
12070   rm -rf conftest*
12071   eval "ac_cv_header_$ac_safe=yes"
12072 else
12073   echo "$ac_err" >&5
12074   echo "configure: failed program was:" >&5
12075   cat conftest.$ac_ext >&5
12076   rm -rf conftest*
12077   eval "ac_cv_header_$ac_safe=no"
12078 fi
12079 rm -f conftest*
12080 fi
12081 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12082   echo "$ac_t""yes" 1>&6
12083     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12084   cat >> confdefs.h <<EOF
12085 #define $ac_tr_hdr 1
12086 EOF
12087  
12088 else
12089   echo "$ac_t""no" 1>&6
12090 fi
12091 done
12092
12093 fi
12094
12095 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
12096                         cat >> confdefs.h <<\EOF
12097 #define REENTRANT 1
12098 EOF
12099
12100         cat >> confdefs.h <<\EOF
12101 #define _REENTRANT 1
12102 EOF
12103
12104         cat >> confdefs.h <<\EOF
12105 #define THREAD_SAFE 1
12106 EOF
12107
12108         cat >> confdefs.h <<\EOF
12109 #define _THREAD_SAFE 1
12110 EOF
12111
12112         cat >> confdefs.h <<\EOF
12113 #define THREADSAFE 1
12114 EOF
12115
12116         cat >> confdefs.h <<\EOF
12117 #define _THREADSAFE 1
12118 EOF
12119
12120         cat >> confdefs.h <<\EOF
12121 #define _SGI_MP_SOURCE 1
12122 EOF
12123
12124
12125                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
12126 echo "configure:12127: checking for thread specific errno" >&5
12127 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
12128   echo $ac_n "(cached) $ac_c" 1>&6
12129 else
12130   
12131                 cat > conftest.$ac_ext <<EOF
12132 #line 12133 "configure"
12133 #include "confdefs.h"
12134 #include <errno.h>
12135 int main() {
12136 errno = 0;
12137 ; return 0; }
12138 EOF
12139 if { (eval echo configure:12140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12140   rm -rf conftest*
12141   ol_cv_errno_thread_specific=yes
12142 else
12143   echo "configure: failed program was:" >&5
12144   cat conftest.$ac_ext >&5
12145   rm -rf conftest*
12146   ol_cv_errno_thread_specific=no
12147 fi
12148 rm -f conftest*
12149         
12150 fi
12151
12152 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
12153
12154                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
12155 echo "configure:12156: checking for thread specific h_errno" >&5
12156 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
12157   echo $ac_n "(cached) $ac_c" 1>&6
12158 else
12159   
12160                 cat > conftest.$ac_ext <<EOF
12161 #line 12162 "configure"
12162 #include "confdefs.h"
12163 #include <netdb.h>
12164 int main() {
12165 h_errno = 0;
12166 ; return 0; }
12167 EOF
12168 if { (eval echo configure:12169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12169   rm -rf conftest*
12170   ol_cv_h_errno_thread_specific=yes
12171 else
12172   echo "configure: failed program was:" >&5
12173   cat conftest.$ac_ext >&5
12174   rm -rf conftest*
12175   ol_cv_h_errno_thread_specific=no
12176 fi
12177 rm -f conftest*
12178         
12179 fi
12180
12181 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
12182
12183         if test $ol_cv_errno_thread_specific != yes \
12184                 -o $ol_cv_h_errno_thread_specific != yes ; then
12185                 LIBS="$LTHREAD_LIBS $LIBS"
12186                 LTHREAD_LIBS=""
12187         fi
12188
12189 fi  
12190
12191 if test $ol_link_threads = no ; then
12192         if test $ol_with_threads = yes ; then
12193                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
12194         fi
12195
12196         if test $ol_with_threads = auto ; then
12197                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
12198                 ol_with_threads=no
12199         fi
12200
12201         cat >> confdefs.h <<\EOF
12202 #define NO_THREADS 1
12203 EOF
12204
12205         LTHREAD_LIBS=""
12206 fi
12207
12208 if test $ol_link_threads != no ; then
12209         cat >> confdefs.h <<\EOF
12210 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
12211 EOF
12212
12213 fi
12214
12215 ol_link_ldbm=no 
12216
12217 if test $ol_with_ldbm_api = auto \
12218         -o $ol_with_ldbm_api = berkeley \
12219         -o $ol_with_ldbm_api = bcompat ; then
12220
12221         if test $ol_with_ldbm_api = bcompat; then \
12222                 ol_cv_berkeley_db=no
12223 for ac_hdr in db_185.h db.h
12224 do
12225 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12226 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12227 echo "configure:12228: checking for $ac_hdr" >&5
12228 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12229   echo $ac_n "(cached) $ac_c" 1>&6
12230 else
12231   cat > conftest.$ac_ext <<EOF
12232 #line 12233 "configure"
12233 #include "confdefs.h"
12234 #include <$ac_hdr>
12235 EOF
12236 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12237 { (eval echo configure:12238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12238 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12239 if test -z "$ac_err"; then
12240   rm -rf conftest*
12241   eval "ac_cv_header_$ac_safe=yes"
12242 else
12243   echo "$ac_err" >&5
12244   echo "configure: failed program was:" >&5
12245   cat conftest.$ac_ext >&5
12246   rm -rf conftest*
12247   eval "ac_cv_header_$ac_safe=no"
12248 fi
12249 rm -f conftest*
12250 fi
12251 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12252   echo "$ac_t""yes" 1>&6
12253     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12254   cat >> confdefs.h <<EOF
12255 #define $ac_tr_hdr 1
12256 EOF
12257  
12258 else
12259   echo "$ac_t""no" 1>&6
12260 fi
12261 done
12262
12263 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
12264         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
12265 echo "configure:12266: checking if Berkeley DB header compatibility" >&5
12266 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
12267   echo $ac_n "(cached) $ac_c" 1>&6
12268 else
12269   
12270                 cat > conftest.$ac_ext <<EOF
12271 #line 12272 "configure"
12272 #include "confdefs.h"
12273
12274 #if HAVE_DB_185_H
12275 #       include <db_185.h>
12276 #else
12277 #       include <db.h>
12278 #endif
12279
12280  /* this check could be improved */
12281 #ifndef DB_VERSION_MAJOR
12282 #       define DB_VERSION_MAJOR 1
12283 #endif
12284
12285 #if DB_VERSION_MAJOR == 1 
12286         __db_version_1
12287 #endif
12288
12289 EOF
12290 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12291   egrep "__db_version_1" >/dev/null 2>&1; then
12292   rm -rf conftest*
12293   ol_cv_header_db1=yes
12294 else
12295   rm -rf conftest*
12296   ol_cv_header_db1=no
12297 fi
12298 rm -f conftest*
12299
12300 fi
12301
12302 echo "$ac_t""$ol_cv_header_db1" 1>&6
12303
12304         if test $ol_cv_header_db1 = yes ; then
12305                 ol_cv_lib_db=no
12306 if test $ol_cv_lib_db = no ; then
12307         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12308 echo "configure:12309: checking for Berkeley DB link (default)" >&5
12309 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12310   echo $ac_n "(cached) $ac_c" 1>&6
12311 else
12312   
12313         ol_DB_LIB=
12314         ol_LIBS=$LIBS
12315         LIBS="$ol_DB_LIB $LIBS"
12316
12317         cat > conftest.$ac_ext <<EOF
12318 #line 12319 "configure"
12319 #include "confdefs.h"
12320
12321 #ifdef HAVE_DB_185_H
12322 # include <db_185.h>
12323 #else
12324 # include <db.h>
12325 #endif
12326
12327 #ifndef DB_VERSION_MAJOR
12328 # define DB_VERSION_MAJOR 1
12329 #endif
12330
12331 #ifndef NULL
12332 #define NULL ((void*)0)
12333 #endif
12334
12335 int main() {
12336
12337 #if DB_VERSION_MAJOR > 1
12338         {
12339                 char *version;
12340                 int major, minor, patch;
12341
12342                 version = db_version( &major, &minor, &patch );
12343
12344                 if( major != DB_VERSION_MAJOR ||
12345                         minor < DB_VERSION_MINOR )
12346                 {
12347                         printf("Berkeley DB version mismatch\n"
12348                                 "\texpected: %s\n\tgot: %s\n",
12349                                 DB_VERSION_STRING, version);
12350                         return 1;
12351                 }
12352         }
12353 #endif
12354
12355 #if DB_VERSION_MAJOR > 2
12356         db_env_create( NULL, 0 );
12357 #elif DB_VERSION_MAJOR > 1
12358         db_appexit( NULL );
12359 #else
12360         (void) dbopen( NULL, 0, 0, 0, NULL);
12361 #endif
12362
12363 ; return 0; }
12364 EOF
12365 if { (eval echo configure:12366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12366   rm -rf conftest*
12367   ol_cv_db_none=yes
12368 else
12369   echo "configure: failed program was:" >&5
12370   cat conftest.$ac_ext >&5
12371   rm -rf conftest*
12372   ol_cv_db_none=no
12373 fi
12374 rm -f conftest*
12375
12376         LIBS="$ol_LIBS"
12377
12378 fi
12379
12380 echo "$ac_t""$ol_cv_db_none" 1>&6
12381
12382         if test $ol_cv_db_none = yes ; then
12383                 ol_cv_lib_db=yes
12384         fi
12385 fi
12386
12387 if test $ol_cv_lib_db = no ; then
12388         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12389 echo "configure:12390: checking for Berkeley DB link (-ldb)" >&5
12390 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12391   echo $ac_n "(cached) $ac_c" 1>&6
12392 else
12393   
12394         ol_DB_LIB=-ldb
12395         ol_LIBS=$LIBS
12396         LIBS="$ol_DB_LIB $LIBS"
12397
12398         cat > conftest.$ac_ext <<EOF
12399 #line 12400 "configure"
12400 #include "confdefs.h"
12401
12402 #ifdef HAVE_DB_185_H
12403 # include <db_185.h>
12404 #else
12405 # include <db.h>
12406 #endif
12407
12408 #ifndef DB_VERSION_MAJOR
12409 # define DB_VERSION_MAJOR 1
12410 #endif
12411
12412 #ifndef NULL
12413 #define NULL ((void*)0)
12414 #endif
12415
12416 int main() {
12417
12418 #if DB_VERSION_MAJOR > 1
12419         {
12420                 char *version;
12421                 int major, minor, patch;
12422
12423                 version = db_version( &major, &minor, &patch );
12424
12425                 if( major != DB_VERSION_MAJOR ||
12426                         minor < DB_VERSION_MINOR )
12427                 {
12428                         printf("Berkeley DB version mismatch\n"
12429                                 "\texpected: %s\n\tgot: %s\n",
12430                                 DB_VERSION_STRING, version);
12431                         return 1;
12432                 }
12433         }
12434 #endif
12435
12436 #if DB_VERSION_MAJOR > 2
12437         db_env_create( NULL, 0 );
12438 #elif DB_VERSION_MAJOR > 1
12439         db_appexit( NULL );
12440 #else
12441         (void) dbopen( NULL, 0, 0, 0, NULL);
12442 #endif
12443
12444 ; return 0; }
12445 EOF
12446 if { (eval echo configure:12447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12447   rm -rf conftest*
12448   ol_cv_db_db=yes
12449 else
12450   echo "configure: failed program was:" >&5
12451   cat conftest.$ac_ext >&5
12452   rm -rf conftest*
12453   ol_cv_db_db=no
12454 fi
12455 rm -f conftest*
12456
12457         LIBS="$ol_LIBS"
12458
12459 fi
12460
12461 echo "$ac_t""$ol_cv_db_db" 1>&6
12462
12463         if test $ol_cv_db_db = yes ; then
12464                 ol_cv_lib_db=-ldb
12465         fi
12466 fi
12467
12468 if test $ol_cv_lib_db = no ; then
12469         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12470 echo "configure:12471: checking for Berkeley DB link (-ldb3)" >&5
12471 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12472   echo $ac_n "(cached) $ac_c" 1>&6
12473 else
12474   
12475         ol_DB_LIB=-ldb3
12476         ol_LIBS=$LIBS
12477         LIBS="$ol_DB_LIB $LIBS"
12478
12479         cat > conftest.$ac_ext <<EOF
12480 #line 12481 "configure"
12481 #include "confdefs.h"
12482
12483 #ifdef HAVE_DB_185_H
12484 # include <db_185.h>
12485 #else
12486 # include <db.h>
12487 #endif
12488
12489 #ifndef DB_VERSION_MAJOR
12490 # define DB_VERSION_MAJOR 1
12491 #endif
12492
12493 #ifndef NULL
12494 #define NULL ((void*)0)
12495 #endif
12496
12497 int main() {
12498
12499 #if DB_VERSION_MAJOR > 1
12500         {
12501                 char *version;
12502                 int major, minor, patch;
12503
12504                 version = db_version( &major, &minor, &patch );
12505
12506                 if( major != DB_VERSION_MAJOR ||
12507                         minor < DB_VERSION_MINOR )
12508                 {
12509                         printf("Berkeley DB version mismatch\n"
12510                                 "\texpected: %s\n\tgot: %s\n",
12511                                 DB_VERSION_STRING, version);
12512                         return 1;
12513                 }
12514         }
12515 #endif
12516
12517 #if DB_VERSION_MAJOR > 2
12518         db_env_create( NULL, 0 );
12519 #elif DB_VERSION_MAJOR > 1
12520         db_appexit( NULL );
12521 #else
12522         (void) dbopen( NULL, 0, 0, 0, NULL);
12523 #endif
12524
12525 ; return 0; }
12526 EOF
12527 if { (eval echo configure:12528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12528   rm -rf conftest*
12529   ol_cv_db_db3=yes
12530 else
12531   echo "configure: failed program was:" >&5
12532   cat conftest.$ac_ext >&5
12533   rm -rf conftest*
12534   ol_cv_db_db3=no
12535 fi
12536 rm -f conftest*
12537
12538         LIBS="$ol_LIBS"
12539
12540 fi
12541
12542 echo "$ac_t""$ol_cv_db_db3" 1>&6
12543
12544         if test $ol_cv_db_db3 = yes ; then
12545                 ol_cv_lib_db=-ldb3
12546         fi
12547 fi
12548
12549 if test $ol_cv_lib_db = no ; then
12550         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12551 echo "configure:12552: checking for Berkeley DB link (-ldb2)" >&5
12552 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12553   echo $ac_n "(cached) $ac_c" 1>&6
12554 else
12555   
12556         ol_DB_LIB=-ldb2
12557         ol_LIBS=$LIBS
12558         LIBS="$ol_DB_LIB $LIBS"
12559
12560         cat > conftest.$ac_ext <<EOF
12561 #line 12562 "configure"
12562 #include "confdefs.h"
12563
12564 #ifdef HAVE_DB_185_H
12565 # include <db_185.h>
12566 #else
12567 # include <db.h>
12568 #endif
12569
12570 #ifndef DB_VERSION_MAJOR
12571 # define DB_VERSION_MAJOR 1
12572 #endif
12573
12574 #ifndef NULL
12575 #define NULL ((void*)0)
12576 #endif
12577
12578 int main() {
12579
12580 #if DB_VERSION_MAJOR > 1
12581         {
12582                 char *version;
12583                 int major, minor, patch;
12584
12585                 version = db_version( &major, &minor, &patch );
12586
12587                 if( major != DB_VERSION_MAJOR ||
12588                         minor < DB_VERSION_MINOR )
12589                 {
12590                         printf("Berkeley DB version mismatch\n"
12591                                 "\texpected: %s\n\tgot: %s\n",
12592                                 DB_VERSION_STRING, version);
12593                         return 1;
12594                 }
12595         }
12596 #endif
12597
12598 #if DB_VERSION_MAJOR > 2
12599         db_env_create( NULL, 0 );
12600 #elif DB_VERSION_MAJOR > 1
12601         db_appexit( NULL );
12602 #else
12603         (void) dbopen( NULL, 0, 0, 0, NULL);
12604 #endif
12605
12606 ; return 0; }
12607 EOF
12608 if { (eval echo configure:12609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12609   rm -rf conftest*
12610   ol_cv_db_db2=yes
12611 else
12612   echo "configure: failed program was:" >&5
12613   cat conftest.$ac_ext >&5
12614   rm -rf conftest*
12615   ol_cv_db_db2=no
12616 fi
12617 rm -f conftest*
12618
12619         LIBS="$ol_LIBS"
12620
12621 fi
12622
12623 echo "$ac_t""$ol_cv_db_db2" 1>&6
12624
12625         if test $ol_cv_db_db2 = yes ; then
12626                 ol_cv_lib_db=-ldb2
12627         fi
12628 fi
12629
12630 if test $ol_cv_lib_db = no ; then
12631         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12632 echo "configure:12633: checking for Berkeley DB link (-ldb1)" >&5
12633 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12634   echo $ac_n "(cached) $ac_c" 1>&6
12635 else
12636   
12637         ol_DB_LIB=-ldb1
12638         ol_LIBS=$LIBS
12639         LIBS="$ol_DB_LIB $LIBS"
12640
12641         cat > conftest.$ac_ext <<EOF
12642 #line 12643 "configure"
12643 #include "confdefs.h"
12644
12645 #ifdef HAVE_DB_185_H
12646 # include <db_185.h>
12647 #else
12648 # include <db.h>
12649 #endif
12650
12651 #ifndef DB_VERSION_MAJOR
12652 # define DB_VERSION_MAJOR 1
12653 #endif
12654
12655 #ifndef NULL
12656 #define NULL ((void*)0)
12657 #endif
12658
12659 int main() {
12660
12661 #if DB_VERSION_MAJOR > 1
12662         {
12663                 char *version;
12664                 int major, minor, patch;
12665
12666                 version = db_version( &major, &minor, &patch );
12667
12668                 if( major != DB_VERSION_MAJOR ||
12669                         minor < DB_VERSION_MINOR )
12670                 {
12671                         printf("Berkeley DB version mismatch\n"
12672                                 "\texpected: %s\n\tgot: %s\n",
12673                                 DB_VERSION_STRING, version);
12674                         return 1;
12675                 }
12676         }
12677 #endif
12678
12679 #if DB_VERSION_MAJOR > 2
12680         db_env_create( NULL, 0 );
12681 #elif DB_VERSION_MAJOR > 1
12682         db_appexit( NULL );
12683 #else
12684         (void) dbopen( NULL, 0, 0, 0, NULL);
12685 #endif
12686
12687 ; return 0; }
12688 EOF
12689 if { (eval echo configure:12690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12690   rm -rf conftest*
12691   ol_cv_db_db1=yes
12692 else
12693   echo "configure: failed program was:" >&5
12694   cat conftest.$ac_ext >&5
12695   rm -rf conftest*
12696   ol_cv_db_db1=no
12697 fi
12698 rm -f conftest*
12699
12700         LIBS="$ol_LIBS"
12701
12702 fi
12703
12704 echo "$ac_t""$ol_cv_db_db1" 1>&6
12705
12706         if test $ol_cv_db_db1 = yes ; then
12707                 ol_cv_lib_db=-ldb1
12708         fi
12709 fi
12710
12711
12712                 if test "$ol_cv_lib_db" != no ; then
12713                         ol_cv_berkeley_db=yes
12714                 fi
12715         fi
12716 fi
12717
12718         else
12719                 ol_cv_berkeley_db=no
12720 for ac_hdr in db.h
12721 do
12722 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12723 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12724 echo "configure:12725: checking for $ac_hdr" >&5
12725 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12726   echo $ac_n "(cached) $ac_c" 1>&6
12727 else
12728   cat > conftest.$ac_ext <<EOF
12729 #line 12730 "configure"
12730 #include "confdefs.h"
12731 #include <$ac_hdr>
12732 EOF
12733 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12734 { (eval echo configure:12735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12735 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12736 if test -z "$ac_err"; then
12737   rm -rf conftest*
12738   eval "ac_cv_header_$ac_safe=yes"
12739 else
12740   echo "$ac_err" >&5
12741   echo "configure: failed program was:" >&5
12742   cat conftest.$ac_ext >&5
12743   rm -rf conftest*
12744   eval "ac_cv_header_$ac_safe=no"
12745 fi
12746 rm -f conftest*
12747 fi
12748 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12749   echo "$ac_t""yes" 1>&6
12750     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12751   cat >> confdefs.h <<EOF
12752 #define $ac_tr_hdr 1
12753 EOF
12754  
12755 else
12756   echo "$ac_t""no" 1>&6
12757 fi
12758 done
12759
12760 if test $ac_cv_header_db_h = yes; then
12761         ol_cv_lib_db=no
12762 if test $ol_cv_lib_db = no ; then
12763         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
12764 echo "configure:12765: checking for Berkeley DB link (default)" >&5
12765 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
12766   echo $ac_n "(cached) $ac_c" 1>&6
12767 else
12768   
12769         ol_DB_LIB=
12770         ol_LIBS=$LIBS
12771         LIBS="$ol_DB_LIB $LIBS"
12772
12773         cat > conftest.$ac_ext <<EOF
12774 #line 12775 "configure"
12775 #include "confdefs.h"
12776
12777 #ifdef HAVE_DB_185_H
12778 # include <db_185.h>
12779 #else
12780 # include <db.h>
12781 #endif
12782
12783 #ifndef DB_VERSION_MAJOR
12784 # define DB_VERSION_MAJOR 1
12785 #endif
12786
12787 #ifndef NULL
12788 #define NULL ((void*)0)
12789 #endif
12790
12791 int main() {
12792
12793 #if DB_VERSION_MAJOR > 1
12794         {
12795                 char *version;
12796                 int major, minor, patch;
12797
12798                 version = db_version( &major, &minor, &patch );
12799
12800                 if( major != DB_VERSION_MAJOR ||
12801                         minor < DB_VERSION_MINOR )
12802                 {
12803                         printf("Berkeley DB version mismatch\n"
12804                                 "\texpected: %s\n\tgot: %s\n",
12805                                 DB_VERSION_STRING, version);
12806                         return 1;
12807                 }
12808         }
12809 #endif
12810
12811 #if DB_VERSION_MAJOR > 2
12812         db_env_create( NULL, 0 );
12813 #elif DB_VERSION_MAJOR > 1
12814         db_appexit( NULL );
12815 #else
12816         (void) dbopen( NULL, 0, 0, 0, NULL);
12817 #endif
12818
12819 ; return 0; }
12820 EOF
12821 if { (eval echo configure:12822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12822   rm -rf conftest*
12823   ol_cv_db_none=yes
12824 else
12825   echo "configure: failed program was:" >&5
12826   cat conftest.$ac_ext >&5
12827   rm -rf conftest*
12828   ol_cv_db_none=no
12829 fi
12830 rm -f conftest*
12831
12832         LIBS="$ol_LIBS"
12833
12834 fi
12835
12836 echo "$ac_t""$ol_cv_db_none" 1>&6
12837
12838         if test $ol_cv_db_none = yes ; then
12839                 ol_cv_lib_db=yes
12840         fi
12841 fi
12842
12843 if test $ol_cv_lib_db = no ; then
12844         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12845 echo "configure:12846: checking for Berkeley DB link (-ldb)" >&5
12846 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12847   echo $ac_n "(cached) $ac_c" 1>&6
12848 else
12849   
12850         ol_DB_LIB=-ldb
12851         ol_LIBS=$LIBS
12852         LIBS="$ol_DB_LIB $LIBS"
12853
12854         cat > conftest.$ac_ext <<EOF
12855 #line 12856 "configure"
12856 #include "confdefs.h"
12857
12858 #ifdef HAVE_DB_185_H
12859 # include <db_185.h>
12860 #else
12861 # include <db.h>
12862 #endif
12863
12864 #ifndef DB_VERSION_MAJOR
12865 # define DB_VERSION_MAJOR 1
12866 #endif
12867
12868 #ifndef NULL
12869 #define NULL ((void*)0)
12870 #endif
12871
12872 int main() {
12873
12874 #if DB_VERSION_MAJOR > 1
12875         {
12876                 char *version;
12877                 int major, minor, patch;
12878
12879                 version = db_version( &major, &minor, &patch );
12880
12881                 if( major != DB_VERSION_MAJOR ||
12882                         minor < DB_VERSION_MINOR )
12883                 {
12884                         printf("Berkeley DB version mismatch\n"
12885                                 "\texpected: %s\n\tgot: %s\n",
12886                                 DB_VERSION_STRING, version);
12887                         return 1;
12888                 }
12889         }
12890 #endif
12891
12892 #if DB_VERSION_MAJOR > 2
12893         db_env_create( NULL, 0 );
12894 #elif DB_VERSION_MAJOR > 1
12895         db_appexit( NULL );
12896 #else
12897         (void) dbopen( NULL, 0, 0, 0, NULL);
12898 #endif
12899
12900 ; return 0; }
12901 EOF
12902 if { (eval echo configure:12903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12903   rm -rf conftest*
12904   ol_cv_db_db=yes
12905 else
12906   echo "configure: failed program was:" >&5
12907   cat conftest.$ac_ext >&5
12908   rm -rf conftest*
12909   ol_cv_db_db=no
12910 fi
12911 rm -f conftest*
12912
12913         LIBS="$ol_LIBS"
12914
12915 fi
12916
12917 echo "$ac_t""$ol_cv_db_db" 1>&6
12918
12919         if test $ol_cv_db_db = yes ; then
12920                 ol_cv_lib_db=-ldb
12921         fi
12922 fi
12923
12924 if test $ol_cv_lib_db = no ; then
12925         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12926 echo "configure:12927: checking for Berkeley DB link (-ldb3)" >&5
12927 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12928   echo $ac_n "(cached) $ac_c" 1>&6
12929 else
12930   
12931         ol_DB_LIB=-ldb3
12932         ol_LIBS=$LIBS
12933         LIBS="$ol_DB_LIB $LIBS"
12934
12935         cat > conftest.$ac_ext <<EOF
12936 #line 12937 "configure"
12937 #include "confdefs.h"
12938
12939 #ifdef HAVE_DB_185_H
12940 # include <db_185.h>
12941 #else
12942 # include <db.h>
12943 #endif
12944
12945 #ifndef DB_VERSION_MAJOR
12946 # define DB_VERSION_MAJOR 1
12947 #endif
12948
12949 #ifndef NULL
12950 #define NULL ((void*)0)
12951 #endif
12952
12953 int main() {
12954
12955 #if DB_VERSION_MAJOR > 1
12956         {
12957                 char *version;
12958                 int major, minor, patch;
12959
12960                 version = db_version( &major, &minor, &patch );
12961
12962                 if( major != DB_VERSION_MAJOR ||
12963                         minor < DB_VERSION_MINOR )
12964                 {
12965                         printf("Berkeley DB version mismatch\n"
12966                                 "\texpected: %s\n\tgot: %s\n",
12967                                 DB_VERSION_STRING, version);
12968                         return 1;
12969                 }
12970         }
12971 #endif
12972
12973 #if DB_VERSION_MAJOR > 2
12974         db_env_create( NULL, 0 );
12975 #elif DB_VERSION_MAJOR > 1
12976         db_appexit( NULL );
12977 #else
12978         (void) dbopen( NULL, 0, 0, 0, NULL);
12979 #endif
12980
12981 ; return 0; }
12982 EOF
12983 if { (eval echo configure:12984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12984   rm -rf conftest*
12985   ol_cv_db_db3=yes
12986 else
12987   echo "configure: failed program was:" >&5
12988   cat conftest.$ac_ext >&5
12989   rm -rf conftest*
12990   ol_cv_db_db3=no
12991 fi
12992 rm -f conftest*
12993
12994         LIBS="$ol_LIBS"
12995
12996 fi
12997
12998 echo "$ac_t""$ol_cv_db_db3" 1>&6
12999
13000         if test $ol_cv_db_db3 = yes ; then
13001                 ol_cv_lib_db=-ldb3
13002         fi
13003 fi
13004
13005 if test $ol_cv_lib_db = no ; then
13006         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
13007 echo "configure:13008: checking for Berkeley DB link (-ldb2)" >&5
13008 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
13009   echo $ac_n "(cached) $ac_c" 1>&6
13010 else
13011   
13012         ol_DB_LIB=-ldb2
13013         ol_LIBS=$LIBS
13014         LIBS="$ol_DB_LIB $LIBS"
13015
13016         cat > conftest.$ac_ext <<EOF
13017 #line 13018 "configure"
13018 #include "confdefs.h"
13019
13020 #ifdef HAVE_DB_185_H
13021 # include <db_185.h>
13022 #else
13023 # include <db.h>
13024 #endif
13025
13026 #ifndef DB_VERSION_MAJOR
13027 # define DB_VERSION_MAJOR 1
13028 #endif
13029
13030 #ifndef NULL
13031 #define NULL ((void*)0)
13032 #endif
13033
13034 int main() {
13035
13036 #if DB_VERSION_MAJOR > 1
13037         {
13038                 char *version;
13039                 int major, minor, patch;
13040
13041                 version = db_version( &major, &minor, &patch );
13042
13043                 if( major != DB_VERSION_MAJOR ||
13044                         minor < DB_VERSION_MINOR )
13045                 {
13046                         printf("Berkeley DB version mismatch\n"
13047                                 "\texpected: %s\n\tgot: %s\n",
13048                                 DB_VERSION_STRING, version);
13049                         return 1;
13050                 }
13051         }
13052 #endif
13053
13054 #if DB_VERSION_MAJOR > 2
13055         db_env_create( NULL, 0 );
13056 #elif DB_VERSION_MAJOR > 1
13057         db_appexit( NULL );
13058 #else
13059         (void) dbopen( NULL, 0, 0, 0, NULL);
13060 #endif
13061
13062 ; return 0; }
13063 EOF
13064 if { (eval echo configure:13065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13065   rm -rf conftest*
13066   ol_cv_db_db2=yes
13067 else
13068   echo "configure: failed program was:" >&5
13069   cat conftest.$ac_ext >&5
13070   rm -rf conftest*
13071   ol_cv_db_db2=no
13072 fi
13073 rm -f conftest*
13074
13075         LIBS="$ol_LIBS"
13076
13077 fi
13078
13079 echo "$ac_t""$ol_cv_db_db2" 1>&6
13080
13081         if test $ol_cv_db_db2 = yes ; then
13082                 ol_cv_lib_db=-ldb2
13083         fi
13084 fi
13085
13086 if test $ol_cv_lib_db = no ; then
13087         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
13088 echo "configure:13089: checking for Berkeley DB link (-ldb1)" >&5
13089 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
13090   echo $ac_n "(cached) $ac_c" 1>&6
13091 else
13092   
13093         ol_DB_LIB=-ldb1
13094         ol_LIBS=$LIBS
13095         LIBS="$ol_DB_LIB $LIBS"
13096
13097         cat > conftest.$ac_ext <<EOF
13098 #line 13099 "configure"
13099 #include "confdefs.h"
13100
13101 #ifdef HAVE_DB_185_H
13102 # include <db_185.h>
13103 #else
13104 # include <db.h>
13105 #endif
13106
13107 #ifndef DB_VERSION_MAJOR
13108 # define DB_VERSION_MAJOR 1
13109 #endif
13110
13111 #ifndef NULL
13112 #define NULL ((void*)0)
13113 #endif
13114
13115 int main() {
13116
13117 #if DB_VERSION_MAJOR > 1
13118         {
13119                 char *version;
13120                 int major, minor, patch;
13121
13122                 version = db_version( &major, &minor, &patch );
13123
13124                 if( major != DB_VERSION_MAJOR ||
13125                         minor < DB_VERSION_MINOR )
13126                 {
13127                         printf("Berkeley DB version mismatch\n"
13128                                 "\texpected: %s\n\tgot: %s\n",
13129                                 DB_VERSION_STRING, version);
13130                         return 1;
13131                 }
13132         }
13133 #endif
13134
13135 #if DB_VERSION_MAJOR > 2
13136         db_env_create( NULL, 0 );
13137 #elif DB_VERSION_MAJOR > 1
13138         db_appexit( NULL );
13139 #else
13140         (void) dbopen( NULL, 0, 0, 0, NULL);
13141 #endif
13142
13143 ; return 0; }
13144 EOF
13145 if { (eval echo configure:13146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13146   rm -rf conftest*
13147   ol_cv_db_db1=yes
13148 else
13149   echo "configure: failed program was:" >&5
13150   cat conftest.$ac_ext >&5
13151   rm -rf conftest*
13152   ol_cv_db_db1=no
13153 fi
13154 rm -f conftest*
13155
13156         LIBS="$ol_LIBS"
13157
13158 fi
13159
13160 echo "$ac_t""$ol_cv_db_db1" 1>&6
13161
13162         if test $ol_cv_db_db1 = yes ; then
13163                 ol_cv_lib_db=-ldb1
13164         fi
13165 fi
13166
13167
13168         if test "$ol_cv_lib_db" != no ; then
13169                 ol_cv_berkeley_db=yes
13170                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
13171 echo "configure:13172: checking for Berkeley DB thread support" >&5
13172 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
13173   echo $ac_n "(cached) $ac_c" 1>&6
13174 else
13175   
13176         ol_LIBS="$LIBS"
13177         if test $ol_cv_lib_db != yes ; then
13178                 LIBS="$ol_cv_lib_db"
13179         fi
13180
13181         if test "$cross_compiling" = yes; then
13182   ol_cv_berkeley_db_thread=cross
13183 else
13184   cat > conftest.$ac_ext <<EOF
13185 #line 13186 "configure"
13186 #include "confdefs.h"
13187
13188 #ifdef HAVE_DB_185_H
13189         choke me;
13190 #else
13191 #include <db.h>
13192 #endif
13193 #ifndef NULL
13194 #define NULL ((void *)0)
13195 #endif
13196 main()
13197 {
13198         int rc;
13199         u_int32_t flags = DB_CREATE |
13200 #ifdef DB_PRIVATE
13201                 DB_PRIVATE |
13202 #endif
13203                 DB_THREAD;
13204
13205 #if DB_VERSION_MAJOR > 2
13206         DB_ENV *env = NULL;
13207
13208         rc = db_env_create( &env, 0 );
13209
13210         flags |= DB_INIT_MPOOL;
13211 #ifdef DB_MPOOL_PRIVATE
13212         flags |= DB_MPOOL_PRIVATE;
13213 #endif
13214
13215         if( rc ) {
13216                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13217                 return rc;
13218         }
13219
13220 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
13221         rc = env->open( env, NULL, flags, 0 );
13222 #else
13223         rc = env->open( env, NULL, NULL, flags, 0 );
13224 #endif
13225
13226         if ( rc == 0 ) {
13227                 rc = env->close( env, 0 );
13228         }
13229
13230         if( rc ) {
13231                 printf("BerkeleyDB: %s\n", db_strerror(rc) );
13232                 return rc;
13233         }
13234
13235 #else
13236         DB_ENV env;
13237         memset( &env, '\0', sizeof(env) );
13238
13239         rc = db_appinit( NULL, NULL, &env, flags );
13240
13241         if( rc == 0 ) {
13242                 db_appexit( &env );
13243         }
13244
13245         unlink("__db_mpool.share");
13246         unlink("__db_lock.share");
13247 #endif
13248
13249         return rc;
13250 }
13251 EOF
13252 if { (eval echo configure:13253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13253 then
13254   ol_cv_berkeley_db_thread=yes
13255 else
13256   echo "configure: failed program was:" >&5
13257   cat conftest.$ac_ext >&5
13258   rm -fr conftest*
13259   ol_cv_berkeley_db_thread=no
13260 fi
13261 rm -fr conftest*
13262 fi
13263
13264
13265         LIBS="$ol_LIBS"
13266
13267         if test $ol_cv_berkeley_db_thread != no ; then
13268                 cat >> confdefs.h <<\EOF
13269 #define HAVE_BERKELEY_DB_THREAD 1
13270 EOF
13271
13272         fi
13273
13274 fi
13275
13276 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
13277         fi
13278 fi
13279
13280         fi
13281
13282         if test $ol_cv_berkeley_db != no ; then
13283                 cat >> confdefs.h <<\EOF
13284 #define HAVE_BERKELEY_DB 1
13285 EOF
13286
13287
13288                 ol_link_ldbm=berkeley
13289                 ol_with_ldbm_api=db
13290
13291                 if test $ol_with_ldbm_type = hash ; then
13292                         cat >> confdefs.h <<\EOF
13293 #define LDBM_USE_DBHASH 1
13294 EOF
13295
13296                 else
13297                         cat >> confdefs.h <<\EOF
13298 #define LDBM_USE_DBBTREE 1
13299 EOF
13300
13301                 fi
13302
13303                                                 if test $ol_cv_lib_db != yes ; then
13304                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
13305                 fi
13306         fi
13307 fi
13308
13309 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
13310         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
13311         ol_with_ldbm_api=none
13312 fi
13313
13314 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
13315         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
13316 echo "configure:13317: checking for MDBM library" >&5
13317 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
13318   echo $ac_n "(cached) $ac_c" 1>&6
13319 else
13320         ol_LIBS="$LIBS"
13321         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
13322 echo "configure:13323: checking for mdbm_set_chain" >&5
13323 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
13324   echo $ac_n "(cached) $ac_c" 1>&6
13325 else
13326   cat > conftest.$ac_ext <<EOF
13327 #line 13328 "configure"
13328 #include "confdefs.h"
13329 /* System header to define __stub macros and hopefully few prototypes,
13330     which can conflict with char mdbm_set_chain(); below.  */
13331 #include <assert.h>
13332 /* Override any gcc2 internal prototype to avoid an error.  */
13333 /* We use char because int might match the return type of a gcc2
13334     builtin and then its argument prototype would still apply.  */
13335 char mdbm_set_chain();
13336 char (*f)();
13337
13338 int main() {
13339
13340 /* The GNU C library defines this for functions which it implements
13341     to always fail with ENOSYS.  Some functions are actually named
13342     something starting with __ and the normal name is an alias.  */
13343 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
13344 choke me
13345 #else
13346 f = mdbm_set_chain;
13347 #endif
13348
13349 ; return 0; }
13350 EOF
13351 if { (eval echo configure:13352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13352   rm -rf conftest*
13353   eval "ac_cv_func_mdbm_set_chain=yes"
13354 else
13355   echo "configure: failed program was:" >&5
13356   cat conftest.$ac_ext >&5
13357   rm -rf conftest*
13358   eval "ac_cv_func_mdbm_set_chain=no"
13359 fi
13360 rm -f conftest*
13361 fi
13362
13363 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
13364   echo "$ac_t""yes" 1>&6
13365   ol_cv_lib_mdbm=yes
13366 else
13367   echo "$ac_t""no" 1>&6
13368
13369                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
13370 echo "configure:13371: checking for mdbm_set_chain in -lmdbm" >&5
13371 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
13372 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13373   echo $ac_n "(cached) $ac_c" 1>&6
13374 else
13375   ac_save_LIBS="$LIBS"
13376 LIBS="-lmdbm  $LIBS"
13377 cat > conftest.$ac_ext <<EOF
13378 #line 13379 "configure"
13379 #include "confdefs.h"
13380 /* Override any gcc2 internal prototype to avoid an error.  */
13381 /* We use char because int might match the return type of a gcc2
13382     builtin and then its argument prototype would still apply.  */
13383 char mdbm_set_chain();
13384
13385 int main() {
13386 mdbm_set_chain()
13387 ; return 0; }
13388 EOF
13389 if { (eval echo configure:13390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13390   rm -rf conftest*
13391   eval "ac_cv_lib_$ac_lib_var=yes"
13392 else
13393   echo "configure: failed program was:" >&5
13394   cat conftest.$ac_ext >&5
13395   rm -rf conftest*
13396   eval "ac_cv_lib_$ac_lib_var=no"
13397 fi
13398 rm -f conftest*
13399 LIBS="$ac_save_LIBS"
13400
13401 fi
13402 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13403   echo "$ac_t""yes" 1>&6
13404   ol_cv_lib_mdbm=-lmdbm
13405 else
13406   echo "$ac_t""no" 1>&6
13407 ol_cv_lib_mdbm=no
13408 fi
13409
13410         
13411 fi
13412
13413         LIBS="$ol_LIBS"
13414
13415 fi
13416
13417 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
13418
13419
13420  for ac_hdr in mdbm.h
13421 do
13422 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13423 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13424 echo "configure:13425: checking for $ac_hdr" >&5
13425 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13426   echo $ac_n "(cached) $ac_c" 1>&6
13427 else
13428   cat > conftest.$ac_ext <<EOF
13429 #line 13430 "configure"
13430 #include "confdefs.h"
13431 #include <$ac_hdr>
13432 EOF
13433 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13434 { (eval echo configure:13435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13435 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13436 if test -z "$ac_err"; then
13437   rm -rf conftest*
13438   eval "ac_cv_header_$ac_safe=yes"
13439 else
13440   echo "$ac_err" >&5
13441   echo "configure: failed program was:" >&5
13442   cat conftest.$ac_ext >&5
13443   rm -rf conftest*
13444   eval "ac_cv_header_$ac_safe=no"
13445 fi
13446 rm -f conftest*
13447 fi
13448 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13449   echo "$ac_t""yes" 1>&6
13450     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13451   cat >> confdefs.h <<EOF
13452 #define $ac_tr_hdr 1
13453 EOF
13454  
13455 else
13456   echo "$ac_t""no" 1>&6
13457 fi
13458 done
13459
13460  echo $ac_n "checking for db""... $ac_c" 1>&6
13461 echo "configure:13462: checking for db" >&5
13462 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
13463   echo $ac_n "(cached) $ac_c" 1>&6
13464 else
13465   
13466         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
13467                 ol_cv_mdbm=no
13468         else
13469                 ol_cv_mdbm=yes
13470         fi
13471
13472 fi
13473
13474 echo "$ac_t""$ol_cv_mdbm" 1>&6
13475  if test $ol_cv_mdbm = yes ; then
13476         cat >> confdefs.h <<\EOF
13477 #define HAVE_MDBM 1
13478 EOF
13479
13480  fi
13481
13482
13483         if test $ol_cv_mdbm = yes ; then
13484                 ol_link_ldbm=mdbm
13485                 ol_with_ldbm_api=mdbm
13486                 if test $ol_cv_lib_mdbm != yes ; then
13487                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
13488                 fi
13489         fi
13490 fi
13491
13492 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
13493         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
13494 echo "configure:13495: checking for GDBM library" >&5
13495 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
13496   echo $ac_n "(cached) $ac_c" 1>&6
13497 else
13498         ol_LIBS="$LIBS"
13499         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
13500 echo "configure:13501: checking for gdbm_open" >&5
13501 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
13502   echo $ac_n "(cached) $ac_c" 1>&6
13503 else
13504   cat > conftest.$ac_ext <<EOF
13505 #line 13506 "configure"
13506 #include "confdefs.h"
13507 /* System header to define __stub macros and hopefully few prototypes,
13508     which can conflict with char gdbm_open(); below.  */
13509 #include <assert.h>
13510 /* Override any gcc2 internal prototype to avoid an error.  */
13511 /* We use char because int might match the return type of a gcc2
13512     builtin and then its argument prototype would still apply.  */
13513 char gdbm_open();
13514 char (*f)();
13515
13516 int main() {
13517
13518 /* The GNU C library defines this for functions which it implements
13519     to always fail with ENOSYS.  Some functions are actually named
13520     something starting with __ and the normal name is an alias.  */
13521 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
13522 choke me
13523 #else
13524 f = gdbm_open;
13525 #endif
13526
13527 ; return 0; }
13528 EOF
13529 if { (eval echo configure:13530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13530   rm -rf conftest*
13531   eval "ac_cv_func_gdbm_open=yes"
13532 else
13533   echo "configure: failed program was:" >&5
13534   cat conftest.$ac_ext >&5
13535   rm -rf conftest*
13536   eval "ac_cv_func_gdbm_open=no"
13537 fi
13538 rm -f conftest*
13539 fi
13540
13541 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
13542   echo "$ac_t""yes" 1>&6
13543   ol_cv_lib_gdbm=yes
13544 else
13545   echo "$ac_t""no" 1>&6
13546
13547                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
13548 echo "configure:13549: checking for gdbm_open in -lgdbm" >&5
13549 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
13550 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13551   echo $ac_n "(cached) $ac_c" 1>&6
13552 else
13553   ac_save_LIBS="$LIBS"
13554 LIBS="-lgdbm  $LIBS"
13555 cat > conftest.$ac_ext <<EOF
13556 #line 13557 "configure"
13557 #include "confdefs.h"
13558 /* Override any gcc2 internal prototype to avoid an error.  */
13559 /* We use char because int might match the return type of a gcc2
13560     builtin and then its argument prototype would still apply.  */
13561 char gdbm_open();
13562
13563 int main() {
13564 gdbm_open()
13565 ; return 0; }
13566 EOF
13567 if { (eval echo configure:13568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13568   rm -rf conftest*
13569   eval "ac_cv_lib_$ac_lib_var=yes"
13570 else
13571   echo "configure: failed program was:" >&5
13572   cat conftest.$ac_ext >&5
13573   rm -rf conftest*
13574   eval "ac_cv_lib_$ac_lib_var=no"
13575 fi
13576 rm -f conftest*
13577 LIBS="$ac_save_LIBS"
13578
13579 fi
13580 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13581   echo "$ac_t""yes" 1>&6
13582   ol_cv_lib_gdbm=-lgdbm
13583 else
13584   echo "$ac_t""no" 1>&6
13585 ol_cv_lib_gdbm=no
13586 fi
13587
13588         
13589 fi
13590
13591         LIBS="$ol_LIBS"
13592
13593 fi
13594
13595 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
13596
13597
13598  for ac_hdr in gdbm.h
13599 do
13600 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13601 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13602 echo "configure:13603: checking for $ac_hdr" >&5
13603 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13604   echo $ac_n "(cached) $ac_c" 1>&6
13605 else
13606   cat > conftest.$ac_ext <<EOF
13607 #line 13608 "configure"
13608 #include "confdefs.h"
13609 #include <$ac_hdr>
13610 EOF
13611 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13612 { (eval echo configure:13613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13613 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13614 if test -z "$ac_err"; then
13615   rm -rf conftest*
13616   eval "ac_cv_header_$ac_safe=yes"
13617 else
13618   echo "$ac_err" >&5
13619   echo "configure: failed program was:" >&5
13620   cat conftest.$ac_ext >&5
13621   rm -rf conftest*
13622   eval "ac_cv_header_$ac_safe=no"
13623 fi
13624 rm -f conftest*
13625 fi
13626 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13627   echo "$ac_t""yes" 1>&6
13628     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13629   cat >> confdefs.h <<EOF
13630 #define $ac_tr_hdr 1
13631 EOF
13632  
13633 else
13634   echo "$ac_t""no" 1>&6
13635 fi
13636 done
13637
13638  echo $ac_n "checking for db""... $ac_c" 1>&6
13639 echo "configure:13640: checking for db" >&5
13640 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
13641   echo $ac_n "(cached) $ac_c" 1>&6
13642 else
13643   
13644         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
13645                 ol_cv_gdbm=no
13646         else
13647                 ol_cv_gdbm=yes
13648         fi
13649
13650 fi
13651
13652 echo "$ac_t""$ol_cv_gdbm" 1>&6
13653  if test $ol_cv_gdbm = yes ; then
13654         cat >> confdefs.h <<\EOF
13655 #define HAVE_GDBM 1
13656 EOF
13657
13658  fi
13659
13660
13661         if test $ol_cv_gdbm = yes ; then
13662                 ol_link_ldbm=gdbm
13663                 ol_with_ldbm_api=gdbm
13664
13665                 if test $ol_cv_lib_gdbm != yes ; then
13666                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
13667                 fi
13668         fi
13669 fi
13670
13671 if test $ol_with_ldbm_api = ndbm ; then
13672         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
13673 echo "configure:13674: checking for NDBM library" >&5
13674 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
13675   echo $ac_n "(cached) $ac_c" 1>&6
13676 else
13677         ol_LIBS="$LIBS"
13678         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
13679 echo "configure:13680: checking for dbm_open" >&5
13680 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
13681   echo $ac_n "(cached) $ac_c" 1>&6
13682 else
13683   cat > conftest.$ac_ext <<EOF
13684 #line 13685 "configure"
13685 #include "confdefs.h"
13686 /* System header to define __stub macros and hopefully few prototypes,
13687     which can conflict with char dbm_open(); below.  */
13688 #include <assert.h>
13689 /* Override any gcc2 internal prototype to avoid an error.  */
13690 /* We use char because int might match the return type of a gcc2
13691     builtin and then its argument prototype would still apply.  */
13692 char dbm_open();
13693 char (*f)();
13694
13695 int main() {
13696
13697 /* The GNU C library defines this for functions which it implements
13698     to always fail with ENOSYS.  Some functions are actually named
13699     something starting with __ and the normal name is an alias.  */
13700 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
13701 choke me
13702 #else
13703 f = dbm_open;
13704 #endif
13705
13706 ; return 0; }
13707 EOF
13708 if { (eval echo configure:13709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13709   rm -rf conftest*
13710   eval "ac_cv_func_dbm_open=yes"
13711 else
13712   echo "configure: failed program was:" >&5
13713   cat conftest.$ac_ext >&5
13714   rm -rf conftest*
13715   eval "ac_cv_func_dbm_open=no"
13716 fi
13717 rm -f conftest*
13718 fi
13719
13720 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
13721   echo "$ac_t""yes" 1>&6
13722   ol_cv_lib_ndbm=yes
13723 else
13724   echo "$ac_t""no" 1>&6
13725
13726                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
13727 echo "configure:13728: checking for dbm_open in -lndbm" >&5
13728 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13729 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13730   echo $ac_n "(cached) $ac_c" 1>&6
13731 else
13732   ac_save_LIBS="$LIBS"
13733 LIBS="-lndbm  $LIBS"
13734 cat > conftest.$ac_ext <<EOF
13735 #line 13736 "configure"
13736 #include "confdefs.h"
13737 /* Override any gcc2 internal prototype to avoid an error.  */
13738 /* We use char because int might match the return type of a gcc2
13739     builtin and then its argument prototype would still apply.  */
13740 char dbm_open();
13741
13742 int main() {
13743 dbm_open()
13744 ; return 0; }
13745 EOF
13746 if { (eval echo configure:13747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13747   rm -rf conftest*
13748   eval "ac_cv_lib_$ac_lib_var=yes"
13749 else
13750   echo "configure: failed program was:" >&5
13751   cat conftest.$ac_ext >&5
13752   rm -rf conftest*
13753   eval "ac_cv_lib_$ac_lib_var=no"
13754 fi
13755 rm -f conftest*
13756 LIBS="$ac_save_LIBS"
13757
13758 fi
13759 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13760   echo "$ac_t""yes" 1>&6
13761   ol_cv_lib_ndbm=-lndbm
13762 else
13763   echo "$ac_t""no" 1>&6
13764
13765                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
13766 echo "configure:13767: checking for dbm_open in -ldbm" >&5
13767 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
13768 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13769   echo $ac_n "(cached) $ac_c" 1>&6
13770 else
13771   ac_save_LIBS="$LIBS"
13772 LIBS="-ldbm  $LIBS"
13773 cat > conftest.$ac_ext <<EOF
13774 #line 13775 "configure"
13775 #include "confdefs.h"
13776 /* Override any gcc2 internal prototype to avoid an error.  */
13777 /* We use char because int might match the return type of a gcc2
13778     builtin and then its argument prototype would still apply.  */
13779 char dbm_open();
13780
13781 int main() {
13782 dbm_open()
13783 ; return 0; }
13784 EOF
13785 if { (eval echo configure:13786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13786   rm -rf conftest*
13787   eval "ac_cv_lib_$ac_lib_var=yes"
13788 else
13789   echo "configure: failed program was:" >&5
13790   cat conftest.$ac_ext >&5
13791   rm -rf conftest*
13792   eval "ac_cv_lib_$ac_lib_var=no"
13793 fi
13794 rm -f conftest*
13795 LIBS="$ac_save_LIBS"
13796
13797 fi
13798 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13799   echo "$ac_t""yes" 1>&6
13800   ol_cv_lib_ndbm=-ldbm
13801 else
13802   echo "$ac_t""no" 1>&6
13803 ol_cv_lib_ndbm=no
13804 fi
13805                 
13806 fi
13807
13808         
13809 fi
13810
13811         LIBS="$ol_LIBS"
13812
13813 fi
13814
13815 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
13816
13817
13818  for ac_hdr in ndbm.h
13819 do
13820 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13821 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13822 echo "configure:13823: checking for $ac_hdr" >&5
13823 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13824   echo $ac_n "(cached) $ac_c" 1>&6
13825 else
13826   cat > conftest.$ac_ext <<EOF
13827 #line 13828 "configure"
13828 #include "confdefs.h"
13829 #include <$ac_hdr>
13830 EOF
13831 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13832 { (eval echo configure:13833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13833 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13834 if test -z "$ac_err"; then
13835   rm -rf conftest*
13836   eval "ac_cv_header_$ac_safe=yes"
13837 else
13838   echo "$ac_err" >&5
13839   echo "configure: failed program was:" >&5
13840   cat conftest.$ac_ext >&5
13841   rm -rf conftest*
13842   eval "ac_cv_header_$ac_safe=no"
13843 fi
13844 rm -f conftest*
13845 fi
13846 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13847   echo "$ac_t""yes" 1>&6
13848     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13849   cat >> confdefs.h <<EOF
13850 #define $ac_tr_hdr 1
13851 EOF
13852  
13853 else
13854   echo "$ac_t""no" 1>&6
13855 fi
13856 done
13857
13858  echo $ac_n "checking for db""... $ac_c" 1>&6
13859 echo "configure:13860: checking for db" >&5
13860 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
13861   echo $ac_n "(cached) $ac_c" 1>&6
13862 else
13863   
13864         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
13865                 ol_cv_ndbm=no
13866         else
13867                 ol_cv_ndbm=yes
13868         fi
13869
13870 fi
13871
13872 echo "$ac_t""$ol_cv_ndbm" 1>&6
13873  if test $ol_cv_ndbm = yes ; then
13874         cat >> confdefs.h <<\EOF
13875 #define HAVE_NDBM 1
13876 EOF
13877
13878  fi
13879
13880
13881         if test $ol_cv_ndbm = yes ; then
13882                 ol_link_ldbm=ndbm
13883                 ol_with_ldbm_api=ndbm
13884
13885                 if test $ol_cv_lib_ndbm != yes ; then
13886                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
13887                 fi
13888         fi
13889 fi
13890
13891 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
13892         echo "configure: warning: could not find suitable LDBM backend" 1>&2
13893         if test $ol_enable_ldbm = yes ; then
13894                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
13895         fi
13896
13897         echo "configure: warning: disabling LDBM" 1>&2
13898         ol_enable_ldbm=no
13899 fi
13900
13901 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
13902         LINK_BINS_DYNAMIC="yes"
13903 else
13904         LINK_BINS_DYNAMIC="no"
13905 fi
13906
13907 if test $ol_enable_wrappers != no ; then
13908         for ac_hdr in tcpd.h
13909 do
13910 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13911 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13912 echo "configure:13913: checking for $ac_hdr" >&5
13913 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13914   echo $ac_n "(cached) $ac_c" 1>&6
13915 else
13916   cat > conftest.$ac_ext <<EOF
13917 #line 13918 "configure"
13918 #include "confdefs.h"
13919 #include <$ac_hdr>
13920 EOF
13921 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13922 { (eval echo configure:13923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13923 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13924 if test -z "$ac_err"; then
13925   rm -rf conftest*
13926   eval "ac_cv_header_$ac_safe=yes"
13927 else
13928   echo "$ac_err" >&5
13929   echo "configure: failed program was:" >&5
13930   cat conftest.$ac_ext >&5
13931   rm -rf conftest*
13932   eval "ac_cv_header_$ac_safe=no"
13933 fi
13934 rm -f conftest*
13935 fi
13936 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13937   echo "$ac_t""yes" 1>&6
13938     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13939   cat >> confdefs.h <<EOF
13940 #define $ac_tr_hdr 1
13941 EOF
13942  
13943 else
13944   echo "$ac_t""no" 1>&6
13945 fi
13946 done
13947
13948
13949         if test $ac_cv_header_tcpd_h != yes ; then
13950                 have_wrappers=no
13951         else
13952                 cat > conftest.$ac_ext <<EOF
13953 #line 13954 "configure"
13954 #include "confdefs.h"
13955
13956 int allow_severity = 0;
13957 int deny_severity  = 0;
13958                 
13959 int main() {
13960 hosts_access()
13961 ; return 0; }
13962 EOF
13963 if { (eval echo configure:13964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13964   rm -rf conftest*
13965   have_wrappers=yes
13966 else
13967   echo "configure: failed program was:" >&5
13968   cat conftest.$ac_ext >&5
13969   rm -rf conftest*
13970   have_wrappers=no
13971 fi
13972 rm -f conftest*
13973         fi
13974
13975         if test $have_wrappers = yes ; then
13976                 cat >> confdefs.h <<\EOF
13977 #define HAVE_TCPD 1
13978 EOF
13979
13980                 WRAP_LIBS="-lwrap"
13981
13982                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
13983 echo "configure:13984: checking for main in -lnsl" >&5
13984 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
13985 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13986   echo $ac_n "(cached) $ac_c" 1>&6
13987 else
13988   ac_save_LIBS="$LIBS"
13989 LIBS="-lnsl  $LIBS"
13990 cat > conftest.$ac_ext <<EOF
13991 #line 13992 "configure"
13992 #include "confdefs.h"
13993
13994 int main() {
13995 main()
13996 ; return 0; }
13997 EOF
13998 if { (eval echo configure:13999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13999   rm -rf conftest*
14000   eval "ac_cv_lib_$ac_lib_var=yes"
14001 else
14002   echo "configure: failed program was:" >&5
14003   cat conftest.$ac_ext >&5
14004   rm -rf conftest*
14005   eval "ac_cv_lib_$ac_lib_var=no"
14006 fi
14007 rm -f conftest*
14008 LIBS="$ac_save_LIBS"
14009
14010 fi
14011 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14012   echo "$ac_t""yes" 1>&6
14013     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
14014     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
14015   cat >> confdefs.h <<EOF
14016 #define $ac_tr_lib 1
14017 EOF
14018
14019   LIBS="-lnsl $LIBS"
14020
14021 else
14022   echo "$ac_t""no" 1>&6
14023 fi
14024
14025         else
14026                 echo "configure: warning: could not find -lwrap" 1>&2
14027                 if test $ol_enable_wrappers = yes ; then
14028                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
14029                 fi
14030
14031                 echo "configure: warning: disabling wrappers support" 1>&2
14032                 ol_enable_wrappers=no
14033                 WRAP_LIBS=""
14034         fi
14035 fi
14036
14037 if test $ol_enable_syslog != no ; then
14038         echo $ac_n "checking for openlog""... $ac_c" 1>&6
14039 echo "configure:14040: checking for openlog" >&5
14040 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
14041   echo $ac_n "(cached) $ac_c" 1>&6
14042 else
14043   cat > conftest.$ac_ext <<EOF
14044 #line 14045 "configure"
14045 #include "confdefs.h"
14046 /* System header to define __stub macros and hopefully few prototypes,
14047     which can conflict with char openlog(); below.  */
14048 #include <assert.h>
14049 /* Override any gcc2 internal prototype to avoid an error.  */
14050 /* We use char because int might match the return type of a gcc2
14051     builtin and then its argument prototype would still apply.  */
14052 char openlog();
14053 char (*f)();
14054
14055 int main() {
14056
14057 /* The GNU C library defines this for functions which it implements
14058     to always fail with ENOSYS.  Some functions are actually named
14059     something starting with __ and the normal name is an alias.  */
14060 #if defined (__stub_openlog) || defined (__stub___openlog)
14061 choke me
14062 #else
14063 f = openlog;
14064 #endif
14065
14066 ; return 0; }
14067 EOF
14068 if { (eval echo configure:14069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14069   rm -rf conftest*
14070   eval "ac_cv_func_openlog=yes"
14071 else
14072   echo "configure: failed program was:" >&5
14073   cat conftest.$ac_ext >&5
14074   rm -rf conftest*
14075   eval "ac_cv_func_openlog=no"
14076 fi
14077 rm -f conftest*
14078 fi
14079
14080 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
14081   echo "$ac_t""yes" 1>&6
14082   :
14083 else
14084   echo "$ac_t""no" 1>&6
14085 fi
14086
14087         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
14088                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
14089         fi
14090         ol_enable_syslog=$ac_cv_func_openlog
14091 fi
14092
14093 ol_link_sql=no
14094 if test $ol_enable_sql != no ; then
14095         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
14096 echo "configure:14097: checking for SQLDriverConnect in -liodbc" >&5
14097 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14098 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14099   echo $ac_n "(cached) $ac_c" 1>&6
14100 else
14101   ac_save_LIBS="$LIBS"
14102 LIBS="-liodbc  $LIBS"
14103 cat > conftest.$ac_ext <<EOF
14104 #line 14105 "configure"
14105 #include "confdefs.h"
14106 /* Override any gcc2 internal prototype to avoid an error.  */
14107 /* We use char because int might match the return type of a gcc2
14108     builtin and then its argument prototype would still apply.  */
14109 char SQLDriverConnect();
14110
14111 int main() {
14112 SQLDriverConnect()
14113 ; return 0; }
14114 EOF
14115 if { (eval echo configure:14116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14116   rm -rf conftest*
14117   eval "ac_cv_lib_$ac_lib_var=yes"
14118 else
14119   echo "configure: failed program was:" >&5
14120   cat conftest.$ac_ext >&5
14121   rm -rf conftest*
14122   eval "ac_cv_lib_$ac_lib_var=no"
14123 fi
14124 rm -f conftest*
14125 LIBS="$ac_save_LIBS"
14126
14127 fi
14128 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14129   echo "$ac_t""yes" 1>&6
14130   have_iodbc=yes
14131 else
14132   echo "$ac_t""no" 1>&6
14133 have_iodbc=no
14134 fi
14135
14136         if test $have_iodbc = yes ; then
14137                 ol_link_sql="-liodbc"
14138         else
14139                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
14140 echo "configure:14141: checking for SQLDriverConnect in -lodbc" >&5
14141 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
14142 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14143   echo $ac_n "(cached) $ac_c" 1>&6
14144 else
14145   ac_save_LIBS="$LIBS"
14146 LIBS="-lodbc  $LIBS"
14147 cat > conftest.$ac_ext <<EOF
14148 #line 14149 "configure"
14149 #include "confdefs.h"
14150 /* Override any gcc2 internal prototype to avoid an error.  */
14151 /* We use char because int might match the return type of a gcc2
14152     builtin and then its argument prototype would still apply.  */
14153 char SQLDriverConnect();
14154
14155 int main() {
14156 SQLDriverConnect()
14157 ; return 0; }
14158 EOF
14159 if { (eval echo configure:14160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14160   rm -rf conftest*
14161   eval "ac_cv_lib_$ac_lib_var=yes"
14162 else
14163   echo "configure: failed program was:" >&5
14164   cat conftest.$ac_ext >&5
14165   rm -rf conftest*
14166   eval "ac_cv_lib_$ac_lib_var=no"
14167 fi
14168 rm -f conftest*
14169 LIBS="$ac_save_LIBS"
14170
14171 fi
14172 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14173   echo "$ac_t""yes" 1>&6
14174   have_odbc=yes
14175 else
14176   echo "$ac_t""no" 1>&6
14177 have_odbc=no
14178 fi
14179
14180                 if test $have_odbc = yes ; then
14181                         ol_link_sql="-lodbc"
14182                 fi
14183         fi
14184
14185         if test $ol_link_sql != no ; then
14186                 SLAPD_SQL_LIBS="$ol_link_sql"
14187
14188         elif test $ol_enable_sql != auto ; then
14189                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
14190         fi
14191 fi
14192
14193 ol_link_termcap=no
14194 for ac_hdr in termcap.h ncurses.h
14195 do
14196 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14197 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14198 echo "configure:14199: checking for $ac_hdr" >&5
14199 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14200   echo $ac_n "(cached) $ac_c" 1>&6
14201 else
14202   cat > conftest.$ac_ext <<EOF
14203 #line 14204 "configure"
14204 #include "confdefs.h"
14205 #include <$ac_hdr>
14206 EOF
14207 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14208 { (eval echo configure:14209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14209 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14210 if test -z "$ac_err"; then
14211   rm -rf conftest*
14212   eval "ac_cv_header_$ac_safe=yes"
14213 else
14214   echo "$ac_err" >&5
14215   echo "configure: failed program was:" >&5
14216   cat conftest.$ac_ext >&5
14217   rm -rf conftest*
14218   eval "ac_cv_header_$ac_safe=no"
14219 fi
14220 rm -f conftest*
14221 fi
14222 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14223   echo "$ac_t""yes" 1>&6
14224     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14225   cat >> confdefs.h <<EOF
14226 #define $ac_tr_hdr 1
14227 EOF
14228  
14229 else
14230   echo "$ac_t""no" 1>&6
14231 fi
14232 done
14233
14234
14235 if test $ol_link_termcap = no ; then
14236         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
14237 echo "configure:14238: checking for tputs in -ltermcap" >&5
14238 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
14239 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14240   echo $ac_n "(cached) $ac_c" 1>&6
14241 else
14242   ac_save_LIBS="$LIBS"
14243 LIBS="-ltermcap  $LIBS"
14244 cat > conftest.$ac_ext <<EOF
14245 #line 14246 "configure"
14246 #include "confdefs.h"
14247 /* Override any gcc2 internal prototype to avoid an error.  */
14248 /* We use char because int might match the return type of a gcc2
14249     builtin and then its argument prototype would still apply.  */
14250 char tputs();
14251
14252 int main() {
14253 tputs()
14254 ; return 0; }
14255 EOF
14256 if { (eval echo configure:14257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14257   rm -rf conftest*
14258   eval "ac_cv_lib_$ac_lib_var=yes"
14259 else
14260   echo "configure: failed program was:" >&5
14261   cat conftest.$ac_ext >&5
14262   rm -rf conftest*
14263   eval "ac_cv_lib_$ac_lib_var=no"
14264 fi
14265 rm -f conftest*
14266 LIBS="$ac_save_LIBS"
14267
14268 fi
14269 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14270   echo "$ac_t""yes" 1>&6
14271   have_termcap=yes
14272 else
14273   echo "$ac_t""no" 1>&6
14274 have_termcap=no
14275 fi
14276
14277         if test $have_termcap = yes ; then
14278                 cat >> confdefs.h <<\EOF
14279 #define HAVE_TERMCAP 1
14280 EOF
14281
14282                 ol_link_termcap=yes
14283                 TERMCAP_LIBS=-ltermcap
14284         fi
14285 fi
14286
14287 if test $ol_link_termcap = no ; then
14288         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
14289 echo "configure:14290: checking for initscr in -lncurses" >&5
14290 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
14291 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14292   echo $ac_n "(cached) $ac_c" 1>&6
14293 else
14294   ac_save_LIBS="$LIBS"
14295 LIBS="-lncurses  $LIBS"
14296 cat > conftest.$ac_ext <<EOF
14297 #line 14298 "configure"
14298 #include "confdefs.h"
14299 /* Override any gcc2 internal prototype to avoid an error.  */
14300 /* We use char because int might match the return type of a gcc2
14301     builtin and then its argument prototype would still apply.  */
14302 char initscr();
14303
14304 int main() {
14305 initscr()
14306 ; return 0; }
14307 EOF
14308 if { (eval echo configure:14309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14309   rm -rf conftest*
14310   eval "ac_cv_lib_$ac_lib_var=yes"
14311 else
14312   echo "configure: failed program was:" >&5
14313   cat conftest.$ac_ext >&5
14314   rm -rf conftest*
14315   eval "ac_cv_lib_$ac_lib_var=no"
14316 fi
14317 rm -f conftest*
14318 LIBS="$ac_save_LIBS"
14319
14320 fi
14321 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14322   echo "$ac_t""yes" 1>&6
14323   have_ncurses=yes
14324 else
14325   echo "$ac_t""no" 1>&6
14326 have_ncurses=no
14327 fi
14328
14329         if test $have_ncurses = yes ; then
14330                 cat >> confdefs.h <<\EOF
14331 #define HAVE_NCURSES 1
14332 EOF
14333
14334                 ol_link_termcap=yes
14335                 TERMCAP_LIBS=-lncurses
14336         fi
14337 fi
14338
14339 if test $ol_link_termcap = no ; then
14340         cat >> confdefs.h <<\EOF
14341 #define NO_TERMCAP 1
14342 EOF
14343
14344         TERMCAP_LIBS=
14345 fi
14346
14347 ol_link_sasl=no
14348 ol_link_spasswd=no
14349 if test $ol_with_cyrus_sasl != no ; then
14350         for ac_hdr in sasl.h
14351 do
14352 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14353 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14354 echo "configure:14355: checking for $ac_hdr" >&5
14355 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14356   echo $ac_n "(cached) $ac_c" 1>&6
14357 else
14358   cat > conftest.$ac_ext <<EOF
14359 #line 14360 "configure"
14360 #include "confdefs.h"
14361 #include <$ac_hdr>
14362 EOF
14363 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14364 { (eval echo configure:14365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14365 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14366 if test -z "$ac_err"; then
14367   rm -rf conftest*
14368   eval "ac_cv_header_$ac_safe=yes"
14369 else
14370   echo "$ac_err" >&5
14371   echo "configure: failed program was:" >&5
14372   cat conftest.$ac_ext >&5
14373   rm -rf conftest*
14374   eval "ac_cv_header_$ac_safe=no"
14375 fi
14376 rm -f conftest*
14377 fi
14378 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14379   echo "$ac_t""yes" 1>&6
14380     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14381   cat >> confdefs.h <<EOF
14382 #define $ac_tr_hdr 1
14383 EOF
14384  
14385 else
14386   echo "$ac_t""no" 1>&6
14387 fi
14388 done
14389
14390
14391         if test $ac_cv_header_sasl_h = yes ; then
14392                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
14393 echo "configure:14394: checking for sasl_client_init in -lsasl" >&5
14394 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
14395 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14396   echo $ac_n "(cached) $ac_c" 1>&6
14397 else
14398   ac_save_LIBS="$LIBS"
14399 LIBS="-lsasl  $LIBS"
14400 cat > conftest.$ac_ext <<EOF
14401 #line 14402 "configure"
14402 #include "confdefs.h"
14403 /* Override any gcc2 internal prototype to avoid an error.  */
14404 /* We use char because int might match the return type of a gcc2
14405     builtin and then its argument prototype would still apply.  */
14406 char sasl_client_init();
14407
14408 int main() {
14409 sasl_client_init()
14410 ; return 0; }
14411 EOF
14412 if { (eval echo configure:14413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14413   rm -rf conftest*
14414   eval "ac_cv_lib_$ac_lib_var=yes"
14415 else
14416   echo "configure: failed program was:" >&5
14417   cat conftest.$ac_ext >&5
14418   rm -rf conftest*
14419   eval "ac_cv_lib_$ac_lib_var=no"
14420 fi
14421 rm -f conftest*
14422 LIBS="$ac_save_LIBS"
14423
14424 fi
14425 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14426   echo "$ac_t""yes" 1>&6
14427   have_cyrus_sasl=yes
14428 else
14429   echo "$ac_t""no" 1>&6
14430 have_cyrus_sasl=no
14431 fi
14432
14433
14434                 if test $have_cyrus_sasl != no ; then
14435                         SASL_LIBS="-lsasl"
14436                         cat >> confdefs.h <<\EOF
14437 #define HAVE_CYRUS_SASL 1
14438 EOF
14439
14440                         ol_link_sasl=yes
14441                 fi
14442         fi
14443
14444         if test $ol_link_sasl = no ; then
14445                 if test $ol_with_cyrus_sasl != auto ; then
14446                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
14447                 else
14448                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
14449                         echo "configure: warning: SASL authentication not supported!" 1>&2
14450                         if test $ol_link_tls = no ; then
14451                                 echo "configure: warning: Strong authentication not supported!" 1>&2
14452                         fi
14453                 fi
14454
14455         elif test $ol_enable_spasswd != no ; then
14456                 ol_link_spasswd=yes
14457         fi
14458
14459 else
14460         echo "configure: warning: SASL authentication not supported!" 1>&2
14461         if test $ol_link_tls = no ; then
14462                 echo "configure: warning: Strong authentication not supported!" 1>&2
14463         fi
14464 fi
14465
14466 if test $cross_compiling != yes ; then
14467         dev=no
14468         if test -r /dev/urandom ; then
14469                 dev="/dev/urandom";
14470         elif test -r /idev/urandom ; then
14471                 dev="/idev/urandom";
14472         elif test -r /dev/srandom ; then
14473                 dev="/dev/srandom";
14474         elif test -r /dev/random ; then
14475                 dev="/dev/random";
14476         elif test -r /idev/random ; then
14477                 dev="/idev/random";
14478         fi
14479
14480         if test $dev != no ; then
14481                 cat >> confdefs.h <<EOF
14482 #define URANDOM_DEVICE "$dev"
14483 EOF
14484
14485         fi
14486 fi
14487
14488 ol_link_fetch=no
14489 if test $ol_with_fetch != no ; then
14490         ol_LIBS=$LIBS
14491 LIBS="-lfetch -lcom_err $LIBS"
14492 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
14493 echo "configure:14494: checking fetch(3) library" >&5
14494 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
14495   echo $ac_n "(cached) $ac_c" 1>&6
14496 else
14497   
14498         cat > conftest.$ac_ext <<EOF
14499 #line 14500 "configure"
14500 #include "confdefs.h"
14501
14502 #include <sys/param.h>
14503 #include <stdio.h>
14504 #include <fetch.h>
14505 int main() {
14506 struct url *u = fetchParseURL("file:///"); 
14507 ; return 0; }
14508 EOF
14509 if { (eval echo configure:14510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14510   rm -rf conftest*
14511   ol_cv_lib_fetch=yes
14512 else
14513   echo "configure: failed program was:" >&5
14514   cat conftest.$ac_ext >&5
14515   rm -rf conftest*
14516   ol_cv_lib_fetch=no
14517 fi
14518 rm -f conftest*
14519 fi
14520
14521 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
14522 LIBS=$ol_LIBS
14523 if test $ol_cv_lib_fetch != no ; then
14524         ol_link_fetch="-lfetch -lcom_err"
14525         cat >> confdefs.h <<\EOF
14526 #define HAVE_FETCH 1
14527 EOF
14528
14529 fi
14530
14531
14532         if test $ol_cv_lib_fetch != no ; then
14533                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
14534                 ol_link_fetch=freebsd
14535
14536         elif test $ol_with_fetch != auto ; then
14537                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
14538         fi 
14539 fi
14540
14541 ol_link_readline=no
14542 if test $ol_with_readline != no ; then
14543         for ac_hdr in readline/readline.h readline/history.h
14544 do
14545 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
14546 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
14547 echo "configure:14548: checking for $ac_hdr" >&5
14548 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
14549   echo $ac_n "(cached) $ac_c" 1>&6
14550 else
14551   cat > conftest.$ac_ext <<EOF
14552 #line 14553 "configure"
14553 #include "confdefs.h"
14554 #include <$ac_hdr>
14555 EOF
14556 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14557 { (eval echo configure:14558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14558 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14559 if test -z "$ac_err"; then
14560   rm -rf conftest*
14561   eval "ac_cv_header_$ac_safe=yes"
14562 else
14563   echo "$ac_err" >&5
14564   echo "configure: failed program was:" >&5
14565   cat conftest.$ac_ext >&5
14566   rm -rf conftest*
14567   eval "ac_cv_header_$ac_safe=no"
14568 fi
14569 rm -f conftest*
14570 fi
14571 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
14572   echo "$ac_t""yes" 1>&6
14573     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
14574   cat >> confdefs.h <<EOF
14575 #define $ac_tr_hdr 1
14576 EOF
14577  
14578 else
14579   echo "$ac_t""no" 1>&6
14580 fi
14581 done
14582
14583
14584         if test $ac_cv_header_readline_readline_h = yes ; then
14585                 save_LIBS="$LIBS"
14586                 LIBS="$TERMCAP_LIBS $LIBS"
14587                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
14588 echo "configure:14589: checking for readline in -lreadline" >&5
14589 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
14590 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14591   echo $ac_n "(cached) $ac_c" 1>&6
14592 else
14593   ac_save_LIBS="$LIBS"
14594 LIBS="-lreadline  $LIBS"
14595 cat > conftest.$ac_ext <<EOF
14596 #line 14597 "configure"
14597 #include "confdefs.h"
14598 /* Override any gcc2 internal prototype to avoid an error.  */
14599 /* We use char because int might match the return type of a gcc2
14600     builtin and then its argument prototype would still apply.  */
14601 char readline();
14602
14603 int main() {
14604 readline()
14605 ; return 0; }
14606 EOF
14607 if { (eval echo configure:14608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14608   rm -rf conftest*
14609   eval "ac_cv_lib_$ac_lib_var=yes"
14610 else
14611   echo "configure: failed program was:" >&5
14612   cat conftest.$ac_ext >&5
14613   rm -rf conftest*
14614   eval "ac_cv_lib_$ac_lib_var=no"
14615 fi
14616 rm -f conftest*
14617 LIBS="$ac_save_LIBS"
14618
14619 fi
14620 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14621   echo "$ac_t""yes" 1>&6
14622   have_readline=yes
14623 else
14624   echo "$ac_t""no" 1>&6
14625 have_readline=no
14626 fi
14627
14628                 LIBS="$save_LIBS"
14629                         
14630                 if test $have_readline = yes ; then
14631                         ol_with_readline=found
14632                         ol_link_readline=yes
14633
14634                         READLINE_LIBS="-lreadline"
14635                 fi
14636         fi
14637 fi
14638
14639 if test $ol_link_readline = yes ; then
14640         cat >> confdefs.h <<\EOF
14641 #define HAVE_READLINE 1
14642 EOF
14643
14644 fi
14645
14646
14647 if test $ol_enable_crypt != no ; then
14648         echo $ac_n "checking for crypt""... $ac_c" 1>&6
14649 echo "configure:14650: checking for crypt" >&5
14650 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
14651   echo $ac_n "(cached) $ac_c" 1>&6
14652 else
14653   cat > conftest.$ac_ext <<EOF
14654 #line 14655 "configure"
14655 #include "confdefs.h"
14656 /* System header to define __stub macros and hopefully few prototypes,
14657     which can conflict with char crypt(); below.  */
14658 #include <assert.h>
14659 /* Override any gcc2 internal prototype to avoid an error.  */
14660 /* We use char because int might match the return type of a gcc2
14661     builtin and then its argument prototype would still apply.  */
14662 char crypt();
14663 char (*f)();
14664
14665 int main() {
14666
14667 /* The GNU C library defines this for functions which it implements
14668     to always fail with ENOSYS.  Some functions are actually named
14669     something starting with __ and the normal name is an alias.  */
14670 #if defined (__stub_crypt) || defined (__stub___crypt)
14671 choke me
14672 #else
14673 f = crypt;
14674 #endif
14675
14676 ; return 0; }
14677 EOF
14678 if { (eval echo configure:14679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14679   rm -rf conftest*
14680   eval "ac_cv_func_crypt=yes"
14681 else
14682   echo "configure: failed program was:" >&5
14683   cat conftest.$ac_ext >&5
14684   rm -rf conftest*
14685   eval "ac_cv_func_crypt=no"
14686 fi
14687 rm -f conftest*
14688 fi
14689
14690 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
14691   echo "$ac_t""yes" 1>&6
14692   have_crypt=yes
14693 else
14694   echo "$ac_t""no" 1>&6
14695
14696                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
14697 echo "configure:14698: checking for crypt in -lcrypt" >&5
14698 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
14699 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14700   echo $ac_n "(cached) $ac_c" 1>&6
14701 else
14702   ac_save_LIBS="$LIBS"
14703 LIBS="-lcrypt  $LIBS"
14704 cat > conftest.$ac_ext <<EOF
14705 #line 14706 "configure"
14706 #include "confdefs.h"
14707 /* Override any gcc2 internal prototype to avoid an error.  */
14708 /* We use char because int might match the return type of a gcc2
14709     builtin and then its argument prototype would still apply.  */
14710 char crypt();
14711
14712 int main() {
14713 crypt()
14714 ; return 0; }
14715 EOF
14716 if { (eval echo configure:14717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14717   rm -rf conftest*
14718   eval "ac_cv_lib_$ac_lib_var=yes"
14719 else
14720   echo "configure: failed program was:" >&5
14721   cat conftest.$ac_ext >&5
14722   rm -rf conftest*
14723   eval "ac_cv_lib_$ac_lib_var=no"
14724 fi
14725 rm -f conftest*
14726 LIBS="$ac_save_LIBS"
14727
14728 fi
14729 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14730   echo "$ac_t""yes" 1>&6
14731   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
14732                         have_crypt=yes
14733 else
14734   echo "$ac_t""no" 1>&6
14735 have_crypt=no
14736 fi
14737
14738 fi
14739
14740
14741         if test $have_crypt = yes ; then
14742                 cat >> confdefs.h <<\EOF
14743 #define HAVE_CRYPT 1
14744 EOF
14745
14746         else
14747                 echo "configure: warning: could not find crypt" 1>&2
14748                 if test $ol_enable_crypt = yes ; then
14749                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
14750                 fi
14751
14752                 echo "configure: warning: disabling crypt support" 1>&2
14753                 ol_enable_crypt=no
14754         fi
14755 fi
14756
14757 if test $ol_enable_proctitle != no ; then
14758         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
14759 echo "configure:14760: checking for setproctitle" >&5
14760 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
14761   echo $ac_n "(cached) $ac_c" 1>&6
14762 else
14763   cat > conftest.$ac_ext <<EOF
14764 #line 14765 "configure"
14765 #include "confdefs.h"
14766 /* System header to define __stub macros and hopefully few prototypes,
14767     which can conflict with char setproctitle(); below.  */
14768 #include <assert.h>
14769 /* Override any gcc2 internal prototype to avoid an error.  */
14770 /* We use char because int might match the return type of a gcc2
14771     builtin and then its argument prototype would still apply.  */
14772 char setproctitle();
14773 char (*f)();
14774
14775 int main() {
14776
14777 /* The GNU C library defines this for functions which it implements
14778     to always fail with ENOSYS.  Some functions are actually named
14779     something starting with __ and the normal name is an alias.  */
14780 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
14781 choke me
14782 #else
14783 f = setproctitle;
14784 #endif
14785
14786 ; return 0; }
14787 EOF
14788 if { (eval echo configure:14789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14789   rm -rf conftest*
14790   eval "ac_cv_func_setproctitle=yes"
14791 else
14792   echo "configure: failed program was:" >&5
14793   cat conftest.$ac_ext >&5
14794   rm -rf conftest*
14795   eval "ac_cv_func_setproctitle=no"
14796 fi
14797 rm -f conftest*
14798 fi
14799
14800 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
14801   echo "$ac_t""yes" 1>&6
14802   have_setproctitle=yes
14803 else
14804   echo "$ac_t""no" 1>&6
14805
14806                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
14807 echo "configure:14808: checking for setproctitle in -lutil" >&5
14808 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
14809 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14810   echo $ac_n "(cached) $ac_c" 1>&6
14811 else
14812   ac_save_LIBS="$LIBS"
14813 LIBS="-lutil  $LIBS"
14814 cat > conftest.$ac_ext <<EOF
14815 #line 14816 "configure"
14816 #include "confdefs.h"
14817 /* Override any gcc2 internal prototype to avoid an error.  */
14818 /* We use char because int might match the return type of a gcc2
14819     builtin and then its argument prototype would still apply.  */
14820 char setproctitle();
14821
14822 int main() {
14823 setproctitle()
14824 ; return 0; }
14825 EOF
14826 if { (eval echo configure:14827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14827   rm -rf conftest*
14828   eval "ac_cv_lib_$ac_lib_var=yes"
14829 else
14830   echo "configure: failed program was:" >&5
14831   cat conftest.$ac_ext >&5
14832   rm -rf conftest*
14833   eval "ac_cv_lib_$ac_lib_var=no"
14834 fi
14835 rm -f conftest*
14836 LIBS="$ac_save_LIBS"
14837
14838 fi
14839 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14840   echo "$ac_t""yes" 1>&6
14841   have_setproctitle=yes
14842                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
14843 else
14844   echo "$ac_t""no" 1>&6
14845 have_setproctitle=no
14846                         LIBOBJS="$LIBOBJS setproctitle.o"
14847                         LIBSRCS="$LIBSRCS setproctitle.c"
14848 fi
14849
14850 fi
14851
14852
14853         if test $have_setproctitle = yes ; then
14854                 cat >> confdefs.h <<\EOF
14855 #define HAVE_SETPROCTITLE 1
14856 EOF
14857
14858         fi
14859 fi
14860
14861 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
14862 echo "configure:14863: checking for ANSI C header files" >&5
14863 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
14864   echo $ac_n "(cached) $ac_c" 1>&6
14865 else
14866   cat > conftest.$ac_ext <<EOF
14867 #line 14868 "configure"
14868 #include "confdefs.h"
14869 #include <stdlib.h>
14870 #include <stdarg.h>
14871 #include <string.h>
14872 #include <float.h>
14873 EOF
14874 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
14875 { (eval echo configure:14876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
14876 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
14877 if test -z "$ac_err"; then
14878   rm -rf conftest*
14879   ac_cv_header_stdc=yes
14880 else
14881   echo "$ac_err" >&5
14882   echo "configure: failed program was:" >&5
14883   cat conftest.$ac_ext >&5
14884   rm -rf conftest*
14885   ac_cv_header_stdc=no
14886 fi
14887 rm -f conftest*
14888
14889 if test $ac_cv_header_stdc = yes; then
14890   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14891 cat > conftest.$ac_ext <<EOF
14892 #line 14893 "configure"
14893 #include "confdefs.h"
14894 #include <string.h>
14895 EOF
14896 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14897   egrep "memchr" >/dev/null 2>&1; then
14898   :
14899 else
14900   rm -rf conftest*
14901   ac_cv_header_stdc=no
14902 fi
14903 rm -f conftest*
14904
14905 fi
14906
14907 if test $ac_cv_header_stdc = yes; then
14908   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14909 cat > conftest.$ac_ext <<EOF
14910 #line 14911 "configure"
14911 #include "confdefs.h"
14912 #include <stdlib.h>
14913 EOF
14914 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14915   egrep "free" >/dev/null 2>&1; then
14916   :
14917 else
14918   rm -rf conftest*
14919   ac_cv_header_stdc=no
14920 fi
14921 rm -f conftest*
14922
14923 fi
14924
14925 if test $ac_cv_header_stdc = yes; then
14926   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14927 if test "$cross_compiling" = yes; then
14928   :
14929 else
14930   cat > conftest.$ac_ext <<EOF
14931 #line 14932 "configure"
14932 #include "confdefs.h"
14933 #include <ctype.h>
14934 #if ((' ' & 0x0FF) == 0x020)
14935 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14936 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14937 #else
14938 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14939  || ('j' <= (c) && (c) <= 'r') \
14940  || ('s' <= (c) && (c) <= 'z'))
14941 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14942 #endif
14943 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14944 int main () { int i; for (i = 0; i < 256; i++)
14945 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
14946 exit (0); }
14947
14948 EOF
14949 if { (eval echo configure:14950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14950 then
14951   :
14952 else
14953   echo "configure: failed program was:" >&5
14954   cat conftest.$ac_ext >&5
14955   rm -fr conftest*
14956   ac_cv_header_stdc=no
14957 fi
14958 rm -fr conftest*
14959 fi
14960
14961 fi
14962 fi
14963
14964 echo "$ac_t""$ac_cv_header_stdc" 1>&6
14965 if test $ac_cv_header_stdc = yes; then
14966   cat >> confdefs.h <<\EOF
14967 #define STDC_HEADERS 1
14968 EOF
14969
14970 fi
14971
14972 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
14973 echo "configure:14974: checking for mode_t" >&5
14974 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
14975   echo $ac_n "(cached) $ac_c" 1>&6
14976 else
14977   cat > conftest.$ac_ext <<EOF
14978 #line 14979 "configure"
14979 #include "confdefs.h"
14980 #include <sys/types.h>
14981 #if STDC_HEADERS
14982 #include <stdlib.h>
14983 #include <stddef.h>
14984 #endif
14985
14986 EOF
14987 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14988   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14989   rm -rf conftest*
14990   eval "ac_cv_type_mode_t=yes"
14991 else
14992   rm -rf conftest*
14993   eval "ac_cv_type_mode_t=no"
14994 fi
14995 rm -f conftest*
14996
14997 fi
14998 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
14999   echo "$ac_t""yes" 1>&6
15000 else
15001   echo "$ac_t""no" 1>&6
15002   cat >> confdefs.h <<EOF
15003 #define mode_t int
15004 EOF
15005
15006 fi
15007
15008 echo $ac_n "checking for off_t""... $ac_c" 1>&6
15009 echo "configure:15010: checking for off_t" >&5
15010 if eval "test \"\${ac_cv_type_off_t+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 <sys/types.h>
15017 #if STDC_HEADERS
15018 #include <stdlib.h>
15019 #include <stddef.h>
15020 #endif
15021
15022 EOF
15023 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15024   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15025   rm -rf conftest*
15026   eval "ac_cv_type_off_t=yes"
15027 else
15028   rm -rf conftest*
15029   eval "ac_cv_type_off_t=no"
15030 fi
15031 rm -f conftest*
15032
15033 fi
15034 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
15035   echo "$ac_t""yes" 1>&6
15036 else
15037   echo "$ac_t""no" 1>&6
15038   cat >> confdefs.h <<EOF
15039 #define off_t long
15040 EOF
15041
15042 fi
15043
15044 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
15045 echo "configure:15046: checking for pid_t" >&5
15046 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
15047   echo $ac_n "(cached) $ac_c" 1>&6
15048 else
15049   cat > conftest.$ac_ext <<EOF
15050 #line 15051 "configure"
15051 #include "confdefs.h"
15052 #include <sys/types.h>
15053 #if STDC_HEADERS
15054 #include <stdlib.h>
15055 #include <stddef.h>
15056 #endif
15057
15058 EOF
15059 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15060   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15061   rm -rf conftest*
15062   eval "ac_cv_type_pid_t=yes"
15063 else
15064   rm -rf conftest*
15065   eval "ac_cv_type_pid_t=no"
15066 fi
15067 rm -f conftest*
15068
15069 fi
15070 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
15071   echo "$ac_t""yes" 1>&6
15072 else
15073   echo "$ac_t""no" 1>&6
15074   cat >> confdefs.h <<EOF
15075 #define pid_t int
15076 EOF
15077
15078 fi
15079
15080 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
15081 echo "configure:15082: checking for ptrdiff_t" >&5
15082 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
15083   echo $ac_n "(cached) $ac_c" 1>&6
15084 else
15085   cat > conftest.$ac_ext <<EOF
15086 #line 15087 "configure"
15087 #include "confdefs.h"
15088 #include <stddef.h>
15089 int main() {
15090 ptrdiff_t p
15091 ; return 0; }
15092 EOF
15093 if { (eval echo configure:15094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15094   rm -rf conftest*
15095   am_cv_type_ptrdiff_t=yes
15096 else
15097   echo "configure: failed program was:" >&5
15098   cat conftest.$ac_ext >&5
15099   rm -rf conftest*
15100   am_cv_type_ptrdiff_t=no
15101 fi
15102 rm -f conftest*
15103 fi
15104
15105 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
15106    if test $am_cv_type_ptrdiff_t = yes; then
15107      cat >> confdefs.h <<\EOF
15108 #define HAVE_PTRDIFF_T 1
15109 EOF
15110
15111    fi
15112
15113 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
15114 echo "configure:15115: checking return type of signal handlers" >&5
15115 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
15116   echo $ac_n "(cached) $ac_c" 1>&6
15117 else
15118   cat > conftest.$ac_ext <<EOF
15119 #line 15120 "configure"
15120 #include "confdefs.h"
15121 #include <sys/types.h>
15122 #include <signal.h>
15123 #ifdef signal
15124 #undef signal
15125 #endif
15126 #ifdef __cplusplus
15127 extern "C" void (*signal (int, void (*)(int)))(int);
15128 #else
15129 void (*signal ()) ();
15130 #endif
15131
15132 int main() {
15133 int i;
15134 ; return 0; }
15135 EOF
15136 if { (eval echo configure:15137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15137   rm -rf conftest*
15138   ac_cv_type_signal=void
15139 else
15140   echo "configure: failed program was:" >&5
15141   cat conftest.$ac_ext >&5
15142   rm -rf conftest*
15143   ac_cv_type_signal=int
15144 fi
15145 rm -f conftest*
15146 fi
15147
15148 echo "$ac_t""$ac_cv_type_signal" 1>&6
15149 cat >> confdefs.h <<EOF
15150 #define RETSIGTYPE $ac_cv_type_signal
15151 EOF
15152
15153
15154 echo $ac_n "checking for size_t""... $ac_c" 1>&6
15155 echo "configure:15156: checking for size_t" >&5
15156 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
15157   echo $ac_n "(cached) $ac_c" 1>&6
15158 else
15159   cat > conftest.$ac_ext <<EOF
15160 #line 15161 "configure"
15161 #include "confdefs.h"
15162 #include <sys/types.h>
15163 #if STDC_HEADERS
15164 #include <stdlib.h>
15165 #include <stddef.h>
15166 #endif
15167
15168 EOF
15169 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15170   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15171   rm -rf conftest*
15172   eval "ac_cv_type_size_t=yes"
15173 else
15174   rm -rf conftest*
15175   eval "ac_cv_type_size_t=no"
15176 fi
15177 rm -f conftest*
15178
15179 fi
15180 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
15181   echo "$ac_t""yes" 1>&6
15182 else
15183   echo "$ac_t""no" 1>&6
15184   cat >> confdefs.h <<EOF
15185 #define size_t unsigned
15186 EOF
15187
15188 fi
15189
15190
15191 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
15192 echo "configure:15193: checking for ssize_t" >&5
15193 if eval "test \"\${ac_cv_type_ssize_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])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15208   rm -rf conftest*
15209   eval "ac_cv_type_ssize_t=yes"
15210 else
15211   rm -rf conftest*
15212   eval "ac_cv_type_ssize_t=no"
15213 fi
15214 rm -f conftest*
15215
15216 fi
15217 if eval "test \"`echo '$ac_cv_type_'ssize_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 ssize_t signed int
15223 EOF
15224
15225 fi
15226
15227 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
15228 echo "configure:15229: checking for caddr_t" >&5
15229 if eval "test \"\${ac_cv_type_caddr_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 <sys/types.h>
15236 #if STDC_HEADERS
15237 #include <stdlib.h>
15238 #include <stddef.h>
15239 #endif
15240
15241 EOF
15242 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15243   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
15244   rm -rf conftest*
15245   eval "ac_cv_type_caddr_t=yes"
15246 else
15247   rm -rf conftest*
15248   eval "ac_cv_type_caddr_t=no"
15249 fi
15250 rm -f conftest*
15251
15252 fi
15253 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
15254   echo "$ac_t""yes" 1>&6
15255 else
15256   echo "$ac_t""no" 1>&6
15257   cat >> confdefs.h <<EOF
15258 #define caddr_t char *
15259 EOF
15260
15261 fi
15262
15263
15264 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
15265 echo "configure:15266: checking for socklen_t" >&5
15266 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
15267   echo $ac_n "(cached) $ac_c" 1>&6
15268 else
15269   cat > conftest.$ac_ext <<EOF
15270 #line 15271 "configure"
15271 #include "confdefs.h"
15272
15273 #ifdef HAVE_SYS_TYPES_H
15274 #include <sys/types.h>
15275 #endif
15276 #ifdef HAVE_SYS_SOCKET_H
15277 #include <sys/socket.h>
15278 #endif
15279
15280 int main() {
15281 socklen_t len;
15282 ; return 0; }
15283 EOF
15284 if { (eval echo configure:15285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15285   rm -rf conftest*
15286   ol_cv_type_socklen_t=yes
15287 else
15288   echo "configure: failed program was:" >&5
15289   cat conftest.$ac_ext >&5
15290   rm -rf conftest*
15291   ol_cv_type_socklen_t=no
15292 fi
15293 rm -f conftest*
15294 fi
15295
15296 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
15297   if test $ol_cv_type_socklen_t = no; then
15298     cat >> confdefs.h <<\EOF
15299 #define socklen_t int
15300 EOF
15301
15302   fi
15303  
15304 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
15305 echo "configure:15306: checking for member st_blksize in aggregate type struct stat" >&5
15306 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
15307   echo $ac_n "(cached) $ac_c" 1>&6
15308 else
15309   cat > conftest.$ac_ext <<EOF
15310 #line 15311 "configure"
15311 #include "confdefs.h"
15312 #include <sys/types.h>
15313 #include <sys/stat.h>
15314 int main() {
15315 struct stat foo; foo.st_blksize;
15316 ; return 0; }
15317 EOF
15318 if { (eval echo configure:15319: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15319   rm -rf conftest*
15320   ac_cv_c_struct_member_st_blksize=yes
15321 else
15322   echo "configure: failed program was:" >&5
15323   cat conftest.$ac_ext >&5
15324   rm -rf conftest*
15325   ac_cv_c_struct_member_st_blksize=no
15326 fi
15327 rm -f conftest*
15328 fi
15329
15330 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
15331 st_blksize="$ac_cv_c_struct_member_st_blksize"
15332 if test $ac_cv_c_struct_member_st_blksize = yes; then
15333   cat >> confdefs.h <<\EOF
15334 #define HAVE_ST_BLKSIZE 1
15335 EOF
15336
15337 fi
15338
15339 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
15340 echo "configure:15341: checking whether time.h and sys/time.h may both be included" >&5
15341 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
15342   echo $ac_n "(cached) $ac_c" 1>&6
15343 else
15344   cat > conftest.$ac_ext <<EOF
15345 #line 15346 "configure"
15346 #include "confdefs.h"
15347 #include <sys/types.h>
15348 #include <sys/time.h>
15349 #include <time.h>
15350 int main() {
15351 struct tm *tp;
15352 ; return 0; }
15353 EOF
15354 if { (eval echo configure:15355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15355   rm -rf conftest*
15356   ac_cv_header_time=yes
15357 else
15358   echo "configure: failed program was:" >&5
15359   cat conftest.$ac_ext >&5
15360   rm -rf conftest*
15361   ac_cv_header_time=no
15362 fi
15363 rm -f conftest*
15364 fi
15365
15366 echo "$ac_t""$ac_cv_header_time" 1>&6
15367 if test $ac_cv_header_time = yes; then
15368   cat >> confdefs.h <<\EOF
15369 #define TIME_WITH_SYS_TIME 1
15370 EOF
15371
15372 fi
15373
15374 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
15375 echo "configure:15376: checking whether struct tm is in sys/time.h or time.h" >&5
15376 if eval "test \"\${ac_cv_struct_tm+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 #include <time.h>
15384 int main() {
15385 struct tm *tp; tp->tm_sec;
15386 ; return 0; }
15387 EOF
15388 if { (eval echo configure:15389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15389   rm -rf conftest*
15390   ac_cv_struct_tm=time.h
15391 else
15392   echo "configure: failed program was:" >&5
15393   cat conftest.$ac_ext >&5
15394   rm -rf conftest*
15395   ac_cv_struct_tm=sys/time.h
15396 fi
15397 rm -f conftest*
15398 fi
15399
15400 echo "$ac_t""$ac_cv_struct_tm" 1>&6
15401 if test $ac_cv_struct_tm = sys/time.h; then
15402   cat >> confdefs.h <<\EOF
15403 #define TM_IN_SYS_TIME 1
15404 EOF
15405
15406 fi
15407
15408 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
15409 echo "configure:15410: checking for uid_t in sys/types.h" >&5
15410 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
15411   echo $ac_n "(cached) $ac_c" 1>&6
15412 else
15413   cat > conftest.$ac_ext <<EOF
15414 #line 15415 "configure"
15415 #include "confdefs.h"
15416 #include <sys/types.h>
15417 EOF
15418 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15419   egrep "uid_t" >/dev/null 2>&1; then
15420   rm -rf conftest*
15421   ac_cv_type_uid_t=yes
15422 else
15423   rm -rf conftest*
15424   ac_cv_type_uid_t=no
15425 fi
15426 rm -f conftest*
15427
15428 fi
15429
15430 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
15431 if test $ac_cv_type_uid_t = no; then
15432   cat >> confdefs.h <<\EOF
15433 #define uid_t int
15434 EOF
15435
15436   cat >> confdefs.h <<\EOF
15437 #define gid_t int
15438 EOF
15439
15440 fi
15441
15442 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
15443 echo "configure:15444: checking for sig_atomic_t" >&5
15444 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
15445   echo $ac_n "(cached) $ac_c" 1>&6
15446 else
15447   cat > conftest.$ac_ext <<EOF
15448 #line 15449 "configure"
15449 #include "confdefs.h"
15450 #include <signal.h>
15451 int main() {
15452 sig_atomic_t atomic;
15453 ; return 0; }
15454 EOF
15455 if { (eval echo configure:15456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15456   rm -rf conftest*
15457   ol_cv_type_sig_atomic_t=yes
15458 else
15459   echo "configure: failed program was:" >&5
15460   cat conftest.$ac_ext >&5
15461   rm -rf conftest*
15462   ol_cv_type_sig_atomic_t=no
15463 fi
15464 rm -f conftest*
15465 fi
15466
15467 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
15468   if test $ol_cv_type_sig_atomic_t = no; then
15469     cat >> confdefs.h <<\EOF
15470 #define sig_atomic_t int
15471 EOF
15472
15473   fi
15474  
15475
15476
15477 # test for pw_gecos in struct passwd
15478 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
15479 echo "configure:15480: checking struct passwd for pw_gecos" >&5
15480 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
15481   echo $ac_n "(cached) $ac_c" 1>&6
15482 else
15483   
15484         cat > conftest.$ac_ext <<EOF
15485 #line 15486 "configure"
15486 #include "confdefs.h"
15487 #include <pwd.h>
15488 int main() {
15489
15490         struct passwd pwd;
15491         pwd.pw_gecos = pwd.pw_name;
15492
15493 ; return 0; }
15494 EOF
15495 if { (eval echo configure:15496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15496   rm -rf conftest*
15497   ol_cv_struct_passwd_pw_gecos=yes
15498 else
15499   echo "configure: failed program was:" >&5
15500   cat conftest.$ac_ext >&5
15501   rm -rf conftest*
15502   ol_cv_struct_passwd_pw_gecos=no
15503 fi
15504 rm -f conftest*
15505 fi
15506
15507 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
15508 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
15509         cat >> confdefs.h <<\EOF
15510 #define HAVE_PW_GECOS 1
15511 EOF
15512
15513 fi
15514
15515 # test for pw_passwd in struct passwd
15516 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
15517 echo "configure:15518: checking struct passwd for pw_passwd" >&5
15518 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
15519   echo $ac_n "(cached) $ac_c" 1>&6
15520 else
15521   
15522         cat > conftest.$ac_ext <<EOF
15523 #line 15524 "configure"
15524 #include "confdefs.h"
15525 #include <pwd.h>
15526 int main() {
15527
15528         struct passwd pwd;
15529         pwd.pw_passwd = pwd.pw_name;
15530
15531 ; return 0; }
15532 EOF
15533 if { (eval echo configure:15534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15534   rm -rf conftest*
15535   ol_cv_struct_passwd_pw_passwd=yes
15536 else
15537   echo "configure: failed program was:" >&5
15538   cat conftest.$ac_ext >&5
15539   rm -rf conftest*
15540   ol_cv_struct_passwd_pw_passwd=no
15541 fi
15542 rm -f conftest*
15543 fi
15544
15545 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
15546 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
15547         cat >> confdefs.h <<\EOF
15548 #define HAVE_PW_PASSWD 1
15549 EOF
15550
15551 fi
15552
15553
15554 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
15555 echo "configure:15556: checking if toupper() requires islower()" >&5
15556 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
15557   echo $ac_n "(cached) $ac_c" 1>&6
15558 else
15559   
15560         if test "$cross_compiling" = yes; then
15561   ol_cv_c_upper_lower=safe
15562 else
15563   cat > conftest.$ac_ext <<EOF
15564 #line 15565 "configure"
15565 #include "confdefs.h"
15566
15567 #include <ctype.h>
15568 main()
15569 {
15570         if ('C' == toupper('C'))
15571                 exit(0);
15572         else
15573                 exit(1);
15574 }
15575 EOF
15576 if { (eval echo configure:15577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15577 then
15578   ol_cv_c_upper_lower=no
15579 else
15580   echo "configure: failed program was:" >&5
15581   cat conftest.$ac_ext >&5
15582   rm -fr conftest*
15583   ol_cv_c_upper_lower=yes
15584 fi
15585 rm -fr conftest*
15586 fi
15587
15588 fi
15589
15590 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
15591 if test $ol_cv_c_upper_lower != no ; then
15592         cat >> confdefs.h <<\EOF
15593 #define C_UPPER_LOWER 1
15594 EOF
15595
15596 fi
15597
15598 echo $ac_n "checking for working const""... $ac_c" 1>&6
15599 echo "configure:15600: checking for working const" >&5
15600 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
15601   echo $ac_n "(cached) $ac_c" 1>&6
15602 else
15603   cat > conftest.$ac_ext <<EOF
15604 #line 15605 "configure"
15605 #include "confdefs.h"
15606
15607 int main() {
15608
15609 /* Ultrix mips cc rejects this.  */
15610 typedef int charset[2]; const charset x;
15611 /* SunOS 4.1.1 cc rejects this.  */
15612 char const *const *ccp;
15613 char **p;
15614 /* NEC SVR4.0.2 mips cc rejects this.  */
15615 struct point {int x, y;};
15616 static struct point const zero = {0,0};
15617 /* AIX XL C 1.02.0.0 rejects this.
15618    It does not let you subtract one const X* pointer from another in an arm
15619    of an if-expression whose if-part is not a constant expression */
15620 const char *g = "string";
15621 ccp = &g + (g ? g-g : 0);
15622 /* HPUX 7.0 cc rejects these. */
15623 ++ccp;
15624 p = (char**) ccp;
15625 ccp = (char const *const *) p;
15626 { /* SCO 3.2v4 cc rejects this.  */
15627   char *t;
15628   char const *s = 0 ? (char *) 0 : (char const *) 0;
15629
15630   *t++ = 0;
15631 }
15632 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
15633   int x[] = {25, 17};
15634   const int *foo = &x[0];
15635   ++foo;
15636 }
15637 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
15638   typedef const int *iptr;
15639   iptr p = 0;
15640   ++p;
15641 }
15642 { /* AIX XL C 1.02.0.0 rejects this saying
15643      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
15644   struct s { int j; const int *ap[3]; };
15645   struct s *b; b->j = 5;
15646 }
15647 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
15648   const int foo = 10;
15649 }
15650
15651 ; return 0; }
15652 EOF
15653 if { (eval echo configure:15654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15654   rm -rf conftest*
15655   ac_cv_c_const=yes
15656 else
15657   echo "configure: failed program was:" >&5
15658   cat conftest.$ac_ext >&5
15659   rm -rf conftest*
15660   ac_cv_c_const=no
15661 fi
15662 rm -f conftest*
15663 fi
15664
15665 echo "$ac_t""$ac_cv_c_const" 1>&6
15666 if test $ac_cv_c_const = no; then
15667   cat >> confdefs.h <<\EOF
15668 #define const 
15669 EOF
15670
15671 fi
15672
15673 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
15674 echo "configure:15675: checking if compiler understands volatile" >&5
15675 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
15676   echo $ac_n "(cached) $ac_c" 1>&6
15677 else
15678   cat > conftest.$ac_ext <<EOF
15679 #line 15680 "configure"
15680 #include "confdefs.h"
15681 int x, y, z;
15682 int main() {
15683 volatile int a; int * volatile b = x ? &y : &z;
15684       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
15685       *b = 0;
15686 ; return 0; }
15687 EOF
15688 if { (eval echo configure:15689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15689   rm -rf conftest*
15690   ol_cv_c_volatile=yes
15691 else
15692   echo "configure: failed program was:" >&5
15693   cat conftest.$ac_ext >&5
15694   rm -rf conftest*
15695   ol_cv_c_volatile=no
15696 fi
15697 rm -f conftest*
15698 fi
15699
15700 echo "$ac_t""$ol_cv_c_volatile" 1>&6
15701   if test $ol_cv_c_volatile = yes; then
15702     : 
15703   else
15704     cat >> confdefs.h <<\EOF
15705 #define volatile 
15706 EOF
15707
15708   fi
15709  
15710
15711 if test $cross_compiling = yes ; then
15712         cat >> confdefs.h <<\EOF
15713 #define CROSS_COMPILING 1
15714 EOF
15715
15716 else
15717         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
15718 echo "configure:15719: checking whether byte ordering is bigendian" >&5
15719 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
15720   echo $ac_n "(cached) $ac_c" 1>&6
15721 else
15722   ac_cv_c_bigendian=unknown
15723 # See if sys/param.h defines the BYTE_ORDER macro.
15724 cat > conftest.$ac_ext <<EOF
15725 #line 15726 "configure"
15726 #include "confdefs.h"
15727 #include <sys/types.h>
15728 #include <sys/param.h>
15729 int main() {
15730
15731 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
15732  bogus endian macros
15733 #endif
15734 ; return 0; }
15735 EOF
15736 if { (eval echo configure:15737: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15737   rm -rf conftest*
15738   # It does; now see whether it defined to BIG_ENDIAN or not.
15739 cat > conftest.$ac_ext <<EOF
15740 #line 15741 "configure"
15741 #include "confdefs.h"
15742 #include <sys/types.h>
15743 #include <sys/param.h>
15744 int main() {
15745
15746 #if BYTE_ORDER != BIG_ENDIAN
15747  not big endian
15748 #endif
15749 ; return 0; }
15750 EOF
15751 if { (eval echo configure:15752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15752   rm -rf conftest*
15753   ac_cv_c_bigendian=yes
15754 else
15755   echo "configure: failed program was:" >&5
15756   cat conftest.$ac_ext >&5
15757   rm -rf conftest*
15758   ac_cv_c_bigendian=no
15759 fi
15760 rm -f conftest*
15761 else
15762   echo "configure: failed program was:" >&5
15763   cat conftest.$ac_ext >&5
15764 fi
15765 rm -f conftest*
15766 if test $ac_cv_c_bigendian = unknown; then
15767 if test "$cross_compiling" = yes; then
15768     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
15769 else
15770   cat > conftest.$ac_ext <<EOF
15771 #line 15772 "configure"
15772 #include "confdefs.h"
15773 main () {
15774   /* Are we little or big endian?  From Harbison&Steele.  */
15775   union
15776   {
15777     long l;
15778     char c[sizeof (long)];
15779   } u;
15780   u.l = 1;
15781   exit (u.c[sizeof (long) - 1] == 1);
15782 }
15783 EOF
15784 if { (eval echo configure:15785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15785 then
15786   ac_cv_c_bigendian=no
15787 else
15788   echo "configure: failed program was:" >&5
15789   cat conftest.$ac_ext >&5
15790   rm -fr conftest*
15791   ac_cv_c_bigendian=yes
15792 fi
15793 rm -fr conftest*
15794 fi
15795
15796 fi
15797 fi
15798
15799 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
15800 if test $ac_cv_c_bigendian = yes; then
15801   cat >> confdefs.h <<\EOF
15802 #define WORDS_BIGENDIAN 1
15803 EOF
15804
15805 fi
15806
15807 fi
15808
15809 echo $ac_n "checking size of short""... $ac_c" 1>&6
15810 echo "configure:15811: checking size of short" >&5 
15811 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
15812   echo $ac_n "(cached) $ac_c" 1>&6
15813 else
15814   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15815   cat > conftest.$ac_ext <<EOF
15816 #line 15817 "configure"
15817 #include "confdefs.h"
15818 #include "confdefs.h" 
15819 #include <sys/types.h> 
15820  
15821
15822 int main() {
15823 switch (0) case 0: case (sizeof (short) == $ac_size):;
15824 ; return 0; }
15825 EOF
15826 if { (eval echo configure:15827: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15827   rm -rf conftest*
15828   ac_cv_sizeof_short=$ac_size
15829 else
15830   echo "configure: failed program was:" >&5
15831   cat conftest.$ac_ext >&5
15832 fi
15833 rm -f conftest* 
15834   if test x$ac_cv_sizeof_short != x ; then break; fi 
15835 done 
15836
15837 fi
15838  
15839 if test x$ac_cv_sizeof_short = x ; then 
15840   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
15841 fi 
15842 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
15843 cat >> confdefs.h <<EOF
15844 #define SIZEOF_SHORT $ac_cv_sizeof_short
15845 EOF
15846  
15847  
15848 echo $ac_n "checking size of int""... $ac_c" 1>&6
15849 echo "configure:15850: checking size of int" >&5 
15850 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
15851   echo $ac_n "(cached) $ac_c" 1>&6
15852 else
15853   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15854   cat > conftest.$ac_ext <<EOF
15855 #line 15856 "configure"
15856 #include "confdefs.h"
15857 #include "confdefs.h" 
15858 #include <sys/types.h> 
15859  
15860
15861 int main() {
15862 switch (0) case 0: case (sizeof (int) == $ac_size):;
15863 ; return 0; }
15864 EOF
15865 if { (eval echo configure:15866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15866   rm -rf conftest*
15867   ac_cv_sizeof_int=$ac_size
15868 else
15869   echo "configure: failed program was:" >&5
15870   cat conftest.$ac_ext >&5
15871 fi
15872 rm -f conftest* 
15873   if test x$ac_cv_sizeof_int != x ; then break; fi 
15874 done 
15875
15876 fi
15877  
15878 if test x$ac_cv_sizeof_int = x ; then 
15879   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
15880 fi 
15881 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
15882 cat >> confdefs.h <<EOF
15883 #define SIZEOF_INT $ac_cv_sizeof_int
15884 EOF
15885  
15886  
15887 echo $ac_n "checking size of long""... $ac_c" 1>&6
15888 echo "configure:15889: checking size of long" >&5 
15889 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
15890   echo $ac_n "(cached) $ac_c" 1>&6
15891 else
15892   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15893   cat > conftest.$ac_ext <<EOF
15894 #line 15895 "configure"
15895 #include "confdefs.h"
15896 #include "confdefs.h" 
15897 #include <sys/types.h> 
15898  
15899
15900 int main() {
15901 switch (0) case 0: case (sizeof (long) == $ac_size):;
15902 ; return 0; }
15903 EOF
15904 if { (eval echo configure:15905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15905   rm -rf conftest*
15906   ac_cv_sizeof_long=$ac_size
15907 else
15908   echo "configure: failed program was:" >&5
15909   cat conftest.$ac_ext >&5
15910 fi
15911 rm -f conftest* 
15912   if test x$ac_cv_sizeof_long != x ; then break; fi 
15913 done 
15914
15915 fi
15916  
15917 if test x$ac_cv_sizeof_long = x ; then 
15918   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
15919 fi 
15920 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
15921 cat >> confdefs.h <<EOF
15922 #define SIZEOF_LONG $ac_cv_sizeof_long
15923 EOF
15924  
15925
15926
15927 if test "$ac_cv_sizeof_int" -lt 4 ; then
15928         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
15929
15930         cat >> confdefs.h <<\EOF
15931 #define LBER_INT_T long
15932 EOF
15933
15934 else
15935         cat >> confdefs.h <<\EOF
15936 #define LBER_INT_T int
15937 EOF
15938
15939 fi
15940
15941 cat >> confdefs.h <<\EOF
15942 #define LBER_LEN_T long
15943 EOF
15944
15945 cat >> confdefs.h <<\EOF
15946 #define LBER_SOCKET_T int
15947 EOF
15948
15949 cat >> confdefs.h <<\EOF
15950 #define LBER_TAG_T long
15951 EOF
15952
15953
15954 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
15955 echo "configure:15956: checking for 8-bit clean memcmp" >&5
15956 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
15957   echo $ac_n "(cached) $ac_c" 1>&6
15958 else
15959   if test "$cross_compiling" = yes; then
15960   ac_cv_func_memcmp_clean=no
15961 else
15962   cat > conftest.$ac_ext <<EOF
15963 #line 15964 "configure"
15964 #include "confdefs.h"
15965
15966 main()
15967 {
15968   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
15969   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
15970 }
15971
15972 EOF
15973 if { (eval echo configure:15974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15974 then
15975   ac_cv_func_memcmp_clean=yes
15976 else
15977   echo "configure: failed program was:" >&5
15978   cat conftest.$ac_ext >&5
15979   rm -fr conftest*
15980   ac_cv_func_memcmp_clean=no
15981 fi
15982 rm -fr conftest*
15983 fi
15984
15985 fi
15986
15987 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
15988 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
15989
15990 echo $ac_n "checking for strftime""... $ac_c" 1>&6
15991 echo "configure:15992: checking for strftime" >&5
15992 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
15993   echo $ac_n "(cached) $ac_c" 1>&6
15994 else
15995   cat > conftest.$ac_ext <<EOF
15996 #line 15997 "configure"
15997 #include "confdefs.h"
15998 /* System header to define __stub macros and hopefully few prototypes,
15999     which can conflict with char strftime(); below.  */
16000 #include <assert.h>
16001 /* Override any gcc2 internal prototype to avoid an error.  */
16002 /* We use char because int might match the return type of a gcc2
16003     builtin and then its argument prototype would still apply.  */
16004 char strftime();
16005 char (*f)();
16006
16007 int main() {
16008
16009 /* The GNU C library defines this for functions which it implements
16010     to always fail with ENOSYS.  Some functions are actually named
16011     something starting with __ and the normal name is an alias.  */
16012 #if defined (__stub_strftime) || defined (__stub___strftime)
16013 choke me
16014 #else
16015 f = strftime;
16016 #endif
16017
16018 ; return 0; }
16019 EOF
16020 if { (eval echo configure:16021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16021   rm -rf conftest*
16022   eval "ac_cv_func_strftime=yes"
16023 else
16024   echo "configure: failed program was:" >&5
16025   cat conftest.$ac_ext >&5
16026   rm -rf conftest*
16027   eval "ac_cv_func_strftime=no"
16028 fi
16029 rm -f conftest*
16030 fi
16031
16032 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
16033   echo "$ac_t""yes" 1>&6
16034   cat >> confdefs.h <<\EOF
16035 #define HAVE_STRFTIME 1
16036 EOF
16037
16038 else
16039   echo "$ac_t""no" 1>&6
16040 # strftime is in -lintl on SCO UNIX.
16041 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
16042 echo "configure:16043: checking for strftime in -lintl" >&5
16043 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
16044 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
16045   echo $ac_n "(cached) $ac_c" 1>&6
16046 else
16047   ac_save_LIBS="$LIBS"
16048 LIBS="-lintl  $LIBS"
16049 cat > conftest.$ac_ext <<EOF
16050 #line 16051 "configure"
16051 #include "confdefs.h"
16052 /* Override any gcc2 internal prototype to avoid an error.  */
16053 /* We use char because int might match the return type of a gcc2
16054     builtin and then its argument prototype would still apply.  */
16055 char strftime();
16056
16057 int main() {
16058 strftime()
16059 ; return 0; }
16060 EOF
16061 if { (eval echo configure:16062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16062   rm -rf conftest*
16063   eval "ac_cv_lib_$ac_lib_var=yes"
16064 else
16065   echo "configure: failed program was:" >&5
16066   cat conftest.$ac_ext >&5
16067   rm -rf conftest*
16068   eval "ac_cv_lib_$ac_lib_var=no"
16069 fi
16070 rm -f conftest*
16071 LIBS="$ac_save_LIBS"
16072
16073 fi
16074 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
16075   echo "$ac_t""yes" 1>&6
16076   cat >> confdefs.h <<\EOF
16077 #define HAVE_STRFTIME 1
16078 EOF
16079
16080 LIBS="-lintl $LIBS"
16081 else
16082   echo "$ac_t""no" 1>&6
16083 fi
16084
16085 fi
16086
16087
16088 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
16089 echo "configure:16090: checking for inet_aton()" >&5
16090 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
16091   echo $ac_n "(cached) $ac_c" 1>&6
16092 else
16093   cat > conftest.$ac_ext <<EOF
16094 #line 16095 "configure"
16095 #include "confdefs.h"
16096
16097 #ifdef HAVE_SYS_TYPES_H
16098 #       include <sys/types.h>
16099 #endif
16100 #ifdef HAVE_SYS_SOCKET_H
16101 #       include <sys/socket.h>
16102 #       ifdef HAVE_SYS_SELECT_H
16103 #               include <sys/select.h>
16104 #       endif
16105 #       include <netinet/in.h>
16106 #       ifdef HAVE_ARPA_INET_H
16107 #               include <arpa/inet.h>
16108 #       endif
16109 #endif
16110
16111 int main() {
16112 struct in_addr in;
16113 int rc = inet_aton( "255.255.255.255", &in );
16114 ; return 0; }
16115 EOF
16116 if { (eval echo configure:16117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16117   rm -rf conftest*
16118   ol_cv_func_inet_aton=yes
16119 else
16120   echo "configure: failed program was:" >&5
16121   cat conftest.$ac_ext >&5
16122   rm -rf conftest*
16123   ol_cv_func_inet_aton=no
16124 fi
16125 rm -f conftest*
16126 fi
16127
16128 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
16129   if test $ol_cv_func_inet_aton != no; then
16130     cat >> confdefs.h <<\EOF
16131 #define HAVE_INET_ATON 1
16132 EOF
16133
16134   fi
16135  
16136
16137 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
16138 echo "configure:16139: checking for _spawnlp" >&5
16139 if eval "test \"\${ac_cv_func__spawnlp+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 _spawnlp(); 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 _spawnlp();
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__spawnlp) || defined (__stub____spawnlp)
16160 choke me
16161 #else
16162 f = _spawnlp;
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__spawnlp=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__spawnlp=no"
16175 fi
16176 rm -f conftest*
16177 fi
16178
16179 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
16180   echo "$ac_t""yes" 1>&6
16181   cat >> confdefs.h <<\EOF
16182 #define HAVE_SPAWNLP 1
16183 EOF
16184
16185 else
16186   echo "$ac_t""no" 1>&6
16187 fi
16188
16189
16190 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
16191 echo "configure:16192: checking for _snprintf" >&5
16192 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
16193   echo $ac_n "(cached) $ac_c" 1>&6
16194 else
16195   cat > conftest.$ac_ext <<EOF
16196 #line 16197 "configure"
16197 #include "confdefs.h"
16198 /* System header to define __stub macros and hopefully few prototypes,
16199     which can conflict with char _snprintf(); below.  */
16200 #include <assert.h>
16201 /* Override any gcc2 internal prototype to avoid an error.  */
16202 /* We use char because int might match the return type of a gcc2
16203     builtin and then its argument prototype would still apply.  */
16204 char _snprintf();
16205 char (*f)();
16206
16207 int main() {
16208
16209 /* The GNU C library defines this for functions which it implements
16210     to always fail with ENOSYS.  Some functions are actually named
16211     something starting with __ and the normal name is an alias.  */
16212 #if defined (__stub__snprintf) || defined (__stub____snprintf)
16213 choke me
16214 #else
16215 f = _snprintf;
16216 #endif
16217
16218 ; return 0; }
16219 EOF
16220 if { (eval echo configure:16221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16221   rm -rf conftest*
16222   eval "ac_cv_func__snprintf=yes"
16223 else
16224   echo "configure: failed program was:" >&5
16225   cat conftest.$ac_ext >&5
16226   rm -rf conftest*
16227   eval "ac_cv_func__snprintf=no"
16228 fi
16229 rm -f conftest*
16230 fi
16231
16232 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
16233   echo "$ac_t""yes" 1>&6
16234   ac_cv_func_snprintf=yes
16235         cat >> confdefs.h <<\EOF
16236 #define snprintf _snprintf
16237 EOF
16238
16239
16240 else
16241   echo "$ac_t""no" 1>&6
16242 fi
16243
16244
16245 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
16246 echo "configure:16247: checking for _vsnprintf" >&5
16247 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
16248   echo $ac_n "(cached) $ac_c" 1>&6
16249 else
16250   cat > conftest.$ac_ext <<EOF
16251 #line 16252 "configure"
16252 #include "confdefs.h"
16253 /* System header to define __stub macros and hopefully few prototypes,
16254     which can conflict with char _vsnprintf(); below.  */
16255 #include <assert.h>
16256 /* Override any gcc2 internal prototype to avoid an error.  */
16257 /* We use char because int might match the return type of a gcc2
16258     builtin and then its argument prototype would still apply.  */
16259 char _vsnprintf();
16260 char (*f)();
16261
16262 int main() {
16263
16264 /* The GNU C library defines this for functions which it implements
16265     to always fail with ENOSYS.  Some functions are actually named
16266     something starting with __ and the normal name is an alias.  */
16267 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
16268 choke me
16269 #else
16270 f = _vsnprintf;
16271 #endif
16272
16273 ; return 0; }
16274 EOF
16275 if { (eval echo configure:16276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16276   rm -rf conftest*
16277   eval "ac_cv_func__vsnprintf=yes"
16278 else
16279   echo "configure: failed program was:" >&5
16280   cat conftest.$ac_ext >&5
16281   rm -rf conftest*
16282   eval "ac_cv_func__vsnprintf=no"
16283 fi
16284 rm -f conftest*
16285 fi
16286
16287 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
16288   echo "$ac_t""yes" 1>&6
16289   ac_cv_func_vsnprintf=yes
16290         cat >> confdefs.h <<\EOF
16291 #define vsnprintf _vsnprintf
16292 EOF
16293
16294
16295 else
16296   echo "$ac_t""no" 1>&6
16297 fi
16298
16299
16300 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
16301 echo "configure:16302: checking for vprintf" >&5
16302 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
16303   echo $ac_n "(cached) $ac_c" 1>&6
16304 else
16305   cat > conftest.$ac_ext <<EOF
16306 #line 16307 "configure"
16307 #include "confdefs.h"
16308 /* System header to define __stub macros and hopefully few prototypes,
16309     which can conflict with char vprintf(); below.  */
16310 #include <assert.h>
16311 /* Override any gcc2 internal prototype to avoid an error.  */
16312 /* We use char because int might match the return type of a gcc2
16313     builtin and then its argument prototype would still apply.  */
16314 char vprintf();
16315 char (*f)();
16316
16317 int main() {
16318
16319 /* The GNU C library defines this for functions which it implements
16320     to always fail with ENOSYS.  Some functions are actually named
16321     something starting with __ and the normal name is an alias.  */
16322 #if defined (__stub_vprintf) || defined (__stub___vprintf)
16323 choke me
16324 #else
16325 f = vprintf;
16326 #endif
16327
16328 ; return 0; }
16329 EOF
16330 if { (eval echo configure:16331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16331   rm -rf conftest*
16332   eval "ac_cv_func_vprintf=yes"
16333 else
16334   echo "configure: failed program was:" >&5
16335   cat conftest.$ac_ext >&5
16336   rm -rf conftest*
16337   eval "ac_cv_func_vprintf=no"
16338 fi
16339 rm -f conftest*
16340 fi
16341
16342 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
16343   echo "$ac_t""yes" 1>&6
16344   cat >> confdefs.h <<\EOF
16345 #define HAVE_VPRINTF 1
16346 EOF
16347
16348 else
16349   echo "$ac_t""no" 1>&6
16350 fi
16351
16352 if test "$ac_cv_func_vprintf" != yes; then
16353 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
16354 echo "configure:16355: checking for _doprnt" >&5
16355 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
16356   echo $ac_n "(cached) $ac_c" 1>&6
16357 else
16358   cat > conftest.$ac_ext <<EOF
16359 #line 16360 "configure"
16360 #include "confdefs.h"
16361 /* System header to define __stub macros and hopefully few prototypes,
16362     which can conflict with char _doprnt(); below.  */
16363 #include <assert.h>
16364 /* Override any gcc2 internal prototype to avoid an error.  */
16365 /* We use char because int might match the return type of a gcc2
16366     builtin and then its argument prototype would still apply.  */
16367 char _doprnt();
16368 char (*f)();
16369
16370 int main() {
16371
16372 /* The GNU C library defines this for functions which it implements
16373     to always fail with ENOSYS.  Some functions are actually named
16374     something starting with __ and the normal name is an alias.  */
16375 #if defined (__stub__doprnt) || defined (__stub____doprnt)
16376 choke me
16377 #else
16378 f = _doprnt;
16379 #endif
16380
16381 ; return 0; }
16382 EOF
16383 if { (eval echo configure:16384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16384   rm -rf conftest*
16385   eval "ac_cv_func__doprnt=yes"
16386 else
16387   echo "configure: failed program was:" >&5
16388   cat conftest.$ac_ext >&5
16389   rm -rf conftest*
16390   eval "ac_cv_func__doprnt=no"
16391 fi
16392 rm -f conftest*
16393 fi
16394
16395 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
16396   echo "$ac_t""yes" 1>&6
16397   cat >> confdefs.h <<\EOF
16398 #define HAVE_DOPRNT 1
16399 EOF
16400
16401 else
16402   echo "$ac_t""no" 1>&6
16403 fi
16404
16405 fi
16406
16407
16408 if test $ac_cv_func_vprintf = yes ; then
16409                 for ac_func in vsnprintf vsprintf
16410 do
16411 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16412 echo "configure:16413: checking for $ac_func" >&5
16413 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16414   echo $ac_n "(cached) $ac_c" 1>&6
16415 else
16416   cat > conftest.$ac_ext <<EOF
16417 #line 16418 "configure"
16418 #include "confdefs.h"
16419 /* System header to define __stub macros and hopefully few prototypes,
16420     which can conflict with char $ac_func(); below.  */
16421 #include <assert.h>
16422 /* Override any gcc2 internal prototype to avoid an error.  */
16423 /* We use char because int might match the return type of a gcc2
16424     builtin and then its argument prototype would still apply.  */
16425 char $ac_func();
16426 char (*f)();
16427
16428 int main() {
16429
16430 /* The GNU C library defines this for functions which it implements
16431     to always fail with ENOSYS.  Some functions are actually named
16432     something starting with __ and the normal name is an alias.  */
16433 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16434 choke me
16435 #else
16436 f = $ac_func;
16437 #endif
16438
16439 ; return 0; }
16440 EOF
16441 if { (eval echo configure:16442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16442   rm -rf conftest*
16443   eval "ac_cv_func_$ac_func=yes"
16444 else
16445   echo "configure: failed program was:" >&5
16446   cat conftest.$ac_ext >&5
16447   rm -rf conftest*
16448   eval "ac_cv_func_$ac_func=no"
16449 fi
16450 rm -f conftest*
16451 fi
16452
16453 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16454   echo "$ac_t""yes" 1>&6
16455     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16456   cat >> confdefs.h <<EOF
16457 #define $ac_tr_func 1
16458 EOF
16459  
16460 else
16461   echo "$ac_t""no" 1>&6
16462 fi
16463 done
16464
16465 fi
16466
16467 for ac_func in \
16468         bcopy                   \
16469         closesocket             \
16470         chroot                  \
16471         endgrent                \
16472         endpwent                \
16473         fcntl                   \
16474         flock                   \
16475         getdtablesize   \
16476         getgrgid                \
16477         gethostname             \
16478         getpass                 \
16479         getpassphrase   \
16480         getpwuid                \
16481         getpwnam                \
16482         getspnam                \
16483         gettimeofday    \
16484         initgroups              \
16485         lockf                   \
16486         memcpy                  \
16487         memmove                 \
16488         mkstemp                 \
16489         pipe                    \
16490         read                    \
16491         recv                    \
16492         recvfrom                \
16493         setpwfile               \
16494         setgid                  \
16495         setegid                 \
16496         setsid                  \
16497         setuid                  \
16498         seteuid                 \
16499         sigaction               \
16500         signal                  \
16501         sigset                  \
16502         strdup                  \
16503         strerror                \
16504         strpbrk                 \
16505         strrchr                 \
16506         strsep                  \
16507         strstr                  \
16508         strtol                  \
16509         strtoul                 \
16510         strspn                  \
16511         sysconf                 \
16512         waitpid                 \
16513         wait4                   \
16514         write                   \
16515         send                    \
16516         sendto                  \
16517
16518 do
16519 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16520 echo "configure:16521: checking for $ac_func" >&5
16521 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16522   echo $ac_n "(cached) $ac_c" 1>&6
16523 else
16524   cat > conftest.$ac_ext <<EOF
16525 #line 16526 "configure"
16526 #include "confdefs.h"
16527 /* System header to define __stub macros and hopefully few prototypes,
16528     which can conflict with char $ac_func(); below.  */
16529 #include <assert.h>
16530 /* Override any gcc2 internal prototype to avoid an error.  */
16531 /* We use char because int might match the return type of a gcc2
16532     builtin and then its argument prototype would still apply.  */
16533 char $ac_func();
16534 char (*f)();
16535
16536 int main() {
16537
16538 /* The GNU C library defines this for functions which it implements
16539     to always fail with ENOSYS.  Some functions are actually named
16540     something starting with __ and the normal name is an alias.  */
16541 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16542 choke me
16543 #else
16544 f = $ac_func;
16545 #endif
16546
16547 ; return 0; }
16548 EOF
16549 if { (eval echo configure:16550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16550   rm -rf conftest*
16551   eval "ac_cv_func_$ac_func=yes"
16552 else
16553   echo "configure: failed program was:" >&5
16554   cat conftest.$ac_ext >&5
16555   rm -rf conftest*
16556   eval "ac_cv_func_$ac_func=no"
16557 fi
16558 rm -f conftest*
16559 fi
16560
16561 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16562   echo "$ac_t""yes" 1>&6
16563     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16564   cat >> confdefs.h <<EOF
16565 #define $ac_tr_func 1
16566 EOF
16567  
16568 else
16569   echo "$ac_t""no" 1>&6
16570 fi
16571 done
16572
16573
16574 for ac_func in getopt tempnam
16575 do
16576 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
16577 echo "configure:16578: checking for $ac_func" >&5
16578 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
16579   echo $ac_n "(cached) $ac_c" 1>&6
16580 else
16581   cat > conftest.$ac_ext <<EOF
16582 #line 16583 "configure"
16583 #include "confdefs.h"
16584 /* System header to define __stub macros and hopefully few prototypes,
16585     which can conflict with char $ac_func(); below.  */
16586 #include <assert.h>
16587 /* Override any gcc2 internal prototype to avoid an error.  */
16588 /* We use char because int might match the return type of a gcc2
16589     builtin and then its argument prototype would still apply.  */
16590 char $ac_func();
16591 char (*f)();
16592
16593 int main() {
16594
16595 /* The GNU C library defines this for functions which it implements
16596     to always fail with ENOSYS.  Some functions are actually named
16597     something starting with __ and the normal name is an alias.  */
16598 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16599 choke me
16600 #else
16601 f = $ac_func;
16602 #endif
16603
16604 ; return 0; }
16605 EOF
16606 if { (eval echo configure:16607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16607   rm -rf conftest*
16608   eval "ac_cv_func_$ac_func=yes"
16609 else
16610   echo "configure: failed program was:" >&5
16611   cat conftest.$ac_ext >&5
16612   rm -rf conftest*
16613   eval "ac_cv_func_$ac_func=no"
16614 fi
16615 rm -f conftest*
16616 fi
16617
16618 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
16619   echo "$ac_t""yes" 1>&6
16620     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
16621   cat >> confdefs.h <<EOF
16622 #define $ac_tr_func 1
16623 EOF
16624  
16625 else
16626   echo "$ac_t""no" 1>&6
16627 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
16628 fi
16629 done
16630
16631
16632
16633 if test "$ac_cv_func_getopt" != yes; then
16634     LIBSRCS="$LIBSRCS getopt.c"
16635 fi
16636
16637 if test "$ac_cv_func_tempnam" != yes; then
16638     LIBSRCS="$LIBSRCS tempnam.c"
16639 fi
16640
16641 # Check Configuration
16642 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
16643 echo "configure:16644: checking declaration of sys_errlist" >&5
16644 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
16645   echo $ac_n "(cached) $ac_c" 1>&6
16646 else
16647   
16648         cat > conftest.$ac_ext <<EOF
16649 #line 16650 "configure"
16650 #include "confdefs.h"
16651
16652 #include <stdio.h>
16653 #include <sys/types.h>
16654 #include <errno.h>
16655 #ifdef WINNT
16656 #include <stdlib.h>
16657 #endif 
16658 int main() {
16659 char *c = (char *) *sys_errlist
16660 ; return 0; }
16661 EOF
16662 if { (eval echo configure:16663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
16663   rm -rf conftest*
16664   ol_cv_dcl_sys_errlist=yes
16665         ol_cv_have_sys_errlist=yes
16666 else
16667   echo "configure: failed program was:" >&5
16668   cat conftest.$ac_ext >&5
16669   rm -rf conftest*
16670   ol_cv_dcl_sys_errlist=no
16671 fi
16672 rm -f conftest*
16673 fi
16674
16675 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
16676 #
16677 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
16678 if test $ol_cv_dcl_sys_errlist = no ; then
16679         cat >> confdefs.h <<\EOF
16680 #define DECL_SYS_ERRLIST 1
16681 EOF
16682
16683
16684         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
16685 echo "configure:16686: checking existence of sys_errlist" >&5
16686 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
16687   echo $ac_n "(cached) $ac_c" 1>&6
16688 else
16689   
16690                 cat > conftest.$ac_ext <<EOF
16691 #line 16692 "configure"
16692 #include "confdefs.h"
16693 #include <errno.h>
16694 int main() {
16695 char *c = (char *) *sys_errlist
16696 ; return 0; }
16697 EOF
16698 if { (eval echo configure:16699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
16699   rm -rf conftest*
16700   ol_cv_have_sys_errlist=yes
16701 else
16702   echo "configure: failed program was:" >&5
16703   cat conftest.$ac_ext >&5
16704   rm -rf conftest*
16705   ol_cv_have_sys_errlist=no
16706 fi
16707 rm -f conftest*
16708 fi
16709
16710 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
16711 fi
16712 if test $ol_cv_have_sys_errlist = yes ; then
16713         cat >> confdefs.h <<\EOF
16714 #define HAVE_SYS_ERRLIST 1
16715 EOF
16716
16717 fi
16718
16719
16720
16721 if test "$ol_enable_debug" != no ; then
16722         cat >> confdefs.h <<\EOF
16723 #define LDAP_DEBUG 1
16724 EOF
16725
16726 fi
16727 if test "$ol_enable_syslog" = yes ; then
16728         cat >> confdefs.h <<\EOF
16729 #define LDAP_SYSLOG 1
16730 EOF
16731
16732 fi
16733 if test "$ol_enable_cache" = no ; then
16734         cat >> confdefs.h <<\EOF
16735 #define LDAP_NOCACHE 1
16736 EOF
16737
16738 fi
16739 if test "$ol_link_kbind" != no ; then
16740         cat >> confdefs.h <<\EOF
16741 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
16742 EOF
16743
16744 fi
16745 if test "$ol_enable_proctitle" != no ; then
16746         cat >> confdefs.h <<\EOF
16747 #define LDAP_PROCTITLE 1
16748 EOF
16749
16750 fi
16751 if test "$ol_enable_referrals" != no ; then
16752         cat >> confdefs.h <<\EOF
16753 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
16754 EOF
16755
16756 fi
16757 if test "$ol_enable_local" != no; then
16758         cat >> confdefs.h <<\EOF
16759 #define LDAP_PF_LOCAL 1
16760 EOF
16761
16762 fi
16763 if test "$ol_link_ipv6" != no; then
16764         cat >> confdefs.h <<\EOF
16765 #define LDAP_PF_INET6 1
16766 EOF
16767
16768 fi
16769 if test "$ol_enable_cleartext" != no ; then
16770         cat >> confdefs.h <<\EOF
16771 #define SLAPD_CLEARTEXT 1
16772 EOF
16773
16774 fi
16775 if test "$ol_enable_crypt" != no ; then
16776         cat >> confdefs.h <<\EOF
16777 #define SLAPD_CRYPT 1
16778 EOF
16779
16780 fi
16781 if test "$ol_link_kpasswd" != no ; then
16782         cat >> confdefs.h <<\EOF
16783 #define SLAPD_KPASSWD 1
16784 EOF
16785
16786 fi
16787 if test "$ol_link_spasswd" != no ; then
16788         cat >> confdefs.h <<\EOF
16789 #define SLAPD_SPASSWD 1
16790 EOF
16791
16792 fi
16793 if test "$ol_enable_phonetic" != no ; then
16794         cat >> confdefs.h <<\EOF
16795 #define SLAPD_PHONETIC 1
16796 EOF
16797
16798 fi
16799 if test "$ol_enable_rlookups" != no ; then
16800         cat >> confdefs.h <<\EOF
16801 #define SLAPD_RLOOKUPS 1
16802 EOF
16803
16804 fi
16805 if test "$ol_enable_aci" != no ; then
16806         cat >> confdefs.h <<\EOF
16807 #define SLAPD_ACI_ENABLED 1
16808 EOF
16809
16810 fi
16811
16812 if test "$ol_link_modules" != no ; then
16813         cat >> confdefs.h <<\EOF
16814 #define SLAPD_MODULES 1
16815 EOF
16816
16817         BUILD_SLAPD=yes
16818         SLAPD_MODULES_LDFLAGS="-dlopen self"
16819 fi
16820
16821 if test "$ol_link_dnssrv" != no ; then
16822         cat >> confdefs.h <<\EOF
16823 #define SLAPD_DNSSRV 1
16824 EOF
16825
16826         BUILD_SLAPD=yes
16827         BUILD_DNSSRV=yes
16828         if test "$ol_with_dnssrv_module" != static ; then
16829                 cat >> confdefs.h <<\EOF
16830 #define SLAPD_DNSSRV_DYNAMIC 1
16831 EOF
16832
16833                 BUILD_DNSSRV=mod
16834                 BUILD_DNSSRV_DYNAMIC=shared
16835                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
16836         fi
16837 fi
16838
16839 if test "$ol_enable_ldap" != no ; then
16840         cat >> confdefs.h <<\EOF
16841 #define SLAPD_LDAP 1
16842 EOF
16843
16844         BUILD_SLAPD=yes
16845         BUILD_LDAP=yes
16846         if test "$ol_with_ldap_module" != static ; then
16847                 cat >> confdefs.h <<\EOF
16848 #define SLAPD_LDAP_DYNAMIC 1
16849 EOF
16850
16851                 BUILD_LDAP=mod
16852                 BUILD_LDAP_DYNAMIC=shared
16853                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
16854         fi
16855 fi
16856
16857 if test "$ol_link_ldbm" != no ; then
16858         cat >> confdefs.h <<\EOF
16859 #define SLAPD_LDBM 1
16860 EOF
16861
16862         BUILD_SLAPD=yes
16863         BUILD_LDBM=yes
16864         if test "$ol_with_ldbm_module" != static ; then
16865                 cat >> confdefs.h <<\EOF
16866 #define SLAPD_LDBM_DYNAMIC 1
16867 EOF
16868
16869                 BUILD_LDBM=mod
16870                 BUILD_LDBM_DYNAMIC=shared
16871                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
16872         fi
16873 fi
16874
16875 if test "$ol_enable_passwd" != no ; then
16876         cat >> confdefs.h <<\EOF
16877 #define SLAPD_PASSWD 1
16878 EOF
16879
16880         BUILD_SLAPD=yes
16881         BUILD_PASSWD=yes
16882         if test "$ol_with_passwd_module" != static ; then
16883                 cat >> confdefs.h <<\EOF
16884 #define SLAPD_PASSWD_DYNAMIC 1
16885 EOF
16886
16887                 BUILD_PASSWD=mod
16888                 BUILD_PASSWD_DYNAMIC=shared
16889                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
16890         fi
16891 fi
16892
16893 if test "$ol_enable_shell" != no ; then
16894         cat >> confdefs.h <<\EOF
16895 #define SLAPD_SHELL 1
16896 EOF
16897
16898         BUILD_SLAPD=yes
16899         BUILD_SHELL=yes
16900         if test "$ol_with_shell_module" != static ; then
16901                 cat >> confdefs.h <<\EOF
16902 #define SLAPD_SHELL_DYNAMIC 1
16903 EOF
16904
16905                 BUILD_SHELL=mod
16906                 BUILD_SHELL_DYNAMIC=shared
16907                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
16908         fi
16909 fi
16910
16911 if test "$ol_enable_sql" != no ; then
16912         cat >> confdefs.h <<\EOF
16913 #define SLAPD_SQL 1
16914 EOF
16915
16916         BUILD_SLAPD=yes
16917         BUILD_SQL=yes
16918         if test "$ol_with_sql_module" != static; then
16919                 cat >> confdefs.h <<\EOF
16920 #define SLAPD_SQL_DYNAMIC 1
16921 EOF
16922
16923                 BUILD_SQL=mod
16924                 BUILD_SQL_DYNAMIC=shared
16925                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
16926         fi
16927 fi
16928
16929 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
16930         $BUILD_SLAPD = yes ; then
16931         BUILD_SLURPD=yes
16932 fi
16933
16934
16935 if test "$LINK_BINS_DYNAMIC" = yes; then
16936     LIB_LINKAGE=DYN
16937     LT_LIB_LINKAGE=shared
16938 else
16939     LIB_LINKAGE=STAT
16940     LT_LIB_LINKAGE=static
16941 fi
16942
16943 if test "$ac_cv_mingw32" = yes ; then
16944     PLAT=NT
16945     DYN_EXT=dll
16946 else
16947     PLAT=UNIX
16948     DYN_EXT=so
16949 fi
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959   
16960   
16961   
16962   
16963   
16964   
16965   
16966   
16967   
16968   
16969   
16970   
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001 trap '' 1 2 15
17002
17003 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
17004
17005 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17006 # Let make expand exec_prefix.
17007 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17008
17009 # Any assignment to VPATH causes Sun make to only execute
17010 # the first set of double-colon rules, so remove it if not needed.
17011 # If there is a colon in the path, we need to keep it.
17012 if test "x$srcdir" = x.; then
17013   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
17014 fi
17015
17016 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
17017
17018 DEFS=-DHAVE_CONFIG_H
17019
17020 # Without the "./", some shells look in PATH for config.status.
17021 : ${CONFIG_STATUS=./config.status}
17022
17023 echo creating $CONFIG_STATUS
17024 rm -f $CONFIG_STATUS
17025 cat > $CONFIG_STATUS <<EOF
17026 #! /bin/sh
17027 # Generated automatically by configure.
17028 # Run this file to recreate the current configuration.
17029 # This directory was configured as follows,
17030 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
17031 #
17032 # $0 $ac_configure_args
17033 #
17034 # Compiler output produced by configure, useful for debugging
17035 # configure, is in ./config.log if it exists.
17036
17037 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
17038 for ac_option
17039 do
17040   case "\$ac_option" in
17041   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17042     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
17043     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
17044   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
17045     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
17046     exit 0 ;;
17047   -help | --help | --hel | --he | --h)
17048     echo "\$ac_cs_usage"; exit 0 ;;
17049   *) echo "\$ac_cs_usage"; exit 1 ;;
17050   esac
17051 done
17052
17053 ac_given_srcdir=$srcdir
17054 ac_given_INSTALL="$INSTALL"
17055
17056 trap 'rm -fr `echo "\
17057 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17058 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17059 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17060 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17061 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17062 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17063 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17064 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17065 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17066 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17067 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17068 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17069 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17070 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17071 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17072 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17073 include/Makefile:build/top.mk:include/Makefile.in \
17074 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17075 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17076 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17077 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17078 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17079 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17080 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17081 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17082 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17083 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17084 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17085 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17086 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17087 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17088 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17089 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17090 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17091 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17092 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17093 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17094 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17095 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17096 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17097  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
17098 EOF
17099 cat >> $CONFIG_STATUS <<EOF
17100
17101 # Protect against being on the right side of a sed subst in config.status.
17102 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
17103  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
17104 $ac_vpsub
17105 $extrasub
17106 s%@SHELL@%$SHELL%g
17107 s%@CFLAGS@%$CFLAGS%g
17108 s%@CPPFLAGS@%$CPPFLAGS%g
17109 s%@CXXFLAGS@%$CXXFLAGS%g
17110 s%@FFLAGS@%$FFLAGS%g
17111 s%@DEFS@%$DEFS%g
17112 s%@LDFLAGS@%$LDFLAGS%g
17113 s%@LIBS@%$LIBS%g
17114 s%@exec_prefix@%$exec_prefix%g
17115 s%@prefix@%$prefix%g
17116 s%@program_transform_name@%$program_transform_name%g
17117 s%@bindir@%$bindir%g
17118 s%@sbindir@%$sbindir%g
17119 s%@libexecdir@%$libexecdir%g
17120 s%@datadir@%$datadir%g
17121 s%@sysconfdir@%$sysconfdir%g
17122 s%@sharedstatedir@%$sharedstatedir%g
17123 s%@localstatedir@%$localstatedir%g
17124 s%@libdir@%$libdir%g
17125 s%@includedir@%$includedir%g
17126 s%@oldincludedir@%$oldincludedir%g
17127 s%@infodir@%$infodir%g
17128 s%@mandir@%$mandir%g
17129 s%@host@%$host%g
17130 s%@host_alias@%$host_alias%g
17131 s%@host_cpu@%$host_cpu%g
17132 s%@host_vendor@%$host_vendor%g
17133 s%@host_os@%$host_os%g
17134 s%@target@%$target%g
17135 s%@target_alias@%$target_alias%g
17136 s%@target_cpu@%$target_cpu%g
17137 s%@target_vendor@%$target_vendor%g
17138 s%@target_os@%$target_os%g
17139 s%@build@%$build%g
17140 s%@build_alias@%$build_alias%g
17141 s%@build_cpu@%$build_cpu%g
17142 s%@build_vendor@%$build_vendor%g
17143 s%@build_os@%$build_os%g
17144 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
17145 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
17146 s%@INSTALL_DATA@%$INSTALL_DATA%g
17147 s%@PACKAGE@%$PACKAGE%g
17148 s%@VERSION@%$VERSION%g
17149 s%@ACLOCAL@%$ACLOCAL%g
17150 s%@AUTOCONF@%$AUTOCONF%g
17151 s%@AUTOMAKE@%$AUTOMAKE%g
17152 s%@AUTOHEADER@%$AUTOHEADER%g
17153 s%@MAKEINFO@%$MAKEINFO%g
17154 s%@install_sh@%$install_sh%g
17155 s%@AMTAR@%$AMTAR%g
17156 s%@AWK@%$AWK%g
17157 s%@AMTARFLAGS@%$AMTARFLAGS%g
17158 s%@SET_MAKE@%$SET_MAKE%g
17159 s%@top_builddir@%$top_builddir%g
17160 s%@ldap_subdir@%$ldap_subdir%g
17161 s%@CC@%$CC%g
17162 s%@RANLIB@%$RANLIB%g
17163 s%@LN_S@%$LN_S%g
17164 s%@DLLTOOL@%$DLLTOOL%g
17165 s%@AS@%$AS%g
17166 s%@OBJDUMP@%$OBJDUMP%g
17167 s%@LIBTOOL@%$LIBTOOL%g
17168 s%@LN_H@%$LN_H%g
17169 s%@SENDMAIL@%$SENDMAIL%g
17170 s%@EDITOR@%$EDITOR%g
17171 s%@FINGER@%$FINGER%g
17172 s%@CPP@%$CPP%g
17173 s%@EXEEXT@%$EXEEXT%g
17174 s%@OBJEXT@%$OBJEXT%g
17175 s%@OL_MKDEP@%$OL_MKDEP%g
17176 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
17177 s%@LIBOBJS@%$LIBOBJS%g
17178 s%@LIBSRCS@%$LIBSRCS%g
17179 s%@PLAT@%$PLAT%g
17180 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
17181 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
17182 s%@DYN_EXT@%$DYN_EXT%g
17183 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
17184 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
17185 s%@BUILD_LDAP@%$BUILD_LDAP%g
17186 s%@BUILD_LDBM@%$BUILD_LDBM%g
17187 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
17188 s%@BUILD_SHELL@%$BUILD_SHELL%g
17189 s%@BUILD_SQL@%$BUILD_SQL%g
17190 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
17191 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
17192 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
17193 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
17194 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
17195 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
17196 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
17197 s%@LDAP_LIBS@%$LDAP_LIBS%g
17198 s%@LDIF_LIBS@%$LDIF_LIBS%g
17199 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
17200 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
17201 s%@LDBM_LIBS@%$LDBM_LIBS%g
17202 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
17203 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
17204 s%@WRAP_LIBS@%$WRAP_LIBS%g
17205 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
17206 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
17207 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
17208 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
17209 s%@KRB4_LIBS@%$KRB4_LIBS%g
17210 s%@KRB5_LIBS@%$KRB5_LIBS%g
17211 s%@READLINE_LIBS@%$READLINE_LIBS%g
17212 s%@SASL_LIBS@%$SASL_LIBS%g
17213 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
17214 s%@TLS_LIBS@%$TLS_LIBS%g
17215 s%@MODULES_LIBS@%$MODULES_LIBS%g
17216 s%@AUTH_LIBS@%$AUTH_LIBS%g
17217 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
17218 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
17219 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
17220
17221 CEOF
17222 EOF
17223
17224 cat >> $CONFIG_STATUS <<\EOF
17225
17226 # Split the substitutions into bite-sized pieces for seds with
17227 # small command number limits, like on Digital OSF/1 and HP-UX.
17228 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
17229 ac_file=1 # Number of current file.
17230 ac_beg=1 # First line for current file.
17231 ac_end=$ac_max_sed_cmds # Line after last line for current file.
17232 ac_more_lines=:
17233 ac_sed_cmds=""
17234 while $ac_more_lines; do
17235   if test $ac_beg -gt 1; then
17236     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
17237   else
17238     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
17239   fi
17240   if test ! -s conftest.s$ac_file; then
17241     ac_more_lines=false
17242     rm -f conftest.s$ac_file
17243   else
17244     if test -z "$ac_sed_cmds"; then
17245       ac_sed_cmds="sed -f conftest.s$ac_file"
17246     else
17247       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
17248     fi
17249     ac_file=`expr $ac_file + 1`
17250     ac_beg=$ac_end
17251     ac_end=`expr $ac_end + $ac_max_sed_cmds`
17252   fi
17253 done
17254 if test -z "$ac_sed_cmds"; then
17255   ac_sed_cmds=cat
17256 fi
17257 EOF
17258
17259 cat >> $CONFIG_STATUS <<EOF
17260
17261 CONFIG_FILES=\${CONFIG_FILES-"\
17262 Makefile:build/top.mk:Makefile.in:build/dir.mk \
17263 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
17264 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
17265 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
17266 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
17267 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
17268 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
17269 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
17270 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
17271 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
17272 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
17273 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
17274 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
17275 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
17276 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
17277 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
17278 include/Makefile:build/top.mk:include/Makefile.in \
17279 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
17280 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
17281 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17282 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
17283 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
17284 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
17285 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
17286 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
17287 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
17288 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
17289 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
17290 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
17291 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
17292 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
17293 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
17294 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
17295 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
17296 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
17297 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
17298 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
17299 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
17300 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
17301 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
17302 "}
17303 EOF
17304 cat >> $CONFIG_STATUS <<\EOF
17305 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
17306   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17307   case "$ac_file" in
17308   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17309        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17310   *) ac_file_in="${ac_file}.in" ;;
17311   esac
17312
17313   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
17314
17315   # Remove last slash and all that follows it.  Not all systems have dirname.
17316   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17317   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17318     # The file is in a subdirectory.
17319     test ! -d "$ac_dir" && mkdir "$ac_dir"
17320     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
17321     # A "../" for each directory in $ac_dir_suffix.
17322     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
17323   else
17324     ac_dir_suffix= ac_dots=
17325   fi
17326
17327   case "$ac_given_srcdir" in
17328   .)  srcdir=.
17329       if test -z "$ac_dots"; then top_srcdir=.
17330       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
17331   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
17332   *) # Relative path.
17333     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
17334     top_srcdir="$ac_dots$ac_given_srcdir" ;;
17335   esac
17336
17337   case "$ac_given_INSTALL" in
17338   [/$]*) INSTALL="$ac_given_INSTALL" ;;
17339   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
17340   esac
17341
17342   echo creating "$ac_file"
17343   rm -f "$ac_file"
17344   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
17345   case "$ac_file" in
17346   *[Mm]akefile*) ac_comsub="1i\\
17347 # $configure_input" ;;
17348   *) ac_comsub= ;;
17349   esac
17350
17351   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17352   sed -e "$ac_comsub
17353 s%@configure_input@%$configure_input%g
17354 s%@srcdir@%$srcdir%g
17355 s%@top_srcdir@%$top_srcdir%g
17356 s%@INSTALL@%$INSTALL%g
17357 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
17358 fi; done
17359 rm -f conftest.s*
17360
17361 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17362 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17363 #
17364 # ac_d sets the value in "#define NAME VALUE" lines.
17365 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17366 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
17367 ac_dC='\3'
17368 ac_dD='%g'
17369 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17370 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17371 ac_uB='\([      ]\)%\1#\2define\3'
17372 ac_uC=' '
17373 ac_uD='\4%g'
17374 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17375 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17376 ac_eB='$%\1#\2define\3'
17377 ac_eC=' '
17378 ac_eD='%g'
17379
17380 if test "${CONFIG_HEADERS+set}" != set; then
17381 EOF
17382 cat >> $CONFIG_STATUS <<EOF
17383   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
17384 EOF
17385 cat >> $CONFIG_STATUS <<\EOF
17386 fi
17387 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
17388   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17389   case "$ac_file" in
17390   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
17391        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
17392   *) ac_file_in="${ac_file}.in" ;;
17393   esac
17394
17395   echo creating $ac_file
17396
17397   rm -f conftest.frag conftest.in conftest.out
17398   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
17399   cat $ac_file_inputs > conftest.in
17400
17401 EOF
17402
17403 # Transform confdefs.h into a sed script conftest.vals that substitutes
17404 # the proper values into config.h.in to produce config.h.  And first:
17405 # Protect against being on the right side of a sed subst in config.status.
17406 # Protect against being in an unquoted here document in config.status.
17407 rm -f conftest.vals
17408 cat > conftest.hdr <<\EOF
17409 s/[\\&%]/\\&/g
17410 s%[\\$`]%\\&%g
17411 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
17412 s%ac_d%ac_u%gp
17413 s%ac_u%ac_e%gp
17414 EOF
17415 sed -n -f conftest.hdr confdefs.h > conftest.vals
17416 rm -f conftest.hdr
17417
17418 # This sed command replaces #undef with comments.  This is necessary, for
17419 # example, in the case of _POSIX_SOURCE, which is predefined and required
17420 # on some systems where configure will not decide to define it.
17421 cat >> conftest.vals <<\EOF
17422 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
17423 EOF
17424
17425 # Break up conftest.vals because some shells have a limit on
17426 # the size of here documents, and old seds have small limits too.
17427
17428 rm -f conftest.tail
17429 while :
17430 do
17431   ac_lines=`grep -c . conftest.vals`
17432   # grep -c gives empty output for an empty file on some AIX systems.
17433   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
17434   # Write a limited-size here document to conftest.frag.
17435   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
17436   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
17437   echo 'CEOF
17438   sed -f conftest.frag conftest.in > conftest.out
17439   rm -f conftest.in
17440   mv conftest.out conftest.in
17441 ' >> $CONFIG_STATUS
17442   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17443   rm -f conftest.vals
17444   mv conftest.tail conftest.vals
17445 done
17446 rm -f conftest.vals
17447
17448 cat >> $CONFIG_STATUS <<\EOF
17449   rm -f conftest.frag conftest.h
17450   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
17451   cat conftest.in >> conftest.h
17452   rm -f conftest.in
17453   if cmp -s $ac_file conftest.h 2>/dev/null; then
17454     echo "$ac_file is unchanged"
17455     rm -f conftest.h
17456   else
17457     # Remove last slash and all that follows it.  Not all systems have dirname.
17458       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
17459       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17460       # The file is in a subdirectory.
17461       test ! -d "$ac_dir" && mkdir "$ac_dir"
17462     fi
17463     rm -f $ac_file
17464     mv conftest.h $ac_file
17465   fi
17466 fi; done
17467
17468 EOF
17469 cat >> $CONFIG_STATUS <<EOF
17470
17471 EOF
17472 cat >> $CONFIG_STATUS <<\EOF
17473
17474 date > stamp-h
17475 echo Please \"make depend\" to build dependencies
17476
17477 exit 0
17478 EOF
17479 chmod +x $CONFIG_STATUS
17480 rm -fr confdefs* $ac_clean_files
17481 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
17482